Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Lamp Class Reference
[ACS Components Examples]

#include <acsexmplLampImpl.h>

Inheritance diagram for Lamp:

Inheritance graph
[legend]
Collaboration diagram for Lamp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Lamp (const ACE_CString &name, maci::ContainerServices *containerServices)
virtual ~Lamp ()
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 onAction (baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual baci::ActionRequest offAction (baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual void on (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
virtual void off (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
virtual ACS::RWdouble_ptr brightness ()

Private Member Functions

void operator= (const Lamp &)

Private Attributes

baci::SmartPropertyPointer<
baci::RWdouble
m_brightness_sp

Detailed Description

Simple component with asynchronous methods. This class Lamp simulates the behavior of a lamp. It provides two asynchronous methods: on and off. It also provides the property brightness. Lastly, it implements timeout negotiation between client and servant for the two methods. Asynchronous calls are implemented using the ...... pattern and the ..... support classes. For each xxx action defined in the IDL interface two methods are provided:

Author:
Matej Sekoranja, Jozef Stefan Institute, Slovenia
Version:
"@(#) $Id: acsexmplLampImpl.h,v 1.99 2008/10/01 04:30:47 cparedes Exp $"


Constructor & Destructor Documentation

Lamp::Lamp const ACE_CString &  name,
maci::ContainerServices containerServices
 

Constructor

Parameters:
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.
containerServices The pointer to the ContainerServices

virtual Lamp::~Lamp  )  [virtual]
 

Destructor


Member Function Documentation

virtual ACS::RWdouble_ptr Lamp::brightness  )  [virtual]
 

Returns a reference to the Brightness property Implementation of IDL interface for the property.


virtual baci::ActionRequest Lamp::invokeAction int  function,
baci::BACIComponent cob_p,
const int &  callbackID,
const CBDescIn descIn,
baci::BACIValue value_p,
Completion completion,
CBDescOut descOut
[virtual]
 

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.

Parameters:
function Action funtion to be invoked.
cob Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value Action data (e.g. value to be set).
completion Error handing structure.
descOut Callback descriptor which will be passed to client.
Returns:
Request to be performed by BACI
  • reqNone - Do nothing (action will be kept in queue).
  • reqInvokeWorking - Invoke <type>Callback::working.
  • reqInvokeDone - Invoke <type>Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should have been called already by function).


Implements baci::ActionImplementator.

virtual void Lamp::off ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
[virtual]
 

Switches off the lamp. Implementation of IDL off() interface. This method just registers the request in the asyncronous queue, together with the associated callback and returns control immediatly. The actual action will be invoked asyncronously by the asynchonous call manager by calling Lamp::offAction The given callback is used to inform the caller when the action is performed.

Parameters:
callBack Callback when action has finished.
desc Callback used for holding information on timeout periods.

virtual baci::ActionRequest Lamp::offAction baci::BACIComponent cob_p,
const int &  callbackID,
const CBDescIn descIn,
baci::BACIValue value_p,
Completion completion,
CBDescOut descOut
[virtual]
 

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.

Parameters:
cob Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value Action data (e.g. value to be set).
completion Error handing structure.
descOut Callback descriptor which will be passed to client.
Returns:
Request to be performed by BACI.
  • reqNone - Do nothing (action will be kept in queue).
  • reqInvokeWorking - Invoke <type>Callback::working.
  • reqInvokeDone - Invoke <type>Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should has been called already by function).


virtual void Lamp::on ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
[virtual]
 

Switches on the lamp. Implementation of IDL on() interface. This method just registers the request in the asyncronous queue, together with the associated callback and returns control immediatly. The actual action will be invoked asyncronously by the asynchonous call manager by calling Lamp::onAction The given callback is used to inform the caller when the action is performed.

Parameters:
callBack Callback when action has finished.
desc Callback used for holding information on timeout periods

virtual baci::ActionRequest Lamp::onAction baci::BACIComponent cob_p,
const int &  callbackID,
const CBDescIn descIn,
baci::BACIValue value_p,
Completion completion,
CBDescOut descOut
[virtual]
 

Implementation of asynchronous acsexmplLamp::Lamp::on() method This is the function that actually switches on the Lamp and, when completed, invokes the callback installed by the client when it requested the action.

Parameters:
cob Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value Action data (e.g. value to be set).
completion Error handing structure.
descOut Callback descriptor which will be passed to client.
Returns:
Request to be performed by BACI.
  • reqNone - Do nothing (action will be kept in queue).
  • reqInvokeWorking - Invoke <type>Callback::working.
  • reqInvokeDone - Invoke <type>Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should has been called already by function).


void Lamp::operator= const Lamp  )  [private]
 

ALMA C++ coding standards state copy operators should be disabled.


Member Data Documentation

baci::SmartPropertyPointer<baci::RWdouble> Lamp::m_brightness_sp [private]
 

m_brightness_sp is the lamp's setable brightness.


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:36:32 2009 for ACS C++ API by doxygen 1.3.8