OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Expressions::SRefAttr< T > Class Template Reference

An attribute defined as a reference to a scalar. More...

#include <SRefAttr.h>

Inheritance diagram for Expressions::SRefAttr< T >:
Collaboration diagram for Expressions::SRefAttr< T >:

Public Member Functions

 SRefAttr (const std::string &oName, const std::string &aName, int index)
 Constructor.
 SRefAttr (const SRefAttr &)
virtual ~SRefAttr ()
virtual SRefAttr< T > * clone () const
 Make clone.
virtual T evaluate () const
 Evaluate.
virtual double getReal ()
 Return real value.
virtual void invalidate ()
 Invalidate.
virtual void print (std::ostream &) const
 Print the reference.
virtual void set (const T &) const
 Store new value.
double getReal ()
std::string getImage () const
 Convert to string.
virtual bool isExpression () const
 Test for expression.
int addReference () const
 Increment reference count.
int removeReference () const
 Decrement the reference count.
bool isShared () const
 Test for sharing.

Private Member Functions

 SRefAttr ()
void operator= (const SRefAttr &)
void fill () const

Private Attributes

const std::string obj_name
const std::string att_name
const int itsIndex
ObjectitsObject
AttributeitsAttr
int refCount

Static Private Attributes

static const std::string typeName

Detailed Description

template<class T>
class Expressions::SRefAttr< T >

An attribute defined as a reference to a scalar.

Definition at line 48 of file SRefAttr.h.

Constructor & Destructor Documentation

◆ SRefAttr() [1/3]

template<class T>
Expressions::SRefAttr< T >::SRefAttr ( const std::string & oName,
const std::string & aName,
int index )

Constructor.

Definition at line 116 of file SRefAttr.h.

References att_name, itsAttr, itsIndex, itsObject, and obj_name.

Referenced by clone(), fill(), operator=(), and SRefAttr().

◆ SRefAttr() [2/3]

template<class T>
Expressions::SRefAttr< T >::SRefAttr ( const SRefAttr< T > & rhs)

Definition at line 123 of file SRefAttr.h.

References att_name, AttributeBase::AttributeBase(), itsAttr, itsIndex, itsObject, obj_name, and SRefAttr().

Here is the call graph for this function:

◆ ~SRefAttr()

template<class T>
Expressions::SRefAttr< T >::~SRefAttr ( )
virtual

Definition at line 131 of file SRefAttr.h.

References itsObject.

◆ SRefAttr() [3/3]

template<class T>
Expressions::SRefAttr< T >::SRefAttr ( )
private

Member Function Documentation

◆ addReference()

int RCObject::addReference ( ) const
inlineinherited

Increment reference count.

Definition at line 83 of file RCObject.h.

References refCount.

Referenced by Pointer< Object >::operator=(), Pointer< Object >::operator=(), and Pointer< Object >::unique().

◆ clone()

template<class T>
SRefAttr< T > * Expressions::SRefAttr< T >::clone ( ) const
virtual

Make clone.

Implements AttributeBase.

Definition at line 138 of file SRefAttr.h.

References SRefAttr().

Here is the call graph for this function:

◆ evaluate()

template<class T>
T Expressions::SRefAttr< T >::evaluate ( ) const
virtual

Evaluate.

Definition at line 144 of file SRefAttr.h.

References AttributeBase::AttributeBase(), fill(), AttributeBase::getImage(), itsAttr, and itsIndex.

Referenced by Attributes::getBool(), Attributes::getReal(), getReal(), and Attributes::getString().

Here is the call graph for this function:

◆ fill()

template<class T>
void Expressions::SRefAttr< T >::fill ( ) const
private

Definition at line 220 of file SRefAttr.h.

References att_name, OpalData::find(), OpalData::getInstance(), itsAttr, itsIndex, itsObject, obj_name, and SRefAttr().

Referenced by evaluate(), and set().

Here is the call graph for this function:

◆ getImage()

std::string AttributeBase::getImage ( ) const
inherited

Convert to string.

Definition at line 34 of file AttributeBase.cpp.

References print().

Referenced by Expressions::ADeferred< T >::evaluate(), Expressions::SDeferred< T >::evaluate(), and Expressions::SRefAttr< T >::evaluate().

Here is the call graph for this function:

◆ getReal() [1/2]

double Expressions::SRefAttr< double >::getReal ( )
inline

Definition at line 183 of file SRefAttr.h.

References evaluate().

Here is the call graph for this function:

◆ getReal() [2/2]

template<class T>
double Expressions::SRefAttr< T >::getReal ( )
virtual

Return real value.

Definition at line 176 of file SRefAttr.h.

◆ invalidate()

template<class T>
void Expressions::SRefAttr< T >::invalidate ( )
virtual

Invalidate.

Reimplemented from Invalidator.

Definition at line 198 of file SRefAttr.h.

References itsAttr, and itsObject.

◆ isExpression()

bool AttributeBase::isExpression ( ) const
virtualinherited

Test for expression.

Reimplemented in Expressions::ADeferred< T >, and Expressions::SDeferred< T >.

Definition at line 42 of file AttributeBase.cpp.

Referenced by OpalElement::printMultipoleStrength().

◆ isShared()

bool RCObject::isShared ( ) const
inlineinherited

Test for sharing.

Definition at line 93 of file RCObject.h.

References refCount.

◆ operator=()

template<class T>
void Expressions::SRefAttr< T >::operator= ( const SRefAttr< T > & )
private

References SRefAttr().

Here is the call graph for this function:

◆ print()

template<class T>
void Expressions::SRefAttr< T >::print ( std::ostream & os) const
virtual

Print the reference.

Implements AttributeBase.

Definition at line 189 of file SRefAttr.h.

References att_name, itsIndex, and obj_name.

◆ removeReference()

int RCObject::removeReference ( ) const
inlineinherited

Decrement the reference count.

Definition at line 88 of file RCObject.h.

References refCount.

◆ set()

template<class T>
void Expressions::SRefAttr< T >::set ( const T & value) const
virtual

Store new value.

Definition at line 205 of file SRefAttr.h.

References AttributeBase::AttributeBase(), fill(), and itsAttr.

Referenced by Attributes::setBool(), Attributes::setPredefinedString(), Attributes::setReal(), Attributes::setString(), and Attributes::setUpperCaseString().

Here is the call graph for this function:

Member Data Documentation

◆ att_name

template<class T>
const std::string Expressions::SRefAttr< T >::att_name
private

Definition at line 96 of file SRefAttr.h.

Referenced by fill(), print(), SRefAttr(), and SRefAttr().

◆ itsAttr

template<class T>
Attribute* Expressions::SRefAttr< T >::itsAttr
mutableprivate

Definition at line 101 of file SRefAttr.h.

Referenced by evaluate(), fill(), invalidate(), set(), SRefAttr(), and SRefAttr().

◆ itsIndex

template<class T>
const int Expressions::SRefAttr< T >::itsIndex
private

Definition at line 97 of file SRefAttr.h.

Referenced by evaluate(), fill(), print(), SRefAttr(), and SRefAttr().

◆ itsObject

template<class T>
Object* Expressions::SRefAttr< T >::itsObject
mutableprivate

Definition at line 100 of file SRefAttr.h.

Referenced by fill(), invalidate(), SRefAttr(), SRefAttr(), and ~SRefAttr().

◆ obj_name

template<class T>
const std::string Expressions::SRefAttr< T >::obj_name
private

Definition at line 95 of file SRefAttr.h.

Referenced by fill(), print(), SRefAttr(), and SRefAttr().

◆ refCount

int RCObject::refCount
mutableprivateinherited

Definition at line 76 of file RCObject.h.

Referenced by addReference(), isShared(), RCObject(), RCObject(), and removeReference().

◆ typeName

template<class T>
const std::string Expressions::SRefAttr< T >::typeName
staticprivate

Definition at line 92 of file SRefAttr.h.


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