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

Generated using the SchemaInterface, data tables, C++ header and source files etc.. More...

#include <GloBaseMaker.h>

Public Member Functions

 BaseMaker ()
 
 BaseMaker (const SchemaInterface &rSchemaInterface)
 
 BaseMaker (const std::string &rstrSchemaFullName)
 
virtual ~BaseMaker ()
 
int checkAllClassReferences () const
 
int checkClassAttributes (const ClassInfo &rClassInfo) const
 
int checkClassIndices (const ClassInfo &rClassInfo) const
 
int createIndex () const
 
int generateAllHeader (const std::string &rstrTargetHeaderPath, bool bCreateAllNew) const
 
int generateAllSource (const std::string &rstrTargetSourcePath, bool bCreateAllNew) const
 
int generateAllTables (const std::string &rstrTargetTablePath, bool bCreateAllNew=false) const
 
int generateHeader (const std::string &rstrTargetHeaderPath, const ClassInfo &rClassInfo, bool bCreateNew) const
 
int generateObjCreator (const std::string &rstrTargetPath, bool bCreateNew) const
 
int generateSource (const std::string &rstrTargetSourcePath, const ClassInfo &rClassInfo, bool bCreateNew) const
 
virtual std::string getAttributeDescription (const ClassInfoAttribute &rClassInfoAttribute) const
 
virtual std::string getClassDescription (const ClassInfo &rClassInfo) const
 
std::string getCommentBlockStartExt ()
 
virtual std::string getFileDescription (const ClassInfo &rClassInfo) const
 
virtual std::string getIndexDescription (const ClassInfoIndex &rClassInfoIndex) const
 
std::string getTextBeforeKeywordPersistent ()
 
std::string getTextBeforeKeywordTransient ()
 
std::string getTextBehindKeywordPersistent ()
 
std::string getTextBehindKeywordTransient ()
 
void init ()
 
virtual void outputMsg (const std::string &rstrOutput) const
 
void setCommentBlockStartExt (const std::string &rstrCommentBlockStartExt)
 
void setSchema (const SchemaInterface &rSchemaInterface)
 
void setSchema (const std::string &rstrSchemaFullName)
 
void setTextBeforeKeywordPersistent (const std::string &rstrBeforeKeywordPersistent)
 
void setTextBeforeKeywordTransient (const std::string &rstrBeforeKeywordTransient)
 
void setTextBehindKeywordPersistent (const std::string &rstrBehindKeywordPersistent)
 
void setTextBehindKeywordTransient (const std::string &rstrBehindKeywordTransient)
 
int updateAllHeader (const std::string &rstrTargetHeaderPath) const
 
int updateAllSource (const std::string &rstrTargetSourcePath) const
 
int updateHeader (const std::string &rstrTargetHeaderPath, const ClassInfo &rClassInfo) const
 
int updateSource (const std::string &rstrTargetSourcePath, const ClassInfo &rClassInfo) const
 
int writeTable (const std::string &rstrTargetTablePath, const ClassInfo &rClassInfo, bool bCreateNew) const
 

Protected Member Functions

int generateAllX (CREATE_FUNCPTR pMemberFunction, const std::string &rstrTargetPath, bool bCreateAllNew) const
 
std::string getCreationNote (bool bWithWarning=true) const
 
int updateAllX (UPDATE_FUNCPTR pMemberFunction, const std::string &rstrTargetPath) const
 

Private Types

typedef int(BaseMaker::*) CREATE_FUNCPTR(const std::string &rstrTargetPath, const ClassInfo &rClassInfo, bool bCreateNew) const
 
typedef int(BaseMaker::*) UPDATE_FUNCPTR(const std::string &rstrTargetPath, const ClassInfo &rClassInfo) const
 

Private Member Functions

 BaseMaker (const BaseMaker &)
 
BaseMakeroperator= (const BaseMaker &)
 

Private Attributes

std::shared_ptr< SchemaInterfacem_spSchemaInterface
 
std::string m_strBeforeKeywordPersistent
 
std::string m_strBeforeKeywordTransient
 
std::string m_strBehindKeywordPersistent
 
std::string m_strBehindKeywordTransient
 
std::string m_strCommentBlockStartExt
 
std::string m_strDokuAttributLine
 
std::string m_strDokuCrossLine
 
std::string m_strDokuLine
 
std::string m_strDokuStarLine
 
std::string m_strOutputLine
 

Detailed Description

Generated using the SchemaInterface, data tables, C++ header and source files etc..

It can be derived from this class and e.g. not to output the information output in the BaseMaker::outputMsg() method via std::cout, but in another way in the subclass.

Author
Helmut Jakoby

Member Typedef Documentation

◆ CREATE_FUNCPTR

int(BaseMaker::*) glo::BaseMaker::CREATE_FUNCPTR(const std::string &rstrTargetPath, const ClassInfo &rClassInfo, bool bCreateNew) const
private

This method type should be passed to method BaseMaker::generateAllX (...)const for editing.

Parameters
[in]rstrTargetPathThe path where the file is to be created, such as "C:/Path/include/" or "C:/Path/source/".
[in]rClassInfoThe class information with the necessary information.
[in]bCreateNewIf true, also an existing file is overwritten!
Returns
A return value < 0 indicates an error.
See also
generateAllX(CREATE_FUNCPTR, const std::string&, bool)const
used in

◆ UPDATE_FUNCPTR

int(BaseMaker::*) glo::BaseMaker::UPDATE_FUNCPTR(const std::string &rstrTargetPath, const ClassInfo &rClassInfo) const
private

This method type should be passed to method BaseMaker::updateAllX (...)const for editing.

Parameters
[in]rstrTargetPathThe path in which the file is to be adapted, e.g. "C:/Path/include/" or "C:/Path/source/".
[in]rClassInfoThe class information with the necessary information.
Returns
A return value < 0 indicates an error.
See also
updateAllX(UPDATE_FUNCPTR, const std::string&)const
used in

Constructor & Destructor Documentation

◆ BaseMaker() [1/4]

glo::BaseMaker::BaseMaker ( )

Standard constructor.

◆ BaseMaker() [2/4]

glo::BaseMaker::BaseMaker ( const std::string & rstrSchemaFullName)

Constructor with parameter passing.

Parameters
[in]rstrSchemaFullNameThe full file name of the schema; e.g. "C:/Path/MyGloBase.ini".
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.
Attention
If the file exists, a SchemaInterface is instantiated in m_spSchemaInterface.

◆ BaseMaker() [3/4]

glo::BaseMaker::BaseMaker ( const SchemaInterface & rSchemaInterface)

Constructor with parameter passing.

Parameters
[in]rSchemaInterfaceThe passed SchemaInterface is copied.

◆ ~BaseMaker()

virtual glo::BaseMaker::~BaseMaker ( )
virtual

Destructor, if a SchemaInterface is in m_spSchemaInterface, it will be removed from memory.

◆ BaseMaker() [4/4]

glo::BaseMaker::BaseMaker ( const BaseMaker & )
private

The copy constructor is not available.

Member Function Documentation

◆ checkAllClassReferences()

int glo::BaseMaker::checkAllClassReferences ( ) const

All reference and index attributes of all class information are checked for the presence of the referenced class information and class information attributes.
The results are output via outputMsg(const std::string&)const.

Returns
A return value < 0 indicates an error.
See also
checkClassAttributes(const ClassInfo&)const
checkClassIndices(const ClassInfo&)const

◆ checkClassAttributes()

int glo::BaseMaker::checkClassAttributes ( const ClassInfo & rClassInfo) const

All reference attributes of the transferred class information are checked for the presence of the referenced class information.
The results are output via outputMsg(const std::string&)const.

Returns
A return value < 0 indicates an error.

◆ checkClassIndices()

int glo::BaseMaker::checkClassIndices ( const ClassInfo & rClassInfo) const

All indexes of the transferred class information are checked for the presence of the referenced class information and class information attributes.
The results are output via outputMsg(const std::string&)const.

Returns
A return value < 0 indicates an error.

◆ createIndex()

int glo::BaseMaker::createIndex ( ) const

All tables are reindexed (the respective index files are created).

Returns
A return value < 0 indicates an error.
See also
RealIndexPool::reindexObjIDIndexes(const SchemaInterface&)
RealIndexPool::writeObjIDIndexes(const SchemaInterface&)const

◆ generateAllHeader()

int glo::BaseMaker::generateAllHeader ( const std::string & rstrTargetHeaderPath,
bool bCreateAllNew ) const

The individual header files are created in the transferred directory.
Passes generateHeader (...) to generateAllX (...).

Parameters
[in]rstrTargetHeaderPathThe path in which the header files are to be created such as "C:/Path/include/".
[in]bCreateAllNewIf true, existing files are overwritten, otherwise not.
Returns
A return value < 0 indicates an error.

◆ generateAllSource()

int glo::BaseMaker::generateAllSource ( const std::string & rstrTargetSourcePath,
bool bCreateAllNew ) const

The individual source files are created in the passed directory.
Passes generateSource (...) to generateAllX (...).

Parameters
[in]rstrTargetSourcePathThe path in which the source files are to be created such as "C:/Path/source/".
[in]bCreateAllNewIf true, existing files are overwritten, otherwise not.
Returns
A return value < 0 indicates an error.

◆ generateAllTables()

int glo::BaseMaker::generateAllTables ( const std::string & rstrTargetTablePath,
bool bCreateAllNew = false ) const

The individual table files are created in the passed directory.
Passes writeTable (...) to generateAllX (...).

Parameters
[in]rstrTargetTablePathThe path in which the tables are to be created, e.g. "C:/Path/Data/".
[in]bCreateAllNewIf true, existing files are overwritten, otherwise not.
Returns
A return value < 0 indicates an error.

◆ generateAllX()

int glo::BaseMaker::generateAllX ( CREATE_FUNCPTR pMemberFunction,
const std::string & rstrTargetPath,
bool bCreateAllNew ) const
protected

For each ClassInfo from the m_spSchemaInterface a method (pMemberFunction) is called, which creates a special file.

Parameters
[in]pMemberFunctionThe method for creating a file.
[in]rstrTargetPathThe path where the file is to be created.
[in]bCreateAllNewIf true, existing files are overwritten, otherwise not.
Returns
A return value < 0 indicates an error.
See also
generateAllTables(const std::string&, bool)const
generateAllHeader(const std::string&, bool)const
generateAllSource(const std::string&, bool)const

◆ generateHeader()

int glo::BaseMaker::generateHeader ( const std::string & rstrTargetHeaderPath,
const ClassInfo & rClassInfo,
bool bCreateNew ) const

A header file of a class information is created in the transferred directory.
The file and class name and the individual attribute and method names are determined from the class information.

Parameters
[in]rstrTargetHeaderPathThe path in which the header file is to be created, e.g. "C:/Path/include/".
[in]rClassInfoThe class information with the necessary information.
[in]bCreateNewIf true, an existing file is overwritten, otherwise not.
Returns
A return value < 0 indicates an error.

◆ generateObjCreator()

int glo::BaseMaker::generateObjCreator ( const std::string & rstrTargetPath,
bool bCreateNew ) const

Generates the specific ObjCreator in the passed directory. The name consists of the schema name plus "ObjCreator.h" (e.g. "MyBaseObjCreator.h").

Parameters
[in]rstrTargetPathThe path in which the header file is to be created
[in]bCreateNewIf true, an existing file is overwritten, otherwise not.
Returns
A return value < 0 indicates an error.

◆ generateSource()

int glo::BaseMaker::generateSource ( const std::string & rstrTargetSourcePath,
const ClassInfo & rClassInfo,
bool bCreateNew ) const

A source file of a class information is created in the transferred directory.
The file and class name and the individual attribute and method names are determined from the class information.

Parameters
[in]rstrTargetSourcePathThe path in which the source file is to be created, e.g. "C:/Path/source/".
[in]rClassInfoThe class information with the necessary information.
[in]bCreateNewIf true, an existing file is overwritten, otherwise not.
Returns
A return value < 0 indicates an error.

◆ getAttributeDescription()

virtual std::string glo::BaseMaker::getAttributeDescription ( const ClassInfoAttribute & rClassInfoAttribute) const
virtual

Returns the attribute description which should be written into a header file of a class attribute declaration. Can be overwritten to make changes to the class attribute description if necessary.

Parameters
[in]rClassInfoAttributeThe class information attribute whose description is to be delivered.

◆ getClassDescription()

virtual std::string glo::BaseMaker::getClassDescription ( const ClassInfo & rClassInfo) const
virtual

Returns the class description which should be written into a header file of a class declaration. Can be overwritten to make changes to the class description if necessary.

Parameters
[in]rClassInfoThe class information whose class description is to be delivered.

◆ getCommentBlockStartExt()

std::string glo::BaseMaker::getCommentBlockStartExt ( )

Returns the string to which the comment block introductory character is appended.

Returns
The string to be attached.

◆ getCreationNote()

std::string glo::BaseMaker::getCreationNote ( bool bWithWarning = true) const
protected

Returns the creation note that will be inserted into each created file at the beginning as a comment.

// ****************************************************************************
// Created by GlobalObjects source code generator version 1.0.2
// Creation date: 2021.12.28 - 14:53:39
// Database: "FirstGloBase"
// ****************************************************************************
Parameters
[in]bWithWarningIf true (default) an additional warning is written.
//
// WARNING! All changes made in this file will be lost!
Returns
See above.

◆ getFileDescription()

virtual std::string glo::BaseMaker::getFileDescription ( const ClassInfo & rClassInfo) const
virtual

Returns the file description which should be written into a header file of a class declaration. Can be overwritten to make changes to the file description if necessary.

Parameters
[in]rClassInfoThe class information whose file description is to be delivered.

◆ getIndexDescription()

virtual std::string glo::BaseMaker::getIndexDescription ( const ClassInfoIndex & rClassInfoIndex) const
virtual

Returns the index description to be written into a header file of a class index declaration. Can be overwritten to make changes to the class index description if necessary.

Parameters
[in]rClassInfoIndexThe class information index whose description is to be delivered.

◆ getTextBeforeKeywordPersistent()

std::string glo::BaseMaker::getTextBeforeKeywordPersistent ( )

Returns m_strBeforeKeywordPersistent.

Returns
see above.

◆ getTextBeforeKeywordTransient()

std::string glo::BaseMaker::getTextBeforeKeywordTransient ( )

Returns m_strBeforeKeywordTransient.

Returns
see above.

◆ getTextBehindKeywordPersistent()

std::string glo::BaseMaker::getTextBehindKeywordPersistent ( )

Returns m_strBehindKeywordPersistent.

Returns
see above.

◆ getTextBehindKeywordTransient()

std::string glo::BaseMaker::getTextBehindKeywordTransient ( )

Returns m_strBehindKeywordTransient.

Returns
see above.

◆ init()

void glo::BaseMaker::init ( )

Sets the string attributes.

◆ operator=()

BaseMaker & glo::BaseMaker::operator= ( const BaseMaker & )
inlineprivate

The assignment operator is not available.

◆ outputMsg()

virtual void glo::BaseMaker::outputMsg ( const std::string & rstrOutput) const
virtual

Here the single steps of the individual tasks are output via std::cout. Can be overwritten to redirect the output (e.g. to a window).

Parameters
[in]rstrOutputThe information to be output.

◆ setCommentBlockStartExt()

void glo::BaseMaker::setCommentBlockStartExt ( const std::string & rstrCommentBlockStartExt)

Sets the string to which the comment block introductory character is appended.

Parameters
[in]rstrCommentBlockStartExtThe string to be added.

◆ setSchema() [1/2]

void glo::BaseMaker::setSchema ( const SchemaInterface & rSchemaInterface)

Sets the GloSchema interface.

Parameters
[in]rSchemaInterfaceThe passed SchemaInterface is copied.
Attention
A possibly previously existing GloSchema interface is removed from the memory.

◆ setSchema() [2/2]

void glo::BaseMaker::setSchema ( const std::string & rstrSchemaFullName)

Sets the GloSchema interface.

Parameters
[in]rstrSchemaFullNameThe full file name of the schema; e.g. "C:/Path/MyGloBase.ini".
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.
Attention
If the file exists, a SchemaInterface is instantiated. A possibly previously existing GloSchema interface is removed from memory.

◆ setTextBeforeKeywordPersistent()

void glo::BaseMaker::setTextBeforeKeywordPersistent ( const std::string & rstrBeforeKeywordPersistent)

Sets m_strBeforeKeywordPersistent.

Parameters
[in]rstrBeforeKeywordPersistentThe string to be added.

◆ setTextBeforeKeywordTransient()

void glo::BaseMaker::setTextBeforeKeywordTransient ( const std::string & rstrBeforeKeywordTransient)

Sets m_strBeforeKeywordTransient.

Parameters
[in]rstrBeforeKeywordTransientThe string to be added.

◆ setTextBehindKeywordPersistent()

void glo::BaseMaker::setTextBehindKeywordPersistent ( const std::string & rstrBehindKeywordPersistent)

Sets m_strBehindKeywordPersistent.

Parameters
[in]rstrBehindKeywordPersistentThe string to be added.

◆ setTextBehindKeywordTransient()

void glo::BaseMaker::setTextBehindKeywordTransient ( const std::string & rstrBehindKeywordTransient)

Sets m_strBehindKeywordTransient.

Parameters
[in]rstrBehindKeywordTransientThe string to be added.

◆ updateAllHeader()

int glo::BaseMaker::updateAllHeader ( const std::string & rstrTargetHeaderPath) const

If available, the individual header files will be adjusted in the transferred directory.
Passes updateHeader (...) to updateAllX (...).

Parameters
[in]rstrTargetHeaderPathThe path in which the header files are to be adjusted, e.g. "C:/Path/include/".
Returns
A return value < 0 indicates an error.

◆ updateAllSource()

int glo::BaseMaker::updateAllSource ( const std::string & rstrTargetSourcePath) const

If available, the individual source files will be adjusted in the transferred directory.
Passes updateSource (...) to updateAllX (...).

Parameters
[in]rstrTargetSourcePathThe path in which the source files are to be adjusted, e.g. "C:/Path/source/".
Returns
A return value < 0 indicates an error.

◆ updateAllX()

int glo::BaseMaker::updateAllX ( UPDATE_FUNCPTR pMemberFunction,
const std::string & rstrTargetPath ) const
protected

For each ClassInfo from the m_spSchemaInterface a method (pMemberFunction) is called, which adapts a special file.

Parameters
[in]pMemberFunctionThe method for file customization.
[in]rstrTargetPathThe path where the files are to be customized.
Returns
A return value < 0 indicates an error.
See also
updateAllHeader(const std::string&)const
updateAllSource(const std::string&)const

◆ updateHeader()

int glo::BaseMaker::updateHeader ( const std::string & rstrTargetHeaderPath,
const ClassInfo & rClassInfo ) const

A header file of a class information in the passed directory will be adapted, if available. The file and class name and the individual attribute and method names are determined from the class information.

Parameters
[in]rstrTargetHeaderPathThe path in which the header file is to be adjusted, e.g. "C:/Path/include/".
[in]rClassInfoThe class information with the necessary information.
Returns
A return value < 0 indicates an error.

◆ updateSource()

int glo::BaseMaker::updateSource ( const std::string & rstrTargetSourcePath,
const ClassInfo & rClassInfo ) const

A source file of a class information in the passed directory will be adapted, if available. The file and class name and the individual attribute and method names are determined from the class information.

Parameters
[in]rstrTargetSourcePathThe path in which the source file is to be adjusted, e.g. "C:/Path/source/".
[in]rClassInfoThe class information with the necessary information.
Returns
A return value < 0 indicates an error.

◆ writeTable()

int glo::BaseMaker::writeTable ( const std::string & rstrTargetTablePath,
const ClassInfo & rClassInfo,
bool bCreateNew ) const

A table file of a class information is created in the transferred directory.

Parameters
[in]rstrTargetTablePathThe path in which the table is to be created, e.g. "C:/Path/Data/".
[in]rClassInfoThe class information with the table name.
[in]bCreateNewIf true, an existing file is overwritten, otherwise not.
Returns
A return value < 0 indicates an error.

Member Data Documentation

◆ m_spSchemaInterface

std::shared_ptr< SchemaInterface > glo::BaseMaker::m_spSchemaInterface
private

To be able to generate data tables, C++ header and source files, the schema must be accessible.

◆ m_strBeforeKeywordPersistent

std::string glo::BaseMaker::m_strBeforeKeywordPersistent
private

The GlobalObjects keyword "persistent" can be preceded by a string in the line above in the generated header.

◆ m_strBeforeKeywordTransient

std::string glo::BaseMaker::m_strBeforeKeywordTransient
private

The GlobalObjects keyword "transient" can be preceded by a string in the line above in the generated header.

◆ m_strBehindKeywordPersistent

std::string glo::BaseMaker::m_strBehindKeywordPersistent
private

The GlobalObjects keyword "persistent" can be appended to a string in the line below in the generated header.

◆ m_strBehindKeywordTransient

std::string glo::BaseMaker::m_strBehindKeywordTransient
private

The GlobalObjects keyword "transient" can be appended to a string in the line below in the generated header.

◆ m_strCommentBlockStartExt

std::string glo::BaseMaker::m_strCommentBlockStartExt
private

A comment block is introduced with a slash and Multiplication sign and ended with an Multiplication sign and slash.
A string stored here is added to the introductory comment characters.

◆ m_strDokuAttributLine

std::string glo::BaseMaker::m_strDokuAttributLine
private

A separator line of '-' as a comment for the attributes (optics).

◆ m_strDokuCrossLine

std::string glo::BaseMaker::m_strDokuCrossLine
private

A separator line of '+' as comment for the header and source files (optics).

◆ m_strDokuLine

std::string glo::BaseMaker::m_strDokuLine
private

A separator line of '-' as comment for the header and source files (optics).

◆ m_strDokuStarLine

std::string glo::BaseMaker::m_strDokuStarLine
private

A separator line of '*' as comment for the header and source files (optics).

◆ m_strOutputLine

std::string glo::BaseMaker::m_strOutputLine
private

A separator line of '-' for information output.


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