- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
traceanalyzer.hpp
Go to the documentation of this file.
1 #pragma once
2 /*
3 ** Copyright (C) 2013 Aldebaran Robotics
4 ** See COPYING for the license
5 */
6
7 #ifndef _QITYPE_TRACEANALYZER_HPP_
8 #define _QITYPE_TRACEANALYZER_HPP_
9
10 #include <boost/utility.hpp>
11 #include <memory>
12 #include <qi/type/detail/manageable.hpp>
13
14
15 namespace qi
16 {
17 class TraceAnalyzerImpl;
18
19 class QI_API TraceAnalyzer: public boost::noncopyable
20 {
21 public:
22 TraceAnalyzer();
23 ~TraceAnalyzer();
25 void clear();
27 void clear(const qi::os::timeval& limit);
29 void addTrace(const qi::EventTrace& e, unsigned int objectId);
30 struct FlowLink
31 {
32 FlowLink(unsigned int srcObj, unsigned int srcFun, unsigned int dstObj, unsigned int dstFun, bool sync)
33 : srcObj(srcObj), srcFun(srcFun), dstObj(dstObj), dstFun(dstFun), sync(sync) {}
34 unsigned int srcObj, srcFun, dstObj, dstFun;
35 bool sync;
36 };
38 void analyze(std::set<FlowLink>& links);
40 void dumpTraces(std::ostream& o);
41 std::string dumpTraces();
42 protected:
43 std::unique_ptr<TraceAnalyzerImpl> _p;
44 };
45 }
46
47
48 namespace qi
49 {
50 inline bool operator < (const TraceAnalyzer::FlowLink& a, const TraceAnalyzer::FlowLink& b)
51 {
52 #define _qi_FIELD(f) if (a.f != b.f) return a.f < b.f
53 _qi_FIELD(srcObj);
54 _qi_FIELD(srcFun);
55 _qi_FIELD(dstObj);
56 _qi_FIELD(dstFun);
57 _qi_FIELD(sync);
58 return false;
59 #undef _qi_FIELD
60 }
61 }
62
63 #endif
QI_API
#define QI_API
Definition: api.hpp:33
qi::TraceAnalyzer::FlowLink::FlowLink
FlowLink(unsigned int srcObj, unsigned int srcFun, unsigned int dstObj, unsigned int dstFun, bool sync)
Definition: traceanalyzer.hpp:32
qi::TraceAnalyzer::_p
std::unique_ptr< TraceAnalyzerImpl > _p
Definition: traceanalyzer.hpp:43
qi::TraceAnalyzer::FlowLink::sync
bool sync
Definition: traceanalyzer.hpp:35
_qi_FIELD
#define _qi_FIELD(f)
qi::os::timeval
struct similar to POSIX timeval
Definition: os.hpp:293
qi::EventTrace
Definition: manageable.hpp:44
qi::TraceAnalyzer::FlowLink
Definition: traceanalyzer.hpp:30
manageable.hpp
qi::operator<
bool operator<(const AnyReference &a, const AnyReference &b)
qi::TraceAnalyzer
Definition: traceanalyzer.hpp:19
qi::TraceAnalyzer::FlowLink::srcObj
unsigned int srcObj
Definition: traceanalyzer.hpp:34