93 const char *data_ptr{};
95 int data_endianness{};
101 data(){ data_ptr =
nullptr; data_size = 0;}
116 const uint32_t *
getEvioPtr(){
return reinterpret_cast<const uint32_t *
>(data_ptr);}
141 std::vector<char> dataBuffer;
144 int maxSize = 512*1024;
162 void init(
const char *ptr);
183 const char *
buffer(){
return &dataBuffer[0];}
201 std::vector<char> recordHeaderBuffer;
204 std::vector<char> recordBuffer;
205 std::vector<char> recordCompressedBuffer;
211 char *getUncompressed(
const char *
data,
int dataLength,
int dataLengthUncompressed);
212 int getUncompressed(
const char *
data,
char *dest,
int dataLength,
int dataLengthUncompressed);
213 void showBuffer(
const char *
data,
int wrapping,
int maxsize);
234 void readRecord(std::ifstream &stream,
long position,
int dataOffset);
241 void readRecord__(std::ifstream &stream,
long position,
long recordLength);
250 bool readRecord(std::ifstream &stream,
long position,
int dataOffset,
long inputSize);
278 void readEvent( std::vector<char> &vec,
int index);
298 void getEventsMap(std::vector<std::pair<int,int>> &emap);
Represents a HIPO bank, a tabular data structure with rows and typed columns.
Simple timer for measuring code performance.
Lightweight wrapper for a raw data pointer with type, size, and offset metadata.
void setDataSize(int __size)
Set the data size in bytes.
void setDataOffset(int __offset)
Set the byte offset into the source buffer.
void setDataPtr(const char *__ptr)
Set the raw data pointer.
int getDataEndianness()
Return the endianness indicator.
const char * getDataPtr()
Return the raw data pointer.
int getEvioSize()
Return the data size in 4-byte (uint32_t) units.
data()
Construct an empty data object with a null pointer and zero size.
int getDataOffset()
Return the byte offset into the source buffer.
const uint32_t * getEvioPtr()
Return the data pointer cast to a uint32_t pointer (EVIO format).
int getDataType()
Return the data type identifier.
void setDataType(int __type)
Set the data type identifier.
int getDataSize()
Return the data size in bytes.
~data()=default
Default destructor.
void setDataEndianness(int __endianness)
Set the endianness indicator for the data.
Container for multiple events packed into a single frame.
bool addEvent(hipo::event &event)
Append an event to the dataframe.
void reset()
Clear all events and reset the dataframe to an empty state.
int getEventAt(int pos, hipo::event &event)
Retrieve the event at the given position.
void init(const char *ptr)
Initialize the dataframe from an existing raw buffer.
int count()
Return the number of events currently stored in the frame.
dataframe()
Construct an empty dataframe with default limits.
void summary()
Print a summary of the dataframe contents to standard output.
const char * buffer()
Return a pointer to the underlying data buffer.
int size()
Return the total size of the internal buffer in bytes.
~dataframe()
Default destructor.
Represents a HIPO event, a container for multiple structures/banks.
Represents a single HIPO record containing multiple events.
hipo::benchmark & getUnzipBenchmark()
Return a reference to the decompression benchmark.
void readEvent(std::vector< char > &vec, int index)
Read raw event bytes into a vector.
hipo::benchmark & getIndexBenchmark()
Return a reference to the index-building benchmark.
record()
Construct an empty record.
int getEventCount()
Return the number of events stored in this record.
void getEventsMap(std::vector< std::pair< int, int >> &emap)
Build a map of event positions (offset, length pairs).
void read(hipo::bank &b, int event)
Read a specific bank from a given event in this record.
hipo::benchmark & getReadBenchmark()
Return a reference to the read-operation benchmark.
int getRecordSizeCompressed()
Return the compressed size of this record in bytes.
void readRecord(std::ifstream &stream, long position, int dataOffset)
Read a record from a file stream at the specified position.
void readHipoEvent(hipo::event &event, int index)
Read an event and populate a hipo::event object.
void getData(hipo::data &data, int index)
Get a lightweight data handle for a specific event.
void getColumn(hipo::data &data, int column, hipo::bank &bank, int event)
Extract a single column from a bank for a given event.
void readRecord__(std::ifstream &stream, long position, long recordLength)
Read a record using its total length (internal variant).
HIPO event container and manipulation interface.
struct hipo::recordHeader_t recordHeader_t
Header structure for a HIPO record.
Utility functions and benchmark timer for HIPO library operations.