dtDAL::ActorType Class Reference

This class is more or less a simple data class that has information describing a particular type of Actor. More...

#include <actortype.h>

List of all members.

Public Member Functions

 ActorType (const std::string &name, const std::string &category="nocategory", const std::string &desc="", const ActorType *parentType=NULL)
 Constructs a new actor type object.
void SetName (const std::string &name)
 Sets the name for this actor type.
const std::string & GetName () const
 Gets the name currently assigned to this actor type.
void SetCategory (const std::string &category)
 Sets the category for this actor type.
const std::string & GetCategory () const
 Gets the category given to this actor type.
void SetDescription (const std::string &desc)
 Sets the description for this actor type.
const std::string & GetDescription () const
 Gets the description given to this actor type.
const std::string & GetUniqueId () const
 Gets the uniqueId string which was generated for this actor type.
const ActorTypeGetParentActorType () const
 Gets the parent or "super" type of this actor type.
bool InstanceOf (const ActorType &rhs) const
 Based on this actor types super type hierarchy, this method determines whether or not this type is a descendent or equal to the specified actor type.
bool InstanceOf (const std::string &category, const std::string &name) const
 Helper method which is the same as the other InstanceOf method, only this one wraps the creation of the actor type.
bool operator< (const ActorType &rhs) const
 Less-than comparison of the actor type's uniqueId strings.
bool operator== (const ActorType &rhs) const
 Equality test of the actor type's uniqueId strings.
bool operator!= (const ActorType &rhs) const
 Inequality test of the actor type's uniqueId strings.
const std::string ToString () const
 returns a string representation of the actor type

Protected Member Functions

virtual ~ActorType ()
void GenerateUniqueId ()
 Creates a unique id for this ActorType.

Friends

std::ostream & operator<< (std::ostream &os, const ActorType &actorType)
 Provide a method for printing the actor type to a stream.

Classes

struct  RefPtrComp
 Simple less than comparison function for the ObjectFactory. More...


Detailed Description

This class is more or less a simple data class that has information describing a particular type of Actor.

Actor types contain a name category and description.

Note:
ActorType objects must be unique, thereby implying no two actor types will have the same name and category.

Categories of an actor type are represented in a hierarchial dot notation. For example, vehicles.trucks.BouncyTruck

ActorType objects have a notion of a type hierarchy. Therefore, when creating a new actor type, its parent type must be specified. This allows queries to be made against the actor type to dermine if it is an "instance" of another type.


Constructor & Destructor Documentation

dtDAL::ActorType::ActorType ( const std::string &  name,
const std::string &  category = "nocategory",
const std::string &  desc = "",
const ActorType parentType = NULL 
) [inline]

Constructs a new actor type object.

virtual dtDAL::ActorType::~ActorType (  )  [inline, protected, virtual]


Member Function Documentation

void dtDAL::ActorType::SetName ( const std::string &  name  )  [inline]

Sets the name for this actor type.

const std::string& dtDAL::ActorType::GetName (  )  const [inline]

Gets the name currently assigned to this actor type.

void dtDAL::ActorType::SetCategory ( const std::string &  category  )  [inline]

Sets the category for this actor type.

const std::string& dtDAL::ActorType::GetCategory (  )  const [inline]

Gets the category given to this actor type.

void dtDAL::ActorType::SetDescription ( const std::string &  desc  )  [inline]

Sets the description for this actor type.

const std::string& dtDAL::ActorType::GetDescription (  )  const [inline]

Gets the description given to this actor type.

const std::string& dtDAL::ActorType::GetUniqueId (  )  const [inline]

Gets the uniqueId string which was generated for this actor type.

const ActorType* dtDAL::ActorType::GetParentActorType (  )  const [inline]

Gets the parent or "super" type of this actor type.

bool dtDAL::ActorType::InstanceOf ( const ActorType rhs  )  const

Based on this actor types super type hierarchy, this method determines whether or not this type is a descendent or equal to the specified actor type.

Returns:
True if a descendent or equal, false otherwise.

bool dtDAL::ActorType::InstanceOf ( const std::string &  category,
const std::string &  name 
) const

Helper method which is the same as the other InstanceOf method, only this one wraps the creation of the actor type.

Parameters:
category The category of the actor type in question.
name The name of the actor type in question.
Returns:
True if a descendent or equal, false otherwise.
See also:
InstanceOf(const ActorType &rhs)

bool dtDAL::ActorType::operator< ( const ActorType rhs  )  const [inline]

Less-than comparison of the actor type's uniqueId strings.

bool dtDAL::ActorType::operator== ( const ActorType rhs  )  const [inline]

Equality test of the actor type's uniqueId strings.

bool dtDAL::ActorType::operator!= ( const ActorType rhs  )  const [inline]

Inequality test of the actor type's uniqueId strings.

const std::string dtDAL::ActorType::ToString (  )  const

returns a string representation of the actor type

void dtDAL::ActorType::GenerateUniqueId (  )  [protected]

Creates a unique id for this ActorType.

Currently, the implementation merely concatenates the name and category. Probably should hash this and store a hash id instead.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ActorType actorType 
) [friend]

Provide a method for printing the actor type to a stream.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008