1 ////////////////////////////////////////////////////////////////////////////// 2 // 3 // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost 4 // Software License, Version 1.0. (See accompanying file 5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 // 7 // See http://www.boost.org/libs/interprocess for documentation. 8 // 9 ////////////////////////////////////////////////////////////////////////////// 10 11 #ifndef BOOST_INTERPROCESS_TEST_PRINTCONTAINER_HPP 12 #define BOOST_INTERPROCESS_TEST_PRINTCONTAINER_HPP 13 14 #include <boost/interprocess/detail/config_begin.hpp> 15 #include <iostream> 16 17 namespace boost{ 18 namespace interprocess{ 19 namespace test{ 20 21 template<class Container> PrintContents(const Container & cont,const char * contName)22void PrintContents(const Container &cont, const char *contName) 23 { 24 std::cout<< "Printing contents of " << contName << std::endl; 25 typename Container::iterator b(cont.begin()), e(cont.end()); 26 for(; b != e; ++b){ 27 std::cout << *b << " "; 28 } 29 std::cout<< std::endl << std::endl; 30 } 31 32 //Function to dump data 33 template<class MyShmCont, class MyStdCont> PrintContainers(MyShmCont * shmcont,MyStdCont * stdcont)34void PrintContainers(MyShmCont *shmcont, MyStdCont *stdcont) 35 { 36 typename MyShmCont::iterator itshm = shmcont->begin(), itshmend = shmcont->end(); 37 typename MyStdCont::iterator itstd = stdcont->begin(), itstdend = stdcont->end(); 38 39 std::cout << "MyShmCont" << std::endl; 40 for(; itshm != itshmend; ++itshm){ 41 std::cout << *itshm << std::endl; 42 } 43 std::cout << "MyStdCont" << std::endl; 44 45 for(; itstd != itstdend; ++itstd){ 46 std::cout << *itstd << std::endl; 47 } 48 } 49 50 } //namespace test{ 51 } //namespace interprocess{ 52 } //namespace boost{ 53 54 #include <boost/interprocess/detail/config_end.hpp> 55 56 #endif //#ifndef BOOST_INTERPROCESS_TEST_PRINTCONTAINER_HPP 57