Versions Compared

Key

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

...

For instance, for the Scheduler component (check the functions the Scheduler must implement in ACS Workshop - Interfaces):

Code Block
languageyml
titlescheduler.yml
working_dir: /home/developer/workspace
prefix: acsws
module: SCHEDULER_MODULE
component_name: Scheduler
functions:
  - 'void start()'
  - 'void stop()'
  - 'long proposalUnderExecution()'

...

Code Block
languagecpp
titleidlScheduler/idl/Scheduler.idl
linenumberstrue
#ifndef _SCHEDULER_IDL_
#define _SCHEDULER_IDL_
 
#pragma prefix "acsws"
 
#include <acscomponent.idl>
 
module SCHEDULER_MODULE {
    interface Scheduler : ACS::ACSComponent {
        void start();

        void stop();

        long proposalUnderExecution();
    };
};

#endif
Code Block
languagepy
titlepyScheduler/src/SCHEDULER_MODULEImpl/SchedulerImpl.py
linenumberstrue
# Client stubs and definitions, such as structs, enums, etc.
import SCHEDULER_MODULE
# Skeleton infrastructure for server implementation
import SCHEDULER_MODULE__POA
   
# Base component implementation
from Acspy.Servants.ACSComponent import ACSComponent
# Services provided by the container to the component
from Acspy.Servants.ContainerServices import ContainerServices
# Basic component lifecycle (initialize, execute, cleanUp and aboutToAbort methods)
from Acspy.Servants.ComponentLifecycle import ComponentLifecycle


class SchedulerImpl(SCHEDULER_MODULE__POA.Scheduler, ACSComponent, ContainerServices, ComponentLifecycle):
    def __init__(self):
        ACSComponent.__init__(self)
        ContainerServices.__init__(self)
        self._logger = self.getLogger()
        
    def start(self):
        raise NotImplementedError("This function should do something")

    def stop(self):
        raise NotImplementedError("This function should do something")

    def proposalUnderExecution(self):
        raise NotImplementedError("This function should do something")