n3rv::topology

class n3rv::topology

This class is meant to store and manimulate topology representations, in order to help services dynamically know which endpoints to bind or contact.

Public Functions

std::string n3rv::topologyserialize()

Serializes current topology object to a JSON-string

Return
JSON-serialized topology object.

n3rv::topologytopology()

class constructor

n3rv::topology~topology()

class destructor

Public Members

std::map<std::string, jservice_class> n3rv::topologysvclasses

Map of available service classes inside topology.

Public Static Functions

topology *n3rv::topologyload(std::string topology_file)

Loads a topology from a JSON-formatted topology file.

Return
a topology object.
Parameters
  • topology_file: Path of the topology file to load.

topology *n3rv::topologyparse(std::string &topology_def)

Parses a JSON-formatted string into a topology object.

Return
a topology object.
Parameters
  • topology_def: JSON-serialized Topology String.

struct n3rv::jservice_class_

service_class struc allows to describe a full service class, with all its binding, connections and callback fucntions.

Public Members

std::string n3rv::jservice_class_namespace_

Namespace of the service class.

std::vector<jbinding> n3rv::jservice_class_bindings

List of bindings the service class must create.

std::vector<jconnection> n3rv::jservice_class_connections

List of connections to remote endpoints a service class must establish.

std::vector<jcallback> n3rv::jservice_class_receive_callbacks

List of [connection, callback] attacchements, which declare how to process messages.

std::vector<jcallback> n3rv::jservice_class_ml_callbacks

List of callbacks to run inside the service main loop.