18 #ifndef ION_PROFILE_TIMELINENODE_H_
19 #define ION_PROFILE_TIMELINENODE_H_
25 #include "base/integral_types.h"
30 typedef std::vector<std::unique_ptr<TimelineNode>>
Children;
35 const uint32 duration);
39 void AddChild(std::unique_ptr<TimelineNode> child);
43 const std::string&
GetName()
const {
return name_; }
46 uint32
GetEnd()
const {
return begin_ + duration_; }
49 double GetEndMs()
const {
return (begin_ + duration_) * 0.001; }
55 return children_[i].get();
72 child->parent_ =
this;
73 children_.push_back(std::move(child));
76 #endif // ION_PROFILE_TIMELINENODE_H_
void UpdateDuration(const uint32 end)
Update the duration of the event given a new end timestamp.
double GetDurationMs() const
void AddChild(std::unique_ptr< TimelineNode > child)
Add a node to the children. It becomes the last child.
TimelineNode * GetParent()
virtual Type GetType() const
const Children & GetChildren() const
const TimelineNode * GetParent() const
Copyright 2016 Google Inc.
std::vector< std::unique_ptr< TimelineNode > > Children
double GetBeginMs() const
uint32 GetDuration() const
TimelineNode(const std::string &name)
Copyright 2016 Google Inc.
const std::string & GetName() const
const TimelineNode * GetChild(const size_t i) const