/***************************************************************
 * PrAccelSensorIntf.h
 *
 * This is an abstract class providing the interface
 * for derived acceleration sensor classes.
 *
 ****************************************************************/

/*
 * modification history
 *----------------------
 *
 * 02/25/03: Weyn Ong  : created.
 */

#ifndef _PrAccelSensorIntf_h
#define _PrAccelSensorIntf_h

#include "PrDriverIntf.h"

// abstract class
class PrAccelSensorIntf : public PrDriverIntf
{
 public:
    PrAccelSensorIntf(int channelCount=0,int bitCount=0);
    // abstract class needs virtual destructor
    virtual ~PrAccelSensorIntf() {};

    // read force sensor values
    virtual int values(Float *data) = 0;  // implement!
 
    // hardware reset
    virtual int zero() = 0;

    // read a force sensor value from a channel
    virtual int value(int channel,Float &data); 
};

inline PrAccelSensorIntf::PrAccelSensorIntf(int channelCount,int bitCount)
: PrDriverIntf(channelCount,bitCount)
{
    flag( PR_DRIVER_OK );
}
 
inline int 
PrAccelSensorIntf::value(int channel,Float &data) { 
    Float * val = new Float[ channelCount() ];
    values( val );
    data = val[channel];
    return PR_DRIVER_OK; 
}

#endif // _PrAccelSensorIntf_h

