#include <librarymanager.h>
Public Types | ||||
| typedef std::map < dtCore::RefPtr< const ActorType >, ActorPluginRegistry *, ActorType::RefPtrComp > | ActorTypeMap | |||
| typedef ActorTypeMap::iterator | ActorTypeMapItor | |||
| typedef std::map< std::string, RegistryEntry > | RegistryMap | |||
| typedef RegistryMap::iterator | RegistryMapItor | |||
Public Member Functions | ||||
| void | LoadActorRegistry (const std::string &libName) | |||
| Loads an actor registry by loading a dynamic library containing the actor registry implementation. | ||||
| bool | AddRegistryEntry (const std::string &libName, const RegistryEntry &entry) | |||
| Inserts the pair of parameters into the container. | ||||
| void | UnloadActorRegistry (const std::string &libName) | |||
| Unloads an actor registry. | ||||
| void | GetActorTypes (std::vector< const ActorType * > &actorTypes) | |||
| Returns a list of all the actor types the library manager knows how to create. | ||||
| const ActorType * | FindActorType (const std::string &category, const std::string &name) | |||
| Gets a single actor type that matches the name and category specified. | ||||
| dtCore::RefPtr< ActorProxy > | CreateActorProxy (const ActorType &actorType) | |||
| Creates a new actor proxy. | ||||
| dtCore::RefPtr< ActorProxy > | CreateActorProxy (const std::string &category, const std::string &name) | |||
| Creates a new actor proxy. | ||||
| ActorPluginRegistry * | GetRegistry (const std::string &name) | |||
| Gets a registry currently loaded by the library manager. | ||||
| ActorPluginRegistry * | GetRegistryForType (const ActorType &actorType) | |||
| ||||
| std::string | GetPlatformSpecificLibraryName (const std::string &libBase) | |||
| Determines which platform we are running on and returns a platform dependent library name. | ||||
| std::string | GetPlatformIndependentLibraryName (const std::string &libName) | |||
| Strips off the path and platform specific library prefixs and extensions and returns a system independent file name. | ||||
Static Public Member Functions | ||||
| static LibraryManager & | GetInstance () | |||
| Gets the singleton instance of the LibraryManager. | ||||
Classes | ||||
| struct | RegistryEntry | |||
| Simple structure for grouping the data corresponding to a registry entry. More... | ||||
It has a list of the dynamic libraries that are registered with the Manager as well as a list of the ActorTypes that each library can create. It is also the main vehicle for creating a new ActorProxy.
| typedef std::map<dtCore::RefPtr<const ActorType>, ActorPluginRegistry*, ActorType::RefPtrComp> dtDAL::LibraryManager::ActorTypeMap |
| typedef ActorTypeMap::iterator dtDAL::LibraryManager::ActorTypeMapItor |
| typedef std::map<std::string, RegistryEntry> dtDAL::LibraryManager::RegistryMap |
| typedef RegistryMap::iterator dtDAL::LibraryManager::RegistryMapItor |
| LibraryManager & dtDAL::LibraryManager::GetInstance | ( | void | ) | [static] |
Gets the singleton instance of the LibraryManager.
| void dtDAL::LibraryManager::LoadActorRegistry | ( | const std::string & | libName | ) |
Loads an actor registry by loading a dynamic library containing the actor registry implementation.
| libName | The system independent name of the library to load. |
| ProjectResourceError | Throws an exception if the library cannot be found or the create and destroy functions are not found in the library. |
| bool dtDAL::LibraryManager::AddRegistryEntry | ( | const std::string & | libName, | |
| const RegistryEntry & | entry | |||
| ) |
Inserts the pair of parameters into the container.
Also, registers the supported Actor types with the manager.
| libName | The system independent name of the library that was loaded | |
| entry | The RegistryEntry mapped to the library name. |
| void dtDAL::LibraryManager::UnloadActorRegistry | ( | const std::string & | libName | ) |
Unloads an actor registry.
This unloads the dynamic library containing the actor registry implementation and also removes all the actor types that the registry supported.
| libName | The system independent name of the library to load. |
| void dtDAL::LibraryManager::GetActorTypes | ( | std::vector< const ActorType * > & | actorTypes | ) |
Returns a list of all the actor types the library manager knows how to create.
| const ActorType * dtDAL::LibraryManager::FindActorType | ( | const std::string & | category, | |
| const std::string & | name | |||
| ) |
Gets a single actor type that matches the name and category specified.
| category | Category of the actor type to find. | |
| name | Name of the actor type. |
| dtCore::RefPtr< ActorProxy > dtDAL::LibraryManager::CreateActorProxy | ( | const ActorType & | actorType | ) |
Creates a new actor proxy.
The actor type is used by the library manager to determine which type of actor proxy to create.
| Throws | a ObjectFactoryUnknownType exception if the type is unknown. |
| dtCore::RefPtr< ActorProxy > dtDAL::LibraryManager::CreateActorProxy | ( | const std::string & | category, | |
| const std::string & | name | |||
| ) |
Creates a new actor proxy.
The actor type is used by the library manager to determine which type of actor proxy to create.
| Throws | a ObjectFactoryUnknownType exception if the type |
| category | The category corresponding to the actor type | |
| name | The name corresponding to the actor type is unknown. |
| ActorPluginRegistry * dtDAL::LibraryManager::GetRegistry | ( | const std::string & | name | ) |
Gets a registry currently loaded by the library manager.
| name | The name of the library. Note, this name is the system independent name. |
| ActorPluginRegistry * dtDAL::LibraryManager::GetRegistryForType | ( | const ActorType & | actorType | ) |
| actorType | the actor type to get the registry for. |
| std::string dtDAL::LibraryManager::GetPlatformSpecificLibraryName | ( | const std::string & | libBase | ) |
Determines which platform we are running on and returns a platform dependent library name.
| libBase | Platform independent library name. |
| std::string dtDAL::LibraryManager::GetPlatformIndependentLibraryName | ( | const std::string & | libName | ) |
Strips off the path and platform specific library prefixs and extensions and returns a system independent file name.
| libName | The platform specific library name. |