7#ifndef __PMOCKBACKEND_IMPL_H__
8#define __PMOCKBACKEND_IMPL_H__
19 size_t dataSize(data_size<T>(data));
21 DataStreamIter iter = (DataStreamIter)msg.data();
22 return data_message_save<T>(iter, data);
43 p_mock.getCurrentValue(referenceMsg);
44 if(referenceMsg.size() != 0lu){
45 DataStreamIter iter = (DataStreamIter)referenceMsg.data();
46 check_stream_assert(data_message_load<T>(iter, referenceData));
47 std::stringstream index;
48 index <<
p_mock.getCurrentIndex();
49 check_stream_assert(phoenix_check_stream(
"mock '"+
p_mock.getFileName()+
"', [mock index = "+index.str()+
"]", data, referenceData));
72 recvStatus =
recvMsg(msg, flag);
74 if(msg.size() != 0lu){
75 DataStreamIter iter = (DataStreamIter)msg.data();
76 if(!data_message_load<T>(iter, data)){
bool socket_serialize_message(PMockSocket::Message &msg, const T &data)
Serialize a message from data.
PSendStatus::PSendStatus sendData(const T &data, PSendFlag::PSendFlag flag=PSendFlag::BLOCK)
Send data with the socket.
PGenericVecMock< DataStreamMsg > p_mock
Mock handler.
PSendStatus::PSendStatus sendMsg(const Message &msg, PSendFlag::PSendFlag flag=PSendFlag::BLOCK)
Specialisation to send a Message with the socket.
DataStreamMsg Message
Define the type of message used by the PAbstractSocketManager.
PRecvStatus::PRecvStatus recvMsg(Message &msg, PRecvFlag::PRecvFlag flag=PRecvFlag::BLOCK)
Recieved data with the socket.
PRecvStatus::PRecvStatus recvData(T &data, PRecvFlag::PRecvFlag flag=PRecvFlag::BLOCK)
Recieved data with the socket.
PRecvFlag
describe the receiving flag of the Socket
PRecvStatus
describe the result of the recv
@ CANNOT_DESERIALIZE_DATA
PSendFlag
describe the sending flag of the Socket
PSendStatus
describe the result of the send