Objects-by-Value
Objects-by-Value (OBV) describes the new type, valuetype
. This
first implementation was contributed from Torsten Kuepper. Valuetype
s
are similar to IDL struct
s extended with these capabilites:
-
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.
Valuetype
s have the following uses:
-
Implement abstract datatypes (ADTs) that can be copied to another process.
-
Represent
eventtype
s 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:
- -Gv Enable OBV support (default)
- -Sv Disable OBV support
- -Wb,obv_opt_accessor Make accessor and modifier functions
inline. Overriding them is not allowed in this mode.
libTAO
must be compiled with
TAO_HAS_VALUETYPE
.
-
Valuetype
s can be used as arguments in CORBA
invocations. There is an example in $TAO_ROOT/TAO/examples/OBV/Typed_Events.
Valuetype
s could even 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.
-
Support for inheritance from abstract interfaces has been added.
-
Support for forward declared valuetypes defined in another
compilation unit has been added.
-
Support for recursively-defined valuetypes has been added.
-
Support for user-declared factories has been added.
-
Valuetype
s work only in conjunction with compiled
marshalling (-Gc
, currently default for
tao_idl
).
-
No support for sharing (aliasing).
-
No support for
valuebox
es.
-
No support for
valuetype
s 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 valuetype
s.
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.

[top]