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

OSCAR::TwoStateSwitch Class Reference
[Device]

Base class for all switches that support On and Off functionality. More...

#include <TwoStateSwitch.h>

Inheritance diagram for OSCAR::TwoStateSwitch:

Inheritance graph
[legend]
List of all members.

Public Methods

 TwoStateSwitch (const String &name=String(), OSCARError &err=DUMMY_ERROR(noError))
 TwoStateSwitch (const TwoStateSwitch &TwoStateSwitch)
TwoStateSwitch & operator= (const TwoStateSwitch &)
virtual ~TwoStateSwitch ()
virtual bool On ()
virtual bool Off ()=0
bool GetState () const

Protected Attributes

bool state

Detailed Description

Author:
Chetan Kapoor


Constructor & Destructor Documentation

OSCAR::TwoStateSwitch::TwoStateSwitch const String   name = String(),
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor for TwoStateSwitch.

Parameters:
name Name you want to assign to object. Default is " ".
err An OSCARError object that on return will hold the value of the error code that was generated when the constructor was called. If this error was not 'noError' you can call GetError() to get the details of the error code.

OSCAR::TwoStateSwitch::TwoStateSwitch const TwoStateSwitch &    TwoStateSwitch
 

virtual OSCAR::TwoStateSwitch::~TwoStateSwitch   [inline, virtual]
 


Member Function Documentation

bool OSCAR::TwoStateSwitch::GetState   const
 

Query whether the switch is on or off.

Returns:
true if switch is on and false if switch is off. A false is also returned if the TwoStateSwitch has not been initialized by a call to the Initialize() method.
See also:
On()

Off()

virtual bool OSCAR::TwoStateSwitch::Off   [pure virtual]
 

Method to turn switch Off() Call to this method should return immediately. Override this method in derived classes. For this class, all this method does is to check whether Initialize() has been called. As such, derived classes should call TwoStateSwitch::Off() and check its return value before proceeding.

Returns:
true or false. If false, call GetError() to get detailed error information
See also:
On()
Exceptions:
notInitialized notInitialized

Implemented in OSCAR::Relay, and OSCAR::ToolChanger.

virtual bool OSCAR::TwoStateSwitch::On   [virtual]
 

Method to turn switch On() Call to this method should return immediately. Override this method in derived classes. For this class, all this method does is to check whether Initialize() has been called. As such, derived classes should call TwoStateSwitch::On() and check its return value before proceeding.

Returns:
true or false. If false, call GetError() to get detailed error information
See also:
Off()
Exceptions:
notInitialized notInitialized

Reimplemented in OSCAR::Relay, and OSCAR::ToolChanger.

TwoStateSwitch& OSCAR::TwoStateSwitch::operator= const TwoStateSwitch &   
 


Member Data Documentation

bool OSCAR::TwoStateSwitch::state [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations