130 likes | 281 Views
ACS Training IDL interfaces for a Component. G.Chiozzi. Garching, 16 th – 19 th January, 2007. ACS Interfaces and IDL. IDL Interface. Interfaces vs. Implementations Accessed through well-defined interface Internals not available - users of object have no knowledge of implementation
E N D
ACS TrainingIDL interfaces for a Component G.Chiozzi Garching, 16th – 19th January, 2007
ACS Interfaces and IDL IDL Interface 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 In ACS Interfaces for Components are defined using: CORBA IDL (Interface Definition Language) Object ACS Training
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 ACS Training
Getting Started with ACS Course and ACS Example Do you know CVS? At the console, type: cvs co ACS/LGPL/CommonSoftware/acscourse This gives you the latest version of the ACS Course module. And cvs co ACS/LGPL/CommonSoftware/acsexample This gives you the latest version of the ACS Example module containing C++ examples for ACS. ACS Training
IDL Example: Mount ACS/LGPL/CommonSoftware/acscourse/ws/idl/acscourseMount.idl #ifndef _ACSCOURSE_MOUNT_IDL_ #define _ACSCOURSE_MOUNT_IDL_ #include <acscomponent.idl> #pragma prefix "alma" module ACSCOURSE_MOUNT { interface Mount1 : ACS::ACSComponent { voidobjfix (in doubleaz, in doubleelev) raises (ACSErrTypeACSCourse::TargetNotFoundEx); }; }; #endif ACS Training
IDL simple data types • Basic data types similar to C, C++ or Java • long, long long, unsigned long, unsigned long long • short, unsigned short • float, double, long double • char, wchar (ISO Unicode) • boolean • octet (raw data without conversion) • any (self-describing variable) ACS Training
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> mySeq // bounded • sequence<float> mySeq // unbounded ACS Training
IDL user defined data types • Facilities for creating your own types: • typedef • enum • const • struct • union • arrays • exception • preprocessor directives - #include #define ACS Training
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 ACS Training
IDL Compiler Client Program Source Object Implementation Source Skeleton Source Stub Source Java or C++ Compiler Java or C++ Compiler Client Program Object Implementation ACS (CORBA) Development Process using IDL IDL Definition Client Implementation Object Implementation ACS Training
objectimplementation client program call method language mapping operation signatures language mapping entry points Stub Skeleton Basic Object Adapter ORB Operations Location Service ORB Transport Layer Multithreading Stubs & Skeletons Stubs and Skeletons are automatically generated from IDL interfaces ACS Training
Other IDL Interfaces acsexmpl/ws/idl/*.idl ACS Training
Questions about IDL??? ACS Training