LogPlayPrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2016 Open Source Robotics Foundation
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 #ifndef _GAZEBO_UTIL_LOGPLAY_PRIVATE_HH_
18 #define _GAZEBO_UTIL_LOGPLAY_PRIVATE_HH_
19 
20 #include <tinyxml2.h>
21 #include <mutex>
22 #include <string>
23 
24 #include "gazebo/common/Time.hh"
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
29  namespace util
30  {
34  {
36  public: const unsigned int kNumChunksToTry = 2u;
37 
39  public: const std::string kStartFrame = "<sdf ";
40 
42  public: const std::string kEndFrame = "</sdf>";
43 
45  public: const std::string kStartTime = "<sim_time>";
46 
48  public: const std::string kEndTime = "</sim_time>";
49 
51  public: tinyxml2::XMLDocument xmlDoc;
52 
54  public: tinyxml2::XMLElement *logStartXml;
55 
57  public: tinyxml2::XMLElement *logCurrXml;
58 
60  public: std::string filename;
61 
64  public: std::string logVersion;
65 
67  public: std::string gazeboVersion;
68 
70  public: uint32_t randSeed;
71 
74 
77 
79  public: std::string encoding;
80 
82  public: std::string currentChunk;
83 
86  public: size_t start;
87 
90  public: size_t end;
91 
93  public: uint64_t initialIterations;
94 
97  public: bool iterationsFound;
98 
100  public: std::mutex mutex;
101  };
102  }
103 }
104 #endif
size_t start
The current chunk might contain multiple frames.
Definition: LogPlayPrivate.hh:86
std::mutex mutex
A mutex to avoid race conditions.
Definition: LogPlayPrivate.hh:100
tinyxml2::XMLElement * logStartXml
Start of the log.
Definition: LogPlayPrivate.hh:54
tinyxml2::XMLDocument xmlDoc
The XML document of the log file.
Definition: LogPlayPrivate.hh:51
const std::string kStartTime
XML tag delimiting the beginning of a simulation time element.
Definition: LogPlayPrivate.hh:45
std::string encoding
The encoding for the current chunk in the log file.
Definition: LogPlayPrivate.hh:79
const std::string kEndFrame
XML tag delimiting the end of a frame.
Definition: LogPlayPrivate.hh:42
std::string logVersion
The version of the Gazebo logger used to create the open log file.
Definition: LogPlayPrivate.hh:64
tinyxml2::XMLElement * logCurrXml
Current position in the log file.
Definition: LogPlayPrivate.hh:57
std::string gazeboVersion
The version of Gazebo used to create the open log file.
Definition: LogPlayPrivate.hh:67
const unsigned int kNumChunksToTry
Max number of chunks to inspect when looking for XML elements.
Definition: LogPlayPrivate.hh:36
uint64_t initialIterations
Initial simulation iteration contained in the log file.
Definition: LogPlayPrivate.hh:93
std::string filename
Name of the log file.
Definition: LogPlayPrivate.hh:60
size_t end
The current chunk might contain multiple frames.
Definition: LogPlayPrivate.hh:90
Definition: LogPlayPrivate.hh:33
const std::string kEndTime
XML tag delimiting the end of a simulation time element.
Definition: LogPlayPrivate.hh:48
uint32_t randSeed
The random number seed recorded in the open log file.
Definition: LogPlayPrivate.hh:70
common::Time logStartTime
Log start time (simulation time).
Definition: LogPlayPrivate.hh:73
std::string currentChunk
This is the chunk where the current frame is contained.
Definition: LogPlayPrivate.hh:82
bool iterationsFound
True if <iterations> is found in the log file.
Definition: LogPlayPrivate.hh:97
common::Time logEndTime
Log end time (simulation time).
Definition: LogPlayPrivate.hh:76
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44
const std::string kStartFrame
XML tag delimiting the beginning of a frame.
Definition: LogPlayPrivate.hh:39