Honeycomb  0.1
Component-Model Framework
Namespaces | Classes | Functions
ByteStream util

Namespaces

 honey::bytestream
 ByteStream util.
 

Classes

class  honey::ByteStreamBuf
 A stream I/O buffer of bytes, to be passed into ByteStream. More...
 
class  honey::ByteStream
 An I/O stream into which objects may be serialized and subsequently deserialized. More...
 

Functions

ByteStream & honey::operator<< (ByteStream &os, const bool val)
 Bool to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const byte val)
 Byte to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const char val)
 UTF-8 char to bytes. More...
 
template<class T , typename std::enable_if< std::is_integral< T >::value||std::is_floating_point< T >::value, int >::type = 0>
ByteStream & honey::operator<< (ByteStream &os, const T val)
 Multi-byte number to big-endian bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, Char val)
 Char to bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, bool &val)
 Bool from bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, byte &val)
 Byte from bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, char &val)
 UTF-8 char from bytes. More...
 
template<class T , typename std::enable_if< std::is_integral< T >::value||std::is_floating_point< T >::value, int >::type = 0>
ByteStream & honey::operator>> (ByteStream &is, T &val)
 Multi-byte number from big-endian bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, Char &val)
 Char from bytes. More...
 
template<class T1 , class T2 >
ByteStream & honey::operator<< (ByteStream &os, const pair< T1, T2 > &p)
 Pair to bytes. More...
 
template<class Tuple >
std::enable_if< mt::isTuple< Tuple >::value, ByteStream & >::type honey::operator<< (ByteStream &os, Tuple &&t)
 Tuple to bytes. More...
 
template<class T , szt N>
ByteStream & honey::operator<< (ByteStream &os, const array< T, N > &a)
 Array to bytes. More...
 
template<class T , szt N, typename std::enable_if<!std::is_same< T, char >::value &&!std::is_same< T, Char >::value, int >::type = 0>
ByteStream & honey::operator<< (ByteStream &os, const T(&a)[N])
 C-array to bytes. C-arrays of chars are interpreted as C-strings, so for proper char arrays use std::array instead. More...
 
template<class T , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const vector< T, Alloc > &vec)
 Vector to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const String &str)
 String to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const Char *str)
 C-string to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const std::string &str)
 UTF-8 string to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const char *str)
 UTF-8 C-string to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const Bytes &bs)
 Bytes to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, ByteBufConst bs)
 Byte buffer to bytes. More...
 
template<class T , class Compare , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const set< T, Compare, Alloc > &set)
 Set to bytes. More...
 
template<class T , class Compare , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const multiset< T, Compare, Alloc > &set)
 Multi-Set to bytes. More...
 
template<class Key , class Hash , class KeyEqual , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const unordered_set< Key, Hash, KeyEqual, Alloc > &set)
 Unordered Set to bytes. More...
 
template<class Key , class Hash , class KeyEqual , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const unordered_multiset< Key, Hash, KeyEqual, Alloc > &set)
 Unordered Multi-Set to bytes. More...
 
template<class Key , class T , class Compare , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const std::map< Key, T, Compare, Alloc > &map)
 Map to bytes. More...
 
template<class Key , class T , class Compare , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const multimap< Key, T, Compare, Alloc > &map)
 Multi-Map to bytes. More...
 
template<class Key , class T , class Hash , class KeyEqual , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const unordered_map< Key, T, Hash, KeyEqual, Alloc > &map)
 Unordered Map to bytes. More...
 
template<class Key , class T , class Hash , class KeyEqual , class Alloc >
ByteStream & honey::operator<< (ByteStream &os, const unordered_multimap< Key, T, Hash, KeyEqual, Alloc > &map)
 Unordered Multi-Map to bytes. More...
 
template<class T1 , class T2 >
ByteStream & honey::operator>> (ByteStream &is, pair< T1, T2 > &p)
 Pair from bytes. More...
 
template<class Tuple >
std::enable_if< mt::isTuple< Tuple >::value, ByteStream & >::type honey::operator>> (ByteStream &is, Tuple &t)
 Tuple from bytes. More...
 
template<class T , szt N>
ByteStream & honey::operator>> (ByteStream &is, array< T, N > &a)
 Array from bytes. More...
 
template<class T , szt N, typename std::enable_if<!std::is_same< T, char >::value &&!std::is_same< T, Char >::value, int >::type = 0>
ByteStream & honey::operator>> (ByteStream &is, T(&a)[N])
 C-array from bytes. C-arrays of chars are interpreted as C-strings, so for proper char arrays use std::array instead. More...
 
template<class T , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, vector< T, Alloc > &vec)
 Vector from bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, String &str)
 String from bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, Char *str)
 C-string from bytes. Pointer must point to allocated memory that is large enough to hold string including null character. More...
 
ByteStream & honey::operator>> (ByteStream &is, std::string &str)
 UTF-8 string from bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, char *str)
 UTF-8 C-string from bytes. Pointer must point to allocated memory that is large enough to hold string including null character. More...
 
ByteStream & honey::operator>> (ByteStream &is, Bytes &bs)
 Bytes from bytes. More...
 
template<class T , typename std::enable_if< std::is_same< T, byte * >::value, int >::type = 0>
ByteStream & honey::operator>> (ByteStream &is, T bs)
 Byte C-string from bytes, unimplemented, use ByteStream::read(bs, n) instead. More...
 
template<class T , class Compare , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, set< T, Compare, Alloc > &set)
 Set from bytes. More...
 
template<class T , class Compare , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, multiset< T, Compare, Alloc > &set)
 Multi-Set from bytes. More...
 
template<class Key , class Hash , class KeyEqual , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, unordered_set< Key, Hash, KeyEqual, Alloc > &set)
 Unordered Set from bytes. More...
 
template<class Key , class Hash , class KeyEqual , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, unordered_multiset< Key, Hash, KeyEqual, Alloc > &set)
 Unordered Multi-Set from bytes. More...
 
template<class Key , class T , class Compare , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, std::map< Key, T, Compare, Alloc > &map)
 Map from bytes. More...
 
template<class Key , class T , class Compare , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, multimap< Key, T, Compare, Alloc > &map)
 Multi-Map from bytes. More...
 
template<class Key , class T , class Hash , class KeyEqual , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, unordered_map< Key, T, Hash, KeyEqual, Alloc > &map)
 Unordered Map from bytes. More...
 
template<class Key , class T , class Hash , class KeyEqual , class Alloc >
ByteStream & honey::operator>> (ByteStream &is, unordered_multimap< Key, T, Hash, KeyEqual, Alloc > &map)
 Unordered Multi-Map from bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const Id &val)
 Id to bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, Id &val)
 Id from bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const IdLiteral &val)
 Literal id to bytes. More...
 
ByteStream & honey::operator<< (ByteStream &os, const NameId &val)
 Named id to bytes. More...
 
ByteStream & honey::operator>> (ByteStream &is, NameId &val)
 Named id from bytes. More...
 
template<class T , class Fin >
ByteStream & honey::operator<< (ByteStream &os, const UniquePtr< T, Fin > &p)
 UniquePtr to bytes, outputs object pointed to (and exists flag), or a null flag if no object. More...
 
template<class T , class Fin >
ByteStream & honey::operator>> (ByteStream &is, UniquePtr< T, Fin > &p)
 UniquePtr from bytes, object is allocated if necessary using current bytestream allocator. More...
 
template<class T >
ByteStream & honey::operator<< (ByteStream &os, const SharedPtr< T > &p)
 SharedPtr to bytes, outputs object pointed to (and exists flag), or index into current shared table if already output (index=flag-2), or a null flag if no object. More...
 
template<class T >
ByteStream & honey::operator>> (ByteStream &is, SharedPtr< T > &p)
 SharedPtr from bytes, object is allocated if necessary using current bytestream allocator. More...
 
template<class Rep , class Period >
ByteStream & honey::operator<< (ByteStream &os, const Duration< Rep, Period > &d)
 Duration to bytes. More...
 
template<class Rep , class Period >
ByteStream & honey::operator>> (ByteStream &is, Duration< Rep, Period > &d)
 Duration from bytes. More...
 

Detailed Description

Function Documentation

ByteStream& honey::operator<< ( ByteStream os,
const bool  val 
)
inline

Bool to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const byte  val 
)
inline

Byte to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const char  val 
)
inline

UTF-8 char to bytes.

template<class T , typename std::enable_if< std::is_integral< T >::value||std::is_floating_point< T >::value, int >::type = 0>
ByteStream & honey::operator<< ( ByteStream os,
const T  val 
)

Multi-byte number to big-endian bytes.

Byte C-string to bytes, unimplemented, use ByteBufConst(bs, n) instead.

ByteStream& honey::operator<< ( ByteStream os,
Char  val 
)
inline

Char to bytes.

template<class T1 , class T2 >
ByteStream& honey::operator<< ( ByteStream os,
const pair< T1, T2 > &  p 
)

Pair to bytes.

template<class Tuple >
std::enable_if<mt::isTuple<Tuple>::value, ByteStream&>::type honey::operator<< ( ByteStream os,
Tuple &&  t 
)

Tuple to bytes.

template<class T , szt N>
ByteStream& honey::operator<< ( ByteStream os,
const array< T, N > &  a 
)

Array to bytes.

template<class T , szt N, typename std::enable_if<!std::is_same< T, char >::value &&!std::is_same< T, Char >::value, int >::type = 0>
ByteStream& honey::operator<< ( ByteStream os,
const T(&)  a[N] 
)

C-array to bytes. C-arrays of chars are interpreted as C-strings, so for proper char arrays use std::array instead.

template<class T , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const vector< T, Alloc > &  vec 
)

Vector to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const String str 
)
inline

String to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const Char str 
)
inline

C-string to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const std::string &  str 
)
inline

UTF-8 string to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const char *  str 
)
inline

UTF-8 C-string to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const Bytes bs 
)
inline

Bytes to bytes.

ByteStream& honey::operator<< ( ByteStream os,
ByteBufConst  bs 
)
inline

Byte buffer to bytes.

template<class T , class Compare , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const set< T, Compare, Alloc > &  set 
)

Set to bytes.

template<class T , class Compare , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const multiset< T, Compare, Alloc > &  set 
)

Multi-Set to bytes.

template<class Key , class Hash , class KeyEqual , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const unordered_set< Key, Hash, KeyEqual, Alloc > &  set 
)

Unordered Set to bytes.

template<class Key , class Hash , class KeyEqual , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const unordered_multiset< Key, Hash, KeyEqual, Alloc > &  set 
)

Unordered Multi-Set to bytes.

template<class Key , class T , class Compare , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const std::map< Key, T, Compare, Alloc > &  map 
)

Map to bytes.

template<class Key , class T , class Compare , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const multimap< Key, T, Compare, Alloc > &  map 
)

Multi-Map to bytes.

template<class Key , class T , class Hash , class KeyEqual , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const unordered_map< Key, T, Hash, KeyEqual, Alloc > &  map 
)

Unordered Map to bytes.

template<class Key , class T , class Hash , class KeyEqual , class Alloc >
ByteStream& honey::operator<< ( ByteStream os,
const unordered_multimap< Key, T, Hash, KeyEqual, Alloc > &  map 
)

Unordered Multi-Map to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const Id val 
)
inline

Id to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const IdLiteral val 
)
inline

Literal id to bytes.

ByteStream& honey::operator<< ( ByteStream os,
const NameId val 
)
inline

Named id to bytes.

template<class T , class Fin >
ByteStream& honey::operator<< ( ByteStream os,
const UniquePtr< T, Fin > &  p 
)

UniquePtr to bytes, outputs object pointed to (and exists flag), or a null flag if no object.

template<class T >
ByteStream& honey::operator<< ( ByteStream os,
const SharedPtr< T > &  p 
)

SharedPtr to bytes, outputs object pointed to (and exists flag), or index into current shared table if already output (index=flag-2), or a null flag if no object.

template<class Rep , class Period >
ByteStream& honey::operator<< ( ByteStream os,
const Duration< Rep, Period > &  d 
)

Duration to bytes.

ByteStream& honey::operator>> ( ByteStream is,
bool &  val 
)
inline

Bool from bytes.

ByteStream& honey::operator>> ( ByteStream is,
byte val 
)
inline

Byte from bytes.

ByteStream& honey::operator>> ( ByteStream is,
char &  val 
)
inline

UTF-8 char from bytes.

template<class T , typename std::enable_if< std::is_integral< T >::value||std::is_floating_point< T >::value, int >::type = 0>
ByteStream& honey::operator>> ( ByteStream is,
T &  val 
)

Multi-byte number from big-endian bytes.

ByteStream& honey::operator>> ( ByteStream is,
Char val 
)
inline

Char from bytes.

template<class T1 , class T2 >
ByteStream& honey::operator>> ( ByteStream is,
pair< T1, T2 > &  p 
)

Pair from bytes.

template<class Tuple >
std::enable_if<mt::isTuple<Tuple>::value, ByteStream&>::type honey::operator>> ( ByteStream is,
Tuple &  t 
)

Tuple from bytes.

template<class T , szt N>
ByteStream& honey::operator>> ( ByteStream is,
array< T, N > &  a 
)

Array from bytes.

template<class T , szt N, typename std::enable_if<!std::is_same< T, char >::value &&!std::is_same< T, Char >::value, int >::type = 0>
ByteStream& honey::operator>> ( ByteStream is,
T(&)  a[N] 
)

C-array from bytes. C-arrays of chars are interpreted as C-strings, so for proper char arrays use std::array instead.

template<class T , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
vector< T, Alloc > &  vec 
)

Vector from bytes.

ByteStream& honey::operator>> ( ByteStream is,
String str 
)
inline

String from bytes.

ByteStream& honey::operator>> ( ByteStream is,
Char str 
)
inline

C-string from bytes. Pointer must point to allocated memory that is large enough to hold string including null character.

ByteStream& honey::operator>> ( ByteStream is,
std::string &  str 
)
inline

UTF-8 string from bytes.

ByteStream& honey::operator>> ( ByteStream is,
char *  str 
)
inline

UTF-8 C-string from bytes. Pointer must point to allocated memory that is large enough to hold string including null character.

ByteStream& honey::operator>> ( ByteStream is,
Bytes bs 
)
inline

Bytes from bytes.

template<class T , typename std::enable_if< std::is_same< T, byte * >::value, int >::type = 0>
ByteStream& honey::operator>> ( ByteStream is,
bs 
)

Byte C-string from bytes, unimplemented, use ByteStream::read(bs, n) instead.

template<class T , class Compare , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
set< T, Compare, Alloc > &  set 
)

Set from bytes.

template<class T , class Compare , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
multiset< T, Compare, Alloc > &  set 
)

Multi-Set from bytes.

template<class Key , class Hash , class KeyEqual , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
unordered_set< Key, Hash, KeyEqual, Alloc > &  set 
)

Unordered Set from bytes.

template<class Key , class Hash , class KeyEqual , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
unordered_multiset< Key, Hash, KeyEqual, Alloc > &  set 
)

Unordered Multi-Set from bytes.

template<class Key , class T , class Compare , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
std::map< Key, T, Compare, Alloc > &  map 
)

Map from bytes.

template<class Key , class T , class Compare , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
multimap< Key, T, Compare, Alloc > &  map 
)

Multi-Map from bytes.

template<class Key , class T , class Hash , class KeyEqual , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
unordered_map< Key, T, Hash, KeyEqual, Alloc > &  map 
)

Unordered Map from bytes.

template<class Key , class T , class Hash , class KeyEqual , class Alloc >
ByteStream& honey::operator>> ( ByteStream is,
unordered_multimap< Key, T, Hash, KeyEqual, Alloc > &  map 
)

Unordered Multi-Map from bytes.

ByteStream& honey::operator>> ( ByteStream is,
Id val 
)
inline

Id from bytes.

ByteStream& honey::operator>> ( ByteStream is,
NameId val 
)
inline

Named id from bytes.

template<class T , class Fin >
ByteStream& honey::operator>> ( ByteStream is,
UniquePtr< T, Fin > &  p 
)

UniquePtr from bytes, object is allocated if necessary using current bytestream allocator.

template<class T >
ByteStream& honey::operator>> ( ByteStream is,
SharedPtr< T > &  p 
)

SharedPtr from bytes, object is allocated if necessary using current bytestream allocator.

template<class Rep , class Period >
ByteStream& honey::operator>> ( ByteStream is,
Duration< Rep, Period > &  d 
)

Duration from bytes.