Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

ObjectIdentification Class Reference

Class that is used as object identification both in POLiTe and in IOPC. More...

#include <cObjectIdentification.h>

Collaboration diagram for ObjectIdentification:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ObjectIdentification ()
 ObjectIdentification (class ProtoBase *aPrototype, char *const aSelectKeyValues)
 ObjectIdentification (const class Object *anObject)
 ObjectIdentification (const long anOid, class ProtoBase *aPrototype)
 ObjectIdentification (const ObjectIdentification &X)
virtual ~ObjectIdentification ()
virtual class ProtoBasePrototype () const
virtual bool operator== (const ObjectIdentification &X) const
virtual bool operator!= (const ObjectIdentification &X) const
virtual ObjectIdentificationoperator= (const ObjectIdentification &X)

Protected Member Functions

virtual bool _Init (class ProtoBase *aPrototype, char *const aSelectKeyValues)
virtual bool _Init (const class Object *anObject)

Protected Attributes

char * _SelectKeyValues
OidType oid

Detailed Description

Class that is used as object identification both in POLiTe and in IOPC.

POLiTe supported composite keys and string-type keys. That's why it used this class. Composite / simple keys in POLiTe were encoded into one string (_SelectKeyValues) and that string was used as OID.

IOPC uses simple integer type OID, so encoding and decoding of OID values is not a good idea. That's why I (Josef Troch) have added attribute oid that is used in IopcPersistentObject descendants. So in every object that comes from database _SelectKeyValues or oid is valid.

If oid is valid, _prototype may point to appropriate IopcProtoBaseAdaptor. If it is NULL, prototype isn't currently known and if accessing object, prototype will be distingushed according to data in project's main table.

Note:
None of class constructors initializes oid. It is (if) initialized after creation of ObjectIdentification object directly from IopcProtoBaseAdaptor.
This class was nearly undocumented in POLiTe. I (Josef Troch) have commented this class, partially using some old source code comments.


Constructor & Destructor Documentation

ObjectIdentification::ObjectIdentification  ) 
 

Construct empty identification (IDNULL).

ObjectIdentification::ObjectIdentification class ProtoBase aPrototype,
char *const  aSelectKeyValues
 

Construct non-empty identification that identifies POLiTe-style persistent object stored in the database.

ObjectIdentification::ObjectIdentification const class Object anObject  ) 
 

Construct non-empty identification that identifies object in the memory only.

ObjectIdentification::ObjectIdentification const long  anOid,
class ProtoBase aPrototype
 

Construct non-empty identification that identifies PersistentObject descendant in database.

Note:
This is one of old POLiTe constructor - it encodes anOid and uses _SelectKeyValues not oid.

ObjectIdentification::ObjectIdentification const ObjectIdentification X  ) 
 

Copy constructor.

ObjectIdentification::~ObjectIdentification  )  [virtual]
 

Destructor - frees _SelectKeyValues.


Member Function Documentation

bool ObjectIdentification::_Init class ProtoBase aPrototype,
char *const  aSelectKeyValues
[protected, virtual]
 

Reinitializes already existing identification to point to POLiTe-style persistent object stored in the database.

bool ObjectIdentification::_Init const class Object anObject  )  [protected, virtual]
 

Reinitializes already existing identification to point to in memory object only.

class ProtoBase * ObjectIdentification::Prototype  )  const [virtual]
 

Returns object's prototype if known, NULL otherwise.

bool ObjectIdentification::operator== const ObjectIdentification X  )  const [inline, virtual]
 

Compares two ObjectIdentification objects, returns true if they identify the same object.

bool ObjectIdentification::operator!= const ObjectIdentification X  )  const [inline, virtual]
 

Compares two ObjectIdentification objects, returns true if they don't identify the same object.

ObjectIdentification & ObjectIdentification::operator= const ObjectIdentification X  )  [inline, virtual]
 

Classic operator =. Copies _SelectKeyValues if necessary.


Member Data Documentation

class ProtoBase* ObjectIdentification::_prototype [protected]
 

Pointer to appropriate class prototype.

const class Object* ObjectIdentification::_object [protected]
 

Pointer to the persistent object if it is in memory.

char* ObjectIdentification::_SelectKeyValues [protected]
 

Encoded list of key values - used in old POLiTe-style persistent classes.

OidType ObjectIdentification::oid [protected]
 

OID - used by new persistent classes - IopcPersistentObject descendants.


The documentation for this class was generated from the following files:
Generated on Wed Aug 11 22:35:57 2004 for IOPC by Doxygen 1.3.6