LCCD  1.5.0
Static Public Member Functions | List of all members
lccd::Xdr Class Reference

Utility functions for DB streamer objects. More...

#include <Xdr.hh>

Static Public Member Functions

static void copy (unsigned const char *from, unsigned char *dest, const int size, const int count)
 Copies the the data in XDR, i.e. More...
 
template<class T >
static void tostream (std::string &s, T *t, unsigned count)
 Writes count objects of (simple) type T to the string s in Xdr format.
 
template<class T >
static unsigned fromstream (const std::string &s, unsigned position, T *t, unsigned count)
 Read count objects of (simple) type t from the string/stream s at position. More...
 
static void tostream (std::string &s, std::string *strVal, unsigned)
 Specialization for strings - count is ignored and taken to be 1.
 
static unsigned fromstream (const std::string &s, unsigned index, std::string *strVal, unsigned count)
 Specialization for strings - count is ignored and taken to be 1. More...
 

Detailed Description

Utility functions for DB streamer objects.

These functions take care of the byte ordering and make sure the streamed data adheres to the xdr convention, e.g. every data item starts at a 32-bit word boundary.

Author
F.Gaede, DESY
Version
Id:
Xdr.hh,v 1.3 2005-09-09 08:09:37 gaede Exp

Member Function Documentation

static void lccd::Xdr::copy ( unsigned const char *  from,
unsigned char *  dest,
const int  size,
const int  count 
)
static

Copies the the data in XDR, i.e.

machine independent format from one location to the another

Referenced by fromstream(), and tostream().

template<class T >
static unsigned lccd::Xdr::fromstream ( const std::string &  s,
unsigned  position,
T *  t,
unsigned  count 
)
inlinestatic

Read count objects of (simple) type t from the string/stream s at position.


Callers have to keep the current position within the string.

Returns
the new position in the stream.

References copy().

static unsigned lccd::Xdr::fromstream ( const std::string &  s,
unsigned  index,
std::string *  strVal,
unsigned  count 
)
inlinestatic

Specialization for strings - count is ignored and taken to be 1.

Returns
the new position in the stream.

References copy().


The documentation for this class was generated from the following file: