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

PowerSupply Class Reference

#include <acsexmplPowerSupplyImpl.h>

Inheritance diagram for PowerSupply:

Inheritance graph
[legend]
Collaboration diagram for PowerSupply:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PowerSupply (const ACE_CString &name, maci::ContainerServices *containerServices)
virtual ~PowerSupply ()
virtual ActionRequest invokeAction (int function, BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual ActionRequest onAction (BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual ActionRequest offAction (BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual ActionRequest resetAction (BACIComponent *component_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 void reset (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc) throw (CORBA::SystemException)
virtual ACS::RWdouble_ptr current () throw (CORBA::SystemException)
virtual ACS::ROdouble_ptr readback () throw (CORBA::SystemException)
virtual ACS::ROpattern_ptr status () throw (CORBA::SystemException)
virtual void execute () throw (ACSErr::ACSbaseExImpl)

Protected Attributes

SmartPropertyPointer< ROpatternm_status_sp

Private Member Functions

void operator= (const PowerSupply &)

Private Attributes

SmartPropertyPointer< ROdoublem_readback_sp
SmartPropertyPointer< PowerSupplyCurrentm_current_sp

Detailed Description

The class PowerSupply simulates the behaviour of a power supply. It provides three methods: on, off and reset. It also provides the properties current, readback and status. 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: acsexmplPowerSupplyImpl.h,v 1.102 2006/04/20 08:47:59 bjeram Exp $"


Constructor & Destructor Documentation

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

Constructor

Parameters:
name component name
containerService A pointer to the container services

virtual PowerSupply::~PowerSupply  )  [virtual]
 

Destructor


Member Function Documentation

virtual ACS::RWdouble_ptr PowerSupply::current  )  throw (CORBA::SystemException) [virtual]
 

Returns a reference to the current_p property (commanded current). Implementation of IDL interface for the property.

Returns:
a pointer to the property

virtual void PowerSupply::execute  )  throw (ACSErr::ACSbaseExImpl) [virtual]
 

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).

Returns:
void

Reimplemented from acscomponent::ACSComponentImpl.

virtual ActionRequest PowerSupply::invokeAction int  function,
BACIComponent *  component_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
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 Callback::working
  • reqInvokeDone - invoke Callback::done and destroy callback
  • reqDestroy - destroy callback (callback should has been called already by function)

Implements baci::ActionImplementator.

Reimplemented in RampedPowerSupply.

virtual void PowerSupply::off ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
throw (CORBA::SystemException) [virtual]
 

Switches off the power supply. 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 PowerSupply::offAction 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 ActionRequest PowerSupply::offAction BACIComponent *  component_p,
const int &  callbackID,
const CBDescIn descIn,
BACIValue value_p,
Completion completion,
CBDescOut descOut
[virtual]
 

Implementation of async. off() method This is the function that actually switches off the PowerSupply 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 Callback::working.
  • reqInvokeDone - Invoke Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should has been called already by function).


virtual void PowerSupply::on ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
throw (CORBA::SystemException) [virtual]
 

Switches on the power supply. 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 PowerSupply::onAction 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 ActionRequest PowerSupply::onAction BACIComponent *  component_p,
const int &  callbackID,
const CBDescIn descIn,
BACIValue value_p,
Completion completion,
CBDescOut descOut
[virtual]
 

Implementation of async. on() method This is the function that actually switches on the PowerSupply 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 Callback::working.
  • reqInvokeDone - Invoke Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should has been called already by function).


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

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

virtual ACS::ROdouble_ptr PowerSupply::readback  )  throw (CORBA::SystemException) [virtual]
 

Returns a reference to the readback_p property (actual current). Implementation of IDL interface for the property.

Returns:
a pointer to the property

virtual void PowerSupply::reset ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
throw (CORBA::SystemException) [virtual]
 

Resets the power supply. Implementation of IDL reset() 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 PowerSupply::resetAction 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 ActionRequest PowerSupply::resetAction BACIComponent *  component_p,
const int &  callbackID,
const CBDescIn descIn,
BACIValue value_p,
Completion completion,
CBDescOut descOut
[virtual]
 

Implementation of async. reset() method This is the function that actually resets the PowerSupply 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 Callback::working.
  • reqInvokeDone - Invoke Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should has been called already by function).


virtual ACS::ROpattern_ptr PowerSupply::status  )  throw (CORBA::SystemException) [virtual]
 

Returns a reference to the status_p property (see acsexmplPowerSupplyImpl.cpp). Implementation of IDL interface for the property.

Returns:
a pointer to the property


Member Data Documentation

SmartPropertyPointer<PowerSupplyCurrent> PowerSupply::m_current_sp [private]
 

m_current_sp is the commanded current.

SmartPropertyPointer<ROdouble> PowerSupply::m_readback_sp [private]
 

m_readback_sp is the actual value of PowerSupply's current.

SmartPropertyPointer<ROpattern> PowerSupply::m_status_sp [protected]
 

m_status_sp is the PowerSupply's state (values are in CDB).


The documentation for this class was generated from the following file:
Generated on Sun Oct 29 02:31:15 2006 for ACS C++ API by doxygen 1.3.6