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
|
localhistory.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 HYDROICEUTIL_LOCAL_HISTORY_H 00012 #define HYDROICEUTIL_LOCAL_HISTORY_H 00013 00014 #include <hydroutil/history.h> 00015 #include <hydroutil/properties.h> 00016 #include <hydroutil/uncopyable.h> 00017 #include <gbxsickacfr/gbxiceutilacfr/timer.h> 00018 00019 #include <IceUtil/Mutex.h> 00020 #include <memory> 00021 00022 namespace hydroiceutil 00023 { 00024 00053 class LocalHistory : public hydroutil::History, 00054 public hydroutil::Uncopyable 00055 { 00056 public: 00058 LocalHistory( const hydroutil::Properties& props=hydroutil::Properties() ); 00059 ~LocalHistory(); 00060 00061 // from hydroutil::History 00062 virtual void report( const std::string& message="" ); 00063 virtual bool isEnabled() const { return enabled_; }; 00064 virtual int autoSaveInterval() const { return autoSaveInterval_; }; 00065 00066 private: 00067 00068 virtual void flush(); 00069 virtual void maybeFlush(); 00070 00071 // these are not touched after the constructor (no need to protect them) 00072 bool enabled_; 00073 int autoSaveInterval_; 00074 00075 IceUtil::Mutex mutex_; 00076 00077 std::string message_; 00078 std::auto_ptr<std::fstream> file_; 00079 // the starting write position in the history file. 00080 std::streampos startPos_; 00081 // line width used for history (it is the maximum length of all progress 00082 // reports so far) 00083 int lineWidth_; 00084 00085 gbxiceutilacfr::Timer runTimer_; 00086 gbxiceutilacfr::Timer flushTimer_; 00087 00088 // currently not using these 00089 hydroutil::Properties properties_; 00090 }; 00091 00092 } // namespace 00093 00094 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)