PARTONS  
PARtonic Tomography Of Nucleon Software
Public Types | Public Member Functions | Private Attributes | List of all members
PARTONS::KinematicType Class Reference

Definition of kinematics types. More...

Public Types

enum  Type { UNDEFINED = 0 , THEO = 1 , EXP = 2 }
 

Public Member Functions

 KinematicType ()
 Default constructor. More...
 
 KinematicType (Type type)
 Assignment constructor. More...
 
 KinematicType (const KinematicType &other)
 Copy constructor. More...
 
 operator Type () const
 Automatic cast to enum. More...
 
std::string toString () const
 Get string representation of type being assigned to a declared object of this class. More...
 
KinematicType::Type getType () const
 Get type being assigned to a declared object of this class. More...
 
void setType (Type type)
 Assign type to a declared object of this class. More...
 

Private Attributes

KinematicType::Type m_type
 Type associated to a declared object of this class. More...
 

Detailed Description

Definition of kinematics types.

This class defines a set of enumeration values that are used to distinguish between kinematics type. In addition, a declared object of this class is always associated to one kinematics type (see KinematicType::m_type), so member functions can act on it. E.g.

//this is single enum variable - nothing to play with
//this is declared object
KinematicType enum_object;
//let us assign some type (default is KinematicType::UNDEFINED)
enum_object.setType(enum_variable);
//with objects you can use available functions, e.g. you can represent enumeration type by a corresponding string
std::string enum_string_1 = enum_object.toString();
//you can achieve some basic operations without the explicit declaration of objects by using the assignment constructor
std::string enum_string_2 = KinematicType(KinematicType::EXP).toString();
Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Kinematics type is: " << enum_string_1);
Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Kinematics type is: " << enum_string_2);
Type
Definition: KinematicType.h:50
@ THEO
Kinematics related to to theory data.
Definition: KinematicType.h:52
@ EXP
Kinematics related to experimental data.
Definition: KinematicType.h:53
KinematicType()
Default constructor.
Definition: KinematicType.cpp:6
ElemUtils::LoggerManager * getLoggerManager() const
Definition: Partons.cpp:191
static Partons * getInstance()
Share a unique pointer of this class.
Definition: Partons.cpp:27

which gives via Logger:

20-05-2017 12:13:02 [INFO] (example::main) Kinematics type is: THEO
20-05-2017 12:13:02 [INFO] (example::main) Kinematics type is: EXP

Member Enumeration Documentation

◆ Type

Enumerator
UNDEFINED 

Undefined type.

THEO 

Kinematics related to to theory data.

EXP 

Kinematics related to experimental data.

Constructor & Destructor Documentation

◆ KinematicType() [1/3]

PARTONS::KinematicType::KinematicType ( )

Default constructor.

◆ KinematicType() [2/3]

PARTONS::KinematicType::KinematicType ( Type  type)

Assignment constructor.

Parameters
typeType to be assigned.

◆ KinematicType() [3/3]

PARTONS::KinematicType::KinematicType ( const KinematicType other)

Copy constructor.

Parameters
otherObject to be copied.

Member Function Documentation

◆ getType()

KinematicType::Type PARTONS::KinematicType::getType ( ) const

Get type being assigned to a declared object of this class.

◆ operator Type()

PARTONS::KinematicType::operator KinematicType::Type ( ) const

Automatic cast to enum.

◆ setType()

void PARTONS::KinematicType::setType ( Type  type)

Assign type to a declared object of this class.

◆ toString()

std::string PARTONS::KinematicType::toString ( ) const

Get string representation of type being assigned to a declared object of this class.

Returns
String representation of assigned type, like "THEO" for KinematicType::THEO.

Member Data Documentation

◆ m_type

KinematicType::Type PARTONS::KinematicType::m_type
private

Type associated to a declared object of this class.


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