Information for the index about which attribute from which class, with how many characters, belongs to the index.
More...
#include <GloClassInfoIndex.h>
Information for the index about which attribute from which class, with how many characters, belongs to the index.
- Copyright
- © 2010 Helmut Jakoby
- Author
- Helmut Jakoby
◆ IndexAttributeItem() [1/4]
glo::ClassInfoIndex::IndexAttributeItem::IndexAttributeItem |
( |
| ) |
|
|
private |
The default constructor is not available.
◆ IndexAttributeItem() [2/4]
glo::ClassInfoIndex::IndexAttributeItem::IndexAttributeItem |
( |
const std::vector< AttributeID > & | rIndexPathVector, |
|
|
int | iSignificantCharacter, |
|
|
bool | bIsNum ) |
Constructor with parameter passing.
- Parameters
-
[in] | rIndexPathVector | The path to the index. See also m_IndexPathVector. |
[in] | iSignificantCharacter | The number of characters used for the index. If 0, all characters are significant. |
[in] | bIsNum | If true, the index is considered a number (spaces are inserted at the beginning if necessary). If false, the index is a string (Spaces are appended to the end of the index). |
◆ IndexAttributeItem() [3/4]
glo::ClassInfoIndex::IndexAttributeItem::IndexAttributeItem |
( |
const std::string & | rsIndexPath, |
|
|
int | iSignificantCharacter, |
|
|
bool | bIsNum ) |
Constructor with parameter passing.
- Parameters
-
[in] | rsIndexPath | The path to the index as string, where the individual AttributeID's are separated by a dot.
E.g.: if the delivered string looks like this: "4.34.6.2.5.5" this means that the index path consists of three AttributeID's -> '4.34', '6.2' and '5.5'. the first digit is the class ID and the second digit the unique position. |
[in] | iSignificantCharacter | The number of characters used for the index. If 0, all characters are significant. |
[in] | bIsNum | If true, the index is considered a number (spaces are inserted at the beginning if necessary). If false, the index is a string (Spaces are appended to the end of the index). |
◆ IndexAttributeItem() [4/4]
glo::ClassInfoIndex::IndexAttributeItem::IndexAttributeItem |
( |
const IndexAttributeItem & | rT | ) |
|
Copy constructor.
- Parameters
-
[in] | rT | The data is copied from this object. |
◆ ~IndexAttributeItem()
virtual glo::ClassInfoIndex::IndexAttributeItem::~IndexAttributeItem |
( |
| ) |
|
|
virtual |
◆ adjustAttributeTypeIfExisting()
Checks if passed AttributeID is included in the m_IndexPathVector.
If contained as path to the actual index attribute, the type may only be ClassInfoAttribute::eEMBEDDED and ClassInfoAttribute::ePOINTER.
If contained as the actual index attribute, ClassInfoIndex::IndexAttributeItem::m_iSignificantCharacter (will only be shortened if necessary, otherwise left as it is) and ClassInfoIndex::IndexAttributeItem::m_bIsNum may be adapted to the new type or, if not suitable as an index attribute, removed from the index.
- Parameters
-
[in] | rAttributeID | The AttributeID for whose corresponding attribute a type change was made. |
[in] | eNewType | The new type of the attribute. |
[in] | pSchemaInterface | The SchemaInterface is used to check attributes. |
- Returns
- If 1, the index entry could be adjusted.
If 0, passed AttributeID is not included in m_IndexPathVector or nothing was done (e.g. eNewType was already).
A value < 0 indicates an error or an adjustment is not possible.
◆ changeAtributeIdIfExisting()
bool glo::ClassInfoIndex::IndexAttributeItem::changeAtributeIdIfExisting |
( |
const AttributeID & | rExistingAttributeID, |
|
|
const AttributeID & | rNewAttributeID ) |
Checks if the first passed AttributeID is contained in the m_IndexPathVector and changes it to the second passed AttributeID.
If e.g. the position of an atrtribute in a ClassInfo has changed, the AttributeID::m_ulFieldPos in the AttributeID changes. To ensure that an index attribute points to the correct attribute, all entries in the m_IndexPathVector are checked here and adjusted if necessary.
- Parameters
-
[in] | rExistingAttributeID | The AttributeID to be changed. |
[in] | rNewAttributeID | The AttributeID with the values to be adopted. |
- Returns
- If true, a AttributeID with values of rExistingAttributeID exists in the m_IndexPathVector and has been changed to the values of rNewAttributeID.
- Note
- If rExistingAttributeID and rNewAttributeID are equal, no action is taken and false is returned.
◆ eraseAttributeIdIfExisting()
int glo::ClassInfoIndex::IndexAttributeItem::eraseAttributeIdIfExisting |
( |
const AttributeID & | rAttributeID | ) |
|
◆ getAttributeIdPositionInIndex()
long glo::ClassInfoIndex::IndexAttributeItem::getAttributeIdPositionInIndex |
( |
const AttributeID & | rAttributeID | ) |
const |
◆ getIndexPath()
std::vector< AttributeID > glo::ClassInfoIndex::IndexAttributeItem::getIndexPath |
( |
| ) |
const |
◆ getIndexPathAsIdString()
std::string glo::ClassInfoIndex::IndexAttributeItem::getIndexPathAsIdString |
( |
| ) |
const |
Returns the index path from m_IndexPathVector as a string, with the individual AttributeID's separated by a dot.
E.g.: if the delivered string looks like this: "4.34.6.2.5.5" this means that the index path consists of three AttributeID's -> '4.34', '6.2' and '5.5'. the first digit is the class ID and the second digit the unique position.
- Returns
- The IndexPath as string.
- See also
- AttributeID
◆ getIndexPathAsNameString()
std::string glo::ClassInfoIndex::IndexAttributeItem::getIndexPathAsNameString |
( |
const SchemaInterface & | rSchemaInterface | ) |
const |
Returns the index path from m_IndexPathVector as a string with the individual class and attribute names separated by a dot.
- Parameters
-
[in] | rSchemaInterface | The SchemaInterface is used to get the names of the index attributes. |
- Returns
- The IndexPath as string.
◆ getIndexPathSize()
std::size_t glo::ClassInfoIndex::IndexAttributeItem::getIndexPathSize |
( |
| ) |
const |
◆ getIsNum()
bool glo::ClassInfoIndex::IndexAttributeItem::getIsNum |
( |
| ) |
const |
Returns whether the index is numeric or not. If true, the index is considered as a number (spaces are inserted at the beginning if necessary). If false, the index is treated as a string (blanks are appended to the end if necessary).
- Returns
- See description.
◆ getLastIndexClassInfoAttribute()
AttributeID glo::ClassInfoIndex::IndexAttributeItem::getLastIndexClassInfoAttribute |
( |
| ) |
const |
◆ getSignificantCharacter()
int glo::ClassInfoIndex::IndexAttributeItem::getSignificantCharacter |
( |
| ) |
const |
Returns the number of characters used for the index. If 0, all characters are significant.
- Returns
- The number of characters used for the index.
◆ isInIndexPath()
bool glo::ClassInfoIndex::IndexAttributeItem::isInIndexPath |
( |
const AttributeID & | rAttributeID | ) |
const |
◆ operator!=()
Comparison operator, all attributes are compared.
- Parameters
-
[in] | rT | The object to be compared with this one. |
◆ operator=()
Assignment operator.
- Parameters
-
[in] | rT | The data is transferred from this object. |
◆ operator==()
Comparison operator, all attributes are compared.
- Parameters
-
[in] | rT | The object to be compared with this one. |
◆ setIndexPath() [1/2]
void glo::ClassInfoIndex::IndexAttributeItem::setIndexPath |
( |
const std::string & | rsIndexPath | ) |
|
Sets the index path in m_IndexPathVector from passed string, where the individual AttributeID's are separated by a dot.
E.g.: if the delivered string looks like this: "4.34.6.2.5.5" this means that the index path consists of three AttributeID's -> '4.34', '6.2' and '5.5'. the first digit is the class ID and the second digit the unique position.
- Parameters
-
[in] | rsIndexPath | The index path. |
◆ setIndexPath() [2/2]
void glo::ClassInfoIndex::IndexAttributeItem::setIndexPath |
( |
const std::vector< AttributeID > & | rIndexPathVector | ) |
|
Sets the index path in m_IndexPathVector.
- Parameters
-
[in] | rIndexPathVector | The index path. |
◆ setIsNum()
void glo::ClassInfoIndex::IndexAttributeItem::setIsNum |
( |
bool | bIsNum | ) |
|
Marks the index as numeric or not. If true, the index is considered as a number (spaces are inserted at the beginning if necessary). If false, the index is treated as a string (blanks are appended to the end if necessary).
- Parameters
-
[in] | bIsNum | See description. |
◆ setSignificantCharacter()
void glo::ClassInfoIndex::IndexAttributeItem::setSignificantCharacter |
( |
int | iSignificantCharacter | ) |
|
Setzt Anzahl der Zeichen welche für den Index genutzt werden. Wenn 0, sind alle Zeichen signifikant.
- Parameters
-
[in] | iSignificantCharacter | Die Anzahl der Zeichen welche für den Index genutzt werden. |
◆ m_bIsNum
bool glo::ClassInfoIndex::IndexAttributeItem::m_bIsNum |
|
private |
If true, the index is considered a number (spaces are inserted at the beginning if necessary). If false, the index is treated as a string (Spaces are appended to the end if necessary).
◆ m_iInstanzInfo
int glo::ClassInfoIndex::IndexAttributeItem::m_iInstanzInfo |
|
private |
For debugging purposes, a value != 0 can be written in here when instantiating.
A breakpoint must be set in the ctor's and dtor for the assignment "XXX".
m_iInstanzInfo is queried in the dtor and stopped at the breakpoint at "iXXX" when != 1.
What's the point of all this? For example, if several objects of this class are instantiated and only a part is removed from memory.
If you know the location where the particular object that creates a memory leak is instantiated, a breakpoint can be set there. In the ctor of the object of this class, m_iInstanzInfo is assigned a unique value. By querying the dtor you can now determine which object is not removed from memory.
◆ m_IndexPathVector
std::vector< AttributeID > glo::ClassInfoIndex::IndexAttributeItem::m_IndexPathVector |
|
private |
An index path is always structured as follows: "Class name.attribute name".
The class name must always be that of the class or superclass of the object to be indexed. The attribute name is the attribute which is used in the index.
Since a class can have an embedded class as an attribute, the attributes of the embedded classes can be used for indexing.
Such an index is always structured as follows: "Class name.attribute name.2_Class name.2_Attribute name[20]".
In this vector, the index path is realized by the contained objects of type AttributeID.
- See also
- AttributeID
◆ m_iSignificantCharacter
int glo::ClassInfoIndex::IndexAttributeItem::m_iSignificantCharacter |
|
private |
The number of characters used for the index. If 0, all characters are significant.
The documentation for this class was generated from the following file: