Actuator Class Reference

#include <Actuator.h>

Inheritance diagram for Actuator:

Inheritance graph
[legend]
List of all members.

Detailed Description

Interface class for objects that provide some form of actuation within the system.

Note: this class is intentionally not written as a purely abstract class. For simple methods, such as getType() it's not prudent to consume the extra vtable and call sequence overhead in order to allow anyone to subclass how getType() works. Should this become a problem, it can certainly be altered, but the intention is to keep it 'featherweight'.


Public Types

enum  ActuatorType {
  INJECTOR,
  IDLE_AIR_CONTROLLER,
  FUEL_PUMP,
  INDICATOR,
  COIL
}
enum  Status {
  OK,
  FAILED
}

Public Member Functions

ActuatorType getType ()
 Returns the type of Actuator.
char getChannel ()
 Returns the channel number.
virtual Status setState (int state)=0
 Sets the current state of the actuator.
virtual int getState ()=0
 Gets the current state of the actuator.
virtual ~Actuator ()
 virtual destructor

Protected Member Functions

 Actuator (ActuatorType t, char ch)
 Constructor, requires the ActuatorType is passed during initialization.

Protected Attributes

const ActuatorType type
 A constant to hold the actuator type.
const char channel
 A constant to hold the channel.


Member Enumeration Documentation

enum Actuator::ActuatorType
 

Enumerator:
INJECTOR  Injector.
IDLE_AIR_CONTROLLER  Idle Air Controller.
FUEL_PUMP  Fuel Pump.
INDICATOR  Indictor (typically LED, etc.

)

COIL  COIL.

enum Actuator::Status
 

Enumerator:
OK  Success.
FAILED  A problem occured.


Constructor & Destructor Documentation

virtual Actuator::~Actuator  )  [inline, virtual]
 

virtual destructor

Actuator::Actuator ActuatorType  t,
char  ch
[inline, protected]
 

Constructor, requires the ActuatorType is passed during initialization.

Parameters:
type of the actuator
ch channel for the actuator


Member Function Documentation

char Actuator::getChannel  )  [inline]
 

Returns the channel number.

Returns:
Channel

virtual int Actuator::getState  )  [pure virtual]
 

Gets the current state of the actuator.

Returns:
the current state

Implemented in LEDActuator.

ActuatorType Actuator::getType  )  [inline]
 

Returns the type of Actuator.

Returns:
ActuatorType

virtual Status Actuator::setState int  state  )  [pure virtual]
 

Sets the current state of the actuator.

Parameters:
state integer value specifying the state. Should be an emumeration that is extended in the subclass, but it can't be due to a limitation of this language.
Returns:
Status

Implemented in LEDActuator.


Member Data Documentation

const char Actuator::channel [protected]
 

A constant to hold the channel.

const ActuatorType Actuator::type [protected]
 

A constant to hold the actuator type.


The documentation for this class was generated from the following file:
Generated on Tue Sep 19 14:04:47 2006 for MegaPlusPlus by  doxygen 1.4.6