/** Lightweight profiler library for c++ Copyright(C) 2016 Sergey Yagovtsev This program is free software : you can redistribute it and / or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.If not, see . **/ #ifndef PROFILER_READER____H #define PROFILER_READER____H ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include #include "profiler/profiler.h" ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// struct BlocksTree { profiler::SerilizedBlock* node; std::vector children; BlocksTree(){ node = nullptr; } BlocksTree(BlocksTree&& that) { makeMove(std::forward(that)); } BlocksTree& operator=(BlocksTree&& that) { makeMove(std::forward(that)); return *this; } ~BlocksTree() { if (node) { delete node; } node = nullptr; } bool operator < (const BlocksTree& other) const { if (!node || !other.node) { return false; } return node->block()->getBegin() < other.node->block()->getBegin(); } private: void makeMove(BlocksTree&& that) { node = that.node; children = std::move(that.children); that.node = nullptr; } }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #endif // PROFILER_READER____H