Atlas-C++
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Atlas::Objects::Entity::RootEntityData Class Reference

Starting point for entity hierarchy. More...

#include <RootEntity.h>

Inheritance diagram for Atlas::Objects::Entity::RootEntityData:
Atlas::Objects::RootData Atlas::Objects::BaseObjectData Atlas::Objects::Entity::AdminEntityData Atlas::Objects::Entity::AnonymousData Atlas::Objects::Entity::GameEntityData Atlas::Objects::Entity::AccountData Atlas::Objects::Entity::GameData Atlas::Objects::Entity::AdminData Atlas::Objects::Entity::PlayerData

List of all members.

Public Member Functions

virtual RootEntityDatacopy () const
 Copy this object.
virtual bool instanceOf (int classNo) const
 Is this instance of some class?
virtual int copyAttr (const std::string &name, Atlas::Message::Element &attr) const
 Retrieve the attribute "name".
virtual void setAttr (const std::string &name, const Atlas::Message::Element &attr)
 Set the attribute "name" to the value given by"attr".
virtual void removeAttr (const std::string &name)
 Remove the attribute "name". This will not work for static attributes.
virtual void sendContents (Atlas::Bridge &b) const
 Send the contents of this object to a Bridge.
virtual void addToMessage (Atlas::Message::MapType &) const
 Write this object to an existing Element.
void setLoc (const std::string &val)
 Set the "loc" attribute.
void setPos (const std::vector< double > &val)
 Set the "pos" attribute.
void setPosAsList (const Atlas::Message::ListType &val)
 Set the "pos" attribute AsList.
void setVelocity (const std::vector< double > &val)
 Set the "velocity" attribute.
void setVelocityAsList (const Atlas::Message::ListType &val)
 Set the "velocity" attribute AsList.
void setContains (const std::list< std::string > &val)
 Set the "contains" attribute.
void setContainsAsList (const Atlas::Message::ListType &val)
 Set the "contains" attribute AsList.
void setStampContains (double val)
 Set the "stamp_contains" attribute.
const std::string & getLoc () const
 Retrieve the "loc" attribute.
std::string & modifyLoc ()
 Retrieve the "loc" attribute as a non-const reference.
const std::vector< double > & getPos () const
 Retrieve the "pos" attribute.
std::vector< double > & modifyPos ()
 Retrieve the "pos" attribute as a non-const reference.
const Atlas::Message::ListType getPosAsList () const
 Retrieve the "pos" attribute AsList.
const std::vector< double > & getVelocity () const
 Retrieve the "velocity" attribute.
std::vector< double > & modifyVelocity ()
 Retrieve the "velocity" attribute as a non-const reference.
const Atlas::Message::ListType getVelocityAsList () const
 Retrieve the "velocity" attribute AsList.
const std::list< std::string > & getContains () const
 Retrieve the "contains" attribute.
std::list< std::string > & modifyContains ()
 Retrieve the "contains" attribute as a non-const reference.
const Atlas::Message::ListType getContainsAsList () const
 Retrieve the "contains" attribute AsList.
double getStampContains () const
 Retrieve the "stamp_contains" attribute.
double & modifyStampContains ()
 Retrieve the "stamp_contains" attribute as a non-const reference.
bool isDefaultLoc () const
 Is "loc" value default?
bool isDefaultPos () const
 Is "pos" value default?
bool isDefaultVelocity () const
 Is "velocity" value default?
bool isDefaultContains () const
 Is "contains" value default?
bool isDefaultStampContains () const
 Is "stamp_contains" value default?
virtual void free ()
 Free an instance of this class, returning it to the memory pool.
virtual RootEntityDatagetDefaultObject ()
 Get the reference object that contains the default values for attributes of instances of the same class as this object.

Static Public Member Functions

static RootEntityDataalloc ()
 Allocate a new instance of this class, using an existing instance if available.
static RootEntityDatagetDefaultObjectInstance ()
 Get the reference object that contains the default values for attributes of instances of this class.

Protected Member Functions

 RootEntityData (RootEntityData *defaults=NULL)
 Construct a RootEntityData class definition.
virtual ~RootEntityData ()
 Default destructor.
virtual int getAttrClass (const std::string &name) const
 Find the class which contains the attribute "name".
virtual int getAttrFlag (const std::string &name) const
 Find the flag for the attribute "name".
void sendLoc (Atlas::Bridge &) const
 Send the "loc" attribute to an Atlas::Bridge.
void sendPos (Atlas::Bridge &) const
 Send the "pos" attribute to an Atlas::Bridge.
void sendVelocity (Atlas::Bridge &) const
 Send the "velocity" attribute to an Atlas::Bridge.
void sendContains (Atlas::Bridge &) const
 Send the "contains" attribute to an Atlas::Bridge.
void sendStampContains (Atlas::Bridge &) const
 Send the "stamp_contains" attribute to an Atlas::Bridge.
virtual void iterate (int &current_class, std::string &attr) const
 Iterate over the attributes of this instance.

Protected Attributes

std::string attr_loc
 Reference object for coordinates (location).
std::vector< double > attr_pos
 Position coordinates, usually world is 3D.
std::vector< double > attr_velocity
 Velocity object is moving, usually world is 3D.
std::list< std::string > attr_contains
 List of objects that use this object as reference system (usually same as what this object contains).
double attr_stamp_contains
 Last time any object that uses this as reference recursively has been modified.

Detailed Description

Starting point for entity hierarchy.

Later in hierarchy tree objtype changes to 'object' when actual game objects are made.


Member Function Documentation

Allocate a new instance of this class, using an existing instance if available.

This is the key function for implementing the memory pool for the Atlas::Objects API.

Reimplemented from Atlas::Objects::RootData.

Reimplemented in Atlas::Objects::Entity::GameEntityData, Atlas::Objects::Entity::GameData, Atlas::Objects::Entity::AdminData, Atlas::Objects::Entity::PlayerData, Atlas::Objects::Entity::AccountData, Atlas::Objects::Entity::AnonymousData, and Atlas::Objects::Entity::AdminEntityData.

virtual int Atlas::Objects::Entity::RootEntityData::copyAttr ( const std::string &  name,
Atlas::Message::Element attr 
) const [virtual]

Retrieve the attribute "name".

Return non-zero if it does not exist.

Reimplemented from Atlas::Objects::RootData.

Reimplemented in Atlas::Objects::Entity::AccountData.

Get the reference object that contains the default values for attributes of instances of the same class as this object.

Returns:
a pointer to the default object.

Reimplemented from Atlas::Objects::RootData.

Reimplemented in Atlas::Objects::Entity::GameEntityData, Atlas::Objects::Entity::GameData, Atlas::Objects::Entity::AdminData, Atlas::Objects::Entity::PlayerData, Atlas::Objects::Entity::AccountData, Atlas::Objects::Entity::AnonymousData, and Atlas::Objects::Entity::AdminEntityData.

Get the reference object that contains the default values for attributes of instances of this class.

Returns:
a pointer to the default object.

Reimplemented from Atlas::Objects::RootData.

Reimplemented in Atlas::Objects::Entity::GameEntityData, Atlas::Objects::Entity::GameData, Atlas::Objects::Entity::AdminData, Atlas::Objects::Entity::PlayerData, Atlas::Objects::Entity::AccountData, Atlas::Objects::Entity::AnonymousData, and Atlas::Objects::Entity::AdminEntityData.


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

Copyright 2000-2004 the respective authors.

This document can be licensed under the terms of the GNU Free Documentation License or the GNU General Public License and may be freely distributed under the terms given by one of these licenses.