evio  6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evio::DataType Class Reference

Numerical values associated with evio data types. More...

#include <DataType.h>

Public Member Functions

const std::string & getName () const
 Get the name associated with this data type. More...
 
uint32_t getValue () const
 Get the integer value associated with this data type. More...
 
std::string toString () const
 Return a string which is usually the same as the name of the enumerated value, except in the cases of ALSOSEGMENT and ALSOBANK which return SEGMENT and BANK respectively. More...
 
bool isStructure () const
 Convenience routine to see if "this" data type is a structure (a container.) More...
 
bool isBank () const
 Convenience routine to see if "this" data type is a bank structure. More...
 
bool isSegment () const
 Convenience routine to see if "this" data type is a segment structure. More...
 
bool isTagSegment () const
 Convenience routine to see if "this" data type is a tagsegment structure. More...
 
bool isInteger () const
 Convenience method to see if "this" data type is an integer of some kind - either 8, 16, 32, or 64 bits worth. More...
 
int getBytes () const
 Return the number of bytes this data type takes (if relevant). More...
 
bool operator== (const DataType &rhs) const
 
bool operator!= (const DataType &rhs) const
 

Static Public Member Functions

static const DataTypegetDataType (uint32_t val)
 Get the object from the integer value. More...
 
static std::string getName (uint32_t val)
 Get the name from the integer value. More...
 
static DataType valueOf (std::string const &typeName)
 Get the enum constant from a string. More...
 
static bool isStructure (uint32_t dataType)
 Convenience method to see if the given integer arg represents a data type which is a structure (a container). More...
 
static bool isBank (uint32_t dataType)
 Convenience method to see if the given integer arg represents a BANK. More...
 
static bool isSegment (uint32_t dataType)
 Convenience method to see if the given integer arg represents a SEGMENT. More...
 
static bool isTagSegment (uint32_t dataType)
 Convenience method to see if the given integer arg represents a TAGSEGMENT. More...
 

Static Public Attributes

static const DataType UNKNOWN32 = DataType(0x0, "UNKNOWN32")
 Unknown data type. More...
 
static const DataType UINT32 = DataType(0x1, "UINT32", 4)
 Unsigned 32 bit int. More...
 
static const DataType FLOAT32 = DataType(0x2, "FLOAT32", 4)
 32 bit float. More...
 
static const DataType CHARSTAR8 = DataType(0x3, "CHARSTAR8")
 ASCII characters. More...
 
static const DataType SHORT16 = DataType(0x4, "SHORT16", 2)
 16 bit int. More...
 
static const DataType USHORT16 = DataType(0x5, "USHORT16", 2)
 Unsigned 16 bit int. More...
 
static const DataType CHAR8 = DataType(0x6, "CHAR8", 1)
 8 bit int. More...
 
static const DataType UCHAR8 = DataType(0x7, "UCHAR8", 1)
 Unsigned 8 bit int. More...
 
static const DataType DOUBLE64 = DataType(0x8, "DOUBLE64", 8)
 64 bit double. More...
 
static const DataType LONG64 = DataType(0x9, "LONG64", 8)
 64 bit int. More...
 
static const DataType ULONG64 = DataType(0xa, "ULONG64", 8)
 Unsigned 64 bit int. More...
 
static const DataType INT32 = DataType(0xb, "INT32", 4)
 32 bit int. More...
 
static const DataType TAGSEGMENT = DataType(0xc, "TAGSEGMENT")
 Tag segment. More...
 
static const DataType ALSOSEGMENT = DataType(0xd, "ALSOSEGMENT")
 Segment alternate value. More...
 
static const DataType ALSOBANK = DataType(0xe, "ALSOBANK")
 Bank alternate value. More...
 
static const DataType COMPOSITE = DataType(0xf, "COMPOSITE")
 Composite data type. More...
 
static const DataType BANK = DataType(0x10, "BANK")
 Bank. More...
 
static const DataType SEGMENT = DataType(0x20, "SEGMENT")
 Segment. More...
 
static const DataType HOLLERIT = DataType(0x21, "HOLLERIT")
 In composite data, Hollerit type. More...
 
static const DataType NVALUE = DataType(0x22, "NVALUE")
 In composite data, N value. More...
 
static const DataType nVALUE = DataType(0x23, "nVALUE")
 In composite data, n value. More...
 
static const DataType mVALUE = DataType(0x24, "mVALUE")
 In composite data, m value. More...
 
static const DataType NOT_A_VALID_TYPE = DataType(0x30, "INVALID")
 Not a valid data type. More...
 

Detailed Description

Numerical values associated with evio data types.

This class approximates the Java enum it was copied from. ALSOTAGSEGMENT (0x40) value was removed from this class because the upper 2 bits of a byte containing the datatype are now used to store padding data.

Version
6.0
Since
6.0 7/22/2019
Author
timmer

Member Function Documentation

int evio::DataType::getBytes ( ) const
inline

Return the number of bytes this data type takes (if relevant).

Returns
the number of bytes this data type takes (if relevant).

Referenced by evio::BaseStructure::dataLength(), and evio::BaseStructure::getNumberDataItems().

static const DataType& evio::DataType::getDataType ( uint32_t  val)
inlinestatic
static std::string evio::DataType::getName ( uint32_t  val)
inlinestatic

Get the name from the integer value.

Parameters
valthe value to match.
Returns
the name, or null.

References getDataType().

Referenced by evio::EventBuilder::addChild(), and evio::BaseStructureHeader::getDataTypeName().

const std::string& evio::DataType::getName ( ) const
inline

Get the name associated with this data type.

Returns
name associated with this data type.
static bool evio::DataType::isBank ( uint32_t  dataType)
inlinestatic

Convenience method to see if the given integer arg represents a BANK.

Parameters
dataTypethe int value to match.
Returns
true if the data type corresponds to a BANK.

References ALSOBANK, and BANK.

Referenced by evio::RecordOutput::addEvent(), and evio::EvioXMLDictionary::getName().

bool evio::DataType::isBank ( ) const
inline

Convenience routine to see if "this" data type is a bank structure.

Returns
true if this data type corresponds to a bank structure.

References ALSOBANK, and BANK.

Referenced by evio::EvioNode::scanStructure().

bool evio::DataType::isInteger ( ) const
inline

Convenience method to see if "this" data type is an integer of some kind - either 8, 16, 32, or 64 bits worth.

Returns
true if the data type corresponds to an integer type

References CHAR8, INT32, LONG64, SHORT16, UCHAR8, UINT32, ULONG64, and USHORT16.

static bool evio::DataType::isSegment ( uint32_t  dataType)
inlinestatic

Convenience method to see if the given integer arg represents a SEGMENT.

Parameters
dataTypethe int value to match.
Returns
true if the data type corresponds to a SEGMENT.

References ALSOSEGMENT, and SEGMENT.

bool evio::DataType::isSegment ( ) const
inline

Convenience routine to see if "this" data type is a segment structure.

Returns
true if this data type corresponds to a bank structure.

References ALSOSEGMENT, and SEGMENT.

Referenced by evio::EvioNode::scanStructure().

static bool evio::DataType::isStructure ( uint32_t  dataType)
inlinestatic

Convenience method to see if the given integer arg represents a data type which is a structure (a container).

Parameters
dataTypethe int value to match.
Returns
true if the data type corresponds to one of the structure types: BANK, SEGMENT, TAGSEGMENT, ALSOBANK, or ALSOSEGMENT.

References ALSOBANK, ALSOSEGMENT, BANK, SEGMENT, and TAGSEGMENT.

Referenced by evio::EventBuilder::addChild(), and evio::BaseStructure::transform().

bool evio::DataType::isStructure ( ) const
inline

Convenience routine to see if "this" data type is a structure (a container.)

Returns
true if the data type corresponds to one of the structure types: BANK, SEGMENT, TAGSEGMENT, ALSOBANK, or ALSOSEGMENT.

References ALSOBANK, ALSOSEGMENT, BANK, SEGMENT, and TAGSEGMENT.

Referenced by evio::EvioNode::scanStructure().

static bool evio::DataType::isTagSegment ( uint32_t  dataType)
inlinestatic

Convenience method to see if the given integer arg represents a TAGSEGMENT.

Parameters
dataTypethe int value to match.
Returns
true if the data type corresponds to a TAGSEGMENT.

References TAGSEGMENT.

bool evio::DataType::isTagSegment ( ) const
inline

Convenience routine to see if "this" data type is a tagsegment structure.

Returns
true if this data type corresponds to a tagsegment structure.

References TAGSEGMENT.

bool evio::DataType::operator!= ( const DataType rhs) const
bool evio::DataType::operator== ( const DataType rhs) const
static DataType evio::DataType::valueOf ( std::string const &  typeName)
inlinestatic

Get the enum constant from a string.

Parameters
typeNamethe name of the DataType to obtain.
Returns
the DataType object associated with the given type name, or DataType::UNKNOWN32 if there's no match.

References UNKNOWN32.

Referenced by evio::EvioXMLDictionary::parseXML().

Member Data Documentation

const DataType evio::DataType::HOLLERIT = DataType(0x21, "HOLLERIT")
static
const DataType evio::DataType::mVALUE = DataType(0x24, "mVALUE")
static
const DataType evio::DataType::NOT_A_VALID_TYPE = DataType(0x30, "INVALID")
static
const DataType evio::DataType::NVALUE = DataType(0x22, "NVALUE")
static
const DataType evio::DataType::nVALUE = DataType(0x23, "nVALUE")
static

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