GlobalObjects
Loading...
Searching...
No Matches
glo::SchemaInterface Class Reference

This class is the interface to a GlobalObjects schema. It contains all class information to store objects of persistent classes in a database and to build objects from tables and tables from objects. More...

#include <GloSchemaInterface.h>

Classes

struct  TempGloClassInfoIndex
 Structure to collect indexes from the schema file until the end of reading. More...
 

Public Member Functions

 SchemaInterface (const SchemaInterface &rT)
 
 SchemaInterface (const std::string &rsSchemaFullName, bool bInDeveloperMode, bool bNew)
 
 SchemaInterface (const std::string &rsSchemaFullName, bool bInDeveloperMode=false)
 
virtual ~SchemaInterface ()
 
std::string _DEBUG_ToString ()
 
void changeAllClassReferences (const std::string &rsOldReferenceName, const std::string &rsNewReferenceName, std::map< unsigned long, ClassInfo *, std::less< unsigned long > > *pChangedClassesContainer)
 
bool classIdExisting (unsigned long ulClassID) const
 
bool classInfoFileNameExisting (const std::string &rsClassFileName) const
 
bool classInfoNameExisting (const std::string &rsClassName) const
 
int destroyClassInfo (unsigned long ulClassID)
 
int getAllAttributes (std::map< std::string, ClassInfoAttribute *, std::less< std::string > > &rRetValContainer) const
 
int getAllAttributes (std::set< ClassInfoAttribute * > &rRetValContainer, unsigned long ulClassID, bool bWithSuperClassAttributes=true) const
 
int getAllClassInfos (std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rClassInfoContainer, bool bCopy=true) const
 
int getAllSubClassInfos (std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rSubClassInfoContainer, unsigned long ulClassID, bool bCopy=true) const
 
int getAllSuperClassIDs (std::set< unsigned long > &rSuperClassIdSet, unsigned long ulClassID) const
 
int getAllSuperClassInfos (std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rSuperClassInfoContainer, unsigned long ulClassID, bool bCopy=true) const
 
int getAllTableNames (std::map< std::string, std::string, std::less< std::string > > &rTableNameContainer) const
 
int getAllTableNames (std::vector< std::string > &rTableNameContainer, unsigned long ulClassID) const
 
ClassInfogetClassInfo (EnSeekMode eMode)
 
ClassInfoAttributegetClassInfoAttributeByAttributeID (int &riErr, const AttributeID &rAttributeID) const
 
ClassInfoAttributegetClassInfoAttributeByClassAndAttributeName (int &riErr, const std::string &rsClassName, const std::string &rsAttributeName) const
 
ClassInfoAttributegetClassInfoAttributeByTableAndFieldName (int &riErr, const std::string &rsTableName, const std::string &rsFieldName) const
 
ClassInfoAttributegetClassInfoAttributeByTableAndFieldName (int &riErr, unsigned long ulClassID, const std::string &rsTableName, const std::string &rsFieldName) const
 
ClassInfogetClassInfoByID (unsigned long ulClassID) const
 
ClassInfogetClassInfoByMainTable (const std::string &rsMainTableName) const
 
ClassInfogetClassInfoByName (const std::string &rsClassName) const
 
ClassInfoIndexgetClassInfoIndexByClassAndIndexName (int &riErr, const std::string &rsClassName, const std::string &rsIndexName) const
 
int getClassTableWithPath (std::string &rstrRetVal, unsigned long ulClassID) const
 
std::string getDataPath () const
 
std::string getDataSubDir () const
 
std::string getDescription () const
 
unsigned long getNextClassID ()
 
std::size_t getNumberOfClassInfos () const
 
std::string getSchemaFullName () const
 
unsigned long getSchemaID () const
 
std::string getSchemaName () const
 
std::string getSchemaPath () const
 
int getSubClassInfos (std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rSubClassInfoContainer, unsigned long ulClassID, bool bCopy=true) const
 
int getSuperClassInfos (std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rSuperClassInfoContainer, unsigned long ulClassID, bool bCopy=true) const
 
unsigned long getVersion () const
 
int insertClassInfo (ClassInfo *pNewClassInfo)
 
bool isSuperClassFrom (unsigned long ulClassIDSuperClass, unsigned long ulClassIDSubClass) const
 
SchemaInterfaceoperator= (const SchemaInterface &rT)
 
void setDataSubDir (const std::string &rsDataSubDir)
 
void setDescription (const std::string &rsDescription)
 
void setSchemaFullName (const std::string &rsSchemaFullName)
 
void setSchemaID (unsigned long ulID)
 
void setSubClassInfosInAllClassInfo ()
 
void setVersion (unsigned long ulVersion)
 
bool tableNameExisting (const std::string &rsTableName) const
 
int writeSchema ()
 

Protected Member Functions

 SchemaInterface ()
 
 SchemaInterface (const std::map< unsigned long, ClassInfo * > *pClassInfoMap)
 
 SchemaInterface (const std::map< unsigned long, std::shared_ptr< glo::ClassInfo > > rClassInfoMap)
 

Private Member Functions

int changeClassNameDotAttributNameInAttributeID (std::vector< TempGloClassInfoIndex > &rTempGloClassInfoIndexVector)
 
void copyClassInfoListFrom (const SchemaInterface &rT)
 
void deleteAllClassInfos ()
 
int getSubClassInfos (std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rSubClassInfoContainer, unsigned long ulClassID, bool bCopy, bool bDeep) const
 
int getSuperClassInfos (std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rSuperClassInfoContainer, unsigned long ulClassID, bool bCopy, bool bDeep) const
 
void init ()
 
void initNew ()
 

Private Attributes

bool m_bInDeveloperMode
 
std::map< unsigned long, ClassInfo *, std::less< unsigned long > > m_ClassInfoMap
 
std::map< unsignedlong, ClassInfo * >::iterator m_ClassInfoMapIterator
 
std::vector< unsigned long > m_CurrentlyAssignedClassIDVector
 
std::string m_sDataSubDir
 
std::string m_sDescription
 
std::string m_sSchemaDataPath
 
std::string m_sSchemaFullName
 
unsigned long m_ulID
 
unsigned long m_ulVersion
 

Friends

class BaseMaker
 
class Record
 

Detailed Description

This class is the interface to a GlobalObjects schema. It contains all class information to store objects of persistent classes in a database and to build objects from tables and tables from objects.

This class can read and save schema files. Class information can be added, modified and removed.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ SchemaInterface() [1/6]

glo::SchemaInterface::SchemaInterface ( )
protected

The standard constructor is not available.

◆ SchemaInterface() [2/6]

glo::SchemaInterface::SchemaInterface ( const std::map< unsigned long, ClassInfo * > * pClassInfoMap)
protected

Constructor with parameter passing (used by Record).

Parameters
[in]pClassInfoMapThe class information.
Attention
pClassInfoMap is copied in the constructor. The calling instance keeps the responsibility for pClassInfoMap.

◆ SchemaInterface() [3/6]

glo::SchemaInterface::SchemaInterface ( const std::map< unsigned long, std::shared_ptr< glo::ClassInfo > > rClassInfoMap)
protected

Constructor with parameter passing (used by Record).

Parameters
[in]rClassInfoMapThe class information.
Attention
pClassInfoMap is copied in the constructor.

◆ SchemaInterface() [4/6]

glo::SchemaInterface::SchemaInterface ( const std::string & rsSchemaFullName,
bool bInDeveloperMode = false )

Constructor with parameter passing.

Parameters
[in]rsSchemaFullNameThe complete file name (e.g. under the operating system Windows "C:/Path/MyGloBase.ini").
[in]bInDeveloperModeIf true the SchemaInterface is in development mode. The developer comments with the classes and attributes from the schema are delivered and written. Otherwise not, in order not to inflate the data volume unnecessarily.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ SchemaInterface() [5/6]

glo::SchemaInterface::SchemaInterface ( const std::string & rsSchemaFullName,
bool bInDeveloperMode,
bool bNew )

Constructor with parameter passing.

Parameters
[in]rsSchemaFullNameThe complete file name (e.g. under the operating system Windows "C:/Path/MyGloBase.ini").
[in]bInDeveloperModeIf true the SchemaInterface is in development mode. The developer comments with the classes and attributes from the schema are delivered and written. Otherwise not, in order not to inflate the data volume unnecessarily.
[in]bNewIf true, a new schema is created, SchemaInterface::initNew() is called, otherwise SchemaInterface::init().
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ SchemaInterface() [6/6]

glo::SchemaInterface::SchemaInterface ( const SchemaInterface & rT)

Copy constructor.

Parameters
[in]rTThe data is copied from this object.

◆ ~SchemaInterface()

virtual glo::SchemaInterface::~SchemaInterface ( )
virtual

Destructor, all class information is removed from memory.

Member Function Documentation

◆ _DEBUG_ToString()

std::string glo::SchemaInterface::_DEBUG_ToString ( )

◆ changeAllClassReferences()

void glo::SchemaInterface::changeAllClassReferences ( const std::string & rsOldReferenceName,
const std::string & rsNewReferenceName,
std::map< unsigned long, ClassInfo *, std::less< unsigned long > > * pChangedClassesContainer )

References to classes with the passed class name rsOldReferenceName in all class information are changed to references to the class with the passed class name rsNewReferenceName.

Should be called if a class name changes.

Parameters
[in]rsOldReferenceNameThe class name that should be replaced.
[in]rsNewReferenceNameThe class name that should be used instead of the former.
[in,out]pChangedClassesContainerIf passed, all changed class information will be inserted there.

◆ changeClassNameDotAttributNameInAttributeID()

int glo::SchemaInterface::changeClassNameDotAttributNameInAttributeID ( std::vector< TempGloClassInfoIndex > & rTempGloClassInfoIndexVector)
private

Swaps all class and attribute names in all TempGloClassInfoIndex::m_sIndexPath Class ID and attribute field position (equivalent to AttributeID).

Parameters
[in,out]rTempGloClassInfoIndexVectorThe vector of objects of type TempGloClassInfoIndex in which the values in TempGloClassInfoIndex::m_sIndexPath are changed.
Returns
A return value < 0 indicates an error.

◆ classIdExisting()

bool glo::SchemaInterface::classIdExisting ( unsigned long ulClassID) const

Checks if a class with passed class id already exists in the schema.

Parameters
[in]ulClassIDThe class id.
Returns
If true, then a class with the passed class id exists.

◆ classInfoFileNameExisting()

bool glo::SchemaInterface::classInfoFileNameExisting ( const std::string & rsClassFileName) const

Checks if a class with passed filename already exists in the schema.

Parameters
[in]rsClassFileNameThe class filename
Returns
If true, then a class with the passed filename exists.

◆ classInfoNameExisting()

bool glo::SchemaInterface::classInfoNameExisting ( const std::string & rsClassName) const

Checks if a class with passed name already exists in the schema.

Parameters
[in]rsClassNameThe full class name (e.g. "mynamespace::MyClassName").
Returns
If true, then a class with the passed name exists.

◆ copyClassInfoListFrom()

void glo::SchemaInterface::copyClassInfoListFrom ( const SchemaInterface & rT)
private

All class information is removed from the list of class information of the schema and from the memory and instead those from the passed SchemaInterface are taken as copies.

◆ deleteAllClassInfos()

void glo::SchemaInterface::deleteAllClassInfos ( )
private

All class information is removed from the list of class information of the schema and from memory.

◆ destroyClassInfo()

int glo::SchemaInterface::destroyClassInfo ( unsigned long ulClassID)

Removes and destroys the class information with passed class ID from m_ClassInfoMap. All "subclass" class information is also removed and destroyed.

Parameters
[in]ulClassIDThe class ID of the class information to be removed.
Returns
A return value of < 0 indicates an error.
Attention
All previously fetched class information of the subclasses of the removed class information is no longer valid with the removed class information.

◆ getAllAttributes() [1/2]

int glo::SchemaInterface::getAllAttributes ( std::map< std::string, ClassInfoAttribute *, std::less< std::string > > & rRetValContainer) const

Returns all class information attributes of all class information.

Parameters
[in,out]rRetValContainerThe found class information attributes are inserted. In this method the container is not cleared before insertion.
Returns
A return value < 0 indicates an error.
Attention
The delivered class information attributes only live as long as the delivering object and must not be removed from memory by the calling instance.

◆ getAllAttributes() [2/2]

int glo::SchemaInterface::getAllAttributes ( std::set< ClassInfoAttribute * > & rRetValContainer,
unsigned long ulClassID,
bool bWithSuperClassAttributes = true ) const

Returns all class information attributes of a class information with passed class ID.

Parameters
[in,out]rRetValContainerThe found class information attributes are inserted. In this method the container is not cleared before insertion.
[in]ulClassIDClass ID of the class information whose class information attributes are expected.
[in]bWithSuperClassAttributesIf false, the attributes of the superclasses are not returned.
Returns
A return value < 0 indicates an error.
Attention
The delivered class information attributes only live as long as the delivering object and must not be removed from memory by the calling instance.

◆ getAllClassInfos()

int glo::SchemaInterface::getAllClassInfos ( std::map< unsigned long, ClassInfo *, std::less< unsigned long > > & rClassInfoContainer,
bool bCopy = true ) const

Returns all class information of the schema.

Parameters
[in,out]rClassInfoContainerThe class information of all classes of the schema.
[in]bCopyCopies or originals:
  • If true, copies of the class information are inserted into rClassInfoContainer; then calling instance must remove this object from memory.
  • If false, the originals of the class information are inserted into rClassInfoContainer; then the calling instance must not remove this object from memory.
Returns
A return value < 0 indicates an error.

◆ getAllSubClassInfos()

int glo::SchemaInterface::getAllSubClassInfos ( std::map< unsigned long, ClassInfo *, std::less< unsigned long > > & rSubClassInfoContainer,
unsigned long ulClassID,
bool bCopy = true ) const

Returns the class information of all subclass(es) of the class whose class ID is passed.

Parameters
[in,out]rSubClassInfoContainerThe class information of all subclasses, if available.
[in]ulClassIDThe class ID of the class whose class information of all subclasses is expected.
[in]bCopyCopies or originals:
  • If true, copies of the subclass class information are inserted into rSubClassInfoContainer; then calling instance must remove this object from memory.
  • If false, the originals of the subclass class information are inserted into rSubClassInfoContainer; then the calling instance must not remove this object from memory.
Returns
A return value < 0 indicates an error.

◆ getAllSuperClassIDs()

int glo::SchemaInterface::getAllSuperClassIDs ( std::set< unsigned long > & rSuperClassIdSet,
unsigned long ulClassID ) const

Returns the class IDs of all superclasses of the class whose ID is passed

Parameters
[in,out]rSuperClassIdSetThe class IDs of the superclasses, if available.
[in]ulClassIDThe class ID of the class whose class IDs of the superclasses are to be returned.
Returns
A return value < 0 indicates an error.

◆ getAllSuperClassInfos()

int glo::SchemaInterface::getAllSuperClassInfos ( std::map< unsigned long, ClassInfo *, std::less< unsigned long > > & rSuperClassInfoContainer,
unsigned long ulClassID,
bool bCopy = true ) const

Returns the class information of all superclass(es) of the class whose class ID is passed.

Parameters
[in,out]rSuperClassInfoContainerThe class information of all superclasses, if available.
[in]ulClassIDThe class ID of the class whose class information of all superclasses is expected.
[in]bCopyCopies or originals:
  • If true, copies of the superclass class information are inserted into rSuperClassInfoContainer; then calling instance must remove this object from memory.
  • If false, the originals of the superclass class information are inserted into rSuperClassInfoContainer; then the calling instance must not remove these objects from memory.
Returns
A return value < 0 indicates an error.

◆ getAllTableNames() [1/2]

int glo::SchemaInterface::getAllTableNames ( std::map< std::string, std::string, std::less< std::string > > & rTableNameContainer) const

Returns all table names of all class information.

Parameters
[in,out]rTableNameContainerThe found table names are inserted. In this method the container is not cleared before inserting.
Returns
A return value < 0 indicates an error.
See also
SchemaInterface::getDataPath()

◆ getAllTableNames() [2/2]

int glo::SchemaInterface::getAllTableNames ( std::vector< std::string > & rTableNameContainer,
unsigned long ulClassID ) const

Returns all table names from a class information with passed class ID.

Parameters
[in,out]rTableNameContainerThe found table names are inserted. In this method the container is not cleared before insertion.
[in]ulClassIDClass ID of the class information whose table names are expected.
Returns
A return value < 0 indicates an error.
See also
SchemaInterface::getDataPath()

◆ getClassInfo()

ClassInfo * glo::SchemaInterface::getClassInfo ( EnSeekMode eMode)

Returns a class information from m_ClassInfoMap related to eMode.

Parameters
[in]eModeThe seek mode.

Parameter examples:

◆ getClassInfoAttributeByAttributeID()

ClassInfoAttribute * glo::SchemaInterface::getClassInfoAttributeByAttributeID ( int & riErr,
const AttributeID & rAttributeID ) const

Returns a class information attribute with a passed AttributeID.

Parameters
[in,out]riErrA value < 0 indicates an error.
[in]rAttributeIDThe attributeID of the searched class information attribute.
Returns
If found, the returned class information attribute only lives as long as the returning object and must not be removed from memory by the calling instance.

◆ getClassInfoAttributeByClassAndAttributeName()

ClassInfoAttribute * glo::SchemaInterface::getClassInfoAttributeByClassAndAttributeName ( int & riErr,
const std::string & rsClassName,
const std::string & rsAttributeName ) const

Returns a class information attribute from a class information with the passed class and attribute names.

Parameters
[in,out]riErrA value < 0 indicates an error.
[in]rsClassNameThe full class name of the searched class information attribute (e.g. "mynamespace::MyClassName")..
[in]rsAttributeNameThe attribute name of the searched class information attribute.
Returns
If found, the returned class information attribute only lives as long as the returning object and must not be removed from memory by the calling instance.

◆ getClassInfoAttributeByTableAndFieldName() [1/2]

ClassInfoAttribute * glo::SchemaInterface::getClassInfoAttributeByTableAndFieldName ( int & riErr,
const std::string & rsTableName,
const std::string & rsFieldName ) const

Returns a class information attribute from a class information with the passed table and field names.

Parameters
[in,out]riErrA value < 0 indicates an error.
[in]rsTableNameThe table name of the searched class information attribute.
[in]rsFieldNameThe table field name of the searched class information attribute.
Returns
If found, the returned class information attribute only lives as long as the returning object and must not be removed from memory by the calling instance.

◆ getClassInfoAttributeByTableAndFieldName() [2/2]

ClassInfoAttribute * glo::SchemaInterface::getClassInfoAttributeByTableAndFieldName ( int & riErr,
unsigned long ulClassID,
const std::string & rsTableName,
const std::string & rsFieldName ) const

Returns a class information attribute from a class information with passed class ID and passed table and field names.

Parameters
[in,out]riErrA value < 0 indicates an error.
[in]ulClassIDClass ID of the class information whose class information attribute is to be searched.
[in]rsTableNameThe table name of the searched class information attribute.
[in]rsFieldNameThe table field name of the searched class information attribute.
Returns
If found, the returned class information attribute only lives as long as the returning object and must not be removed from memory by the calling instance.

◆ getClassInfoByID()

ClassInfo * glo::SchemaInterface::getClassInfoByID ( unsigned long ulClassID) const

Returns the class information from m_ClassInfoMap with passed class ID if available.

Parameters
[in]ulClassIDThe class ID.
Returns
If successful, the class information.
Attention
The returned object only lives as long as the returning object and must not be removed from memory by the calling instance.

◆ getClassInfoByMainTable()

ClassInfo * glo::SchemaInterface::getClassInfoByMainTable ( const std::string & rsMainTableName) const

Returns the class information from m_ClassInfoMap whose data is stored in the table with the passed name.

Parameters
[in]rsMainTableNameThe table name.
Returns
If successful, the class information.
Attention
The returned object only lives as long as the returning object and must not be removed from memory by the calling instance.

◆ getClassInfoByName()

ClassInfo * glo::SchemaInterface::getClassInfoByName ( const std::string & rsClassName) const

Returns the class information from m_ClassInfoMap with the passed name if available.

Parameters
[in]rsClassNameThe full class name (e.g. "mynamespace::MyClassName").
Returns
If successful, the class information.
Attention
The returned object only lives as long as the returning object and must not be removed from memory by the calling instance.

◆ getClassInfoIndexByClassAndIndexName()

ClassInfoIndex * glo::SchemaInterface::getClassInfoIndexByClassAndIndexName ( int & riErr,
const std::string & rsClassName,
const std::string & rsIndexName ) const

Returns a class information index of a class information with the passed class and index names.

Parameters
[in,out]riErrA value < 0 indicates an error.
[in]rsClassNameThe full class name of the searched class information index (e.g. "mynamespace::MyClassName").
[in]rsIndexNameThe index name of the searched class information index.
Returns
If found, the supplied class information attribute only lives as long as the supplying object and may not be removed from memory by the calling instance.

◆ getClassTableWithPath()

int glo::SchemaInterface::getClassTableWithPath ( std::string & rstrRetVal,
unsigned long ulClassID ) const

Returns the table filename with full path of a class information with passed class ID.

Parameters
[in,out]rstrRetValThe table filename with complete path (e.g. under the operating system "C:/Path/Data/MyClassTable").
[in]ulClassIDClass ID of the class information whose table filename is expected.
Returns
A return value < 0 indicates an error.

◆ getDataPath()

std::string glo::SchemaInterface::getDataPath ( ) const

Returns the full directory name where the data can be found. The data is always located in a subdirectory of the directory where the schema file is located.

Returns
The complete directory name, such as "C:/Path/Data/" under the Windows operating system.

◆ getDataSubDir()

std::string glo::SchemaInterface::getDataSubDir ( ) const

Returns the directory name where the data can be found. The data is always located in a subdirectory of the directory where the schema file is located.

Returns
The directory name like "Data".

◆ getDescription()

std::string glo::SchemaInterface::getDescription ( ) const

Returns the database description.

Returns
See above.

◆ getNextClassID()

unsigned long glo::SchemaInterface::getNextClassID ( )

Returns the next free unique class ID.

Returns
The unique class ID

◆ getNumberOfClassInfos()

std::size_t glo::SchemaInterface::getNumberOfClassInfos ( ) const

Returns the number of class information.

Returns
See above.

◆ getSchemaFullName()

std::string glo::SchemaInterface::getSchemaFullName ( ) const

Returns the complete file name.

Returns
Complete file name (e.g. under the Windows operating system "C:/Path/MyGloBase.ini").

◆ getSchemaID()

unsigned long glo::SchemaInterface::getSchemaID ( ) const

Returns the schema ID.

Returns
See above.

◆ getSchemaName()

std::string glo::SchemaInterface::getSchemaName ( ) const

Returns the schema resp. database name.

Returns
Schema name (e.g. "MyGloBase").

◆ getSchemaPath()

std::string glo::SchemaInterface::getSchemaPath ( ) const

Returns the file path where the schema file can be found.

Returns
Complete path name (e.g. under the operating system Windows "C:/Path/").

◆ getSubClassInfos() [1/2]

int glo::SchemaInterface::getSubClassInfos ( std::map< unsigned long, ClassInfo *, std::less< unsigned long > > & rSubClassInfoContainer,
unsigned long ulClassID,
bool bCopy,
bool bDeep ) const
private

Returns the class information of the subclass(es) of the class whose class ID is passed.

Parameters
[in,out]rSubClassInfoContainerThe class information of the subclass(es), if available.
[in]ulClassIDThe class ID of the class whose class information of the subclasses is expected.
[in]bCopyCopies or originals:
  • If true, copies of the subclass class information are inserted into rSubClassInfoContainer; then calling instance must remove this object from memory.
  • If false, the originals of the subclass class information are inserted into rSubClassInfoContainer; then the calling instance must not remove this object from memory.
[in]bDeepIf true, not only the direct subclasses are inserted but also their subclasses.
Returns
A return value < 0 indicates an error.

◆ getSubClassInfos() [2/2]

int glo::SchemaInterface::getSubClassInfos ( std::map< unsigned long, ClassInfo *, std::less< unsigned long > > & rSubClassInfoContainer,
unsigned long ulClassID,
bool bCopy = true ) const

Returns the class information of the direct subclass(es) of the class whose class ID is passed.

Parameters
[in,out]rSubClassInfoContainerThe class information of the direct subclass(es), if available.
[in]ulClassIDThe class ID of the class whose class information of the direct subclasses is expected.
[in]bCopyCopies or originals:
  • If true, copies of the subclass class information are inserted into rSubClassInfoContainer; then calling instance must remove this object from memory.
  • If false, the originals of the subclass class information are inserted into rSubClassInfoContainer; then the calling instance must not remove this object from memory.
Returns
A return value < 0 indicates an error.

◆ getSuperClassInfos() [1/2]

int glo::SchemaInterface::getSuperClassInfos ( std::map< unsigned long, ClassInfo *, std::less< unsigned long > > & rSuperClassInfoContainer,
unsigned long ulClassID,
bool bCopy,
bool bDeep ) const
private

Returns the class information of the superclass(es) of the class whose class ID is passed.

Parameters
[in,out]rSuperClassInfoContainerThe class information of the superclass(es), if available. In this method the container is not emptied before insertion.
[in]ulClassIDThe class ID of the class whose class information of the superclasses is expected.
[in]bCopyCopies or originals:
  • If true, copies of the superclass class information are inserted into rSuperClassInfoContainer; then calling instance must remove this object from memory.
  • If false, the originals of the superclass class information are inserted into rSuperClassInfoContainer; then the calling instance must not remove these objects from memory.
[in]bDeepIf true, not only the direct superclasses are inserted but also their superclasses.
Returns
A return value < 0 indicates an error.

◆ getSuperClassInfos() [2/2]

int glo::SchemaInterface::getSuperClassInfos ( std::map< unsigned long, ClassInfo *, std::less< unsigned long > > & rSuperClassInfoContainer,
unsigned long ulClassID,
bool bCopy = true ) const

Returns the class information of the direct superclass(es) of the class whose class ID is passed.

Parameters
[in,out]rSuperClassInfoContainerThe class information of the direct superclass(es), if available.
[in]ulClassIDThe class ID of the class whose class information of the direct superclasses is expected.
[in]bCopyCopies or originals:
  • If true, copies of the superclass class information are inserted into rSuperClassInfoContainer; then calling instance must remove this object from memory.
  • If false, the originals of the superclass class information are inserted into rSuperClassInfoContainer; then the calling instance must not remove these objects from memory.
Returns
A return value < 0 indicates an error.

◆ getVersion()

unsigned long glo::SchemaInterface::getVersion ( ) const

Returns the version number.

Returns
See above.

◆ init()

void glo::SchemaInterface::init ( )
private

The schema interface is initialized. The schema file is opened and all class information with its class information attributes is read, called by the constructor.

Exceptions
eut::ErrorNExceptionIn case of an error an exception is thrown.

◆ initNew()

void glo::SchemaInterface::initNew ( )
private

It is only checked whether the file from "m_sSchemaFullName" does not already exist, is called by the constructor.

Exceptions
eut::ErrorNExceptionIf the schema file already exists an exception is thrown.

◆ insertClassInfo()

int glo::SchemaInterface::insertClassInfo ( ClassInfo * pNewClassInfo)

Inserts passed class information into m_ClassInfoMap if no class information with the same class ID exists yet.

Parameters
[in]pNewClassInfoThe class information to be inserted.
Returns
A return value < 0 indicates an error.
Attention
If passed object was accepted without error, it is removed from memory by this object. The calling instance may then no longer remove the passed object from memory.

◆ isSuperClassFrom()

bool glo::SchemaInterface::isSuperClassFrom ( unsigned long ulClassIDSuperClass,
unsigned long ulClassIDSubClass ) const

Checks whether a class is a superclass of another class.

Parameters
[in]ulClassIDSuperClassThe class ID of the superclass to be checked.
[in]ulClassIDSubClassThe class ID of the subclass to be checked.
Returns
If true, the class with the class ID ulClassIDSuperClass is a superclass of the subclass with the class ID ulClassIDSubClass.

◆ operator=()

SchemaInterface & glo::SchemaInterface::operator= ( const SchemaInterface & rT)

Assignment operator.

Parameters
[in]rTThe data is transferred from this object.

◆ setDataSubDir()

void glo::SchemaInterface::setDataSubDir ( const std::string & rsDataSubDir)

Sets the directory name where the data can be found. The data is always located in a subdirectory of the directory where the schema file is located.

Parameters
[in]rsDataSubDirThe directory name like "Data".

◆ setDescription()

void glo::SchemaInterface::setDescription ( const std::string & rsDescription)

Sets the database description.

Parameters
[in]rsDescriptionThe description.

◆ setSchemaFullName()

void glo::SchemaInterface::setSchemaFullName ( const std::string & rsSchemaFullName)

Sets the complete file name.

Parameters
[in]rsSchemaFullNameComplete file name (e.g. under the operating system Windows "C:/Path/MyGloBase.ini").

◆ setSchemaID()

void glo::SchemaInterface::setSchemaID ( unsigned long ulID)

Sets the schema ID.

Parameters
[in]ulIDThe schema ID.

◆ setSubClassInfosInAllClassInfo()

void glo::SchemaInterface::setSubClassInfosInAllClassInfo ( )

The subclasses are inserted in all class information.

See also
glo::ClassInfo::insertSubClassInfo(glo::ClassInfo*)

◆ setVersion()

void glo::SchemaInterface::setVersion ( unsigned long ulVersion)

Sets the version number.

Parameters
[in]ulVersionThe version number.

◆ tableNameExisting()

bool glo::SchemaInterface::tableNameExisting ( const std::string & rsTableName) const

Checks if a table name for a class information in the schema is already assigned.

Parameters
[in]rsTableNameThe table name to be checked.
Returns
If true, the table name in the schema is already used.

◆ writeSchema()

int glo::SchemaInterface::writeSchema ( )

Writes the schema file (m_sSchemaFullName). Its tries to overwrite a possibly already existing file.

Returns
A return value < 0 indicates an error.

Friends And Related Symbol Documentation

◆ BaseMaker

friend class BaseMaker
friend

◆ Record

friend class Record
friend

Member Data Documentation

◆ m_bInDeveloperMode

bool glo::SchemaInterface::m_bInDeveloperMode
private

If true the GloSchema interface is in development mode. The developer comments with the classes and attributes from the schema are delivered and written. Otherwise not, in order not to inflate the data volume.

◆ m_ClassInfoMap

std::map< unsigned long, ClassInfo *, std::less<unsigned long> > glo::SchemaInterface::m_ClassInfoMap
private

The collection of class information of the respective schema.

◆ m_ClassInfoMapIterator

std::map<unsignedlong,ClassInfo*>::iterator glo::SchemaInterface::m_ClassInfoMapIterator
private

An internal iterator on the collection of class information of the respective schema.

◆ m_CurrentlyAssignedClassIDVector

std::vector<unsigned long> glo::SchemaInterface::m_CurrentlyAssignedClassIDVector
private

Only temporarily to hold assigned ClassIDs whose classes may not yet be in the schema.

◆ m_sDataSubDir

std::string glo::SchemaInterface::m_sDataSubDir
private

The object data is always located in this subdirectory of the directory in which the schema file is located.

See also
m_sSchemaFullName

◆ m_sDescription

std::string glo::SchemaInterface::m_sDescription
private

Description of the database.

◆ m_sSchemaDataPath

std::string glo::SchemaInterface::m_sSchemaDataPath
private

The path to the schema file (e.g. under the operating system Windows "C:/Path/MyDataBase/")

See also
m_sSchemaFullName
m_sDataSubDir

◆ m_sSchemaFullName

std::string glo::SchemaInterface::m_sSchemaFullName
private

The complete file name of the schema file (e.g. under the operating system Windows "C:/Path/MyGloBase.ini")

See also
m_sDataSubDir

◆ m_ulID

unsigned long glo::SchemaInterface::m_ulID
private

The ID of the database.

◆ m_ulVersion

unsigned long glo::SchemaInterface::m_ulVersion
private

The versin of the schema; unequal IDs of client and server can lead to unexpected behavior!


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