lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
XtcData::DataDef Class Reference

VarDef that also keeps a map from field name to the order in which it was added. More...

#include <XtcUpdateIter.hh>

Inherits XtcData::VarDef.

Public Member Functions

 DataDef ()
 Construct an empty definition list.
 
void add (char *name, unsigned dtype, int rank)
 Append a Name(name, (Name::DataType)dtype, rank) to NameVec and map name to its position.
 
void show ()
 Print "List of names" and each name, then "List of indices" and each name with its position, to stdout.
 
int index (char *name)
 Return the position recorded for name, or -1 if it is not found.
 
int getDtype (char *name)
 Return the DataType of the field called name.
 
int getRank (char *name)
 Return the rank of the field called name.
 

Additional Inherited Members

- Public Attributes inherited from XtcData::VarDef
std::vector< Name > NameVec
 Name definitions, in order.
 

Detailed Description

VarDef that also keeps a map from field name to the order in which it was added.

Constructor & Destructor Documentation

◆ DataDef()

XtcData::DataDef::DataDef ( )
inline

Construct an empty definition list.

Member Function Documentation

◆ add()

void XtcData::DataDef::add ( char *  name,
unsigned  dtype,
int  rank 
)
inline

Append a Name(name, (Name::DataType)dtype, rank) to NameVec and map name to its position.

A repeated name keeps its first position in the map. The Name constructor aborts on an invalid name or rank.

◆ getDtype()

int XtcData::DataDef::getDtype ( char *  name)
inline

Return the DataType of the field called name.

A missing name is not checked (index -1 is used).

◆ getRank()

int XtcData::DataDef::getRank ( char *  name)
inline

Return the rank of the field called name.

A missing name is not checked (index -1 is used).

◆ index()

int XtcData::DataDef::index ( char *  name)
inline

Return the position recorded for name, or -1 if it is not found.

◆ show()

void XtcData::DataDef::show ( )
inline

Print "List of names" and each name, then "List of indices" and each name with its position, to stdout.


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