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

Definition of enumeration values for channels. More...

Public Types

enum  Type {
  UNDEFINED = 0 , DVCS = 1 , DVMP = 2 , TCS = 3 ,
  GAM2 = 4 , DDVCS = 5
}
 Definition of enumerate values corresponding to channels. More...
 

Public Member Functions

 ChannelType ()
 Default constructor. More...
 
 ChannelType (Type type)
 Assignment constructor. More...
 
virtual ~ChannelType ()
 Destructor. 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...
 
std::string getShortName ()
 Get short name representation of type being assigned to a declared object of this class. More...
 
ChannelType::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

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

Detailed Description

Definition of enumeration values for channels.

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

//this is single enum variable - nothing to play with
//this is declared object
ChannelType enum_object;
//let us assign some type (default is ChannelType::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 = ChannelType(ChannelType::DVMP).toString();
Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Channel is: " << enum_string_1);
Partons::getInstance()->getLoggerManager()->info("example", __func__, ElemUtils::Formatter() << "Channel is: " << enum_string_2);
Type
Definition of enumerate values corresponding to channels.
Definition: ChannelType.h:52
@ DVCS
Deeply Virtual Compton Scattering.
Definition: ChannelType.h:54
@ DVMP
Deeply Virtual Meson Production.
Definition: ChannelType.h:55
ChannelType()
Default constructor.
Definition: ChannelType.cpp:5
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:01:45 [INFO] (example::main) Channel is: DVCS
20-05-2017 12:01:45 [INFO] (example::main) Channel is: DVMP

Member Enumeration Documentation

◆ Type

Definition of enumerate values corresponding to channels.

Enumerator
UNDEFINED 

Undefined type.

DVCS 

Deeply Virtual Compton Scattering.

DVMP 

Deeply Virtual Meson Production.

TCS 

Time-like Compton Scattering.

GAM2 

Two photons production.

DDVCS 

Double Deeply Virtual Compton Scattering.

Constructor & Destructor Documentation

◆ ChannelType() [1/2]

PARTONS::ChannelType::ChannelType ( )

Default constructor.

◆ ChannelType() [2/2]

PARTONS::ChannelType::ChannelType ( Type  type)

Assignment constructor.

Parameters
typeType to be assigned.

◆ ~ChannelType()

PARTONS::ChannelType::~ChannelType ( )
virtual

Destructor.

Member Function Documentation

◆ getShortName()

std::string PARTONS::ChannelType::getShortName ( )

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

Returns
Short string representation of assigned type, like "DVCS" for ChannelType:DVCS.

◆ getType()

ChannelType::Type PARTONS::ChannelType::getType ( ) const

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

◆ operator Type()

PARTONS::ChannelType::operator ChannelType::Type ( ) const

Automatic cast to enum.

◆ setType()

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

Assign type to a declared object of this class.

◆ toString()

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

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

Returns
String representation of assigned type, like "DVCS" for ChannelType::DVCS.

Member Data Documentation

◆ m_type

ChannelType::Type PARTONS::ChannelType::m_type
private

Type associated to a declared object of this class.


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