Sensor.h 743 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
// Sensor.h

// This is the abstract base class for all of the individual
// measurement code, filters, and others. It includes code which
// allows a Sensor to represent a polymorphic list.

#ifndef SENSOR_H_STUB_2
#define SENSOR_H_STUB_2

10 11
#include "log.h"

12 13
class Sensor
{
14 15 16 17
public:
  virtual ~Sensor();
  Sensor * getTail(void);
  void addNode(std::auto_ptr<Sensor> node);
18
  void capturePacket(PacketInfo * packet);
19 20 21
private:
  std::auto_ptr<Sensor> next;
protected:
22 23 24 25 26 27 28
  virtual void localSend(PacketInfo * packet)=0;
  virtual void localAck(PacketInfo * packet)=0;
};

class NullSensor : public Sensor
{
public:
29
  virtual ~NullSensor();
30
protected:
31
  virtual void localSend(PacketInfo *);
32
  virtual void localAck(PacketInfo * packet);
33 34 35
};

#endif