PhoenixSocket  4.0.1
Library which integrates socket unix use in Phoenix
Loading...
Searching...
No Matches
PMockBackend.h File Reference
#include "PSocketFlag.h"
#include "phoenix_generic_mock.h"
#include "PMockBackend_impl.h"
+ Include dependency graph for PMockBackend.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PMockBackend
 Backend to use Mock library with PAbtractSocket. More...
 
struct  PMockParam
 Set of parameters to be passed to create a socket with mock backend. More...
 
class  PMockSocket
 Example of a mock socket with vector of messages. More...
 

Functions

bool phoenix_createMockBackend (PMockSocket &mock, const PSocketParam &socketParam, const std::string &prefix="", const PMockParam &extraParam=PMockParam())
 Create a mock backend.
 

Function Documentation

◆ phoenix_createMockBackend()

bool phoenix_createMockBackend ( PMockSocket & mock,
const PSocketParam & socketParam,
const std::string & prefix,
const PMockParam & extraParam )

Create a mock backend.

Parameters
[out]mock: mock socket to be initialised
socketParam: parameters of the socket (hostname, port, etc)
prefix: prefix of the mock file
extraParam: extra parameters of the mock configuration
Returns
true on success, false otherwise

Definition at line 19 of file PMockBackend.cpp.

19 {
20 mock.setIsMockRecord(true);
21 bool b = mock.createClientSocket(socketParam, extraParam);
22 mock.setMockPrefix(prefix);
23 return b;
24}
bool createClientSocket(const PSocketParam &socketParam, const Param &extraParam)
Initialise a client 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)

References PMockSocket::createClientSocket(), PMockSocket::setIsMockRecord(), and PMockSocket::setMockPrefix().

+ Here is the call graph for this function: