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

Lamp Class Reference

#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 ActionRequest invokeAction (int function, BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual ActionRequest onAction (BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual ActionRequest offAction (BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual void on (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc) throw (CORBA::SystemException)
virtual void off (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc) throw (CORBA::SystemException)
virtual ACS::RWdouble_ptr brightness () throw (CORBA::SystemException)

Private Member Functions

void operator= (const Lamp &)

Private Attributes

SmartPropertyPointer< RWdoublem_brightness_sp

Detailed Description

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.96 2005/04/29 14:08:41 acaproni 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  )  throw (CORBA::SystemException) [virtual]
 

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


virtual ActionRequest Lamp::invokeAction int  function,
BACIComponent *  cob_p,
const int &  callbackID,
const CBDescIn descIn,
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 Callback::working.
  • reqInvokeDone - Invoke 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
throw (CORBA::SystemException) [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 ActionRequest Lamp::offAction BACIComponent *  cob_p,
const int &  callbackID,
const CBDescIn descIn,
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 Callback::working.
  • reqInvokeDone - Invoke 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
throw (CORBA::SystemException) [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 ActionRequest Lamp::onAction BACIComponent *  cob_p,
const int &  callbackID,
const CBDescIn descIn,
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 Callback::working.
  • reqInvokeDone - Invoke 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

SmartPropertyPointer<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 Sun Oct 29 02:31:01 2006 for ACS C++ API by doxygen 1.3.6