MOOS 0.2375
/home/toby/moos-ivp/MOOS-2375-Oct0611/Tools/Graphical/uIndexedPlayBack/MOOSPlayBackIndex.h
Go to the documentation of this file.
00001 
00002 //
00003 //   MOOS - Mission Oriented Operating Suite 
00004 //  
00005 //   A suit of Applications and Libraries for Mobile Robotics Research 
00006 //   Copyright (C) 2001-2005 Massachusetts Institute of Technology and 
00007 //   Oxford University. 
00008 //    
00009 //   This software was written by Paul Newman at MIT 2001-2002 and Oxford 
00010 //   University 2003-2005. email: pnewman@robots.ox.ac.uk. 
00011 //      
00012 //   This file is part of a  MOOS Utility Component. 
00013 //        
00014 //   This program is free software; you can redistribute it and/or 
00015 //   modify it under the terms of the GNU General Public License as 
00016 //   published by the Free Software Foundation; either version 2 of the 
00017 //   License, or (at your option) any later version. 
00018 //          
00019 //   This program is distributed in the hope that it will be useful, 
00020 //   but WITHOUT ANY WARRANTY; without even the implied warranty of 
00021 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
00022 //   General Public License for more details. 
00023 //            
00024 //   You should have received a copy of the GNU General Public License 
00025 //   along with this program; if not, write to the Free Software 
00026 //   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 
00027 //   02111-1307, USA. 
00028 //
00030 // MOOSPlayBack.h: interface for the CMOOSPlayBack class.
00031 //
00033 
00034 #if !defined(AFX_MOOSPLAYBACK_H__326FF11A_6E11_425E_8626_C016072CF8CC__INCLUDED_)
00035 #define AFX_MOOSPLAYBACK_H__326FF11A_6E11_425E_8626_C016072CF8CC__INCLUDED_
00036 
00037 #include <MOOSGenLib/MOOSGenLib.h>
00038 #include <MOOSLIB/MOOSLib.h>
00039 
00040 using namespace std;
00041 
00042 #include <string>
00043 #include <list>
00044 #include <iostream>
00045 #include <fstream>
00046 #include <set>
00047 
00048 //#include <MOOSUtilityLib/MOOSMemoryMapped.h>
00049 #include "ALogIndexWrapper.h"
00050 
00051 typedef set<string> STRING_SET;
00052 class CMOOSPlayBackIndex  
00053 {
00054 public:
00055     
00056     //CMOOSMemMappedAlogFile m_ALog;
00057     ALogIndexWrapper m_ALog;
00058     
00059     bool SetLastTimeProcessed(double dfTime);
00060     string GetStatusString();
00061     bool IsWaitingForClient();
00062     double GetLastMessageTime();
00063     bool ClearFilter();
00064     bool Filter(const std::string & sSrc, bool bWanted);
00065     bool IsFiltered(const std::string & sSrc);
00066     bool SetTickInterval(double dfInterval);
00067     bool Reset();
00068     bool IsEOF();
00069     bool Iterate(MOOSMSG_LIST & Output);
00070     double GetFinishTime();
00071     double GetStartTime();
00072     int GetCurrentLine();
00073     double GetTimeNow();
00074     int GetSize();
00075     bool IsOpen();
00076     bool Initialise(const string & sFileName);
00077     STRING_SET GetSources(){return m_ALog.GetSourceNames();};
00078     CMOOSPlayBackIndex();
00079     virtual ~CMOOSPlayBackIndex();
00080 
00081     string m_sFileName;
00082     ifstream m_InputFile;
00083     double m_dfLastMessageTime;
00084     int m_nLastLine;
00085     double m_dfTickTime;
00086     double m_dfLastClientProcessedTime;
00087     double m_dfClientLagTime;
00088 
00089 protected:
00090     std::string m_sBinaryFileName;
00091     std::ifstream m_BinaryFile;
00092     bool m_bWaitingForClientCatchup;
00093     double m_dfLogStart;
00094 
00095     bool MessageFromLine(const std::string & sLine,CMOOSMsg & Msg);    
00096     STRING_SET m_SourceFilter;
00097 
00098     int m_nCurrentLine;
00099 public:
00100     bool GotoTime(double dfT);
00101 };
00102 
00103 #endif // !defined(AFX_MOOSPLAYBACK_H__326FF11A_6E11_425E_8626_C016072CF8CC__INCLUDED_)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines