You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Introduction

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:

  • Inheritance from IDL interface to be implemented
  • Basic implementation of the methods
  • Modifying CDB configuration in your test directory
  • Exercising your component implementation from objexp and/or a PySimpleClient instance

Guides

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:

idlHelloComp/idl/HelloComponent.idl
#ifndef _HELLOCOMPONENT_IDL_
#define _HELLOCOMPONENT_IDL_

#pragma prefix "acsws"

#include <acscomponent.idl>

module workshop {
    interface HelloComponent {
        void printHello();
    };
};

#endif

We modify the Makefile:

idlHelloComponent/src/Makefile
...
IDL_FILES = HelloComponent
HelloComponentStubs_LIBS = acscomponentStubs
...


We then compile and install the IDL definitions:

> make all install

C++

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:

cppHelloComponent/src/Makefile
...
INCLUDES = HellowComponentImpl.h
...
LIBRARIES = HelloComponentImpl
HelloComponentImpl_OBJECTS = HelloComponentImpl
HelloComponentImpl_LIBS = HelloComponentStubs
...

We fill the component code as follows:


  • No labels