|
HIPO
4.3.0
High Performance Output data format for experimental physics
|
Schema definition for a HIPO bank. More...
#include <dictionary.h>
Public Member Functions | |
| schema () | |
| Default constructor. Initializes an empty schema with zero group/item IDs. More... | |
| schema (const char *name, int __group, int __item) | |
| Construct a schema with a name, group ID, and item ID. More... | |
| schema (const schema &s) | |
| Copy constructor. More... | |
| virtual | ~schema ()=default |
| Virtual destructor (defaulted). More... | |
| void | parse (const std::string &schString) |
| Parse a schema definition string and populate entries. More... | |
| std::string | getName () const |
| Get the schema name. More... | |
| int | getGroup () |
| Get the group identifier. More... | |
| int | getItem () |
| Get the item identifier. More... | |
| int | getSizeForRows (int rows) |
| Compute the total buffer size needed for a given number of rows. More... | |
| int | getRowLength () const noexcept |
| Get the size of a single row in bytes. More... | |
| int | getEntryOrder (const char *name) const |
| Get the column index for a given column name. More... | |
| bool | exists (const char *name) const |
| Check whether a column with the given name exists. More... | |
| int | getOffset (int item, int order, int rows) const |
| Compute the byte offset for a column value by column index. More... | |
| int | getOffset (const char *name, int order, int rows) const |
| Compute the byte offset for a column value by column name. More... | |
| int | getEntryType (int item) const noexcept |
| Get the type identifier of a column by index. More... | |
| int | getEntryType (const char *name) const noexcept |
| Get the type identifier of a column by name. More... | |
| std::string | getEntryName (int item) const noexcept |
| Get the name of a column by index. More... | |
| int | getEntries () const noexcept |
| Get the number of columns in the schema. More... | |
| void | show () |
| Print the schema to standard output. More... | |
| std::string | getSchemaString () |
| Serialize the schema to a definition string (e.g. "pid/I,px/F"). More... | |
| std::string | getSchemaStringJson () |
| Serialize the schema to a JSON-formatted string. More... | |
| void | operator= (const schema &D) |
| Copy-assignment operator. More... | |
Schema definition for a HIPO bank.
Defines the column names, types, and layout for a bank. Each column has a name, a type (B=byte, S=short, I=int, F=float, D=double, L=long), and an offset computed from the column order.
Definition at line 73 of file dictionary.h.
|
inline |
Default constructor. Initializes an empty schema with zero group/item IDs.
Definition at line 92 of file dictionary.h.
|
inline |
Construct a schema with a name, group ID, and item ID.
| name | Schema name (e.g. "REC::Particle"). |
| __group | Group identifier used in the bank header. |
| __item | Item identifier used in the bank header. |
Definition at line 99 of file dictionary.h.
|
inline |
|
virtualdefault |
Virtual destructor (defaulted).
|
inline |
Check whether a column with the given name exists.
| name | Column name to check. |
Definition at line 159 of file dictionary.h.
|
inlinenoexcept |
Get the number of columns in the schema.
Definition at line 217 of file dictionary.h.
|
inlinenoexcept |
Get the name of a column by index.
| item | Zero-based column index. |
Definition at line 214 of file dictionary.h.
|
inline |
Get the column index for a given column name.
| name | Column name to look up. |
Definition at line 239 of file dictionary.h.
|
inlinenoexcept |
Get the type identifier of a column by name.
| name | Column name. |
Definition at line 201 of file dictionary.h.
|
inlinenoexcept |
Get the type identifier of a column by index.
| item | Zero-based column index. |
Definition at line 193 of file dictionary.h.
|
inline |
|
inline |
|
inline |
|
inline |
Compute the byte offset for a column value by column name.
| name | Column name. |
| order | Row number (zero-based). |
| rows | Total number of rows in the bank. |
Definition at line 183 of file dictionary.h.
|
inline |
Compute the byte offset for a column value by column index.
| item | Zero-based column index. |
| order | Row number (zero-based). |
| rows | Total number of rows in the bank. |
Definition at line 171 of file dictionary.h.
|
inlinenoexcept |
Get the size of a single row in bytes.
Definition at line 141 of file dictionary.h.
| std::string hipo::schema::getSchemaString | ( | ) |
Serialize the schema to a definition string (e.g. "pid/I,px/F").
Definition at line 86 of file dictionary.cpp.
| std::string hipo::schema::getSchemaStringJson | ( | ) |
Serialize the schema to a JSON-formatted string.
Definition at line 100 of file dictionary.cpp.
| int hipo::schema::getSizeForRows | ( | int | rows | ) |
Compute the total buffer size needed for a given number of rows.
| rows | Number of rows. |
Definition at line 80 of file dictionary.cpp.
|
inline |
Copy-assignment operator.
| D | Schema to copy from. |
Definition at line 230 of file dictionary.h.
| void hipo::schema::parse | ( | const std::string & | schString | ) |
Parse a schema definition string and populate entries.
The string format is comma-separated "name/type" pairs, e.g. "pid/I,px/F,py/F,pz/F".
| schString | The schema definition string to parse. |
Definition at line 17 of file dictionary.cpp.
| void hipo::schema::show | ( | ) |
Print the schema to standard output.
Definition at line 67 of file dictionary.cpp.