/**
* @file Trace.hpp
* @author The ARTIS Development Team
* See the AUTHORS or Authors.txt file
*/
/*
* ARTIS - the multimodeling and simulation environment
* This file is a part of the ARTIS environment
*
* Copyright (C) 2013-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 COMMON_UTILS_TRACE
#define COMMON_UTILS_TRACE 1
#include
#include
#include
#include
#include
#include
#include
namespace artis {
namespace common {
enum TraceType {
NONE = 0, I_MESSAGE, POST_EVENT, S_MESSAGE, Y_MESSAGE,
DELTA_INT, DELTA_EXT, DELTA_CONF, TA, LAMBDA, START, OUTPUT
};
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