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

Objects of this class transport the data from the tables into the persistent object and from these again into the tables. More...

#include <GloRecord.h>

Classes

class  IndexStrNameTuple
 IndexStrNameTuples hold an index as a sortable string, its name and the class ID of the class being indexed (can be a superclass of the class with the record) and whether the index is unique. More...
 

Public Member Functions

 Record ()
 
 Record (const ObjID &rObjID)
 
 Record (const Record &rT, bool bDeepCopy=false)
 
std::string _DEBUG_ToString ()
 
bool allObjIDsHaveFilePos () const
 
void deleteAllAttributeData ()
 
void deleteAllIndexStrings ()
 
unsigned int forget ()
 
void getAllAttributes (std::list< BaseRecordAttribute * > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
 
void getAllAttributes (std::list< std::shared_ptr< BaseRecordAttribute > > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
 
void getAllAttributesSortByID (std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
void getAllAttributesSortByID (std::map< AttributeID, std::shared_ptr< BaseRecordAttribute >, std::less< AttributeID > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
void getAllAttributesSortByName (std::map< std::string, BaseRecordAttribute *, std::less< std::string > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
void getAllAttributesSortByName (std::map< std::string, std::shared_ptr< BaseRecordAttribute >, std::less< std::string > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
void getAllClassMemberNames (std::list< std::string > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
 
void getAllClassMemberNamesSortByID (std::map< AttributeID, std::string > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
 
std::vector< std::shared_ptr< Record::IndexStrNameTuple > > getAllIndexStrings () const
 
int getAttribute (BaseRecordAttribute *&prRetVal, EnSeekMode eMode)
 
int getAttribute (std::shared_ptr< BaseRecordAttribute > &rRetVal, EnSeekMode eMode)
 
int getAttributeByAttributeID (BaseRecordAttribute *&prRetVal, const AttributeID &rAttributeID) const
 
int getAttributeByAttributeID (std::shared_ptr< BaseRecordAttribute > &rRetVal, const AttributeID &rAttributeID) const
 
int getAttributeByClassMemberName (BaseRecordAttribute *&prRetVal, const std::string &sName) const
 
int getAttributeByClassMemberName (std::shared_ptr< BaseRecordAttribute > &rRetVal, const std::string &sName) const
 
int getAttributeByFieldName (BaseRecordAttribute *&prRetVal, const std::string &sName) const
 
int getAttributeByFieldName (std::shared_ptr< BaseRecordAttribute > &rRetVal, const std::string &sName) const
 
int getAttributeByTableFieldName (BaseRecordAttribute *&prRetVal, const std::string &sName) const
 
int getAttributeByTableFieldName (std::shared_ptr< BaseRecordAttribute > &rRetVal, const std::string &sName) const
 
int getAttributesFromTableSortByFieldPos (std::map< int, BaseRecordAttribute *, std::less< int > > &rRetValMap, const std::string &sName) const
 
unsigned long getClassID () const
 
ObjID getObjID () const
 
unsigned int getReferenceCount () const
 
int getTableObjIDAttribute (ObjIDRecordAttribute *&prRetVal, EnSeekMode eMode)
 
int getTableObjIDAttribute (std::shared_ptr< BaseRecordAttribute > &rRetVal, EnSeekMode eMode)
 
bool hasObjIDInMap () const
 
int initNew ()
 
int initNew (const std::map< unsigned long, ClassInfo * > &rClassInfoMap, unsigned long ulClassID, bool bWithSuperClassAttributes=true)
 
int initNew (const std::map< unsigned long, std::shared_ptr< glo::ClassInfo > > &rClassInfoMap, unsigned long ulClassID, bool bWithSuperClassAttributes=true)
 
int initNew (unsigned long ulClassID)
 
void insertInAllIndexStrings (const std::string &rsIndex, const std::string &rsIndexName, bool bUnique, unsigned long ulClassID)
 
Recordoperator= (const Record &rT)
 
unsigned int remember ()
 
void removeAndForgetAllBaseRecordAttributes ()
 
void removeAndForgetAllObjIDRecordAttributes ()
 
void removeGenericDanglingPointer ()
 
void setDeterminedFileNamesForAllAttributesWithThese ()
 
void setObjID (const ObjID &rObjID)
 
int takeOverAttribute (BaseRecordAttribute *pAttribute, bool bDeepCopy=false)
 
int takeOverObjIDsFilePos (const Record &rSourceRecord)
 
int takeOverRecord (const Record &rRecord, bool bDeepCopy=false)
 
int takeOverRecordData (const Record &rSourceRecord)
 

Static Public Attributes

static unsigned int sm_uiInstanceCount
 

Protected Member Functions

virtual ~Record ()
 
int acceptClassInfoAttributesToDataAttributes (const std::set< ClassInfoAttribute * > &rClassInfoAttributeSet, unsigned long ulClassID)
 
const std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > & AttributeMap () const
 
bool containedInAttributeSet (const BaseRecordAttribute &rPruefAttribut) const
 
bool containedInTableObjIDSet (const ObjIDRecordAttribute &rPruefAttribut) const
 
int getIndexString (std::string &rsRetValIndex, const SchemaInterface &rSchemaInterface, const ClassInfoIndex &rClassInfoIndex, const std::map< ObjID, Record *, std::less< ObjID > > &rIndexRecords) const
 
int getIndexString (std::string &rsRetValIndex, const std::vector< eut::LanguageFunctions::EnLanguageKey > &rLanguageKeys, bool bCaseSensitive, const SchemaInterface &rSchemaInterface, const ClassInfoIndex::IndexAttributeItem &rIndexAttributeItem, const std::map< ObjID, Record *, std::less< ObjID > > &rIndexRecords) const
 
void removeAllFilePos ()
 
const std::map< AttributeID, ObjIDRecordAttribute *, std::less< AttributeID > > & TableObjIDMap () const
 
int takeOverTableObjIDAttribute (ObjIDRecordAttribute *pObjIDAttribute, bool bDeepCopy=false)
 

Private Member Functions

void init ()
 

Private Attributes

std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > m_AttributeMap
 
std::map< AttributeID, BaseRecordAttribute * >::iterator m_AttributeMapIterator
 
bool m_bDeleteControl
 
std::vector< std::shared_ptr< Record::IndexStrNameTuple > > m_IndexStrNameTupleVector
 
eut::CriticalSection m_LocalCriticalSection
 
ObjID m_ObjID
 
std::map< AttributeID, ObjIDRecordAttribute *, std::less< AttributeID > > m_TableObjIDMap
 
std::map< AttributeID, ObjIDRecordAttribute * >::iterator m_TableObjIDMapIterator
 
unsigned int m_uiReferenceCount
 

Friends

class DataStreamer
 
class Manager
 
class TableReaderInterface
 
class TableWriterInterface
 

Detailed Description

Objects of this class transport the data from the tables into the persistent object and from these again into the tables.

Objects of this type have a reference counter and must not be removed from memory using the destructor.

Objects with a reference counter may only be instantiated once. When passing to another instance, the reference counter is incremented using Record::remember().

If the now owning instance no longer needs the object, the reference counter is decremented using Record::forget().

If the reference counter runs to 0, the destructor is called automatically.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ Record() [1/3]

glo::Record::Record ( )

Standard constructor.

◆ Record() [2/3]

glo::Record::Record ( const ObjID & rObjID)

Constructor with parameter passing.

Parameters
[in]rObjIDThe object ID.

◆ Record() [3/3]

glo::Record::Record ( const Record & rT,
bool bDeepCopy = false )

Copy constructor with additional parameter transfer.

Parameters
[in]rTThe object to be copied.
[in]bDeepCopyIf true, all record attributes are copied, otherwise the reference counter of the record attributes is incremented (default).

◆ ~Record()

virtual glo::Record::~Record ( )
protectedvirtual

Destructor, the memory is cleared.

Member Function Documentation

◆ _DEBUG_ToString()

std::string glo::Record::_DEBUG_ToString ( )

Returns the object content as string.

◆ acceptClassInfoAttributesToDataAttributes()

int glo::Record::acceptClassInfoAttributesToDataAttributes ( const std::set< ClassInfoAttribute * > & rClassInfoAttributeSet,
unsigned long ulClassID )
protected

Generates a record attribute for all passed class information attributes and transfers it to the record attribute list.

Parameters
[in]rClassInfoAttributeSetList of the data set attributes to be generated.
[in]ulClassIDThe class ID.
Returns
A return value < 0 indicates an error.

◆ allObjIDsHaveFilePos()

bool glo::Record::allObjIDsHaveFilePos ( ) const

Returns true if m_TableObjIDMap is not empty and all ObjIDs have a file position entered; otherwise false.

Returns
See above

◆ AttributeMap()

const std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > & glo::Record::AttributeMap ( ) const
protected

Returns the reference to the record attribute list (m_AttributeMap).

Returns
Reference to the list of record attributes, only lives as long as the returning object.

◆ containedInAttributeSet()

bool glo::Record::containedInAttributeSet ( const BaseRecordAttribute & rPruefAttribut) const
protected

Checks if a record attribute is present in the list of record attributes. The attribute ID (see also AttributeID) is compared.

Parameters
[in]rPruefAttributThe record attribute to be checked.
Returns
If true, the record attribute is present.
See also
m_AttributeMap

◆ containedInTableObjIDSet()

bool glo::Record::containedInTableObjIDSet ( const ObjIDRecordAttribute & rPruefAttribut) const
protected

Checks whether an object ID attribute is present in the list of object ID attributes. The attribute ID (see also AttributeID) is compared.

Parameters
[in]rPruefAttributThe object ID attribute to be checked.
Returns
If true, the object ID attribute is present.
See also
m_TableObjIDMap

◆ deleteAllAttributeData()

void glo::Record::deleteAllAttributeData ( )

Löscht alle Daten in seinen Datensatzattributen ausser CreateDate und LastChange. Die Liste der Objekt-ID-Attribute bleibt wie sie ist.

◆ deleteAllIndexStrings()

void glo::Record::deleteAllIndexStrings ( )

Deletes all index strings in m_IndexStrNameTupleVector.

◆ forget()

unsigned int glo::Record::forget ( )

An object of this class should always be delivered with a previous call to Record::remember(). The supplied instance must then 'forget' the object using this method.

Returns
The return value is the number of references to the object of this class.
Exceptions
eut::ErrorNExceptionAn exception is thrown if the reference counter wants to go into minus.

◆ getAllAttributes() [1/2]

void glo::Record::getAllAttributes ( std::list< BaseRecordAttribute * > & rRetValList,
const std::vector< unsigned long > * pClassIdVector = 0 ) const

Fills the passed list with all record attributes.

Parameters
[in,out]rRetValListList of the found record attributes.
[in]pClassIdVectorIf passed, only record attributes of the classes with the ClassID from this vector are returned.
Attention
The returned objects must be removed from memory using BaseRecordAttribute::forget()!

◆ getAllAttributes() [2/2]

void glo::Record::getAllAttributes ( std::list< std::shared_ptr< BaseRecordAttribute > > & rRetValList,
const std::vector< unsigned long > * pClassIdVector = 0 ) const

Fills the passed list with all record attributes in a std::shared_ptr.

Parameters
[in,out]rRetValListList of the found record attributes in a std::shared_ptr.
[in]pClassIdVectorIf passed, only record attributes of the classes with the ClassID from this vector are returned.

◆ getAllAttributesSortByID() [1/2]

void glo::Record::getAllAttributesSortByID ( std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > & rRetValMap,
const std::vector< unsigned long > * pClassIdVector = 0 ) const

Fills the passed map with all record attributes, sorted by the attribute ID stored in the corresponding class information attribute.

Parameters
[in,out]rRetValMapMap of the found record attributes.
[in]pClassIdVectorIf passed, only record attributes of the classes with the ClassID from this vector are returned.
Attention
The delivered objects must be removed from memory using BaseRecordAttribute::forget()!

◆ getAllAttributesSortByID() [2/2]

void glo::Record::getAllAttributesSortByID ( std::map< AttributeID, std::shared_ptr< BaseRecordAttribute >, std::less< AttributeID > > & rRetValMap,
const std::vector< unsigned long > * pClassIdVector = 0 ) const

Fills the passed map with all record attributes in a std::shared_ptr, sorted by the attribute ID stored in the corresponding class information attribute.

Parameters
[in,out]rRetValMapMap of the found record attributes in a std::shared_ptr.
[in]pClassIdVectorIf passed, only record attributes of the classes with the ClassID from this vector are returned.

◆ getAllAttributesSortByName() [1/2]

void glo::Record::getAllAttributesSortByName ( std::map< std::string, BaseRecordAttribute *, std::less< std::string > > & rRetValMap,
const std::vector< unsigned long > * pClassIdVector = 0 ) const

Fills the passed map with all record attributes, sorted by their full attribute name (e.g. "MyClass.m_MyAttribute").

Parameters
[in,out]rRetValMapMap of the found record attributes.
[in]pClassIdVectorIf passed, only record attributes of the classes with the ClassID from this vector are returned.
Attention
The returned objects must be removed from memory using BaseRecordAttribute::forget()!

◆ getAllAttributesSortByName() [2/2]

void glo::Record::getAllAttributesSortByName ( std::map< std::string, std::shared_ptr< BaseRecordAttribute >, std::less< std::string > > & rRetValMap,
const std::vector< unsigned long > * pClassIdVector = 0 ) const

Fills the passed map with all record attributes in a std::shared_ptr, sorted by their full attribute name (e.g. "MyClass.m_MyAttribute").

Parameters
[in,out]rRetValMapMap of the found record attributes in a std::shared_ptr.
[in]pClassIdVectorIf passed, only record attributes of the classes with the ClassID from this vector are returned.

◆ getAllClassMemberNames()

void glo::Record::getAllClassMemberNames ( std::list< std::string > & rRetValList,
const std::vector< unsigned long > * pClassIdVector = 0 ) const

Fills the passed string list with the complete attribute names of the record attributes.

Parameters
[in,out]rRetValListString list in which the complete attribute names are returned, e.g. "MyClass.m_MyAttribute". The list is cleared before.
[in]pClassIdVectorIf passed, only all complete attribute names of the classes with the ClassID from this vector are returned.

◆ getAllClassMemberNamesSortByID()

void glo::Record::getAllClassMemberNamesSortByID ( std::map< AttributeID, std::string > & rRetValMap,
const std::vector< unsigned long > * pClassIdVector = 0 ) const

Fills the passed string map (sorted by the attribute ID stored in the corresponding class information attribute) with the complete attribute names of the record attributes.

Parameters
[in,out]rRetValMapString map into which the complete attribute names are delivered, e.g. "MyClass.m_MyAttribute".
[in]pClassIdVectorIf passed, only all complete attribute names of the classes with the ClassID from this vector are returned.

◆ getAllIndexStrings()

std::vector< std::shared_ptr< Record::IndexStrNameTuple > > glo::Record::getAllIndexStrings ( ) const

Get all index strings from m_IndexStrNameTupleVector.

Returns
See above

◆ getAttribute() [1/2]

int glo::Record::getAttribute ( BaseRecordAttribute *& prRetVal,
EnSeekMode eMode )

Returns a record attribute related to eMode.

Parameters
[in,out]prRetValPointer to the found record attribute.
[in]eModeThe seek mode.

Parameter examples:

Returns
A return < 0 indicates an error. A return == ERR_RANGE indicates the end of the list of attributes.
Attention
The returned object must be removed from memory using BaseRecordAttribute::forget()!

◆ getAttribute() [2/2]

int glo::Record::getAttribute ( std::shared_ptr< BaseRecordAttribute > & rRetVal,
EnSeekMode eMode )

Returns a record attribute in a passed std::shared_ptr with respect to eMode.

Parameters
[in,out]rRetValReference to a std::shared_ptr in which the found record attribute is returned.
[in]eModeThe seek mode.

Parameter examples:

Returns
A return < 0 indicates an error. A return == ERR_RANGE indicates the end of the list of attributes.

◆ getAttributeByAttributeID() [1/2]

int glo::Record::getAttributeByAttributeID ( BaseRecordAttribute *& prRetVal,
const AttributeID & rAttributeID ) const

Returns the record attribute with a specific attribute ID stored in the corresponding class information attribute.

Parameters
[in,out]prRetValPointer to the found record attribute.
[in]rAttributeIDThe attribute ID.
Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates that nothing was found until the end of the list of record attributes.
Attention
The returned object must be removed from memory using BaseRecordAttribute::forget()!

◆ getAttributeByAttributeID() [2/2]

int glo::Record::getAttributeByAttributeID ( std::shared_ptr< BaseRecordAttribute > & rRetVal,
const AttributeID & rAttributeID ) const

Returns the record attribute in a passed std::shared_ptr with a specific attribute ID stored in the corresponding class information attribute.

Parameters
[in,out]rRetValReference to a std::shared_ptr in which the found record attribute is returned.
[in]rAttributeIDThe attribute ID.
Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates that nothing was found until the end of the list of record attributes.

◆ getAttributeByClassMemberName() [1/2]

int glo::Record::getAttributeByClassMemberName ( BaseRecordAttribute *& prRetVal,
const std::string & sName ) const

Returns the record attribute with a specific complete class attribute name (including the class name).

Parameters
[in,out]prRetValPointer to the found record attribute.
[in]sNameThe complete class attribute description of the searched record attribute (e.g., "MyClass.m_MyAttribute").
Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates that nothing was found until the end of the list of record attributes.
Attention
The returned object must be removed from memory using BaseRecordAttribute::forget()!

◆ getAttributeByClassMemberName() [2/2]

int glo::Record::getAttributeByClassMemberName ( std::shared_ptr< BaseRecordAttribute > & rRetVal,
const std::string & sName ) const

Returns the record attribute in a passed std::shared_ptr with a specific complete class attribute name (including the class name).

Parameters
[in,out]rRetValReference to a std::shared_ptr in which the found record attribute is returned.
[in]sNameThe complete class attribute description of the searched record attribute (e.g., "MyClass.m_MyAttribute").
Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates that nothing was found until the end of the list of record attributes.

◆ getAttributeByFieldName() [1/2]

int glo::Record::getAttributeByFieldName ( BaseRecordAttribute *& prRetVal,
const std::string & sName ) const

Returns the record attribute with a specific name.

Parameters
[in,out]prRetValPointer to the found record attribute.
[in]sNameThe name of the searched record attribute (e.g., "m_MyAttribute").
Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates that nothing was found until the end of the list of record attributes.
Attention
The returned object must be removed from memory using BaseRecordAttribute::forget()!

◆ getAttributeByFieldName() [2/2]

int glo::Record::getAttributeByFieldName ( std::shared_ptr< BaseRecordAttribute > & rRetVal,
const std::string & sName ) const

Returns the record attribute in a passed std::shared_ptr with a specific name.

Parameters
[in,out]rRetValReference to a std::shared_ptr into which the found record attribute is returned'.
[in]sNameThe name of the searched data record attribute (e.g. "m_MyAttribute").
Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates that nothing was found until the end of the list of attributes.

◆ getAttributeByTableFieldName() [1/2]

int glo::Record::getAttributeByTableFieldName ( BaseRecordAttribute *& prRetVal,
const std::string & sName ) const

Returns the record attribute which is stored in a table field with a specific name.

Parameters
[in,out]prRetValPointer to the found record attribute.
[in]sNameThe name of the table field (e.g.: "MyTable.MyTableFieldName").
Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates that nothing was found until the end of the list of record attributes.
Attention
The returned object must be removed from memory using BaseRecordAttribute::forget()!

◆ getAttributeByTableFieldName() [2/2]

int glo::Record::getAttributeByTableFieldName ( std::shared_ptr< BaseRecordAttribute > & rRetVal,
const std::string & sName ) const

Returns the record attribute in a passed std::shared_ptr, which is stored in a table field with a specific name.

Parameters
[in,out]rRetValReference to a std::shared_ptr in which the found record attribute is returned.
[in]sNameThe name of the table field (e.g.: "MyTable.MyTableFieldName").
Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates that nothing was found until the end of the list of record attributes.

◆ getAttributesFromTableSortByFieldPos()

int glo::Record::getAttributesFromTableSortByFieldPos ( std::map< int, BaseRecordAttribute *, std::less< int > > & rRetValMap,
const std::string & sName ) const

Fills the passed map with all record attributes stored in the table with the passed table name, sorted by field position.

Parameters
[in,out]rRetValMapMap of the found record attributes.
[in]sNameThe table name.
Returns
A return value < 0 indicates an error.
Attention
The returned objects must be removed from memory using BaseRecordAttribute::forget()!

◆ getClassID()

unsigned long glo::Record::getClassID ( ) const

Returns the class ID.

Returns
See above.

◆ getIndexString() [1/2]

int glo::Record::getIndexString ( std::string & rsRetValIndex,
const SchemaInterface & rSchemaInterface,
const ClassInfoIndex & rClassInfoIndex,
const std::map< ObjID, Record *, std::less< ObjID > > & rIndexRecords ) const
protected

Returns the index string as defined in the passed ClassInfoIndex.

Is used by the Manager to be able to consider the index when saving or deleting.

Parameters
[in,out]rsRetValIndexThe index string.
[in]rSchemaInterfaceThe scheme of the record.
[in]rClassInfoIndexThe class index.
[in]rIndexRecordsAll records that want to be stored and that may have attributes of the index.
Returns
A return value < 0 indicates an error.

◆ getIndexString() [2/2]

int glo::Record::getIndexString ( std::string & rsRetValIndex,
const std::vector< eut::LanguageFunctions::EnLanguageKey > & rLanguageKeys,
bool bCaseSensitive,
const SchemaInterface & rSchemaInterface,
const ClassInfoIndex::IndexAttributeItem & rIndexAttributeItem,
const std::map< ObjID, Record *, std::less< ObjID > > & rIndexRecords ) const
protected

Returns the index string of the passed ClassInfoIndex::IndexAttributeItem.

Parameters
[in,out]rsRetValIndexThe index string.
[in]rLanguageKeysThe language keys in a vector.
[in]bCaseSensitiveIf false, all characters in the rsRetValIndex are converted to upper case.
[in]rSchemaInterfaceThe schema of the record.
[in]rIndexAttributeItemThe information which index is meant.
[in]rIndexRecordsAll records that want to be stored and that may have attributes of the index.
Returns
A return value < 0 indicates an error.

◆ getObjID()

ObjID glo::Record::getObjID ( ) const

Returns the object ID.

Returns
See above.

◆ getReferenceCount()

unsigned int glo::Record::getReferenceCount ( ) const

Returns the number of referencing instances.

Returns
See above.

◆ getTableObjIDAttribute() [1/2]

int glo::Record::getTableObjIDAttribute ( ObjIDRecordAttribute *& prRetVal,
EnSeekMode eMode )

Returns an object ID attribute from the list of object ID attributes related to eMode.

Parameters
[in,out]prRetValThe pointer to an object ID attribute found.
[in]eModeThe seek mode.

Parameter examples:

Returns
A return < 0 indicates an error. A return == ERR_RANGE indicates the end of the list of object ID attributes.
Attention
The supplied object must be removed from memory using ObjIDRecordAttribute::forget()!

◆ getTableObjIDAttribute() [2/2]

int glo::Record::getTableObjIDAttribute ( std::shared_ptr< BaseRecordAttribute > & rRetVal,
EnSeekMode eMode )

Returns an object ID attribute in a passed std::shared_ptr from the list of object ID attributes related to eMode.

Parameters
[in,out]rRetValReference to a std::shared_ptr in which the found attribute is returned.
[in]eModeThe seek mode.

Parameter examples:

Returns
A return < 0 indicates an error. A return == ERR_RANGE indicates the end of the list of object IDs of the class and its superclasses.

◆ hasObjIDInMap()

bool glo::Record::hasObjIDInMap ( ) const

Returns false if m_TableObjIDMap is empty; otherwise true.

Returns
See above

◆ init()

void glo::Record::init ( )
private

The attributes are initialized.

◆ initNew() [1/4]

int glo::Record::initNew ( )

Reinitializes the record, all record attributes are discarded.

Returns
A return value < 0 indicates an error.

◆ initNew() [2/4]

int glo::Record::initNew ( const std::map< unsigned long, ClassInfo * > & rClassInfoMap,
unsigned long ulClassID,
bool bWithSuperClassAttributes = true )

Initializes a record with all record attributes from the passed class information list. The passed class ID is taken over.

Parameters
[in]rClassInfoMapThe list of class information.
[in]ulClassIDThe class ID to be transferred.
[in]bWithSuperClassAttributesIf false, the attributes of the superclasses are not (co)initialized.
Returns
A return value < 0 indicates an error.
Attention
The calling instance is responsible that the individual class information objects belong to the class whose class ID is passed.

◆ initNew() [3/4]

int glo::Record::initNew ( const std::map< unsigned long, std::shared_ptr< glo::ClassInfo > > & rClassInfoMap,
unsigned long ulClassID,
bool bWithSuperClassAttributes = true )

Initializes a record with all record attributes from the passed class information list. The passed class ID is taken over.

Parameters
[in]rClassInfoMapThe list of class information.
[in]ulClassIDThe class ID to be transferred.
[in]bWithSuperClassAttributesIf false, the attributes of the superclasses are not (co)initialized.
Returns
A return value < 0 indicates an error.
Attention
The calling instance is responsible that the individual class information objects belong to the class whose class ID is passed.

◆ initNew() [4/4]

int glo::Record::initNew ( unsigned long ulClassID)

Reinitializes the record, all record attributes are discarded, the passed class ID is used.

Parameters
[in]ulClassIDThe class ID to be transferred.
Returns
A return value < 0 indicates an error.

◆ insertInAllIndexStrings()

void glo::Record::insertInAllIndexStrings ( const std::string & rsIndex,
const std::string & rsIndexName,
bool bUnique,
unsigned long ulClassID )

Inserts the passed index as IndexStrNameTuple in m_IndexStrNameTupleVector or updates an existing entry.

Parameters
[in]rsIndexThe index (e.g., "MUELLER KARL-THEOD").
[in]rsIndexNameThe index name (e.g., "IDX_MyIndexName").
[in]bUniqueIf true, the composite index may only occur once.
[in]ulClassIDThe class ID of the class which is indexed.

◆ operator=()

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

Assignment operator.

Parameters
[in]rTThe object whose record and object ID attributes are to be taken over.
Attention
The attributes to be transferred are not copied, but the reference counter is incremented for the transferred attributes.

◆ remember()

unsigned int glo::Record::remember ( )

Increments the m_uiReferenceCount. Should always be called on 'delivery' of an object of this class. The delivered instance must then 'forget' the object again with Record::forget().

Returns
The return value is the number of references to the object of this class.

◆ removeAllFilePos()

void glo::Record::removeAllFilePos ( )
protected

The file position in the corresponding class information attribute is set to 0 in all record attributes. This is necessary, for example, if the record was deleted from the database.

◆ removeAndForgetAllBaseRecordAttributes()

void glo::Record::removeAndForgetAllBaseRecordAttributes ( )

Removes all record attributes from its list of record attributes and calls the method BaseRecordAttribute::forget() for each record attribute.

◆ removeAndForgetAllObjIDRecordAttributes()

void glo::Record::removeAndForgetAllObjIDRecordAttributes ( )

Removes all object ID attributes from its list of object ID attributes and calls the method BaseRecordAttribute::forget() for each object ID attribute.

◆ removeGenericDanglingPointer()

◆ setDeterminedFileNamesForAllAttributesWithThese()

void glo::Record::setDeterminedFileNamesForAllAttributesWithThese ( )

For all attributes from the m_AttributeMap that may need to be saved in a file, the method that sets this file name is called.

Note
This method is only processed if m_ObjID is valid.

◆ setObjID()

void glo::Record::setObjID ( const ObjID & rObjID)

Accepts the object ID, the class ID is not accepted. Transfers object ID without class ID also to the elements of the list of object ID attributes.

Parameters
[in]rObjIDThe object ID to be transferred.

◆ TableObjIDMap()

const std::map< AttributeID, ObjIDRecordAttribute *, std::less< AttributeID > > & glo::Record::TableObjIDMap ( ) const
protected

Returns the reference to the list of object ID attributes (m_TableObjIDMap).

Returns
Reference to the list of object ID attributes, lives only as long as the delivering object.

◆ takeOverAttribute()

int glo::Record::takeOverAttribute ( BaseRecordAttribute * pAttribute,
bool bDeepCopy = false )

Accepts the passed record attribute and increments its reference counter.

Parameters
[in]pAttributeThe class information attribute to be transferred.
[in]bDeepCopyIf true, the record attribute is copied and not only the reference counter is incremented!
Returns
A return value < 0 indicates an error.

◆ takeOverObjIDsFilePos()

int glo::Record::takeOverObjIDsFilePos ( const Record & rSourceRecord)

Transfers from the passed record only the file position of the object ID attributes (from their corresponding class information attribute) to the list of object ID attributes (m_TableObjIDMap).

Parameters
[in]rSourceRecordThe record whose values will be transferred.
Returns
A return value < 0 indicates an error.
Attention
Only works if the transferred record has the same ObjID as this record.

◆ takeOverRecord()

int glo::Record::takeOverRecord ( const Record & rRecord,
bool bDeepCopy = false )

Adopts all record attributes (except the object ID) of the transferred record.

Parameters
[in]rRecordThe record whose record attributes will be transferred.
[in]bDeepCopyIf true, all record attributes are copied, otherwise the reference counter of the record attributes is incremented (default).
Returns
A return value < 0 indicates an error.

◆ takeOverRecordData()

int glo::Record::takeOverRecordData ( const Record & rSourceRecord)

Copies the record attribute data of the passed record to its own record attributes if possible. An attempt is made to copy (also cast) all data record attributes with matching attribute IDs.

The ClassID must match.

Parameters
[in]rSourceRecordThe record whose record attribute data is to be copied.

◆ takeOverTableObjIDAttribute()

int glo::Record::takeOverTableObjIDAttribute ( ObjIDRecordAttribute * pObjIDAttribute,
bool bDeepCopy = false )
protected

Adopts the passed object ID attribute to its list of object ID attributes.

Parameters
[in]pObjIDAttributeThe object ID attribute to be transferred.
[in]bDeepCopyIf true, the object ID attribute is copied and not only the reference counter is incremented.
Returns
A return value < 0 indicates an error.

Friends And Related Symbol Documentation

◆ DataStreamer

friend class DataStreamer
friend

◆ Manager

friend class Manager
friend

◆ TableReaderInterface

friend class TableReaderInterface
friend

◆ TableWriterInterface

friend class TableWriterInterface
friend

Member Data Documentation

◆ m_AttributeMap

std::map< AttributeID, BaseRecordAttribute *, std::less<AttributeID> > glo::Record::m_AttributeMap
private

The record has attributes consisting of objects of the derived type BaseRecordAttribute. These are kept in this container.

This container also contains the attributes of the superclass/s.

◆ m_AttributeMapIterator

std::map<AttributeID,BaseRecordAttribute*>::iterator glo::Record::m_AttributeMapIterator
private

An internal iterator for the container of attributes.

◆ m_bDeleteControl

bool glo::Record::m_bDeleteControl
private

Is default true. Only set to false in Record::forget() if the reference counter == 0. An exception is thrown in the destructor if this value == true.

This is to ensure that this object is only removed from memory by Record::forget().

◆ m_IndexStrNameTupleVector

std::vector< std::shared_ptr< Record::IndexStrNameTuple > > glo::Record::m_IndexStrNameTupleVector
private

In order to be able to transport index strings once they have been determined, they are kept here after the determination.

◆ m_LocalCriticalSection

eut::CriticalSection glo::Record::m_LocalCriticalSection
private

To allow multiple threads to access Record::remember() and Record::::forget()

◆ m_ObjID

ObjID glo::Record::m_ObjID
private

A record has a unique object ID. This is used to find the data in the tables.

◆ m_TableObjIDMap

std::map< AttributeID, ObjIDRecordAttribute *, std::less<AttributeID> > glo::Record::m_TableObjIDMap
private

This container contains the object IDs of the class and its superclass/s.

◆ m_TableObjIDMapIterator

std::map<AttributeID,ObjIDRecordAttribute*>::iterator glo::Record::m_TableObjIDMapIterator
private

An internal iterator for the container of object IDs.

◆ m_uiReferenceCount

unsigned int glo::Record::m_uiReferenceCount
private

The reference counter.

◆ sm_uiInstanceCount

unsigned int glo::Record::sm_uiInstanceCount
static

For debug purposes, a static reference counter to check if all instances are cleared.


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