GEGELATI

Loading...
Searching...
No Matches
tpgEdgeInstrumented.h
1
36#ifndef TPG_EDGE_INSTRUMENTED_H
37#define TPG_EDGE_INSTRUMENTED_H
38
39#include <atomic>
40#include <cstddef>
41
42#include "tpg/tpgEdge.h"
43
44namespace TPG {
45
50 class TPGEdgeInstrumented : public TPGEdge
51 {
52 public:
54 TPGEdgeInstrumented(const TPGVertex* src, const TPGVertex* dest,
55 const std::shared_ptr<Program::Program> prog)
56 : TPGEdge(src, dest, prog), nbVisits{0}, nbTraversal{0}
57 {
58 }
59
65 uint64_t getNbVisits() const;
66
71 void incrementNbVisits() const;
72
78 uint64_t getNbTraversal() const;
79
84 void incrementNbTraversal() const;
85
89 void reset() const;
90
91 protected:
96 mutable std::atomic_uint64_t nbVisits;
97
102 mutable std::atomic_uint64_t nbTraversal;
103 };
104} // namespace TPG
105
106#endif // !TPG_EDGE_INSTRUMENTED_H
TPG::TPGEdgeInstrumented
Instrumented TPGEdge class to keep track of a TPG execution statistics.
Definition tpgEdgeInstrumented.h:51
TPG::TPGEdgeInstrumented::getNbTraversal
uint64_t getNbTraversal() const
Get the number of time a TPGEdge was traversed.
Definition tpgEdgeInstrumented.cpp:48
TPG::TPGEdgeInstrumented::nbVisits
std::atomic_uint64_t nbVisits
Definition tpgEdgeInstrumented.h:96
TPG::TPGEdgeInstrumented::getNbVisits
uint64_t getNbVisits() const
Get the number of time a TPGEdge was visited.
Definition tpgEdgeInstrumented.cpp:38
TPG::TPGEdgeInstrumented::TPGEdgeInstrumented
TPGEdgeInstrumented(const TPGVertex *src, const TPGVertex *dest, const std::shared_ptr< Program::Program > prog)
Default constructor.
Definition tpgEdgeInstrumented.h:54
TPG::TPGEdgeInstrumented::nbTraversal
std::atomic_uint64_t nbTraversal
Definition tpgEdgeInstrumented.h:102
TPG::TPGEdgeInstrumented::reset
void reset() const
Reset the instrumentation attributes.
Definition tpgEdgeInstrumented.cpp:58
TPG::TPGEdgeInstrumented::incrementNbVisits
void incrementNbVisits() const
Add one to the number of visits for this TPGEdge.
Definition tpgEdgeInstrumented.cpp:43
TPG::TPGEdgeInstrumented::incrementNbTraversal
void incrementNbTraversal() const
Add one to the number of traversal for this TPGEdge.
Definition tpgEdgeInstrumented.cpp:53
TPG::TPGEdge
Class representing edges of the Tangled Program Graphs.
Definition tpgEdge.h:54
TPG::TPGVertex
Abstract class representing the vertices of a TPGGraph.
Definition tpgVertex.h:55
TPG
Definition executionStats.h:44