DPsim
|
#include <Attribute.h>
Public Member Functions | |
AttributeStatic (T initialValue=T()) | |
virtual void | set (T value) override |
virtual T & | get () override |
virtual bool | isStatic () const override |
virtual void | setReference (typename Attribute< T >::Ptr reference) override |
virtual std::shared_ptr< T > | asRawPointer () override |
virtual void | appendDependencies (AttributeBase::Set *deps) override |
![]() | |
Attribute (T initialValue=T()) | |
String | toString () override |
Fallback method for all attribute types not covered by the specifications in Attribute.cpp. | |
operator const T & () | |
User-defined cast operator. More... | |
T & | operator* () |
User-defined dereference operator. More... | |
bool | copyValue (AttributeBase::Ptr copyFrom) override |
Copy the attribute value of copyFrom onto this attribute. More... | |
const std::type_info & | getType () override |
Get the type of this attribute. More... | |
AttributeBase::Ptr | cloneValueOntoNewAttribute () override |
Generates a new attribute of the same type and copies the current value in the heap. Does not copy any dependency relations! More... | |
template<class U > | |
Attribute< U >::Ptr | derive (typename AttributeUpdateTask< U, T >::Actor getter=typename AttributeUpdateTask< U, T >::Actor(), typename AttributeUpdateTask< U, T >::Actor setter=typename AttributeUpdateTask< U, T >::Actor()) |
template<typename U = T, std::enable_if_t< std::is_same_v< Complex, U >, bool > = true> | |
AttributePointer< Attribute< Real > > | deriveReal () |
template<typename U = T, std::enable_if_t< std::is_same_v< Complex, U >, bool > = true> | |
AttributePointer< Attribute< Real > > | deriveImag () |
template<typename U = T, std::enable_if_t< std::is_same_v< Complex, U >, bool > = true> | |
AttributePointer< Attribute< Real > > | deriveMag () |
template<typename U = T, std::enable_if_t< std::is_same_v< Complex, U >, bool > = true> | |
AttributePointer< Attribute< Real > > | derivePhase () |
template<typename U = T, std::enable_if_t< std::is_same_v< Real, U >||std::is_same_v< Complex, U >, bool > = true> | |
AttributePointer< Attribute< T > > | deriveScaled (T scale) |
template<class U , class V = T, std::enable_if_t< std::is_same_v< CPS::MatrixVar< U >, V >, bool > = true> | |
AttributePointer< Attribute< U > > | deriveCoeff (typename CPS::MatrixVar< U >::Index row, typename CPS::MatrixVar< U >::Index column) |
String | toString () |
String | toString () |
String | toString () |
![]() | |
virtual AttributeBase::Set | getDependencies () final |
Friends | |
class | SharedFactory< AttributeStatic< T > > |
Additional Inherited Members | |
![]() | |
using | Type = T |
using | Ptr = AttributePointer< Attribute< T > > |
![]() | |
typedef AttributePointer< AttributeBase > | Ptr |
typedef std::vector< Ptr > | List |
typedef std::set< Ptr, AttributeCmp< AttributeBase > > | Set |
typedef std::map< String, Ptr > | Map |
![]() | |
static std::shared_ptr< AttributeStatic< T > > | make (Args &&...args) |
![]() | |
std::shared_ptr< T > | mData |
Class for static attributes. A static attribute's value can only ever by changed via the get
and set
methods (or the reference provided by get
). Static attributes do not directly depend on any other attributes and currently cannot have any update tasks.
Definition at line 542 of file Attribute.h.
|
inlineoverridevirtual |
Append all dependencies of this attribute to the given set. For static attributes, this will only append this
, for dynamic attributes, it will recursively collect and append all dependencies.
Implements CPS::AttributeBase.
Definition at line 561 of file Attribute.h.
|
inlineoverridevirtual |
Exposing the underlying shared_ptr for this attribute's data. Used to create reference relations between two attributes.
Implements CPS::Attribute< T >.
Definition at line 559 of file Attribute.h.
|
inlineoverridevirtual |
Get a mutable reference to the attribute's underlying data. This method is also called when dereferencing an attribute using the * operator
Implements CPS::Attribute< T >.
Definition at line 551 of file Attribute.h.
|
inlineoverridevirtual |
Check whether this is a static or dynamic attribute
AttributeStatic
, false for instances of AttributeDynamic
Implements CPS::AttributeBase.
Definition at line 553 of file Attribute.h.
|
inlineoverridevirtual |
Manually set the attribute to the given value. For dynamic attributes, this will trigger the UPDATE_ON_SET tasks for updating any dependency attributes.
Implements CPS::Attribute< T >.
Definition at line 549 of file Attribute.h.
|
inlineoverridevirtual |
Convenience method for setting this attribute to always equal another attribute. When this
is dynamic, this will set up an UPDATE_ONCE task that sets this attribute's data pointer to equal the data pointer of the referenced attribute. If this
is static, calling this method will result in a runtime error.
reference | The attribute which's value will be adapted |
Implements CPS::Attribute< T >.
Definition at line 555 of file Attribute.h.