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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

utils/snapshotlogger/mainthread.h

00001 /*
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 <gbxsickacfr/gbxiceutilacfr/subsystemthread.h>
00015 #include <orcaice/context.h>
00016 #include <orcalog/orcalog.h>
00017 #include <hydrodll/dll.h>
00018 #include <string>
00019 #include <memory>
00020 #include <orcaifaceimpl/buttonImpl.h>
00021 
00022 namespace snapshotlogger
00023 {
00024 
00025 class MainThread: public gbxsickacfr::gbxiceutilacfr::SubsystemThread,
00026                   public gbxsickacfr::gbxiceutilacfr::NotifyHandler<bool>
00027 {       
00028 public:
00029     MainThread( const orcaice::Context& context );
00030     ~MainThread();
00031 
00032     // from SubsystemThread
00033     virtual void walk();
00034 
00035     // from gbxsickacfr::gbxiceutilacfr::NotifyHandler -- called on re-init request
00036     // (the value of the bool is meaningless)
00037     virtual void handleData( const bool &request )
00038         { requestStore_.set( request ); }
00039 
00040 private:
00041 
00042     void initLoggers();
00043     void initInterface();
00044     void loadPluginLibraries( const std::string &factoryLibNames );
00045     // throws exceptions if it can't create the logger
00046     orcalog::SnapshotLogger *createLogger( const std::string &interfaceType );
00047     std::string filenamePrefix();
00048     orcalog::MasterFileWriter *createMasterFileWriter( const std::string &filenamePrefix );
00049 
00050     void takeSnapshot();
00051 
00052     std::vector<orcalog::SnapshotLoggerFactory*>     logFactories_;
00053     std::vector<hydrodll::DynamicallyLoadedLibrary*> libraries_;
00054 
00055     // The guys that write the data files
00056     std::vector<orcalog::SnapshotLogger*> snapshotLoggers_;
00057     // Information about them
00058     std::vector<orcalog::LogWriterInfo> logWriterInfos_;
00059 
00060     // interface to handle requests to take a snapshot
00061     orcaifaceimpl::ButtonImplPtr buttonInterface_;
00062 
00063     // Holds incoming requests to take snapshots
00064     // (the value of the bool's are meaningless)
00065     gbxsickacfr::gbxiceutilacfr::Store<bool> requestStore_;
00066 
00067     bool useFilenameTimestamps_;
00068 
00069     orcaice::Context context_;
00070 };
00071 
00072 } // namespace
00073 
00074 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5