CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes
PhysicsTools::Variable Class Reference

Class describing an input variable. More...

#include <Variable.h>

Classes

class  Value
 Helper class that can contain an identifier-value pair. More...
 
class  ValueList
 Helper class that can contain an list of identifier-value pairs. More...
 

Public Types

enum  Flags { FLAG_NONE = 0, FLAG_OPTIONAL = 1 << 0, FLAG_MULTIPLE = 1 << 1, FLAG_ALL = (1 << 2) - 1 }
 

Public Member Functions

Flags getFlags () const
 
const AtomicId getName () const
 
bool isMultiple () const
 
bool isOptional () const
 
 Variable ()
 
 Variable (AtomicId name, Flags flags=FLAG_NONE)
 
 Variable (const Variable &orig)
 

Private Attributes

Flags flags
 
AtomicId name
 

Detailed Description

Class describing an input variable.

The class Variable describes an input variable by its name and properties. The name is represented by an atomic identifier (an alphanumerical value). The properties consists of flags. Currently the two flags describe the allowed number of times a variable can appear in the input, whether a variable is allowed to be omitted and whether a variable can have multiple values.

Definition at line 33 of file Variable.h.

Member Enumeration Documentation

◆ Flags

Enumerator
FLAG_NONE 
FLAG_OPTIONAL 
FLAG_MULTIPLE 
FLAG_ALL 

Definition at line 35 of file Variable.h.

35 { FLAG_NONE = 0, FLAG_OPTIONAL = 1 << 0, FLAG_MULTIPLE = 1 << 1, FLAG_ALL = (1 << 2) - 1 };

Constructor & Destructor Documentation

◆ Variable() [1/3]

PhysicsTools::Variable::Variable ( )
inline

Definition at line 132 of file Variable.h.

132 {}

◆ Variable() [2/3]

PhysicsTools::Variable::Variable ( const Variable orig)
inline

Definition at line 133 of file Variable.h.

133 : name(orig.name), flags(orig.flags) {}

◆ Variable() [3/3]

PhysicsTools::Variable::Variable ( AtomicId  name,
Flags  flags = FLAG_NONE 
)
inline

Definition at line 134 of file Variable.h.

134 : name(name), flags(flags) {}

Member Function Documentation

◆ getFlags()

Flags PhysicsTools::Variable::getFlags ( ) const
inline

Definition at line 137 of file Variable.h.

137 { return flags; }

References flags.

◆ getName()

const AtomicId PhysicsTools::Variable::getName ( void  ) const
inline

Definition at line 136 of file Variable.h.

136 { return name; }

References name.

Referenced by plotting.Plot::draw().

◆ isMultiple()

bool PhysicsTools::Variable::isMultiple ( ) const
inline

Definition at line 140 of file Variable.h.

140 { return flags & FLAG_MULTIPLE; }

References FLAG_MULTIPLE, and flags.

◆ isOptional()

bool PhysicsTools::Variable::isOptional ( ) const
inline

Definition at line 139 of file Variable.h.

139 { return flags & FLAG_OPTIONAL; }

References FLAG_OPTIONAL, and flags.

Member Data Documentation

◆ flags

Flags PhysicsTools::Variable::flags
private

Definition at line 144 of file Variable.h.

Referenced by getFlags(), isMultiple(), and isOptional().

◆ name

AtomicId PhysicsTools::Variable::name
private
PhysicsTools::Variable::flags
Flags flags
Definition: Variable.h:144
PhysicsTools::Variable::FLAG_OPTIONAL
Definition: Variable.h:35
PhysicsTools::Variable::FLAG_NONE
Definition: Variable.h:35
PhysicsTools::Variable::name
AtomicId name
Definition: Variable.h:143
PhysicsTools::Variable::FLAG_ALL
Definition: Variable.h:35
PhysicsTools::Variable::FLAG_MULTIPLE
Definition: Variable.h:35