Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tracecallextractor.h
Go to the documentation of this file.
1 
18 #ifndef ION_GFX_TRACECALLEXTRACTOR_H_
19 #define ION_GFX_TRACECALLEXTRACTOR_H_
20 
21 #include <string>
22 #include <vector>
23 
24 namespace ion {
25 namespace gfx {
26 
34  public:
37  explicit TraceCallExtractor(const std::string& trace);
39 
41  void SetTrace(const std::string& trace);
42 
43  const std::vector<std::string>& GetCalls() { return calls_; }
44 
46  size_t GetCallCount() const;
47 
50  size_t GetCountOf(const std::string& call_prefix) const;
51 
55  size_t GetNthIndexOf(size_t n, const std::string& call_prefix) const;
56 
57  private:
60  void CreateCallVector();
61 
63  std::string trace_;
64 
66  std::vector<std::string> calls_;
67 };
68 
69 } // namespace gfx
70 } // namespace ion
71 
72 #endif // ION_GFX_TRACECALLEXTRACTOR_H_
size_t GetCallCount() const
Returns the number of OpenGL calls in the stream.
void SetTrace(const std::string &trace)
Sets trace string and extracts vector of calls.
The TraceCallExtractor class parses an OpenGL trace output generated by a GraphicsManager, segmenting it into a vector of calls with arguments.
const std::vector< std::string > & GetCalls()
size_t GetCountOf(const std::string &call_prefix) const
Returns the number of times the passed call start occurs in the trace stream.
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...