PhoenixSocket  1.0.0
Library which integrates socket unix use in Phoenix
Loading...
Searching...
No Matches
PMockBackend.h File Reference
#include "PSocketFlag.h"
#include "phoenix_mock_socket.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...
 
struct  PMockSocket
 Data to be used to handle the mock socket. More...
 

Functions

bool phoenix_loadMockSocket (const std::string &prefix, const std::string &host, size_t port, PVecMockMessage &vecMessage)
 Load a mock of socket.
 
bool phoenix_saveMockSocket (const std::string &prefix, const std::string &host, size_t port, const PVecMockMessage &vecMessage)
 Save a mock of socket.
 

Function Documentation

◆ phoenix_loadMockSocket()

bool phoenix_loadMockSocket ( const std::string & prefix,
const std::string & host,
size_t port,
PVecMockMessage & vecMessage )

Load a mock of socket.

Parameters
fileName: file name of the mock to be loaded
[out]vecMessage: vector of message to be loaded
Returns
true on success, false otherwise

Definition at line 17 of file PMockBackend.cpp.

17 {
18 std::stringstream socketFileName;
19 socketFileName << prefix << host << "_" << port << ".pmockbackend";
20 return data_load(socketFileName.str(), vecMessage);
21}

◆ phoenix_saveMockSocket()

bool phoenix_saveMockSocket ( const std::string & prefix,
const std::string & host,
size_t port,
const PVecMockMessage & vecMessage )

Save a mock of socket.

Parameters
fileName: file name of the mock to be saved
[out]vecMessage: vector of message to be saved
Returns
true on success, false otherwise

Definition at line 28 of file PMockBackend.cpp.

28 {
29 std::stringstream socketFileName;
30 socketFileName << prefix << host << "_" << port << ".pmockbackend";
31 return data_save(socketFileName.str(), vecMessage);
32}