Commit be838038 authored by Mathieu Faverge's avatar Mathieu Faverge

Apply patch 9 from issue #13 - modernize loop convert

parent 68d76d81
......@@ -13,9 +13,8 @@ Palette::Palette(const std::string &name) : _name(name) {
}
Palette::~Palette() {
for(std::map<std::string, Color *>::iterator it = _pairs.begin() ;
it != _pairs.end() ; ++ it) {
Color *c = (*it).second;
for(auto & _pair : _pairs) {
Color *c = _pair.second;
delete c;
}
}
......
......@@ -93,7 +93,7 @@ bool convert_to_double(const std::string &arg, double *val) {
}
}
double clockGet (void)
double clockGet ()
{
#if (defined X_ARCHalpha_compaq_osf1) || (defined X_ARCHi686_mac)
struct rusage data;
......
......@@ -66,6 +66,6 @@ bool convert_to_double(const std::string &arg, double *val);
Uses different timing routines depending on the machine architecture.
\return Returns the time ellapsed since 'clockStart'.
*/
double clockGet (void);
double clockGet ();
#endif // TOOLS_HPP
......@@ -930,16 +930,12 @@ void Core::launch_action(int state, void* arg) {
const Container::Vector *root_containers = _trace->get_view_root_containers();
if(root_containers->empty())root_containers= _trace->get_root_containers();
if (!root_containers->empty()){
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
if ((container = buf.search_container_by_position(*i, yr)))
for (const auto &root_container : *root_containers)
if ((container = buf.search_container_by_position(root_container, yr)))
break;
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
if ((container2 = buf.search_container_by_position(*i, yr2)))
for (const auto &root_container : *root_containers)
if ((container2 = buf.search_container_by_position(root_container, yr2)))
break;
......@@ -1159,11 +1155,9 @@ void Core::export_variable(Variable *var, const string &filename) {
const double min = var->get_min().get_value();
const double max = var->get_max().get_value();
for(list<pair<Date, Double> >::const_iterator value = variable_values->begin();
value != variable_values->end();
value++) {
first_value = (*value).first.get_value();
second_value =((*value).second.get_value()-min)/(max-min) ;
for(const auto & variable_value : *variable_values) {
first_value = variable_value.first.get_value();
second_value =(variable_value.second.get_value()-min)/(max-min) ;
file << first_value << "\t" << second_value << endl;
}
......
......@@ -235,8 +235,8 @@ void Interface_graphic::load_windows(){
_ui_help_window, SLOT(close()));
// For the recent files menu
for (int i = 0 ; i < Session::_MAX_NB_RECENT_FILES ; ++ i) {
_recent_file_actions[i] = nullptr;
for (auto & _recent_file_action : _recent_file_actions) {
_recent_file_action = nullptr;
}
update_recent_files_menu();
......@@ -601,9 +601,9 @@ void Interface_graphic::open_recent_file() {
void Interface_graphic::on_clear_recent_files_triggered() {
Session::clear_recent_files();
// We remove the elements from the menu
for(int i = 0 ; i < Session::_MAX_NB_RECENT_FILES ; ++ i) {
if(_recent_file_actions[i] != nullptr) {
_ui_recent_files_menu->removeAction(_recent_file_actions[i]);
for(auto & _recent_file_action : _recent_file_actions) {
if(_recent_file_action != nullptr) {
_ui_recent_files_menu->removeAction(_recent_file_action);
}
}
}
......
......@@ -101,17 +101,15 @@ void Node_select::set_initial_container_names(){
// Add the root container names
QList<QTreeWidgetItem *> items;
QFlags<Qt::ItemFlag> flg;
for (Container::VectorIt it = root_containers->begin();
it != root_containers->end();
it ++) {
string name = (*it)->get_Name().to_string();
for (const auto &root_container : *root_containers) {
string name = root_container->get_Name().to_string();
QStringList temp(QString::fromStdString(name));
QTreeWidgetItem *current_node = new QTreeWidgetItem((QTreeWidgetItem *)nullptr, temp);
current_node->setData(0,Qt::UserRole,qVariantFromValue(*it));//store the pointer to the container in the Data field
current_node->setData(0,Qt::UserRole,qVariantFromValue(root_container));//store the pointer to the container in the Data field
items.append(current_node);
// Recursivity to add the children names
set_container_names_rec(current_node, (*it), flg, false);
set_container_names_rec(current_node, root_container, flg, false);
}
_nodes_original->insertTopLevelItems(0, items);
......@@ -136,20 +134,18 @@ void Node_select::set_displayed_container_names(){
// Add the root container names
QList<QTreeWidgetItem *> items;
QFlags<Qt::ItemFlag> flg= Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsTristate;
for (Container::VectorIt it = root_containers->begin();
it != root_containers->end();
it ++) {
string name = (*it)->get_Name().to_string();
for (const auto &root_container : *root_containers) {
string name = root_container->get_Name().to_string();
QStringList temp(QString::fromStdString(name));
QTreeWidgetItem *current_node = new QTreeWidgetItem((QTreeWidgetItem *)nullptr, temp);
current_node->setFlags(flg);
current_node->setCheckState(0,Qt::Checked);
current_node->setData(0,Qt::UserRole,qVariantFromValue(*it));//store the pointer to the container in the Data field
current_node->setData(0,Qt::UserRole,qVariantFromValue(root_container));//store the pointer to the container in the Data field
items.append(current_node);
// Recursivity to add the children names
set_container_names_rec(current_node, (*it), flg, true);
set_container_names_rec(current_node, root_container, flg, true);
}
_nodes_displayed->insertTopLevelItems(0, items);
......@@ -170,18 +166,16 @@ void Node_select::set_container_names_rec(QTreeWidgetItem *current_node, Contain
if(load_view==false || children->empty())children = current_container->get_children();
//QFlags<Qt::ItemFlag> flg= Qt::ItemIsDragEnabled;
for (Container::VectorIt it = children->begin();
it != children->end();
it ++) {
for (const auto &child : *children) {
// We create the node and we do the recursivity
string name = (*it)->get_Name().to_string();
string name = child->get_Name().to_string();
QStringList temp(QString::fromStdString(name));
QTreeWidgetItem *node = new QTreeWidgetItem(current_node, temp);
node->setFlags(flg);
node->setData(0,Qt::UserRole, qVariantFromValue(*it));//store the pointer to the container in the Data field
node->setData(0,Qt::UserRole, qVariantFromValue(child));//store the pointer to the container in the Data field
if(flg & Qt::ItemIsUserCheckable)node->setCheckState(0,Qt::Checked);
set_container_names_rec(node ,(*it), flg, load_view);
set_container_names_rec(node ,child, flg, load_view);
}
}
......
......@@ -30,10 +30,7 @@
#include <QStylePainter>
#include <QStyleOptionSlider>
QxtSpanSliderPrivate::QxtSpanSliderPrivate()
{
}
QxtSpanSliderPrivate::QxtSpanSliderPrivate() = default;
void QxtSpanSliderPrivate::initStyleOption(QStyleOptionSlider* option, QxtSpanSlider::SpanHandle handle) const
{
......
......@@ -107,12 +107,11 @@ void ParserVite::parse(Trace &trace,
/* Loop over root containers to add them in the stack */
root_containers = trace.get_root_containers();
for (Container::VectorIt it = root_containers->begin();
it != root_containers->end(); it++) {
for (const auto &root_container : *root_containers) {
#ifdef DBG_PARSER_VITE
std::cerr << "+";
#endif
CTstack.push(*it);
CTstack.push(root_container);
}
#ifdef DBG_PARSER_VITE
......
......@@ -180,10 +180,8 @@ void Command_window::set_container_names() {
QList<QTreeWidgetItem *> items;
QFlags<Qt::ItemFlag> flg=Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsTristate;
for (Container::VectorIt it = root_containers->begin();
it != root_containers->end();
it ++) {
string name = (*it)->get_Name().to_string();
for (const auto &root_container : *root_containers) {
string name = root_container->get_Name().to_string();
QStringList temp(QString::fromStdString(name));
QTreeWidgetItem *current_node = new QTreeWidgetItem((QTreeWidgetItem *)nullptr, temp);
......@@ -192,7 +190,7 @@ void Command_window::set_container_names() {
items.append(current_node);
// Recursivity to add the children names
set_container_names_rec(current_node, (*it));
set_container_names_rec(current_node, root_container);
}
(*(items.begin()))->setExpanded(true);
......@@ -203,16 +201,14 @@ void Command_window::set_container_names_rec(QTreeWidgetItem *current_node, cons
const Container::Vector *children = current_container->get_children();
QFlags<Qt::ItemFlag> flg = Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | Qt::ItemIsEnabled/* | Qt::ItemIsTristate*/;
for (Container::VectorIt it = children->begin();
it != children->end();
it ++) {
for (const auto &it : *children) {
// We create the node and we do the recursivity
string name = (*it)->get_Name().to_string();
string name = it->get_Name().to_string();
QStringList temp(QString::fromStdString(name));
QTreeWidgetItem *node = new QTreeWidgetItem(current_node, temp);
node->setFlags(flg);
node->setCheckState(0,Qt::Unchecked);
set_container_names_rec(node ,(*it));
set_container_names_rec(node ,it);
}
}
......
......@@ -110,9 +110,9 @@ Plugin_window::Plugin_window(Core *c, QWidget *parent)
Plugin_window::~Plugin_window() {
_plugin_directories.clear();
for(unsigned int i = 0 ; i < _plugins.size() ; i ++) {
delete _plugins[i];
_plugins[i] = nullptr;
for(auto & _plugin : _plugins) {
delete _plugin;
_plugin = nullptr;
}
_plugins.clear();
}
......@@ -134,8 +134,7 @@ void Plugin_window::load_shared_plugins() {
QFileInfoList list = dir.entryInfoList();
for (int i = 0 ; i < list.size() ; ++ i) {
const QFileInfo &fileInfo = list.at(i);
for (const auto & fileInfo : list) {
QString filename = fileInfo.absoluteFilePath();
if(!QLibrary::isLibrary(filename)) {
......@@ -144,7 +143,7 @@ void Plugin_window::load_shared_plugins() {
QLibrary current_plugin(filename);
Plugin *(*f)(void) = (Plugin *(*)(void)) current_plugin.resolve("create");
Plugin *(*f)() = (Plugin *(*)()) current_plugin.resolve("create");
if(!f) {
cerr << "Unable to load " << current_plugin.errorString().toStdString() <<endl;
}
......@@ -194,10 +193,8 @@ void Plugin_window::execute_plugin() {
}
void Plugin_window::clear_plugins() {
for(vector<Plugin *>::iterator it = _plugins.begin() ;
it < _plugins.end() ;
++ it) {
(*it)->clear();
for(Plugin *plugin : _plugins) {
plugin->clear();
}
}
......@@ -205,9 +202,9 @@ void Plugin_window::reload_plugins() {
// Temporary disconnection for delete current plugins
disconnect(_tab_widget, SIGNAL(currentChanged(int)), this, SLOT(reload_plugin(int)));
_plugin_directories.clear();
for(unsigned int i = 0 ; i < _plugins.size() ; i ++) {
delete _plugins[i];
_plugins[i] = nullptr;
for(auto & _plugin : _plugins) {
delete _plugin;
_plugin = nullptr;
}
_plugins.clear();
connect(_tab_widget, SIGNAL(currentChanged(int)), this, SLOT(reload_plugin(int)));
......
......@@ -218,13 +218,13 @@ public:
/* Before calling start_draw_container(), Info::Container::y_max should have a correct value */
_render->start_draw_containers();
for (unsigned int i=0 ; i<_containers.size() ; i++){
for (const auto & _container : _containers){
_render->set_color(0, 0, j);
_render->draw_quad(_containers[i].x * coeffx,
trace_to_render_y(_containers[i].y),
_render->draw_quad(_container.x * coeffx,
trace_to_render_y(_container.y),
_z_container,
_containers[i].w * coeffx,
_containers[i].h * coeffy);
_container.w * coeffx,
_container.h * coeffy);
}
for (unsigned int i=0 ; i<_container_texts.size() ; i++){
......
......@@ -115,10 +115,8 @@ public:
for(int i = 0 ; i < nbcont ; i ++) {
const std::map<VariableType *, Variable *> *variables = this->_containers_to_print[i]->get_variables();
// We print each variable
for(std::map<VariableType *, Variable *>::const_iterator it = variables->begin() ;
it != variables->end() ;
it ++) {
draw_diagram(draw_object, i, (*it).second);
for(const auto &variable : *variables) {
draw_diagram(draw_object, i, variable.second);
_nb_variables_already_print ++;
}
}
......@@ -229,11 +227,9 @@ public:
bool is_last_value = false; // If we get a time bigger than the end_time
if(max_value != min_value) {
for (std::list<std::pair<Date, Double> >::const_iterator it = values->begin();
it != values->end();
it ++) {
time = (*it).first.get_value();
value = (*it).second.get_value();
for (const auto & it : *values) {
time = it.first.get_value();
value = it.second.get_value();
if(time < this->_start_time) {
continue;
......
......@@ -180,11 +180,9 @@ public:
ctname);
// Draw the stats
for (std::map<const EntityValue *, stats *>::iterator it = temp_states.begin();
it != temp_states.end();
it ++)
for (auto & temp_state : temp_states)
{
double length = (*it).second->_total_length;
double length = temp_state.second->_total_length;
double percent = length / duration ;
double width = percent * _graph_width;
double red = 0.7;
......@@ -192,9 +190,9 @@ public:
double blue = 0.75;
// We search for a color
if((*it).first->get_extra_fields()->find(std::string("Color")) != (*it).first->get_extra_fields()->end())
if(temp_state.first->get_extra_fields()->find(std::string("Color")) != temp_state.first->get_extra_fields()->end())
{
const Color *color = (const Color *)(*it).first->get_extra_fields()->find(std::string("Color"))->second;
const Color *color = (const Color *)temp_state.first->get_extra_fields()->find(std::string("Color"))->second;
red = color->get_red();
green = color->get_green();
blue = color->get_blue();
......@@ -210,7 +208,7 @@ public:
QString::number(percent*100., 'f', 1).toStdString()+"%");
pos_x += width;
this->_setstates.insert((*it).first);
this->_setstates.insert(temp_state.first);
}
......
......@@ -196,11 +196,9 @@ public:
virtual double get_max_percentage(std::map<const EntityValue*, stats*> &temp_states) const {
double value;
double max_length = 0.;
for (std::map<const EntityValue *, stats *>::iterator it = temp_states.begin();
it != temp_states.end();
it ++) {
if((*it).second->_total_length >= max_length) {
max_length = (*it).second->_total_length;
for (auto & temp_state : temp_states) {
if(temp_state.second->_total_length >= max_length) {
max_length = temp_state.second->_total_length;
}
}
value = max_length/(_end_time-_start_time);
......
......@@ -143,17 +143,15 @@ public:
// Draw the stats
for (std::map<const EntityValue *, stats *>::iterator it = temp_states.begin();
it != temp_states.end();
it ++) {
for (auto & temp_state : temp_states) {
// We have to convert the percentage in a rectangle and print it
const double length = (*it).second->_total_length;
const double length = temp_state.second->_total_length;
const double height = length*100.*this->_percentage_height_default/(this->_end_time-this->_start_time);
// We search for a color
if((*it).first->get_extra_fields()->find(std::string("Color")) != (*it).first->get_extra_fields()->end()) {
const Color *color = (const Color *)(*it).first->get_extra_fields()->find(std::string("Color"))->second;
if(temp_state.first->get_extra_fields()->find(std::string("Color")) != temp_state.first->get_extra_fields()->end()) {
const Color *color = (const Color *)temp_state.first->get_extra_fields()->find(std::string("Color"))->second;
draw_object->draw_rect(pos_x, pos_y, _WIDTH_HISTOGRAM_DEFAULT, height/max_percentage, color->get_red(), color->get_green(), color->get_blue());
}
else {
......
......@@ -64,10 +64,8 @@ Statistic::Statistic(){
Statistic::~Statistic(){
// Delete states
for (map<const EntityValue *, stats *>::iterator it = _states.begin();
it != _states.end();
it ++) {
delete (*it).second;
for (auto & _state : _states) {
delete _state.second;
}
}
......
......@@ -111,11 +111,9 @@ void Stats_window::set_container_names() {
QList<QTreeWidgetItem *> items;
QFlags<Qt::ItemFlag> flg=Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsTristate;
for (Container::VectorIt it = root_containers->begin();
it != root_containers->end();
it ++) {
string name = (*it)->get_name();
string alias = (*it)->get_alias();
for (const auto &root_container : *root_containers) {
string name = root_container->get_name();
string alias = root_container->get_alias();
QStringList str_name(QString::fromStdString(name));
QString str_alias(QString::fromStdString(alias));
QTreeWidgetItem *current_node = new QTreeWidgetItem((QTreeWidgetItem *)nullptr, str_name);
......@@ -126,7 +124,7 @@ void Stats_window::set_container_names() {
items.append(current_node);
// Recursivity to add the children names
set_container_names_rec(current_node, (*it));
set_container_names_rec(current_node, root_container);
}
(*(items.begin()))->setExpanded(true);
......@@ -137,20 +135,18 @@ void Stats_window::set_container_names_rec(QTreeWidgetItem *current_node, Contai
const Container::Vector *children = current_container->get_children();
QFlags<Qt::ItemFlag> flg = Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsTristate;
for (Container::VectorIt it = children->begin();
it != children->end();
it ++)
for (const auto &it : *children)
{
// We create the node and we do the recursivity
string name = (*it)->get_name();
string alias = (*it)->get_alias();
string name = it->get_name();
string alias = it->get_alias();
QStringList str_name(QString::fromStdString(name));
QString str_alias(QString::fromStdString(alias));
QTreeWidgetItem *node = new QTreeWidgetItem(current_node, str_name);
node->setFlags(flg);
node->setCheckState(0,Qt::Checked);
node->setText(1, str_alias);
set_container_names_rec(node ,(*it));
set_container_names_rec(node ,it);
}
}
......
......@@ -134,10 +134,8 @@ Container::~Container()
_links.pop_front();
}
// Delete variables
for(map<VariableType *, Variable *>::iterator it = _variables.begin();
it != _variables.end();
it++){
delete (*it).second;
for(auto & _variable : _variables){
delete _variable.second;
}
_variables.clear();
#endif
......
......@@ -209,11 +209,9 @@ public:
std::stack<Container *> containers;
const Container::Vector *root_containers = trace->get_view_root_containers();
if(root_containers->empty())root_containers= trace->get_root_containers();
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++){
containers.push(*i);
container->push_back(*i);
for (const auto &root_container : *root_containers){
containers.push(root_container);
container->push_back(root_container);
}
add(container, &containers);
......@@ -282,12 +280,10 @@ public:
*Message::get_instance() << QObject::tr("There is no container. The trace can not be drawn.").toStdString() << Message::endw;
}
else {
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
for (const auto &root_container : *root_containers)
// Use the fact that if a container is selected, then it implies that all his ancestors are
if(is_in_set(*i,container))
y += browse_container(draw_object, *i, 0., y, _container_width, 0., container)+_container_v_space;
if(is_in_set(root_container,container))
y += browse_container(draw_object, root_container, 0., y, _container_width, 0., container)+_container_v_space;
}
}/* end browse_container_tree */
......@@ -310,10 +306,8 @@ public:
children = container->get_children();
/*if(!children.empty())
h = 0.;*/
for (Container::VectorIt i = children->begin();
i != children->end();
i++) {
h += browse_container(draw_object, (*i), x + _container_width + _container_h_space, y + h, _container_width, 0., set_container) + _container_v_space;
for (const auto &i : *children) {
h += browse_container(draw_object, i, x + _container_width + _container_h_space, y + h, _container_width, 0., set_container) + _container_v_space;
}
// h -= _container_v_space;
......@@ -452,13 +446,8 @@ public:
// Browse links
link_list = container->get_links();
for (Link::VectorIt it = link_list->begin();
it != link_list->end();
it++) {
link = *it;
for (const auto &it : *link_list) {
link = it;
EntityValue *value = link->get_value();
assert(value);
const Color *color = value->get_used_color();
......@@ -521,11 +510,9 @@ public:
// Browse variables
variable_map = container->get_variables();
for (std::map<VariableType *, Variable *>::const_iterator i = variable_map->begin();
i != variable_map->end();
i++) {
for (const auto &i : *variable_map) {
var = (*i).second;
var = i.second;
double min = var->get_min().get_value();
double max = var->get_max().get_value();
variable_values = var->get_values();
......@@ -537,14 +524,12 @@ public:
draw_object->draw_text_value((long int)var, 0.0, position + 0.5 * _container_height + _container_v_space/2);
_var_positions[var]=position;
draw_variable_value(draw_object, 0.0, 0.0, position);
for (std::list<std::pair<Date, Double> >::const_iterator value = variable_values->begin();
value != variable_values->end();
value++) {
for (const auto & variable_value : *variable_values) {
/* Call the object state drawing function.
We pass the first value if correspond to the beginning */
first_value = (*value).first.get_value();
second_value =((*value).second.get_value()-min)/(max-min) ;
first_value = variable_value.first.get_value();
second_value =(variable_value.second.get_value()-min)/(max-min) ;
if(!(first_value == 0. && second_value == 0.)) {
draw_variable_value(draw_object, first_value, second_value, position);
}
......@@ -617,10 +602,8 @@ public:
const Container::Vector *root_containers = trace->get_view_root_containers();
if(root_containers->empty())root_containers= trace->get_root_containers();
if (!root_containers->empty())
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
if ((container = search_container_by_position(*i, yr)))
for (const auto &root_container : *root_containers)
if ((container = search_container_by_position(root_container, yr)))
break;
// If the clic is out
......@@ -629,10 +612,8 @@ public:
// Calculate the container positions
int position = 0;
for (Container::VectorIt i = root_containers->begin();
i != root_containers->end();
i++)
position += calc_container_positions(*i, position);
for (const auto &root_container : *root_containers)
position += calc_container_positions(root_container, position);
// First we browse to find a communication
ancestor = container;
......@@ -746,10 +727,8 @@ public:
void print_extra_fields(const std::string &name, const std::map<std::string, Value *> *extra_fields) {
if (extra_fields!=nullptr &&!extra_fields->empty()) {
*Message::get_instance() << "<em>" << name << " extra fields</em><br />";
for (std::map<std::string, Value *>::const_iterator i = extra_fields->begin();
i != extra_fields->end();
i++)
*Message::get_instance() << "<strong>" << (*i).first << ":</strong> " << (*i).second->to_string() << "<br />";
for (const auto & extra_field : *extra_fields)
*Message::get_instance() << "<strong>" << extra_field.first << ":</strong> " << extra_field.second->to_string() << "<br />";
}
}
......@@ -758,10 +737,8 @@ public:
// Search if the result is a descendant
const Container::Vector *children = container->get_view_children();//we want to display only children meant to be displayed
if(children->empty())children = container->get_children();
for (Container::VectorIt i = children->begin();
i != children->end();
i++) {
if ((result = search_container_by_position(*i, y)) != nullptr)
for (const auto &i : *children) {
if ((result = search_container_by_position(i, y)) != nullptr)
return result;
}
......@@ -801,10 +778,8 @@ public:
const Container::Vector *children = container->get_view_children();//we want to display only children meant to be displayed
if( children->empty() )
children = container->get_children();
for (Container::VectorIt i = children->begin();
i != children->end();
i++) {
size += calc_container_positions((*i), position+size);
for (const auto &i : *children) {
size += calc_container_positions(i, position+size);
}
// Store the position to draw links
......@@ -842,11 +817,9 @@ public:
// Browse links
link_list = container->get_links();
for (Link::VectorIt it = link_list->begin();
it != link_list->end();
it++) {
for (const auto &it : *link_list) {
link = *it;
link = it;
double srcpos = _container_positions[link->get_source()];
double dstpos = _container_positions[link->get_destination()];
......@@ -933,8 +906,8 @@ public:
const Container * dest = link->get_destination();
for(unsigned int i = 0 ; i < set_container->size() ; i++){
if(src == (*set_container)[i]){
for(unsigned int j = 0 ; j < set_container->size() ; j++)
if(dest == (*set_container)[j])
for(const auto & j : *set_container)
if(dest == j)
if(
(interval->_left.get_value() < link->get_start_time().get_value() && interval->_right.get_value() > link->get_end_time().get_value()) ||
(interval->_left.get_value() < link->get_end_time().get_value() && interval->_right.get_value() > link->get_start_time().get_value()))
......@@ -947,8 +920,8 @@ public:
bool is_in_set(const Container * c, std::vector<const Container *> *set_container){
if(!c || !set_container)
return false;
for(unsigned int i = 0 ; i<set_container->size() ; i++ )
if(c==(*set_container)[i])
for(const auto & i : *set_container)
if(c==i)
return true;
return false;
}
......@@ -963,11 +936,9 @@ public:
containers->pop();
const Container::Vector *children = c->get_view_children();//we want to display only children meant to be displayed
if(children->empty())children = c->get_children();
for (Container::VectorIt i = children->begin();
i != children->end();
i++){
containers->push(*i);
container->push_back(*i);
for (const auto &i : *children){
containers->push(i);
container->push_back(i);
}
add(container,containers);