#include <ShoreApp.h> REF(T) &REF(T) ::operator=(const REF(T) &ref); REF(any) &REF(any)::operator=(const LOID &loid);
There are two public forms of the C++ assignment assignment operator. The first form allows assignment between refs of the same type. The second form is only available on REF(any); it allows assignment between refs and logical oids.
REF(T) has one additional overloading of operator=:
REF(T) &REF(T)::operator=(const T *p);This form of operator= should only be used to assign the result of T::operator new to a REF(T) variable. Other uses of this assignment operator are unsafe.
To create a reference to an object, when the object's logical object identifier (LOID) is known:
// // Suppose we know the object's oid is 0.0.0.0:10.33333 // and also suppose that the object's type is T. // LOID loid(0,10,33333); // construct a Ref<any> for that oid. Ref<any> anyref(loid); // equivalently: Ref<any> anyref2 = loid; // Convert to a Ref<T> -- see man page for get_type Ref<T> tref = TYPE_OBJECT(T).isa(anyref); // Now we have a Ref<T> pointing object 0.0.0.0:10.33333 //
To create a reference to a registered object, when the object's path name is known, use lookup(cxxlb) .