Belle II Software development
DataNode< AVariableManager, T > Class Template Reference

Template class for storing the Constants (int, double, bool) of the Cutstring. More...

#include <CutNodes.h>

Inheritance diagram for DataNode< AVariableManager, T >:
AbstractExpressionNode< AVariableManager >

Public Types

typedef AVariableManager::Var Var
 Template argument dependent Variable type definition.
 

Public Member Functions

AVariableManager::VarVariant evaluate (const Object *p) const override
 return m_value as a variant<double, int, bool>
 
void print () const override
 Print node.
 
std::string decompile () const override
 Decompile Node back to a string.
 
 ~DataNode ()
 Destructor.
 

Private Types

typedef AbstractExpressionNode< AVariableManager >::Object Object
 Template argument dependent Particle type definition.
 

Private Member Functions

 DataNode (T value)
 Constructor.
 

Private Attributes

const T m_value
 constant of type T which is always returned by evaluate(const Object* p)
 

Friends

class NodeFactory
 

Detailed Description

template<class AVariableManager, typename T>
class Belle2::DataNode< AVariableManager, T >

Template class for storing the Constants (int, double, bool) of the Cutstring.

evaluate(p) returns the value.

Definition at line 886 of file CutNodes.h.

Member Typedef Documentation

◆ Object

typedef AbstractExpressionNode<AVariableManager>::Object Object
private

Template argument dependent Particle type definition.

Definition at line 892 of file CutNodes.h.

◆ Var

typedef AVariableManager::Var Var
inherited

Template argument dependent Variable type definition.

Definition at line 75 of file AbstractNodes.h.

Constructor & Destructor Documentation

◆ DataNode()

DataNode ( value)
inlineexplicitprivate

Constructor.

Parameters
value(T): some constant value in cut may be of type double, int, bool

Definition at line 897 of file CutNodes.h.

897: m_value{value} {};
const T m_value
constant of type T which is always returned by evaluate(const Object* p)
Definition: CutNodes.h:898

◆ ~DataNode()

~DataNode ( )
inline

Destructor.

Definition at line 933 of file CutNodes.h.

933{}

Member Function Documentation

◆ decompile()

std::string decompile ( ) const
inlineoverridevirtual

Decompile Node back to a string.

decompile(compile) should give the same result.

Implements AbstractExpressionNode< AVariableManager >.

Definition at line 923 of file CutNodes.h.

924 {
925 std::stringstream stringstream;
926 stringstream << std::boolalpha;
927 stringstream << m_value;
928 return stringstream.str();
929 }

◆ evaluate()

AVariableManager::VarVariant evaluate ( const Object p) const
inlineoverridevirtual

return m_value as a variant<double, int, bool>

Parameters
ppointer to the object, that should be checked. Not needed here since we always return the constant m_value.

Implements AbstractExpressionNode< AVariableManager >.

Definition at line 904 of file CutNodes.h.

905 {
906 (void)p;
907 typename AVariableManager::VarVariant ret{m_value};
908 return ret;
909 }

◆ print()

void print ( ) const
inlineoverridevirtual

Print node.

Implements AbstractExpressionNode< AVariableManager >.

Definition at line 913 of file CutNodes.h.

914 {
915 std::cout << std::boolalpha;
916 std::cout << m_value;
917 }

Friends And Related Function Documentation

◆ NodeFactory

friend class NodeFactory
friend

Definition at line 888 of file CutNodes.h.

Member Data Documentation

◆ m_value

const T m_value
private

constant of type T which is always returned by evaluate(const Object* p)

Definition at line 898 of file CutNodes.h.


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