GEGELATI
Loading...
Searching...
No Matches
tpgEdgeInstrumented.h
1
37#ifndef TPG_EDGE_INSTRUMENTED_H
38#define TPG_EDGE_INSTRUMENTED_H
39
40#include <atomic>
41#include <cstddef>
42
43#include "tpg/tpgEdge.h"
44
45namespace TPG {
46
52 {
53 public:
55 TPGEdgeInstrumented(const TPGVertex* src, const TPGVertex* dest,
56 const std::shared_ptr<Program::Program> prog)
57 : TPGEdge(src, dest, prog), nbVisits{0}, nbTraversal{0}
58 {
59 }
60
66 uint64_t getNbVisits() const;
67
72 void incrementNbVisits() const;
73
79 uint64_t getNbTraversal() const;
80
85 void incrementNbTraversal() const;
86
90 void reset() const;
91
92 protected:
97 mutable std::atomic_uint64_t nbVisits;
98
103 mutable std::atomic_uint64_t nbTraversal;
104 };
105} // namespace TPG
106
107#endif // !TPG_EDGE_INSTRUMENTED_H
Instrumented TPGEdge class to keep track of a TPG execution statistics.
Definition tpgEdgeInstrumented.h:52
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:97
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:55
std::atomic_uint64_t nbTraversal
Definition tpgEdgeInstrumented.h:103
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