salsa 0.7.1
|
Base Distributor class. More...
#include <Distributor.hh>
Public Member Functions | |
Distributor (std::string uuid, std::shared_ptr< Socket > pPipe, NodeManager *pNM) | |
virtual | ~Distributor () |
std::string | uuid () const |
Returns distributor's UUID. | |
std::shared_ptr< Socket > | pipe () const |
TODO Returns distributor's pipe? | |
void | print () const |
TODO Prints distributor's state. | |
void | addClient (std::string uuid, std::string type) |
void | removeClient (std::string uuid) |
void | addOther (std::string uuid, std::string type) |
void | removeOther (std::string uuid) |
NodeInfo * | nodeInfo () const |
virtual void | onEnter (Message *pInMsg, std::vector< std::string > &out, std::string type) |
TODO Three horsemen of apocalypse. | |
virtual void | onExit (Message *pInMsg, std::vector< std::string > &out) |
virtual void | onWhisper (Message *pInMsg, std::vector< std::string > &out) |
Json::Value | jsonValueNodeInfo () const |
Returns json value. | |
virtual void | upadateJsonValueNodeInfo () |
Static Public Member Functions | |
static std::shared_ptr< spdlog::logger > | getConsoleOutput () |
Get console output. | |
static void | setConsoleLevel (spdlog::level::level_enum level) |
Sets console log level. | |
Protected Attributes | |
std::string | mUUID {} |
Self UUID. | |
std::shared_ptr< Socket > | mpPipe = nullptr |
Pipe for messages (net connector) | |
std::map< std::string, std::string > | mClients {} |
List of clients. | |
std::map< std::string, std::string > | mOthers {} |
List of others. | |
NodeManager * | mpNodeManager = nullptr |
Node Manager. | |
NodeInfo * | mpNodeInfo {new NodeInfo()} |
Node Info. | |
Json::Value | mJsonValue |
Node Info as json value. | |
TaskInfo | mTaskInfoCache {} |
Task Info cache. | |
Static Private Attributes | |
static std::shared_ptr< spdlog::logger > | mspConsoleLogger = spdlog::stdout_color_mt("salsa") |
Pointer to spd logger. | |
Base Distributor class.
Definition at line 19 of file Distributor.hh.
Salsa::Distributor::Distributor | ( | std::string | uuid, |
std::shared_ptr< Socket > | pPipe, | ||
NodeManager * | pNM ) |
Constructor
Definition at line 3 of file Distributor.cc.
References mpNodeManager, mpPipe, mUUID, Salsa::Object::Object(), pipe(), and uuid().
Referenced by Salsa::Consumer::Consumer(), Salsa::Feeder::Feeder(), and Salsa::Worker::Worker().
|
virtual |
void Salsa::Distributor::addClient | ( | std::string | uuid, |
std::string | type ) |
void Salsa::Distributor::addOther | ( | std::string | uuid, |
std::string | type ) |
|
inlinestaticinherited |
Get console output.
Definition at line 21 of file Object.hh.
References mspConsoleLogger.
Referenced by Salsa::ConfigZyre::apply().
|
inline |
NodeInfo * Salsa::Distributor::nodeInfo | ( | ) | const |
Returns node info
Definition at line 92 of file Distributor.cc.
References mpNodeInfo.
Referenced by Salsa::Feeder::onWhisper().
|
virtual |
TODO Three horsemen of apocalypse.
onEnter
Reimplemented in Salsa::Consumer, Salsa::Feeder, and Salsa::Worker.
Definition at line 58 of file Distributor.cc.
|
virtual |
onExit
Reimplemented in Salsa::Consumer, Salsa::Feeder, and Salsa::Worker.
Definition at line 64 of file Distributor.cc.
|
virtual |
onWhisper
Reimplemented in Salsa::Consumer, Salsa::Feeder, and Salsa::Worker.
Definition at line 70 of file Distributor.cc.
std::shared_ptr< Socket > Salsa::Distributor::pipe | ( | ) | const |
TODO Returns distributor's pipe?
Returns pipe socket
Definition at line 77 of file Distributor.cc.
References mpPipe.
Referenced by Distributor(), Salsa::Feeder::Feeder(), Salsa::Feeder::subscribe(), Salsa::Feeder::terminateJob(), and Salsa::Worker::Worker().
void Salsa::Distributor::print | ( | ) | const |
void Salsa::Distributor::removeClient | ( | std::string | uuid | ) |
void Salsa::Distributor::removeOther | ( | std::string | uuid | ) |
|
inlinestaticinherited |
|
virtual |
Updates json value with node info
Definition at line 100 of file Distributor.cc.
References mJsonValue, and mpNodeInfo.
Referenced by Salsa::Feeder::onExit(), and Salsa::Feeder::onWhisper().
std::string Salsa::Distributor::uuid | ( | ) | const |
Returns distributor's UUID.
Returns uuid
Definition at line 84 of file Distributor.cc.
References mUUID.
Referenced by addClient(), addOther(), Salsa::Consumer::Consumer(), Distributor(), Salsa::Feeder::Feeder(), removeClient(), removeOther(), Salsa::Feeder::removeWorkerTask(), Salsa::Feeder::subscribe(), Salsa::Feeder::terminateJob(), and Salsa::Worker::Worker().
|
protected |
List of clients.
Definition at line 56 of file Distributor.hh.
Referenced by addClient(), Salsa::Feeder::onExit(), print(), removeClient(), Salsa::Feeder::subscribe(), and Salsa::Feeder::terminateJob().
|
protected |
Node Info as json value.
Definition at line 60 of file Distributor.hh.
Referenced by jsonValueNodeInfo(), and upadateJsonValueNodeInfo().
|
protected |
List of others.
Definition at line 57 of file Distributor.hh.
Referenced by addOther(), print(), and removeOther().
|
protected |
Node Info.
Definition at line 59 of file Distributor.hh.
Referenced by Salsa::Feeder::Feeder(), nodeInfo(), Salsa::Worker::onEnter(), Salsa::Feeder::onExit(), Salsa::Feeder::onWhisper(), upadateJsonValueNodeInfo(), Salsa::Worker::Worker(), and ~Distributor().
|
protected |
Node Manager.
Definition at line 58 of file Distributor.hh.
Referenced by Distributor(), Salsa::Feeder::onEnter(), Salsa::Consumer::onExit(), Salsa::Feeder::onExit(), Salsa::Consumer::onWhisper(), Salsa::Feeder::onWhisper(), Salsa::Worker::onWhisper(), Salsa::Feeder::subscribe(), Salsa::Feeder::terminateJob(), and Salsa::Worker::Worker().
|
protected |
Pipe for messages (net connector)
Definition at line 55 of file Distributor.hh.
Referenced by Distributor(), pipe(), and print().
|
staticprivateinherited |
Pointer to spd logger.
Definition at line 32 of file Object.hh.
Referenced by getConsoleOutput(), and setConsoleLevel().
|
mutableprotected |
Task Info cache.
Definition at line 62 of file Distributor.hh.
|
protected |
Self UUID.
Definition at line 54 of file Distributor.hh.
Referenced by Distributor(), Salsa::Feeder::Feeder(), Salsa::Consumer::onWhisper(), Salsa::Worker::onWhisper(), uuid(), and Salsa::Worker::Worker().