##

LogPlay.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_UTIL_LOGPLAY_HH_
#define _GAZEBO_UTIL_LOGPLAY_HH_
#include <memory>
#include <string>
#include "gazebo/common/SingletonT.hh"
#include "gazebo/common/Time.hh"
#include "gazebo/util/system.hh"
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo, util, LogPlay)
namespace gazebo
{
namespace util
{
// Forward declare private data class
class LogPlayPrivate;
class GZ_UTIL_VISIBLE LogPlay : public SingletonT<LogPlay>
{
private: LogPlay();
private: virtual ~LogPlay();
public: void Open(const std::string &_logFile);
public: bool IsOpen() const;
public: std::string LogVersion() const;
public: std::string GazeboVersion() const;
public: uint32_t RandSeed() const;
public: common::Time LogStartTime() const;
public: common::Time LogEndTime() const;
public: std::string Filename() const;
public: std::string FullPathFilename() const;
public: uintmax_t FileSize() const;
public: bool Step(std::string &_data);
public: bool StepBack(std::string &_data);
public: bool Step(const int _step, std::string &_data);
public: bool Seek(const common::Time &_time);
public: bool Rewind();
public: bool Forward();
public: unsigned int ChunkCount() const;
public: bool Chunk(const unsigned int _index, std::string &_data) const;
public: std::string Encoding() const;
public: std::string Header() const;
public: uint64_t InitialIterations() const;
public: bool HasIterations() const;
private: void ReadHeader();
private: void ReadLogTimes();
private: bool ReadIterations();
private: bool NextChunk();
private: bool PrevChunk();
private: std::unique_ptr<LogPlayPrivate> dataPtr;
private: friend class SingletonT<LogPlay>;
};
}
}
#endif
Time.hh
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo
gazebo
Definition: LogPlay.hh:28
gazebo::common::Time
A Time class, can be used to hold wall- or sim-time. stored as sec and nano-sec.
Definition: Time.hh:47
SingletonT
Singleton template class.
Definition: SingletonT.hh:33
gazebo::util::LogPlay
Definition: LogPlay.hh:50
system.hh
util
util
Definition: LogPlay.hh:28
GZ_SINGLETON_DECLARE
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61
SingletonT.hh