YAPOG  0.0.1
Yet Another Pokemon Online Game
yap::ObjectFactory Class Reference

#include <ObjectFactory.hpp>

Collaboration diagram for yap::ObjectFactory:

List of all members.

Public Member Functions

template<typename T >
T * Get (const String &typeName, const ID &id)
template<typename T >
T * Create (const String &typeName, const ID &id)
template<typename T >
T * Create (const ID &typeID, const ID &id)
template<typename T >
T * Create (const String &typeName, IReader &reader, const String &rootNodeName)
 Creates an object from a partial input file. Does not store it.
void RegisterLoader (const String &typeName, IObjectIDLoader *loader)
void RegisterLoader (const String &typeName, IObjectLoader *loader)
void AddType (const ID &id, const String &type)
const StringGetType (const ID &id) const
const IDGetID (const String &type) const
const collection::Map< ID,
String > & 
GetTypes () const

Static Public Member Functions

static ObjectFactoryInstance ()

Private Member Functions

 DISALLOW_COPY (ObjectFactory)
 ObjectFactory ()
 ~ObjectFactory ()
bool ContainsLoader (const String &typeName) const

Private Attributes

collection::Map< String,
IObjectIDLoader * > 
objectIDLoaders_
collection::Map< String,
IObjectLoader * > 
objectLoaders_
collection::Map< ID, Stringtypes_
collection::Map< String, IDids_

Static Private Attributes

static const UInt64 INITIAL_ID = 0
static UInt64 currentID_ = INITIAL_ID

Detailed Description

Definition at line 15 of file ObjectFactory.hpp.


Constructor & Destructor Documentation

yap::ObjectFactory::ObjectFactory ( )
private

Definition at line 12 of file ObjectFactory.cpp.

yap::ObjectFactory::~ObjectFactory ( )
private

Definition at line 20 of file ObjectFactory.cpp.


Member Function Documentation

void yap::ObjectFactory::AddType ( const ID id,
const String type 
)

Definition at line 62 of file ObjectFactory.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool yap::ObjectFactory::ContainsLoader ( const String typeName) const
private

Definition at line 100 of file ObjectFactory.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
T * yap::ObjectFactory::Create ( const String typeName,
const ID id 
)
inline

Definition at line 23 of file ObjectFactory.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
T * yap::ObjectFactory::Create ( const ID typeID,
const ID id 
)
inline

Definition at line 37 of file ObjectFactory.hxx.

Here is the call graph for this function:

template<typename T >
T * yap::ObjectFactory::Create ( const String typeName,
IReader reader,
const String rootNodeName 
)
inline

Creates an object from a partial input file. Does not store it.

Parameters:
typeNameName of the registered type to load.
readerIReader from which to load the entity.
rootNodeNameName of the root node which contains the definition of the entity to create.
Returns:
The entity with the type typeName created from the node rootNodeName in the file file.

Definition at line 43 of file ObjectFactory.hxx.

Here is the call graph for this function:

yap::ObjectFactory::DISALLOW_COPY ( ObjectFactory  )
private
template<typename T >
T * yap::ObjectFactory::Get ( const String typeName,
const ID id 
)

Definition at line 14 of file ObjectFactory.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

const ID & yap::ObjectFactory::GetID ( const String type) const

Definition at line 87 of file ObjectFactory.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const String & yap::ObjectFactory::GetType ( const ID id) const

Definition at line 76 of file ObjectFactory.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const collection::Map< ID, String > & yap::ObjectFactory::GetTypes ( ) const

Definition at line 95 of file ObjectFactory.cpp.

Here is the caller graph for this function:

ObjectFactory & yap::ObjectFactory::Instance ( )
static

Definition at line 29 of file ObjectFactory.cpp.

Here is the caller graph for this function:

void yap::ObjectFactory::RegisterLoader ( const String typeName,
IObjectIDLoader loader 
)

Definition at line 36 of file ObjectFactory.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::ObjectFactory::RegisterLoader ( const String typeName,
IObjectLoader loader 
)

Definition at line 49 of file ObjectFactory.cpp.

Here is the call graph for this function:


Member Data Documentation

UInt64 yap::ObjectFactory::currentID_ = INITIAL_ID
staticprivate

Definition at line 63 of file ObjectFactory.hpp.

collection::Map<String, ID> yap::ObjectFactory::ids_
private

Definition at line 69 of file ObjectFactory.hpp.

const UInt64 yap::ObjectFactory::INITIAL_ID = 0
staticprivate

Definition at line 62 of file ObjectFactory.hpp.

collection::Map<String, IObjectIDLoader*> yap::ObjectFactory::objectIDLoaders_
private

Definition at line 65 of file ObjectFactory.hpp.

collection::Map<String, IObjectLoader*> yap::ObjectFactory::objectLoaders_
private

Definition at line 66 of file ObjectFactory.hpp.

collection::Map<ID, String> yap::ObjectFactory::types_
private

Definition at line 68 of file ObjectFactory.hpp.


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