#include <d_Ref.h>
Inheritance diagram for d_Ref< T >:

Public Methods | |
| d_Ref () | |
| d_Ref (const T *iObject) | |
| d_Ref (const d_Ref< T > &iRef) | |
| d_Ref (const d_Ref_Any &iRef) | |
| d_Ref< T > & | operator= (const T *iSource) |
| T * | operator-> () |
| T & | operator * () |
| T * | ptr () |
| void | load () |
You had to use this class for referencing persistent objects rather than C++ pointers. It's implemented as a template class. The user must specify the persistent class (derived from d_Object class) of the relationship as template-argoument. Being a template class there is no need to cast the result to own class.
It can be used as attribute of a class for 1 to 1 relationship between objects of the same or different class.
If it's used as template-argoument of a class container in a class attribute can express 1 to N relationships.
LOCATION: d_Ref.h
Usage: d_Ref< <linked-class> > <property-name>;
WHERE:
<linked-class>: Name of class to link. Can be only a persistent class (inherited from d_Object)
<property-name>: name of property
EXAMPLES: class Invoice : public d_Object { * Relationship 1-1 to customer object d_Ref<Customer> customer;
* Relationship 1-N to product objects d_Set< d_Ref<Product> > products; };
* Reference to Invoice object d_Ref<Invoice> myInvoice;
ODMG: Compliant
|
|||||||||
|
Default constructor. Creates a null reference. ODMG : Compliant |
|
||||||||||
|
Creates a reference to object. ODMG : Compliant |
|
||||||||||
|
Copy constructor. Copy the reference of . ODMG : Compliant |
|
||||||||||
|
Creates a reference by the d_Ref_Any object . ODMG : Compliant |
|
|||||||||
|
Force loading of object in memory. If the object is not present in memory Orient ODBMS loads the object from storage to memory. If the reference is null then an exception d_Error_RefInvalid is raised. SEE ALSO: operator ->(), operator *(), ptr() ODMG : Extension |
|
|||||||||
|
Returns the persistent object in memory. If the object is not present in memory Orient ODBMS loads the object from storage to memory trasparently. If the reference is null then an exception d_Error_RefNull or d_Error_RefInvalid is raised. SEE ALSO: operator ->(), ptr() ODMG : Compliant |
|
|||||||||
|
Returns the persistent object in memory. If the object is not present in memory Orient ODBMS loads the object from database to memory trasparently. If the reference is null then an exception d_Error_RefNull or d_Error_RefInvalid is raised. This operator permits to handle d_Ref<> as common C++ pointer. SEE ALSO: operator *(), ptr() ODMG : Compliant |
|
||||||||||
|
Set the reference to object. ODMG : Compliant |
|
|||||||||
|
Returns the persistent object in memory. If the object is not present in memory Orient ODBMS loads the object from storage to memory trasparently. If the reference is null then an exception d_Error_RefInvalid is raised. SEE ALSO: operator ->(), operator *() ODMG : Compliant |
1.3-rc1