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

Abstract class for pointer and embeddet attributes of a Record. More...

#include <GloAPointerRecordAttribute.h>

Inheritance diagram for glo::APointerRecordAttribute:

Public Member Functions

 APointerRecordAttribute (ClassInfoAttribute *pType, const std::streampos &rFilePos)
 
 APointerRecordAttribute (ClassInfoAttribute *pType, ObjID Value, const std::streampos &rFilePos)
 
void getGeneric (GenericPersistent *&prRetVal)
 
void getGeneric (std::shared_ptr< GenericPersistent > &rRetVal)
 
int getReferencedRecord (Record *&prRetVal)
 
int getReferencedRecord (std::shared_ptr< Record > &rRetVal)
 
bool hasRecord () const
 
bool isGeneric () const
 
void setGeneric (GenericPersistent *pPersGeneric)
 
void setGeneric (std::shared_ptr< GenericPersistent > spPersGeneric)
 
void setReferencedRecord (Record *pRecord)
 
void setReferencedRecord (std::shared_ptr< Record > spRecord)
 
virtual void setValue (ObjID Value)
 
virtual void setValueFromVoid (void *pValue)
 
bool operator== (const APointerRecordAttribute &rT) const
 Comparison operator, all attributes are compared.
 
bool operator!= (const APointerRecordAttribute &rT) const
 Comparison operator, all attributes are compared.
 
- Public Member Functions inherited from glo::IDRecordAttribute
 IDRecordAttribute (ClassInfoAttribute *pType, const std::streampos &rFilePos)
 
 IDRecordAttribute (ClassInfoAttribute *pType, ObjID Value, const std::streampos &rFilePos)
 
virtual bool dataIsFieldContent () const
 
virtual unsigned short getDataFieldLength () const
 
virtual std::string getValueAsDataString () const
 
virtual std::string getValueAsDisplayString () const
 
virtual std::string getValueAsStreamString () const
 
virtual std::string getValueAsString () const
 
std::string getValueAsString (const ObjID &rValue) const
 
virtual void * getValueAsVoidPointer ()
 
const ObjIDgetValueRef () const
 
virtual void initNew ()
 
virtual int takeValue (const BaseRecordAttribute &rT)
 
bool operator== (const IDRecordAttribute &rT) const
 Comparison operator, all attributes are compared.
 
bool operator!= (const IDRecordAttribute &rT) const
 Comparison operator, all attributes are compared.
 
- Public Member Functions inherited from glo::BaseRecordAttribute
 BaseRecordAttribute (ClassInfoAttribute *pClassInfoAttribut, const std::streampos &rFilePos)
 
virtual ~BaseRecordAttribute ()
 
unsigned int forget ()
 
AttributeID getAttributeID () const
 
virtual int getAttributeValueBlob (eut::Blob &rBlob) const
 
ClassInfoAttributegetClassInfoAttribute () const
 
std::string getClassMemberName () const
 
std::string getClassName () const
 
virtual BaseRecordAttributegetCopy ()=0
 
virtual std::string getDataReference () const
 
EnDataType getDataType () const
 
std::string getFieldName () const
 
int getFieldPos ()
 
std::streampos getFilePosition () const
 
virtual int getFormattedFieldContents (std::string &rsRetVal, DATA_REFERENCE_INFO &rRetValInfo, ObjID ObjID)
 
EnDataTypeGroup getInfoType ()
 
unsigned int getReferenceCount () const
 
std::string getTableFieldName () const
 
std::string getTableName () const
 
ClassInfoAttribute::Type getType () const
 
std::string getTypeAsCppString () const
 
std::string getTypeAsString () const
 
std::string getTypeInfo () const
 
unsigned int remember ()
 
virtual void setDataReference (const std::string &rsDataReference)
 
void setFilePosition (const std::streampos &rFilePos)
 
virtual int setValueFromObjectAttributeID (Persistent &rObject, const AttributeID &rAttributeID)
 
virtual int updateDataReference (const std::string &rsDataPath, DATA_REFERENCE_INFO MethodInfo)
 
bool operator== (const BaseRecordAttribute &rT) const
 Comparison operator, all attributes are compared.
 
bool operator!= (const BaseRecordAttribute &rT) const
 Comparison operator, all attributes are compared.
 

Protected Member Functions

 APointerRecordAttribute ()
 
 APointerRecordAttribute (const APointerRecordAttribute &)
 
virtual ~APointerRecordAttribute ()
 
- Protected Member Functions inherited from glo::IDRecordAttribute
 IDRecordAttribute ()
 
 IDRecordAttribute (const IDRecordAttribute &rT)
 
virtual ~IDRecordAttribute ()
 
- Protected Member Functions inherited from glo::BaseRecordAttribute
 BaseRecordAttribute ()
 
 BaseRecordAttribute (const BaseRecordAttribute &rT)
 

Private Member Functions

APointerRecordAttributeoperator= (const APointerRecordAttribute &)
 
void setReferencedRecordDeep (Record *pRecord)
 

Private Attributes

GenericPersistentm_pGeneric
 
Recordm_pReferencedRecord
 

Detailed Description

Abstract class for pointer and embeddet attributes of a Record.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ APointerRecordAttribute() [1/4]

glo::APointerRecordAttribute::APointerRecordAttribute ( )
protected

The standard constructor is not available.

◆ ~APointerRecordAttribute()

virtual glo::APointerRecordAttribute::~APointerRecordAttribute ( )
protectedvirtual

The destructor is not available. The object may only be removed from memory using forget().

◆ APointerRecordAttribute() [2/4]

glo::APointerRecordAttribute::APointerRecordAttribute ( ClassInfoAttribute * pType,
const std::streampos & rFilePos )

Constructor with parameter passing.

Parameters
[in]pTypeA class information attribute is expected.
[in]rFilePosThe file position.
Exceptions
eut::ErrorNExceptionAn exception will be thrown if an error occurs.
Attention
Since objects of these classes are only instantiated by internal objects like Record and TableReaderInterface, and they know what they are doing, a type check of the class information attribute is omitted!

◆ APointerRecordAttribute() [3/4]

glo::APointerRecordAttribute::APointerRecordAttribute ( ClassInfoAttribute * pType,
ObjID Value,
const std::streampos & rFilePos )

Constructor with parameter passing.

Parameters
[in]pTypeA class information attribute is expected.
[in]ValueThe value of the attribute.
[in]rFilePosThe file position.
Exceptions
eut::ErrorNExceptionAn exception will be thrown if an error occurs.
Attention
Since objects of these classes are only instantiated by internal objects like Record and TableReaderInterface, and they know what they are doing, a type check of the class information attribute is omitted!

◆ APointerRecordAttribute() [4/4]

glo::APointerRecordAttribute::APointerRecordAttribute ( const APointerRecordAttribute & )
protected

The copy constructor is not available.

Member Function Documentation

◆ getGeneric() [1/2]

void glo::APointerRecordAttribute::getGeneric ( GenericPersistent *& prRetVal)

Returns the referenced generic object.

Parameters
[in,out]prRetValThe referenced generic object, if available.
Attention
The calling instance must 'forget' the returned object using GenericPersistent::forget().

◆ getGeneric() [2/2]

void glo::APointerRecordAttribute::getGeneric ( std::shared_ptr< GenericPersistent > & rRetVal)

Returns the referenced generic object.

Parameters
[in,out]rRetValThe referenced generic object in a std::shared_ptr, if available.

◆ getReferencedRecord() [1/2]

int glo::APointerRecordAttribute::getReferencedRecord ( Record *& prRetVal)

Returns the record of the referenced object.

Parameters
[in,out]prRetValThe record of the referenced object, if available.
Returns
A return value < 0 indicates an error.
Attention
The calling instance must remove the returned object from memory using Record::forget().

◆ getReferencedRecord() [2/2]

int glo::APointerRecordAttribute::getReferencedRecord ( std::shared_ptr< Record > & rRetVal)

Returns the record of the referenced object.

Parameters
[in,out]rRetValThe record of the referenced object in a std::shared_ptr, if available.
Returns
A return value < 0 indicates an error.

◆ hasRecord()

bool glo::APointerRecordAttribute::hasRecord ( ) const

Checks whether a Record is referenced in m_pReferencedRecord.

Returns
If true, a Record is referenced.

◆ isGeneric()

bool glo::APointerRecordAttribute::isGeneric ( ) const

Checks whether a GenericPersistent is referenced.

Returns
If true, a GenericPersistent is referenced.

◆ operator!=()

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

Comparison operator, all attributes are compared.

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

◆ operator=()

APointerRecordAttribute & glo::APointerRecordAttribute::operator= ( const APointerRecordAttribute & )
private

The assignment operator is not available.

◆ operator==()

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

Comparison operator, all attributes are compared.

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

◆ setGeneric() [1/2]

void glo::APointerRecordAttribute::setGeneric ( GenericPersistent * pPersGeneric)

Sets the referenced generic object.

Parameters
[in]pPersGenericSets the referenced generic object.

◆ setGeneric() [2/2]

void glo::APointerRecordAttribute::setGeneric ( std::shared_ptr< GenericPersistent > spPersGeneric)

Sets the referenced generic object.

Parameters
[in]spPersGenericSets the referenced generic object in a std::shared_ptr.

◆ setReferencedRecord() [1/2]

void glo::APointerRecordAttribute::setReferencedRecord ( Record * pRecord)

Sets the record of the referenced object.

Parameters
[in]pRecordThe record of the referenced object.

◆ setReferencedRecord() [2/2]

void glo::APointerRecordAttribute::setReferencedRecord ( std::shared_ptr< Record > spRecord)

Sets the record of the referenced object.

Parameters
[in]spRecordThe record of the referenced object in a std::shared_ptr.

◆ setReferencedRecordDeep()

void glo::APointerRecordAttribute::setReferencedRecordDeep ( Record * pRecord)
private

Creates a copy of the transferred record and inserts it into m_pReferencedRecord.

Parameters
[in]pRecordThe new record to be inserted is only used in the copy constructor.

◆ setValue()

virtual void glo::APointerRecordAttribute::setValue ( ObjID Value)
virtual

Sets the value of the attribute. Overwritten here to set a possibly set m_pGeneric to "NULL_PTR" when passing a NULL-ObjID.

Parameters
[in]ValueThe new value.

Reimplemented from glo::IDRecordAttribute.

◆ setValueFromVoid()

virtual void glo::APointerRecordAttribute::setValueFromVoid ( void * pValue)
virtual

Sets the value of the attribute. Is assigned via a static_cast. Overwritten here to set a possibly set m_pGeneric to NULL_PTR when passing a NULL-ObjID.

Parameters
[in]pValueThe raw pointer to the value.

Reimplemented from glo::IDRecordAttribute.

Member Data Documentation

◆ m_pGeneric

GenericPersistent* glo::APointerRecordAttribute::m_pGeneric
private

Is only set if the attribute is part of a generic object.
A referenced generic object is stored here so that it can be instantiated and be in GenPersObjectSpy. If only the record of the generic object were stored, the generic object would be lost.

◆ m_pReferencedRecord

Record* glo::APointerRecordAttribute::m_pReferencedRecord
private

In addition to the ObjID (in superclass) the record of the referenced object.


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