// Copyright 2008-2010 Gordon Woodhull // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // mplgraph.cpp : Defines the entry point for the console application. // #include #include namespace mpl_graph = boost::msm::mpl_graph; namespace mpl_utils = mpl_graph::mpl_utils; namespace mpl = boost::mpl; /* test graph: A -> B -> C -\--> D \ |--> E \ \--> F \-----/ */ // vertices struct A{}; struct B{}; struct C{}; struct D{}; struct E{}; struct F{}; // edges struct A_B{}; struct B_C{}; struct C_D{}; struct C_E{}; struct C_F{}; struct B_F{}; typedef mpl::vector, mpl::vector, mpl::vector, mpl::vector, mpl::vector, mpl::vector > some_incidence_list; typedef mpl_graph::incidence_list_graph some_graph; BOOST_MPL_ASSERT(( boost::is_same::type, B> )); BOOST_MPL_ASSERT(( boost::is_same::type, C> )); BOOST_MPL_ASSERT(( boost::is_same::type, D> )); BOOST_MPL_ASSERT(( boost::is_same::type, F> )); BOOST_MPL_ASSERT(( mpl_utils::set_equal::type, mpl::vector > )); BOOST_MPL_ASSERT(( mpl_utils::set_equal::type, mpl::vector > )); BOOST_MPL_ASSERT_RELATION( (mpl_graph::out_degree::value), ==, 2 ); BOOST_MPL_ASSERT_RELATION( (mpl_graph::out_degree::value), ==, 3 ); BOOST_MPL_ASSERT(( mpl_utils::set_equal::type, mpl::vector > )); BOOST_MPL_ASSERT(( mpl_utils::set_equal::type, mpl::vector > )); BOOST_MPL_ASSERT_RELATION( (mpl_graph::in_degree::value), ==, 0 ); BOOST_MPL_ASSERT_RELATION( (mpl_graph::in_degree::value), ==, 2 ); BOOST_MPL_ASSERT_RELATION( (mpl_graph::degree::value), ==, 1 ); BOOST_MPL_ASSERT_RELATION( (mpl_graph::degree::value), ==, 4 ); BOOST_MPL_ASSERT(( mpl_utils::set_equal::type, mpl::vector > )); BOOST_MPL_ASSERT(( mpl_utils::set_equal::type, mpl::vector > )); BOOST_MPL_ASSERT(( mpl_utils::set_equal::type, mpl::vector > )); BOOST_MPL_ASSERT_RELATION( mpl_graph::num_vertices::value, ==, 6 ); BOOST_MPL_ASSERT_RELATION( mpl_graph::num_edges::value, ==, 6 ); int main(int argc, char* argv[]) { return 0; }