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

Class for the pointer list attributes of a Record. More...

#include <GloPoRefListRecordAttribute.h>

Inheritance diagram for glo::PoRefListRecordAttribute:

Public Member Functions

 PoRefListRecordAttribute (ClassInfoAttribute *pType, const std::list< ObjIDRecordTuple * > &rValueList, const std::streampos &rFilePos)
 
 PoRefListRecordAttribute (ClassInfoAttribute *pType, const std::streampos &rFilePos)
 
virtual void clearGenericList ()
 
virtual void clearValueList ()
 
virtual void clearValueLot ()
 
virtual BaseRecordAttributegetCopy ()
 
const std::list< GenericPersistent * > & getGenericListRef () const
 
virtual std::string getValueAsStreamString () const
 
virtual void * getValueAsVoidPointer ()
 
const std::list< ObjIDRecordTuple * > & getValueRef () const
 
virtual std::size_t getValueSize () const
 
bool hasRecords () const
 
void insert (const std::list< ObjIDRecordTuple * >::const_iterator &rIter, const ObjIDRecordTuple &rObjIDRecordTuple)
 
bool isGeneric () const
 
void push_back (const ObjIDRecordTuple &rObjIDRecordTuple)
 
void push_front (const ObjIDRecordTuple &rObjIDRecordTuple)
 
void setGenericList (const std::list< GenericPersistent * > &rPersGenericList)
 
void setValue (const std::list< ObjIDRecordTuple * > &rValueList)
 
virtual int setValueFromObjectAttributeID (Persistent &rObject, const AttributeID &rAttributeID)
 
virtual int setValueFromObjectAttributeID (Persistent &rObject, const AttributeID &rAttributeID, bool bWithRefRecords)
 
virtual void setValueFromVoid (void *pValueList)
 
virtual int takeValue (const BaseRecordAttribute &rT)
 
- Public Member Functions inherited from glo::LotRecordAttribute
 LotRecordAttribute (ClassInfoAttribute *pType, const std::streampos &rFilePos)
 
virtual bool dataIsFieldContent () const
 
virtual int getAttributeValueBlob (eut::Blob &rBlob) const
 
virtual unsigned short getDataFieldLength () const
 
virtual std::string getDataReference () const
 
const std::string & getFileName () const
 
virtual int getFormattedFieldContents (std::string &rsRetVal, DATA_REFERENCE_INFO &rRetValInfo, ObjID ObjID)
 
virtual std::string getValueAsDataString () const
 
virtual std::string getValueAsDisplayString () const
 
virtual std::string getValueAsString () const
 
virtual void initNew ()
 
void setDeterminedFileNameFromAttributeValue (ObjID ObjID)
 
void setFileName (const std::string &rsFileName)
 
virtual int updateDataReference (const std::string &rsDataPath, DATA_REFERENCE_INFO MethodInfo)
 
bool operator== (const LotRecordAttribute &rT) const
 Comparison operator.
 
bool operator!= (const LotRecordAttribute &rT) const
 Comparison operator.
 
- Public Member Functions inherited from glo::BaseRecordAttribute
 BaseRecordAttribute (ClassInfoAttribute *pClassInfoAttribut, const std::streampos &rFilePos)
 
virtual ~BaseRecordAttribute ()
 
unsigned int forget ()
 
AttributeID getAttributeID () const
 
ClassInfoAttributegetClassInfoAttribute () const
 
std::string getClassMemberName () const
 
std::string getClassName () const
 
EnDataType getDataType () const
 
std::string getFieldName () const
 
int getFieldPos ()
 
std::streampos getFilePosition () const
 
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)
 
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

 PoRefListRecordAttribute ()
 
 PoRefListRecordAttribute (const PoRefListRecordAttribute &rT)
 
virtual ~PoRefListRecordAttribute ()
 
virtual void streamValueListInFileStream (std::ofstream &rFileStream)
 
bool operator== (const PoRefListRecordAttribute &rT) const
 Comparison operator.
 
bool operator!= (const PoRefListRecordAttribute &rT) const
 Comparison operator.
 
- Protected Member Functions inherited from glo::LotRecordAttribute
 LotRecordAttribute ()
 
 LotRecordAttribute (const LotRecordAttribute &rT)
 
virtual ~LotRecordAttribute ()
 
- Protected Member Functions inherited from glo::BaseRecordAttribute
 BaseRecordAttribute ()
 
 BaseRecordAttribute (const BaseRecordAttribute &rT)
 

Private Member Functions

PoRefListRecordAttributeoperator= (const PoRefListRecordAttribute &)
 

Private Attributes

std::list< GenericPersistent * > m_GenericList
 
std::list< ObjIDRecordTuple * > m_ValueList
 

Additional Inherited Members

- Protected Attributes inherited from glo::LotRecordAttribute
std::string m_sFileName
 

Detailed Description

Class for the pointer list attributes of a Record.

Represents an attribute of the type TPointerList<MyPersClass> and MyPersClass is a persistent object.

The objects in the list are usually loaded along with the owning object.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ PoRefListRecordAttribute() [1/4]

glo::PoRefListRecordAttribute::PoRefListRecordAttribute ( )
protected

The standard constructor is not available.

◆ ~PoRefListRecordAttribute()

virtual glo::PoRefListRecordAttribute::~PoRefListRecordAttribute ( )
protectedvirtual

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

◆ PoRefListRecordAttribute() [2/4]

glo::PoRefListRecordAttribute::PoRefListRecordAttribute ( 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!

◆ PoRefListRecordAttribute() [3/4]

glo::PoRefListRecordAttribute::PoRefListRecordAttribute ( ClassInfoAttribute * pType,
const std::list< ObjIDRecordTuple * > & rValueList,
const std::streampos & rFilePos )

Constructor with parameter passing.

Parameters
[in]pTypeA class information attribute is expected.
[in]rValueListThe list of referenced objects 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!

◆ PoRefListRecordAttribute() [4/4]

glo::PoRefListRecordAttribute::PoRefListRecordAttribute ( const PoRefListRecordAttribute & rT)
protected

Copy constructor.

Parameters
[in]rTThe data is copied from this object.
See also
getCopy()

Member Function Documentation

◆ clearGenericList()

virtual void glo::PoRefListRecordAttribute::clearGenericList ( )
virtual

The list of generic objects is cleaned up (emptied and the objects are removed from the memory).

◆ clearValueList()

virtual void glo::PoRefListRecordAttribute::clearValueList ( )
virtual

The list of referenced objects is cleaned up (emptied and the objects are removed from the memory).

◆ clearValueLot()

virtual void glo::PoRefListRecordAttribute::clearValueLot ( )
virtual

The list of referenced objects and, if available, the list of generic objects are cleaned up (emptied and the objects are removed from memory).

Implements glo::LotRecordAttribute.

◆ getCopy()

virtual BaseRecordAttribute * glo::PoRefListRecordAttribute::getCopy ( )
virtual

Returns a copy of the object. Sometimes a copy of an attribute is needed, e.g. if a deep-copied record (with copied attributes) is needed.

Returns
The copy of this attribute
Attention
The supplied object must be removed from memory by the calling instance.

Implements glo::BaseRecordAttribute.

◆ getGenericListRef()

const std::list< GenericPersistent * > & glo::PoRefListRecordAttribute::getGenericListRef ( ) const

Returns a reference to the list of generic objects.

Returns
The reference to the list of generic objects.

◆ getValueAsStreamString()

virtual std::string glo::PoRefListRecordAttribute::getValueAsStreamString ( ) const
virtual

Returns the value as string for the DataStreamer.

Returns
The value for the DataStreamer.

Reimplemented from glo::LotRecordAttribute.

◆ getValueAsVoidPointer()

virtual void * glo::PoRefListRecordAttribute::getValueAsVoidPointer ( )
virtual

Returns a raw pointer to the value.

Returns
The raw pointer to the value.

Implements glo::BaseRecordAttribute.

◆ getValueRef()

const std::list< ObjIDRecordTuple * > & glo::PoRefListRecordAttribute::getValueRef ( ) const

Returns a reference to m_ValueList.

Returns
The reference to the list of referenced objects.

◆ getValueSize()

virtual std::size_t glo::PoRefListRecordAttribute::getValueSize ( ) const
virtual

Returns the number of objects in the list of referenced objects.

Returns
The number.

Implements glo::LotRecordAttribute.

◆ hasRecords()

bool glo::PoRefListRecordAttribute::hasRecords ( ) const

Checks whether a Record is referenced from the first ObjIDRecordTuple in m_ValueList.

Returns
If true, a Record is referenced.

◆ insert()

void glo::PoRefListRecordAttribute::insert ( const std::list< ObjIDRecordTuple * >::const_iterator & rIter,
const ObjIDRecordTuple & rObjIDRecordTuple )

Inserts the passed ObjIDRecordTuple in m_ValueList at the position of the passed iterator.

Parameters
[in]rIterThe Iterator.
[in]rObjIDRecordTupleThe ObjIDRecordTuple to be inserted.

◆ isGeneric()

bool glo::PoRefListRecordAttribute::isGeneric ( ) const

Checks whether a GenericPersistent is referenced in m_GenericList.

Returns
If true, a GenericPersistent is referenced.

◆ operator!=()

bool glo::PoRefListRecordAttribute::operator!= ( const PoRefListRecordAttribute & rT) const
protected

Comparison operator.

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

◆ operator=()

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

The assignment operator is not available.

◆ operator==()

bool glo::PoRefListRecordAttribute::operator== ( const PoRefListRecordAttribute & rT) const
protected

Comparison operator.

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

◆ push_back()

void glo::PoRefListRecordAttribute::push_back ( const ObjIDRecordTuple & rObjIDRecordTuple)

Inserts passed ObjIDRecordTuple in m_ValueList at the end.

Parameters
[in]rObjIDRecordTupleThe ObjIDRecordTuple to be inserted.

◆ push_front()

void glo::PoRefListRecordAttribute::push_front ( const ObjIDRecordTuple & rObjIDRecordTuple)

Inserts passed ObjIDRecordTuple in m_ValueList at the beginning.

Parameters
[in]rObjIDRecordTupleThe ObjIDRecordTuple to be inserted.

◆ setGenericList()

void glo::PoRefListRecordAttribute::setGenericList ( const std::list< GenericPersistent * > & rPersGenericList)

Sets the list of generic objects with objects from passed list. The own list is deleted first.

Parameters
[in]rPersGenericListThe list of referenced generic objects.

◆ setValue()

void glo::PoRefListRecordAttribute::setValue ( const std::list< ObjIDRecordTuple * > & rValueList)

Copies the objects of the transferred list to its own list of referenced objects. The own list is deleted first.

Parameters
[in]rValueListThe list of referenced objects.

◆ setValueFromObjectAttributeID() [1/2]

virtual int glo::PoRefListRecordAttribute::setValueFromObjectAttributeID ( Persistent & rObject,
const AttributeID & rAttributeID )
virtual

The value of the RecordAttribut from the class attribute of the passed Persistent is determined and set based on the passed AttributeID.

Parameters
[in]rObjectThe persistent object whose attribute is used.
[in]rAttributeIDThe ID of the attribute of the passed object.
Returns
A return value < 0 indicates an error.
Exceptions
eut::ErrorNExceptionAn exception is thrown in case of a fatal error, e.g. if rObject does not have the attribute.

Reimplemented from glo::BaseRecordAttribute.

◆ setValueFromObjectAttributeID() [2/2]

virtual int glo::PoRefListRecordAttribute::setValueFromObjectAttributeID ( Persistent & rObject,
const AttributeID & rAttributeID,
bool bWithRefRecords )
virtual

The value of the RecordAttribut from the class attribute of the passed Persistent is determined and set based on the passed AttributeID.

Parameters
[in]rObjectThe persistent object whose attribute is used.
[in]rAttributeIDThe ID of the attribute of the passed object.
[in]bWithRefRecordsIf true and a valid object is referenced, the respective record is generated and referenced.
Returns
A return value < 0 indicates an error.
Exceptions
eut::ErrorNExceptionAn exception is thrown in case of a fatal error, e.g. if rObject does not have the attribute.

◆ setValueFromVoid()

virtual void glo::PoRefListRecordAttribute::setValueFromVoid ( void * pValueList)
virtual

Copies the objects of the transferred list to its own list of referenced objects. The own list is deleted first.

This is guaranteed by a static_cast.

Parameters
[in]pValueListThe raw pointer to the list of referenced objects.

Implements glo::BaseRecordAttribute.

◆ streamValueListInFileStream()

virtual void glo::PoRefListRecordAttribute::streamValueListInFileStream ( std::ofstream & rFileStream)
protectedvirtual

Transfers the contents of the element container for LotRecordAttribute::updateDataReference (...) in a suitable form in the file stream passed.

Parameters
[in,out]rFileStreamThe filestream.
Note
Passed filestream must be valid and open for writing.
Exceptions
eut::ErrorNExceptionAn exception is thrown if parameter rFileStream is invalid or not open for writing.

Implements glo::LotRecordAttribute.

◆ takeValue()

virtual int glo::PoRefListRecordAttribute::takeValue ( const BaseRecordAttribute & rT)
virtual

Adopts the value from transferred attribute, if possible. An attempt is made to cast the value in some way.

Parameters
[in]rTThe persistent attribute from which the values are to be taken.
Returns
An error or warning message from subclasses will be delivered if the cast does not work.

Reimplemented from glo::BaseRecordAttribute.

Member Data Documentation

◆ m_GenericList

std::list<GenericPersistent *> glo::PoRefListRecordAttribute::m_GenericList
private

The list of referenced generic objects. Is only set if part of a generic object.

◆ m_ValueList

std::list<ObjIDRecordTuple *> glo::PoRefListRecordAttribute::m_ValueList
private

The value of the attribute. The list of referenced objects using object ObjIDRecordTuple's.


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