All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LogPlay.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Nate Koenig
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef _LOGPLAY_HH_
19 #define _LOGPLAY_HH_
20 
21 #include <tinyxml.h>
22 
23 #include <list>
24 #include <string>
25 #include <fstream>
26 
27 #include "common/SingletonT.hh"
28 
29 namespace gazebo
30 {
31  namespace common
32  {
35 
46  class LogPlay : public SingletonT<LogPlay>
47  {
49  private: LogPlay();
50 
52  private: virtual ~LogPlay();
53 
59  public: void Open(const std::string &_logFile);
60 
63  public: bool IsOpen() const;
64 
67  public: bool Step(std::string &_data);
68 
70  private: void ReadHeader();
71 
73  private: TiXmlDocument xmlDoc;
74 
76  private: TiXmlElement *logStartXml;
77 
79  private: TiXmlElement *logCurrXml;
80 
82  private: std::string filename;
83 
85  private: friend class SingletonT<LogPlay>;
86  };
88  }
89 }
90 
91 #endif