Atlas
0.7.0
Networking protocol for the Worldforge system.
|
All objects inherit from this.. More...
#include <Root.h>
Public Member Functions | |
RootData * | copy () const override |
Copy this object. More... | |
bool | instanceOf (int classNo) const override |
Is this instance of some class? More... | |
int | copyAttr (const std::string &name, Atlas::Message::Element &attr) const override |
void | setAttr (std::string name, Atlas::Message::Element attr, const Atlas::Objects::Factories *factories=nullptr) override |
Set the attribute "name" to the value given by"attr". More... | |
void | removeAttr (const std::string &name) override |
Remove the attribute "name". This will not work for static attributes. More... | |
void | sendContents (Atlas::Bridge &b) const override |
Send the contents of this object to a Bridge. More... | |
void | addToMessage (Atlas::Message::MapType &) const override |
Write this object to an existing Element. More... | |
void | setId (std::string val) |
Set the "id" attribute. More... | |
void | setParent (std::string val) |
Set the "parent" attribute. More... | |
void | setStamp (double val) |
Set the "stamp" attribute. More... | |
void | setObjtype (std::string val) |
Set the "objtype" attribute. More... | |
void | setName (std::string val) |
Set the "name" attribute. More... | |
const std::string & | getId () const |
Retrieve the "id" attribute. More... | |
std::string & | modifyId () |
Retrieve the "id" attribute as a non-const reference. More... | |
const std::string & | getParent () const |
Retrieve the "parent" attribute. More... | |
std::string & | modifyParent () |
Retrieve the "parent" attribute as a non-const reference. More... | |
double | getStamp () const |
Retrieve the "stamp" attribute. More... | |
double & | modifyStamp () |
Retrieve the "stamp" attribute as a non-const reference. More... | |
const std::string & | getObjtype () const |
Retrieve the "objtype" attribute. More... | |
std::string & | modifyObjtype () |
Retrieve the "objtype" attribute as a non-const reference. More... | |
const std::string & | getName () const |
Retrieve the "name" attribute. More... | |
std::string & | modifyName () |
Retrieve the "name" attribute as a non-const reference. More... | |
bool | isDefaultId () const |
Is "id" value default? More... | |
bool | isDefaultParent () const |
Is "parent" value default? More... | |
bool | isDefaultStamp () const |
Is "stamp" value default? More... | |
bool | isDefaultObjtype () const |
Is "objtype" value default? More... | |
bool | isDefaultName () const |
Is "name" value default? More... | |
int | getClassNo () const |
Get class number: More... | |
uint32_t | getAttrFlags () const |
bool | hasAttr (const std::string &name) const |
Check whether the attribute "name" exists. More... | |
bool | hasAttrFlag (uint32_t flag) const |
Check whether the attribute "name" exists. More... | |
Atlas::Message::Element | getAttr (const std::string &name) const |
virtual void | removeAttrFlag (uint32_t flag) |
Remove the attribute "name". More... | |
Atlas::Message::MapType | asMessage () const |
Static Public Attributes | |
static constexpr const char * | default_parent = "root" |
static constexpr const char * | default_objtype = "obj" |
static Allocator< RootData > | allocator |
Protected Member Functions | |
RootData (RootData *defaults=nullptr) | |
Construct a RootData class definition. More... | |
~RootData () override=default | |
Default destructor. More... | |
int | getAttrClass (const std::string &name) const override |
Find the class which contains the attribute "name". More... | |
bool | getAttrFlag (const std::string &name, uint32_t &flag) const override |
Find the flag for the attribute "name". More... | |
void | sendId (Atlas::Bridge &) const |
Send the "id" attribute to an Atlas::Bridge. More... | |
void | sendParent (Atlas::Bridge &) const |
Send the "parent" attribute to an Atlas::Bridge. More... | |
void | sendStamp (Atlas::Bridge &) const |
Send the "stamp" attribute to an Atlas::Bridge. More... | |
void | sendObjtype (Atlas::Bridge &) const |
Send the "objtype" attribute to an Atlas::Bridge. More... | |
void | sendName (Atlas::Bridge &) const |
Send the "name" attribute to an Atlas::Bridge. More... | |
void | reset () override |
Resets the object as it's returned to the pool. More... | |
void | free () override |
Free an instance of this class, returning it to the memory pool. More... | |
void | incRef () |
void | decRef () |
Static Protected Member Functions | |
template<typename T > | |
static T * | copyInstance (const T &instance) |
Protected Attributes | |
std::string | attr_id |
Id of object. More... | |
std::string | attr_parent |
The object this inherits attributes from. More... | |
double | attr_stamp |
Last time this object was modified. More... | |
std::string | attr_objtype |
What kind of object this is. More... | |
std::string | attr_name |
Name of object. More... | |
int | m_class_no |
int | m_refCount |
BaseObjectData * | m_defaults |
BaseObjectData * | m_next |
std::map< std::string, Atlas::Message::Element > | m_attributes |
uint32_t | m_attrFlags |
Friends | |
template<typename > | |
class | ::Atlas::Objects::Allocator |
All objects inherit from this..
You can browse all definitions starting from here and descending into children.
|
inlineexplicitprotected |
|
overrideprotecteddefault |
Default destructor.
|
overridevirtual |
Write this object to an existing Element.
Reimplemented from Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 119 of file Root.cpp.
References Atlas::Objects::BaseObjectData::addToMessage(), attr_id, attr_name, attr_stamp, getObjtype(), and getParent().
Referenced by Atlas::Objects::Entity::RootEntityData::addToMessage(), and Atlas::Objects::Operation::RootOperationData::addToMessage().
|
inherited |
Convert this object to a Object. This is now legacy, and implemented using addToMessage.
Definition at line 92 of file BaseObject.cpp.
References Atlas::Objects::BaseObjectData::addToMessage().
|
overridevirtual |
Copy this object.
Implements Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
|
overridevirtual |
Retrieve the attribute "name". Return non-zero if it does not exist.
Reimplemented from Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 39 of file Root.cpp.
References Atlas::Objects::BaseObjectData::copyAttr(), getId(), getName(), getObjtype(), getParent(), and getStamp().
Referenced by Atlas::Objects::Entity::RootEntityData::copyAttr(), and Atlas::Objects::Operation::RootOperationData::copyAttr().
|
overrideprotectedvirtual |
Free an instance of this class, returning it to the memory pool.
This function in combination with alloc() handle the memory pool.
Implements Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
|
inherited |
Retrieve the attribute "name". Throws NoSuchAttrException if it does not exist.
Definition at line 52 of file BaseObject.cpp.
References Atlas::Objects::BaseObjectData::copyAttr().
|
overrideprotectedvirtual |
Find the class which contains the attribute "name".
Reimplemented from Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 21 of file Root.cpp.
References Atlas::Objects::BaseObjectData::getAttrClass().
Referenced by Atlas::Objects::Entity::RootEntityData::getAttrClass(), and Atlas::Objects::Operation::RootOperationData::getAttrClass().
|
overrideprotectedvirtual |
Find the flag for the attribute "name".
Reimplemented from Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 29 of file Root.cpp.
References Atlas::Objects::BaseObjectData::getAttrFlag().
Referenced by Atlas::Objects::Entity::RootEntityData::getAttrFlag(), and Atlas::Objects::Operation::RootOperationData::getAttrFlag().
|
inlineinherited |
Get class number:
Definition at line 260 of file BaseObject.h.
|
inline |
Retrieve the "id" attribute.
Definition at line 213 of file Root.h.
References attr_id, and Atlas::Objects::BaseObjectData::m_defaults.
Referenced by copyAttr().
|
inline |
Retrieve the "name" attribute.
Definition at line 273 of file Root.h.
References attr_name, and Atlas::Objects::BaseObjectData::m_defaults.
Referenced by copyAttr().
|
inline |
Retrieve the "objtype" attribute.
Definition at line 258 of file Root.h.
References attr_objtype, and Atlas::Objects::BaseObjectData::m_defaults.
Referenced by addToMessage(), copyAttr(), and sendObjtype().
|
inline |
Retrieve the "parent" attribute.
Definition at line 228 of file Root.h.
References attr_parent, and Atlas::Objects::BaseObjectData::m_defaults.
Referenced by addToMessage(), copyAttr(), and sendParent().
|
inline |
Retrieve the "stamp" attribute.
Definition at line 243 of file Root.h.
References attr_stamp, and Atlas::Objects::BaseObjectData::m_defaults.
Referenced by copyAttr().
|
inherited |
Check whether the attribute "name" exists.
Definition at line 35 of file BaseObject.cpp.
References Atlas::Objects::BaseObjectData::getAttrFlag().
|
inherited |
Check whether the attribute "name" exists.
Definition at line 47 of file BaseObject.cpp.
|
overridevirtual |
Is this instance of some class?
Reimplemented from Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 156 of file Root.cpp.
References Atlas::Objects::BaseObjectData::instanceOf().
Referenced by Atlas::Objects::Entity::RootEntityData::instanceOf(), and Atlas::Objects::Operation::RootOperationData::instanceOf().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Retrieve the "id" attribute as a non-const reference.
Definition at line 221 of file Root.h.
References attr_id, Atlas::Objects::BaseObjectData::m_defaults, and setId().
|
inline |
Retrieve the "name" attribute as a non-const reference.
Definition at line 281 of file Root.h.
References attr_name, Atlas::Objects::BaseObjectData::m_defaults, and setName().
|
inline |
Retrieve the "objtype" attribute as a non-const reference.
Definition at line 266 of file Root.h.
References attr_objtype, Atlas::Objects::BaseObjectData::m_defaults, and setObjtype().
|
inline |
Retrieve the "parent" attribute as a non-const reference.
Definition at line 236 of file Root.h.
References attr_parent, Atlas::Objects::BaseObjectData::m_defaults, and setParent().
|
inline |
Retrieve the "stamp" attribute as a non-const reference.
Definition at line 251 of file Root.h.
References attr_stamp, Atlas::Objects::BaseObjectData::m_defaults, and setStamp().
|
overridevirtual |
Remove the attribute "name". This will not work for static attributes.
Reimplemented from Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 59 of file Root.cpp.
References Atlas::Objects::BaseObjectData::removeAttr().
Referenced by Atlas::Objects::Entity::RootEntityData::removeAttr(), and Atlas::Objects::Operation::RootOperationData::removeAttr().
|
virtualinherited |
Remove the attribute "name".
Definition at line 87 of file BaseObject.cpp.
Referenced by Atlas::Objects::BaseObjectData::removeAttr().
|
overrideprotectedvirtual |
Resets the object as it's returned to the pool.
Implements Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 147 of file Root.cpp.
Referenced by Atlas::Objects::Entity::RootEntityData::reset(), and Atlas::Objects::Operation::RootOperationData::reset().
|
overridevirtual |
Send the contents of this object to a Bridge.
Reimplemented from Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 109 of file Root.cpp.
References Atlas::Objects::BaseObjectData::sendContents(), sendId(), sendName(), sendObjtype(), sendParent(), and sendStamp().
Referenced by Atlas::Objects::Entity::RootEntityData::sendContents(), and Atlas::Objects::Operation::RootOperationData::sendContents().
|
inlineprotected |
Send the "id" attribute to an Atlas::Bridge.
Definition at line 74 of file Root.cpp.
References attr_id.
Referenced by sendContents().
|
inlineprotected |
Send the "name" attribute to an Atlas::Bridge.
Definition at line 102 of file Root.cpp.
References attr_name.
Referenced by sendContents().
|
inlineprotected |
Send the "objtype" attribute to an Atlas::Bridge.
Definition at line 95 of file Root.cpp.
References attr_objtype, getObjtype(), and Atlas::Objects::BaseObjectData::m_defaults.
Referenced by sendContents().
|
inlineprotected |
Send the "parent" attribute to an Atlas::Bridge.
Definition at line 81 of file Root.cpp.
References attr_parent, getParent(), and Atlas::Objects::BaseObjectData::m_defaults.
Referenced by sendContents().
|
inlineprotected |
Send the "stamp" attribute to an Atlas::Bridge.
Definition at line 88 of file Root.cpp.
References attr_stamp.
Referenced by sendContents().
|
overridevirtual |
Set the attribute "name" to the value given by"attr".
Reimplemented from Atlas::Objects::BaseObjectData.
Reimplemented in Atlas::Objects::Operation::RootOperationData, and Atlas::Objects::Entity::RootEntityData.
Definition at line 49 of file Root.cpp.
References Atlas::Message::Element::asFloat(), Atlas::Message::Element::moveString(), Atlas::Objects::BaseObjectData::setAttr(), setId(), setName(), setObjtype(), setParent(), and setStamp().
Referenced by Atlas::Objects::Entity::RootEntityData::setAttr(), and Atlas::Objects::Operation::RootOperationData::setAttr().
|
inline |
Set the "id" attribute.
Definition at line 175 of file Root.h.
References attr_id.
Referenced by modifyId(), and setAttr().
|
inline |
Set the "name" attribute.
Definition at line 207 of file Root.h.
References attr_name.
Referenced by modifyName(), and setAttr().
|
inline |
Set the "objtype" attribute.
Definition at line 199 of file Root.h.
References attr_objtype.
Referenced by modifyObjtype(), and setAttr().
|
inline |
Set the "parent" attribute.
Definition at line 183 of file Root.h.
References attr_parent.
Referenced by modifyParent(), setAttr(), Atlas::Objects::Entity::AnonymousData::setType(), and Atlas::Objects::Operation::GenericData::setType().
|
inline |
Set the "stamp" attribute.
Definition at line 191 of file Root.h.
References attr_stamp.
Referenced by modifyStamp(), and setAttr().
|
protected |
Id of object.
Definition at line 123 of file Root.h.
Referenced by addToMessage(), getId(), modifyId(), sendId(), and setId().
|
protected |
Name of object.
Definition at line 131 of file Root.h.
Referenced by addToMessage(), getName(), modifyName(), sendName(), and setName().
|
protected |
What kind of object this is.
Definition at line 129 of file Root.h.
Referenced by getObjtype(), modifyObjtype(), sendObjtype(), and setObjtype().
|
protected |
The object this inherits attributes from.
Definition at line 125 of file Root.h.
Referenced by getParent(), modifyParent(), sendParent(), and setParent().
|
protected |
Last time this object was modified.
Definition at line 127 of file Root.h.
Referenced by addToMessage(), getStamp(), modifyStamp(), sendStamp(), and setStamp().
|
protectedinherited |
The default instance, acting as a prototype for all other instances.
Definition at line 330 of file BaseObject.h.
Referenced by Atlas::Objects::Operation::RootOperationData::getArgs(), Atlas::Objects::Entity::AccountData::getCharacters(), Atlas::Objects::Entity::RootEntityData::getContains(), Atlas::Objects::Operation::RootOperationData::getFrom(), Atlas::Objects::Operation::RootOperationData::getFutureSeconds(), getId(), Atlas::Objects::Entity::RootEntityData::getLoc(), getName(), getObjtype(), getParent(), Atlas::Objects::Entity::AccountData::getPassword(), Atlas::Objects::Entity::RootEntityData::getPos(), Atlas::Objects::Operation::RootOperationData::getRefno(), Atlas::Objects::Operation::RootOperationData::getSeconds(), Atlas::Objects::Operation::RootOperationData::getSerialno(), getStamp(), Atlas::Objects::Entity::RootEntityData::getStampContains(), Atlas::Objects::Operation::RootOperationData::getTo(), Atlas::Objects::Entity::AccountData::getUsername(), Atlas::Objects::Entity::RootEntityData::getVelocity(), Atlas::Objects::Operation::RootOperationData::modifyArgs(), Atlas::Objects::Entity::AccountData::modifyCharacters(), Atlas::Objects::Entity::RootEntityData::modifyContains(), Atlas::Objects::Operation::RootOperationData::modifyFrom(), Atlas::Objects::Operation::RootOperationData::modifyFutureSeconds(), modifyId(), Atlas::Objects::Entity::RootEntityData::modifyLoc(), modifyName(), modifyObjtype(), modifyParent(), Atlas::Objects::Entity::AccountData::modifyPassword(), Atlas::Objects::Entity::RootEntityData::modifyPos(), Atlas::Objects::Operation::RootOperationData::modifyRefno(), Atlas::Objects::Operation::RootOperationData::modifySeconds(), Atlas::Objects::Operation::RootOperationData::modifySerialno(), modifyStamp(), Atlas::Objects::Entity::RootEntityData::modifyStampContains(), Atlas::Objects::Operation::RootOperationData::modifyTo(), Atlas::Objects::Entity::AccountData::modifyUsername(), Atlas::Objects::Entity::RootEntityData::modifyVelocity(), sendObjtype(), and sendParent().
|
protectedinherited |
The next instance, if this instance has been freed up.
Definition at line 335 of file BaseObject.h.