![]() |
PhoenixZMQ
2.0.0
Library which integrates zeromq use in Phoenix
|
Backend to use Mock library with PAbtractSocket. More...
#include <PEmptyBackend.h>
Public Types | |
typedef DataStreamMsg | Message |
Define the type of message used by the PAbstractSocketManager. More... | |
typedef PEmptyParam | Param |
Define the type of extra parameters which can be used to create a Socket used by the PAbstractSocketManager. More... | |
typedef int | Socket |
Define the socket of the backend used by the PAbstractSocketManager. More... | |
Public Member Functions | |
PEmptyBackend () | |
Default constructor of PEmptyBackend. More... | |
Static Public Member Functions | |
static Param | client (const std::string &address, size_t port) |
Create param for a client socket. More... | |
static void | close (Socket &socket) |
Close the given socket. More... | |
static bool | createClientSocket (Socket &socket, const PEmptyParam ¶m) |
Create a client socket. More... | |
static bool | createClientSocket (Socket &socket, const std::string &address, size_t port, const PEmptyParam ¶m) |
Create a client socket. More... | |
static bool | createServerSocket (Socket &socket, const PEmptyParam ¶m) |
Create a client socket. More... | |
static bool | createServerSocket (Socket &socket, const std::string &address, size_t port, const PEmptyParam ¶m) |
Create a client socket. More... | |
static bool | isConnected (const Socket &socket) |
Close the given socket. More... | |
static void | mockToMsg (Message &msg, DataStreamMsg &mockMsg) |
Copy mock message data into current backend message. More... | |
static const DataStreamIter | msgData (const Message &msg) |
Get the data of a message. More... | |
static DataStreamIter | msgData (Message &msg) |
Get the data of a message. More... | |
static void | msgResize (Message &msg, size_t sizeMsg) |
Resize a message. More... | |
static size_t | msgSize (const Message &msg) |
Get the size of a message. More... | |
static void | msgToMock (DataStreamMsg &mockMsg, const Message &msg) |
Copy current backend message data into mock message. More... | |
static bool | recv (Socket &socket, Message &msg, PRecvFlag::PRecvFlag flag) |
Recieve message from the given socket. More... | |
static bool | send (Socket &socket, const Message &msg, PSendFlag::PSendFlag flag) |
Send message on the given socket. More... | |
static Param | server (const std::string &address, size_t port) |
Create param for a server socket. More... | |
Backend to use Mock library with PAbtractSocket.
Definition at line 22 of file PEmptyBackend.h.
typedef DataStreamMsg PEmptyBackend::Message |
Define the type of message used by the PAbstractSocketManager.
Definition at line 27 of file PEmptyBackend.h.
typedef PEmptyParam PEmptyBackend::Param |
Define the type of extra parameters which can be used to create a Socket used by the PAbstractSocketManager.
Definition at line 29 of file PEmptyBackend.h.
typedef int PEmptyBackend::Socket |
Define the socket of the backend used by the PAbstractSocketManager.
Definition at line 25 of file PEmptyBackend.h.
PEmptyBackend::PEmptyBackend | ( | ) |
|
static |
Create param for a client socket.
address | : address of the server to be connected to |
port | : port to be used |
Definition at line 20 of file PEmptyBackend.cpp.
References PEmptyParam::address, and PEmptyParam::port.
Referenced by server().
|
static |
Close the given socket.
[out] | socket | : socket to be closed |
Definition at line 132 of file PEmptyBackend.cpp.
|
static |
Create a client socket.
[out] | socket | : socket to be created |
param | : extra customisable parameters for the creation of the socket (depends on the backend) |
Definition at line 63 of file PEmptyBackend.cpp.
|
static |
Create a client socket.
[out] | socket | : socket to be created |
address | : address of the server, the client has to connect to | |
port | : port to be used for the connection | |
param | : extra customisable parameters for the creation of the socket (depends on the backend) |
Definition at line 43 of file PEmptyBackend.cpp.
|
static |
Create a client socket.
[out] | socket | : socket to be created |
param | : extra customisable parameters for the creation of the socket (depends on the backend) |
Definition at line 72 of file PEmptyBackend.cpp.
|
static |
Create a client socket.
[out] | socket | : socket to be created |
address | : address of the server, the client has to connect to | |
port | : port to be used for the connection | |
param | : extra customisable parameters for the creation of the socket (depends on the backend) |
Definition at line 54 of file PEmptyBackend.cpp.
|
static |
Close the given socket.
socket | : socket to be checked |
Definition at line 140 of file PEmptyBackend.cpp.
|
static |
Copy mock message data into current backend message.
[out] | msg | : message of the current backend to be converted |
mockMsg | : mock message |
Definition at line 158 of file PEmptyBackend.cpp.
References msgData(), and msgResize().
|
static |
Get the data of a message.
msg | : message to be used |
Definition at line 116 of file PEmptyBackend.cpp.
Referenced by mockToMsg(), and msgToMock().
|
static |
Get the data of a message.
msg | : message to be used |
Definition at line 124 of file PEmptyBackend.cpp.
|
static |
Resize a message.
[out] | msg | : message to be resized |
sizeMsg | : new size of the message |
Definition at line 100 of file PEmptyBackend.cpp.
Referenced by mockToMsg().
|
static |
Get the size of a message.
msg | : message to be used |
Definition at line 108 of file PEmptyBackend.cpp.
Referenced by msgToMock().
|
static |
Copy current backend message data into mock message.
[out] | mockMsg | : mock message |
msg | : message of the current backend to be converted |
Definition at line 148 of file PEmptyBackend.cpp.
References msgData(), and msgSize().
|
static |
Recieve message from the given socket.
socket | : socket to be used |
msg | : message to be recieved |
flag | : flags to be used to send the message (BLOCK, NON_BLOCK, etc) |
Definition at line 92 of file PEmptyBackend.cpp.
|
static |
Send message on the given socket.
socket | : socket to be used |
msg | : message to be sent |
flag | : flags to be used to send the message (BLOCK, NON_BLOCK, etc) |
Definition at line 82 of file PEmptyBackend.cpp.
|
static |
Create param for a server socket.
address | : address of the server to be connected to |
port | : port to be used |
Definition at line 32 of file PEmptyBackend.cpp.
References client().