LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
UTIL::lXDR Class Reference

#include <lXDR.hh>

+ Inheritance diagram for UTIL::lXDR:

Public Member Functions

 lXDR (const char *filename=0, bool open_for_write=false)
 
virtual ~lXDR ()
 
void setFileName (const char *filename, bool open_for_write=false)
 
const char * getFileName (void) const
 
long getError (void) const
 
long readLong (void)
 
double readFloat (void)
 
double readDouble (void)
 
const char * readString (long &length)
 
long * readLongArray (long &length)
 
double * readFloatArray (long &length)
 
double * readDoubleArray (long &length)
 
long writeLong (long data)
 
long writeDouble (double data)
 
long writeString (const char *data)
 
long writeString (const char *data, long length)
 
long writeLongArray (const long *data, long length)
 
long writeDoubleArray (const double *data, long length)
 
void setError (long error)
 
long filePosition (long pos=-1)
 

Static Public Member Functions

static int getMajor (void)
 
static int getMinor (void)
 
static const char * getText (void)
 

Private Types

enum  {
  MAJOR = 1, MINOR = 0, DAY = 23, MONTH = 10,
  YEAR = 2003
}
 

Private Member Functions

 lXDR (const lXDR &)
 
lXDRoperator= (const lXDR &)
 
double ntohd (double d) const
 
double htond (double d) const
 
long checkRead (long *)
 
long checkRead (float *)
 
long checkRead (double *)
 
long checkWrite (long *)
 
long checkWrite (double *)
 

Private Attributes

char * _fileName
 
FILE * _fp
 
long _error {0}
 
bool _openForWrite {false}
 
bool _hasNetworkOrder {false}
 

Detailed Description

Definition at line 28 of file lXDR.hh.

Member Enumeration Documentation

anonymous enum
private
Enumerator
MAJOR 
MINOR 
DAY 
MONTH 
YEAR 

Definition at line 33 of file lXDR.hh.

Constructor & Destructor Documentation

UTIL::lXDR::lXDR ( const char *  filename = 0,
bool  open_for_write = false 
)

Definition at line 41 of file lXDR.cc.

References _hasNetworkOrder, and setFileName().

UTIL::lXDR::lXDR ( const lXDR )
private
UTIL::lXDR::~lXDR ( )
virtual

Definition at line 28 of file lXDR.cc.

References _fileName, and _fp.

Member Function Documentation

long UTIL::lXDR::checkRead ( long *  l)
private
long UTIL::lXDR::checkRead ( float *  f)
private

Definition at line 138 of file lXDR.cc.

References _error, _fp, _openForWrite, LXDR_NOFILE, LXDR_READERROR, LXDR_READONLY, and LXDR_SUCCESS.

long UTIL::lXDR::checkRead ( double *  d)
private

Definition at line 127 of file lXDR.cc.

References _error, _fp, _openForWrite, LXDR_NOFILE, LXDR_READERROR, LXDR_READONLY, LXDR_SUCCESS, and ntohd().

long UTIL::lXDR::checkWrite ( long *  l)
private
long UTIL::lXDR::checkWrite ( double *  d)
private

Definition at line 273 of file lXDR.cc.

References _error, _fp, _openForWrite, htond(), LXDR_NOFILE, LXDR_SUCCESS, LXDR_WRITEERROR, and LXDR_WRITEONLY.

long UTIL::lXDR::filePosition ( long  pos = -1)

Definition at line 338 of file lXDR.cc.

References _error, _fp, LXDR_NOFILE, and LXDR_SEEKERROR.

Referenced by UTIL::lStdHep::readEvent().

long UTIL::lXDR::getError ( void  ) const
inline
const char* UTIL::lXDR::getFileName ( void  ) const
inline

Definition at line 62 of file lXDR.hh.

References _fileName.

static int UTIL::lXDR::getMajor ( void  )
inlinestatic

Definition at line 36 of file lXDR.hh.

References MAJOR.

static int UTIL::lXDR::getMinor ( void  )
inlinestatic

Definition at line 37 of file lXDR.hh.

References MINOR.

static const char* UTIL::lXDR::getText ( void  )
inlinestatic

Definition at line 38 of file lXDR.hh.

References DAY, MAJOR, MINOR, MONTH, and YEAR.

double UTIL::lXDR::htond ( double  d) const
inlineprivate

Definition at line 124 of file lXDR.hh.

References ntohd().

Referenced by checkWrite(), and writeDoubleArray().

double UTIL::lXDR::ntohd ( double  d) const
private

Definition at line 87 of file lXDR.cc.

References _hasNetworkOrder.

Referenced by checkRead(), htond(), and readDoubleArray().

lXDR& UTIL::lXDR::operator= ( const lXDR )
private
double UTIL::lXDR::readDouble ( void  )

Definition at line 159 of file lXDR.cc.

References checkRead().

Referenced by UTIL::lStdHep::Event::read().

double * UTIL::lXDR::readDoubleArray ( long &  length)

Definition at line 220 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkRead(), LXDR_READERROR, LXDR_SUCCESS, and ntohd().

Referenced by UTIL::lStdHep::Event::read().

double UTIL::lXDR::readFloat ( void  )

Definition at line 166 of file lXDR.cc.

References checkRead().

Referenced by UTIL::lStdHep::Event::read().

double * UTIL::lXDR::readFloatArray ( long &  length)

Definition at line 234 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkRead(), LXDR_READERROR, and LXDR_SUCCESS.

long UTIL::lXDR::readLong ( void  )
long * UTIL::lXDR::readLongArray ( long &  length)
const char * UTIL::lXDR::readString ( long &  length)
void UTIL::lXDR::setError ( long  error)
inline
void UTIL::lXDR::setFileName ( const char *  filename,
bool  open_for_write = false 
)

Definition at line 49 of file lXDR.cc.

References _error, _fileName, _fp, _openForWrite, LXDR_OPENFAILURE, and LXDR_SUCCESS.

Referenced by lXDR().

long UTIL::lXDR::writeDouble ( double  data)

Definition at line 289 of file lXDR.cc.

References checkWrite().

long UTIL::lXDR::writeDoubleArray ( const double *  data,
long  length 
)

Definition at line 323 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkWrite(), htond(), LXDR_SUCCESS, and LXDR_WRITEERROR.

long UTIL::lXDR::writeLong ( long  data)

Definition at line 284 of file lXDR.cc.

References checkWrite().

long UTIL::lXDR::writeLongArray ( const long *  data,
long  length 
)

Definition at line 308 of file lXDR.cc.

References _error, _fp, _hasNetworkOrder, checkWrite(), LXDR_SUCCESS, and LXDR_WRITEERROR.

long UTIL::lXDR::writeString ( const char *  data)

Definition at line 294 of file lXDR.cc.

long UTIL::lXDR::writeString ( const char *  data,
long  length 
)

Definition at line 299 of file lXDR.cc.

References _error, _fp, checkWrite(), LXDR_SUCCESS, and LXDR_WRITEERROR.

Member Data Documentation

long UTIL::lXDR::_error {0}
private
char* UTIL::lXDR::_fileName
private

Definition at line 117 of file lXDR.hh.

Referenced by getFileName(), setFileName(), and ~lXDR().

FILE* UTIL::lXDR::_fp
private
bool UTIL::lXDR::_hasNetworkOrder {false}
private
bool UTIL::lXDR::_openForWrite {false}
private

Definition at line 120 of file lXDR.hh.

Referenced by checkRead(), checkWrite(), and setFileName().


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