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, InfoPort > | mapRegisteredPorts () |
Static Public Member Functions | |
static PortManager & | instance () |
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()
|
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] name name of the port [in] container_name name of the container associated to the port [in] datatype_name name of the datatype associated to the port [in] fileregistration name of the file/location
- Returns
- current id of port registered in the list
Definition at line 99 of file portManager.hpp.
◆ containsContainer()
|
inline |
Check if a container name is already registered
- Parameters
-
[in] name name of the container
- Returns
- true if the container already exists
Definition at line 148 of file portManager.hpp.
◆ containsDatatype()
|
inline |
Check if a data type name is already registered
- Parameters
-
[in] name name of the datatype
- Returns
- true if the datatype already exists
Definition at line 156 of file portManager.hpp.
◆ containsPort()
|
inline |
Check if a port name is already registered
- Parameters
-
[in] name name of the port
- Returns
- true if the port already exists
Definition at line 140 of file portManager.hpp.
◆ getPortData()
|
inline |
Return data attached to a Port in a InfoData struct
- Parameters
-
[in] name of the Port
- Returns
- copy of InfoData struct associated to the Port
Definition at line 183 of file portManager.hpp.
◆ instance()
|
inlinestatic |
Instance the singleton
Definition at line 85 of file portManager.hpp.
◆ mapRegisteredContainers()
|
inline |
- Returns
- the whole list of registered containers for ports
Definition at line 168 of file portManager.hpp.
◆ mapRegisteredDataTypes()
|
inline |
- Returns
- the whole list of registered datatypes for ports
Definition at line 174 of file portManager.hpp.
◆ 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:
- src/common/portManager.hpp