retriever_thread.h

00001
00002 /***************************************************************************
00003  *  retriever_thread.h - FireVision Retriever Thread
00004  *
00005  *  Created: Tue Jun 26 17:37:38 2007
00006  *  Copyright  2006-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022
00023 #ifndef __FIREVISION_APPS_RETRIEVER_RETRIEVER_THREAD_H_
00024 #define __FIREVISION_APPS_RETRIEVER_RETRIEVER_THREAD_H_
00025 
00026 #include <core/threading/thread.h>
00027
00028 #include <aspect/configurable.h>
00029 #include <aspect/logging.h>
00030 #include <aspect/vision.h>
00031
00032 class Camera;
00033 class SharedMemoryImageBuffer;
00034 class SeqWriter;
00035 class ColorModelLookupTable;
00036 namespace fawkes {
00037   class TimeTracker;
00038 }
00039
00040 class FvRetrieverThread
00041 : public fawkes::Thread,
00042   public fawkes::ConfigurableAspect,
00043   public fawkes::LoggingAspect,
00044   public fawkes::VisionAspect
00045 {
00046  public:
00047   FvRetrieverThread(const char *camera_string, const char *id);
00048   virtual ~FvRetrieverThread();
00049
00050   virtual void init();
00051   virtual void finalize();
00052   virtual void loop();
00053 
00054  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
00055  protected: virtual void run() { Thread::run(); }
00056
00057  private:
00058   char *__id;
00059   char *__camera_string;
00060
00061   Camera *cam;
00062   SharedMemoryImageBuffer *shm;
00063   SeqWriter *seq_writer;
00064   fawkes::TimeTracker *__tt;
00065   unsigned int __loop_count;
00066   unsigned int __ttc_capture;
00067   unsigned int __ttc_memcpy;
00068   unsigned int __ttc_dispose;
00069
00070   ColorModelLookupTable *__cm;
00071 };
00072
00073
00074 #endif