PathsInfo.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
8 
9 #include <atomic>
10 #include <cstddef>
11 #include <map>
12 #include <string>
13 
14 using namespace std;
15 
16 namespace art {
17 
18  map<string, std::shared_ptr<Worker>>&
20  {
21  return workers_;
22  }
23 
24  map<string, std::shared_ptr<Worker>> const&
26  {
27  return workers_;
28  }
29 
30  void
31  PathsInfo::add_path(ActionTable const& actions,
32  ActivityRegistry const& registry,
33  PathContext const& pc,
34  std::vector<WorkerInPath>&& wips,
35  GlobalTaskGroup& task_group)
36  {
37  if (pc.pathName() == PathContext::end_path()) {
38  paths_.emplace_back(
39  actions, registry, pc, move(wips), nullptr, task_group);
40  } else {
41  paths_.emplace_back(
42  actions, registry, pc, move(wips), &pathResults_, task_group);
43  pathResults_ = HLTGlobalStatus(size(paths_));
44  }
45  TDEBUG_FUNC_SI(5, pc.scheduleID())
46  << "Made path " << std::hex << &paths_.back() << std::dec
47  << " pathID: " << to_string(pc.pathID()) << " name: " << pc.pathName();
48  }
49 
50  vector<Path>&
51  PathsInfo::paths()
52  {
53  return paths_;
54  }
55 
56  vector<Path> const&
57  PathsInfo::paths() const
58  {
59  return paths_;
60  }
61 
62  vector<string>
63  PathsInfo::pathNames() const
64  {
65  vector<string> result;
66  std::transform(begin(paths_),
67  end(paths_),
68  back_inserter(result),
69  [](auto const& path) { return path.name(); });
70  return result;
71  }
72 
73  void
75  {
76  for (auto const& val : workers_) {
77  val.second->reset();
78  }
79  }
80 
81  void
82  PathsInfo::reset_for_event()
83  {
84  reset();
85  pathResults_.reset();
86  }
87 
89  PathsInfo::pathResults()
90  {
91  return pathResults_;
92  }
93 
94  void
95  PathsInfo::incrementTotalEventCount()
96  {
97  ++totalEvents_;
98  }
99 
100  void
101  PathsInfo::incrementPassedEventCount()
102  {
103  ++passedEvents_;
104  }
105 
106  size_t
107  PathsInfo::passedEvents() const
108  {
109  return passedEvents_.load();
110  }
111 
112  size_t
113  PathsInfo::failedEvents() const
114  {
115  return totalEvents_.load() - passedEvents_.load();
116  }
117 
118  size_t
119  PathsInfo::totalEvents() const
120  {
121  return totalEvents_.load();
122  }
123 
124 } // namespace art
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
static QCString result
STL namespace.
QTextStream & hex(QTextStream &s)
auto scheduleID() const
Definition: PathContext.h:52
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
auto const & pathName() const
Definition: PathContext.h:63
QTextStream & reset(QTextStream &s)
def move(depos, offset)
Definition: depos.py:107
#define TDEBUG_FUNC_SI(LEVEL, SI)
QTextStream & dec(QTextStream &s)
PathID pathID() const noexcept
Definition: PathContext.h:68
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
Namespace containing all the test actions.
workers
Definition: train.py:479
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34