15 #include <dpsim-models/Attribute.h>
16 #include <dpsim-models/Config.h>
23 AttributeBase::Map mAttributeMap;
26 using Ptr = std::shared_ptr<AttributeList>;
30 const AttributeBase::Map &attributes()
const {
return mAttributeMap; };
39 mAttributeMap[name] = newAttr;
50 mAttributeMap[name] = newAttr;
56 auto it = mAttributeMap.find(name);
57 if (it == mAttributeMap.end())
67 auto attrPtr = std::dynamic_pointer_cast<Attribute<T>>(attr.getPtr());
69 if (attrPtr ==
nullptr)
Base class of objects having attributes to access member variables.
AttributeBase::Ptr attribute(const String &name) const
Return pointer to an attribute.
Attribute< T >::Ptr createDynamic(const String &name)
Attribute< T >::Ptr attributeTyped(const String &name) const
Return pointer to an attribute.
Attribute< T >::Ptr create(const String &name, T intitialValue=T())