![]() |
|
PhoenixSocket
4.0.1
Library which integrates socket unix use in Phoenix
|
Example of a mock socket with vector of messages. More...
#include <PMockBackendFile.h>
Collaboration diagram for PMockSocketFile:Public Types | |
| typedef DataStreamMsg | Message |
| Define the type of message used by the PAbstractSocketManager. | |
| typedef PMockParamFile | Param |
| Define the type of extra parameters which can be used to create a Socket used by the PAbstractSocketManager. | |
Public Member Functions | |
| void | close () |
| Close the PMockSocketFile. | |
| bool | createClientSocket (const PSocketParam &socketParam, const Param &extraParam) |
| Initialise a client socket. | |
| bool | createServerSocket (const PSocketParam &socketParam, const Param &extraParam) |
| Initialise a server socket. | |
| bool | isConnected () const |
| Say if the PMockSocketFile is connected. | |
| PMockSocketFile () | |
| Default constructor of hte PMockSocketFile. | |
| template<typename T> | |
| PRecvStatus::PRecvStatus | recvData (T &data, PRecvFlag::PRecvFlag flag) |
| Recieved data with the socket. | |
| PRecvStatus::PRecvStatus | recvMsg (Message &msg, PRecvFlag::PRecvFlag flag) |
| Recieved data with the socket. | |
| template<typename T> | |
| PSendStatus::PSendStatus | sendData (const T &data, PSendFlag::PSendFlag flag) |
| Send data with the socket. | |
| PSendStatus::PSendStatus | sendMsg (const Message &msg, PSendFlag::PSendFlag flag) |
| Specialisation to send a Message with the socket. | |
| void | setIsMockRecord (bool isMockRecord) |
| Set the mock prefix (where to find/save it) | |
| void | setMockPrefix (const std::string &mockPrefix) |
| Set the mock prefix (where to find/save it) | |
| virtual | ~PMockSocketFile () |
| Default destructor of hte PMockSocketFile. | |
Private Attributes | |
| Param | p_extraParam |
| Extra parameters of the socket. | |
| PGenericFileMock< DataStreamMsg > | p_mock |
| Mock handler. | |
| PSocketParam | p_socketParam |
| Parameters of the socket. | |
Example of a mock socket with vector of messages.
Definition at line 17 of file PMockBackendFile.h.
| typedef DataStreamMsg PMockSocketFile::Message |
Define the type of message used by the PAbstractSocketManager.
Definition at line 20 of file PMockBackendFile.h.
| typedef PMockParamFile PMockSocketFile::Param |
Define the type of extra parameters which can be used to create a Socket used by the PAbstractSocketManager.
Definition at line 22 of file PMockBackendFile.h.
| PMockSocketFile::PMockSocketFile | ( | ) |
Default constructor of hte PMockSocketFile.
Definition at line 27 of file PMockBackendFile.cpp.
|
virtual |
Default destructor of hte PMockSocketFile.
Definition at line 32 of file PMockBackendFile.cpp.
| void PMockSocketFile::close | ( | ) |
Close the PMockSocketFile.
Definition at line 111 of file PMockBackendFile.cpp.
References p_mock.
| bool PMockSocketFile::createClientSocket | ( | const PSocketParam & | socketParam, |
| const Param & | extraParam ) |
Initialise a client socket.
| socketParam | : parameters to be use to initialise the socket (hostname, port, etc) |
| extraParam | : extra customisable parameters for the creation of the socket (depends on the backend) |
Definition at line 40 of file PMockBackendFile.cpp.
References p_extraParam, and p_socketParam.
Referenced by PMockBackendFile::createClientSocket(), createServerSocket(), and phoenix_createMockBackend().
Here is the caller graph for this function:| bool PMockSocketFile::createServerSocket | ( | const PSocketParam & | socketParam, |
| const Param & | extraParam ) |
Initialise a server socket.
| socketParam | : parameters to be use to initialise the socket (hostname, port, etc) |
| extraParam | : extra customisable parameters for the creation of the socket (depends on the backend) |
Definition at line 50 of file PMockBackendFile.cpp.
References createClientSocket().
Here is the call graph for this function:| bool PMockSocketFile::isConnected | ( | ) | const |
Say if the PMockSocketFile is connected.
Definition at line 106 of file PMockBackendFile.cpp.
| PRecvStatus::PRecvStatus PMockSocketFile::recvData | ( | T & | data, |
| PRecvFlag::PRecvFlag | flag ) |
Recieved data with the socket.
| [out] | data | : data to be recieved with the socket |
| flag | : recieving flag (BLOCK, NON_BLOCK) |
Definition at line 52 of file PMockBackendFile_impl.h.
References PRecvStatus::CANNOT_DESERIALIZE_DATA, PRecvStatus::NO_MESSAGE_RECEIVED, PRecvStatus::OK, and recvMsg().
Here is the call graph for this function:| PRecvStatus::PRecvStatus PMockSocketFile::recvMsg | ( | PMockSocketFile::Message & | msg, |
| PRecvFlag::PRecvFlag | flag ) |
Recieved data with the socket.
| [out] | msg | : Message to be recieved with the socket |
| flag | : recieving flag (BLOCK, NON_BLOCK) |
Definition at line 89 of file PMockBackendFile.cpp.
References PRecvStatus::NO_MESSAGE_RECEIVED, PRecvStatus::OK, and p_mock.
Referenced by recvData().
Here is the caller graph for this function:| PSendStatus::PSendStatus PMockSocketFile::sendData | ( | const T & | data, |
| PSendFlag::PSendFlag | flag ) |
Send data with the socket.
| data | : data to be sent with the socket |
| flag | : sending flag (BLOCK, NON_BLOCK) |
Definition at line 18 of file PMockBackendFile_impl.h.
References PSendStatus::CANNOT_SERIALIZE_DATA, PSendStatus::OK, p_mock, and sendMsg().
Here is the call graph for this function:| PSendStatus::PSendStatus PMockSocketFile::sendMsg | ( | const Message & | msg, |
| PSendFlag::PSendFlag | flag ) |
Specialisation to send a Message with the socket.
| msg | : Message to be sent |
| flag | : sending flag (BLOCK, NON_BLOCK) |
Definition at line 75 of file PMockBackendFile.cpp.
References PSendStatus::OK, and p_mock.
Referenced by sendData().
Here is the caller graph for this function:| void PMockSocketFile::setIsMockRecord | ( | bool | isMockRecord | ) |
Set the mock prefix (where to find/save it)
| isMockRecord | : true if the mock has to be recorded |
Definition at line 66 of file PMockBackendFile.cpp.
References p_mock.
Referenced by phoenix_createMockBackend().
Here is the caller graph for this function:| void PMockSocketFile::setMockPrefix | ( | const std::string & | mockPrefix | ) |
Set the mock prefix (where to find/save it)
| mockPrefix | : prefix of the mock to find or write it |
Definition at line 57 of file PMockBackendFile.cpp.
References p_mock, and p_socketParam.
Referenced by phoenix_createMockBackend().
Here is the caller graph for this function:
|
private |
Extra parameters of the socket.
Definition at line 49 of file PMockBackendFile.h.
Referenced by createClientSocket().
|
private |
Mock handler.
Definition at line 45 of file PMockBackendFile.h.
Referenced by close(), recvMsg(), sendData(), sendMsg(), setIsMockRecord(), and setMockPrefix().
|
private |
Parameters of the socket.
Definition at line 47 of file PMockBackendFile.h.
Referenced by createClientSocket(), and setMockPrefix().