7 #ifndef ATLAS_OBJECTS_BASEOBJECT_H 8 #define ATLAS_OBJECTS_BASEOBJECT_H 10 #include <Atlas/Message/MEncoder.h> 11 #include <Atlas/Message/Element.h> 12 #include <Atlas/Bridge.h> 13 #include <Atlas/Exception.h> 46 static const int BASE_OBJECT_NO = 0;
84 int getAttrFlags()
const 92 virtual bool instanceOf(
int classNo)
const;
95 bool hasAttr(
const std::string& name)
const;
97 bool hasAttrFlag(
int flag)
const;
104 virtual int copyAttr(
const std::string& name,
107 virtual void setAttr(
const std::string& name,
110 virtual void removeAttr(
const std::string& name);
112 virtual void removeAttrFlag(
int flag);
116 const Atlas::Message::MapType asMessage()
const;
119 virtual void addToMessage(Atlas::Message::MapType &)
const;
125 inline void incRef();
126 inline void decRef();
138 virtual void free() = 0;
165 iterator() : m_obj(0), m_val(
"", *
this) {}
167 m_current_class(I.m_current_class),
168 m_I(I.m_I), m_val(I.m_val.first, *
this) {}
179 bool operator==(
const iterator& I)
const;
181 bool operator!=(
const iterator& I)
const {
return !operator==(I);}
201 typedef std::pair<std::string,PsuedoElement> value_type;
203 const value_type& operator*()
const {
return m_val;}
204 const value_type* operator->()
const {
return &m_val;}
209 Message::MapType::iterator m_I;
223 m_current_class(I.m_current_class),
224 m_I(I.m_I), m_val(I.m_val.first, *
this) {}
226 m_current_class(I.m_current_class),
227 m_I(I.m_I), m_val(I.m_val.first, *
this) {}
240 bool operator!=(
const const_iterator& I)
const {
return !operator==(I);}
255 typedef std::pair<std::string,PsuedoElement> value_type;
257 const value_type& operator*()
const {
return m_val;}
258 const value_type* operator->()
const {
return &m_val;}
263 Message::MapType::const_iterator m_I;
280 virtual int getAttrClass(
const std::string& name)
const;
283 virtual int getAttrFlag(
const std::string& name)
const;
286 virtual void iterate(
int& current_class, std::string& attr)
const;
294 std::map<std::string, Atlas::Message::Element> m_attributes;
299 void BaseObjectData::incRef() {
303 void BaseObjectData::decRef() {
305 assert( m_refCount >= 0 );
Definition: BaseObject.h:216
const std::string & getName() const
Get the name of the attribute which does not exist.
Definition: BaseObject.h:41
Atlas stream bridge.
Definition: Bridge.h:35
The iterator first iterates over the contents of m_obj->m_attributes, holding an iterator to the attr...
Definition: BaseObject.h:159
int getClassNo() const
Get class number:
Definition: BaseObject.h:79
Multi-type container.
Definition: Element.h:60
The Atlas namespace.
Definition: Bridge.h:20
An exception indicating the requested attribute does not exist.
Definition: BaseObject.h:32
Definition: BaseObject.h:183
static BaseObjectData * alloc()
Allocate a new instance of this class, using an existing instance if available.
Definition: BaseObject.h:133
Definition: BaseObject.h:242
Atlas base object class.
Definition: BaseObject.h:67
Base class for all exceptions thrown by Atlas-C++.
Definition: Exception.h:17