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
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
Instrumented TPGEdge class to keep track of a TPG execution statistics.
Definition tpgEdgeInstrumented.h:51
uint64_t getNbTraversal() const
Get the number of time a TPGEdge was traversed.
Definition tpgEdgeInstrumented.cpp:48
std::atomic_uint64_t nbVisits
Definition tpgEdgeInstrumented.h:96
uint64_t getNbVisits() const
Get the number of time a TPGEdge was visited.
Definition tpgEdgeInstrumented.cpp:38
TPGEdgeInstrumented(const TPGVertex *src, const TPGVertex *dest, const std::shared_ptr< Program::Program > prog)
Default constructor.
Definition tpgEdgeInstrumented.h:54
std::atomic_uint64_t nbTraversal
Definition tpgEdgeInstrumented.h:102
void reset() const
Reset the instrumentation attributes.
Definition tpgEdgeInstrumented.cpp:58
void incrementNbVisits() const
Add one to the number of visits for this TPGEdge.
Definition tpgEdgeInstrumented.cpp:43
void incrementNbTraversal() const
Add one to the number of traversal for this TPGEdge.
Definition tpgEdgeInstrumented.cpp:53
Class representing edges of the Tangled Program Graphs.
Definition tpgEdge.h:54
Abstract class representing the vertices of a TPGGraph.
Definition tpgVertex.h:55
Definition executionStats.h:44