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