Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::gfx::TraceCallExtractor Class Reference

The TraceCallExtractor class parses an OpenGL trace output generated by a GraphicsManager, segmenting it into a vector of calls with arguments. More...

#include "tracecallextractor.h"

Public Member Functions

 TraceCallExtractor ()
 
 TraceCallExtractor (const std::string &trace)
 Utility constructor also sets trace string and extracts vector of calls. More...
 
 ~TraceCallExtractor ()
 
void SetTrace (const std::string &trace)
 Sets trace string and extracts vector of calls. More...
 
const std::vector< std::string > & GetCalls ()
 
size_t GetCallCount () const
 Returns the number of OpenGL calls in the stream. More...
 
size_t GetCountOf (const std::string &call_prefix) const
 Returns the number of times the passed call start occurs in the trace stream. More...
 
size_t GetNthIndexOf (size_t n, const std::string &call_prefix) const
 Returns the index of the nth call in the trace stream beginning with start, if it exists, otherwise returns base::kInvalidIndex. More...
 

Detailed Description

The TraceCallExtractor class parses an OpenGL trace output generated by a GraphicsManager, segmenting it into a vector of calls with arguments.

It also contains utility functions to locate and count particular calls. Calls are tested using one or more strings that must match the beginnings of the resulting trace strings. This scheme is used, rather than exact full-string matches, to allow for differences in trace formatting on different platforms.

Definition at line 33 of file tracecallextractor.h.

Constructor & Destructor Documentation

ion::gfx::TraceCallExtractor::TraceCallExtractor ( )

Definition at line 29 of file tracecallextractor.cc.

References SetTrace().

ion::gfx::TraceCallExtractor::TraceCallExtractor ( const std::string &  trace)
explicit

Utility constructor also sets trace string and extracts vector of calls.

Definition at line 33 of file tracecallextractor.cc.

References SetTrace().

ion::gfx::TraceCallExtractor::~TraceCallExtractor ( )
inline

Definition at line 38 of file tracecallextractor.h.

Member Function Documentation

size_t ion::gfx::TraceCallExtractor::GetCallCount ( ) const

Returns the number of OpenGL calls in the stream.

Definition at line 42 of file tracecallextractor.cc.

const std::vector<std::string>& ion::gfx::TraceCallExtractor::GetCalls ( )
inline

Definition at line 43 of file tracecallextractor.h.

size_t ion::gfx::TraceCallExtractor::GetCountOf ( const std::string &  call_prefix) const

Returns the number of times the passed call start occurs in the trace stream.

Definition at line 46 of file tracecallextractor.cc.

References ion::base::StartsWith().

size_t ion::gfx::TraceCallExtractor::GetNthIndexOf ( size_t  n,
const std::string &  call_prefix 
) const

Returns the index of the nth call in the trace stream beginning with start, if it exists, otherwise returns base::kInvalidIndex.

Note that n == 0 returns the first index, n == 1 returns the second index, and so on.

Definition at line 55 of file tracecallextractor.cc.

References ion::base::kInvalidIndex, and ion::base::StartsWith().

void ion::gfx::TraceCallExtractor::SetTrace ( const std::string &  trace)

Sets trace string and extracts vector of calls.

Definition at line 37 of file tracecallextractor.cc.

Referenced by TraceCallExtractor().


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