LogPlay Class Reference

#include <LogPlay.hh>

Inherits SingletonT< LogPlay >.

Public Member Functions

bool Chunk (const unsigned int _index, std::string &_data) const
 Get data for a particular chunk index. More...
 
unsigned int ChunkCount () const
 Get the number of chunks (steps) in the open log file. More...
 
std::string Encoding () const
 Get the type of encoding used for current chunck in the open log file. More...
 
std::string Filename () const
 Get the name of the log file. More...
 
uintmax_t FileSize () const
 Get the size of the log file. More...
 
bool Forward ()
 Jump to the end of the log file. More...
 
std::string FullPathFilename () const
 Get the full path of the log file. More...
 
std::string GazeboVersion () const
 Get the Gazebo version number of the open log file. More...
 
bool GetChunk (unsigned int _index, std::string &_data) GAZEBO_DEPRECATED(7.0)
 Get data for a particular chunk index. More...
 
unsigned int GetChunkCount () const GAZEBO_DEPRECATED(7.0)
 Get the number of chunks (steps) in the open log file. More...
 
std::string GetEncoding () const GAZEBO_DEPRECATED(7.0)
 Get the type of encoding used for current chunck in the open log file. More...
 
std::string GetFilename () const GAZEBO_DEPRECATED(7.0)
 Get the name of the log file. More...
 
uintmax_t GetFileSize () const GAZEBO_DEPRECATED(7.0)
 Get the size of the log file. More...
 
std::string GetFullPathFilename () const GAZEBO_DEPRECATED(7.0)
 Get the full path of the log file. More...
 
std::string GetGazeboVersion () const GAZEBO_DEPRECATED(7.0)
 Get the Gazebo version number of the open log file. More...
 
std::string GetHeader () const GAZEBO_DEPRECATED(7.0)
 Get the header that was read from a log file. More...
 
uint64_t GetInitialIterations () const GAZEBO_DEPRECATED(7.0)
 Get the initial simulation iterations from a log file. More...
 
common::Time GetLogEndTime () const GAZEBO_DEPRECATED(7.0)
 Get the log end time of the open log file. More...
 
common::Time GetLogStartTime () const GAZEBO_DEPRECATED(7.0)
 Get the log start time of the open log file. More...
 
std::string GetLogVersion () const GAZEBO_DEPRECATED(7.0)
 Get the log version number of the open log file. More...
 
uint32_t GetRandSeed () const GAZEBO_DEPRECATED(7.0)
 Get the random number seed of the open log file. More...
 
bool HasIterations () const
 Return if the log file contains the <iterations> tag. More...
 
std::string Header () const
 Get the header that was read from a log file. More...
 
uint64_t InitialIterations () const
 Get the initial simulation iterations from a log file. More...
 
bool IsOpen () const
 Return true if a file is open. More...
 
common::Time LogEndTime () const
 Get the log end time of the open log file. More...
 
common::Time LogStartTime () const
 Get the log start time of the open log file. More...
 
std::string LogVersion () const
 Get the log version number of the open log file. More...
 
void Open (const std::string &_logFile)
 Open a log file for reading. More...
 
uint32_t RandSeed () const
 Get the random number seed of the open log file. More...
 
bool Rewind ()
 Jump to the beginning of the log file. More...
 
bool Seek (const common::Time &_time)
 Jump to the closest sample that has its simulation time lower than the time specified as a parameter. More...
 
bool Step (std::string &_data)
 Step through the open log file. More...
 
bool Step (const int _step, std::string &_data)
 Step through the open log file. More...
 
bool StepBack (std::string &_data)
 Step through the open log file backwards. More...
 

Static Public Member Functions

static LogPlayInstance ()
 Get an instance of the singleton. More...
 

Member Function Documentation

§ Chunk()

bool Chunk ( const unsigned int  _index,
std::string &  _data 
) const

Get data for a particular chunk index.

Parameters
[in]_indexIndex of the chunk.
[out]_dataStorage for the chunk's data.
Returns
True if the _index was valid.

§ ChunkCount()

unsigned int ChunkCount ( ) const

Get the number of chunks (steps) in the open log file.

Returns
The number of recorded states in the log file.

§ Encoding()

std::string Encoding ( ) const

Get the type of encoding used for current chunck in the open log file.

Returns
The type of encoding. An empty string will be returned if LogPlay::Step has not been called at least once.

§ Filename()

std::string Filename ( ) const

Get the name of the log file.

Returns
The filename.

§ FileSize()

uintmax_t FileSize ( ) const

Get the size of the log file.

Returns
The size of the file in bytes.

§ Forward()

bool Forward ( )

Jump to the end of the log file.

Returns
True If the function succeed or false otherwise.

§ FullPathFilename()

std::string FullPathFilename ( ) const

Get the full path of the log file.

Returns
The full path of the log file.

§ GazeboVersion()

std::string GazeboVersion ( ) const

Get the Gazebo version number of the open log file.

Returns
The Gazebo version of the open log file. Empty string if a log file is not open.

§ GetChunk()

bool GetChunk ( unsigned int  _index,
std::string &  _data 
)

Get data for a particular chunk index.

Parameters
[in]_indexIndex of the chunk.
[out]_dataStorage for the chunk's data.
Returns
True if the _index was valid.
Deprecated:
See GetChunk(unsigned int, std::string &) const

§ GetChunkCount()

unsigned int GetChunkCount ( ) const

Get the number of chunks (steps) in the open log file.

Returns
The number of recorded states in the log file.
Deprecated:
See ChunkCount() const

§ GetEncoding()

std::string GetEncoding ( ) const

Get the type of encoding used for current chunck in the open log file.

Returns
The type of encoding. An empty string will be returned if LogPlay::Step has not been called at least once.
Deprecated:
See Encoding() const

§ GetFilename()

std::string GetFilename ( ) const

Get the name of the log file.

Returns
The filename.
Deprecated:
See Filename() const;

§ GetFileSize()

uintmax_t GetFileSize ( ) const

Get the size of the log file.

Returns
The size of the file in bytes.
Deprecated:
See FileSize() const

§ GetFullPathFilename()

std::string GetFullPathFilename ( ) const

Get the full path of the log file.

Returns
The full path of the log file.
Deprecated:
See FullPathFilename()

§ GetGazeboVersion()

std::string GetGazeboVersion ( ) const

Get the Gazebo version number of the open log file.

Returns
The Gazebo version of the open log file. Empty string if a log file is not open.
Deprecated:
See GazeboVersion()

§ GetHeader()

std::string GetHeader ( ) const

Get the header that was read from a log file.

Should call LogPlay::Open first.

Returns
Header of the open log file.
Deprecated:
See Header() const

§ GetInitialIterations()

uint64_t GetInitialIterations ( ) const

Get the initial simulation iterations from a log file.

Returns
Initial simulation iteration contained in the log file.
Deprecated:
See InitialIterations() const

§ GetLogEndTime()

common::Time GetLogEndTime ( ) const

Get the log end time of the open log file.

Returns
End time of the log.
Deprecated:
See LogEndTime() const

§ GetLogStartTime()

common::Time GetLogStartTime ( ) const

Get the log start time of the open log file.

Returns
Start time of the log.
Deprecated:
See LogStartTime() const

§ GetLogVersion()

std::string GetLogVersion ( ) const

Get the log version number of the open log file.

Returns
The log version of the open log file. Empty string if a log file is not open.
Deprecated:
See LogVersion() const

§ GetRandSeed()

uint32_t GetRandSeed ( ) const

Get the random number seed of the open log file.

Returns
The random number seed the open log file. The current random number seed, as defined in ignition::math::Rand::Seed.
Deprecated:
See RandSeed() const

§ HasIterations()

bool HasIterations ( ) const

Return if the log file contains the <iterations> tag.

Old log files may not have the <iterations> tag.

Returns
True if <iterations> was found in the log file or false otherwise.

§ Header()

std::string Header ( ) const

Get the header that was read from a log file.

Should call LogPlay::Open first.

Returns
Header of the open log file.

§ InitialIterations()

uint64_t InitialIterations ( ) const

Get the initial simulation iterations from a log file.

Returns
Initial simulation iteration contained in the log file.

§ Instance()

static LogPlay * Instance ( )
inlinestaticinherited

Get an instance of the singleton.

§ IsOpen()

bool IsOpen ( ) const

Return true if a file is open.

Returns
True if a log file is open.

§ LogEndTime()

common::Time LogEndTime ( ) const

Get the log end time of the open log file.

Returns
End time of the log.

§ LogStartTime()

common::Time LogStartTime ( ) const

Get the log start time of the open log file.

Returns
Start time of the log.

§ LogVersion()

std::string LogVersion ( ) const

Get the log version number of the open log file.

Returns
The log version of the open log file. Empty string if a log file is not open.

§ Open()

void Open ( const std::string &  _logFile)

Open a log file for reading.

Open a log file that was previously recorded.

Parameters
[in]_logFileThe file to load
Exceptions
ExceptionWhen the log file does not exist, is a directory instead of a regular file, or Gazebo was unable to parse it.

§ RandSeed()

uint32_t RandSeed ( ) const

Get the random number seed of the open log file.

Returns
The random number seed the open log file. The current random number seed, as defined in ignition::math::Rand::Seed.

§ Rewind()

bool Rewind ( )

Jump to the beginning of the log file.

The next step() call will return the first data "chunk".

Returns
True If the function succeed or false otherwise.

§ Seek()

bool Seek ( const common::Time _time)

Jump to the closest sample that has its simulation time lower than the time specified as a parameter.

Parameters
[in]_timeTarget simulation time.
Returns
True if operation succeed or false otherwise.

§ Step() [1/2]

bool Step ( std::string &  _data)

Step through the open log file.

Parameters
[out]_dataData from next entry in the log file.

§ Step() [2/2]

bool Step ( const int  _step,
std::string &  _data 
)

Step through the open log file.

Parameters
[in]_stepNumber of samples to step (forward or backwards).
[out]_dataData from next entry in the log file.

§ StepBack()

bool StepBack ( std::string &  _data)

Step through the open log file backwards.

Parameters
[out]_dataData from next entry in the log file.

The documentation for this class was generated from the following file: