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

In objects of this class, the information for GlobalObjects is how a persistent class attribute is structured. More...

#include <GloClassInfoAttribute.h>

Inheritance diagram for glo::ClassInfoAttribute:

Classes

class  Type
 Summarized type information for a ClassInfoAttribute. More...
 

Public Member Functions

 ClassInfoAttribute ()
 
 ClassInfoAttribute (const ClassInfoAttribute &rT)
 
 ClassInfoAttribute (const std::string &rsName, const std::string &rsTableName, const std::string &rsFieldName, int iFieldPos, const std::string &rsAttributeType, const std::string &rsInfo)
 
virtual ~ClassInfoAttribute ()
 
std::string _DEBUG_ToString ()
 
std::string formatAnIndexString (const std::string &rsStringToBeFormatted, const std::vector< eut::LanguageFunctions::EnLanguageKey > &rLanguageKeys, bool bCaseSensitive, void *pIndexAttributeItem) const
 
std::string formatAnSearchIndexString (const std::string &rsStringToBeFormatted, const std::vector< eut::LanguageFunctions::EnLanguageKey > &rLanguageKeys, bool bCaseSensitive, void *pIndexAttributeItem) const
 
AttributeID getAttributeID () const
 
std::string getClassAttributeName () const
 
EnDataType getDataType () const
 
std::string getDataTypeInfo () const
 
std::string getDataTypeSubType () const
 
unsigned long getDataTypeSubTypeClassID () const
 
std::string getDeveloperAccessControl () const
 
std::string getFieldName () const
 
int getFieldPos () const
 
std::string getFieldPosAsString () const
 
EnDataTypeGroup getInfoType ()
 
int getSignificantCharacter () const
 
std::string getTableFieldName () const
 
std::string getTableName () const
 
ClassInfoAttribute::Type getType () const
 
std::string getTypeAsCppString () const
 
std::string getTypeAsString () const
 
bool isCrossreferenceType () const
 
bool isCrossreferenceType (std::string &rsCrossRefFileName) const
 
bool isCrossreferenceType (unsigned long &rulBaseID) const
 
bool isNum () const
 
ClassInfoAttributeoperator= (const ClassInfoAttribute &rT)
 
void setDataType (EnDataType eType)
 
void setDataTypeInfo (const std::string &rsInfo)
 
void setDataTypeSubType (const std::string &rsSubType)
 
void setDataTypeSubTypeClassID (unsigned long ulSubTypeClassID)
 
void setDeveloperAccessControl (const std::string &rsAccessControl)
 
void setFieldName (const std::string &rsName)
 
void setFieldPos (int iFieldPos)
 
void setTableName (const std::string &rsName)
 
bool operator== (const ClassInfoAttribute &rT) const
 Comparison operator, all attributes are compared.
 
bool operator!= (const ClassInfoAttribute &rT) const
 Comparison operator, all attributes are compared.
 
- Public Member Functions inherited from glo::ClassInfoItem
 ClassInfoItem ()
 
 ClassInfoItem (const ClassInfoItem &rT)
 
 ClassInfoItem (const std::string &rsName)
 
virtual ~ClassInfoItem ()
 
unsigned long getClassID () const
 
std::string getClassName () const
 
std::string getDeveloperDescription () const
 
std::string getName () const
 
ClassInfogetParent ()
 
ClassInfoItemoperator= (const ClassInfoItem &rT)
 
void setDeveloperDescription (const std::string &rsDeveloperDescription)
 
void setMyClassInfo (ClassInfo *pMyClassInfo)
 
void setName (const std::string &rsName)
 
bool operator== (const ClassInfoItem &rT) const
 Comparison operator, all attributes are compared.
 
bool operator!= (const ClassInfoItem &rT) const
 Comparison operator, all attributes are compared.
 

Static Public Member Functions

static unsigned int getDataTypesCount ()
 
static EnDataTypeGroup getInfoType (EnDataType eType)
 
static int getRecordAttributeLimits (const ClassInfoAttribute::Type &rDataType, std::string &rsMin, std::string &rsMax, std::string &rsDataFieldSize)
 
static int getSignificantCharacter (EnDataType eDataType)
 
static std::string getTypeAsCppString (EnDataType eType, const std::string &rsSubType)
 
static std::string getTypeAsString (EnDataType eType, bool bSimple=true)
 
static EnDataType getTypeFromString (const std::string &rsType)
 
static bool isNum (EnDataType eDataType)
 

Private Member Functions

void convertAttributeType (const std::string &rsType, const std::string &rsTypeInfo)
 
std::string formatAnyIndexString (const std::string &rsStringToBeFormatted, const std::vector< eut::LanguageFunctions::EnLanguageKey > &rLanguageKeys, bool bCaseSensitive, bool bIsSearchString, void *pIndexAttributeItem) const
 

Private Attributes

int m_iFieldPos
 
std::string m_sDeveloperAccessControl
 
std::string m_sFieldName
 
std::string m_sTableName
 
ClassInfoAttribute::Type m_Type
 

Friends

class ClassInfo
 
class SchemaInterface
 

Detailed Description

In objects of this class, the information for GlobalObjects is how a persistent class attribute is structured.

In order to be able to build objects from tables and tables from objects, we need these class information attributes.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ ClassInfoAttribute() [1/3]

glo::ClassInfoAttribute::ClassInfoAttribute ( )

Standard construktor.

◆ ClassInfoAttribute() [2/3]

glo::ClassInfoAttribute::ClassInfoAttribute ( const std::string & rsName,
const std::string & rsTableName,
const std::string & rsFieldName,
int iFieldPos,
const std::string & rsAttributeType,
const std::string & rsInfo )

Constructor with parameter passing.

Parameters
[in]rsNameThe attribute name.
[in]rsTableNameThe table name in which attributes of this class information attribute are stored.
[in]rsFieldNameThe table field name in which the attributes of this class information attribute are stored.
[in]iFieldPosThe column position in the table.
[in]rsAttributeTypeThe attribute type as string (see also SchemaTypeString).
[in]rsInfoThe info like a number for a string length or an expression like dependent etc. (see also EnDataTypeGroup).
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ClassInfoAttribute() [3/3]

glo::ClassInfoAttribute::ClassInfoAttribute ( const ClassInfoAttribute & rT)

Copy constructor.

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

◆ ~ClassInfoAttribute()

virtual glo::ClassInfoAttribute::~ClassInfoAttribute ( )
virtual

Destructor.

Member Function Documentation

◆ _DEBUG_ToString()

std::string glo::ClassInfoAttribute::_DEBUG_ToString ( )
Returns
The object content as string in debug mode.

◆ convertAttributeType()

void glo::ClassInfoAttribute::convertAttributeType ( const std::string & rsType,
const std::string & rsTypeInfo )
private

Sets the own type from the passed parameters.

Parameters
[in]rsTypeThe attribute type as string (see also SchemaTypeString).
[in]rsTypeInfoThe info like a number for a string length or a Expression like dependent etc.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.
Note
For Glo developers: Is implemented in GloRecordAttributeFunctions.cpp, so that extensions of data set attributes can be made there collectively.

◆ formatAnIndexString()

std::string glo::ClassInfoAttribute::formatAnIndexString ( const std::string & rsStringToBeFormatted,
const std::vector< eut::LanguageFunctions::EnLanguageKey > & rLanguageKeys,
bool bCaseSensitive,
void * pIndexAttributeItem ) const

Returns a formatted index string.

Parameters
[in]rsStringToBeFormattedThe string to format.
[in]rLanguageKeysThe language keys in a vector.
[in]bCaseSensitiveIf false, all characters in rsStringToBeFormatted are converted to uppercase.
[in]pIndexAttributeItemThe information which index is meant. Will casted in ClassInfoIndex::IndexAttributeItem.
Returns
The formatted index string.

◆ formatAnSearchIndexString()

std::string glo::ClassInfoAttribute::formatAnSearchIndexString ( const std::string & rsStringToBeFormatted,
const std::vector< eut::LanguageFunctions::EnLanguageKey > & rLanguageKeys,
bool bCaseSensitive,
void * pIndexAttributeItem ) const

Returns a formatted index string. The difference to the method ClassInfoAttribute::formatAnIndexString (...) is that in this method, the search string is not shortened if it is too long due to placeholders '*'.

Parameters
[in]rsStringToBeFormattedThe string to format.
[in]rLanguageKeysThe language keys in a vector.
[in]bCaseSensitiveIf false, all characters in rsStringToBeFormatted are converted to uppercase.
[in]pIndexAttributeItemThe information which index is meant. Will casted in ClassInfoIndex::IndexAttributeItem.
Returns
The formatted index string.

◆ formatAnyIndexString()

std::string glo::ClassInfoAttribute::formatAnyIndexString ( const std::string & rsStringToBeFormatted,
const std::vector< eut::LanguageFunctions::EnLanguageKey > & rLanguageKeys,
bool bCaseSensitive,
bool bIsSearchString,
void * pIndexAttributeItem ) const
private

Returns a formatted search index string.

Parameters
[in]rsStringToBeFormattedThe string to format.
[in]rLanguageKeysThe language keys in a vector.
[in]bCaseSensitiveIf false, all characters in rsStringToBeFormatted are converted to uppercase.
[in]bIsSearchStringIf set, the difference is that the search string is not truncated if it is too long due to placeholders '*'.
[in]pIndexAttributeItemThe information which index is meant. Is cast in ClassInfoIndex::IndexAttributeItem.
Returns
The formatted index string.

◆ getAttributeID()

AttributeID glo::ClassInfoAttribute::getAttributeID ( ) const
Returns
The attribute ID.
Die Attribut-ID.

◆ getClassAttributeName()

std::string glo::ClassInfoAttribute::getClassAttributeName ( ) const

Returns the attribute description with class name separated by a period. For example, "MyClass.m_MyAttributes".

Returns
The class and attribute name.

◆ getDataType()

EnDataType glo::ClassInfoAttribute::getDataType ( ) const
Returns
The attribute type as enum.

◆ getDataTypeInfo()

std::string glo::ClassInfoAttribute::getDataTypeInfo ( ) const
Returns
The type information.
See also
ClassInfoAttribute::Type::getTypeInfo(), EnDataTypeGroup.

◆ getDataTypesCount()

static unsigned int glo::ClassInfoAttribute::getDataTypesCount ( )
static

Returns the number of supported attribute types. Can be used to display all data types as string by passing values one by one to ClassInfoAttribute::getTypeAsString(EnDataType, bool).

Returns
The number of supported attribute types.

◆ getDataTypeSubType()

std::string glo::ClassInfoAttribute::getDataTypeSubType ( ) const
Returns
The possible subtype.
See also
ClassInfoAttribute::Type::getSubType()const

◆ getDataTypeSubTypeClassID()

unsigned long glo::ClassInfoAttribute::getDataTypeSubTypeClassID ( ) const
Returns
The possible subtype class ID.
See also
ClassInfoAttribute::Type::getSubTypeClassID().

◆ getDeveloperAccessControl()

std::string glo::ClassInfoAttribute::getDeveloperAccessControl ( ) const
Returns
The access control for the attribute.

◆ getFieldName()

std::string glo::ClassInfoAttribute::getFieldName ( ) const
Returns
The table field name.

◆ getFieldPos()

int glo::ClassInfoAttribute::getFieldPos ( ) const
Returns
The tables column position (start at 0).

◆ getFieldPosAsString()

std::string glo::ClassInfoAttribute::getFieldPosAsString ( ) const
Returns
The tables column position (start at 0) as string.

◆ getInfoType() [1/2]

EnDataTypeGroup glo::ClassInfoAttribute::getInfoType ( )
Returns
The group type of the supported attribute type.

◆ getInfoType() [2/2]

static EnDataTypeGroup glo::ClassInfoAttribute::getInfoType ( EnDataType eType)
static

Returns the group type of the passed attribute type.

Parameters
[in]eTypeThe attribute type
Returns
The group type.
Note
For Glo developers: Is implemented in GloRecordAttributeFunctions.cpp, so that extensions of record attributes can be made there collectively.

◆ getRecordAttributeLimits()

static int glo::ClassInfoAttribute::getRecordAttributeLimits ( const ClassInfoAttribute::Type & rDataType,
std::string & rsMin,
std::string & rsMax,
std::string & rsDataFieldSize )
static

Returns the limits of the passed class information attribute type.

Parameters
[in]rDataTypeThe RecordAttributeType.
[in,out]rsMinMinimum value of the attribute of the passed type.
[in,out]rsMaxMaximum value of the attribute of the transferred type.
[in,out]rsDataFieldSizeLength of the data field .
Returns
A return value < 0 indicates an error.
Note
For Glo developers: Is implemented in GloRecordAttributeFunctions.cpp, so that extensions of data set attributes can be made there collectively.

◆ getSignificantCharacter() [1/2]

int glo::ClassInfoAttribute::getSignificantCharacter ( ) const
Returns
The number of characters of the attribute.
See also
TypeDataLength.

◆ getSignificantCharacter() [2/2]

static int glo::ClassInfoAttribute::getSignificantCharacter ( EnDataType eDataType)
static

Returns the default length of the passed attribute type.

Parameters
[in]eDataTypeThe attribute type to be checked.
Returns
The default length.
Note
For Glo developers: Is implemented in GloRecordAttributeFunctions.cpp, so that extensions of record attributes can be made there collectively.
See also
TypeDataLength.

◆ getTableFieldName()

std::string glo::ClassInfoAttribute::getTableFieldName ( ) const

Returns the table name and table field name separated by a period. For example, "TableName.FieldName".

Returns
The table and field name.

◆ getTableName()

std::string glo::ClassInfoAttribute::getTableName ( ) const
Returns
The table name.

◆ getType()

ClassInfoAttribute::Type glo::ClassInfoAttribute::getType ( ) const
Returns
The summarized type information.

◆ getTypeAsCppString() [1/2]

std::string glo::ClassInfoAttribute::getTypeAsCppString ( ) const
Returns
The attribute type supported by GlobalObjects as it appears in the header and source file.
See also
CppTypeString.

◆ getTypeAsCppString() [2/2]

static std::string glo::ClassInfoAttribute::getTypeAsCppString ( EnDataType eType,
const std::string & rsSubType )
static

Returns the passed type attribute type in conjunction with the SubString as it appears in the header and source file.

Parameters
[in]eTypeThe attribute type
[in]rsSubTypeThe SubType.
Returns
The supported type attribute type.
Note
For Glo developers: Is implemented in GloRecordAttributeFunctions.cpp, so that extensions of record attributes can be made there collectively.
See also
CppTypeString.

◆ getTypeAsString() [1/2]

std::string glo::ClassInfoAttribute::getTypeAsString ( ) const

Returns the type of attribute supported by GlobalObjects as it appears in the schema.

Returns
The supported type attribute type.

◆ getTypeAsString() [2/2]

static std::string glo::ClassInfoAttribute::getTypeAsString ( EnDataType eType,
bool bSimple = true )
static

Returns the passed attribute type as a string as it appears in the schema.

Parameters
[in]eTypeThe attribute type
[in]bSimpleIf true, 'unsigned' numbers are returned without "unsigned".
Returns
The supported attribute type.
Note
For Glo developers: Is implemented in GloRecordAttributeFunctions.cpp, so that extensions of record attributes can be made there collectively.
See also
SchemaTypeString.

◆ getTypeFromString()

static EnDataType glo::ClassInfoAttribute::getTypeFromString ( const std::string & rsType)
static

Returns the passed attribute type.

Parameters
[in]rsTypeThe attribute type in a string (GLORA_SCHEMATYPESTRING).
Returns
The supported attribute type.
Note
For Glo developers: Is implemented in GloRecordAttributeFunctions.cpp, so that extensions of data set attributes can be made there collectively.

◆ isCrossreferenceType() [1/3]

bool glo::ClassInfoAttribute::isCrossreferenceType ( ) const

Returns true if the attribute is a reference that can be found in another database.

Returns
If true, it is a cross reference.

◆ isCrossreferenceType() [2/3]

bool glo::ClassInfoAttribute::isCrossreferenceType ( std::string & rsCrossRefFileName) const

Returns true if the attribute is a reference that can be found in another database, and the corresponding file name of the referenced object.

Parameters
[in,out]rsCrossRefFileNameIf the return value == true, the corresponding file name of the referenced object can be found here.
Returns
If true, it is a cross reference.
Note
The transfer parameter rsCrossRefFileName is only set if the return == true.

◆ isCrossreferenceType() [3/3]

bool glo::ClassInfoAttribute::isCrossreferenceType ( unsigned long & rulBaseID) const

Returns true if the attribute is a reference that can be found in another database, and the corresponding database ID.

Parameters
[in,out]rulBaseIDIf the return value == true, this is the corresponding database-id.
Returns
If true, it is a cross reference.
Note
The parameter rulBaseID is only set if the return == true.

◆ isNum() [1/2]

bool glo::ClassInfoAttribute::isNum ( ) const
Returns
True if the type is a number.

◆ isNum() [2/2]

static bool glo::ClassInfoAttribute::isNum ( EnDataType eDataType)
static

Checks if the passed attribute type is a number.

Parameters
[in]eDataTypeThe attribute type to be checked.
Returns
If true, the transferred attribute type is a number.
Note
For Glo developers: Is implemented in GloRecordAttributeFunctions.cpp, so that extensions of record attributes can be made there collectively.

◆ operator!=()

bool glo::ClassInfoAttribute::operator!= ( const ClassInfoAttribute & rT) const

Comparison operator, all attributes are compared.

Parameters
[in]rTThe object to be compared with this one.

◆ operator=()

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

Assignment operator.

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

◆ operator==()

bool glo::ClassInfoAttribute::operator== ( const ClassInfoAttribute & rT) const

Comparison operator, all attributes are compared.

Parameters
[in]rTThe object to be compared with this one.

◆ setDataType()

void glo::ClassInfoAttribute::setDataType ( EnDataType eType)

Sets the unique supported attribute type.

Parameters
[in]eTypeThe attribute type.

◆ setDataTypeInfo()

void glo::ClassInfoAttribute::setDataTypeInfo ( const std::string & rsInfo)

Sets the info like a number for a string length or an expression like dependent etc. See also GloClassInfoAttributes::Type::setTypeInfo() and EnDataTypeGroup.

Parameters
[in]rsInfoThe Info.

◆ setDataTypeSubType()

void glo::ClassInfoAttribute::setDataTypeSubType ( const std::string & rsSubType)

Sets a possible subtype.

Parameters
[in]rsSubTypeThe SubType.
See also
ClassInfoAttribute::Type::setSubType (...)

◆ setDataTypeSubTypeClassID()

void glo::ClassInfoAttribute::setDataTypeSubTypeClassID ( unsigned long ulSubTypeClassID)

Sets a possible subtype class ID.

Parameters
[in]ulSubTypeClassIDThe SubType class ID.
See also
ClassInfoAttribute::Type::setSubTypeClassID (...)

◆ setDeveloperAccessControl()

void glo::ClassInfoAttribute::setDeveloperAccessControl ( const std::string & rsAccessControl)

Sets the access control for the attribute.

Parameters
[in]rsAccessControlSets the access control for the attribute.

◆ setFieldName()

void glo::ClassInfoAttribute::setFieldName ( const std::string & rsName)

Sets the table field name in which attributes of this class information attribute are stored.

Parameters
[in]rsNameThe table field name.

◆ setFieldPos()

void glo::ClassInfoAttribute::setFieldPos ( int iFieldPos)

Sets the column position in the table.

Parameters
[in]iFieldPosThe column position.

◆ setTableName()

void glo::ClassInfoAttribute::setTableName ( const std::string & rsName)

Sets the table name in which attributes of this class information attribute are stored.

Parameters
[in]rsNameThe table name.

Friends And Related Symbol Documentation

◆ ClassInfo

friend class ClassInfo
friend

◆ SchemaInterface

friend class SchemaInterface
friend

Member Data Documentation

◆ m_iFieldPos

int glo::ClassInfoAttribute::m_iFieldPos
private

The the column position in the table (starting at 0) where the value of this class information attribute is stored.

◆ m_sDeveloperAccessControl

std::string glo::ClassInfoAttribute::m_sDeveloperAccessControl
private

The access control to assign the attributes to 'private', 'protected' or 'public' when generating the header files.
Is only set and evaluated by the schema interface if it is in developer mode.

Attention
Is NOT streamed into a blob or taken over from a blob.

◆ m_sFieldName

std::string glo::ClassInfoAttribute::m_sFieldName
private

The table field name in which the value of this class information attribute is stored.

◆ m_sTableName

std::string glo::ClassInfoAttribute::m_sTableName
private

The table name in which the value of this class information attribute is stored.

◆ m_Type

ClassInfoAttribute::Type glo::ClassInfoAttribute::m_Type
private

The summarized type information.


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