Sunteți pe pagina 1din 8

Introduction to CORBA types

IDL = Interface Definition Language ORB = Object Request Broker

Basic:

Numeric (integer, floating and fixed point, and enumerated). Characters and strings, including wide characters. Object references - handles to CORBA objects.

Complex:

Structures and unions, which parallel C/C++ structs and unions. Arrays - runtime fixed-length, possibly multi-dimensional stores of multiple data elements. Sequences - runtime variable-length stores of multiple data elements. "any" values store values of any data type, along with the type information necessary to make use of that data type. The upcoming CORBA 2.3 specification will add "object by value" capabilities, which will allow expressing much more complex data relationships such as graphs.

CORBA Primitive Types


CORBA Type boolean char double long double float long wide char octet short long long unsigned short unsigned long unsigned long long string wide string fixed sequence array Bytes 1 1 8 16 4 4 2 1 2 8 2 4 8 Java Mapping boolean char double double float int char byte short long short int long string string BigDecimal array array Bytes 1 2 8 8 4 4 2 1 2 8 2 4 8

Bindings
Ada Java C Lisp C++ PL_I COBOL Python CORBA Scripting Language Smalltalk PHP CAML SWI-Prolog

Background information
http://en.wikipedia.org/wiki/CORBA http://www.cs.wustl.edu/~schmidt/corba-overview.html ORB/IDL diagrams http://www.iona.com/support/docs/orbix2000/1.2/pref_cpp/html/CORBAModule3.html#52 4375
AnySeq AttrDescriptionSeq AttributeDescription AttributeMode BooleanSeq CharSeq ConstantDescription ContainedSeq ContextIdentifier ContextIdSeq DefinitionKind DomainManagersList DoubleSeq EnumMemberSeq ExcDescriptionSeq ExceptionDefSeq ExceptionDescription Flags FloatSeq Identifier Initializer InitializerSeq InterfaceDefSeq InterfaceDescription InvalidPolicies ModuleDescription OctetSeq OpDescriptionSeq OperationDescription OperationMode ORBid ParameterDescription ParameterMode ParDescriptionSeq PolicyError PolicyErrorCode PolicyList PolicyType PolicyTypeSeq PrimitiveKind RepositoryId RepositoryIdSeq ScopedName ServiceDetail ServiceDetailType ServiceInformation ServiceOption ServiceType SetOverrideType ShortSeq StringValue StructMember StructMemberSeq TCKind TypeDescription ULongLongSeq ULongSeq UnionMember UnionMemberSeq UShortSeq ValueDefSeq ValueDescription ValueMember ValueMemberSeq ValueModifier VersionSpec Visibility WCharSeq WStringValue

Primitive C++ Type


Boolean

C++ Definition
typedef unsigned char Boolean;

(Valid values are 1 for true or 0 for false.)


Boolean_out Char Char_out Double Double_out Float Float_out Long Long_out LongDouble LongDouble_out LongLong LongLong_out Octet Octet_out Short Short_out ULong ULong_out ULongLong ULongLong_out UShort UShort_out WChar WChar_out typedef Boolean& Boolean_out; typedef unsigned char Char; typedef Char& Char_out; typedef double Double; typedef Double& Double_out; typedef float Float; typedef Float& Float_out; typedef long Long; typedef Long& Long_out; typedef long double LongDouble; typedef LongDouble& LongDouble_out; typedef ... LongLong; typedef LongLong& LongLong_out; typedef unsigned char Octet; typedef Octet& Octet_out; typedef short Short; typedef Short& Short_out; typedef unsigned long ULong; typedef ULong& ULong_out; typedef ... ULongLong; typedef ULongLong& ULongLong_out; typedef unsigned short UShort; typedef UShort& UShort_out; typedef wchar_t WChar; typedef WChar& WChar_out;

http://www.javacommerce.com/displaypage.jsp?name=idltypes.sql&id=18212
IDL Type boolean char wchar octet short / unsigned short long / unsigned long Java boolean char char byte short int

long long / unsigned long long float double

long float double

http://developer.gnome.org/doc/whitepapers/ORBit/about-corba.html Available CORBA data types: Basic:


Numeric (integer, floating and fixed point, and enumerated). Characters and strings, including wide characters. Object references - handles to CORBA objects.

Complex

Structures and unions, which parallel C/C++ structs and unions. Arrays - runtime fixed-length, possibly multi-dimensional stores of multiple data elements. Sequences - runtime variable-length stores of multiple data elements. "any" values store values of any data type, along with the type information necessary to make use of that data type. The upcoming CORBA 2.3 specification will add "object by value" capabilities, which will allow expressing much more complex data relationships such as graphs.

http://www-itec.uni-klu.ac.at/~harald/corba/idldatattypes.html

IDL Construct module interface (non-abstract) interface (abstract) constant (not within an interface) boolean char, wchar octet package

Java Construct

signature interface and an operations interface, helper class, holder class signature interface, helper class, holder class public interface boolean char byte

string, wstring short, unsigned short long, unsigned long long long, unsigned long long float double fixed enum, struct, union sequence, array exception readonly attribute readwrite attribute operation

java.lang.String short int long float double java.math.BigDecimal class array class accessor method accessor and modifer methods method

Here is a sample IDL definition containing an array, a bounded sequence, and an unbounded sequence:
module ArrayModule { struct SomeStructure { long longArray[15]; sequence <boolean> unboundedBools; sequence <char, 15> boundedChars; }; };

The arrays would be defined in Java as


public int[] longArray; public boolean[] unboundedBools; public char[] boundedChars;

http://www.dre.vanderbilt.edu/Doxygen/Stable/ace/classACE__CDR.html byte sizes http://www.omg.org/technology/documents/formal/corba_language_mapping_specs.htm http://cbbrowne.com/info/corbalanguages.html

mappings

S-ar putea să vă placă și