Basic singleton for managing Ports declaration in mimmo. More...

#include <portManager.hpp>

Public Member Functions

long addPort (const std::string name, const std::string container_name, const std::string datatype_name, const std::string fileregistration)
 
bool containsContainer (const std::string name)
 
bool containsDatatype (const std::string name)
 
bool containsPort (const std::string name)
 
InfoPort getPortData (const std::string name)
 
std::unordered_map< std::string, long > mapRegisteredContainers ()
 
std::unordered_map< std::string, long > mapRegisteredDataTypes ()
 
std::unordered_map< std::string, InfoPortmapRegisteredPorts ()
 

Static Public Member Functions

static PortManagerinstance ()
 

Detailed Description

Basic singleton for managing Ports declaration in mimmo.

PortManager is the reference singleton to declare and store ports of mimmo, together with their containers and data types. PortManager can be "extended", that is more ports, containers and data type can be added, once mimmo is already built. PortManager contains utilities to manage the ports addition.

Definition at line 71 of file portManager.hpp.

Member Function Documentation

◆ addPort()

long mimmo::PortManager::addPort ( const std::string  name,
const std::string  container_name,
const std::string  datatype_name,
const std::string  fileregistration 
)
inline

Add a port to registered list. Beware: eventual compatibility between mimmo ports is verified assuring that they are sharing the same type of container and data. So be careful in the choice of names for container and datatype of a port.

Parameters
[in]namename of the port
[in]container_namename of the container associated to the port
[in]datatype_namename of the datatype associated to the port
[in]fileregistrationname of the file/location
Returns
current id of port registered in the list

Definition at line 99 of file portManager.hpp.

◆ containsContainer()

bool mimmo::PortManager::containsContainer ( const std::string  name)
inline

Check if a container name is already registered

Parameters
[in]namename of the container
Returns
true if the container already exists

Definition at line 148 of file portManager.hpp.

◆ containsDatatype()

bool mimmo::PortManager::containsDatatype ( const std::string  name)
inline

Check if a data type name is already registered

Parameters
[in]namename of the datatype
Returns
true if the datatype already exists

Definition at line 156 of file portManager.hpp.

◆ containsPort()

bool mimmo::PortManager::containsPort ( const std::string  name)
inline

Check if a port name is already registered

Parameters
[in]namename of the port
Returns
true if the port already exists

Definition at line 140 of file portManager.hpp.

◆ getPortData()

InfoPort mimmo::PortManager::getPortData ( const std::string  name)
inline

Return data attached to a Port in a InfoData struct

Parameters
[in]nameof the Port
Returns
copy of InfoData struct associated to the Port

Definition at line 183 of file portManager.hpp.

◆ instance()

static PortManager& mimmo::PortManager::instance ( )
inlinestatic

Instance the singleton

Definition at line 85 of file portManager.hpp.

◆ mapRegisteredContainers()

std::unordered_map<std::string, long> mimmo::PortManager::mapRegisteredContainers ( )
inline
Returns
the whole list of registered containers for ports

Definition at line 168 of file portManager.hpp.

◆ mapRegisteredDataTypes()

std::unordered_map<std::string, long> mimmo::PortManager::mapRegisteredDataTypes ( )
inline
Returns
the whole list of registered datatypes for ports

Definition at line 174 of file portManager.hpp.

◆ mapRegisteredPorts()

std::unordered_map<std::string, InfoPort> mimmo::PortManager::mapRegisteredPorts ( )
inline
Returns
the whole list of registered ports

Definition at line 162 of file portManager.hpp.


The documentation for this class was generated from the following file: