7 #ifndef __PEMPTY_BACKEND_H__
8 #define __PEMPTY_BACKEND_H__
33 static Param client(
const std::string & address,
size_t port);
34 static Param server(
const std::string & address,
size_t port);
Backend to use Mock library with PAbtractSocket.
static bool createServerSocket(Socket &socket, const std::string &address, size_t port, const PEmptyParam ¶m)
Create a client socket.
static bool isConnected(const Socket &socket)
Close the given socket.
static bool createClientSocket(Socket &socket, const std::string &address, size_t port, const PEmptyParam ¶m)
Create a client socket.
static const DataStreamIter msgData(const Message &msg)
Get the data of a message.
static size_t msgSize(const Message &msg)
Get the size of a message.
static void msgToMock(DataStreamMsg &mockMsg, const Message &msg)
Copy current backend message data into mock message.
int Socket
Define the socket of the backend used by the PAbstractSocketManager.
static Param server(const std::string &address, size_t port)
Create param for a server socket.
static bool recv(Socket &socket, Message &msg, PRecvFlag::PRecvFlag flag)
Recieve message from the given socket.
static void mockToMsg(Message &msg, DataStreamMsg &mockMsg)
Copy mock message data into current backend message.
static void msgResize(Message &msg, size_t sizeMsg)
Resize a message.
static Param client(const std::string &address, size_t port)
Create param for a client socket.
static bool send(Socket &socket, const Message &msg, PSendFlag::PSendFlag flag)
Send message on the given socket.
DataStreamMsg Message
Define the type of message used by the PAbstractSocketManager.
PEmptyBackend()
Default constructor of PEmptyBackend.
PEmptyParam Param
Define the type of extra parameters which can be used to create a Socket used by the PAbstractSocketM...
static void close(Socket &socket)
Close the given socket.
std::vector< DataStreamType > DataStreamMsg
DataStreamType * DataStreamIter
PRecvFlag
describe the recieving flag of the Socket
PSendFlag
describe the sending flag of the Socket
Set of parameters to be passed to create a socket with mock backend.
size_t port
Connection port.
std::string address
Host address.