PhoenixSwarm  5.1.1
Library to ease communication between daemons
Loading...
Searching...
No Matches
TestBaseDaemon Class Reference

Test Daemon. More...

+ Inheritance diagram for TestBaseDaemon:
+ Collaboration diagram for TestBaseDaemon:

Public Member Functions

template<typename _Callable>
bool addCallableMethod (_Callable &&function, const PString &name)
 Add a callable method of the Daemon.
 
virtual void addCallMethod ()
 Do the addCallableMethod here.
 
template<typename _Class, typename _Data>
bool addDataCallableMethod (PUncastableBool(&function)(_Class &, const _Data &), _Class &persistentData, size_t nbBin, float histLowerBound, float histUpperBound)
 Add a callable method of the Daemon.
 
template<typename _Data>
bool addDataCallableMethod (PUncastableBool(&function)(const _Data &), size_t nbBin, float histLowerBound, float histUpperBound)
 Add a callable method of the Daemon.
 
void addMessageToConfirm (const Swarm::Message &message)
 Add a message to confirm.
 
bool callMethod (Swarm::Data &result, const PString &name, const Swarm::Data &parameter)
 Call an added callable method by name.
 
void checkMessageTimeout (time_t currentTime)
 Check if a message has reached the timeout.
 
void clearCallableMethod ()
 Clear the map of callable methods.
 
void clearStat ()
 Clear all the statistics of the daemon.
 
StatAccumulator createNewStat (size_t nbBin, float histLowerBound, float histUpperBound)
 Create a new clear computing statistic.
 
virtual bool extraLoad (const ConfigNode *config)
 Extra call on load for the current Daemon.
 
void fillDaemonStat (Swarm::Stat &stat, time_t startTimestamp, time_t endTimestamp)
 Fill the Stat with the current statistics of the daemon.
 
VecStat fillVecStat (const Swarm::StatAccumulator &accumulator, time_t startTimestamp, time_t endTimestamp)
 Fill a VecStat from a StatAccumulator to send to the DamonStat.
 
DaemonConfiggetConfig ()
 Get the configuration of the current BaseDaemon.
 
Swarm::AbstractDataFunctiongetDataFunction (const Swarm::Data &data)
 Get the data function associated with the given data.
 
PLog & getLog ()
 Get the log of the current BaseDaemon.
 
PLog & getLogger ()
 Get the logger of the current BaseDaemon.
 
DaemonMainConfiggetMainConfig ()
 Get the main configuration of the swarm.
 
MapDaemonConfiggetMapDaemonConfig ()
 Get the map of all Daemon configurations.
 
const std::map< size_t, Swarm::Message > & getMapMessageToBeConfirmed () const
 Get the map of message to be confirmed.
 
size_t getMessageId ()
 Get current message id.
 
bool getMessageToConfirm (Swarm::Message &message, size_t id) const
 Get a message to confirm by id if it exists.
 
OptionParser & getOptionParser ()
 Return the OptionParser of the current BaseDaemon.
 
bool isDaemonExist (const PString &name) const
 Say if a neighbour Daemon does exist.
 
bool load (const PPath &fileName, const PString &daemonName)
 Load the Toml configuration which define all BaseDaemons of the Swarm.
 
bool load (const PString &configFileContent, const PString &daemonName, ConfigFormat::ConfigFormat format)
 Load the Json configuration which define all BaseDaemons of the Swarm.
 
void loadConfigFromNode (const ConfigNode &dico, const PString &daemonName)
 Load configuration form a node of ConfigNode.
 
bool parseArgument (int argc, char **argv)
 Parse arguments given to the BaseDaemon with command line.
 
void processConfirmedMessage (size_t id, time_t currentTime)
 Process confirmed message.
 
bool processData (const Swarm::Data &data)
 Process given data with the proper method.
 
void stop ()
 Stops the BaseDaemon.
 
void updateStatAccumulator (StatAccumulator &stat, float value)
 Update a computing statistic with a new value.
 

Protected Attributes

DaemonConfig p_config
 Configuration of the curent Daemon.
 
bool p_isFullMock
 True if the daemon has to be executed in mock mode for socket and clock.
 
bool p_isFullMockRecord
 True if the daemon has to be executed in mock record mode for socket and clock.
 
bool p_isRun
 True if the current BaseDaemon is running.
 
PLog p_log
 Logger of the current Daemon.
 
DaemonMainConfig p_mainConfig
 Main configuration of the Daemon.
 
MapDaemonConfig p_mapDaemon
 Map of the other Daemon of the Swarm.
 

Private Member Functions

std::map< PString, StatAccumulatorcreateNewCommunicationStatMap (const PString &dataType, size_t nbBin, float histLowerBound, float histUpperBound)
 Create a new map of communication statistic.
 
void getCommunicationStat (const PString &destName, const PString &dataType, float latency, size_t nbBin, float histLowerBound, float histUpperBound)
 Add a communication statistic.
 
void initialisationBaseDaemon ()
 Initialisation function of the class BaseDaemon.
 

Private Attributes

std::map< PString, Swarm::AbstractFunction * > p_mapCallableMethod
 Map of callable method of the Daemon.
 
std::map< PString, Swarm::AbstractDataFunction * > p_mapDataFunction
 Map of methods which have to be called when receiving data.
 
std::map< size_t, Swarm::Messagep_mapMessageToBeConfirmed
 Map of messages which have to be confirmed by destination Daemon.
 
size_t p_messageId
 Id counter of the message of the current Daemon.
 
OptionParser p_optionParser
 Option parser of the Daemon.
 

Detailed Description

Test Daemon.

Definition at line 321 of file main.cpp.

Member Function Documentation

◆ addCallableMethod()

template<typename _Callable>
bool Swarm::BaseDaemon::addCallableMethod ( _Callable && function,
const PString & name )
inlineinherited

Add a callable method of the Daemon.

Parameters
function: method to be added
name: name of the method which can be called
Returns
true on success, false otherwise

Definition at line 73 of file BaseDaemon.h.

73 {
74 std::map<PString, AbstractFunction*>::iterator it(p_mapCallableMethod.find(name));
75 if(it != p_mapCallableMethod.end()){
76 getLog().getLogError() << "BaseDaemon::addCallableMethod : function '"<<name<<"' already added" << std::endl;
77 return false;
78 }
79 p_mapCallableMethod[name] = new FunctionCall(function, name);
80 return true;
81 }
std::map< PString, Swarm::AbstractFunction * > p_mapCallableMethod
Map of callable method of the Daemon.
Definition BaseDaemon.h:182
PLog & getLog()
Get the log of the current BaseDaemon.

References getLog(), and p_mapCallableMethod.

+ Here is the call graph for this function:

◆ addCallMethod()

void BaseDaemon::addCallMethod ( )
virtualinherited

Do the addCallableMethod here.

Reimplemented in Swarm::Monitoring< _TBackend >.

Definition at line 113 of file BaseDaemon.cpp.

113 {
114 if(p_log.isOpen()){
115 p_log.getLogWarning() << "BaseDaemon::addCallMethod : no redefined addCallMethod " << std::endl;
116 }else{
117 std::cerr << "BaseDaemon::addCallMethod : no redefined addCallMethod (and no log file so we use std::cerr)" << std::endl;
118 }
119}
PLog p_log
Logger of the current Daemon.
Definition BaseDaemon.h:166

References p_log.

Referenced by loadConfigFromNode().

+ Here is the caller graph for this function:

◆ addDataCallableMethod() [1/2]

template<typename _Class, typename _Data>
bool Swarm::BaseDaemon::addDataCallableMethod ( PUncastableBool(&)(_Class &, const _Data &) function,
_Class & persistentData,
size_t nbBin,
float histLowerBound,
float histUpperBound )
inlineinherited

Add a callable method of the Daemon.

Parameters
function: method to be added
persistentData: data used each time the method is called
nbBin: number of bin in the histogram
histLowerBound: lower bound of the histogram
histUpperBound: upper bound of the histogram
Returns
true on success, false otherwise

Definition at line 128 of file BaseDaemon.h.

128 {
129 PString prototype(phoenix_getTypeToStr<_Data>());
130 std::cout << "BaseDaemon::addDataCallableMethod : prototype = " << prototype << std::endl;
131 std::map<PString, Swarm::AbstractDataFunction*>::iterator it(p_mapDataFunction.find(prototype));
132 if(it != p_mapDataFunction.end()){
133 getLog().getLogError() << "BaseDaemon::addDataCallableMethod : function to process data '"<<prototype<<"' already added" << std::endl;
134 return false;
135 }
136 getLog().getLogDebug() << "BaseDaemon::addDataCallableMethod : add method to process data '"<<prototype<<"'" << std::endl;
137 p_mapDataFunction[prototype] = new Swarm::DataFunctionClassCall(function, persistentData, prototype);
138 p_config.getDaemonStatAccumulator().getMapStatComputing()[prototype] = createNewStat(nbBin, histLowerBound, histUpperBound);
139 return true;
140 }
std::map< PString, Swarm::AbstractDataFunction * > p_mapDataFunction
Map of methods which have to be called when receiving data.
Definition BaseDaemon.h:189
StatAccumulator createNewStat(size_t nbBin, float histLowerBound, float histUpperBound)
Create a new clear computing statistic.
DaemonConfig p_config
Configuration of the curent Daemon.
Definition BaseDaemon.h:162

References createNewStat(), getLog(), p_config, and p_mapDataFunction.

+ Here is the call graph for this function:

◆ addDataCallableMethod() [2/2]

template<typename _Data>
bool Swarm::BaseDaemon::addDataCallableMethod ( PUncastableBool(&)(const _Data &) function,
size_t nbBin,
float histLowerBound,
float histUpperBound )
inlineinherited

Add a callable method of the Daemon.

Parameters
function: method to be added
nbBin: number of bin in the histogram
histLowerBound: lower bound of the histogram
histUpperBound: upper bound of the histogram
Returns
true on success, false otherwise

Definition at line 105 of file BaseDaemon.h.

105 {
106 PString prototype(phoenix_getTypeToStr<_Data>());
107 std::cout << "BaseDaemon::addDataCallableMethod : prototype = " << prototype << std::endl;
108 std::map<PString, Swarm::AbstractDataFunction*>::iterator it(p_mapDataFunction.find(prototype));
109 if(it != p_mapDataFunction.end()){
110 getLog().getLogError() << "BaseDaemon::addDataCallableMethod : function to process data '"<<prototype<<"' already added" << std::endl;
111 return false;
112 }
113 getLog().getLogDebug() << "BaseDaemon::addDataCallableMethod : add method to process data '"<<prototype<<"'" << std::endl;
114 p_mapDataFunction[prototype] = new Swarm::DataFunctionCall(function, prototype);
115 p_config.getDaemonStatAccumulator().getMapStatComputing()[prototype] = createNewStat(nbBin, histLowerBound, histUpperBound);
116 return true;
117 }

References createNewStat(), getLog(), p_config, and p_mapDataFunction.

Referenced by Swarm::Monitoring< _TBackend >::addCallMethod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addMessageToConfirm()

void BaseDaemon::addMessageToConfirm ( const Swarm::Message & message)
inherited

Add a message to confirm.

Parameters
message: message to be added

Definition at line 186 of file BaseDaemon.cpp.

186 {
187 p_mapMessageToBeConfirmed[message.getId()] = message;
188}
std::map< size_t, Swarm::Message > p_mapMessageToBeConfirmed
Map of messages which have to be confirmed by destination Daemon.
Definition BaseDaemon.h:184
size_t getId() const
Gets the id of the Message.

References Swarm::Message::getId(), and p_mapMessageToBeConfirmed.

Referenced by Swarm::Daemon< _TBackend >::sendMessage(), testBaseDaemonGetMessageToConfirm(), and testBaseDaemonProcessConfirmedMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ callMethod()

bool BaseDaemon::callMethod ( Swarm::Data & result,
const PString & name,
const Swarm::Data & parameter )
inherited

Call an added callable method by name.

Parameters
[out]result: result of the call
name: name of the method
parameter: parameters of the call
Returns
true on success, false otherwise

Definition at line 127 of file BaseDaemon.cpp.

127 {
128 std::map<PString, AbstractFunction*>::iterator it(p_mapCallableMethod.find(name));
129 if(it == p_mapCallableMethod.end()){
130 getLog().getLogError() << "BaseDaemon::callMethod : function '"<<name<<"' not found" << std::endl;
131 return false;
132 }
133 return p_mapCallableMethod[name]->call(p_log, result, parameter);
134}

References getLog(), p_log, and p_mapCallableMethod.

+ Here is the call graph for this function:

◆ checkMessageTimeout()

void BaseDaemon::checkMessageTimeout ( time_t currentTime)
inherited

Check if a message has reached the timeout.

Parameters
currentTime: current time

Definition at line 229 of file BaseDaemon.cpp.

229 {
230 std::vector<size_t> messagesToRemove;
231 for(auto it = p_mapMessageToBeConfirmed.begin(); it != p_mapMessageToBeConfirmed.end(); ++it){
232 const size_t & messageId = it->first;
233 const Message & message = it->second;
234 time_t elapsedTime = currentTime - message.getSendTime();
235 if(message.getVecRecver().size() == 0lu){
236 getLog().getLogError() << "BaseDaemon::checkMessageTimeout() : message " << messageId << " has no receiver." << std::endl;
237 continue;
238 }
239 std::map<PString, time_t>::const_iterator timeoutIt = p_config.getMapTimeout().find(message.getVecRecver().front());
240 if(timeoutIt == p_config.getMapTimeout().end()){
241 getLog().getLogError() << "BaseDaemon::checkMessageTimeout() : no timeout found for receiver '" << message.getVecRecver().front() << "' of message " << messageId << "." << std::endl;
242 continue;
243 }
244 time_t timeout = timeoutIt->second;
245 phoenix_assert(message.getVecRecver().size() != 0lu);
246 if (elapsedTime > timeout) {
247 messagesToRemove.push_back(messageId);
248 getLog().getLogWarning() << "BaseDaemon::checkMessageTimeout() : Timeout Reached for message " << messageId << " sent to '" << message.getVecRecver().front() << "'. Removing unconfirmed transaction" << std::endl;
249 }
250 }
251 for(const size_t & messageId : messagesToRemove){
252 p_mapMessageToBeConfirmed.erase(messageId);
253 }
254}
const std::vector< PString > & getVecRecver() const
Gets the vecRecver of the Message.
const time_t & getSendTime() const
Gets the sendTime of the Message.

References getLog(), Swarm::Message::getSendTime(), Swarm::Message::getVecRecver(), p_config, and p_mapMessageToBeConfirmed.

Referenced by Swarm::Daemon< _TBackend >::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearCallableMethod()

void BaseDaemon::clearCallableMethod ( )
inherited

Clear the map of callable methods.

Definition at line 137 of file BaseDaemon.cpp.

137 {
138 for(std::map<PString, AbstractFunction*>::iterator it(p_mapCallableMethod.begin()); it != p_mapCallableMethod.end(); ++it){
139 delete it->second;
140 }
141 p_mapCallableMethod.clear();
142}

References p_mapCallableMethod.

Referenced by ~BaseDaemon().

+ Here is the caller graph for this function:

◆ clearStat()

void BaseDaemon::clearStat ( )
inherited

Clear all the statistics of the daemon.

Definition at line 355 of file BaseDaemon.cpp.

355 {
356 for(MapStatAccumulator::iterator it = p_config.getDaemonStatAccumulator().getMapStatComputing().begin(); it != p_config.getDaemonStatAccumulator().getMapStatComputing().end(); ++it){
357 it->second.setNbEvent(0lu);
358 std::fill(it->second.getVecHistogram().begin(), it->second.getVecHistogram().end(), 0lu);
359 }
360 for(MapDaemonStatAccumulator::iterator itMap = p_config.getDaemonStatAccumulator().getMapStatCommunication().begin(); itMap != p_config.getDaemonStatAccumulator().getMapStatCommunication().end(); ++itMap){
361 for(MapStatAccumulator::iterator it = itMap->second.begin(); it != itMap->second.end(); ++it){
362 it->second.setNbEvent(0lu);
363 std::fill(it->second.getVecHistogram().begin(), it->second.getVecHistogram().end(), 0lu);
364 }
365 }
366}

References p_config.

Referenced by Swarm::Daemon< _TBackend >::sendStatToStatDaemon(), and testClearStatAccumulator().

+ Here is the caller graph for this function:

◆ createNewCommunicationStatMap()

std::map< PString, StatAccumulator > BaseDaemon::createNewCommunicationStatMap ( const PString & dataType,
size_t nbBin,
float histLowerBound,
float histUpperBound )
privateinherited

Create a new map of communication statistic.

Parameters
dataType: type of data which where pushed
nbBin: number of bin of the histogram
histLowerBound: lower bound of the histogram
histUpperBound: upper bound of the histogram
Returns
new map of communication statistic

Definition at line 417 of file BaseDaemon.cpp.

417 {
418 std::map<PString, StatAccumulator> newStatMap;
419 newStatMap[dataType] = createNewStat(nbBin, histLowerBound, histUpperBound);
420 return newStatMap;
421}

References createNewStat().

Referenced by getCommunicationStat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createNewStat()

StatAccumulator BaseDaemon::createNewStat ( size_t nbBin,
float histLowerBound,
float histUpperBound )
inherited

Create a new clear computing statistic.

Parameters
nbBin: number of bin of the histogram
histLowerBound: lower bound of the histogram
histUpperBound: upper bound of the histogram
Returns
new clear computing statistic

Definition at line 332 of file BaseDaemon.cpp.

332 {
333 StatAccumulator newStat;
334 newStat.setNbEvent(0lu);
335 newStat.setMin(std::nan(""));
336 newStat.setMax(std::nan(""));
337 newStat.setSum(std::nan(""));
338 newStat.setNbEventAboveUpperBound(0lu);
339 newStat.setNbEventBelowLowerBound(0lu);
340 newStat.setHistUpperBound(histUpperBound);
341 newStat.setHistLowerBound(histLowerBound);
342 newStat.setVecHistogram(std::vector<size_t>(nbBin, 0lu));
343 return newStat;
344}
void setMin(float min)
Sets the min of the StatAccumulator.
void setVecHistogram(const std::vector< size_t > &vecHistogram)
Sets the vecHistogram of the StatAccumulator.
void setHistUpperBound(float histUpperBound)
Sets the histUpperBound of the StatAccumulator.
void setMax(float max)
Sets the max of the StatAccumulator.
void setNbEventAboveUpperBound(size_t nbEventAboveUpperBound)
Sets the nbEventAboveUpperBound of the StatAccumulator.
void setHistLowerBound(float histLowerBound)
Sets the histLowerBound of the StatAccumulator.
void setNbEventBelowLowerBound(size_t nbEventBelowLowerBound)
Sets the nbEventBelowLowerBound of the StatAccumulator.
void setSum(float sum)
Sets the sum of the StatAccumulator.
void setNbEvent(size_t nbEvent)
Sets the nbEvent of the StatAccumulator.

References Swarm::StatAccumulator::setHistLowerBound(), Swarm::StatAccumulator::setHistUpperBound(), Swarm::StatAccumulator::setMax(), Swarm::StatAccumulator::setMin(), Swarm::StatAccumulator::setNbEvent(), Swarm::StatAccumulator::setNbEventAboveUpperBound(), Swarm::StatAccumulator::setNbEventBelowLowerBound(), Swarm::StatAccumulator::setSum(), and Swarm::StatAccumulator::setVecHistogram().

Referenced by addDataCallableMethod(), addDataCallableMethod(), createNewCommunicationStatMap(), and getCommunicationStat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extraLoad()

bool BaseDaemon::extraLoad ( const ConfigNode * config)
virtualinherited

Extra call on load for the current Daemon.

Parameters
config: configuration for the current Daemon
Returns
true on success, false otherwise

Reimplemented in Swarm::Monitoring< _TBackend >.

Definition at line 108 of file BaseDaemon.cpp.

108 {
109 return true;
110}

Referenced by loadConfigFromNode().

+ Here is the caller graph for this function:

◆ fillDaemonStat()

void BaseDaemon::fillDaemonStat ( Swarm::Stat & stat,
time_t startTimestamp,
time_t endTimestamp )

Fill the Stat with the current statistics of the daemon.

Parameters
statStat to be filled
startTimestamptime at which the statistic started to be filled
endTimestamptime at which the statistic stopped to be filled

Definition at line 157 of file BaseDaemon.cpp.

482 {
483 // Fill the computing statistics
484 MapStatAccumulator & mapStatComputing = p_config.getDaemonStatAccumulator().getMapStatComputing();
485 for(MapStatAccumulator::iterator it = mapStatComputing.begin(); it != mapStatComputing.end(); ++it){
486 StatAccumulator & accumulator = it->second;
487 VecStat vecStat = fillVecStat(accumulator, startTimestamp, endTimestamp);
488 stat.getMapStatComputing()[it->first] = vecStat;
489 }
490
491 // Fill the communication statistics
492 MapDaemonStatAccumulator & mapStatCommunication = p_config.getDaemonStatAccumulator().getMapStatCommunication();
493 for(MapDaemonStatAccumulator::iterator itMap = mapStatCommunication.begin(); itMap != mapStatCommunication.end(); ++itMap){
494 const PString & destName = itMap->first;
495 std::map<PString, VecStat> & mapVecStat = stat.getMapStatCommunication()[destName];
496 for(MapStatAccumulator::iterator it = itMap->second.begin(); it != itMap->second.end(); ++it){
497 StatAccumulator & accumulator = it->second;
498 VecStat vecStat = fillVecStat(accumulator, startTimestamp, endTimestamp);
499 mapVecStat[it->first] = vecStat;
500 }
501 }
502}
std::map< PString, Swarm::StatAccumulator > MapStatAccumulator
Definition BaseDaemon.h:39
std::map< PString, std::map< PString, Swarm::StatAccumulator > > MapDaemonStatAccumulator
Definition BaseDaemon.h:38
const std::map< DaemonName, std::map< DataType, Swarm::VecStat > > & getMapStatCommunication() const
Gets the mapStatCommunication of the Stat.
const std::map< PString, Swarm::VecStat > & getMapStatComputing() const
Gets the mapStatComputing of the Stat.
VecStat fillVecStat(const Swarm::StatAccumulator &accumulator, time_t startTimestamp, time_t endTimestamp)
Fill a VecStat from a StatAccumulator to send to the DamonStat.

Referenced by testFillDaemonStat().

+ Here is the caller graph for this function:

◆ fillVecStat()

VecStat BaseDaemon::fillVecStat ( const Swarm::StatAccumulator & accumulator,
time_t startTimestamp,
time_t endTimestamp )

Fill a VecStat from a StatAccumulator to send to the DamonStat.

Parameters
accumulatorStatAccumulator to be converted
startTimestamptime at which the statistic started to be filled
endTimestamptime at which the statistic stopped to be filled
Returns
VecStat filled with the statistics from the accumulator

Definition at line 156 of file BaseDaemon.cpp.

452 {
453 VecStat vecStat;
454
455 // Compute event values
456 vecStat.getNbEvent().push_back(accumulator.getNbEvent());
457 vecStat.getMin().push_back(accumulator.getMin());
458 vecStat.getMax().push_back(accumulator.getMax());
459 vecStat.getAverage().push_back(accumulator.getSum() / accumulator.getNbEvent());
460
461 // Compute time values
462 vecStat.getStartTimestamp().push_back(startTimestamp);
463 vecStat.getEndTimestamp().push_back(endTimestamp);
464 time_t rate = endTimestamp - startTimestamp;
465 vecStat.getRate().push_back(accumulator.getNbEvent()*1e9 / rate);
466 vecStat.getRateEventAboveUpperBound().push_back(accumulator.getNbEventAboveUpperBound()*1e9 / rate);
467 vecStat.getRateEventBelowLowerBound().push_back(accumulator.getNbEventBelowLowerBound()*1e9 / rate);
468
469 vecStat.getVecRateQuantile().resize(accumulator.getVecHistogram().size());
470 for(size_t i = 0; i < accumulator.getVecHistogram().size(); ++i){
471 vecStat.getVecRateQuantile()[i].push_back(accumulator.getVecHistogram()[i]*1e9 / rate);
472 }
473 return vecStat;
474}
float getSum() const
Gets the sum of the StatAccumulator.
size_t getNbEvent() const
Gets the nbEvent of the StatAccumulator.
float getMax() const
Gets the max of the StatAccumulator.
size_t getNbEventAboveUpperBound() const
Gets the nbEventAboveUpperBound of the StatAccumulator.
float getMin() const
Gets the min of the StatAccumulator.
size_t getNbEventBelowLowerBound() const
Gets the nbEventBelowLowerBound of the StatAccumulator.
const std::vector< size_t > & getVecHistogram() const
Gets the vecHistogram of the StatAccumulator.
const std::vector< float > & getMax() const
Gets the max of the VecStat.
const std::vector< time_t > & getEndTimestamp() const
Gets the endTimestamp of the VecStat.
const std::vector< float > & getRate() const
Gets the rate of the VecStat.
const std::vector< time_t > & getStartTimestamp() const
Gets the startTimestamp of the VecStat.
const std::vector< float > & getAverage() const
Gets the average of the VecStat.
const std::vector< float > & getRateEventBelowLowerBound() const
Gets the rateEventBelowLowerBound of the VecStat.
const std::vector< float > & getRateEventAboveUpperBound() const
Gets the rateEventAboveUpperBound of the VecStat.
const std::vector< float > & getMin() const
Gets the min of the VecStat.
const std::vector< size_t > & getNbEvent() const
Gets the nbEvent of the VecStat.
const std::vector< std::vector< float > > & getVecRateQuantile() const
Gets the vecRateQuantile of the VecStat.

Referenced by testFillVecStat().

+ Here is the caller graph for this function:

◆ getCommunicationStat()

void BaseDaemon::getCommunicationStat ( const PString & destName,
const PString & dataType,
float latency,
size_t nbBin,
float histLowerBound,
float histUpperBound )
privateinherited

Add a communication statistic.

Parameters
destName: name of the destination Daemon from which data where pushed
dataType: type of data which where pushed
latency: latency between the send of the data and the receiving of the confirmation by the daemon destName
nbBin: number of bin of the histogram
histLowerBound: lower bound of the histogram
histUpperBound: upper bound of the histogram

Definition at line 431 of file BaseDaemon.cpp.

431 {
432 std::map<PString, std::map<PString, StatAccumulator> > & mapCommunication = p_config.getDaemonStatAccumulator().getMapStatCommunication();
433 MapDaemonStatAccumulator::iterator it = mapCommunication.find(destName);
434 if(it == mapCommunication.end()){
435 mapCommunication[destName] = createNewCommunicationStatMap(dataType, nbBin, histLowerBound, histUpperBound);
436 }
437 else{
438 std::map<PString, StatAccumulator>::iterator itDataType = it->second.find(dataType);
439 if(itDataType == it->second.end()){
440 it->second[dataType] = createNewStat(nbBin, histLowerBound, histUpperBound);
441 }
442 }
443 updateStatAccumulator(p_config.getDaemonStatAccumulator().getMapStatCommunication().find(destName)->second[dataType], latency);
444}
void updateStatAccumulator(StatAccumulator &stat, float value)
Update a computing statistic with a new value.
std::map< PString, StatAccumulator > createNewCommunicationStatMap(const PString &dataType, size_t nbBin, float histLowerBound, float histUpperBound)
Create a new map of communication statistic.

References createNewCommunicationStatMap(), createNewStat(), p_config, and updateStatAccumulator().

Referenced by processConfirmedMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConfig()

DaemonConfig & BaseDaemon::getConfig ( )
inherited

Get the configuration of the current BaseDaemon.

Returns
configuration of the current BaseDaemon

Definition at line 371 of file BaseDaemon.cpp.

371 {
372 return p_config;
373}

References p_config.

Referenced by Swarm::Monitoring< _TBackend >::addCallMethod(), testClearStatAccumulator(), and testFillDaemonStat().

+ Here is the caller graph for this function:

◆ getDataFunction()

AbstractDataFunction * BaseDaemon::getDataFunction ( const Swarm::Data & data)
inherited

Get the data function associated with the given data.

Parameters
dataThe data for which to retrieve the associated function
Returns
A pointer to the associated data function, or nullptr if not found

Definition at line 268 of file BaseDaemon.cpp.

268 {
269 PString prototype(data.getType());
270 std::map<PString, AbstractDataFunction*>::iterator it(p_mapDataFunction.find(prototype));
271 if(it == p_mapDataFunction.end()){
272 getLog().getLogError() << "BaseDaemon::getDataFunction : function to process data '"<<prototype<<"' not found" << std::endl;
273 return nullptr;
274 }
275 return it->second;
276}
const PString & getType() const
Gets the type of the Data.

References getLog(), Swarm::Data::getType(), and p_mapDataFunction.

Referenced by processData(), and Swarm::Daemon< _TBackend >::processInputMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLog()

PLog & BaseDaemon::getLog ( )
inherited

◆ getLogger()

PLog & BaseDaemon::getLogger ( )
inherited

Get the logger of the current BaseDaemon.

Returns
logger of the current BaseDaemon

Definition at line 392 of file BaseDaemon.cpp.

392 {
393 return p_log;
394}

References p_log.

◆ getMainConfig()

DaemonMainConfig & BaseDaemon::getMainConfig ( )
inherited

Get the main configuration of the swarm.

Returns
main configuration of the swarm

Definition at line 385 of file BaseDaemon.cpp.

385 {
386 return p_mainConfig;
387}
DaemonMainConfig p_mainConfig
Main configuration of the Daemon.
Definition BaseDaemon.h:160

References p_mainConfig.

◆ getMapDaemonConfig()

MapDaemonConfig & BaseDaemon::getMapDaemonConfig ( )
inherited

Get the map of all Daemon configurations.

Returns
map of all Daemon configurations

Definition at line 378 of file BaseDaemon.cpp.

378 {
379 return p_mapDaemon;
380}
MapDaemonConfig p_mapDaemon
Map of the other Daemon of the Swarm.
Definition BaseDaemon.h:164

References p_mapDaemon.

◆ getMapMessageToBeConfirmed()

const std::map< size_t, Message > & BaseDaemon::getMapMessageToBeConfirmed ( ) const
inherited

Get the map of message to be confirmed.

Returns
map of message to be confirmed

Definition at line 349 of file BaseDaemon.cpp.

349 {
351}

References p_mapMessageToBeConfirmed.

◆ getMessageId()

size_t BaseDaemon::getMessageId ( )
inherited

Get current message id.

Returns
current message id

Definition at line 259 of file BaseDaemon.cpp.

259 {
260 ++p_messageId;
261 return p_messageId;
262}
size_t p_messageId
Id counter of the message of the current Daemon.
Definition BaseDaemon.h:186

References p_messageId.

Referenced by Swarm::Daemon< _TBackend >::sendData().

+ Here is the caller graph for this function:

◆ getMessageToConfirm()

bool BaseDaemon::getMessageToConfirm ( Swarm::Message & message,
size_t id ) const
inherited

Get a message to confirm by id if it exists.

Parameters
[out]message: message which has the id id
id: id of the message to be searched
Returns
true if the message with id id does exist, false otherwise

Definition at line 195 of file BaseDaemon.cpp.

195 {
196 std::map<size_t, Message>::const_iterator it(p_mapMessageToBeConfirmed.find(id));
197 if(it != p_mapMessageToBeConfirmed.end()){
198 message = it->second;
199 return true;
200 }
201 return false;
202}

References p_mapMessageToBeConfirmed.

Referenced by testBaseDaemonGetMessageToConfirm(), and testBaseDaemonProcessConfirmedMessage().

+ Here is the caller graph for this function:

◆ getOptionParser()

OptionParser & BaseDaemon::getOptionParser ( )
inherited

Return the OptionParser of the current BaseDaemon.

Returns
OptionParser of the current BaseDaemon

Definition at line 153 of file BaseDaemon.cpp.

153 {
154 return p_optionParser;
155}
OptionParser p_optionParser
Option parser of the Daemon.
Definition BaseDaemon.h:180

References p_optionParser.

◆ initialisationBaseDaemon()

void BaseDaemon::initialisationBaseDaemon ( )
privateinherited

Initialisation function of the class BaseDaemon.

Definition at line 397 of file BaseDaemon.cpp.

397 {
398 p_optionParser.setExampleLongOption("phoenix_daemon --daemonconfig=daemon_config.toml --daemonname=main");
399 p_optionParser.setExampleShortOption("phoenix_daemon -c daemon_config.toml -n main");
400 p_optionParser.addOption("daemonconfig", "c", OptionType::FILENAME, true, "Toml configuration file which define all Daemons of the swarm");
401 p_optionParser.addOption("daemonname", "n", OptionType::STRING, true, "Name of the current Daemon of the swarm configuration defined with --daemonconfig");
402 p_optionParser.addOption("mock", "m", OptionType::NONE, false, "Activate the Daemon in mock mode for the sockets and the clock");
403 p_optionParser.addOption("mockrecord", "r", OptionType::NONE, false, "Activate the Daemon in mock record mode for the sockets and the clock");
404 p_isRun = false;
405 p_messageId = 0lu;
406 p_isFullMock = false;
407 p_isFullMockRecord = false;
408}
bool p_isRun
True if the current BaseDaemon is running.
Definition BaseDaemon.h:168
bool p_isFullMock
True if the daemon has to be executed in mock mode for socket and clock.
Definition BaseDaemon.h:170
bool p_isFullMockRecord
True if the daemon has to be executed in mock record mode for socket and clock.
Definition BaseDaemon.h:172

References p_isFullMock, p_isFullMockRecord, p_isRun, p_messageId, and p_optionParser.

Referenced by BaseDaemon().

+ Here is the caller graph for this function:

◆ isDaemonExist()

bool BaseDaemon::isDaemonExist ( const PString & name) const
inherited

Say if a neighbour Daemon does exist.

Parameters
name: name of the Daemon to be searched
Returns
true if the Daemon does exist, false otherwise

Definition at line 168 of file BaseDaemon.cpp.

168 {
169 MapDaemonConfig::const_iterator it(p_mapDaemon.find(name));
170 if(it == p_mapDaemon.end()){
171 //Then if the stat daemon does not exist in the map, it may be the current daemon
172 if(p_config.getName() == name){
173 return true;
174 }
175 }
176 if(it != p_mapDaemon.end()){
177 return true;
178 }
179
180 return false;
181}

References p_config, and p_mapDaemon.

Referenced by loadConfigFromNode(), testBaseDaemonLoadConfigJson(), testBaseDaemonLoadConfigJsonString(), testBaseDaemonLoadConfigToml(), testBaseDaemonLoadConfigTomlString(), testBaseDaemonLoadConfigYml(), testBaseDaemonLoadConfigYmlString(), and testBaseDaemonParseArgument().

+ Here is the caller graph for this function:

◆ load() [1/2]

bool BaseDaemon::load ( const PPath & fileName,
const PString & daemonName )
inherited

Load the Toml configuration which define all BaseDaemons of the Swarm.

Parameters
fileName: name of the configuration file of all the BaseDaemons of the Swarm in toml format
daemonName: name of the current BaseDaemon in the given file
Returns
true on success, false otherwise

Definition at line 97 of file BaseDaemon.cpp.

97 {
98 ConfigNode dico;
99 daemon_load_config(p_log, dico, fileName);
100 loadConfigFromNode(dico, daemonName);
101 return true;
102}
void loadConfigFromNode(const ConfigNode &dico, const PString &daemonName)
Load configuration form a node of ConfigNode.
void daemon_load_config(PLog &log, ConfigNode &dico, const PString &inputConfig, ConfigFormat::ConfigFormat format)
Load the daemon config into a ConfigNode from a json string.

References daemon_load_config(), loadConfigFromNode(), and p_log.

+ Here is the call graph for this function:

◆ load() [2/2]

bool BaseDaemon::load ( const PString & configFileContent,
const PString & daemonName,
ConfigFormat::ConfigFormat format )
inherited

Load the Json configuration which define all BaseDaemons of the Swarm.

Parameters
configFileContent: name of the configuration file of all the BaseDaemons of the Swarm in json format
daemonName: name of the current BaseDaemon in the given file
format: format of the configuration file
Returns
true on success, false otherwise

Definition at line 85 of file BaseDaemon.cpp.

85 {
86 ConfigNode dico;
87 daemon_load_config(p_log, dico, configFileContent, format);
88 loadConfigFromNode(dico, daemonName);
89 return true;
90}

References daemon_load_config(), loadConfigFromNode(), and p_log.

Referenced by parseArgument(), testBaseDaemonLoadConfigJson(), testBaseDaemonLoadConfigJsonString(), testBaseDaemonLoadConfigToml(), testBaseDaemonLoadConfigTomlString(), testBaseDaemonLoadConfigYml(), testBaseDaemonLoadConfigYmlString(), testBaseDaemonMissingDaemonSectionJsonFile(), testBaseDaemonMissingDaemonSectionJsonString(), testBaseDaemonMissingDaemonSectionTomlFile(), testBaseDaemonMissingDaemonSectionTomlString(), testBaseDaemonMissingDaemonSectionYmlFile(), testBaseDaemonMissingDaemonSectionYmlString(), and testBaseDaemonProcessConfirmedMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadConfigFromNode()

void BaseDaemon::loadConfigFromNode ( const ConfigNode & dico,
const PString & daemonName )
inherited

Load configuration form a node of ConfigNode.

Parameters
[out]dico: loaded configuration
daemonName: name of the current Daemon in the configuration
Returns
true on success, false otherwise

Definition at line 47 of file BaseDaemon.cpp.

47 {
48 const ConfigNode * mapMainConfig = dico.getChild("swarm");
49 if(mapMainConfig != nullptr){
50 p_mainConfig.recvTimeoutMs = phoenix_get_value<int>(*mapMainConfig, "recv_timeout_ms", -1);
51 p_mainConfig.sendTimeoutMs = phoenix_get_value<int>(*mapMainConfig, "send_timeout_ms", -1);
52 p_mainConfig.recvFlag = fromString<PRecvFlag::PRecvFlag>(phoenix_get_string(*mapMainConfig, "recv_flag", "NON_BLOCK"));
53 p_mainConfig.sendFlag = fromString<PSendFlag::PSendFlag>(phoenix_get_string(*mapMainConfig, "send_flag", "NON_BLOCK"));
54 }
55 std::map<PString, time_t> mapTimeout;
56 const ConfigNode * extraConfigParam = nullptr;
57 daemon_read_configNode(p_config, p_mapDaemon, p_log, mapTimeout, extraConfigParam, dico, daemonName);
58
59 const ConfigNode * mapStatDaemon = dico.getChild("statistics");
60 if(mapStatDaemon != nullptr){
61 p_config.setStatDaemonName(daemon_loadString(*mapStatDaemon, "stat_daemon_name"));
62 extraLoad(mapStatDaemon);
63 }
64 p_config.setMapTimeout(mapTimeout);
65 if(p_config.getStatDaemonName() != ""){
66 if(!isDaemonExist(p_config.getStatDaemonName())){
67 p_log.getLogError() << "BaseDaemon::loadConfigFromNode : stat daemon '"<<p_config.getStatDaemonName()<<"' not found in configuration" << std::endl;
68 }
69 }
70
71 p_log.getLogInfo() << "BaseDaemon::loadConfigFromNode : loading configuration successful" << std::endl;
72 p_log.getLogInfo() << "BaseDaemon::loadConfigFromNode : ready to call addCallMethod to subscribe on received data" << std::endl;
74 if(extraConfigParam != nullptr){
75 extraLoad(extraConfigParam);
76 }
77}
bool isDaemonExist(const PString &name) const
Say if a neighbour Daemon does exist.
virtual void addCallMethod()
Do the addCallableMethod here.
virtual bool extraLoad(const ConfigNode *config)
Extra call on load for the current Daemon.
PString daemon_loadString(const ConfigNode &dico, const PString &attributeName)
Load a string value.
void daemon_read_configNode(Swarm::DaemonConfig &daemonConfig, MapDaemonConfig &mapDaemon, PLog &log, MapTimeout &mapTimeout, const ConfigNode *&extraConfigParam, const ConfigNode &dico, const PString &daemonName)
Read the ConfigNode to initialise current Daemon.

References addCallMethod(), daemon_loadString(), daemon_read_configNode(), extraLoad(), isDaemonExist(), p_config, p_log, p_mainConfig, and p_mapDaemon.

Referenced by load(), and load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseArgument()

bool BaseDaemon::parseArgument ( int argc,
char ** argv )
inherited

Parse arguments given to the BaseDaemon with command line.

Parameters
argc: number of arguments given to the program
argv: list of arguments given to the program
Returns
true on success, false otherwise

Definition at line 30 of file BaseDaemon.cpp.

30 {
31 p_optionParser.parseArgument(argc, argv);
32 const OptionMode & defaultMode = p_optionParser.getDefaultMode();
33 PPath configurationFile;
34 defaultMode.getValue(configurationFile, "daemonconfig");
35 PString daemonName;
36 defaultMode.getValue(daemonName, "daemonname");
37 p_isFullMock = defaultMode.isOptionExist("mock");
38 p_isFullMockRecord = defaultMode.isOptionExist("mockrecord");
39 return load(configurationFile, daemonName);
40}
bool load(const PString &configFileContent, const PString &daemonName, ConfigFormat::ConfigFormat format)
Load the Json configuration which define all BaseDaemons of the Swarm.

References load(), p_isFullMock, p_isFullMockRecord, and p_optionParser.

Referenced by testBaseDaemonParseArgument().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processConfirmedMessage()

void BaseDaemon::processConfirmedMessage ( size_t id,
time_t currentTime )
inherited

Process confirmed message.

Parameters
id: id of the message to be removed
currentTime: time when the confirmation was received

Definition at line 208 of file BaseDaemon.cpp.

208 {
209 std::map<size_t, Message>::const_iterator it(p_mapMessageToBeConfirmed.find(id));
210 if(it != p_mapMessageToBeConfirmed.end()){
211 getLog().getLogInfo() << "BaseDaemon::processConfirmedMessage : adding statistics for processed transaction " << id << std::endl;
212 const Message & message = it->second;
213 time_t ellapsedTime = currentTime - message.getSendTime();
214 for(const PString & receiver : message.getVecRecver()){
215 getLog().getLogDebug() << "BaseDaemon::processConfirmedMessage : add statistic for receiver : " << receiver << std::endl;
216 getCommunicationStat(receiver, message.getData().getType(), ellapsedTime, p_config.getStatNbBin(), p_config.getStatHistLowerBound(), p_config.getStatHistUpperBound());
217 }
218 // Remove the confirmed message
219 getLog().getLogInfo() << "BaseDaemon::removeConfirmedMessage : remove confirmed transaction " << id << std::endl;
221 }else{
222 getLog().getLogError() << "BaseDaemon::processConfirmedMessage : transaction " << id << " not found in p_mapMessageToBeConfirmed" << std::endl;
223 }
224}
void getCommunicationStat(const PString &destName, const PString &dataType, float latency, size_t nbBin, float histLowerBound, float histUpperBound)
Add a communication statistic.
const Swarm::Data & getData() const
Gets the data of the Message.

References getCommunicationStat(), Swarm::Message::getData(), getLog(), Swarm::Message::getSendTime(), Swarm::Data::getType(), Swarm::Message::getVecRecver(), p_config, and p_mapMessageToBeConfirmed.

Referenced by Swarm::Daemon< _TBackend >::processInputMessage(), and testBaseDaemonProcessConfirmedMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processData()

bool BaseDaemon::processData ( const Swarm::Data & data)
inherited

Process given data with the proper method.

Parameters
data: data to be processed
Returns
true on success, false otherwise

Definition at line 282 of file BaseDaemon.cpp.

282 {
283 AbstractDataFunction* function = getDataFunction(data);
284 if(function == nullptr){
285 return false;
286 }
287 getLog().getLogDebug() << "BaseDaemon::processData : process data '"<<data.getType()<<"'" << std::endl;
288 bool b = function->call(p_log, data);
289 return b;
290}
virtual bool call(PLog &log, const Swarm::Data &data)=0
Swarm::AbstractDataFunction * getDataFunction(const Swarm::Data &data)
Get the data function associated with the given data.

References Swarm::AbstractDataFunction::call(), getDataFunction(), getLog(), Swarm::Data::getType(), and p_log.

+ Here is the call graph for this function:

◆ stop()

void BaseDaemon::stop ( )
inherited

Stops the BaseDaemon.

Definition at line 145 of file BaseDaemon.cpp.

145 {
146 p_log.getLogInfo() << "Stopping Daemon '"<<p_config.getName()<<"' at '"<<p_config.getHostName()<<"'" << std::endl;
147 p_isRun = false;
148}

References p_config, p_isRun, and p_log.

Referenced by Swarm::Daemon< _TBackend >::processInputMessage(), and testBaseDaemonParseArgument().

+ Here is the caller graph for this function:

◆ updateStatAccumulator()

void BaseDaemon::updateStatAccumulator ( StatAccumulator & stat,
float value )
inherited

Update a computing statistic with a new value.

Parameters
stat: statistic to be updated
value: new value to be added to the statistic

Definition at line 296 of file BaseDaemon.cpp.

296 {
297 stat.setNbEvent(stat.getNbEvent() + 1lu);
298 getLog().getLogDebug() << "BaseDaemon::updateStatAccumulator : event nb is " << stat.getNbEvent() << std::endl;
299 if(stat.getNbEvent() == 1lu){
300 stat.setMin(value);
301 stat.setMax(value);
302 stat.setSum(value);
303 }else{
304 if(value < stat.getMin()){
305 stat.setMin(value);
306 }
307 if(value > stat.getMax()){
308 stat.setMax(value);
309 }
310 stat.setSum(stat.getSum() + value);
311 }
312 if(value > stat.getHistUpperBound()){
314 }
315 if(value < stat.getHistLowerBound()){
317 }
318 float binSize = (stat.getHistUpperBound() - stat.getHistLowerBound()) / stat.getVecHistogram().size();
319 size_t bin = (value - stat.getHistLowerBound()) / binSize;
320 if(bin < stat.getVecHistogram().size()){
321 std::vector<size_t> & vecHistogram = stat.getVecHistogram();
322 vecHistogram[bin] = vecHistogram[bin] + 1lu;
323 }
324}
float getHistUpperBound() const
Gets the histUpperBound of the StatAccumulator.
float getHistLowerBound() const
Gets the histLowerBound of the StatAccumulator.

References Swarm::StatAccumulator::getHistLowerBound(), Swarm::StatAccumulator::getHistUpperBound(), getLog(), Swarm::StatAccumulator::getMax(), Swarm::StatAccumulator::getMin(), Swarm::StatAccumulator::getNbEvent(), Swarm::StatAccumulator::getNbEventAboveUpperBound(), Swarm::StatAccumulator::getNbEventBelowLowerBound(), Swarm::StatAccumulator::getSum(), Swarm::StatAccumulator::getVecHistogram(), Swarm::StatAccumulator::setMax(), Swarm::StatAccumulator::setMin(), Swarm::StatAccumulator::setNbEvent(), Swarm::StatAccumulator::setNbEventAboveUpperBound(), Swarm::StatAccumulator::setNbEventBelowLowerBound(), and Swarm::StatAccumulator::setSum().

Referenced by getCommunicationStat(), Swarm::Daemon< _TBackend >::processInputMessage(), and testUpdateStatAccumulator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ p_config

◆ p_isFullMock

bool Swarm::BaseDaemon::p_isFullMock
protectedinherited

True if the daemon has to be executed in mock mode for socket and clock.

Definition at line 170 of file BaseDaemon.h.

Referenced by initialisationBaseDaemon(), Swarm::Daemon< _TBackend >::initialisationDaemonSocket(), parseArgument(), Swarm::Daemon< _TBackend >::setClockMode(), and Swarm::Daemon< _TBackend >::setSocketMode().

◆ p_isFullMockRecord

bool Swarm::BaseDaemon::p_isFullMockRecord
protectedinherited

True if the daemon has to be executed in mock record mode for socket and clock.

Definition at line 172 of file BaseDaemon.h.

Referenced by initialisationBaseDaemon(), Swarm::Daemon< _TBackend >::initialisationDaemonSocket(), parseArgument(), Swarm::Daemon< _TBackend >::setClockMode(), and Swarm::Daemon< _TBackend >::setSocketMode().

◆ p_isRun

bool Swarm::BaseDaemon::p_isRun
protectedinherited

True if the current BaseDaemon is running.

Definition at line 168 of file BaseDaemon.h.

Referenced by initialisationBaseDaemon(), Swarm::Daemon< _TBackend >::run(), and stop().

◆ p_log

◆ p_mainConfig

DaemonMainConfig Swarm::BaseDaemon::p_mainConfig
protectedinherited

◆ p_mapCallableMethod

std::map<PString, Swarm::AbstractFunction*> Swarm::BaseDaemon::p_mapCallableMethod
privateinherited

Map of callable method of the Daemon.

Definition at line 182 of file BaseDaemon.h.

Referenced by addCallableMethod(), callMethod(), and clearCallableMethod().

◆ p_mapDaemon

MapDaemonConfig Swarm::BaseDaemon::p_mapDaemon
protectedinherited

◆ p_mapDataFunction

std::map<PString, Swarm::AbstractDataFunction*> Swarm::BaseDaemon::p_mapDataFunction
privateinherited

Map of methods which have to be called when receiving data.

Definition at line 189 of file BaseDaemon.h.

Referenced by addDataCallableMethod(), addDataCallableMethod(), and getDataFunction().

◆ p_mapMessageToBeConfirmed

std::map<size_t, Swarm::Message> Swarm::BaseDaemon::p_mapMessageToBeConfirmed
privateinherited

Map of messages which have to be confirmed by destination Daemon.

Definition at line 184 of file BaseDaemon.h.

Referenced by addMessageToConfirm(), checkMessageTimeout(), getMapMessageToBeConfirmed(), getMessageToConfirm(), and processConfirmedMessage().

◆ p_messageId

size_t Swarm::BaseDaemon::p_messageId
privateinherited

Id counter of the message of the current Daemon.

Definition at line 186 of file BaseDaemon.h.

Referenced by getMessageId(), and initialisationBaseDaemon().

◆ p_optionParser

OptionParser Swarm::BaseDaemon::p_optionParser
privateinherited

Option parser of the Daemon.

Definition at line 180 of file BaseDaemon.h.

Referenced by BaseDaemon(), getOptionParser(), initialisationBaseDaemon(), and parseArgument().


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