/** * @file utils/Trace.hpp * @author See the AUTHORS file */ /* * Copyright (C) 2012-2019 ULCO http://www.univ-littoral.fr * * 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 UTILS_TRACE #define UTILS_TRACE #include #include #include #include #include #include #include #include namespace artis { namespace utils { enum TraceType { NONE = 0, CHECK, COMPUTE, INIT, KERNEL, PUT }; template class TraceElement { public: TraceElement() :_time(Time::null), _type(NONE) { } TraceElement(const std::string& model_name, typename Time::type time, TraceType type) : _model_name(model_name), _time(time), _type(type) { } virtual ~TraceElement() { } const std::string& get_comment() const { return _comment; } const std::string& get_model_name() const { return _model_name; } typename Time::type get_time() const { return _time; } TraceType get_type() const { return _type; } void set_comment(const std::string& comment) { _comment = comment; } private: std::string _model_name; typename Time::type _time; TraceType _type; std::string _comment; }; template class TraceElements : public std::vector > { public: TraceElements() { } virtual ~TraceElements() { } TraceElements filter_model_name( const std::string& model_name) const { TraceElements