|
orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
utils/snapshotlogger/mainthread.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2007 Alexei Makarenko, Alex Brooks 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef MAIN_THREAD_H 00012 #define MAIN_THREAD_H 00013 00014 #include <orcaice/subsystemthread.h> 00015 #include <orcaice/context.h> 00016 #include <orcalog/orcalog.h> 00017 #include <hydrodll/dll.h> 00018 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00019 #include <string> 00020 #include <memory> 00021 #include <orcaifaceimpl/button.h> 00022 00023 namespace snapshotlogger 00024 { 00025 00026 class MainThread: public orcaice::SubsystemThread, 00027 public gbxiceutilacfr::NotifyHandler<bool> 00028 { 00029 public: 00030 MainThread( const orcaice::Context& context ); 00031 ~MainThread(); 00032 00033 // from gbxiceutilacfr::NotifyHandler -- called on re-init request 00034 // (the value of the bool is meaningless) 00035 virtual void handleData( const bool &request ) 00036 { requestStore_.set( request ); } 00037 00038 private: 00039 // from SubsystemThread 00040 virtual void initialise(); 00041 virtual void work(); 00042 00043 void initLoggers(); 00044 void initInterface(); 00045 void loadPluginLibraries( const std::string &factoryLibNames ); 00046 // throws exceptions if it can't create the logger 00047 orcalog::SnapshotLogger *createLogger( const std::string &interfaceType ); 00048 std::string filenamePrefix(); 00049 orcalog::MasterFileWriter *createMasterFileWriter( const std::string &filenamePrefix ); 00050 00051 void takeSnapshot(); 00052 00053 std::vector<orcalog::SnapshotLoggerFactory*> logFactories_; 00054 std::vector<hydrodll::DynamicallyLoadedLibrary*> libraries_; 00055 00056 // The guys that write the data files 00057 std::vector<orcalog::SnapshotLogger*> snapshotLoggers_; 00058 // Information about them 00059 std::vector<orcalog::LogWriterInfo> logWriterInfos_; 00060 00061 // interface to handle requests to take a snapshot 00062 orcaifaceimpl::ButtonImplPtr buttonInterface_; 00063 00064 // Holds incoming requests to take snapshots 00065 // (the value of the bool's are meaningless) 00066 gbxiceutilacfr::Store<bool> requestStore_; 00067 00068 bool useFilenameTimestamps_; 00069 00070 orcaice::Context context_; 00071 }; 00072 00073 } // namespace 00074 00075 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)
1.4.5