INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
hydrodrivers/hydrogpsfake/driver.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDRO_GPS_FAKE_H 00012 #define HYDRO_GPS_FAKE_H 00013 00014 #include <hydrointerfaces/gps.h> 00015 00016 namespace gpsfake { 00017 00018 // 00019 // Bogus driver, useful for testing the rest of the component. 00020 // 00021 class Driver : public hydrointerfaces::Gps 00022 { 00023 00024 public: 00025 00026 Driver( const Config &cfg, const hydroutil::Context &context ); 00027 00028 virtual void read( hydrointerfaces::Gps::Data &data ); 00029 00030 private: 00031 00032 std::vector<double> latitudes_; 00033 std::vector<double> longitudes_; 00034 unsigned int numReads_; 00035 unsigned int dataRecord_; 00036 int fixCounter_; 00037 00038 bool neverSeeSatellites_; 00039 00040 Gps::Config config_; 00041 hydroutil::Context context_; 00042 }; 00043 00044 // Used for dynamically loading driver 00045 class Factory : public hydrointerfaces::GpsFactory 00046 { 00047 public: 00048 hydrointerfaces::Gps *createDriver( 00049 const hydrointerfaces::Gps::Config &config, 00050 const hydroutil::Context &context ) const 00051 { 00052 return new Driver( config, context ); 00053 } 00054 }; 00055 00056 } // namespace 00057 00058 // Used for dynamically loading driver 00059 extern "C" { 00060 hydrointerfaces::GpsFactory *createGpsDriverFactory(); 00061 } 00062 00063 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)