FairMQ
1.4.33
C++ Message Queuing Library and Framework
|
Wrapper class for FairMQSocket and related methods. More...
#include <FairMQChannel.h>
Classes | |
struct | ChannelConfigurationError |
Public Member Functions | |
FairMQChannel () | |
Default constructor. | |
FairMQChannel (const std::string &name) | |
FairMQChannel (const std::string &type, const std::string &method, const std::string &address) | |
FairMQChannel (const std::string &name, const std::string &type, std::shared_ptr< FairMQTransportFactory > factory) | |
FairMQChannel (const std::string &name, const std::string &type, const std::string &method, const std::string &address, std::shared_ptr< FairMQTransportFactory > factory) | |
FairMQChannel (const std::string &name, int index, const fair::mq::Properties &properties) | |
FairMQChannel (const FairMQChannel &) | |
Copy Constructor. | |
FairMQChannel (const FairMQChannel &, const std::string &name) | |
Copy Constructor (with new name) | |
FairMQChannel & | operator= (const FairMQChannel &) |
Move constructor. More... | |
virtual | ~FairMQChannel () |
Move assignment operator. More... | |
FairMQSocket & | GetSocket () const |
bool | Bind (const std::string &address) |
bool | Connect (const std::string &address) |
std::string | GetName () const |
std::string | GetPrefix () const |
std::string | GetIndex () const |
std::string | GetType () const |
std::string | GetMethod () const |
std::string | GetAddress () const |
std::string | GetTransportName () const |
fair::mq::Transport | GetTransportType () const |
int | GetSndBufSize () const |
int | GetRcvBufSize () const |
int | GetSndKernelSize () const |
int | GetRcvKernelSize () const |
int | GetLinger () const |
int | GetRateLogging () const |
int | GetPortRangeMin () const |
int | GetPortRangeMax () const |
bool | GetAutoBind () const |
void | UpdateName (const std::string &name) |
void | UpdateType (const std::string &type) |
void | UpdateMethod (const std::string &method) |
void | UpdateAddress (const std::string &address) |
void | UpdateTransport (const std::string &transport) |
void | UpdateSndBufSize (const int sndBufSize) |
void | UpdateRcvBufSize (const int rcvBufSize) |
void | UpdateSndKernelSize (const int sndKernelSize) |
void | UpdateRcvKernelSize (const int rcvKernelSize) |
void | UpdateLinger (const int duration) |
void | UpdateRateLogging (const int rateLogging) |
void | UpdatePortRangeMin (const int minPort) |
void | UpdatePortRangeMax (const int maxPort) |
void | UpdateAutoBind (const bool autobind) |
bool | IsValid () const |
bool | Validate () |
void | Init () |
bool | ConnectEndpoint (const std::string &endpoint) |
bool | BindEndpoint (std::string &endpoint) |
void | Invalidate () |
invalidates the channel (requires validation to be used again). | |
int64_t | Send (FairMQMessagePtr &msg, int sndTimeoutInMs=-1) |
int64_t | Receive (FairMQMessagePtr &msg, int rcvTimeoutInMs=-1) |
int64_t | Send (std::vector< FairMQMessagePtr > &msgVec, int sndTimeoutInMs=-1) |
int64_t | Receive (std::vector< FairMQMessagePtr > &msgVec, int rcvTimeoutInMs=-1) |
int64_t | Send (FairMQParts &parts, int sndTimeoutInMs=-1) |
int64_t | Receive (FairMQParts &parts, int rcvTimeoutInMs=-1) |
unsigned long | GetBytesTx () const |
unsigned long | GetBytesRx () const |
unsigned long | GetMessagesTx () const |
unsigned long | GetMessagesRx () const |
auto | Transport () -> FairMQTransportFactory * |
template<typename... Args> | |
FairMQMessagePtr | NewMessage (Args &&... args) |
template<typename T > | |
FairMQMessagePtr | NewSimpleMessage (const T &data) |
template<typename T > | |
FairMQMessagePtr | NewStaticMessage (const T &data) |
template<typename... Args> | |
FairMQUnmanagedRegionPtr | NewUnmanagedRegion (Args &&... args) |
Friends | |
class | FairMQDevice |
Wrapper class for FairMQSocket and related methods.
The class is not thread-safe.
FairMQChannel::FairMQChannel | ( | const std::string & | name | ) |
Constructor
name | Channel name |
FairMQChannel::FairMQChannel | ( | const std::string & | type, |
const std::string & | method, | ||
const std::string & | address | ||
) |
Constructor
type | Socket type (push/pull/pub/sub/spub/xsub/pair/req/rep/dealer/router/) |
method | Socket method (bind/connect) |
address | Network address to bind/connect to (e.g. "tcp://127.0.0.1:5555" or "ipc://abc") |
FairMQChannel::FairMQChannel | ( | const std::string & | name, |
const std::string & | type, | ||
std::shared_ptr< FairMQTransportFactory > | factory | ||
) |
Constructor
name | Channel name |
type | Socket type (push/pull/pub/sub/spub/xsub/pair/req/rep/dealer/router/) |
factory | TransportFactory |
FairMQChannel::FairMQChannel | ( | const std::string & | name, |
const std::string & | type, | ||
const std::string & | method, | ||
const std::string & | address, | ||
std::shared_ptr< FairMQTransportFactory > | factory | ||
) |
Constructor
name | Channel name |
type | Socket type (push/pull/pub/sub/spub/xsub/pair/req/rep/dealer/router/) |
method | Socket method (bind/connect) |
address | Network address to bind/connect to (e.g. "tcp://127.0.0.1:5555" or "ipc://abc") |
factory | TransportFactory |
|
inlinevirtual |
Move assignment operator.
Destructor
|
inline |
Get socket address (e.g. "tcp://127.0.0.1:5555" or "ipc://abc")
|
inline |
Set automatic binding (pick random port if bind fails)
|
inline |
Get channel index
|
inline |
Get linger duration (in milliseconds)
|
inline |
Get socket method
|
inline |
Get channel name
|
inline |
Get end of the port range for automatic binding
|
inline |
Get start of the port range for automatic binding
|
inline |
Get channel prefix
|
inline |
Get socket rate logging interval (in seconds)
|
inline |
Get socket receive buffer size (in number of messages)
|
inline |
Get socket kernel transmit receive buffer size (in bytes)
|
inline |
Get socket send buffer size (in number of messages)
|
inline |
Get socket kernel transmit send buffer size (in bytes)
|
inline |
Get channel transport name ("default", "zeromq" or "shmem")
|
inline |
Get channel transport type
|
inline |
Get socket type
|
inline |
Checks if the configured channel settings are valid (checks the validity parameter, without running full validation (as oposed to ValidateChannel()))
FairMQChannel & FairMQChannel::operator= | ( | const FairMQChannel & | chan | ) |
Move constructor.
Assignment operator
|
inline |
Receives a message from the socket queue.
msg | Constant reference of unique_ptr to a FairMQMessage |
rcvTimeoutInMs | receive timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot receive) |
|
inline |
Receive FairMQParts
parts | FairMQParts reference |
rcvTimeoutInMs | receive timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot receive) |
|
inline |
Receive a vector of messages
msgVec | message vector reference |
rcvTimeoutInMs | receive timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot receive) |
|
inline |
Sends a message to the socket queue.
msg | Constant reference of unique_ptr to a FairMQMessage |
sndTimeoutInMs | send timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot send) |
|
inline |
Send FairMQParts
parts | FairMQParts reference |
sndTimeoutInMs | send timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot send) |
|
inline |
Send a vector of messages
msgVec | message vector reference |
sndTimeoutInMs | send timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot send) |
|
inline |
Set socket address
Socket | address (e.g. "tcp://127.0.0.1:5555" or "ipc://abc") |
|
inline |
Set automatic binding (pick random port if bind fails)
autobind | true/false, true to enable automatic binding |
|
inline |
Set linger duration (in milliseconds)
duration | linger duration (in milliseconds) |
|
inline |
Set socket method
method | Socket method (bind/connect) |
|
inline |
Set channel name
name | Arbitrary channel name |
|
inline |
Set end of the port range for automatic binding
maxPort | end of the port range |
|
inline |
Set start of the port range for automatic binding
minPort | start of the port range |
|
inline |
Set socket rate logging interval (in seconds)
rateLogging | Socket rate logging interval (in seconds) |
|
inline |
Set socket receive buffer size
rcvBufSize | Socket receive buffer size (in number of messages) |
|
inline |
Set socket kernel transmit receive buffer size (in bytes)
rcvKernelSize | Socket receive buffer size (in bytes) |
|
inline |
Set socket send buffer size
sndBufSize | Socket send buffer size (in number of messages) |
|
inline |
Set socket kernel transmit send buffer size (in bytes)
sndKernelSize | Socket send buffer size (in bytes) |
|
inline |
Set channel transport
transport | transport string ("default", "zeromq" or "shmem") |
|
inline |
Set socket type
type | Socket type (push/pull/pub/sub/spub/xsub/pair/req/rep/dealer/router/) |
bool FairMQChannel::Validate | ( | ) |
Validates channel configuration