Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:

  1. Implement component's IDL
  2. Implement component
  3. Install component in ACS

So, we create the component's IDL directory and file

Set INTROOT directory

Visit ACS Directory Structure#INTROOT for full details.

Code Block
languagebash
export INTROOT=~/workspace/introot
getTemplateForDirectory INTROOT $INTROOT

Set IDL

First we create the directory for the IDL:

Code Block
languagebash
cd ~/workspace
getTemplateForDirectory MODROOT_WS idlHelloComp
cd idlHelloComp/src
touch ../idl/HelloComponent.idl
sudo nanovim ../idl/HelloComponent.idl

...

Code Block
languagecpp
titleidlHelloComp/idl/HelloComponent.idl
linenumberstrue
#ifndef _HELLOCOMPONENT_IDL_
#define _HELLOCOMPONENT_IDL_

#pragma prefix "acsws"

#include <acscomponent.idl>

module workshop {
    interface HelloComponent : ACS::ACSComponent {
        string printHello();
    };
};

#endif

We modify add our component's IDL to the Makefile:

Code Block
languagebash
vim ~/workspace/idlHelloComp/src/Makefile


Code Block
titleidlHelloComponent/src/Makefile
...
IDL_FILES = HelloComponent
HelloComponentStubs_LIBS = acscomponentStubs
...
COMPONENT_HELPERS=on
...

...

Code Block
languagebash
make -j all install