Struct Status

Struct Documentation

struct Status

Result of one or several graph operations

Ctors and dtors.

Status(Code code, std::string message)

Construct a Status.

Parameters
  • code: status code

  • message: message for humans

Status()

Public Types

enum Code

Operation status code

Values:

ok_code = 0
not_implemented_code = -1
missing_vertex_code = -2
invalid_edge_code = -3
missing_edge_code = -4

Public Functions

bool operator!() const

Negation operator

Return

true if status is not Code::ok_code, false otherwise

operator bool() const

Implicit conversion operator

Return

true if status is Code::ok_code, false otherwise

const Status &raise_on_error() const

Return

this instance if member does not throw

Exceptions
  • std::runtime_error: whenever status is not Code::ok_code.

Public Members

const Code code

status code

const std::string message

status message for humans

Public Static Functions

static const Status &error_not_implemented()

Construct a Status.

Return

A status representing a not implemented state

static Status error_missing_vertex(const vertex_uid_t &vertex)

Construct a Status.

Return

A status representing a missing vertex

Parameters
  • vertex: The missing vertex

static Status error_missing_edge(const edge_uid_t &edge)

Construct a Status.

Return

A Status representing the missing edge

Parameters
  • edge: The missing edge

static Status error_invalid_edge(const vertex_uid_t &vertex1, const vertex_uid_t &vertex2)

Construct a Status.

Return

A status representing a invalid edge between 2 vertices

Parameters
  • vertex1: one end of an edge

  • vertex2: other end of the edge

static const Status &ok()

Create Status.

Return

A status representing a situation where everything is alright.