Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

PListSensorDriver.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_PListSensorDriver_h_
00003 #define INCLUDED_PListSensorDriver_h_
00004 
00005 #include "DataStreamDriver.h"
00006 
00007 //! Accepts a stream of plist packets, each containing dictionaries for output, button, and sensor values (see DynamicRobotState)
00008 class PListSensorDriver : public DataStreamDriver {
00009 public:
00010   explicit PListSensorDriver(const std::string& name)
00011     : DeviceDriver(autoRegisterDriver,name), DataStreamDriver(autoRegisterDriver,name)
00012   {
00013     for(unsigned int i=0; i<NumOutputs; ++i)
00014       providing[i] = false;
00015   }
00016   
00017   virtual std::string getClassName() const { return autoRegisterDriver; }
00018   
00019   virtual void getSensorSources(std::map<std::string,DataSource*>& sources) {
00020     sources.clear();
00021     sources["Sensors"]=this;
00022   }
00023   
00024   virtual void deregisterSource();
00025   
00026 protected:
00027   virtual bool readData(std::istream& is);
00028   
00029   bool providing[NumOutputs];  //!< outputs which are being provided by the input stream, so we can claim them and block local feedback
00030   
00031 private:
00032   //! holds the class name, set via registration with the DeviceDriver registry
00033   static const std::string autoRegisterDriver;
00034   PListSensorDriver(const PListSensorDriver&); //!< don't call
00035   PListSensorDriver& operator=(const PListSensorDriver&); //!< don't call
00036 };
00037 
00038 /*! @file
00039  * @brief Describes PListSensorDriver, which accepts a stream of plist packets, each containing dictionaries for output, button, and sensor values
00040  * @author Ethan Tira-Thompson (ejt) (Creator)
00041  */
00042 
00043 #endif

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:39 2016 by Doxygen 1.6.3