HIPO  4.3.0
High Performance Output data format for experimental physics
hipo::datastream Class Reference

Abstract base class for data stream I/O. More...

#include <datastream.h>

Public Member Functions

 datastream ()
 
virtual ~datastream ()
 
virtual long size ()
 
virtual long position ()
 
virtual long position (long pos)
 Seek to a position in the stream. More...
 
virtual void open (const char *filename)
 Open a data source. More...
 
virtual int read (char *s, int size)
 Read bytes from the stream. More...
 

Detailed Description

Abstract base class for data stream I/O.

Provides a polymorphic interface for reading binary data from different sources (local files, XRootD remote files).

Definition at line 74 of file datastream.h.

Constructor & Destructor Documentation

◆ datastream()

hipo::datastream::datastream ( )

◆ ~datastream()

virtual hipo::datastream::~datastream ( )
virtual

Member Function Documentation

◆ open()

virtual void hipo::datastream::open ( const char *  filename)
inlinevirtual

Open a data source.

Parameters
filenamePath or URL of the data source

Definition at line 98 of file datastream.h.

◆ position() [1/2]

virtual long hipo::datastream::position ( )
inlinevirtual
Returns
Current read position in bytes.

Definition at line 91 of file datastream.h.

◆ position() [2/2]

virtual long hipo::datastream::position ( long  pos)
inlinevirtual

Seek to a position in the stream.

Parameters
posByte offset from the beginning
Returns
The new position

Definition at line 95 of file datastream.h.

◆ read()

virtual int hipo::datastream::read ( char *  s,
int  size 
)
inlinevirtual

Read bytes from the stream.

Parameters
sDestination buffer
sizeNumber of bytes to read
Returns
Number of bytes read

Definition at line 103 of file datastream.h.

◆ size()

virtual long hipo::datastream::size ( )
inlinevirtual
Returns
Total size of the stream in bytes.

Definition at line 89 of file datastream.h.


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