Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
timeline.cc
Go to the documentation of this file.
1 
18 #include "ion/profile/timeline.h"
19 
20 #include "ion/base/logging.h"
22 
27  if (node_->GetChildren().empty()) {
29  while (true) {
30  if (node_ == root_) {
31  node_ = nullptr;
32  break;
33  }
35  const TimelineNode* parent = node_->GetParent();
36  auto iter = parent->GetChildren().begin();
37  while (iter != parent->GetChildren().end()) {
38  if ((*iter).get() == node_) break;
39  ++iter;
40  }
41  CHECK(iter != parent->GetChildren().end());
43  ++iter;
45  if (iter != parent->GetChildren().end()) {
46  node_ = (*iter).get();
47  break;
48  } else {
49  node_ = parent;
50  }
51  }
52  } else {
54  node_ = node_->GetChildren().front().get();
55  }
56 
57  return *this;
58 }
Traverses the hierarchy in pre-order.
Definition: timeline.h:56
#define CHECK(expr)
Definition: logging.h:323
const_iterator operator++()
Copyright 2016 Google Inc.
Definition: timeline.cc:26
const Children & GetChildren() const
Definition: timelinenode.h:53
const TimelineNode * GetParent() const
Definition: timelinenode.h:51
Copyright 2016 Google Inc.
Definition: timelinenode.h:28
Copyright 2016 Google Inc.