00001 //------------------------------------------------------------------------------ 00002 #ifndef d_Ref_NoTx_h 00003 #define d_Ref_NoTx_h 1 00004 //------------------------------------------------------------------------------ 00005 00006 #include "d_Ref.h" 00007 //------------------------------------------------------------------------------ 00008 00009 /** 00010 * Expresses relationships to objects. 00011 * 00012 * This class works such as d_Ref but manages no transactional objects. 00013 * 00014 * LOCATION: 00015 * d_Ref_NoTx.h 00016 * 00017 * Usage: 00018 * d_Ref_NoTx< <linked-class> > <property-name>; 00019 * 00020 * WHERE: 00021 * 00022 * <linked-class>: Name of class to link. Can be only a persistent class 00023 * (inherited from d_Object) 00024 * 00025 * <property-name>: name of property 00026 * 00027 * EXAMPLES: 00028 * 00029 * * Reference to Invoice object 00030 * d_Ref_NoTx<Invoice> myInvoice; 00031 * 00032 * SEE ALSO: 00033 * d_Ref, d_Object 00034 * 00035 * ODMG: 00036 * Extension 00037 */ 00038 template <class T> 00039 class _ODLL d_Ref_NoTx : public d_Ref_Any 00040 { 00041 public: 00042 /** 00043 * Default constructor. 00044 * 00045 * Creates a null reference. 00046 */ 00047 d_Ref_NoTx(); 00048 00049 /** 00050 * Creates a reference to <iObject> object. 00051 */ 00052 d_Ref_NoTx( const T* iObject ); 00053 00054 /** 00055 * Copy constructor. 00056 * 00057 * Copy the reference of <iRef>. 00058 */ 00059 d_Ref_NoTx( const d_Ref_NoTx<T>& iRef ); 00060 00061 /** 00062 * Creates a reference by the d_Ref object <iRef>. 00063 */ 00064 d_Ref_NoTx( const d_Ref<T>& iRef ); 00065 00066 /** 00067 * Creates a reference by the d_Ref_Any object <iRef>. 00068 */ 00069 d_Ref_NoTx( const d_Ref_Any& iRef ); 00070 00071 /** 00072 * Set the reference to <iSource> object. 00073 */ 00074 d_Ref_NoTx<T>& operator =( const T* iSource ); 00075 00076 /** 00077 * Returns the persistent object in memory. 00078 * 00079 * If the object is not present in memory Orient ODBMS loads the object 00080 * from database to memory trasparently. 00081 * 00082 * If the reference is null then an exception d_Error_RefNull or 00083 * d_Error_RefInvalid is raised. 00084 * 00085 * This operator permits to handle d_Ref<> as common C++ pointer. 00086 * 00087 * SEE ALSO: operator *(), ptr() 00088 */ 00089 T* operator -> (); 00090 00091 /** 00092 * Returns the persistent object in memory. 00093 * 00094 * If the object is not present in memory Orient ODBMS loads the object 00095 * from storage to memory trasparently. 00096 * 00097 * If the reference is null then an exception d_Error_RefNull or 00098 * d_Error_RefInvalid is raised. 00099 * 00100 * SEE ALSO: operator ->(), ptr() 00101 */ 00102 T & operator * (); 00103 00104 /** 00105 * Returns the persistent object in memory. 00106 * 00107 * If the object is not present in memory Orient ODBMS loads the object 00108 * from storage to memory trasparently. 00109 * 00110 * If the reference is null then an exception d_Error_RefInvalid is 00111 * raised. 00112 * 00113 * SEE ALSO: operator ->(), operator *() 00114 */ 00115 T * ptr (); 00116 }; 00117 //------------------------------------------------------------------------------ 00118 00119 #include "d_Ref_NoTx.cti" 00120 //------------------------------------------------------------------------------ 00121 //------------------------------------------------------------------------------ 00122 00123 #endif 00124
1.3-rc1