DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
dabc::iostream Class Reference

class to stream binary data More...

#include <dabc/Record.h>

Inheritance diagram for dabc::iostream:
dabc::memstream dabc::sizestream

Public Member Functions

bool is_input () const
 
bool is_output () const
 
virtual bool is_real () const
 
virtual uint64_t maxstoresize () const
 return maximum size of data which can be stored in the stream More...
 
virtual bool read (void *tgt, uint64_t len)
 
bool read_double (double &v)
 
bool read_int32 (int32_t &v)
 
bool read_int64 (int64_t &v)
 
bool read_str (std::string &str)
 Restore string from the stream. More...
 
bool read_uint32 (uint32_t &v)
 
bool read_uint64 (uint64_t &v)
 
virtual bool shift (uint64_t len)
 
virtual uint64_t size () const
 return number of bytes, written or read from the stream More...
 
bool skip_object ()
 Insted of reading object we read size and shift on that size Only can be done where size stored as 32-bit integer in the current position and contains number of 64-bit stored values, including size itself. More...
 
bool verify_size (uint64_t pos, uint64_t sz)
 
virtual bool write (const void *src, uint64_t len)
 
bool write_double (double v)
 
bool write_int32 (int32_t v)
 
bool write_int64 (int64_t v)
 
bool write_str (const std::string &str)
 Store string in the stream. More...
 
bool write_uint32 (uint32_t v)
 
bool write_uint64 (uint64_t v)
 
virtual ~iostream ()
 

Static Public Member Functions

static uint64_t str_storesize (const std::string &str)
 Returns bytes count, required to store string. More...
 

Protected Member Functions

 iostream ()
 
 iostream (bool isinp)
 
virtual char * tmpbuf () const
 return temporary buffer More...
 
virtual uint64_t tmpbuf_size () const
 return number of bytes which are directly available in temporary buffer More...
 

Protected Attributes

bool fInput
 

Detailed Description

class to stream binary data

Definition at line 41 of file Record.h.

Constructor & Destructor Documentation

◆ iostream() [1/2]

dabc::iostream::iostream ( )
inlineprotected

Definition at line 50 of file Record.h.

◆ iostream() [2/2]

dabc::iostream::iostream ( bool  isinp)
inlineprotected

Definition at line 51 of file Record.h.

◆ ~iostream()

virtual dabc::iostream::~iostream ( )
inlinevirtual

Definition at line 54 of file Record.h.

Member Function Documentation

◆ tmpbuf_size()

virtual uint64_t dabc::iostream::tmpbuf_size ( ) const
inlineprotectedvirtual

return number of bytes which are directly available in temporary buffer

Reimplemented in dabc::memstream.

Definition at line 46 of file Record.h.

◆ tmpbuf()

virtual char* dabc::iostream::tmpbuf ( ) const
inlineprotectedvirtual

return temporary buffer

Reimplemented in dabc::memstream.

Definition at line 48 of file Record.h.

◆ is_input()

bool dabc::iostream::is_input ( ) const
inline

Definition at line 56 of file Record.h.

◆ is_output()

bool dabc::iostream::is_output ( ) const
inline

Definition at line 57 of file Record.h.

◆ is_real()

virtual bool dabc::iostream::is_real ( ) const
inlinevirtual

Reimplemented in dabc::sizestream.

Definition at line 58 of file Record.h.

◆ skip_object()

bool dabc::iostream::skip_object ( )

Insted of reading object we read size and shift on that size Only can be done where size stored as 32-bit integer in the current position and contains number of 64-bit stored values, including size itself.

Definition at line 23 of file Record.cxx.

◆ verify_size()

bool dabc::iostream::verify_size ( uint64_t  pos,
uint64_t  sz 
)

Definition at line 33 of file Record.cxx.

◆ write()

virtual bool dabc::iostream::write ( const void *  src,
uint64_t  len 
)
inlinevirtual

Reimplemented in dabc::memstream, and dabc::sizestream.

Definition at line 67 of file Record.h.

◆ read()

virtual bool dabc::iostream::read ( void *  tgt,
uint64_t  len 
)
inlinevirtual

Reimplemented in dabc::memstream, and dabc::sizestream.

Definition at line 68 of file Record.h.

◆ shift()

virtual bool dabc::iostream::shift ( uint64_t  len)
inlinevirtual

Reimplemented in dabc::memstream, and dabc::sizestream.

Definition at line 69 of file Record.h.

◆ size()

virtual uint64_t dabc::iostream::size ( ) const
inlinevirtual

return number of bytes, written or read from the stream

Reimplemented in dabc::memstream, and dabc::sizestream.

Definition at line 71 of file Record.h.

◆ maxstoresize()

virtual uint64_t dabc::iostream::maxstoresize ( ) const
inlinevirtual

return maximum size of data which can be stored in the stream

Reimplemented in dabc::memstream, and dabc::sizestream.

Definition at line 74 of file Record.h.

◆ write_int32()

bool dabc::iostream::write_int32 ( int32_t  v)
inline

Definition at line 76 of file Record.h.

◆ write_uint32()

bool dabc::iostream::write_uint32 ( uint32_t  v)
inline

Definition at line 77 of file Record.h.

◆ write_int64()

bool dabc::iostream::write_int64 ( int64_t  v)
inline

Definition at line 78 of file Record.h.

◆ write_uint64()

bool dabc::iostream::write_uint64 ( uint64_t  v)
inline

Definition at line 79 of file Record.h.

◆ write_double()

bool dabc::iostream::write_double ( double  v)
inline

Definition at line 80 of file Record.h.

◆ read_int32()

bool dabc::iostream::read_int32 ( int32_t &  v)
inline

Definition at line 82 of file Record.h.

◆ read_uint32()

bool dabc::iostream::read_uint32 ( uint32_t &  v)
inline

Definition at line 83 of file Record.h.

◆ read_int64()

bool dabc::iostream::read_int64 ( int64_t &  v)
inline

Definition at line 84 of file Record.h.

◆ read_uint64()

bool dabc::iostream::read_uint64 ( uint64_t &  v)
inline

Definition at line 85 of file Record.h.

◆ read_double()

bool dabc::iostream::read_double ( double &  v)
inline

Definition at line 86 of file Record.h.

◆ str_storesize()

uint64_t dabc::iostream::str_storesize ( const std::string &  str)
static

Returns bytes count, required to store string.

Bytes count rounded to 64 bit

Definition at line 68 of file Record.cxx.

◆ write_str()

bool dabc::iostream::write_str ( const std::string &  str)

Store string in the stream.

Definition at line 76 of file Record.cxx.

◆ read_str()

bool dabc::iostream::read_str ( std::string &  str)

Restore string from the stream.

Definition at line 94 of file Record.cxx.

Field Documentation

◆ fInput

bool dabc::iostream::fInput
protected

Definition at line 43 of file Record.h.


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