libglass Namespace Reference


Classes

class  AliasBase
class  _Alias
class  Alias
class  BarrierBase
class  Barrier
class  record
class  chain_iterator
class  chain
class  EventBase
class  _Event
class  Event
class  EventSerializable
class  Exception
class  EmptyException
class  Glass
class  GlassClient
class  GlassServer
class  GlassServerPeer
class  MessengerBase
class  _Messenger
class  Messenger
class  Packet
class  PluginManagerBase
class  PluginManager
class  PluginBase
class  PluginInterface
class  Protocol
class  RemoteBase
class  _Remote
class  Remote
class  SerializableObject
class  RegisterObject
class  SharedBase
class  _Shared
class  Shared
class  StreamBase
class  Stream
class  TCP
class  GlassThread
class  StringPointerCompare
class  ConstStringPointerCompare
class  UDP

Typedefs

typedef std::string string
typedef int nodeFD
typedef unsigned int nodeId

Enumerations

enum  nodeRelation { None = 0, Server, Client, Peer }

Functions

std::ostream & operator<< (std::ostream &o, chain &p)
template<typename T >
bool toString (chain &c, T const &t, unsigned int nmemb=1, void *extra=NULL)
template<typename T >
bool toString (chain &c, T *const &t, unsigned int nmemb=1, void *extra=NULL)
template<typename T >
bool fromString (const chain &c, unsigned int offset, T &data, unsigned int &used, unsigned int nmemb=1, void *extra=NULL)
template<typename T >
bool fromString (const chain &c, unsigned int offset, T *const &data, unsigned int &used, unsigned int nmemb=1, void *extra=NULL)
template<typename T >
bool rawPack (chain &c, T const &t, unsigned int nmemb=1, void *extra=NULL)
template<typename T >
bool rawPack (chain &c, T *const &t, unsigned int nmemb=1, void *extra=NULL)
template<typename T >
bool rawUnpack (const chain &c, unsigned int offset, T &data, unsigned int &used, unsigned int nmemb=1, void *extra=NULL)
template<typename T >
bool rawUnpack (const chain &c, unsigned int offset, T *const &data, unsigned int &used, unsigned int nmemb=1, void *extra=NULL)
template<>
bool fromString< std::string > (const chain &c, unsigned int offset, std::string &data, unsigned int &used, unsigned int nmemb, void *extra)
template<>
bool rawPack< std::string > (chain &c, std::string const &t, unsigned int nmemb, void *extra)
template<>
bool rawUnpack< std::string > (const chain &c, unsigned int offset, std::string &data, unsigned int &used, unsigned int nmemb, void *extra)
template<>
bool rawPack< char * > (chain &c, char *const &t, unsigned int nmemb, void *extra)
template<>
bool rawUnpack< char * > (const chain &c, unsigned int offset, char *&data, unsigned int &used, unsigned int nmemb, void *extra)
std::ostream & operator<< (std::ostream &o, Packet &p)
unsigned int charToNum (unsigned char buf[4])
void numToChar (unsigned int num, unsigned char buf[4])
void numToChar (unsigned int num, char buf[4])
void shortToChar (unsigned short num, unsigned char buf[2])
unsigned short charToShort (unsigned char buf[2])

Variables

const PluginId rootBaseId = PluginId("RootBase")
const nodeFD nobodyFD = -1
const nodeFD everybodyFD = -2
const nodeId nobodyId = 0
const nodeId everybodyId = 1
const nodeId serversId = 2
const nodeId clientsId = 3
const nodeId peersId = 4
const nodeId firstId = 5
const nodeId maxId = UINT_MAX

Typedef Documentation

typedef int libglass::nodeFD

Node File Descriptor.

NodeFDs are used as an abstraction of file descriptors; they are a unique id that is associated by the Protocol class to a system file descriptor.

Definition at line 72 of file types.h.

typedef unsigned int libglass::nodeId

Node Identificator.

These are unique ids; each node has one and only one nodeId, that is used to address packets internally.

Definition at line 88 of file types.h.

typedef std::string libglass::string

Our string type.

Definition at line 40 of file types.h.


Enumeration Type Documentation

The possible relationships of two nodes.

Enumerator:
None 
Server 
Client 
Peer 

Definition at line 35 of file types.h.


Function Documentation

unsigned int libglass::charToNum ( unsigned char  buf[4]  )  [inline]

Converts a 4 byte string to a 32 bit number.

Definition at line 128 of file types.h.

unsigned short libglass::charToShort ( unsigned char  buf[2]  )  [inline]

Definition at line 160 of file types.h.

template<typename T >
bool libglass::fromString ( const chain &  c,
unsigned int  offset,
T *const &  data,
unsigned int &  used,
unsigned int  nmemb = 1,
void *  extra = NULL 
) [inline]

Definition at line 124 of file packager.h.

References libglass::chain::toString().

template<typename T >
bool libglass::fromString ( const chain &  c,
unsigned int  offset,
T &  data,
unsigned int &  used,
unsigned int  nmemb = 1,
void *  extra = NULL 
) [inline]

Unserializes

Parameters:
c The chain containing data to unserialize.
offset The start of the data to unserialize.
data A reference to unserialize to.
used A reference to a integer which will contain the number of used characters by the unserializer.
nmemb Number of elements. Use with arrays.
extra Any extra data to be used by this function.
Return values:
True if successful.
False otherwise.

Definition at line 110 of file packager.h.

References libglass::chain::toString().

template<>
bool libglass::fromString< std::string > ( const chain &  c,
unsigned int  offset,
std::string &  data,
unsigned int &  used,
unsigned int  nmemb,
void *  extra 
) [inline]

void libglass::numToChar ( unsigned int  num,
char  buf[4] 
) [inline]

Definition at line 145 of file types.h.

void libglass::numToChar ( unsigned int  num,
unsigned char  buf[4] 
) [inline]

Converts a 32 bit number to a 4 byte string.

Definition at line 138 of file types.h.

std::ostream& libglass::operator<< ( std::ostream &  o,
Packet &  p 
)

std::ostream& libglass::operator<< ( std::ostream &  o,
chain &  p 
)

template<typename T >
bool libglass::rawPack ( chain &  c,
T *const &  t,
unsigned int  nmemb = 1,
void *  extra = NULL 
) [inline]

Definition at line 150 of file packager.h.

References libglass::chain::append().

template<typename T >
bool libglass::rawPack ( chain &  c,
T const &  t,
unsigned int  nmemb = 1,
void *  extra = NULL 
) [inline]

Definition at line 145 of file packager.h.

References libglass::chain::append().

template<>
bool libglass::rawPack< char * > ( chain &  c,
char *const &  t,
unsigned int  nmemb,
void *  extra 
) [inline]

template<>
bool libglass::rawPack< std::string > ( chain &  c,
std::string const &  t,
unsigned int  nmemb,
void *  extra 
) [inline]

template<typename T >
bool libglass::rawUnpack ( const chain &  c,
unsigned int  offset,
T *const &  data,
unsigned int &  used,
unsigned int  nmemb = 1,
void *  extra = NULL 
) [inline]

Definition at line 169 of file packager.h.

References libglass::chain::substrcopy().

template<typename T >
bool libglass::rawUnpack ( const chain &  c,
unsigned int  offset,
T &  data,
unsigned int &  used,
unsigned int  nmemb = 1,
void *  extra = NULL 
) [inline]

Definition at line 157 of file packager.h.

References libglass::chain::substrcopy().

template<>
bool libglass::rawUnpack< char * > ( const chain &  c,
unsigned int  offset,
char *&  data,
unsigned int &  used,
unsigned int  nmemb,
void *  extra 
) [inline]

template<>
bool libglass::rawUnpack< std::string > ( const chain &  c,
unsigned int  offset,
std::string &  data,
unsigned int &  used,
unsigned int  nmemb,
void *  extra 
) [inline]

void libglass::shortToChar ( unsigned short  num,
unsigned char  buf[2] 
) [inline]

Converts a 16 bit number to a 4 byte string.

Definition at line 155 of file types.h.

template<typename T >
bool libglass::toString ( chain &  c,
T *const &  t,
unsigned int  nmemb = 1,
void *  extra = NULL 
) [inline]

Definition at line 80 of file packager.h.

References libglass::chain::append().

template<typename T >
bool libglass::toString ( chain &  c,
T const &  t,
unsigned int  nmemb = 1,
void *  extra = NULL 
) [inline]

Serializes

Parameters:
t The data.
c The chain to append to.
nmemb Number of elements. Use with arrays.
extra Any extra data to be used by this function.
Returns:
The length of the data appended to the chain, or -1 if an error occurred.

Definition at line 54 of file packager.h.

References libglass::chain::append().


Variable Documentation

Id for clients.

Definition at line 108 of file types.h.

Definition at line 78 of file types.h.

Id for "everybody" (multicast).

Definition at line 98 of file types.h.

Referenced by libglass::Event< T, T, T >::getEvent().

First valid id for a node.

Definition at line 118 of file types.h.

const nodeId libglass::maxId = UINT_MAX

Maximum id available.

Definition at line 123 of file types.h.

Definition at line 77 of file types.h.

Id for "nobody".

Definition at line 93 of file types.h.

Referenced by libglass::Remote< T, T, T >::getData(), and libglass::Remote< T, T, T >::setData().

Id for peers.

Definition at line 113 of file types.h.

const PluginId libglass::rootBaseId = PluginId("RootBase")

Definition at line 32 of file packet.h.

Id for servers.

Definition at line 103 of file types.h.


Generated on Fri May 28 13:19:01 2010 for libGlass by  doxygen 1.5.8