hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
Classes | Typedefs | Functions
hobbes::net Namespace Reference

Classes

struct  aioTupleRead
 
struct  aioTupleRead< e, e, Ts... >
 
struct  aioTupleState
 
struct  aioTupleState< T, Ts... >
 
struct  aioTupleStateAt
 
struct  aioTupleStateAt< 0, std::pair< U, V > >
 
struct  aioTupleStateAt< i, std::pair< U, V > >
 
struct  AsyncReader
 
struct  AsyncRPCFunc
 
struct  AsyncRPCFunc< R(Args...)>
 
struct  AsyncRPCFunc< void(Args...)>
 
struct  AsyncScheduler
 
struct  cannot_memcpy
 
struct  cannot_memcpy< T, typename io< T >::can_memcpy >
 
struct  io
 
struct  io< const char * >
 
struct  io< std::map< K, T > >
 
struct  io< std::pair< U, V > >
 
struct  io< std::string >
 
struct  io< std::tuple< Ts... > >
 
struct  io< std::vector< T >, typename cannot_memcpy< T >::type >
 
struct  io< std::vector< T >, typename io< T >::can_memcpy >
 
struct  io< T, typename T::is_hnet_alias >
 
struct  io< T, typename T::is_hnet_enum >
 
struct  io< T, typename T::is_hnet_struct >
 
struct  io< T, typename T::is_hnet_variant >
 
struct  io< unit >
 
struct  ioTuple
 
struct  ioTuple< e, e, Ts... >
 
struct  oSeq
 
struct  oSeq< T, Ts... >
 
struct  RPCDef
 
struct  RPCFunc
 
struct  RPCFunc< R(Args...)>
 
struct  RPCFunc< void(Args...)>
 
struct  RPCTyDef
 
struct  RPCTyDef< R(Args...)>
 
struct  RPCTyDef< void(Args...)>
 
struct  unit
 

Typedefs

typedef std::vector< uint8_t > bytes
 
typedef std::vector< RPCDefRPCDefs
 

Functions

void sendData (int socket, const uint8_t *d, size_t sz)
 
void sendString (int socket, const std::string &s)
 
void sendBytes (int socket, const bytes &x)
 
void recvData (int socket, uint8_t *d, size_t sz)
 
void recvString (int socket, std::string *x)
 
void setBlockingBit (int socket, bool block)
 
size_t recvDataPartial (int socket, uint8_t *d, size_t sz)
 
int initSession (int s, const RPCDefs &rpcds)
 
int makeConnection (int s, sockaddr *saddr, size_t len)
 
int makeConnection (const hostent &host, int port)
 
int makeConnection (const std::string &host, size_t port)
 
int makeConnection (const std::string &host, const std::string &port)
 
int makeConnection (const std::string &hostport)
 
template<typename T >
void w (const T &x, bytes *out)
 
void ws (const char *x, bytes *out)
 
void ws (const std::string &x, bytes *out)
 
void ws (const bytes &x, bytes *out)
 
void encode_primty (const char *tn, bytes *out)
 
 _HNET_DEFINE_PRIMTYS (bool, "bool")
 
 _HNET_DEFINE_PRIMTYS (uint8_t, "byte")
 
 _HNET_DEFINE_PRIMTYS (char, "char")
 
 _HNET_DEFINE_PRIMTYS (int16_t, "short")
 
 _HNET_DEFINE_PRIMTYS (uint16_t, "short")
 
 _HNET_DEFINE_PRIMTYS (int32_t, "int")
 
 _HNET_DEFINE_PRIMTYS (uint32_t, "int")
 
 _HNET_DEFINE_PRIMTYS (int64_t, "long")
 
 _HNET_DEFINE_PRIMTYS (uint64_t, "long")
 
 _HNET_DEFINE_PRIMTYS (float, "float")
 
 _HNET_DEFINE_PRIMTYS (double, "double")
 

Typedef Documentation

◆ bytes

typedef std::vector<uint8_t> hobbes::net::bytes

◆ RPCDefs

typedef std::vector<RPCDef> hobbes::net::RPCDefs

Function Documentation

◆ _HNET_DEFINE_PRIMTYS() [1/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( bool  ,
"bool"   
)

◆ _HNET_DEFINE_PRIMTYS() [2/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( uint8_t  ,
"byte"   
)

◆ _HNET_DEFINE_PRIMTYS() [3/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( char  ,
"char"   
)

◆ _HNET_DEFINE_PRIMTYS() [4/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( int16_t  ,
"short"   
)

◆ _HNET_DEFINE_PRIMTYS() [5/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( uint16_t  ,
"short"   
)

◆ _HNET_DEFINE_PRIMTYS() [6/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( int32_t  ,
"int"   
)

◆ _HNET_DEFINE_PRIMTYS() [7/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( uint32_t  ,
"int"   
)

◆ _HNET_DEFINE_PRIMTYS() [8/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( int64_t  ,
"long"   
)

◆ _HNET_DEFINE_PRIMTYS() [9/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( uint64_t  ,
"long"   
)

◆ _HNET_DEFINE_PRIMTYS() [10/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( float  ,
"float"   
)

◆ _HNET_DEFINE_PRIMTYS() [11/11]

hobbes::net::_HNET_DEFINE_PRIMTYS ( double  ,
"double"   
)

◆ encode_primty()

void hobbes::net::encode_primty ( const char *  tn,
bytes out 
)
inline

◆ initSession()

int hobbes::net::initSession ( int  s,
const RPCDefs rpcds 
)
inline

◆ makeConnection() [1/5]

int hobbes::net::makeConnection ( int  s,
sockaddr *  saddr,
size_t  len 
)
inline

◆ makeConnection() [2/5]

int hobbes::net::makeConnection ( const hostent &  host,
int  port 
)
inline

◆ makeConnection() [3/5]

int hobbes::net::makeConnection ( const std::string &  host,
size_t  port 
)
inline

◆ makeConnection() [4/5]

int hobbes::net::makeConnection ( const std::string &  host,
const std::string &  port 
)
inline

◆ makeConnection() [5/5]

int hobbes::net::makeConnection ( const std::string &  hostport)
inline

◆ recvData()

void hobbes::net::recvData ( int  socket,
uint8_t *  d,
size_t  sz 
)
inline

◆ recvDataPartial()

size_t hobbes::net::recvDataPartial ( int  socket,
uint8_t *  d,
size_t  sz 
)
inline

◆ recvString()

void hobbes::net::recvString ( int  socket,
std::string *  x 
)
inline

◆ sendBytes()

void hobbes::net::sendBytes ( int  socket,
const bytes x 
)
inline

◆ sendData()

void hobbes::net::sendData ( int  socket,
const uint8_t *  d,
size_t  sz 
)
inline

◆ sendString()

void hobbes::net::sendString ( int  socket,
const std::string &  s 
)
inline

◆ setBlockingBit()

void hobbes::net::setBlockingBit ( int  socket,
bool  block 
)
inline

◆ w()

template<typename T >
void hobbes::net::w ( const T &  x,
bytes out 
)

◆ ws() [1/3]

void hobbes::net::ws ( const char *  x,
bytes out 
)
inline

◆ ws() [2/3]

void hobbes::net::ws ( const std::string &  x,
bytes out 
)
inline

◆ ws() [3/3]

void hobbes::net::ws ( const bytes x,
bytes out 
)
inline