ALMA Computing Group
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

LampWheel Class Reference
[ACS Components Examples]

The class LampWheel class simulates the behavior of a very simple lamp wheel using an asynchronous method to rotate it. More...

#include <acsexmplLampWheelImpl.h>

List of all members.

Public Member Functions

 LampWheel (const ACE_CString &name, maci::ContainerServices *containerServices)
 Constructor.
virtual ~LampWheel ()
 Destructor.
virtual void initialize ()
 Called to give the component time to initialize itself.
virtual void execute ()
 Called after initialize to tell the component that it has to be ready to accept incoming functional calls any time.
virtual void cleanUp ()
 Called after the last functional call to the component has finished.
virtual void aboutToAbort ()
 Called when due to some error condition the component is about to be forcefully removed some unknown amount of time later (usually not very much...).
virtual baci::ActionRequest invokeAction (int function, baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
 Action dispatcher function This function is called whenever an asynchronous request has to be handled.
virtual baci::ActionRequest moveAction (baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
 Implementation of asynchrnous acsexmplLamp::Lamp::off() method This is the function that actually switches off the Lamp and, when completed, invokes the callback installed by the client when it requested the action.
virtual void move (CORBA::Short, ACS::CBvoid_ptr, const ACS::CBDescIn &)
 Move the lamp wheel to a specification slot.
virtual ACS::ROdouble_ptr position ()
 Returns a reference to the position property Implementation of IDL interface for the property.
virtual ACS::ROstring_ptr desc ()
 Returns a reference to the desc property Implementation of IDL interface for the property.
virtual ACS::ROlong_ptr slots ()
 Returns a reference to the descavailableSlots property Implementation of IDL interface for the property.

Private Member Functions

void operator= (const LampWheel &)
 ALMA C++ coding standards state copy operators should be disabled.
int retrieveConfigurationFromCDB (std::list< SlotDescriptor > &config)
 Read the CDB and fill the list with the actual configuration of each slot.

Static Private Member Functions

static void start_hndl (void *data, const XML_Char *el, const XML_Char **attr)
 The handler for the start element.
static void end_hndl (void *data, const XML_Char *el)
 The handler for the end element.
static void char_hndl (void *data, const XML_Char *s, int len)
 The handler for the char element.

Private Attributes

ACE_CString m_fullName
baci::SmartPropertyPointer
< baci::ROdouble > 
m_position_sp
 m_position_sp is the position of the wheel.
baci::SmartPropertyPointer
< baci::ROstring > 
m_desc_sp
 m_desc_sp is the description of the wheel.
baci::SmartPropertyPointer
< baci::ROlong > 
m_slots_sp
 m_slots_sp is the number of available slots in the wheel
std::list< SlotDescriptorm_lampWheelConfiguration
 The list of descriptions of each slot of the wheel: it is the configuration of the lampWheel It is built reading the CDB.

Detailed Description

The class LampWheel class simulates the behavior of a very simple lamp wheel using an asynchronous method to rotate it.

The component reads the wheel data from the CDB. The lamp wheel is caracterized by a description, a number of available slots and a description of the used slots. All these data reside on the CDB. In particular, the number of defined slots is not defined a priori but is retrieved by parsing the CDB record for the component.

At startup, the component read the description of the wheel from the CDB and stores the configuration into a list. The move method moves the wheel to the position defined for the passed slot number. The position is read from the list (i.e. from the CDB). A log message inform the user about the selected lamp.

Author:
Alessandro Caproni,
Version:
"@(#) $Id: acsexmplLampWheelImpl.h,v 1.16 2008/10/09 08:41:11 cparedes Exp $"

Definition at line 121 of file acsexmplLampWheelImpl.h.


Constructor & Destructor Documentation

LampWheel::LampWheel ( const ACE_CString &  name,
maci::ContainerServices *  containerServices 
)

Constructor.

Parameters:
poa Poa which will activate this and also all other components.
name component's name. This is also the name that will be used to find the configuration data for the component in the Configuration Database.

Definition at line 49 of file acsexmplLampWheelImpl.cpp.


The documentation for this class was generated from the following files: