ASSIGN(CXXLB)

Shore Programmer's Manual - 2 August 96

NAME

assign \- REF(T) assignment

SYNOPSIS

#include <ShoreApp.h>
REF(T)   &REF(T)  ::operator=(const REF(T) &ref);
REF(any) &REF(any)::operator=(const LOID &loid);

DESCRIPTION

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.

EXAMPLE

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

VERSION

This manual page applies to Version 1.0 of theShore software.

SPONSORSHIP

The Shore project is sponsored by the Advanced Research Project Agency, ARPA order number 018 (formerly 8230), monitored by the U.S. Army Research Laboratory under contract DAAB07-92-C-Q508.

COPYRIGHT

Copyright (c) 1994, 1995, 1996 Computer Sciences Department, University of Wisconsin -- Madison. All Rights Reserved.

SEE ALSO

ref(cxxlb) , construct(cxxlb) , equal(cxxlb) , get_type(cxxlb) , lookup(cxxlb) , and new(cxxlb) .