libpalliate v0.0.1
Palliate core library
transport::TCP::Client Class Reference

#include <client.h>

Inheritance diagram for transport::TCP::Client:

Public Member Functions

 Client (int _fd, bool _packed=false)
 
 Client (const char *host, unsigned port, bool _packed=false)
 
 ~Client () override
 
void send (capnp::MessageBuilder *message) override
 
reader_t recv () override
 
- Public Member Functions inherited from transport::Client
 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
 

Additional Inherited Members

- Public Types inherited from runnable
using callback_f = std::function< void()>
 
using callback_t = std::stop_callback< callback_f >
 
- Public Attributes inherited from transport::Client
std::function< void(Client *, reader_t)> message_event
 
- Protected Member Functions inherited from runnable
virtual bool setup ()
 
virtual bool loop ()=0
 
- Protected Attributes inherited from transport::Client
bool packed
 
- Protected Attributes inherited from runnable
std::jthread thread
 
std::unique_ptr< callback_tcallback
 

Constructor & Destructor Documentation

◆ Client() [1/2]

Client::Client ( int  _fd,
bool  _packed = false 
)
explicit

◆ Client() [2/2]

Client::Client ( const char *  host,
unsigned  port,
bool  _packed = false 
)

◆ ~Client()

Client::~Client ( )
override

Member Function Documentation

◆ recv()

transport::reader_t Client::recv ( )
overridevirtual

Implements transport::Client.

◆ send()

void Client::send ( capnp::MessageBuilder *  message)
overridevirtual

Implements transport::Client.


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