Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
MockNetworkClient Class Reference

A mock client satisfying NetworkClient concept. More...

Collaboration diagram for MockNetworkClient:
Collaboration graph

Public Member Functions

bool is_connected () const
 
void send_packet (std::vector< uint8_t > data)
 
void stop_client ()
 
void connect ()
 

Private Attributes

bool connected_ = false
 

Detailed Description

A mock client satisfying NetworkClient concept.

Definition at line 219 of file concepts_example.cpp.

Member Function Documentation

◆ connect()

void MockNetworkClient::connect ( )
inline

Definition at line 232 of file concepts_example.cpp.

232 {
233 connected_ = true;
234 std::cout << "Mock: client connected\n";
235 }

References connected_.

◆ is_connected()

bool MockNetworkClient::is_connected ( ) const
inline

Definition at line 221 of file concepts_example.cpp.

221{ return connected_; }

References connected_.

◆ send_packet()

void MockNetworkClient::send_packet ( std::vector< uint8_t > data)
inline

Definition at line 223 of file concepts_example.cpp.

223 {
224 std::cout << "Mock: sent " << data.size() << " bytes\n";
225 }

◆ stop_client()

void MockNetworkClient::stop_client ( )
inline

Definition at line 227 of file concepts_example.cpp.

227 {
228 connected_ = false;
229 std::cout << "Mock: client stopped\n";
230 }

References connected_.

Member Data Documentation

◆ connected_

bool MockNetworkClient::connected_ = false
private

Definition at line 238 of file concepts_example.cpp.

Referenced by connect(), is_connected(), and stop_client().


The documentation for this class was generated from the following file: