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

iostream class, which write and read data from memory More...

#include <dabc/Record.h>

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

Public Member Functions

virtual uint64_t maxstoresize () const
 return maximum size of data which can be stored in the stream More...
 
 memstream (bool isinp, char *buf, uint64_t len)
 
virtual bool read (void *tgt, uint64_t len)
 
virtual bool shift (uint64_t len)
 
virtual uint64_t size () const
 return number of bytes, written or read from the stream More...
 
virtual bool write (const void *src, uint64_t len)
 
virtual ~memstream ()
 
- Public Member Functions inherited from dabc::iostream
bool is_input () const
 
bool is_output () const
 
virtual bool is_real () const
 
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)
 
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)
 
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 ()
 

Protected Member Functions

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 Member Functions inherited from dabc::iostream
 iostream ()
 
 iostream (bool isinp)
 

Protected Attributes

char * fCurr
 
uint64_t fLength
 
char * fMem
 
uint64_t fRemains
 
- Protected Attributes inherited from dabc::iostream
bool fInput
 

Additional Inherited Members

- Static Public Member Functions inherited from dabc::iostream
static uint64_t str_storesize (const std::string &str)
 Returns bytes count, required to store string. More...
 

Detailed Description

iostream class, which write and read data from memory

Definition at line 133 of file Record.h.

Constructor & Destructor Documentation

◆ memstream()

dabc::memstream::memstream ( bool  isinp,
char *  buf,
uint64_t  len 
)
inline

Definition at line 152 of file Record.h.

◆ ~memstream()

virtual dabc::memstream::~memstream ( )
inlinevirtual

Definition at line 161 of file Record.h.

Member Function Documentation

◆ tmpbuf_size()

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

return number of bytes which are directly available in temporary buffer

Reimplemented from dabc::iostream.

Definition at line 140 of file Record.h.

◆ tmpbuf()

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

return temporary buffer

Reimplemented from dabc::iostream.

Definition at line 141 of file Record.h.

◆ size()

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

return number of bytes, written or read from the stream

Reimplemented from dabc::iostream.

Definition at line 145 of file Record.h.

◆ maxstoresize()

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

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

Reimplemented from dabc::iostream.

Definition at line 146 of file Record.h.

◆ shift()

bool dabc::memstream::shift ( uint64_t  len)
virtual

Reimplemented from dabc::iostream.

Definition at line 114 of file Record.cxx.

◆ write()

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

Reimplemented from dabc::iostream.

Definition at line 122 of file Record.cxx.

◆ read()

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

Reimplemented from dabc::iostream.

Definition at line 132 of file Record.cxx.

Field Documentation

◆ fMem

char* dabc::memstream::fMem
protected

Definition at line 135 of file Record.h.

◆ fLength

uint64_t dabc::memstream::fLength
protected

Definition at line 136 of file Record.h.

◆ fCurr

char* dabc::memstream::fCurr
protected

Definition at line 137 of file Record.h.

◆ fRemains

uint64_t dabc::memstream::fRemains
protected

Definition at line 138 of file Record.h.


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