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

Object attribute with a constant scalar value. More...

#include <SValue.h>

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

Public Member Functions

 SValue ()
 Default constructor.
 SValue (const T &val)
 Constructor.
 SValue (const SValue< T > &)
virtual ~SValue ()
virtual SValue< T > * clone () const
 Make clone.
virtual T evaluate ()
 Evaluate.
virtual void print (std::ostream &) const
 Print the attribute value.
void print (std::ostream &os) const
 Print value.
void print (std::ostream &os) const
 Print value.
void print (std::ostream &os) const
 Print value.
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.
virtual void invalidate ()
 Force re-evaluation.

Protected Attributes

value
 The value of the attribute.

Private Member Functions

void operator= (const SValue< T > &)

Private Attributes

int refCount

Detailed Description

template<class T>
class Expressions::SValue< T >

Object attribute with a constant scalar value.

Definition at line 34 of file SValue.h.

Constructor & Destructor Documentation

◆ SValue() [1/3]

template<class T>
Expressions::SValue< T >::SValue ( )

Default constructor.

Definition at line 75 of file SValue.h.

References value.

Referenced by clone(), operator=(), print(), Expressions::SDeferred< T >::SDeferred(), Expressions::SDeferred< T >::SDeferred(), and SValue().

◆ SValue() [2/3]

template<class T>
Expressions::SValue< T >::SValue ( const T & val)
explicit

Constructor.

Definition at line 87 of file SValue.h.

References value.

◆ SValue() [3/3]

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

Definition at line 81 of file SValue.h.

References SValue(), and value.

Here is the call graph for this function:

◆ ~SValue()

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

Definition at line 93 of file SValue.h.

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>
SValue< T > * Expressions::SValue< T >::clone ( ) const
virtual

Make clone.

Implements AttributeBase.

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

Definition at line 98 of file SValue.h.

References SValue(), and value.

Here is the call graph for this function:

◆ evaluate()

template<class T>
T Expressions::SValue< T >::evaluate ( )
virtual

Evaluate.

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

Definition at line 104 of file SValue.h.

References value.

◆ 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:

◆ invalidate()

void Invalidator::invalidate ( )
virtualinherited

◆ 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::SValue< T >::operator= ( const SValue< T > & )
private

References SValue().

Here is the call graph for this function:

◆ print() [1/4]

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

Print the attribute value.

Implements AttributeBase.

Reimplemented in Expressions::SDeferred< T >.

Definition at line 113 of file SValue.h.

References value.

Referenced by print().

◆ print() [2/4]

void Expressions::SValue< std::string >::print ( std::ostream & ) const
inlinevirtual

Print value.

Implements AttributeBase.

Definition at line 138 of file SValue.h.

References value.

◆ print() [3/4]

void Expressions::SValue< bool >::print ( std::ostream & ) const
inlinevirtual

Print value.

Implements AttributeBase.

Definition at line 131 of file SValue.h.

References value.

◆ print() [4/4]

void Expressions::SValue< std::list< Token > >::print ( std::ostream & ) const
inlinevirtual

Print value.

Implements AttributeBase.

Definition at line 120 of file SValue.h.

References print(), SValue(), and value.

Here is the call graph for this function:

◆ removeReference()

int RCObject::removeReference ( ) const
inlineinherited

Decrement the reference count.

Definition at line 88 of file RCObject.h.

References refCount.

Member Data Documentation

◆ refCount

int RCObject::refCount
mutableprivateinherited

Definition at line 76 of file RCObject.h.

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

◆ value

template<class T>
T Expressions::SValue< T >::value
mutableprotected

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