dtDAL::ActorPluginRegistry Class Reference

The ActorPluginRegistry is the base class that developers extend to build their own registries. More...

#include <actorpluginregistry.h>

Inheritance diagram for dtDAL::ActorPluginRegistry:

dtActors::EngineActorRegistry

List of all members.

Public Member Functions

 ActorPluginRegistry (const std::string &name, const std::string &desc="")
 Constructs the registry.
virtual ~ActorPluginRegistry ()
 Empty destructor.
virtual void RegisterActorTypes ()=0
 Registers the actor types that this registry knows how to create.
void SetName (const std::string &name)
 Sets the name of this registry.
const std::string & GetName () const
 Gets the name currently assigned to this registry.
void SetDescription (const std::string &desc)
 Sets the description for this registry.
const std::string & GetDescription () const
 Gets the description of this registry.
void GetSupportedActorTypes (std::vector< dtCore::RefPtr< const ActorType > > &actors)
 Gets a list of actor types that this registry supports.
bool IsActorTypeSupported (dtCore::RefPtr< const ActorType > type)
 Checks to see if this registry supports the given actor type.
dtCore::RefPtr< ActorProxyCreateActorProxy (const ActorType &type)
 Creates a new actor proxy based on the ActorType given.

Protected Attributes

std::string mName
std::string mDescription
dtCore::RefPtr
< dtUtil::ObjectFactory
< dtCore::RefPtr< const
ActorType >, ActorProxy,
ActorType::RefPtrComp > > 
mActorFactory
 Factory object which stores the actor types and knows how to create proxy objects for each type.


Detailed Description

The ActorPluginRegistry is the base class that developers extend to build their own registries.

Its main purpose is to serve as an object factory which knows how to build ActorProxies using ActorTypes as the tool by which to do so.

Note:
Registry objects should only be used with the dtCore::RefPtr<> construct since they are reference counted objects.
See also:
ActorType

ActorProxy


Constructor & Destructor Documentation

dtDAL::ActorPluginRegistry::ActorPluginRegistry ( const std::string &  name,
const std::string &  desc = "" 
) [inline]

Constructs the registry.

Sets the name and description for this registry.

virtual dtDAL::ActorPluginRegistry::~ActorPluginRegistry (  )  [inline, virtual]

Empty destructor.

This class is not reference counted since we need to manually free pointers to the registry objects from their corresponding dynamic library, therefore, we need access to the object's destructor.


Member Function Documentation

virtual void dtDAL::ActorPluginRegistry::RegisterActorTypes (  )  [pure virtual]

Registers the actor types that this registry knows how to create.

This method is the first method to get called by the LibraryManager after it loads a dynamic library and gets a pointer to the registry object it contains.

Implemented in dtActors::EngineActorRegistry.

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

Sets the name of this registry.

Parameters:
name Name to assign to the registry.

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

Gets the name currently assigned to this registry.

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

Sets the description for this registry.

Parameters:
desc Couple sentence description for this actor registry.

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

Gets the description of this registry.

void dtDAL::ActorPluginRegistry::GetSupportedActorTypes ( std::vector< dtCore::RefPtr< const ActorType > > &  actors  ) 

Gets a list of actor types that this registry supports.

bool dtDAL::ActorPluginRegistry::IsActorTypeSupported ( dtCore::RefPtr< const ActorType type  ) 

Checks to see if this registry supports the given actor type.

Parameters:
type The type to check support for.
Returns:
True if supported, false otherwise.

dtCore::RefPtr< ActorProxy > dtDAL::ActorPluginRegistry::CreateActorProxy ( const ActorType type  ) 

Creates a new actor proxy based on the ActorType given.

Parameters:
type Type of actor to create.
Returns:
Returns a smart pointer to the newly created proxy object.
Exceptions:
ExceptionEnum::ObjectFactoryUnknownType 


Member Data Documentation

std::string dtDAL::ActorPluginRegistry::mName [protected]

std::string dtDAL::ActorPluginRegistry::mDescription [protected]

dtCore::RefPtr<dtUtil::ObjectFactory<dtCore::RefPtr<const ActorType>, ActorProxy,ActorType::RefPtrComp> > dtDAL::ActorPluginRegistry::mActorFactory [protected]

Factory object which stores the actor types and knows how to create proxy objects for each type.

See also:
ObjectFactory


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