Atlas 0.7.0
Networking protocol for the Worldforge system.
Atlas::Objects::RootData Class Reference

All objects inherit from this.. More...

#include <Root.h>

Inheritance diagram for Atlas::Objects::RootData:
Collaboration diagram for Atlas::Objects::RootData:

Public Member Functions

RootDatacopy () 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< RootDataallocator
 

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
 
BaseObjectDatam_defaults
 
BaseObjectDatam_next
 
std::map< std::string, Atlas::Message::Elementm_attributes
 
uint32_t m_attrFlags
 

Friends

template<typename >
class ::Atlas::Objects::Allocator
 

Detailed Description

All objects inherit from this..

You can browse all definitions starting from here and descending into children.

Definition at line 36 of file Root.h.

Constructor & Destructor Documentation

◆ RootData()

Atlas::Objects::RootData::RootData ( RootData defaults = nullptr)
inlineexplicitprotected

Construct a RootData class definition.

Definition at line 40 of file Root.h.

◆ ~RootData()

Atlas::Objects::RootData::~RootData ( )
overrideprotecteddefault

Default destructor.

Member Function Documentation

◆ addToMessage()

void Atlas::Objects::RootData::addToMessage ( Atlas::Message::MapType &  ) const
overridevirtual

◆ asMessage()

MapType Atlas::Objects::BaseObjectData::asMessage ( ) const
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().

◆ copy()

RootData * Atlas::Objects::RootData::copy ( ) const
overridevirtual

Copy this object.

Implements Atlas::Objects::BaseObjectData.

Reimplemented in Atlas::Objects::Entity::RootEntityData, and Atlas::Objects::Operation::RootOperationData.

Definition at line 151 of file Root.cpp.

◆ copyAttr()

int Atlas::Objects::RootData::copyAttr ( const std::string &  name,
Atlas::Message::Element attr 
) const
overridevirtual

◆ copyInstance()

template<typename T >
T * Atlas::Objects::BaseObjectData::copyInstance ( const T &  instance)
staticprotectedinherited

Definition at line 356 of file BaseObject.h.

◆ decRef()

void Atlas::Objects::BaseObjectData::decRef ( )
inlineprotectedinherited

Definition at line 345 of file BaseObject.h.

◆ free()

void Atlas::Objects::RootData::free ( )
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::Entity::RootEntityData, and Atlas::Objects::Operation::RootOperationData.

Definition at line 140 of file Root.cpp.

◆ getAttr()

Element Atlas::Objects::BaseObjectData::getAttr ( const std::string &  name) const
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().

◆ getAttrClass()

int Atlas::Objects::RootData::getAttrClass ( const std::string &  name) const
overrideprotectedvirtual

◆ getAttrFlag()

bool Atlas::Objects::RootData::getAttrFlag ( const std::string &  name,
uint32_t &  flag 
) const
overrideprotectedvirtual

◆ getAttrFlags()

uint32_t Atlas::Objects::BaseObjectData::getAttrFlags ( ) const
inlineinherited

Definition at line 265 of file BaseObject.h.

◆ getClassNo()

int Atlas::Objects::BaseObjectData::getClassNo ( ) const
inlineinherited

Get class number:

Definition at line 260 of file BaseObject.h.

◆ getId()

const std::string & Atlas::Objects::RootData::getId ( ) const
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().

◆ getName()

const std::string & Atlas::Objects::RootData::getName ( ) const
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().

◆ getObjtype()

const std::string & Atlas::Objects::RootData::getObjtype ( ) const
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().

◆ getParent()

const std::string & Atlas::Objects::RootData::getParent ( ) const
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().

◆ getStamp()

double Atlas::Objects::RootData::getStamp ( ) const
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().

◆ hasAttr()

bool Atlas::Objects::BaseObjectData::hasAttr ( const std::string &  name) const
inherited

Check whether the attribute "name" exists.

Definition at line 35 of file BaseObject.cpp.

References Atlas::Objects::BaseObjectData::getAttrFlag().

◆ hasAttrFlag()

bool Atlas::Objects::BaseObjectData::hasAttrFlag ( uint32_t  flag) const
inherited

Check whether the attribute "name" exists.

Definition at line 47 of file BaseObject.cpp.

◆ incRef()

void Atlas::Objects::BaseObjectData::incRef ( )
inlineprotectedinherited

Definition at line 341 of file BaseObject.h.

◆ instanceOf()

bool Atlas::Objects::RootData::instanceOf ( int  classNo) const
overridevirtual

◆ isDefaultId()

bool Atlas::Objects::RootData::isDefaultId ( ) const
inline

Is "id" value default?

Definition at line 288 of file Root.h.

◆ isDefaultName()

bool Atlas::Objects::RootData::isDefaultName ( ) const
inline

Is "name" value default?

Definition at line 308 of file Root.h.

◆ isDefaultObjtype()

bool Atlas::Objects::RootData::isDefaultObjtype ( ) const
inline

Is "objtype" value default?

Definition at line 303 of file Root.h.

◆ isDefaultParent()

bool Atlas::Objects::RootData::isDefaultParent ( ) const
inline

Is "parent" value default?

Definition at line 293 of file Root.h.

◆ isDefaultStamp()

bool Atlas::Objects::RootData::isDefaultStamp ( ) const
inline

Is "stamp" value default?

Definition at line 298 of file Root.h.

◆ modifyId()

std::string & Atlas::Objects::RootData::modifyId ( )
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().

◆ modifyName()

std::string & Atlas::Objects::RootData::modifyName ( )
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().

◆ modifyObjtype()

std::string & Atlas::Objects::RootData::modifyObjtype ( )
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().

◆ modifyParent()

std::string & Atlas::Objects::RootData::modifyParent ( )
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().

◆ modifyStamp()

double & Atlas::Objects::RootData::modifyStamp ( )
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().

◆ removeAttr()

void Atlas::Objects::RootData::removeAttr ( const std::string &  name)
overridevirtual

◆ removeAttrFlag()

void Atlas::Objects::BaseObjectData::removeAttrFlag ( uint32_t  flag)
virtualinherited

Remove the attribute "name".

Definition at line 87 of file BaseObject.cpp.

Referenced by Atlas::Objects::BaseObjectData::removeAttr().

◆ reset()

void Atlas::Objects::RootData::reset ( )
overrideprotectedvirtual

◆ sendContents()

void Atlas::Objects::RootData::sendContents ( Atlas::Bridge b) const
overridevirtual

◆ sendId()

void Atlas::Objects::RootData::sendId ( Atlas::Bridge b) const
inlineprotected

Send the "id" attribute to an Atlas::Bridge.

Definition at line 74 of file Root.cpp.

References attr_id.

Referenced by sendContents().

◆ sendName()

void Atlas::Objects::RootData::sendName ( Atlas::Bridge b) const
inlineprotected

Send the "name" attribute to an Atlas::Bridge.

Definition at line 102 of file Root.cpp.

References attr_name.

Referenced by sendContents().

◆ sendObjtype()

void Atlas::Objects::RootData::sendObjtype ( Atlas::Bridge b) const
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().

◆ sendParent()

void Atlas::Objects::RootData::sendParent ( Atlas::Bridge b) const
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().

◆ sendStamp()

void Atlas::Objects::RootData::sendStamp ( Atlas::Bridge b) const
inlineprotected

Send the "stamp" attribute to an Atlas::Bridge.

Definition at line 88 of file Root.cpp.

References attr_stamp.

Referenced by sendContents().

◆ setAttr()

void Atlas::Objects::RootData::setAttr ( std::string  name,
Atlas::Message::Element  attr,
const Atlas::Objects::Factories factories = nullptr 
)
overridevirtual

◆ setId()

void Atlas::Objects::RootData::setId ( std::string  val)
inline

Set the "id" attribute.

Definition at line 175 of file Root.h.

References attr_id.

Referenced by modifyId(), and setAttr().

◆ setName()

void Atlas::Objects::RootData::setName ( std::string  val)
inline

Set the "name" attribute.

Definition at line 207 of file Root.h.

References attr_name.

Referenced by modifyName(), and setAttr().

◆ setObjtype()

void Atlas::Objects::RootData::setObjtype ( std::string  val)
inline

Set the "objtype" attribute.

Definition at line 199 of file Root.h.

References attr_objtype.

Referenced by modifyObjtype(), and setAttr().

◆ setParent()

void Atlas::Objects::RootData::setParent ( std::string  val)
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().

◆ setStamp()

void Atlas::Objects::RootData::setStamp ( double  val)
inline

Set the "stamp" attribute.

Definition at line 191 of file Root.h.

References attr_stamp.

Referenced by modifyStamp(), and setAttr().

Friends And Related Function Documentation

◆ ::Atlas::Objects::Allocator

template<typename >
friend class ::Atlas::Objects::Allocator
friend

Definition at line 146 of file Root.h.

Member Data Documentation

◆ allocator

Allocator< RootData > Atlas::Objects::RootData::allocator
static

Definition at line 147 of file Root.h.

◆ attr_id

std::string Atlas::Objects::RootData::attr_id
protected

Id of object.

Definition at line 123 of file Root.h.

Referenced by addToMessage(), getId(), modifyId(), sendId(), and setId().

◆ attr_name

std::string Atlas::Objects::RootData::attr_name
protected

Name of object.

Definition at line 131 of file Root.h.

Referenced by addToMessage(), getName(), modifyName(), sendName(), and setName().

◆ attr_objtype

std::string Atlas::Objects::RootData::attr_objtype
protected

What kind of object this is.

Definition at line 129 of file Root.h.

Referenced by getObjtype(), modifyObjtype(), sendObjtype(), and setObjtype().

◆ attr_parent

std::string Atlas::Objects::RootData::attr_parent
protected

The object this inherits attributes from.

Definition at line 125 of file Root.h.

Referenced by getParent(), modifyParent(), sendParent(), and setParent().

◆ attr_stamp

double Atlas::Objects::RootData::attr_stamp
protected

Last time this object was modified.

Definition at line 127 of file Root.h.

Referenced by addToMessage(), getStamp(), modifyStamp(), sendStamp(), and setStamp().

◆ default_objtype

constexpr const char* Atlas::Objects::RootData::default_objtype = "obj"
staticconstexpr

Definition at line 52 of file Root.h.

◆ default_parent

constexpr const char* Atlas::Objects::RootData::default_parent = "root"
staticconstexpr

Definition at line 50 of file Root.h.

◆ m_attrFlags

uint32_t Atlas::Objects::BaseObjectData::m_attrFlags
protectedinherited

Definition at line 338 of file BaseObject.h.

◆ m_attributes

std::map<std::string, Atlas::Message::Element> Atlas::Objects::BaseObjectData::m_attributes
protectedinherited

Definition at line 336 of file BaseObject.h.

◆ m_class_no

int Atlas::Objects::BaseObjectData::m_class_no
protectedinherited

Definition at line 324 of file BaseObject.h.

◆ m_defaults

BaseObjectData* Atlas::Objects::BaseObjectData::m_defaults
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().

◆ m_next

BaseObjectData* Atlas::Objects::BaseObjectData::m_next
protectedinherited

The next instance, if this instance has been freed up.

Definition at line 335 of file BaseObject.h.

◆ m_refCount

int Atlas::Objects::BaseObjectData::m_refCount
protectedinherited

Definition at line 325 of file BaseObject.h.


The documentation for this class was generated from the following files: