#include <acsexmplLampWheelImpl.h>
Inheritance diagram for LampWheel:
Public Member Functions | |
LampWheel (const ACE_CString &name, maci::ContainerServices *containerServices) | |
virtual | ~LampWheel () |
virtual void | initialize () |
virtual void | execute () |
virtual void | cleanUp () |
virtual void | aboutToAbort () |
virtual baci::ActionRequest | invokeAction (int function, baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut) |
virtual baci::ActionRequest | moveAction (baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut) |
virtual void | move (CORBA::Short, ACS::CBvoid_ptr, const ACS::CBDescIn &) |
virtual ACS::ROdouble_ptr | position () |
virtual ACS::ROstring_ptr | desc () |
virtual ACS::ROlong_ptr | slots () |
Private Member Functions | |
void | operator= (const LampWheel &) |
int | retrieveConfigurationFromCDB (std::list< SlotDescriptor > &config) |
Static Private Member Functions | |
void | start_hndl (void *data, const XML_Char *el, const XML_Char **attr) |
void | end_hndl (void *data, const XML_Char *el) |
void | char_hndl (void *data, const XML_Char *s, int len) |
Private Attributes | |
ACE_CString | m_fullName |
baci::SmartPropertyPointer< baci::ROdouble > | m_position_sp |
baci::SmartPropertyPointer< baci::ROstring > | m_desc_sp |
baci::SmartPropertyPointer< baci::ROlong > | m_slots_sp |
std::list< SlotDescriptor > | m_lampWheelConfiguration |
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.
|
Constructor
|
|
Destructor |
|
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...). The component should make an effort to die as neatly as possible. Because of its urgency, this method will be called asynchronously to the execution of any other method of the component. If this method is overwritten in a chain of subclasses, the developer might need to make sure that all activities performed by the implementation of the base class take place. Check the documentation of direct parent class to know if this is necessary (and do not forget to document each class for the need to chain lifecycle methods in subclasses). The best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a constructor chain. In this class the default implementation only sets the state of the component to acscomponent::ACS::ACS::COMPSTATE_ABORTING
Reimplemented from acscomponent::ACSComponentImpl.
|
|
The handler for the char element
|
|
Called after the last functional call to the component has finished. The component should then orderly release resources etc. If this method is overwritten in a subclass, the developer has to make sure that all cleanup performed by the implementation of the base class take place. The best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a destructor chain. If this method is overwritten in a chain of subclasses, the developer might need to make sure that all activities performed by the implementation of the base class take place. Check the documentation of direct parent class to know if this is necessary (and do not forget to document each class for the need to chain lifecycle methods in subclasses). The best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a destructor chain. In this class the default implementation only sets the state of the component to acscomponent::ACS::COMPSTATE_DESTROYING
Reimplemented from acscomponent::ACSComponentImpl.
|
|
Returns a reference to the desc property Implementation of IDL interface for the property.
|
|
The handler for the end element
|
|
Called after initialize to tell the component that it has to be ready to accept incoming functional calls any time. Must be implemented as a synchronous (blocking) call (can spawn threads though). If this method is overwritten in a chain of subclasses, the developer might need to make sure that all activities performed by the implementation of the base class take place. Check the documentation of direct parent class to know if this is necessary (and do not forget to document each class for the need to chain lifecycle methods in subclasses). The best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a constructor chain. In this class the default implementation only sets the state of the component to acscomponent::ACS::COMPSTATE_OPERATIONAL
Reimplemented from acscomponent::ACSComponentImpl.
|
|
Called to give the component time to initialize itself. For instance, the component could retrieve connections, read in configuration files/parameters, build up in-memory tables, ... Called before execute. In fact, this method might be called quite some time before functional requests can be sent to the component. Must be implemented as a synchronous (blocking) call. If this method is overwritten in a chain of subclasses, the developer has to make sure that all initialisations performed by the implementation of the base class take place. Check the documentation of direct parent class to know if this is necessary (and do not forget to document each class for the need to chain lifecycle methods in subclasses). If necessary, the best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a constructor chain. In this class the default implementation only sets the state of the component first to acscomponent::ACS::COMPSTATE_INITIALIZING and then to acscomponent::ACS::COMPSTATE_INITIALIZED.
Reimplemented from acscomponent::ACSComponentImpl.
|
|
Action dispatcher function This function is called whenever an asynchronous request has to be handled. It receives (as parameters) the description of the function and selects the proper implementation to call.
Implements baci::ActionImplementator.
|
|
Move the lamp wheel to a specification slot. The position of the slot is read from the database Implementation of IDL move(...) interface. The actual action will be invoked asyncronously by the asynchonous call manager by calling LampWhell::moveAction The given callback is used to inform the caller when the action is performed.
|
|
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.
|
|
ALMA C++ coding standards state copy operators should be disabled. |
|
Returns a reference to the position property Implementation of IDL interface for the property.
|
|
Read the CDB and fill the list with the actual configuration of each slot
|
|
Returns a reference to the descavailableSlots property Implementation of IDL interface for the property.
|
|
The handler for the start element
|
|
m_desc_sp is the description of the wheel. |
|
|
|
The list of descriptions of each slot of the wheel: it is the configuration of the lampWheel It is built reading the CDB |
|
m_position_sp is the position of the wheel. |
|
m_slots_sp is the number of available slots in the wheel |