DPsim
|
#include <Attribute.h>
Public Types | |
using | element_type = T |
Public Member Functions | |
AttributePointer (const AttributePointer &r)=default | |
AttributePointer (std::shared_ptr< T > ptr) | |
AttributePointer (std::nullptr_t ptr) | |
AttributePointer (T *ptr) | |
template<class U > | |
AttributePointer (AttributePointer< U > ptr) | |
template<class U > | |
AttributePointer (std::shared_ptr< U > ptr) | |
AttributePointer & | operator= (const AttributePointer &r) noexcept |
template<class U > | |
AttributePointer & | operator= (const AttributePointer< U > &r) noexcept |
AttributePointer & | operator= (AttributePointer &&r) |
template<class U > | |
AttributePointer & | operator= (AttributePointer< U > &&r) |
T & | operator* () const noexcept |
T * | operator-> () const noexcept |
T * | get () const |
std::shared_ptr< T > | getPtr () const |
bool | isNull () const |
Custom pointer class for storing attributes as member variables and in the mAttributes
attribute map. Using this type over the normal std::shared_ptr
allows for disabling certain operator overloads, e.g. the comparison with the nullptr / the number 0 that is possible with shared ptrs. Since attribute pointers rarely need to be compared with the nullptr, disabling the implicit comparison allows for detecting more errors at compile time. Explicit comparison still remains possible via the getPtr
method.
Definition at line 46 of file Attribute.h.