Tacopie  3.0.0
Tacopie is a TCP Client & Server C++11 library.
All Classes Functions Variables Typedefs Enumerations
Namespaces | Classes | Typedefs | Functions | Variables
tacopie Namespace Reference

Namespaces

 utils
 

Classes

class  io_service
 
class  logger
 
class  logger_iface
 
class  self_pipe
 
class  tacopie_error
 
class  tcp_client
 
class  tcp_server
 
class  tcp_socket
 

Typedefs

typedef int fd_t
 file descriptor platform type More...
 

Functions

const std::shared_ptr< io_service > & get_default_io_service (std::uint32_t num_io_workers=1)
 
void set_default_io_service (const std::shared_ptr< io_service > &service)
 
void debug (const std::string &msg, const std::string &file, std::size_t line)
 
void info (const std::string &msg, const std::string &file, std::size_t line)
 
void warn (const std::string &msg, const std::string &file, std::size_t line)
 
void error (const std::string &msg, const std::string &file, std::size_t line)
 

Variables

std::unique_ptr< logger_ifaceactive_logger
 

Typedef Documentation

◆ fd_t

typedef int tacopie::fd_t

file descriptor platform type

Function Documentation

◆ debug()

void tacopie::debug ( const std::string &  msg,
const std::string &  file,
std::size_t  line 
)

debug logging convenience function used internaly to call the logger

Parameters
msgmessage to be logged
filefile from which the message is coming
lineline in the file of the message

◆ error()

void tacopie::error ( const std::string &  msg,
const std::string &  file,
std::size_t  line 
)

error logging convenience function used internaly to call the logger

Parameters
msgmessage to be logged
filefile from which the message is coming
lineline in the file of the message

◆ get_default_io_service()

const std::shared_ptr<io_service>& tacopie::get_default_io_service ( std::uint32_t  num_io_workers = 1)

default io_service getter & setter if the default is fetched for the first time, build it, otherwise return the current instance if the io_service already exist, return it and reset its number of workers if necessary

Parameters
num_io_workersdefines the number of background threads that will be used to process read and write callbacks. This must be a strictly positive value.
Returns
shared_ptr to the default instance of the io_service

◆ info()

void tacopie::info ( const std::string &  msg,
const std::string &  file,
std::size_t  line 
)

info logging convenience function used internaly to call the logger

Parameters
msgmessage to be logged
filefile from which the message is coming
lineline in the file of the message

◆ set_default_io_service()

void tacopie::set_default_io_service ( const std::shared_ptr< io_service > &  service)

set the default io_service to be returned by get_default_io_service

Parameters
servicethe service to be used as the default io_service instance

◆ warn()

void tacopie::warn ( const std::string &  msg,
const std::string &  file,
std::size_t  line 
)

warn logging convenience function used internaly to call the logger

Parameters
msgmessage to be logged
filefile from which the message is coming
lineline in the file of the message

Variable Documentation

◆ active_logger

std::unique_ptr<logger_iface> tacopie::active_logger

variable containing the current logger by default, not set (no logs)