Commit 985c8126 authored by Arthur Redondy's avatar Arthur Redondy

Reorganisation du dossier source : etape 4 supression de dossiers residuels et...

Reorganisation du dossier source : etape 4 supression de dossiers residuels et changement des paths dans les includes
parent c83ba126
......@@ -13,10 +13,10 @@ class Interface_console;
#include "interface_graphic.hpp"
#include "render_area.hpp"
#include "../../trace/src/Trace.hpp"
#include "../../trace/src/DrawTrace.hpp"
#include "../trace/Trace.hpp"
#include "../trace/DrawTrace.hpp"
#include "../../parser/src/ParserPaje.hpp"
#include "../parser/ParserPaje.hpp"
#include "resource.hpp"
......
......@@ -9,7 +9,7 @@
#define RESOURCE_HPP
#include "../../main_resource.hpp"
#include "../main_resource.hpp"
#include <cmath>
......
......@@ -8,7 +8,7 @@
* \brief The main launcher.
*/
#include "interface/src/interface_console.hpp"
#include "interface/interface_console.hpp"
/*!
*\brief The main function of ViTE.
......
......@@ -20,7 +20,7 @@ typedef double Element_col;
/* Message management */
#include "message/src/message_ns.hpp"
#include "message/message_ns.hpp"
/* Example:
* message << "Test:" << 45 << " and " << true << endi;
* -> display as an informative message.
......
......@@ -16,7 +16,7 @@
#ifndef TEST_MESSAGE
/* Release mode */
#include "../../interface/src/interface.hpp"
#include "../interface/interface.hpp"
#else
/* Test mode */
......
......@@ -6,7 +6,7 @@
#include <iostream>
#include <string>
/*! \struct Field Definition.hpp "../parser/src/Definition.hpp"
/*! \struct Field Definition.hpp "../parser/Definition.hpp"
* \brief Contains the name and the type of a definition element.
*/
struct Field{
......@@ -15,7 +15,7 @@ struct Field{
};
/*! \class Definition Definition.hpp "../parser/src/Definition.hpp"
/*! \class Definition Definition.hpp "../parser/Definition.hpp"
* \brief Contains the definition of a definition.
*/
......
......@@ -6,12 +6,12 @@
#include "Definition.hpp"
#include "Line.hpp"
#include "../../trace/src/values/Values.hpp"
#include "../trace/values/Values.hpp"
#ifdef DEBUG
#include "../tests/stub/trace.hpp"
#ifdef DEBUG_PRINT_TRACE
#include "../../tests/parser/stub/trace.hpp"
#else
#include "../../trace/src/Trace.hpp"
#include "../trace/Trace.hpp"
#endif
/**
* \class ParserEventDecoder
......
......@@ -9,10 +9,10 @@
#include "ParserEventDecoder.hpp"
#include "Parser.hpp"
#include "Line.hpp"
#ifdef DEBUG
#include "../tests/stub/trace.hpp"
#ifdef DEBUG_PRINT_TRACE
#include "../../tests/parser/stub/trace.hpp"
#else
#include "../../trace/src/Trace.hpp"
#include "../trace/Trace.hpp"
#endif
/*!
......
......@@ -7,7 +7,7 @@
#include "resource.hpp"
#include "../../interface/src/render_area.hpp"
#include "../interface/render_area.hpp"
......
#include "EntityList.hpp"
EntityList::EntityList() {
_beginning = 0;
_end = 0;
_current = 0;
#include "EntityList.hpp"
EntityList::EntityList() {
_beginning = 0;
_end = 0;
_current = 0;
}
EntityList::EntityList(const EntityList& list) {
EntityListElement *el, *src;
if (list.is_empty()) { // Empty list
_beginning = 0;
_end = 0;
if (list.is_empty()) { // Empty list
_beginning = 0;
_end = 0;
_current = 0;
}
else if (list._beginning == list._end) { // One element list
......@@ -44,92 +44,91 @@ EntityList::EntityList(const EntityList& list) {
_end = el;
}
}
EntityList::~EntityList(){
// For each entity of the list, we delete it
while(!is_empty()) {
this->remove_current();
}
}
bool EntityList::is_empty() const {
return _current == 0;
}
void EntityList::go_beginning() {
_current = _beginning;
}
void EntityList::go_end() {
_current = _end;
}
void EntityList::insert_after(const Entity *ent) {
EntityListElement *el = new EntityListElement;
el->ent = ent;
if (_current) {
el->next = _current->next;
el->previous = _current;
if (_current->next)
_current->next->previous = el;
_current->next = el;
if (_current == _end)
_end = el;
}
else { // There is no element in the list
el->next = 0;
el->previous = 0;
_beginning = _end = _current = el;
}
}
void EntityList::remove_current() {
EntityList::~EntityList(){
// For each entity of the list, we delete it
while(!is_empty()) {
this->remove_current();
}
}
bool EntityList::is_empty() const {
return _current == 0;
}
void EntityList::go_beginning() {
_current = _beginning;
}
void EntityList::go_end() {
_current = _end;
}
void EntityList::insert_after(const Entity *ent) {
EntityListElement *el = new EntityListElement;
el->ent = ent;
if (_current) {
el->next = _current->next;
el->previous = _current;
if (_current->next)
_current->next->previous = el;
_current->next = el;
if (_current == _end)
_end = el;
}
else { // There is no element in the list
el->next = 0;
el->previous = 0;
_beginning = _end = _current = el;
}
}
void EntityList::remove_current() {
EntityListElement *el = _current;
if (el) {
if (el->previous)
el->previous->next = el->next;
if (el->next)
el->next->previous = el->previous;
if (el == _beginning)
_beginning = el->next;
if (el == _end)
_end = el->previous;
if (el->next)
_current = el->next;
else
_current = el->previous;
if (el) {
if (el->previous)
el->previous->next = el->next;
if (el->next)
el->next->previous = el->previous;
if (el == _beginning)
_beginning = el->next;
if (el == _end)
_end = el->previous;
if (el->next)
_current = el->next;
else
_current = el->previous;
delete el;
}
}
void EntityList::next() {
if (_current && _current->next)
_current = _current->next;
}
bool EntityList::has_next() const {
return (_current && _current->next != NULL);
}
void EntityList::previous() {
if (_current && _current->previous)
_current = _current->previous;
}
bool EntityList::has_previous() const {
return (_current && _current->previous != 0);
}
const Entity *EntityList::get_current_entity() const {
if (_current)
return _current->ent;
else
return 0;
}
}
}
void EntityList::next() {
if (_current && _current->next)
_current = _current->next;
}
bool EntityList::has_next() const {
return (_current && _current->next != NULL);
}
void EntityList::previous() {
if (_current && _current->previous)
_current = _current->previous;
}
bool EntityList::has_previous() const {
return (_current && _current->previous != 0);
}
const Entity *EntityList::get_current_entity() const {
if (_current)
return _current->ent;
else
return 0;
}
#include "EntityValue.hpp"
EntityValue::EntityValue(const Name &name, EntityType *type): _name(name), _type(type) {
}
}
Name EntityValue::get_name() const {
return _name;
}
}
const EntityType *EntityValue::get_type() const {
return _type;
......
......@@ -10,7 +10,7 @@
#include "../../main_resource.hpp"
#include "../main_resource.hpp"
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment