graph_properties.cc 1.41 KB
Newer Older
Tiago Peixoto's avatar
Tiago Peixoto committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// graph-tool -- a general graph modification and manipulation thingy
//
// Copyright (C) 2006  Tiago de Paula Peixoto <tiago@forked.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

#include "graph_properties.hh"

//==============================================================================
// find_property_map(dp,name,key_type)
//==============================================================================
boost::dynamic_property_map& 
25
graph_tool::find_property_map(const boost::dynamic_properties& dp, std::string name, const std::type_info& key_type)
Tiago Peixoto's avatar
Tiago Peixoto committed
26
27
28
29
30
31
32
{
    for(typeof(dp.begin()) iter = dp.begin(); iter != dp.end(); ++iter)
	if (iter->first == name && iter->second->key() == key_type)
	    return *iter->second;

    throw boost::property_not_found(name);
}