libpalliate v0.0.1
Palliate core library
transport::Client Class Referenceabstract

#include <client.h>

Inheritance diagram for transport::Client:

Public Member Functions

 Client (std::string const &_name, bool _packed=false)
 
 ~Client () override
 
bool loop () final
 
virtual void send (capnp::MessageBuilder *message)=0
 
virtual reader_t recv ()=0
 
- Public Member Functions inherited from runnable
 runnable (std::string const &_name)
 
virtual ~runnable ()
 
virtual void operator() (std::stop_token token={})
 
void run ()
 
void run (callback_f _callback)
 
void stop ()
 
auto operator<=> (runnable const &other) const
 

Public Attributes

std::function< void(Client *, reader_t)> message_event
 

Protected Attributes

bool packed
 
- Protected Attributes inherited from runnable
std::jthread thread
 
std::unique_ptr< callback_tcallback
 

Additional Inherited Members

- Public Types inherited from runnable
using callback_f = std::function< void()>
 
using callback_t = std::stop_callback< callback_f >
 
- Protected Member Functions inherited from runnable
virtual bool setup ()
 
virtual bool loop ()=0
 

Constructor & Destructor Documentation

◆ Client()

transport::Client::Client ( std::string const &  _name,
bool  _packed = false 
)
inlineexplicit

◆ ~Client()

Client::~Client ( )
override

Member Function Documentation

◆ loop()

bool Client::loop ( )
finalvirtual

Implements runnable.

◆ recv()

virtual reader_t transport::Client::recv ( )
pure virtual

Implemented in transport::TCP::Client.

◆ send()

virtual void transport::Client::send ( capnp::MessageBuilder *  message)
pure virtual

Implemented in transport::TCP::Client.

Member Data Documentation

◆ message_event

std::function<void(Client*, reader_t)> transport::Client::message_event

◆ packed

bool transport::Client::packed
protected

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