Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

d_Ref< T > Class Template Reference

#include <d_Ref.h>

Inheritance diagram for d_Ref< T >:

d_Ref_Any List of all members.

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 ()

Detailed Description

template<class T>
class d_Ref< T >

Expresses relationships to objects.

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;

SEE ALSO: d_Ref_Any, d_Object

ODMG: Compliant


Constructor & Destructor Documentation

template<class T>
d_Ref< T >::d_Ref  
 

Default constructor.

Creates a null reference.

ODMG : Compliant

template<class T>
d_Ref< T >::d_Ref const T *    iObject
 

Creates a reference to object.

ODMG : Compliant

template<class T>
d_Ref< T >::d_Ref const d_Ref< T > &    iRef
 

Copy constructor.

Copy the reference of .

ODMG : Compliant

template<class T>
d_Ref< T >::d_Ref const d_Ref_Any   iRef
 

Creates a reference by the d_Ref_Any object .

ODMG : Compliant


Member Function Documentation

template<class T>
void d_Ref< T >::load  
 

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

template<class T>
T& d_Ref< T >::operator *  
 

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

template<class T>
T* d_Ref< T >::operator->  
 

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

template<class T>
d_Ref<T>& d_Ref< T >::operator= const T *    iSource
 

Set the reference to object.

ODMG : Compliant

template<class T>
T* d_Ref< T >::ptr  
 

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


The documentation for this class was generated from the following file:
Generated on Fri Nov 29 17:12:14 2002 for Orient ODBMS Just Edition v. 2.0e by doxygen1.3-rc1