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

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

#include <GloPoRefSetRecordAttribute.h>

Inheritance diagram for glo::PoRefSetRecordAttribute:

Public Member Functions

 PoRefSetRecordAttribute (ClassInfoAttribute *pType, const std::set< ObjIDRecordTuple * > &rValueSet, const std::streampos &rFilePos)
 
 PoRefSetRecordAttribute (ClassInfoAttribute *pType, const std::streampos &rFilePos)
 
virtual void clearGenericSet ()
 
virtual void clearValueLot ()
 
virtual void clearValueSet ()
 
virtual BaseRecordAttributegetCopy ()
 
const std::set< GenericPersistent * > & getGenericSetRef () const
 
virtual std::string getValueAsStreamString () const
 
virtual void * getValueAsVoidPointer ()
 
const std::set< ObjIDRecordTuple * > & getValueRef () const
 
virtual std::size_t getValueSize () const
 
bool hasRecords () const
 
void insert (const ObjIDRecordTuple &rObjIDRecordTuple)
 
bool isGeneric () const
 
void setGenericSet (const std::set< GenericPersistent * > &rPersGenericSet)
 
void setValue (const std::set< ObjIDRecordTuple * > &rValueSet)
 
virtual int setValueFromObjectAttributeID (Persistent &rObject, const AttributeID &rAttributeID)
 
virtual int setValueFromObjectAttributeID (Persistent &rObject, const AttributeID &rAttributeID, bool bWithRefRecords)
 
virtual void setValueFromVoid (void *pValueSet)
 
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

 PoRefSetRecordAttribute ()
 
 PoRefSetRecordAttribute (const PoRefSetRecordAttribute &rT)
 
virtual ~PoRefSetRecordAttribute ()
 
virtual void streamValueListInFileStream (std::ofstream &rFileStream)
 
bool operator== (const PoRefSetRecordAttribute &rT) const
 Comparison operator.
 
bool operator!= (const PoRefSetRecordAttribute &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

PoRefSetRecordAttributeoperator= (const PoRefSetRecordAttribute &)
 

Private Attributes

std::set< GenericPersistent * > m_GenericSet
 
std::set< ObjIDRecordTuple * > m_ValueSet
 

Additional Inherited Members

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

Detailed Description

Class for the pointer set attributes of a Record.

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

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

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ PoRefSetRecordAttribute() [1/4]

glo::PoRefSetRecordAttribute::PoRefSetRecordAttribute ( )
protected

The standard constructor is not available.

◆ ~PoRefSetRecordAttribute()

virtual glo::PoRefSetRecordAttribute::~PoRefSetRecordAttribute ( )
protectedvirtual

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

◆ PoRefSetRecordAttribute() [2/4]

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

◆ PoRefSetRecordAttribute() [3/4]

glo::PoRefSetRecordAttribute::PoRefSetRecordAttribute ( ClassInfoAttribute * pType,
const std::set< ObjIDRecordTuple * > & rValueSet,
const std::streampos & rFilePos )

Constructor with parameter passing.

Parameters
[in]pTypeA class information attribute is expected.
[in]rValueSetThe set 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!

◆ PoRefSetRecordAttribute() [4/4]

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

Copy constructor.

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

Member Function Documentation

◆ clearGenericSet()

virtual void glo::PoRefSetRecordAttribute::clearGenericSet ( )
virtual

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

◆ clearValueLot()

virtual void glo::PoRefSetRecordAttribute::clearValueLot ( )
virtual

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

Implements glo::LotRecordAttribute.

◆ clearValueSet()

virtual void glo::PoRefSetRecordAttribute::clearValueSet ( )
virtual

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

◆ getCopy()

virtual BaseRecordAttribute * glo::PoRefSetRecordAttribute::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.

◆ getGenericSetRef()

const std::set< GenericPersistent * > & glo::PoRefSetRecordAttribute::getGenericSetRef ( ) const

Returns a reference to the set of generic objects.

Returns
The reference to the set of generic objects.

◆ getValueAsStreamString()

virtual std::string glo::PoRefSetRecordAttribute::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::PoRefSetRecordAttribute::getValueAsVoidPointer ( )
virtual

Returns a raw pointer to the value.

Returns
The raw pointer to the value.

Implements glo::BaseRecordAttribute.

◆ getValueRef()

const std::set< ObjIDRecordTuple * > & glo::PoRefSetRecordAttribute::getValueRef ( ) const

Returns a reference to m_ValueSet.

Returns
The reference to the set of referenced objects.

◆ getValueSize()

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

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

Returns
The number.

Implements glo::LotRecordAttribute.

◆ hasRecords()

bool glo::PoRefSetRecordAttribute::hasRecords ( ) const

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

Returns
If true, a Record is referenced.

◆ insert()

void glo::PoRefSetRecordAttribute::insert ( const ObjIDRecordTuple & rObjIDRecordTuple)

Inserts passed ObjIDRecordTuple in m_ValueSet at the end.

Parameters
[in]rObjIDRecordTupleThe ObjIDRecordTuple to be inserted.

◆ isGeneric()

bool glo::PoRefSetRecordAttribute::isGeneric ( ) const

Checks whether a GenericPersistent is referenced in m_GenericSet.

Returns
If true, a GenericPersistent is referenced.

◆ operator!=()

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

Comparison operator.

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

◆ operator=()

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

The assignment operator is not available.

◆ operator==()

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

Comparison operator.

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

◆ setGenericSet()

void glo::PoRefSetRecordAttribute::setGenericSet ( const std::set< GenericPersistent * > & rPersGenericSet)

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

Parameters
[in]rPersGenericSetThe set of referenced generic objects.

◆ setValue()

void glo::PoRefSetRecordAttribute::setValue ( const std::set< ObjIDRecordTuple * > & rValueSet)

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

Parameters
[in]rValueSetThe set of referenced objects.

◆ setValueFromObjectAttributeID() [1/2]

virtual int glo::PoRefSetRecordAttribute::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::PoRefSetRecordAttribute::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::ErrorNExceptionIf an Error an exception is thrown.

◆ setValueFromVoid()

virtual void glo::PoRefSetRecordAttribute::setValueFromVoid ( void * pValueSet)
virtual

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

This is guaranteed by a static_cast.

Parameters
[in]pValueSetThe raw pointer to the set of referenced objects.

Implements glo::BaseRecordAttribute.

◆ streamValueListInFileStream()

virtual void glo::PoRefSetRecordAttribute::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::PoRefSetRecordAttribute::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_GenericSet

std::set<GenericPersistent *> glo::PoRefSetRecordAttribute::m_GenericSet
private

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

◆ m_ValueSet

std::set<ObjIDRecordTuple *> glo::PoRefSetRecordAttribute::m_ValueSet
private

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


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