Atacama Large Millimeter Array ACS Training IDL interfaces













- Slides: 13
Atacama Large Millimeter Array ACS Training IDL interfaces for a Component G. Chiozzi Garching, 16 th – 19 th January, 2007 Garching, 16 th – 19 th January 2007
ACS Interfaces and IDL Interface In ACS Interfaces for Components are defined using: CORBA IDL (Interface Definition Language) Interfaces vs. Implementations Accessed through well-defined interface Internals not available - users of object have no knowledge of implementation Interfaces & Implementations totally separate For one interface, multiple implementations possible Object
Why IDL? • IDL reconciles diverse object models and programming languages • Imposes the same object model on all supported languages • Programming language independent way of describing data types and object interfaces – purely descriptive - no procedural description elements – provides abstraction from implementation – allows multiple language bindings to be defined • A way for integrating and sharing objects from different object models and languages Garching 16 th-19 th January 2007 ACS Training 3
Getting Started with ACS Course and ACS Example Do you know CVS? At the console, type: cvs co ACS/LGPL/Common. Software/acscourse This gives you the latest version of the ACS Course module. And cvs co ACS/LGPL/Common. Software/acsexample This gives you the latest version of the ACS Example module containing C++ examples for ACS. Garching 16 th-19 th January 2007 ACS Training 4
IDL Example: Mount ACS/LGPL/Common. Software/acscourse/ws/idl/acscourse. Mount. idl #ifndef _ACSCOURSE_MOUNT_IDL_ #define _ACSCOURSE_MOUNT_IDL_ #include <acscomponent. idl> #pragma prefix "alma" module ACSCOURSE_MOUNT { interface Mount 1 : ACS: : ACSComponent { void objfix (in double az, in double elev) raises (ACSErr. Type. ACSCourse: : Target. Not. Found. Ex); }; }; #endif Garching 16 th-19 th January 2007 ACS Training 5
IDL simple data types • Basic data types similar to C, C++ or Java – – – – long, unsigned long short, unsigned short float, double, long double char, wchar (ISO Unicode) boolean octet (raw data without conversion) any (self-describing variable) Garching 16 th-19 th January 2007 ACS Training 6
IDL complex data types • string - sequence of characters - bounded or unbounded – string<256> msg // bounded – string msg // unbounded • wstring - sequence of Unicode characters - bounded or unbounded • sequence - one dimensional array whose members are all of the same type - bounded or unbounded – sequence<float, 100> my. Seq // bounded – sequence<float> my. Seq // unbounded Garching 16 th-19 th January 2007 ACS Training 7
IDL user defined data types • Facilities for creating your own types: – – – – typedef enum const struct union arrays exception • preprocessor directives - #include #define Garching 16 th-19 th January 2007 ACS Training 8
Operations and parameters • Return type of operations can be any IDL type (but we do not allow references to other components) • each parameter has a direction (in, out, inout) and a name • similar to C/C++ function declarations Garching 16 th-19 th January 2007 ACS Training 9
ACS (CORBA) Development Process using IDL Definition Client Implementation Object Implementation IDL Compiler Client Program Source Stub Source Skeleton Source Java or C++ Compiler Client Program Object Implementation Source
Stubs & Skeletons object implementation client program call language mapping operation signatures method language mapping entry points Stub Skeleton ORB Operations Location Service Transport Layer ORB Basic Object Adapter Multithreading Stubs and Skeletons are automatically generated from IDL interfaces
Other IDL Interfaces acsexmpl/ws/idl/*. idl Garching 16 th-19 th January 2007 ACS Training 12
Questions about IDL? ? ? Garching 16 th-19 th January 2007 ACS Training 13