Commit bf8b37b5 authored by Mathieu Faverge's avatar Mathieu Faverge

Clean up the big mess in headers (part2)

parent b3a1ea5a
......@@ -47,13 +47,41 @@ SET(VITE_HDRS
main_resource.hpp
# Info header
info/info.hpp
# Interface headers
interface/interface.hpp
interface/interface_console.hpp
interface/interface_graphic.hpp
interface/parsing_thread.hpp
interface/resource.hpp
interface/help.hpp
# General headers
general/Tools.hpp
# Data structure headers
trace/values/Color.hpp
trace/values/Date.hpp
trace/values/Double.hpp
trace/values/Hex.hpp
trace/values/Integer.hpp
trace/values/Name.hpp
trace/values/String.hpp
trace/values/Value.hpp
trace/values/Values.hpp
trace/tree/BinaryTree.hpp
trace/tree/Node.hpp
trace/tree/Interval.hpp
trace/ContainerType.hpp
trace/EntityType.hpp
trace/EventType.hpp
trace/StateType.hpp
trace/LinkType.hpp
trace/VariableType.hpp
trace/EntityTypes.hpp
trace/EntityValue.hpp
trace/Container.hpp
trace/Entity.hpp
trace/Event.hpp
trace/resource.hpp
trace/State.hpp
trace/StateChange.hpp
trace/Link.hpp
trace/Entitys.hpp
trace/Variable.hpp
trace/DrawTrace.hpp
trace/DrawTree.hpp
trace/Trace.hpp
# Render headers
render/render.hpp
render/Render_area.hpp
......@@ -64,6 +92,13 @@ SET(VITE_HDRS
render/render_stats_opengl.hpp
render/render_stats_svg.hpp
#render/vbo.hpp
# Interface headers
interface/help.hpp
interface/resource.hpp
interface/parsing_thread.hpp
interface/interface.hpp
interface/interface_console.hpp
interface/interface_graphic.hpp
# Parser headers
parser/Definition.hpp
parser/Line.hpp
......@@ -73,39 +108,6 @@ SET(VITE_HDRS
parser/ParserPaje.hpp
parser/ParserVite.hpp
parser/File.hpp
# Data structure headers
trace/Container.hpp
trace/ContainerType.hpp
trace/DrawTrace.hpp
trace/DrawTree.hpp
trace/Entity.hpp
trace/EntityType.hpp
trace/EntityValue.hpp
trace/Event.hpp
trace/EventType.hpp
trace/resource.hpp
trace/State.hpp
trace/StateChange.hpp
trace/StateType.hpp
trace/Link.hpp
trace/LinkType.hpp
trace/Variable.hpp
trace/VariableType.hpp
trace/Trace.hpp
trace/values/Color.hpp
trace/values/Date.hpp
trace/values/Double.hpp
trace/values/Hex.hpp
trace/values/Integer.hpp
trace/values/Name.hpp
trace/values/String.hpp
trace/values/Value.hpp
trace/values/Values.hpp
trace/tree/BinaryTree.hpp
trace/tree/Node.hpp
trace/tree/Interval.hpp
# General headers
general/Tools.hpp
# Statistics headers
statistics/Stats_window.hpp
statistics/Statistic.hpp
......@@ -123,16 +125,37 @@ SET(VITE_UIS
)
SET(VITE_SRCS
# Messages & Errors
message/Message.cpp
message/Errors.cpp
main.cpp
# General code files
general/Tools.cpp
# Info code file
info/info.cpp
# Interface code files
interface/interface_console.cpp
interface/interface_graphic.cpp
interface/parsing_thread.cpp
interface/help.cpp
# Data structure code files
trace/values/Color.cpp
trace/values/Date.cpp
trace/values/Double.cpp
trace/values/Hex.cpp
trace/values/Integer.cpp
trace/values/Name.cpp
trace/values/String.cpp
trace/tree/Interval.cpp
trace/EntityValue.cpp
trace/ContainerType.cpp
trace/EntityType.cpp
trace/EventType.cpp
trace/StateType.cpp
trace/LinkType.cpp
trace/VariableType.cpp
trace/Entity.cpp
trace/Event.cpp
trace/State.cpp
trace/StateChange.cpp
trace/Link.cpp
trace/Variable.cpp
trace/Container.cpp
trace/Trace.cpp
# Render code files
render/Render_area.cpp
render/Render_opengl.cpp
......@@ -143,40 +166,21 @@ SET(VITE_SRCS
# Parser code files
parser/Definition.cpp
parser/Line.cpp
parser/File.cpp
parser/ParserDefinitionPaje.cpp
parser/ParserEventPaje.cpp
parser/ParserPaje.cpp
parser/ParserVite.cpp
parser/File.cpp
# Data structure code files
trace/Container.cpp
trace/ContainerType.cpp
trace/Entity.cpp
trace/EntityType.cpp
trace/EntityValue.cpp
trace/Event.cpp
trace/EventType.cpp
trace/State.cpp
trace/StateChange.cpp
trace/StateType.cpp
trace/Link.cpp
trace/LinkType.cpp
trace/Variable.cpp
trace/VariableType.cpp
trace/Trace.cpp
trace/values/Color.cpp
trace/values/Date.cpp
trace/values/Double.cpp
trace/values/Hex.cpp
trace/values/Integer.cpp
trace/values/Name.cpp
trace/values/String.cpp
trace/tree/Interval.cpp
# General code files
general/Tools.cpp
# Statistics code files
statistics/Stats_window.cpp
statistics/Statistic.cpp
statistics/Stats_window.cpp
# Interface code files
interface/help.cpp
interface/parsing_thread.cpp
interface/interface_graphic.cpp
interface/interface_console.cpp
# Main
main.cpp
)
SET(VITE_RCCS
......
......@@ -40,18 +40,23 @@
** - VUCHENER Clément
**
*/
#include "Tools.hpp"
#include <cstdio>
// For translations
#include <QObject>
#include <cstdio>
#include <iostream>
/* -- */
#include <QObject> // For translations
/* -- */
#include <locale.h> // For dots or commas separator in double numbers
/* -- */
#include "Tools.hpp"
/* -- */
using namespace std;
double convert_to_double(const string arg){
double value = -1.0; // value returned
double value = -1.0; // value returned
string arg_temp = arg + " 3";
int useless;
int useless;
if(sscanf(arg_temp.c_str(), "%lf %d", &value, &useless) == 2){
return value; // It is the good format
}
......
......@@ -49,10 +49,6 @@
#define TOOLS_HPP
#include <string>
#include <iostream>
// For dots or commas separator in double numbers
#include <locale.h>
/*!
* \fn convert_to_double(const std::string args)
......
......@@ -44,8 +44,8 @@
*\file info.cpp
*/
#include "info.hpp"
#include "main_resource.hpp"
#include "info/info.hpp"
// void (Interface_console:: *Info::Core::launch_action)(int, void*) = NULL;
// const int Info::Core::_STATE_UNKNOWN = -1;
......@@ -73,14 +73,14 @@
// const int Info::Core::_STATE_RENDER_DISPLAY_INFORMATION = 21;
// const int Info::Core::_STATE_RENDER_UPDATE = 22;
int Info::Container::x_min = 0;
int Info::Container::x_max = 0;
int Info::Entity::x_min = 0;
int Info::Entity::x_max = 0;
int Info::Container::x_min = 0;
int Info::Container::x_max = 0;
int Info::Entity::x_min = 0;
int Info::Entity::x_max = 0;
bool Info::Render::_key_alt = false;
bool Info::Render::_key_ctrl = false;
bool Info::Render::_key_alt = false;
bool Info::Render::_key_ctrl = false;
Element_pos Info::Render::_x_min_visible = 0.0;
Element_pos Info::Render::_x_max_visible = 0.0;
......@@ -88,5 +88,5 @@ Element_pos Info::Render::_info_x = 0.0;
Element_pos Info::Render::_info_y = 0.0;
Element_pos Info::Render::_info_accurate = 0.0;
bool Info::Render::_no_arrows = false;
bool Info::Render::_no_events = false;
bool Info::Render::_no_arrows = false;
bool Info::Render::_no_events = false;
......@@ -47,8 +47,6 @@
#ifndef INFO_HPP
#define INFO_HPP
#include "main_resource.hpp"
class Interface_console;
/*!
......
......@@ -52,9 +52,6 @@
class Interface;
#include "resource.hpp"
/*!
*\brief This is an interface, used by the terminal and graphical interfaces.
*
......
......@@ -45,10 +45,55 @@
*\brief This is the console interface C source code.
*/
#include "Errors.hpp"
#include "interface_console.hpp"
#include <queue>
#include <string>
#include <iostream>
#include <fstream>
#include <list>
#include <map>
#include <vector>
#include <stack>
/* -- */
#include <QObject>
/* -- */
#include "main_resource.hpp"
#include "info/info.hpp"
#include "message/Errors.hpp"
#include "general/Tools.hpp"
/* -- */
#include "render/render.hpp"
#include "render/render_svg.hpp"
#include "render/Render_opengl_dl.hpp"
/* -- */
#include "trace/values/Values.hpp"
#include "trace/tree/Interval.hpp"
#include "trace/tree/Node.hpp"
#include "trace/tree/BinaryTree.hpp"
#include "trace/EntityValue.hpp"
#include "trace/EntityTypes.hpp"
#include "trace/Entitys.hpp"
// #include "trace/tree/Interval.hpp"
#include "trace/Trace.hpp"
#include "trace/DrawTree.hpp"
#include "trace/DrawTrace.hpp"
/* -- */
#include "parser/File.hpp"
#include "parser/Parser.hpp"
#include "parser/ParserPaje.hpp"
#ifdef WITH_OTF
# include <otf.h>
# include "parser/ParserOTF.hpp"
#endif //WITH_OTF
#include "parser/ParserVite.hpp"
/* -- */
#include "statistics/Stats_window.hpp"
/* -- */
#include "interface/resource.hpp"
#include "interface/help.hpp"
#include "interface/interface.hpp"
#include "interface/interface_graphic.hpp"
#include "interface/interface_console.hpp"
#include "interface/parsing_thread.hpp"
......
......@@ -47,42 +47,11 @@
#ifndef INTERFACE_CONSOLE_HPP
#define INTERFACE_CONSOLE_HPP
class Trace;
class Render_opengl;
class Interface_graphic;
class Interface_console;
#include "interface.hpp"
#include "interface_graphic.hpp"
/*
* render_opengl.hpp includes render_area.hpp.
* So do not include it twice.
*/
//#ifndef RENDER_AREA_HPP
#include "Render_opengl_dl.hpp"
//#endif
#include "render_svg.hpp"
#include "File.hpp"
#include "Trace.hpp"
#include "DrawTrace.hpp"
#include "Parser.hpp"
#include "ParserPaje.hpp"
#ifdef WITH_OTF
# include <otf.h>
# include "ParserOTF.hpp"
#endif //WITH_OTF
#include "ParserVite.hpp"
#include "resource.hpp"
#include "Tools.hpp"
#include "parsing_thread.hpp"
/*!
*\brief This class is an terminal interface, it inherited from the Interface interface.
*/
......
......@@ -45,8 +45,29 @@
*\brief This is graphical interface C source code.
*/
#include "Trace.hpp"
#include "interface_graphic.hpp"
#include <fstream>
#include <string>
#include <map>
#include <list>
/* -- */
#include <QObject>
/* -- */
#include "main_resource.hpp"
#include "info/info.hpp"
#include "general/Tools.hpp"
/* -- */
#include "trace/values/Values.hpp"
/* -- */
#include "render/render.hpp"
#include "render/render_svg.hpp"
/* -- */
#include "statistics/Stats_window.hpp"
/* -- */
#include "interface/resource.hpp"
#include "interface/help.hpp"
#include "interface/interface.hpp"
#include "interface/interface_console.hpp"
#include "interface/interface_graphic.hpp"
using namespace std;
......
......@@ -47,23 +47,16 @@
#ifndef INTERFACE_GRAPHIC_HPP
#define INTERFACE_GRAPHIC_HPP
class Interface_graphic;
#include "ui_main_window.h"/* the main window graphical interface */
/* Global informations */
#include "info.hpp"
#include "interface/resource.hpp"
#include "interface.hpp"
#include "interface_console.hpp"
#include "resource.hpp"
#include "help.hpp"
class Help;
class Interface_console;
class Stats_window;
class Interface_graphic;
#include "Stats_window.hpp"
/* the main window graphical interface */
#include "ui_main_window.h"
/*!
*\brief This class is a graphical interface which creates a window, it inherited from the Interface interface.
......
......@@ -40,14 +40,18 @@
** - VUCHENER Clément
**
*/
#include <QThread>
#include <iostream>
#include "Trace.hpp"
#include "File.hpp"
#include "Parser.hpp"
#include "parsing_thread.hpp"
#include <fstream>
#include <list>
#include <map>
/* -- */
#include "trace/values/Values.hpp"
#include "trace/Trace.hpp"
/* -- */
#include "parser/File.hpp"
#include "parser/Parser.hpp"
/* -- */
#include "interface/parsing_thread.hpp"
void parsing_thread::init(Parser *p, Trace *t, std::string filename){
_parser = p;
......
......@@ -44,8 +44,8 @@
#define PARSING_THREAD_HPP
#include <QThread>
#include "Trace.hpp"
#include "Parser.hpp"
class Trace;
class Parser;
/*!
* \class parsing_thread
......
......@@ -64,8 +64,14 @@
#include <QApplication>
/* Global informations */
#include "info.hpp"
#include "main_resource.hpp"
/* -- */
#include "info/info.hpp"
#include "render/Render_opengl.hpp"
#include "interface.hpp"
#include "interface_graphic.hpp"
#include "interface_console.hpp"
/*!
......
......@@ -54,7 +54,7 @@
#include <string>
#include <cstdlib> /* for macros EXIT_SUCCESS and EXIT_FAILURE */
#include<math.h> /* for min and max functions */
#include <math.h> /* for min and max functions */
/*!
* \def VITE_VERSION
......@@ -94,6 +94,7 @@ typedef double Times;
/* Message management */
#include <sstream>
#include "Message.hpp"
......
......@@ -40,8 +40,22 @@
** - VUCHENER Clément
**
*/
#include "Errors.hpp"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <queue>
/* -- */
#include <QObject>
/* -- */
#ifndef VITE_DEBUG
# include "interface/interface.hpp"
#endif
/* -- */
#include "message/Message.hpp"
#include "message/Errors.hpp"
/* -- */
using namespace std;
queue<string> Error::_errors;
......@@ -49,40 +63,40 @@ queue<string> Error::_warnings;
const int Error::_EVERYTHING = 0;
const int Error::_WARNING = 1;
const int Error::_ERROR = 2;
const int Error::_WARNING = 1;
const int Error::_ERROR = 2;
string Error::_content = QObject::tr("").toStdString();
const string Error::_PARSE = QObject::tr("expected \" before end of file").toStdString();
const string Error::_MMAP = QObject::tr("mmap error").toStdString();
const string Error::_EMPTY_FILE = QObject::tr("empty file").toStdString();
const string Error::_FSTAT = QObject::tr("status file error").toStdString();
const string Error::_OPEN = QObject::tr("open file error").toStdString();
const string Error::_MUNMAP = QObject::tr("munmap error").toStdString();
const string Error::_EXPECT_END_DEF = QObject::tr("expected %EndEventDef").toStdString();
const string Error::_EXPECT_EVENT_DEF = QObject::tr("expected %EventDef").toStdString();
const string Error::_EXPECT_NAME_DEF = QObject::tr("the definition is not named").toStdString();
const string Error::_EXPECT_ID_DEF = QObject::tr("the definition is not identified").toStdString();
const string Error::_UNKNOWN_ID_DEF = QObject::tr("there is no definition with the identity: ").toStdString();
const string Error::_EXTRA_TOKEN = QObject::tr("extra token(s) ignored").toStdString();
const string Error::_PARSE = QObject::tr("expected \" before end of file").toStdString();
const string Error::_MMAP = QObject::tr("mmap error").toStdString();
const string Error::_EMPTY_FILE = QObject::tr("empty file").toStdString();
const string Error::_FSTAT = QObject::tr("status file error").toStdString();
const string Error::_OPEN = QObject::tr("open file error").toStdString();
const string Error::_MUNMAP = QObject::tr("munmap error").toStdString();
const string Error::_EXPECT_END_DEF = QObject::tr("expected %EndEventDef").toStdString();
const string Error::_EXPECT_EVENT_DEF = QObject::tr("expected %EventDef").toStdString();
const string Error::_EXPECT_NAME_DEF = QObject::tr("the definition is not named").toStdString();
const string Error::_EXPECT_ID_DEF = QObject::tr("the definition is not identified").toStdString();
const string Error::_UNKNOWN_ID_DEF = QObject::tr("there is no definition with the identity: ").toStdString();
const string Error::_EXTRA_TOKEN = QObject::tr("extra token(s) ignored").toStdString();
const string Error::_UNKNOWN_EVENT_DEF = QObject::tr("the following event doesn't match with any event known: ").toStdString();
const string Error::_FIELD_TYPE_MISSING = QObject::tr("a field type is missing ").toStdString();
const string Error::_FIELD_TYPE_UNKNOWN = QObject::tr("the following field type is unknown: ").toStdString();
const string Error::_EMPTY_DEF = QObject::tr("a definition line is empty").toStdString();
const string Error::_EMPTY_DEF = QObject::tr("a definition line is empty").toStdString();
const string Error::_INCOMPATIBLE_VALUE_IN_EVENT = QObject::tr("incompatible value: ").toStdString();
const string Error::_BAD_FILE_EXTENSION = QObject::tr("the extension of the file is not .trace").toStdString();
const string Error::_BAD_FILE_EXTENSION = QObject::tr("the extension of the file is not .trace").toStdString();
const string Error::_LINE_TOO_SHORT_EVENT = QObject::tr("missing field value(s) in an event").toStdString();
const string Error::_UNKNOWN_CONTAINER_TYPE = QObject::tr("Unknown container type: ").toStdString();
const string Error::_UNKNOWN_CONTAINER = QObject::tr("Unknown container: ").toStdString();
const string Error::_UNKNOWN_EVENT_TYPE = QObject::tr("Unknown event type: ").toStdString();
const string Error::_UNKNOWN_STATE_TYPE = QObject::tr("Unknown state type: ").toStdString();
const string Error::_UNKNOWN_VARIABLE_TYPE = QObject::tr("Unknown variable type: ").toStdString();
const string Error::_UNKNOWN_LINK_TYPE = QObject::tr("Unknown link type: ").toStdString();
const string Error::_UNKNOWN_ENTITY_TYPE = QObject::tr("Unknown entity type: ").toStdString();
const string Error::_UNKNOWN_ENTITY_VALUE = QObject::tr("Unknown entity value: ").toStdString();
const string Error::_UNKNOWN_CONTAINER = QObject::tr("Unknown container: ").toStdString();
const string Error::_UNKNOWN_EVENT_TYPE = QObject::tr("Unknown event type: ").toStdString();
const string Error::_UNKNOWN_STATE_TYPE = QObject::tr("Unknown state type: ").toStdString();
const string Error::_UNKNOWN_VARIABLE_TYPE = QObject::tr("Unknown variable type: ").toStdString();
const string Error::_UNKNOWN_LINK_TYPE = QObject::tr("Unknown link type: ").toStdString();
const string Error::_UNKNOWN_ENTITY_TYPE = QObject::tr("Unknown entity type: ").toStdString();
const string Error::_UNKNOWN_ENTITY_VALUE = QObject::tr("Unknown entity value: ").toStdString();
void Error::set(const string kind_of_error, const int priority){
......
......@@ -43,18 +43,14 @@
#ifndef ERRORS_HPP
#define ERRORS_HPP
#include <string>
#include <queue>
/*!
* \file Errors.hpp
* This file contains all the significations of the errors or warnings that can be thrown by the parser
*
**/
#include <string>
#include <queue>
#include <iostream>
#include <fstream>
#include "Message.hpp"
/*! \class Error
* \brief Define errors and warnings used in the parser.
*/
......
......@@ -40,9 +40,42 @@
** - VUCHENER Clément
**
*/
#include "Message.hpp"
Message *Message::_message = NULL;
#include <sstream>
#include <iostream>
/* -- */
#include <QObject>
/* -- */
#ifdef VITE_DEBUG
/* Test mode */
class Interface {
public:
void error(const std::string& s) {
std::cerr <<"ERROR: " << s << std::endl;
}
void warning(const std::string& s) {
std::cerr <<"WARNING: " << s << std::endl;
}
void information(const std::string& s) {
std::cerr <<"INFORMATION: " << s << std::endl;
}
void selection_information(const std::string& s) {
std::cerr <<"INFORMATION: " << s << std::endl;
}
std::string get_filename(){
return "filename ";
}
};
#else
/* Release mode */
#include "interface/interface.hpp"
#endif
/* -- */
#include "message/Message.hpp"
Message *Message::_message = NULL;
Interface *Message::_interface = NULL;
Message::Message() {
......
......@@ -43,46 +43,18 @@
#ifndef MESSAGE_HPP
#define MESSAGE_HPP
#include <sstream>
#ifndef VITE_DEBUG
/* Release mode */
#include "interface.hpp"
#else
/* Test mode */
#include <iostream>
class Interface {
public: