This repository was archived by the owner on Jan 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 358
Expand file tree
/
Copy pathThreadTrackDataProvider.cpp
More file actions
54 lines (42 loc) · 1.79 KB
/
Copy pathThreadTrackDataProvider.cpp
File metadata and controls
54 lines (42 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) 2021 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ClientData/ThreadTrackDataProvider.h"
#include "OrbitBase/Append.h"
namespace orbit_client_data {
using orbit_client_protos::TimerInfo;
std::vector<uint32_t> ThreadTrackDataProvider::GetAllThreadIds() const {
std::vector<uint32_t> all_thread_id;
for (const ScopeTreeTimerData* scope_tree_timer_data :
thread_track_data_manager_->GetAllScopeTreeTimerData()) {
all_thread_id.push_back(scope_tree_timer_data->GetThreadId());
}
return all_thread_id;
}
std::vector<const TimerChain*> ThreadTrackDataProvider::GetAllThreadTimerChains() const {
std::vector<const TimerChain*> chains;
for (const uint32_t thread_id : GetAllThreadIds()) {
orbit_base::Append(chains, GetChains(thread_id));
}
return chains;
}
const TimerInfo* ThreadTrackDataProvider::GetLeft(const TimerInfo& timer) const {
return GetScopeTreeTimerData(timer.thread_id())->GetLeft(timer);
}
const TimerInfo* ThreadTrackDataProvider::GetRight(const TimerInfo& timer) const {
return GetScopeTreeTimerData(timer.thread_id())->GetRight(timer);
}
const TimerInfo* ThreadTrackDataProvider::GetUp(const TimerInfo& timer) const {
return GetScopeTreeTimerData(timer.thread_id())->GetUp(timer);
}
const TimerInfo* ThreadTrackDataProvider::GetDown(const TimerInfo& timer) const {
return GetScopeTreeTimerData(timer.thread_id())->GetDown(timer);
}
void ThreadTrackDataProvider::OnCaptureComplete() {
// Update data if needed after capture is completed.
for (ScopeTreeTimerData* scope_tree_timer_data :
thread_track_data_manager_->GetAllScopeTreeTimerData()) {
scope_tree_timer_data->OnCaptureComplete();
}
}
} // namespace orbit_client_data