#include <ClassHierarchy.h>
Inheritance diagram for ClassHierarchy:
Public Member Functions | |
ClassHierarchy () | |
virtual | ~ClassHierarchy () |
int | addClass (FullClassInfo &classInfo) |
FullClassInfo * | findClass (const char *name) |
CStdString | getProjectName () const |
void | setProjectName (const char *newProjectName) |
int | createInheritanceHierarchy (CStdString &warningsForUser, CStdString &errorForUser) |
int | checkInheritanceHierarchy (CStdString &warningsForUser, CStdString &errorForUser) |
int | generateMissingValues (CStdString &warningsForUser, CStdString &errorForUser) |
void | topologicalSort (std::list< FullClassInfo * > &sortedClassList) |
void | printClasses () |
Protected Types | |
typedef std::map< CStdString, FullClassInfo > | ClassMap |
Protected Member Functions | |
int | checkChildren (FullClassInfo *classInfo, CStdString &warningsForUser, CStdString &errorForUser) |
int | generateMissingValuesHelper (FullClassInfo *classInfo, CStdString &warningsForUser, CStdString &errorForUser) |
int | generateTableNames (CStdString &warningsForUser, CStdString &errorForUser) |
int | generateColumnNames (CStdString &warningsForUser, CStdString &errorForUser) |
int | generateTableInfoMap (CStdString &warningsForUser, CStdString &errorForUser) |
int | getTableColumnsForClass (FullClassInfo *classInfo, TableInfoMap::iterator &where, CStdString &warningsForUser, CStdString &errorForUser) |
Protected Attributes | |
ClassMap | classMap |
CStdString | projectName |
bool | prepared |
TableInfoMap | classesColumns |
The class is actually a container for FullClassInfo-s, that are added to the class using addClass() method. Afterwards they are linked together to create the hierarchy by a call to createInheritanceHierarchy().
|
Map: key = class name, value = appropriate FullClassInfo.
|
|
Simple constructor.
|
|
Empty virtual destructor.
|
|
Adds given
|
|
Returns pointer to class of the given
|
|
Returns projectName.
|
|
Sets projectName to
|
|
Links FullClassInfo-s to create class inheritance hierarchy according to FullClassInfo::baseClassNames. Fills in FullClassInfo::parents and FullClassInfo::children. Should be called after successfull filling of classMap.
|
|
Checks whether inheritance graph doesn't contain cycles
|
|
Generates ClassHierarchy's missing values:
First action is implemented by a call to generateColumnNames() (must be called first - following call to generateMissingValuesHelper() propagates the information through the tree). Second - fifth actions are implemented as a call to generateMissingValuesHelper() for every class. FullClassInfo::flags prevents class from beeing processed more then once. Last action is implemented by a call to generateTableNames().
|
|
Returns topologically sorted list of all classes in the hierarchy. Of course, createInheritanceHierarchy() must be called prior. |
|
For debug purposes only. Prints most of ClassHierarchy's information to stdout.
|
|
Helper function used by checkInheritanceHierarchy().
Checks whether If FullClassInfo::flags is FCI_NORMAL, function sets it to FCI_VISITED_THIS_TURN, then calls itself on all children, and if no of the calls return any error, function sets the flags to FCI_VISITED and returns.
|
|
Helper function used by generateMissingValues(). Does the same thing as generateMissingValues() (except column names generation) but only for given class and its ancestors.
|
|
Generates missing table names and checks whether user supplied names are unique. Changes all table names to upper case. (Most DB systems treat table/column/... names as non case sensitive.)
Reimplemented in MWClassHierarchy. |
|
Generates globally unique column name where the name has not been specified by user. (Doesn't check uniqueness of user specified ones - this is done when generating creation SQL in IOPC DBSC's DBSchemaGenerator::generateCreationScript()). Changes all column names to upper case. (Most DB systems treat table/column/... names as non case sensitive.)
|
|
Initializes classesColumns. Calls getTableColumnsForClass() for each class.
|
|
Adds to classesColumns all columns from class Function also check uniqueness of column names inside one hierarchy (exactly - inside each table and inside each view).
|
|
Container containing the hierarchy's classes.
|
|
Name of the project whose class hierarchy is represented by this class.
|
|
Flag set after successful finishing of generateMissingValues().
|
|
Map containing for each class information about appropriate DB table.
|