COIN-OR::LEMON - Graph Library

Changeset 1597:15b51d278bf0 in lemon-0.x for gui/mapstorage.cc


Ignore:
Timestamp:
07/27/05 13:35:13 (16 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2101
Message:

No maps with the same name can be added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/mapstorage.cc

    r1525 r1597  
    77int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap)
    88{
    9   nodemap_storage[name]=nodemap;
    10   return 0;
     9  if( nodemap_storage.find(name) == nodemap_storage.end() )
     10    {
     11      nodemap_storage[name]=nodemap;
     12      return 0;
     13    }
     14  return 1;
    1115}
    1216
    1317int MapStorage::addEdgeMap(const std::string & name, Graph::EdgeMap<double> *edgemap)
    1418{
    15   edgemap_storage[name]=edgemap;
    16   return 0;
     19  if( edgemap_storage.find(name) == edgemap_storage.end() )
     20    {
     21      edgemap_storage[name]=edgemap;
     22      return 0;
     23    }
     24  return 1;
    1725}
    1826
Note: See TracChangeset for help on using the changeset viewer.