RE: Suggested revised text for HTML/XML report intro

Larry Masinter, Noah Mendelsohn et al.

One solution to having XHTML forms and similar entities work with XML
data-types is to make a version of the code that employs the CORBA IDL type
Any. This would be a generic or template, which could permit the use of XML
data-Types. I should admit that I have very little knowledge of IDL, except
for its use of in, out, inOut and return. However, I was able to find this
example on the web.
http://omniorb.sourceforge.net/omni41/omniORB/omniORB011.html

One way to do this is to provide a choice where one of the values is the
collection of standard HTML5 data-types and the other is an instantiated
generic. 

Bob Leif


11.1 Example using type Any


Before going through this example, you should make sure that you have read
and understood the examples in chapter 2
<http://omniorb.sourceforge.net/omni41/omniORB/omniORB002.html#chap:basic> .
The source code for this example is included in the omniORB distribution, in
the directory src/examples/anyExample. A listing of the source code is
provided at the end of this chapter.


11.1.1 Type Any in IDL


Type Any allows one to delay the decision on the type used in an operation
until run-time. To use type any in IDL, use the keywordany, as in the
following example:

// IDL

interface anyExample {

  any testOp(in any mesg);

};

The operation testOp()() in this example can now take any value expressible
in OMG IDL as an argument, and can also return any type expressible in OMG
IDL.

Type Any is mapped into C++ as the type CORBA::Any. When passed as an
argument or as a result of an operation, the following rules apply:


In 

InOut 

Out 

Return 

	

const CORBA::Any& 

CORBA::Any& 

CORBA::Any*& 

CORBA::Any* 

 

Received on Tuesday, 4 October 2011 10:51:45 UTC