The IDL (Interface Definition Language) file is the component's definition. It contains the functions the component exposes and the interface it must implement, regardless of the language in which is implemented.
In this link you can find details about IDL syntax and definitions.
Set IDL for our hello-world components
For any given component we have to follow 3 steps:
- Implement component's IDL
- Implement component
- Install component in ACS
So, we create the component's IDL directory and file:
Code Block |
---|
|
cd ~/workspace
getTemplateForDirectory MODROOT_WS idlHelloComp
cd idlHelloComp/src
touch ../idl/HelloComponent.idl
vim ../idl/HelloComponent.idl |
We fill the IDL with the following:
Code Block |
---|
language | cpp |
---|
title | idlHelloComp/idl/HelloComponent.idl |
---|
linenumbers | true |
---|
|
#ifndef _HELLOCOMPONENT_IDL_
#define _HELLOCOMPONENT_IDL_
#pragma prefix "acsws"
#include <acscomponent.idl>
module workshop {
interface HelloComponent : ACS::ACSComponent {
string printHello();
};
};
#endif |
We add our component's IDL to the Makefile:
Code Block |
---|
|
vim ~/workspace/idlHelloComp/src/Makefile |
Code Block |
---|
title | idlHelloComponent/src/Makefile |
---|
|
...
IDL_FILES = HelloComponent
HelloComponentStubs_LIBS = acscomponentStubs
...
COMPONENT_HELPERS=on
... |
We then compile and install the IDL definitions:
Code Block |
---|
|
make all install |