#include <tRef.h>
Inheritance diagram for Ref< T >:
Public Member Functions | |
T * | operator-> () |
T & | operator * () |
Ref () | |
Ref (const RefBase &Dbp) | |
Ref (const Object *const DbObj) | |
Ref (class Connection *aConnection, class ProtoBase *aPrototype, char *aSelectKeyValues, unsigned short aStrategies) | |
Ref (class Connection *aConnection, const long anOid) | |
Ref (class Connection *aConnection, const QueRefProto &aQuery) | |
Ref (class Connection *aConnection, const char *aQuery) | |
Ref< T > & | operator= (const RefBase &Dbp) |
Ref< T > & | operator= (const T *Ptr) |
void | setOID (const OidType oid, class Connection *connection) |
Instance of template Ref<T> can points to one object in one specific database. When accessing the object, the reference is automatically dereferenced and the object is retrieved (if necessary) from database and placed into the memory. To minimise the amount of database accesses all persistent objects contained currently in memory are registered in the library persistent objects cache - ObjectCache.
Objects of type Ref<T> can be used as persistent attributes in IOPC-style persistent objects (IopcPersistentObject descendants), see getOID() and setOID().
This class were almost undocumented in POLiTe - I (Josef Troch) have commented it and made some changes to make multiple inheritance work and added methods to support persistence of attributes of this type.
|
Empty constructor - constructs DBNULL pointer.
|
|
Copy constructor.
|
|
Constructor taking pointer to the object.
|
|
Constructor taking object's connection, prototype, encoded key values ( |
|
Old constructor (POLiTe-style) that takes object's connection, OID and prototype. This constructor encodes the OID to get string, doesn't uses OID directly (see ObjectIdentification). |
|
Constructor that uses temporary query result to find object matching the query. Uses ExecuteQuery().
|
|
The same as Ref(class Connection *, const QueRefProto &), but query is given as string.
|
|
Returns pointer to the referenced object. If the object is not present in memory yet, loads it from the database (using ObjectBuffer::GetReferencedObject()). If reference points nowhere (DBNULL) throws ObjLibException_NotFound, if the referenced object cannot be cast to type T, throws IopcExceptionInvalidReference.
|
|
The same as operator->() but returns C++ reference to the object, not pointer.
|
|
Common operator =.
|
|
Operator = that takes C++ pointer to object.
|
|
Sets _ObjectIdentification and _Connection to point to object with OID This function was added by Josef Troch to support persistence of attributes of type Ref<T>. It is called from persistent object's iopcImportAttributes() function.
|