Commit dc8434f2 authored by Mathieu Faverge's avatar Mathieu Faverge

Code indent and assert

parent c95731cb
......@@ -49,6 +49,7 @@
#define DRAW_TRACE_HPP
#include <iostream>
#include <cassert>
/*
* Theses constants can not be put as static const float because it is a template and there binary representation is not normed by the C++ langage.
......@@ -463,7 +464,9 @@ public:
link = *it;
EntityValue *value = link->get_value();
assert(value);
const Color *color = value->get_used_color();
assert(color);
if(link_is_in_set(link,set_container,interval))
draw_link(draw_object, link, color, value);
/*bool display=false;
......
......@@ -53,9 +53,13 @@
/* -- */
using namespace std;
Link::Link(Date start, Date end, LinkType *type, Container *container, Container *source, Container *destination, EntityValue *value, map<std::string, Value *> opt):
Entity(container, opt), _start(start), _end(end), _type(type), _value(value), _source(source), _destination(destination) {
Link::Link(Date start, Date end,
LinkType *type, Container *container,
Container *source, Container *destination,
EntityValue *value, map<std::string, Value *> opt)
: Entity(container, opt), _start(start), _end(end),
_type(type), _value(value), _source(source), _destination(destination)
{
}
Date Link::get_start_time() const {
......
......@@ -49,6 +49,7 @@
#include <sstream>
#include <stack>
#include <algorithm>
#include <cassert>
/* -- */
#include "interface/Interface.hpp"
......@@ -266,7 +267,7 @@ void Trace::define_link_type(Name &name,
map<string, Value *> &opt)
{
if (source && destination) {
LinkType * lt = new LinkType(name, ancestor, source, destination, opt);
LinkType *lt = new LinkType(name, ancestor, source, destination, opt);
_link_types.insert( pair<std::string, LinkType*>(name.get_alias(), lt) );
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
......@@ -338,7 +339,8 @@ void Trace::reset_state(Date &time, StateType *type, Container *container, map<s
void Trace::new_event(Date &time, EventType *type, Container *container, map<string, Value *> &opt) {
if (container && type) {
EntityValue *EV = search_entity_value( type->get_alias(), type );
EntityValue *EV = search_entity_value( type->get_alias(), type );
assert(EV);
container->new_event(time, type, EV, opt);
}
......@@ -384,7 +386,8 @@ Trace::start_link(Date &time, LinkType *type,
Container *ancestor, Container *source,
String key, map<string, Value *> &opt)
{
EntityValue* EV = search_entity_value( type->get_alias(), type );
EntityValue *EV = search_entity_value( type->get_alias(), type );
assert(EV);
if (ancestor && type && source)
ancestor->start_link(time, type, source, EV, key, opt);
......@@ -813,6 +816,7 @@ Trace::search_entity_value(std::string alias,
}
std::cerr << "Trace::search_entity_value: EntityValue with alias " << alias << " not found !!!" << std::endl;
assert(0);
return NULL;
}
......
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