salsa 0.7.1
|
Salsa zyre socket class. More...
#include <SocketZyre.hh>
Public Member Functions | |
SocketZyre (std::string name="no_name", std::map< std::string, std::string > headers={}) | |
virtual | ~SocketZyre () |
virtual int | connect () final |
Connect function. | |
virtual int | disconnect () final |
Disconnect function. | |
virtual Message * | pull () |
Pull message. | |
virtual int | push (Message *) |
Push message. | |
int | push (std::string, std::string) |
Push message to UUID. | |
void | port (int newPort) |
Set zyre port. | |
int | port () const |
Get zyre port. | |
virtual zyre_t * | zyre () const |
Returns zyre pointer. | |
virtual zsock_t * | socket () const |
Returns zyre socket pointer. | |
std::string | header (const char *pKey) const |
Returns value for key from header. | |
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. | |
Private Attributes | |
zyre_t * | mpSocket = nullptr |
Zyre instance. | |
int | mPort = 0 |
Port for Zyre. | |
std::map< std::string, std::string > | mHeaders = {} |
List of headers. | |
Static Private Attributes | |
static std::shared_ptr< spdlog::logger > | mspConsoleLogger = spdlog::stdout_color_mt("salsa") |
Pointer to spd logger. | |
Salsa zyre socket class.
Definition at line 18 of file SocketZyre.hh.
Salsa::SocketZyre::SocketZyre | ( | std::string | name = "no_name", |
std::map< std::string, std::string > | headers = {} ) |
Constructor with zyre name
name | Zyre name |
headers | List of headers |
Definition at line 5 of file SocketZyre.cc.
References header(), mHeaders, mpSocket, and Salsa::Socket::Socket().
|
virtual |
|
finalvirtual |
Connect function.
Connect zyre to the network
Implements Salsa::Socket.
Definition at line 33 of file SocketZyre.cc.
References mpSocket.
|
finalvirtual |
Disconnect function.
Disconnect zyre from network
Implements Salsa::Socket.
Definition at line 43 of file SocketZyre.cc.
References mpSocket.
Referenced by ~SocketZyre().
|
inlinestaticinherited |
Get console output.
Definition at line 21 of file Object.hh.
References mspConsoleLogger.
Referenced by Salsa::ConfigZyre::apply().
|
inline |
Returns value for key from header.
Definition at line 47 of file SocketZyre.hh.
References mHeaders.
Referenced by SocketZyre().
|
inline |
|
inline |
|
virtual |
Pull message.
Pull message from the network
Implements Salsa::Socket.
Definition at line 56 of file SocketZyre.cc.
References mpSocket.
|
virtual |
Push message.
Push message to the network
Implements Salsa::Socket.
Definition at line 66 of file SocketZyre.cc.
int Salsa::SocketZyre::push | ( | std::string | targetUUID, |
std::string | payload ) |
|
inlinestaticinherited |
|
inlinevirtual |
Returns zyre socket pointer.
Definition at line 45 of file SocketZyre.hh.
References mpSocket.
Referenced by Salsa::PollerZmq::add().
|
inlinevirtual |
Returns zyre pointer.
Definition at line 42 of file SocketZyre.hh.
References mpSocket.
Referenced by Salsa::NodeManagerZyre::sendWhisper().
|
private |
List of headers.
Definition at line 52 of file SocketZyre.hh.
Referenced by header(), and SocketZyre().
|
private |
|
private |
Zyre instance.
Definition at line 50 of file SocketZyre.hh.
Referenced by connect(), disconnect(), port(), pull(), push(), socket(), SocketZyre(), zyre(), and ~SocketZyre().
|
staticprivateinherited |
Pointer to spd logger.
Definition at line 32 of file Object.hh.
Referenced by getConsoleOutput(), and setConsoleLevel().