7 #include <Atlas/Objects/BaseObject.h>
10 using Atlas::Message::MapType;
12 namespace Atlas {
namespace Objects {
15 m_class_no(BASE_OBJECT_NO),
20 if(defaults ==
nullptr) {
25 BaseObjectData::~BaseObjectData()
27 assert( m_refCount==0 );
32 return BASE_OBJECT_NO == classNo;
41 return m_attrFlags & flag;
43 return (m_attributes.find(name) != m_attributes.end());
49 return m_attrFlags & flag;
64 auto I = m_attributes.find(name);
65 if (I == m_attributes.end()) {
74 m_attributes[std::move(name)] = std::move(attr);
83 m_attributes.erase(name);
101 for (
const auto & attribute : m_attributes) {
102 m[attribute.first] = attribute.second;
109 for (
const auto & attribute : m_attributes) {
110 e.mapElementItem(attribute.first, attribute.second);
virtual void addToMessage(Atlas::Message::MapType &) const
Write this object to an existing Element.
virtual void removeAttr(const std::string &name)
Remove the attribute "name".
virtual int getAttrClass(const std::string &name) const
Find the class which contains the attribute "name".
Atlas::Message::MapType asMessage() const
bool hasAttr(const std::string &name) const
Check whether the attribute "name" exists.
virtual void removeAttrFlag(uint32_t flag)
Remove the attribute "name".
virtual bool getAttrFlag(const std::string &name, uint32_t &flag) const
Find the flag for the attribute "name".
Atlas::Message::Element getAttr(const std::string &name) const
virtual int copyAttr(const std::string &name, Atlas::Message::Element &attr) const
virtual void setAttr(std::string name, Atlas::Message::Element attr, const Atlas::Objects::Factories *factories=nullptr)
Set the attribute "name" to the value given by "attr".
virtual void sendContents(Atlas::Bridge &b) const
Send the contents of this object to a Bridge.
BaseObjectData(BaseObjectData *defaults)
bool hasAttrFlag(uint32_t flag) const
Check whether the attribute "name" exists.
virtual bool instanceOf(int classNo) const
Is this instance of some class?