Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::ClassRegistry Class Reference

ClassRegistry contains all Class's in the Framework Runtime. More...

#include <vcf/FoundationKit/ClassRegistry.h>

List of all members.

Public Member Functions

 ClassRegistry ()
virtual ~ClassRegistry ()

Static Public Member Functions

static ClassRegistrycreate ()
static void terminate ()
static ClassgetClass (const String &className)
 returns a Class object from a string.
static ClassgetClassFromClassID (const String &classID)
 returns a Class object from a string representing a ClassID/UUID.
static ClassgetClass (const Object *object)
 returns a Class object for the object passed in.
static ClassgetClass (Object *object)
static ObjectcreateNewInstance (const String &className)
 creates a new instance of an object based on the class name.
static ObjectcreateNewInstanceFromClassID (const String &classID)
 creates a new instance of an object based on the classID.
static void * createNewInterfaceInstanceFromInterfaceName (const String &interfaceName, const String &implementerClassName)
 see ImplementedInterfaceClass::createInterfaceInstance()
static void * createNewInterfaceInstanceFromInterfaceID (const String &interfaceID, const String &implementerClassID)
 see ImplementedInterfaceClass::createInterfaceInstance()
static void addClass (const String &className, Class *classToRegister)
 adds a new Class object to the ClassRegistry
static void removeClass (const String &className)
static void removeClassByID (const String &classID)
static void addInterface (const String &interfaceName, InterfaceClass *interfaceToRegister)
 adds a new InterfaceClass object to the ClassRegistry that represents a particular interface
static void removeInterface (const String &interfaceName)
static void removeInterfaceByID (const String &interfaceID)
static Enumerator< Class * > * getClasses ()
 returns an enumeration of all the classes in the system at the time of the call
static Enumerator< InterfaceClass * > * getInterfaces ()
static ImplementedInterfaceClassgetImplementedInterface (const String &implementingClassName, const String &interfaceID)
 returns a ImplementedInterfaceClass object from a string.
static InterfaceClassgetInterface (const String &interfaceName)
 returns a InterfaceClass object from a string.
static InterfaceClassgetInterfaceFromInterfaceID (const String &interfaceID)
 returns a InterfaceClass object from a string ID.
static void addImplementedInterface (ImplementedInterfaceClass *interfaceToRegister, const String &implementerClassID)
 Adds an implemented interface class to the registry.
static bool registerMethod (Method *method, const String &className, const bool &isInterfaceMethod)
 attempts to register the method with the class or interface
static bool registerMethodByUUID (Method *method, const String &UUID, const bool &isInterfaceMethod)
 attempts to register the method with the class or interface
static void dump ()
 Dumps out the classes in registery to stdout.
static void removeClass (Class *clazz)
 Removes a class from teh ClassRegistry.
static void removeInterface (InterfaceClass *interfaceClass)

Protected Member Functions

Classinternal_getClass (const String &className)
Classinternal_getClassFromClassID (const String &classID)
Classinternal_getClass (Object *object)
Classinternal_getClass (const Object *object)
Objectinternal_createNewInstance (const String &className)
Objectinternal_createNewInstanceFromClassID (const String &classID)
void * internal_createNewInterfaceInstanceFromInterfaceName (const String &interfaceName, const String &implementerClassName)
void * internal_createNewInterfaceInstanceFromInterfaceID (const String &interfaceID, const String &implementerClassID)
void internal_addClass (const String &className, Class *classToRegister)
void internal_addInterface (const String &interfaceName, InterfaceClass *interfaceToRegister)
Enumerator< Class * > * internal_getClasses ()
Enumerator< InterfaceClass * > * internal_getInterfaces ()
ImplementedInterfaceClassinternal_getImplementedInterface (const String &implementingClassName, const String &interfaceID)
InterfaceClassinternal_getInterface (const String &interfaceName)
InterfaceClassinternal_getInterfaceFromInterfaceID (const String &interfaceID)
void internal_addImplementedInterface (ImplementedInterfaceClass *interfaceToRegister, const String &implementerClassID)
bool internal_registerMethod (Method *method, const String &className, const bool &isInterfaceMethod)
bool internal_registerMethodByUUID (Method *method, const String &UUID, const bool &isInterfaceMethod)
void internal_dump ()

Static Protected Member Functions

static ClassRegistrygetClassRegistry ()
 a static function that returns the global instance of the ClassRegistry.

Protected Attributes

Map< String, Class * > classMap_
 a map of all the classes in the ClassRegistry.
Map< String, InterfaceClass * > interfaceMap_
 a map of all the interfaces in the ClassRegistry.
std::map< String, InterfaceClass * > interfaceIDMap_
 a map of all the classes in the ClassRegistry.
std::map< String, ImplementedInterfaceClass * > implementedInterfacesIDMap_
 a map of all the classes in the ClassRegistry.
std::map< String, Class * > classIDMap_
 a map of all the classes in the ClassRegistry.

Static Protected Attributes

static ClassRegistryregistryInstance_


Detailed Description

ClassRegistry contains all Class's in the Framework Runtime.

The ClassRegistry is used by the Framework Runtime to register Classes and properties for Classes. The ClassRegistry is also used to dynamically create new instances of a class from a class name.

Author:
Jim Crafton
Version:
1.0


Constructor & Destructor Documentation

VCF::ClassRegistry::ClassRegistry  ) 
 

virtual VCF::ClassRegistry::~ClassRegistry  )  [virtual]
 


Member Function Documentation

static void VCF::ClassRegistry::addClass const String className,
Class classToRegister
[static]
 

adds a new Class object to the ClassRegistry

Parameters:
String the name of the class
Class the Class object to register

static void VCF::ClassRegistry::addImplementedInterface ImplementedInterfaceClass interfaceToRegister,
const String implementerClassID
[static]
 

Adds an implemented interface class to the registry.

static void VCF::ClassRegistry::addInterface const String interfaceName,
InterfaceClass interfaceToRegister
[static]
 

adds a new InterfaceClass object to the ClassRegistry that represents a particular interface

Parameters:
String the name of the interface
InterfaceClass the InterfaceClass object to register

static ClassRegistry* VCF::ClassRegistry::create  )  [static]
 

static Object* VCF::ClassRegistry::createNewInstance const String className  )  [static]
 

creates a new instance of an object based on the class name.

Parameters:
String the class name of the object to create
Object a pointer to the newly created object

static Object* VCF::ClassRegistry::createNewInstanceFromClassID const String classID  )  [static]
 

creates a new instance of an object based on the classID.

Parameters:
String the classID of the object to create
Object a pointer to the newly created object

static void* VCF::ClassRegistry::createNewInterfaceInstanceFromInterfaceID const String interfaceID,
const String implementerClassID
[static]
 

see ImplementedInterfaceClass::createInterfaceInstance()

static void* VCF::ClassRegistry::createNewInterfaceInstanceFromInterfaceName const String interfaceName,
const String implementerClassName
[static]
 

see ImplementedInterfaceClass::createInterfaceInstance()

static void VCF::ClassRegistry::dump  )  [static]
 

Dumps out the classes in registery to stdout.

static Class* VCF::ClassRegistry::getClass Object object  )  [static]
 

static Class* VCF::ClassRegistry::getClass const Object object  )  [static]
 

returns a Class object for the object passed in.

Parameters:
Object the object instance to get a class for
Returns:
Class the class associated with the object

static Class* VCF::ClassRegistry::getClass const String className  )  [static]
 

returns a Class object from a string.

If no matching Class exists the function returns NULL. In terms of efficiency, this function is faster than getClass( Object*)

Parameters:
String the name of the class to find
Returns:
Class the class associated with the className

static Enumerator<Class*>* VCF::ClassRegistry::getClasses  )  [static]
 

returns an enumeration of all the classes in the system at the time of the call

static Class* VCF::ClassRegistry::getClassFromClassID const String classID  )  [static]
 

returns a Class object from a string representing a ClassID/UUID.

If no matching Class exists the function returns NULL. In terms of efficiency, this function is faster than getClass( Object*)

Parameters:
String the UUID or ClassID of the class to find
Returns:
Class the class associated with the ClassID

static ClassRegistry* VCF::ClassRegistry::getClassRegistry  )  [static, protected]
 

a static function that returns the global instance of the ClassRegistry.

static ImplementedInterfaceClass* VCF::ClassRegistry::getImplementedInterface const String implementingClassName,
const String interfaceID
[static]
 

returns a ImplementedInterfaceClass object from a string.

If no matching ImplementedInterfaceClass exists the function returns NULL.

Parameters:
String the name of the implementing class to find the interface UUID to find
Returns:
ImplementedInterfaceClass the implemented interface associated with the implementingClassName

static InterfaceClass* VCF::ClassRegistry::getInterface const String interfaceName  )  [static]
 

returns a InterfaceClass object from a string.

If no matching InterfaceClass exists the function returns NULL.

Parameters:
String the name of the interface to find
Returns:
InterfaceClass the interface associated with the interfaceName

static InterfaceClass* VCF::ClassRegistry::getInterfaceFromInterfaceID const String interfaceID  )  [static]
 

returns a InterfaceClass object from a string ID.

If no matching InterfaceClass exists the function returns NULL.

Parameters:
String the UUID of the interface to find
Returns:
InterfaceClass the interface associated with the interfaceName

static Enumerator<InterfaceClass*>* VCF::ClassRegistry::getInterfaces  )  [static]
 

void VCF::ClassRegistry::internal_addClass const String className,
Class classToRegister
[protected]
 

void VCF::ClassRegistry::internal_addImplementedInterface ImplementedInterfaceClass interfaceToRegister,
const String implementerClassID
[protected]
 

void VCF::ClassRegistry::internal_addInterface const String interfaceName,
InterfaceClass interfaceToRegister
[protected]
 

Object* VCF::ClassRegistry::internal_createNewInstance const String className  )  [protected]
 

Object* VCF::ClassRegistry::internal_createNewInstanceFromClassID const String classID  )  [protected]
 

void* VCF::ClassRegistry::internal_createNewInterfaceInstanceFromInterfaceID const String interfaceID,
const String implementerClassID
[protected]
 

void* VCF::ClassRegistry::internal_createNewInterfaceInstanceFromInterfaceName const String interfaceName,
const String implementerClassName
[protected]
 

void VCF::ClassRegistry::internal_dump  )  [protected]
 

Class* VCF::ClassRegistry::internal_getClass const Object object  )  [protected]
 

Class* VCF::ClassRegistry::internal_getClass Object object  )  [protected]
 

Class* VCF::ClassRegistry::internal_getClass const String className  )  [protected]
 

Enumerator<Class*>* VCF::ClassRegistry::internal_getClasses  )  [protected]
 

Class* VCF::ClassRegistry::internal_getClassFromClassID const String classID  )  [protected]
 

ImplementedInterfaceClass* VCF::ClassRegistry::internal_getImplementedInterface const String implementingClassName,
const String interfaceID
[protected]
 

InterfaceClass* VCF::ClassRegistry::internal_getInterface const String interfaceName  )  [protected]
 

InterfaceClass* VCF::ClassRegistry::internal_getInterfaceFromInterfaceID const String interfaceID  )  [protected]
 

Enumerator<InterfaceClass*>* VCF::ClassRegistry::internal_getInterfaces  )  [protected]
 

bool VCF::ClassRegistry::internal_registerMethod Method method,
const String className,
const bool &  isInterfaceMethod
[protected]
 

bool VCF::ClassRegistry::internal_registerMethodByUUID Method method,
const String UUID,
const bool &  isInterfaceMethod
[protected]
 

static bool VCF::ClassRegistry::registerMethod Method method,
const String className,
const bool &  isInterfaceMethod
[static]
 

attempts to register the method with the class or interface

Returns:
bool represents whether or not the registration attempt was successful. If the method returns false then the caller must free the Method object that was passed in

static bool VCF::ClassRegistry::registerMethodByUUID Method method,
const String UUID,
const bool &  isInterfaceMethod
[static]
 

attempts to register the method with the class or interface

Parameters:
Method the Method object that represents the method to registered
String the UUID of the class or interface to register the Method with
bool whether or not the Method is associated with an Interface or a Class.
Returns:
bool represents whether or not the registration attempt was successful. If the method returns false then the caller must free the Method object that was passed in

static void VCF::ClassRegistry::removeClass Class clazz  )  [static]
 

Removes a class from teh ClassRegistry.

Dynamically loaded libraries should call this prior to termination to prevent bad memory from being deleted

static void VCF::ClassRegistry::removeClass const String className  )  [static]
 

static void VCF::ClassRegistry::removeClassByID const String classID  )  [static]
 

static void VCF::ClassRegistry::removeInterface InterfaceClass interfaceClass  )  [static]
 

static void VCF::ClassRegistry::removeInterface const String interfaceName  )  [static]
 

static void VCF::ClassRegistry::removeInterfaceByID const String interfaceID  )  [static]
 

static void VCF::ClassRegistry::terminate  )  [static]
 


Member Data Documentation

std::map<String,Class*> VCF::ClassRegistry::classIDMap_ [protected]
 

a map of all the classes in the ClassRegistry.

keyed by the classID

Map<String,Class*> VCF::ClassRegistry::classMap_ [protected]
 

a map of all the classes in the ClassRegistry.

keyed by the class name

std::map<String,ImplementedInterfaceClass*> VCF::ClassRegistry::implementedInterfacesIDMap_ [protected]
 

a map of all the classes in the ClassRegistry.

keyed by the classID

std::map<String,InterfaceClass*> VCF::ClassRegistry::interfaceIDMap_ [protected]
 

a map of all the classes in the ClassRegistry.

keyed by the classID

Map<String,InterfaceClass*> VCF::ClassRegistry::interfaceMap_ [protected]
 

a map of all the interfaces in the ClassRegistry.

keyed by the interface name

ClassRegistry* VCF::ClassRegistry::registryInstance_ [static, protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information