Last Update: 2003/06/30
Objects-by-Value (OBV) describes the new type, valuetype, introduced in CORBA 2.3
(Core:
formal/02-12-06.pdf; Mapping to C++:
formal/03-06-03.pdf).
The original TAO implementation was contributed by Torsten Kuepper, and has subsequently been enhanced and corrected by Jeff Parsons and George Edwards.
Valuetypes are similar to IDL structs extended with
these capabilities:
Encapsulate both state information and operations in an implementation that is guaranteed to be local.
Can be declared abstract, in which case no state members are defined.
Can inherit from a single concrete valuetype and multiple abstract valuetypes.
Can support a single concrete interface, allowing them to be manipulated as either a valuetype or an object reference.
Can support multiple abstract interfaces, allowing them to be substituted for those interfaces in operation invocations.
Can hold references to other valuetypes, with the
possibility of NULL references or shared (aliased) references.
Valuetypes have the following uses:
Implement abstract datatypes (ADTs) that can be copied to another process.
Represent eventtypes in the Event Service.
Ensure operations are executed locally for increased performance.
The IDL compiler understands valuetype.
Relevant options of TAO's IDL compiler are:
libTAO must be compiled with TAO_HAS_VALUETYPE.
Valuetypes can be used as arguments in CORBA invocations.
There is an example in
$TAO_ROOT/TAO/examples/OBV/Typed_Events.
Valuetypes can reference other
valuetype objects (but without sharing).
Support for valuetypes as members of IDL aggregate types has been added.
Support for inheritance from a concrete interface (supports) has been added. There is an example in $TAO_ROOT/TAO/tests/OBV/Supports.
Support for inheritance from abstract interfaces has been added. There is an example in $TAO_ROOT/TAO/tests/Abstract_Interface.
Support for forward declared valuetypes defined in another compilation unit has been added. See $TAO_ROOT/TAO/examples/OBV/Typed_Events.
Support for recursively-defined valuetypes has been added. See $TAO_ROOT/TAO/tests/OBV/Supports.
Support for user-declared factories has been added. See $TAO_ROOT/TAO/tests/OBV/Factory.
Valuetypes work only in conjunction with
compiled marshaling (-Gc, currently default for
tao_idl).
No support for sharing (aliasing).
No support for valueboxes
No support for valuetypes with cyclic references.
No support for fragmentation (chunking) of the marshalled
valuetype object. Hence no support for truncation or
custom marshalling.
The marshal engine accesses the state members directly and
does not utilize the accessor/modifier functions. This is different
from the CORBA specs and needs to be changed. But the
optimized mode (-Wb,obv_opt_accessor) should be
unaffected by that.
The map of valuetype factories needs some
revision to provide proper locking. Currently the
registration of factories is best completed before
unmarshalling valuetypes.
There is one map of factories for the whole process. This
will once be changed to conform to the specs, which
suggests one per ORB.