#include <ClassFactory.h>
Public Methods | |
CClassFactory () | |
Default constructor. More... | |
virtual | ~CClassFactory () |
Default destructor. More... | |
void | clearClasDef () |
Clear current classes definitions. More... | |
void | clearCurContext () |
Clear current context. More... | |
bool | addClass (const char *className, const char *extends) |
add a new Class Definitions to the class Factory. More... | |
TiXmlNode * | findClass (const char *className) |
find a particular class in the clasess Definitions of the class Factory. More... | |
bool | deleteClass (const char *className) |
delete a particular class in the clasess Definitions. More... | |
bool | addAttribute (const char *className, const char *attributeName) |
add a new Attribute to a giving class. More... | |
bool | deleteAttribute (const char *className, const char *attributeName) |
delete an Attribute from a giving class. More... | |
bool | newInstance (const char *className, const char *instanceName) |
Make a new object instace of a giving class name. More... | |
TiXmlNode * | findInstance (const char *instanceName) |
find an object instace of a giving class name. More... | |
bool | deleteInstace (const char *instanceName) |
delete an object instace of a giving instance name. More... | |
bool | setValue (const char *instanceName, const char *attributeName, const char *value) |
Set the value of an attribute in a giving object instance. More... | |
CString | getValue (const char *instanceName, const char *attributeName) |
Get the value of an attribute in a giving object instance. More... | |
bool | loadClassDef (const char *filename) |
Load classes definitions from a XML / Text file. More... | |
bool | saveClassDef (const char *filename) |
Save classes definitions from a XML / Text file. More... | |
bool | loadContext (const char *filename) |
Load object instances context from a XML / Text file. More... | |
bool | saveContext (const char *filename) |
Save object instances context from a XML / Text file. More... | |
TiXmlDocument * | getClassDef () |
Get the full classes definitions as an xml dom document. More... | |
TiXmlDocument * | getCurContext () |
Get the full objects instances as an xml dom document. More... | |
Private Methods | |
bool | addAttributesToInstance (TiXmlElement *element, TiXmlNode *classNode) |
Add the attributes of a class to a instance (INTERNAL USE). More... | |
void | error (char message[],...) |
Display an Error Message. More... | |
Private Attributes | |
TiXmlDocument | classesDefinitions |
XML Document with classes definitions. More... | |
TiXmlDocument | currentContext |
XML Document with objects instances. More... |
This class its a implementation of something like class factory.
Definition at line 107 of file ClassFactory.h.
|
Default constructor. Default constructor Definition at line 8 of file ClassFactory.cpp. |
|
Default destructor. Default destructor Definition at line 13 of file ClassFactory.cpp. References clearClasDef(), and clearCurContext(). |
|
add a new Attribute to a giving class. You should call this method to add a new attribute to a giving class.
Definition at line 377 of file ClassFactory.cpp. |
|
Add the attributes of a class to a instance (INTERNAL USE). This function add the attributes of desired class to a giving instance, this method work in recursive way to add all the attribute of uppers classes to the instance.
Definition at line 278 of file ClassFactory.cpp. References error(), and findClass(). Referenced by newInstance(). |
|
add a new Class Definitions to the class Factory. You should call this method to add new Class Definition to the Class Factory.
Definition at line 324 of file ClassFactory.cpp. References classesDefinitions, error(), and findClass(). |
|
Clear current classes definitions. Clear current classes definitions Definition at line 20 of file ClassFactory.cpp. References classesDefinitions. Referenced by ~CClassFactory(). |
|
Clear current context. Clear current context Definition at line 27 of file ClassFactory.cpp. References currentContext. Referenced by ~CClassFactory(). |
|
delete an Attribute from a giving class. You should call this method to delete an attribute from a giving class.
Definition at line 448 of file ClassFactory.cpp. |
|
delete a particular class in the clasess Definitions. You should call this method to delete a class definition giving a class name.
Definition at line 431 of file ClassFactory.cpp. References classesDefinitions, error(), and findClass(). |
|
delete an object instace of a giving instance name. You should call this method to delete an object instance of a giving instace name.
Definition at line 162 of file ClassFactory.cpp. References currentContext, error(), and findInstance(). |
|
Display an Error Message. Nasty function to display errors
Definition at line 495 of file ClassFactory.cpp. Referenced by addAttribute(), addAttributesToInstance(), addClass(), deleteAttribute(), deleteClass(), deleteInstace(), getValue(), loadClassDef(), loadContext(), newInstance(), saveClassDef(), saveContext(), and setValue(). |
|
find a particular class in the clasess Definitions of the class Factory. You should call this method to find a class definition giving a class name.
Definition at line 128 of file ClassFactory.cpp. References classesDefinitions. Referenced by addAttribute(), addAttributesToInstance(), addClass(), deleteAttribute(), deleteClass(), and newInstance(). |
|
find an object instace of a giving class name. You should call this method to find an object instance of a giving instace name.
Definition at line 179 of file ClassFactory.cpp. References currentContext. Referenced by deleteInstace(), getValue(), and setValue(). |
|
Get the full classes definitions as an xml dom document. You should call this method to get the classes definitions in a TiXmlDocument.
Definition at line 344 of file ClassFactory.h. References classesDefinitions. |
|
Get the full objects instances as an xml dom document. You should call this method to get the objects instances in a TiXmlDocument.
Definition at line 356 of file ClassFactory.h. References currentContext. |
|
Get the value of an attribute in a giving object instance. You should call this method to get the value of an attribute in a givging object instace
Definition at line 251 of file ClassFactory.cpp. References error(), and findInstance(). |
|
Load classes definitions from a XML / Text file. You should call this method to load the full classes definitions from a XML FILE
Definition at line 60 of file ClassFactory.cpp. References classesDefinitions, and error(). |
|
Load object instances context from a XML / Text file. You should call this method to load the full object instances context from a XML FILE
Definition at line 33 of file ClassFactory.cpp. References currentContext, and error(). |
|
Make a new object instace of a giving class name. You should call this method to add a new object instance of a giving name. This method olso creates the values of the atributes of this class, and uppers classes following the hirearchy..
Definition at line 86 of file ClassFactory.cpp. References addAttributesToInstance(), currentContext, error(), and findClass(). |
|
Save classes definitions from a XML / Text file. You should call this method to save the full classes definitions to a XML FILE
Definition at line 73 of file ClassFactory.cpp. References classesDefinitions, and error(). |
|
Save object instances context from a XML / Text file. You should call this method to save the full object instances context to a XML FILE
Definition at line 47 of file ClassFactory.cpp. References currentContext, and error(). |
|
Set the value of an attribute in a giving object instance. You should call this method to set the value of an attribute in a givging object instace
Definition at line 213 of file ClassFactory.cpp. References error(), and findInstance(). |
|
XML Document with classes definitions. XML Document with classes definitions Definition at line 367 of file ClassFactory.h. Referenced by addClass(), clearClasDef(), deleteClass(), findClass(), getClassDef(), loadClassDef(), and saveClassDef(). |
|
XML Document with objects instances. XML Document with objects instances Definition at line 373 of file ClassFactory.h. Referenced by clearCurContext(), deleteInstace(), findInstance(), getCurContext(), loadContext(), newInstance(), and saveContext(). |