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

Container for multiple events packed into a single frame. More...

#include <record.h>

Public Member Functions

 dataframe ()
 Construct an empty dataframe with default limits. More...
 
 dataframe (int max_events, int max_size)
 Construct a dataframe with custom capacity limits. More...
 
 ~dataframe ()
 Default destructor. More...
 
void init (const char *ptr)
 Initialize the dataframe from an existing raw buffer. More...
 
bool addEvent (hipo::event &event)
 Append an event to the dataframe. More...
 
int getEventAt (int pos, hipo::event &event)
 Retrieve the event at the given position. More...
 
int count ()
 Return the number of events currently stored in the frame. More...
 
int size ()
 Return the total size of the internal buffer in bytes. More...
 
void reset ()
 Clear all events and reset the dataframe to an empty state. More...
 
const char * buffer ()
 Return a pointer to the underlying data buffer. More...
 
void summary ()
 Print a summary of the dataframe contents to standard output. More...
 

Detailed Description

Container for multiple events packed into a single frame.

A dataframe accumulates events up to a configurable maximum count or byte size and provides random access to individual events within the frame.

Definition at line 139 of file record.h.

Constructor & Destructor Documentation

◆ dataframe() [1/2]

hipo::dataframe::dataframe ( )
inline

Construct an empty dataframe with default limits.

Definition at line 148 of file record.h.

◆ dataframe() [2/2]

hipo::dataframe::dataframe ( int  max_events,
int  max_size 
)

Construct a dataframe with custom capacity limits.

Parameters
max_eventsMaximum number of events the frame may hold.
max_sizeMaximum total size in bytes.

Definition at line 550 of file record.cpp.

◆ ~dataframe()

hipo::dataframe::~dataframe ( )
inline

Default destructor.

Definition at line 156 of file record.h.

Member Function Documentation

◆ addEvent()

bool hipo::dataframe::addEvent ( hipo::event event)

Append an event to the dataframe.

Parameters
eventThe event to add.
Returns
true if the event was added, false if capacity limits are reached.

Definition at line 569 of file record.cpp.

◆ buffer()

const char* hipo::dataframe::buffer ( )
inline

Return a pointer to the underlying data buffer.

Definition at line 183 of file record.h.

◆ count()

int hipo::dataframe::count ( )

Return the number of events currently stored in the frame.

Definition at line 595 of file record.cpp.

◆ getEventAt()

int hipo::dataframe::getEventAt ( int  pos,
hipo::event event 
)

Retrieve the event at the given position.

Parameters
posZero-based index of the event.
eventOutput event to populate.
Returns
Status code indicating success or failure.

Definition at line 583 of file record.cpp.

◆ init()

void hipo::dataframe::init ( const char *  ptr)

Initialize the dataframe from an existing raw buffer.

Parameters
ptrPointer to the raw record data.

Definition at line 589 of file record.cpp.

◆ reset()

void hipo::dataframe::reset ( )

Clear all events and reset the dataframe to an empty state.

Definition at line 556 of file record.cpp.

◆ size()

int hipo::dataframe::size ( )

Return the total size of the internal buffer in bytes.

Definition at line 596 of file record.cpp.

◆ summary()

void hipo::dataframe::summary ( )

Print a summary of the dataframe contents to standard output.

Definition at line 598 of file record.cpp.


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