12 static constexpr
size_t STR_BUFFER_SIZE = 64;
16 char key[STR_BUFFER_SIZE];
17 char val[STR_BUFFER_SIZE];
19 inline keyval() : next(nullptr) {
27 char m_title[STR_BUFFER_SIZE];
30 unsigned long time_start;
31 unsigned long time_end;
38 PhaseData* first_child;
39 PhaseData* next_sibling;
42 : first_stat(nullptr),
44 next_sibling(nullptr) {
48 if(first_stat)
delete first_stat;
49 if(first_child)
delete first_child;
50 if(next_sibling)
delete next_sibling;
53 inline const char* title()
const {
57 inline void title(
const char* title) {
58 strncpy(m_title, title, STR_BUFFER_SIZE);
62 inline void log_stat(
const char* key,
const T& value) {
63 keyval* kv =
new keyval();
65 strncpy(kv->key, key, STR_BUFFER_SIZE);
69 keyval* last = first_stat;
79 inline json::Object to_json()
const {
81 obj.set(
"title", m_title);
82 obj.set(
"timeStart", time_start);
83 obj.set(
"timeEnd", time_end);
84 obj.set(
"memOff", mem_off);
85 obj.set(
"memPeak", mem_peak);
86 obj.set(
"memFinal", mem_current);
89 keyval* kv = first_stat;
92 pair.set(
"key", std::string(kv->key));
93 pair.set(
"value", std::string(kv->val));
97 obj.set(
"stats", stats);
101 PhaseData* child = first_child;
103 sub.add(child->to_json());
104 child = child->next_sibling;
Contains the text compression and encoding framework.
std::string to_string(tdc::uint_impl_t< N > value)