mimmo::IOConnections_MIMMO Class Reference

IOConnections_MIMMO is a class to read/write mimmo pin connections from XML IO/parser defined in bitpit::Config. More...

#include <IOConnections.hpp>

Public Member Functions

 IOConnections_MIMMO (const IOConnections_MIMMO &other)
 
 IOConnections_MIMMO (std::unordered_map< std::string, BaseManipulation * > mapConn)
 
virtual ~IOConnections_MIMMO ()
 
void absorbConnections (const bitpit::Config &slotXML, bool debug=false)
 
void flushConnections (bitpit::Config &slotXML, bool debug=false)
 

Protected Attributes

std::unordered_map< BaseManipulation *, std::string > m_invMapConn
 
bitpit::Logger * m_log
 
std::unordered_map< std::string, BaseManipulation * > m_mapConn
 

Detailed Description

IOConnections_MIMMO is a class to read/write mimmo pin connections from XML IO/parser defined in bitpit::Config.

Read and write declared connections from/to an external input/output XML configuration file. Needs to be constructed with an external map reporting a string with "name of the object in XML file" as key, and a "BaseManipulation pointer" of all the object instantiated and connectable as argument. Search the right couple of object to connect and connects them, in input mode, or write existing connections in output mode.

In the XML interface a connection between two executable blocks must be declared following the nomenclature:

< name_of_connection>
   <sender> name of the sender </sender>
   <senderPort> type of the sender Port </senderPort>
   <receiver> name of the receiver </receiver>
   <receiverPort> name of the receiver Port </receiverPort>
</name_of_connection>

Multiple connections are declared repeating this block format as many times as necessary

Definition at line 53 of file IOConnections.hpp.

Constructor & Destructor Documentation

◆ IOConnections_MIMMO() [1/2]

mimmo::IOConnections_MIMMO::IOConnections_MIMMO ( std::unordered_map< std::string, BaseManipulation * >  mapConn)

Default constructor of IOConnections_MIMMO. Needs a map of executable objects actually instantiated externally, with a string identifying the object. Such strings identifies the object in the XML section from/to which reading/writing also. When builds itself, the class evaluates the inverse map of executable objects and compile the maps of PortType-s actually available in the API.

Parameters
[in]mapConnmap of instantiated connectable objects with their XML names as keys.

Definition at line 37 of file IOConnections.cpp.

◆ ~IOConnections_MIMMO()

mimmo::IOConnections_MIMMO::~IOConnections_MIMMO ( )
virtual

Default destructor

Definition at line 51 of file IOConnections.cpp.

◆ IOConnections_MIMMO() [2/2]

mimmo::IOConnections_MIMMO::IOConnections_MIMMO ( const IOConnections_MIMMO other)

Copy constructor

Definition at line 56 of file IOConnections.cpp.

Member Function Documentation

◆ absorbConnections()

void mimmo::IOConnections_MIMMO::absorbConnections ( const bitpit::Config &  slotXML,
bool  debug = false 
)

Reading declared connections from a bitpit XML slot Configuration Section and apply them. Map of instantiated objects helps class to recognize which objects are already istantiated and ready to be eventually connected. If the objects map reports a not instantiated object, connection will be refused. The same applies for not existent or not compatible kind of connection ports, declared in the XML section. The method is meant to read connections from xml file.

Parameters
[in]slotXMLConfig::Section from which read infos.
[in]debugtrue, activate verbose debug mode. Default option false.

Definition at line 73 of file IOConnections.cpp.

◆ flushConnections()

void mimmo::IOConnections_MIMMO::flushConnections ( bitpit::Config &  slotXML,
bool  debug = false 
)

Write declared connections to a bitpit XML slot Configuration Section. The map of instantiated objects helps class to recognize which objects are are connected and compile correctly their xml field. If the objects map reports a not instantiated object, connection will be refused and not written. The same applies for not existent or not compatible kind of connection ports. The method is meant to write connections to a xml file.

Parameters
[in]slotXMLConfig::Section to which write infos.
[in]debugtrue, activate verbose debug mode. Default option false.

Definition at line 159 of file IOConnections.cpp.

Member Data Documentation

◆ m_invMapConn

std::unordered_map<BaseManipulation *, std::string > mimmo::IOConnections_MIMMO::m_invMapConn
protected

inverse map of connectable object

Definition at line 57 of file IOConnections.hpp.

◆ m_log

bitpit::Logger* mimmo::IOConnections_MIMMO::m_log
protected

Pointer to logger.

Definition at line 59 of file IOConnections.hpp.

◆ m_mapConn

std::unordered_map<std::string, BaseManipulation * > mimmo::IOConnections_MIMMO::m_mapConn
protected

direct map of connectable object

Definition at line 56 of file IOConnections.hpp.


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