Hymn to Beauty
C++ 3D Engine
Thread.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <list>
5#include <json/json.h>
6
7#include "Event.hpp"
8
9namespace Profiling {
10
12class Thread {
13 public:
15
18 explicit Thread(const std::string& name);
19
21
26 Event* AddEvent(const std::string& name);
27
29
32 Json::Value ToJson() const;
33
35
38 void FromJson(const Json::Value& value);
39
41 std::string name;
42
44 std::list<Event> events;
45};
46
47}
A profiling event on the timeline.
Definition: Event.hpp:10
A thread containing events.
Definition: Thread.hpp:12
Thread(const std::string &name)
Create new thread.
Definition: Thread.cpp:5
void FromJson(const Json::Value &value)
Load thread from json value.
Definition: Thread.cpp:29
Event * AddEvent(const std::string &name)
Create new event.
Definition: Thread.cpp:9
std::list< Event > events
Events.
Definition: Thread.hpp:44
Json::Value ToJson() const
Save thread to json value.
Definition: Thread.cpp:14
std::string name
The name of the thread.
Definition: Thread.hpp:41
Definition: Event.cpp:3