sl@0
|
1 |
//=======================================================================
|
sl@0
|
2 |
// Copyright 2002 Indiana University.
|
sl@0
|
3 |
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
|
sl@0
|
4 |
//
|
sl@0
|
5 |
// Distributed under the Boost Software License, Version 1.0. (See
|
sl@0
|
6 |
// accompanying file LICENSE_1_0.txt or copy at
|
sl@0
|
7 |
// http://www.boost.org/LICENSE_1_0.txt)
|
sl@0
|
8 |
//=======================================================================
|
sl@0
|
9 |
|
sl@0
|
10 |
/*
|
sl@0
|
11 |
* © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
|
sl@0
|
12 |
*/
|
sl@0
|
13 |
|
sl@0
|
14 |
#include <boost/graph/properties.hpp>
|
sl@0
|
15 |
#include <boost/graph/adjacency_list.hpp>
|
sl@0
|
16 |
#ifdef __SYMBIAN32__
|
sl@0
|
17 |
#include "std_log_result.h"
|
sl@0
|
18 |
#define LOG_FILENAME_LINE __FILE__, __LINE__
|
sl@0
|
19 |
#endif
|
sl@0
|
20 |
using namespace boost;
|
sl@0
|
21 |
|
sl@0
|
22 |
struct vertex_info_t { };
|
sl@0
|
23 |
struct edge_info_t { };
|
sl@0
|
24 |
namespace boost {
|
sl@0
|
25 |
BOOST_INSTALL_PROPERTY(vertex, info);
|
sl@0
|
26 |
BOOST_INSTALL_PROPERTY(edge, info);
|
sl@0
|
27 |
};
|
sl@0
|
28 |
|
sl@0
|
29 |
typedef property<vertex_info_t, double> vertex_properties;
|
sl@0
|
30 |
typedef property<edge_info_t, double> edge_properties;
|
sl@0
|
31 |
|
sl@0
|
32 |
typedef adjacency_list<vecS, vecS, bidirectionalS,
|
sl@0
|
33 |
vertex_properties, edge_properties> graph_t;
|
sl@0
|
34 |
|
sl@0
|
35 |
double& foo_1(graph_t& x)
|
sl@0
|
36 |
{
|
sl@0
|
37 |
property_map<graph_t, vertex_info_t>::type pmap
|
sl@0
|
38 |
= get(vertex_info_t(), x);
|
sl@0
|
39 |
return pmap[vertex(0, x)];
|
sl@0
|
40 |
}
|
sl@0
|
41 |
|
sl@0
|
42 |
const double& foo_2(graph_t const & x)
|
sl@0
|
43 |
{
|
sl@0
|
44 |
property_map<graph_t, vertex_info_t>::const_type pmap
|
sl@0
|
45 |
= get(vertex_info_t(), x);
|
sl@0
|
46 |
return pmap[vertex(0, x)];
|
sl@0
|
47 |
}
|
sl@0
|
48 |
|
sl@0
|
49 |
double& bar_1(graph_t& x)
|
sl@0
|
50 |
{
|
sl@0
|
51 |
property_map<graph_t, edge_info_t>::type pmap
|
sl@0
|
52 |
= get(edge_info_t(), x);
|
sl@0
|
53 |
return pmap[edge(vertex(0, x), vertex(1, x), x).first];
|
sl@0
|
54 |
}
|
sl@0
|
55 |
|
sl@0
|
56 |
const double& bar_2(graph_t const & x)
|
sl@0
|
57 |
{
|
sl@0
|
58 |
property_map<graph_t, edge_info_t>::const_type pmap
|
sl@0
|
59 |
= get(edge_info_t(), x);
|
sl@0
|
60 |
return pmap[edge(vertex(0, x), vertex(1, x), x).first];
|
sl@0
|
61 |
}
|
sl@0
|
62 |
|
sl@0
|
63 |
int
|
sl@0
|
64 |
main()
|
sl@0
|
65 |
{
|
sl@0
|
66 |
|
sl@0
|
67 |
#ifdef __SYMBIAN32__
|
sl@0
|
68 |
std_log(LOG_FILENAME_LINE,"[End Test Case ]");
|
sl@0
|
69 |
|
sl@0
|
70 |
testResultXml("lvalue_pmap");
|
sl@0
|
71 |
close_log_file();
|
sl@0
|
72 |
#endif
|
sl@0
|
73 |
return 0;
|
sl@0
|
74 |
}
|