Atlas-C++
|
Base class for accounts. More...
#include <Entity.h>
Public Member Functions | |
virtual AccountData * | copy () 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 | setUsername (const std::string &val) |
Set the "username" attribute. | |
void | setPassword (const std::string &val) |
Set the "password" attribute. | |
void | setCharacters (const std::list< std::string > &val) |
Set the "characters" attribute. | |
void | setCharactersAsList (const Atlas::Message::ListType &val) |
Set the "characters" attribute AsList. | |
const std::string & | getUsername () const |
Retrieve the "username" attribute. | |
std::string & | modifyUsername () |
Retrieve the "username" attribute as a non-const reference. | |
const std::string & | getPassword () const |
Retrieve the "password" attribute. | |
std::string & | modifyPassword () |
Retrieve the "password" attribute as a non-const reference. | |
const std::list< std::string > & | getCharacters () const |
Retrieve the "characters" attribute. | |
std::list< std::string > & | modifyCharacters () |
Retrieve the "characters" attribute as a non-const reference. | |
const Atlas::Message::ListType | getCharactersAsList () const |
Retrieve the "characters" attribute AsList. | |
bool | isDefaultUsername () const |
Is "username" value default? | |
bool | isDefaultPassword () const |
Is "password" value default? | |
bool | isDefaultCharacters () const |
Is "characters" value default? | |
virtual void | free () |
Free an instance of this class, returning it to the memory pool. | |
virtual AccountData * | getDefaultObject () |
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 AccountData * | alloc () |
Allocate a new instance of this class, using an existing instance if available. | |
static AccountData * | getDefaultObjectInstance () |
Get the reference object that contains the default values for attributes of instances of this class. | |
Protected Member Functions | |
AccountData (AccountData *defaults=NULL) | |
Construct a AccountData class definition. | |
virtual | ~AccountData () |
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 | sendUsername (Atlas::Bridge &) const |
Send the "username" attribute to an Atlas::Bridge. | |
void | sendPassword (Atlas::Bridge &) const |
Send the "password" attribute to an Atlas::Bridge. | |
void | sendCharacters (Atlas::Bridge &) const |
Send the "characters" attribute to an Atlas::Bridge. | |
virtual void | iterate (int ¤t_class, std::string &attr) const |
Iterate over the attributes of this instance. | |
Protected Attributes | |
std::string | attr_username |
Username for account usually. | |
std::string | attr_password |
Password for account usually. | |
std::list< std::string > | attr_characters |
List of characters account can control. |
Base class for accounts.
Later in hierarchy tree objtype changes to 'object' when actual game objects are made.
static AccountData* Atlas::Objects::Entity::AccountData::alloc | ( | ) | [static] |
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::Entity::AdminEntityData.
Reimplemented in Atlas::Objects::Entity::AdminData, and Atlas::Objects::Entity::PlayerData.
virtual int Atlas::Objects::Entity::AccountData::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::Entity::RootEntityData.
virtual void Atlas::Objects::Entity::AccountData::free | ( | ) | [virtual] |
Free an instance of this class, returning it to the memory pool.
This function in combination with alloc() handle the memory pool.
Reimplemented from Atlas::Objects::Entity::AdminEntityData.
Reimplemented in Atlas::Objects::Entity::AdminData, and Atlas::Objects::Entity::PlayerData.
virtual AccountData* Atlas::Objects::Entity::AccountData::getDefaultObject | ( | ) | [virtual] |
Get the reference object that contains the default values for attributes of instances of the same class as this object.
Reimplemented from Atlas::Objects::Entity::AdminEntityData.
Reimplemented in Atlas::Objects::Entity::AdminData, and Atlas::Objects::Entity::PlayerData.
static AccountData* Atlas::Objects::Entity::AccountData::getDefaultObjectInstance | ( | ) | [static] |
Get the reference object that contains the default values for attributes of instances of this class.
Reimplemented from Atlas::Objects::Entity::AdminEntityData.
Reimplemented in Atlas::Objects::Entity::AdminData, and Atlas::Objects::Entity::PlayerData.
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.