GEGELATI
tpgEdgeInstrumented.h
1#ifndef TPG_EDGE_INSTRUMENTED_H
2#define TPG_EDGE_INSTRUMENTED_H
3
4#include <atomic>
5#include <cstddef>
6
7#include "tpg/tpgEdge.h"
8
9namespace TPG {
10
16 {
17 public:
19 TPGEdgeInstrumented(const TPGVertex* src, const TPGVertex* dest,
20 const std::shared_ptr<Program::Program> prog)
21 : TPGEdge(src, dest, prog), nbVisits{0}, nbTraversal{0}
22 {
23 }
24
30 uint64_t getNbVisits() const;
31
36 void incrementNbVisits() const;
37
43 uint64_t getNbTraversal() const;
44
49 void incrementNbTraversal() const;
50
54 void reset() const;
55
56 protected:
61 mutable std::atomic_uint64_t nbVisits;
62
67 mutable std::atomic_uint64_t nbTraversal;
68 };
69} // namespace TPG
70
71#endif // !TPG_EDGE_INSTRUMENTED_H
Instrumented TPGEdge class to keep track of a TPG execution statistics.
Definition: tpgEdgeInstrumented.h:16
uint64_t getNbTraversal() const
Get the number of time a TPGEdge was traversed.
Definition: tpgEdgeInstrumented.cpp:13
std::atomic_uint64_t nbVisits
Definition: tpgEdgeInstrumented.h:61
uint64_t getNbVisits() const
Get the number of time a TPGEdge was visited.
Definition: tpgEdgeInstrumented.cpp:3
TPGEdgeInstrumented(const TPGVertex *src, const TPGVertex *dest, const std::shared_ptr< Program::Program > prog)
Default constructor.
Definition: tpgEdgeInstrumented.h:19
std::atomic_uint64_t nbTraversal
Definition: tpgEdgeInstrumented.h:67
void reset() const
Reset the instrumentation attributes.
Definition: tpgEdgeInstrumented.cpp:23
void incrementNbVisits() const
Add one to the number of visits for this TPGEdge.
Definition: tpgEdgeInstrumented.cpp:8
void incrementNbTraversal() const
Add one to the number of traversal for this TPGEdge.
Definition: tpgEdgeInstrumented.cpp:18
Class representing edges of the Tangled Program Graphs.
Definition: tpgEdge.h:51
Abstract class representing the vertices of a TPGGraph.
Definition: tpgVertex.h:49
Definition: tpgActionInstrumented.h:8