On this day we will focus on preparing the initial implementation of our first component. By the end of the day, we expect the groups to:
As a guide, we're going to show you a very simple component implementation
First we create the directory for the IDL:
> getTemplateForDirectory MODROOT_WS idlHelloComp > cd idlHelloComp/src > touch ../idl/HelloComponent.idl |
We fill the IDL with the following:
#ifndef _HELLOCOMPONENT_IDL_ #define _HELLOCOMPONENT_IDL_ #pragma prefix "acsws" #include <acscomponent.idl> module workshop { interface HelloComponent { void printHello(); }; }; #endif |
We modify the Makefile:
... IDL_FILES = HelloComponent HelloComponentStubs_LIBS = acscomponentStubs ... |
We then compile and install the IDL definitions:
> make all install |
We create the needed directories:
> getTemplateForDirectory MODROOT_WS cppHelloComp > cd cppHelloComp/src > touch HelloComponentImpl.cpp > touch ../include/HelloComponentImpl.h |
We modify the Makefile for this component:
... INCLUDES = HellowComponentImpl.h ... LIBRARIES = HelloComponentImpl HelloComponentImpl_OBJECTS = HelloComponentImpl HelloComponentImpl_LIBS = HelloComponentStubs ... |
We fill the component code as follows: