COIN-OR::LEMON - Graph Library

Changeset 46:121452cc4096 in glemon-0.x for mapstorage.cc


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

No maps with the same name can be added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mapstorage.cc

    r31 r46  
    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.