SeaBreeze
EEPROMSlotFeatureBase.h
Go to the documentation of this file.
1 /***************************************************/
30 #ifndef EEPROMSLOTFEATUREBASE_H
31 #define EEPROMSLOTFEATUREBASE_H
32 
35 #include "common/buses/Bus.h"
36 #include "common/SeaBreeze.h"
40 #include <vector>
41 
42 namespace seabreeze {
43 
45  /* Keeping most of this class protected to force use of the derived
46  * classes, e.g. EEPROMSlotFeature, which can provide better control
47  * over which slots are accessed.
48  */
49 
50  protected:
51 
53  virtual ~EEPROMSlotFeatureBase();
54  virtual std::vector<byte> *readEEPROMSlot(const Protocol &protocol,
55  const Bus &bus, unsigned int slot) throw (FeatureException, IllegalArgumentException);
56  virtual int writeEEPROMSlot(const Protocol &protocol,
57  const Bus &bus, unsigned int slot, const std::vector<byte> &data)
59 
60  /* This is a utility function that reads out the given EEPROM slot and
61  * parses it into a double value. If for some reason the parse fails,
62  * this will throw a NumberFormatException.
63  */
64  double readDouble(const Protocol &protocol, const Bus &bus,
65  unsigned int slot) throw (FeatureException, NumberFormatException);
66 
67  /* As with readDouble(), this will read a slot and parse into an integer */
68  long readLong(const Protocol &protocol, const Bus &bus,
69  unsigned int slot) throw (FeatureException, NumberFormatException);
70 
71  };
72 
73 }
74 
75 #endif /* EEPROMSLOTFEATUREBASE_H */
Definition: Protocol.h:44
Definition: FeatureImpl.h:54
Definition: NumberFormatException.h:42
Definition: FeatureException.h:43
Definition: Bus.h:48
Encapsulates all SeaBreeze classes.
Definition: DeviceFactory.h:42
Definition: EEPROMSlotFeatureBase.h:44
Definition: IllegalArgumentException.h:43