23 AttributeBase::Map mAttributeMap;
26 using Ptr = std::shared_ptr<AttributeList>;
30 const AttributeBase::Map &attributes()
const {
return mAttributeMap; };
34 typename Attribute<T>::Ptr create(
const String &name, T intitialValue = T()) {
35 typename Attribute<T>::Ptr newAttr =
37 mAttributeMap[name] = newAttr;
43 typename Attribute<T>::Ptr createDynamic(
const String &name) {
44 typename Attribute<T>::Ptr newAttr =
46 mAttributeMap[name] = newAttr;
51 AttributeBase::Ptr
attribute(
const String &name)
const {
52 auto it = mAttributeMap.find(name);
53 if (it == mAttributeMap.end())
63 auto attrPtr = std::dynamic_pointer_cast<Attribute<T>>(attr.getPtr());
65 if (attrPtr ==
nullptr)
68 return typename Attribute<T>::Ptr(attrPtr);