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

Collection of schema definitions, typically read from a HIPO file header. More...

#include <dictionary.h>

Public Member Functions

 dictionary ()=default
 
virtual ~dictionary ()=default
 
std::vector< std::string > getSchemaList ()
 Get a list of all schema names in the dictionary. More...
 
void addSchema (schema sc)
 Add a schema to the dictionary. More...
 
bool hasSchema (const char *name)
 Check whether a schema with the given name exists. More...
 
schemagetSchema (const char *name)
 Retrieve a schema by name. More...
 
bool parse (const char *schemaString)
 Parse a full schema string and add it to the dictionary. More...
 
void show ()
 Print all schemas in the dictionary to standard output. More...
 

Detailed Description

Collection of schema definitions, typically read from a HIPO file header.

Definition at line 248 of file dictionary.h.

Constructor & Destructor Documentation

◆ dictionary()

hipo::dictionary::dictionary ( )
default

◆ ~dictionary()

virtual hipo::dictionary::~dictionary ( )
virtualdefault

Member Function Documentation

◆ addSchema()

void hipo::dictionary::addSchema ( schema  sc)
inline

Add a schema to the dictionary.

Parameters
scSchema to add (keyed by its name).

Definition at line 260 of file dictionary.h.

◆ getSchema()

schema& hipo::dictionary::getSchema ( const char *  name)
inline

Retrieve a schema by name.

Parameters
nameSchema name to look up.
Returns
Reference to the matching schema.
Exceptions
hipo::schema_errorIf the schema does not exist.

Definition at line 271 of file dictionary.h.

◆ getSchemaList()

std::vector< std::string > hipo::dictionary::getSchemaList ( )

Get a list of all schema names in the dictionary.

Returns
Vector of schema name strings.

Definition at line 121 of file dictionary.cpp.

◆ hasSchema()

bool hipo::dictionary::hasSchema ( const char *  name)
inline

Check whether a schema with the given name exists.

Parameters
nameSchema name to look up.
Returns
True if the schema exists, false otherwise.

Definition at line 264 of file dictionary.h.

◆ parse()

bool hipo::dictionary::parse ( const char *  schemaString)

Parse a full schema string and add it to the dictionary.

Parameters
schemaStringString containing the schema definition.
Returns
True on success, false on failure.

Definition at line 130 of file dictionary.cpp.

◆ show()

void hipo::dictionary::show ( )

Print all schemas in the dictionary to standard output.

Definition at line 143 of file dictionary.cpp.


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