Orxonox: orxonox::Template Class Reference

# orxonox::Template Class Reference

`#include <src/core/Template.h>`

Inheritance diagram for orxonox::Template:

List of all members.

## Public Member Functions

void | applyOn (BaseObject *object)
virtual void | changedName ()
| This function gets called if the name of the object changes.
const std::string & | getBaseclass () const
Identifier * | getBaseclassIdentifier () const
const std::string & | getLink () const
bool | getLoadDefaults () const
const TiXmlElement & | getXMLElement () const
void | setBaseclass (const std::string &baseclass)
void | setLink (const std::string &link)
void | setLoadDefaults (bool bLoadDefaults)
void | setXMLElement (const TiXmlElement &xmlelement)
| Template (BaseObject *creator)
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XML loading and saving.
virtual | ~Template ()

## Static Public Member Functions

static void | apply (const std::string &name, BaseObject *object)
static Template * | getTemplate (const std::string &name)
static std::map< std::string, Template * > & | getTemplateMap ()

## Private Attributes

std::string | baseclass_
Identifier * | baseclassIdentifier_
bool | bIsLink_
bool | bIsReturningXMLElement_
bool | bLoadDefaults_
std::string | link_
TiXmlElement * | xmlelement_

## Constructor & Destructor Documentation

orxonox::Template::Template | ( | BaseObject * | creator | ) |

References baseclassIdentifier_, bIsLink_, bIsReturningXMLElement_, bLoadDefaults_, RegisterObject, and xmlelement_.

orxonox::Template::~Template | ( |  | ) | `[virtual]`

References orxonox::BaseObject::getName(), getTemplateMap(), and xmlelement_.

## Member Function Documentation

void orxonox::Template::apply | ( | const std::string & | name,
|  | BaseObject * | object |
| ) |  |  | `[static]`

References getTemplateMap().

void orxonox::Template::applyOn | ( | BaseObject * | object | ) |

References baseclassIdentifier_, bLoadDefaults_, COUT, orxonox::XMLPort::ExpandObject, orxonox::Identifier::getName(), orxonox::BaseObject::getName(), getXMLElement(), orxonox::OrxonoxClass::isA(), and orxonox::XMLPort::LoadObject.

Referenced by orxonox::BaseObject::addTemplate().

void orxonox::Template::changedName | ( |  | ) | `[virtual]`

This function gets called if the name of the object changes.

Reimplemented from orxonox::BaseObject.

References COUT, orxonox::BaseObject::getName(), orxonox::BaseObject::getOldName(), getTemplateMap(), and SUPER.

const std::string& orxonox::Template::getBaseclass | ( |  | ) | const`[inline]`

Referenced by XMLPort().

Identifier* orxonox::Template::getBaseclassIdentifier | ( |  | ) | const`[inline]`

Referenced by orxonox::SpaceShip::loadEngineTemplate(), orxonox::PickupSpawner::trigger(), and orxonox::PickupSpawner::XMLPort().

const std::string& orxonox::Template::getLink | ( |  | ) | const`[inline]`

Referenced by XMLPort().

bool orxonox::Template::getLoadDefaults | ( |  | ) | const`[inline]`

Referenced by XMLPort().

Template * orxonox::Template::getTemplate | ( | const std::string & | name | ) | `[static]`

References COUT, and getTemplateMap().

Referenced by orxonox::BaseObject::addTemplate(), getXMLElement(), orxonox::SpaceShip::loadEngineTemplate(), orxonox::PickupSpawner::setItemTemplateName(), and orxonox::SpawnPoint::setTemplateName().

std::map< std::string, Template * > & orxonox::Template::getTemplateMap | ( |  | ) | `[static]`

Referenced by apply(), changedName(), getTemplate(), and ~Template().

const TiXmlElement & orxonox::Template::getXMLElement | ( |  | ) | const

References bIsLink_, bIsReturningXMLElement_, COUT, orxonox::BaseObject::getName(), getTemplate(), getXMLElement(), link_, and xmlelement_.

Referenced by applyOn(), and getXMLElement().

void orxonox::Template::setBaseclass | ( | const std::string & | baseclass | ) |

References baseclass_, baseclassIdentifier_, and ClassByString.

Referenced by XMLPort().

void orxonox::Template::setLink | ( | const std::string & | link | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Template::setLoadDefaults | ( | bool | bLoadDefaults | ) | `[inline]`

Referenced by XMLPort().

void orxonox::Template::setXMLElement | ( | const TiXmlElement & | xmlelement | ) |

References xmlelement_.

Referenced by XMLPort().

void orxonox::Template::XMLPort | ( | Element & | xmlelement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

XML loading and saving.

Parameters:

  | xmlelement | The XML-element
  | loading | Loading (true) or saving (false)

Returns:
  The XML-element

Reimplemented from orxonox::BaseObject.

References getBaseclass(), getLink(), getLoadDefaults(), setBaseclass(), setLink(), setLoadDefaults(), setXMLElement(), SUPER, and XMLPortParam.

## Member Data Documentation

std::string orxonox::Template::baseclass_`[private]`

Referenced by setBaseclass().

Identifier* orxonox::Template::baseclassIdentifier_`[private]`

Referenced by applyOn(), setBaseclass(), and Template().

bool orxonox::Template::bIsLink_`[private]`

Referenced by getXMLElement(), and Template().

bool orxonox::Template::bIsReturningXMLElement_`[mutable, private]`

Referenced by getXMLElement(), and Template().

bool orxonox::Template::bLoadDefaults_`[private]`

Referenced by applyOn(), and Template().

std::string orxonox::Template::link_`[private]`

Referenced by getXMLElement().

TiXmlElement* orxonox::Template::xmlelement_`[private]`

Referenced by getXMLElement(), setXMLElement(), Template(), and ~Template().

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

- src/core/Template.h
- src/core/Template.cc