orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
imagefake/driver.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 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_IMAGE_FAKE_H 00012 #define HYDRO_IMAGE_FAKE_H 00013 00014 #include <hydrointerfaces/image.h> 00015 00016 namespace imagefake { 00017 00018 // 00019 // Bogus image driver, useful for testing the rest of the component. 00020 // 00021 class Driver : public hydrointerfaces::Image 00022 { 00023 00024 public: 00025 00026 Driver( const Config &cfg, const hydroutil::Context &context ); 00027 virtual ~Driver(); 00028 00029 // Blocks till new data is available 00030 virtual void read( hydrointerfaces::Image::Data &data ); 00031 00032 private: 00033 00034 Image::Config config_; 00035 hydroutil::Context context_; 00036 }; 00037 00038 // Used for dynamically loading driver 00039 class Factory : public hydrointerfaces::ImageFactory 00040 { 00041 public: 00042 hydrointerfaces::Image *createDriver( 00043 const hydrointerfaces::Image::Config &config, 00044 const hydroutil::Context &context ) const 00045 { 00046 return new Driver( config, context ); 00047 } 00048 }; 00049 00050 } // namespace 00051 00052 // Used for dynamically loading driver 00053 extern "C" { 00054 hydrointerfaces::ImageFactory *createDriverFactory(); 00055 } 00056 00057 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)