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

RampedPowerSupply Class Reference
[ACS Components Examples]

#include <acsexmplRampedPowerSupplyImpl.h>

Inheritance diagram for RampedPowerSupply:

Inheritance graph
[legend]
Collaboration diagram for RampedPowerSupply:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RampedPowerSupply (const ACE_CString &name, maci::ContainerServices *containerServices)
 ~RampedPowerSupply ()
virtual baci::ActionRequest invokeAction (int function, baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual baci::ActionRequest startRampingAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual baci::ActionRequest stopRampingAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual void startRamping (CORBA::Long rampingSteps, ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
virtual void stopRamping (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
virtual ACS::RWstring_ptr rampingStatus ()
virtual ACS::ROlong_ptr rampingStep ()

Static Public Attributes

const int START_RAMPING = 3
const int STOP_RAMPING = 4

Private Member Functions

void operator= (const RampedPowerSupply &)

Private Attributes

baci::SmartPropertyPointer<
baci::ROlong
m_rampingStep_sp
DevIO< CORBA::Long > * m_rampingStep_devio_p
baci::SmartPropertyPointer<
baci::RWstring
m_rampingStatus_sp

Detailed Description

Simulates the behavior of a ramped power supply by inheriting from Power Supply's IDL interface and C++ implementation. The class RampedPowerSupply simulates the behaviour of a ramped power supply and is derived from the PowerSupply IDL interface. This class shows how to utilize inheritance in both the C++ and IDL class/interface.

Asynchronous calls are implemented using the ...... pattern and the ..... support classes. For each xxx action defined in the IDL interface two methods are provided:

Class RampedPowerSupply also provides the properties rampingStatus and rampingSteps in addition to anything inherited from PowerSupply.

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


Constructor & Destructor Documentation

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

Constructor

Parameters:
poa poa which will activate this and also all other components
name component name

RampedPowerSupply::~RampedPowerSupply  ) 
 

Destructor


Member Function Documentation

virtual baci::ActionRequest RampedPowerSupply::invokeAction int  function,
baci::BACIComponent component_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
component_p owner of the action
callbackID id of the callback to be notified
descIn callback descriptor (passed by client)
value_p 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)

Reimplemented from PowerSupply.

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

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

virtual ACS::RWstring_ptr RampedPowerSupply::rampingStatus  )  [virtual]
 

Returns a reference to the rampingStatus property (status). Implementation of IDL interface for the property.

Returns:
a pointer to the BACI property

virtual ACS::ROlong_ptr RampedPowerSupply::rampingStep  )  [virtual]
 

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

Returns:
a pointer to the BACI property

virtual void RampedPowerSupply::startRamping CORBA::Long  rampingSteps,
ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
[virtual]
 

Starts ramping the power supply. Implementation of IDL startRamping() 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 RampedPowerSupply::startRampingAction The given callback is used to inform the caller when the action is performed.

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

virtual baci::ActionRequest RampedPowerSupply::startRampingAction baci::BACIComponent component_p,
const int &  callbackID,
const CBDescIn descIn,
baci::BACIValue value_p,
Completion completion,
CBDescOut descOut
[virtual]
 

Implementation of async. startRamping() method This is the function that actually starts ramping and, when completed, invokes the callback installed by the client when it requested the action.

Parameters:
component_p Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value_p 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 RampedPowerSupply::stopRamping ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
[virtual]
 

Stops ramping the power supply. Implementation of IDL stopRamping() 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 RampedPowerSupply::stopAction The given callback is used to inform the caller when the action is performed.

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

virtual baci::ActionRequest RampedPowerSupply::stopRampingAction baci::BACIComponent component_p,
const int &  callbackID,
const CBDescIn descIn,
baci::BACIValue value_p,
Completion completion,
CBDescOut descOut
[virtual]
 

Implementation of async. stopRamping() method This is the function that actually stops ramping and, when completed, invokes the callback installed by the client when it requested the action.

Parameters:
component_p Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value_p 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).



Member Data Documentation

baci::SmartPropertyPointer<baci::RWstring> RampedPowerSupply::m_rampingStatus_sp [private]
 

m_rampingStatus_p is the RampedPowerSupply's status in the ramping process.

DevIO<CORBA::Long>* RampedPowerSupply::m_rampingStep_devio_p [private]
 

m_rampingStep_devio_p is the DevIO subclass passed to the RampingStep property when it is created. Essentially the DevIO is used to interact with hardware directly without tying ACS to any specific hardware drivers resulting in added flexibility. Please see acsexmplLongDevIO.h to understand exactly how this is accomplished.

baci::SmartPropertyPointer<baci::ROlong> RampedPowerSupply::m_rampingStep_sp [private]
 

m_rampingStep_p is the RampedPowerSupply's present step in the ramping process.

const int RampedPowerSupply::START_RAMPING = 3 [static]
 

One of these function IDs will be passed to invokeAction().

const int RampedPowerSupply::STOP_RAMPING = 4 [static]
 


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