ComPWA
Common Partial-Wave-Analysis Framework
ComPWA::FunctionTree::Parameter Class Referenceabstract

Base class for internal parameter. More...

#include <Parameter.hpp>

Public Member Functions

 Parameter (std::string name, ParType type=ParType::UNDEFINED)
 Constructor with name of parameter and optional type. More...
 
virtual ~Parameter ()=default
 
virtual std::string name () const
 Getter for name of object. More...
 
virtual void setName (std::string n)
 Getter for name of object. More...
 
virtual ParType type () const
 Getter for type of object. More...
 
virtual std::string className () const =0
 Getter for typename of object, to be defined by the actual implementation. More...
 
virtual bool isParameter () const
 
void attach (std::weak_ptr< ParObserver > newObserver)
 Attaches a new TreeNode as Observer. More...
 
void detachExpired ()
 Removes TreeNodes not needed as Observer anymore. More...
 
void notify ()
 Notify all observing TreeNodes that parameter changed. More...
 
virtual std::string to_str () const =0
 A public function returning a string with parameter information. More...
 
virtual std::string val_to_str () const =0
 A public function returning a string with parameter value. More...
 

Protected Attributes

std::string Name
 Name of parameter. More...
 
ParType Type
 Type of parameter (e.g. Double, Integer, ...) More...
 
std::vector< std::weak_ptr< ParObserver > > ObservingNodes
 List of observers, e.g. TreeNodes. More...
 

Private Member Functions

template<class archive >
void serialize (archive &ar, const unsigned int version)
 

Friends

std::ostream & operator<< (std::ostream &out, std::shared_ptr< Parameter > b)
 
std::ostream & operator<< (std::ostream &out, Parameter &b)
 

Detailed Description

Base class for internal parameter.

This class defines the internal container of a parameter. For the use in the function tree, the observer pattern is used and this class takes over the role of the Subject. Therefore the actual implementations of Parameter are the ConcreteSubjects of the observer pattern and the TreeNodes take the role of the observers.

Definition at line 79 of file Parameter.hpp.

+ Inheritance diagram for ComPWA::FunctionTree::Parameter:
+ Collaboration diagram for ComPWA::FunctionTree::Parameter:

Constructor & Destructor Documentation

◆ Parameter()

ComPWA::FunctionTree::Parameter::Parameter ( std::string  name,
ParType  type = ParType::UNDEFINED 
)
inline

Constructor with name of parameter and optional type.

Definition at line 82 of file Parameter.hpp.

◆ ~Parameter()

virtual ComPWA::FunctionTree::Parameter::~Parameter ( )
virtualdefault

Member Function Documentation

◆ attach()

void ComPWA::FunctionTree::Parameter::attach ( std::weak_ptr< ParObserver newObserver)
inline

Attaches a new TreeNode as Observer.

Definition at line 104 of file Parameter.hpp.

◆ className()

virtual std::string ComPWA::FunctionTree::Parameter::className ( ) const
pure virtual

Getter for typename of object, to be defined by the actual implementation.

Implemented in ComPWA::FunctionTree::FitParameter, and ComPWA::FunctionTree::Value< T >.

◆ detachExpired()

void ComPWA::FunctionTree::Parameter::detachExpired ( )
inline

Removes TreeNodes not needed as Observer anymore.

Definition at line 109 of file Parameter.hpp.

◆ isParameter()

virtual bool ComPWA::FunctionTree::Parameter::isParameter ( ) const
inlinevirtual

Reimplemented in ComPWA::FunctionTree::FitParameter.

Definition at line 99 of file Parameter.hpp.

◆ name()

virtual std::string ComPWA::FunctionTree::Parameter::name ( ) const
inlinevirtual

Getter for name of object.

Definition at line 88 of file Parameter.hpp.

◆ notify()

void ComPWA::FunctionTree::Parameter::notify ( )
inline

Notify all observing TreeNodes that parameter changed.

Definition at line 117 of file Parameter.hpp.

◆ serialize()

template<class archive >
void ComPWA::FunctionTree::Parameter::serialize ( archive &  ar,
const unsigned int  version 
)
inlineprivate

Definition at line 156 of file Parameter.hpp.

◆ setName()

virtual void ComPWA::FunctionTree::Parameter::setName ( std::string  n)
inlinevirtual

Getter for name of object.

Definition at line 91 of file Parameter.hpp.

◆ to_str()

virtual std::string ComPWA::FunctionTree::Parameter::to_str ( ) const
pure virtual

A public function returning a string with parameter information.

Implemented in ComPWA::FunctionTree::FitParameter, and ComPWA::FunctionTree::Value< T >.

◆ type()

virtual ParType ComPWA::FunctionTree::Parameter::type ( ) const
inlinevirtual

Getter for type of object.

Definition at line 94 of file Parameter.hpp.

◆ val_to_str()

virtual std::string ComPWA::FunctionTree::Parameter::val_to_str ( ) const
pure virtual

A public function returning a string with parameter value.

Implemented in ComPWA::FunctionTree::FitParameter, and ComPWA::FunctionTree::Value< T >.

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  out,
std::shared_ptr< Parameter b 
)
friend

Definition at line 123 of file Parameter.hpp.

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  out,
Parameter b 
)
friend

Definition at line 128 of file Parameter.hpp.

Member Data Documentation

◆ Name

std::string ComPWA::FunctionTree::Parameter::Name
protected

Name of parameter.

Definition at line 145 of file Parameter.hpp.

◆ ObservingNodes

std::vector<std::weak_ptr<ParObserver> > ComPWA::FunctionTree::Parameter::ObservingNodes
protected

List of observers, e.g. TreeNodes.

Definition at line 151 of file Parameter.hpp.

◆ Type

ParType ComPWA::FunctionTree::Parameter::Type
protected

Type of parameter (e.g. Double, Integer, ...)

Definition at line 148 of file Parameter.hpp.


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