hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
Namespaces | Macros | Functions
codec.H File Reference
#include <iostream>
#include <vector>
#include <map>
#include <unistd.h>
#include <string.h>
Include dependency graph for codec.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 hobbes
 

Macros

#define PRIM_CODEC(T)
 

Functions

 hobbes::PRIM_CODEC (bool)
 
 hobbes::PRIM_CODEC (unsigned char)
 
 hobbes::PRIM_CODEC (char)
 
 hobbes::PRIM_CODEC (short)
 
 hobbes::PRIM_CODEC (int)
 
 hobbes::PRIM_CODEC (long)
 
 hobbes::PRIM_CODEC (size_t)
 
 hobbes::PRIM_CODEC (float)
 
 hobbes::PRIM_CODEC (double)
 
void hobbes::encode (const std::string &x, std::ostream &out)
 
void hobbes::decode (std::string *x, std::istream &in)
 
template<typename T >
void hobbes::encode (const std::vector< T > &xs, std::ostream &out)
 
template<typename T >
void hobbes::decode (std::vector< T > *xs, std::istream &in)
 
template<typename U , typename V >
void hobbes::encode (const std::pair< U, V > &p, std::ostream &out)
 
template<typename U , typename V >
void hobbes::decode (std::pair< U, V > *p, std::istream &in)
 
template<typename K , typename V >
void hobbes::encode (const std::map< K, V > &m, std::ostream &out)
 
template<typename K , typename V >
void hobbes::decode (std::map< K, V > *m, std::istream &in)
 
void hobbes::fdread (int fd, char *x, size_t len)
 
void hobbes::fdread (int fd, unsigned char *x, size_t len)
 
void hobbes::fdread (int fd, char *x)
 
void hobbes::fdread (int fd, uint8_t *x)
 
void hobbes::fdread (int fd, int *x)
 
void hobbes::fdread (int fd, uint32_t *x)
 
void hobbes::fdread (int fd, size_t *x)
 
void hobbes::fdread (int fd, std::string *x)
 
template<typename T >
void hobbes::fdread (int fd, std::vector< T > *xs)
 
void hobbes::fdwrite (int fd, const char *x, size_t len)
 
void hobbes::fdwrite (int fd, const unsigned char *x, size_t len)
 
void hobbes::fdwrite (int fd, char x)
 
void hobbes::fdwrite (int fd, uint8_t x)
 
void hobbes::fdwrite (int fd, int x)
 
void hobbes::fdwrite (int fd, uint32_t x)
 
void hobbes::fdwrite (int fd, size_t x)
 
void hobbes::fdwrite (int fd, const std::string &x)
 
template<typename T >
void hobbes::fdwrite (int fd, const std::vector< T > &xs)
 
bool hobbes::unmarkBadFD (int fd)
 

Macro Definition Documentation

◆ PRIM_CODEC

#define PRIM_CODEC (   T)
Value:
inline void encode(T x, std::ostream& out) { out.write((const char*)&x, sizeof(x)); } \
inline void decode(T* x, std::istream& in) { in.read((char*)x, sizeof(*x)); }
void decode(std::map< K, V > *m, std::istream &in)
Definition: codec.H:81
void encode(const std::map< K, V > &m, std::ostream &out)
Definition: codec.H:73
#define out
Definition: netio.H:19
bool in(T x, const std::set< T > &xs)
Definition: array.H:47