[omniORB] Any::NP_length()

Sai-Lai Lo S.Lo@uk.research.att.com
19 Oct 1999 23:13:48 +0100


>>>>> Renzo Tomaselli writes:

> =A0=A0=A0 =A0=A0=A0 according to the 2.8 manual there should be a CORBA=
::Any::NP_length()
> somewhere, but I couln't find it. I would like to know whether it's jus=
t a
> name mismatch or it really doesn't exist at all.

This was an internal function which has been removed since 2.7. Any
reference to it in the manual should be removed.

> This method is the only chance we have to manage type-unsafe "any"
> methods for purposes such as streaming; without knowing the length of
> what an "any" contains, Any::replace() and Any::value() look pretty
> useless. This kind of management is critical when large blocks of octet=
s
> (such as images) are contained into an "any" to stream/unstream, since
> DynAny themselves offer no alternative to walk such sequences
> byte-by-byte for feeding/fetching contents.

If you are thinking of externalise an Any, my advice is to marshal the An=
y
value into a MemBufferedStream and extract the content as a sequence of
Octet. There is no portable way to do so I'm afraid. If you need code
example, please search the archive.

Sai-Lai



--=20
Sai-Lai Lo                                   S.Lo@uk.research.att.com
AT&T Laboratories Cambridge           WWW:   http://www.uk.research.att.c=
om=20
24a Trumpington Street                Tel:   +44 1223 343000
Cambridge CB2 1QA                     Fax:   +44 1223 313542
ENGLAND