1 //////////////////////////////////////////////////////////////////////////////
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)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #ifndef BOOST_INTERPROCESS_TEST_PRINTCONTAINER_HPP
12 #define BOOST_INTERPROCESS_TEST_PRINTCONTAINER_HPP
14 #include <boost/interprocess/detail/config_begin.hpp>
18 namespace interprocess{
21 template<class Container>
22 void PrintContents(const Container &cont, const char *contName)
24 std::cout<< "Printing contents of " << contName << std::endl;
25 typename Container::iterator b(cont.begin()), e(cont.end());
27 std::cout << *b << " ";
29 std::cout<< std::endl << std::endl;
32 //Function to dump data
33 template<class MyShmCont, class MyStdCont>
34 void PrintContainers(MyShmCont *shmcont, MyStdCont *stdcont)
36 typename MyShmCont::iterator itshm = shmcont->begin(), itshmend = shmcont->end();
37 typename MyStdCont::iterator itstd = stdcont->begin(), itstdend = stdcont->end();
39 std::cout << "MyShmCont" << std::endl;
40 for(; itshm != itshmend; ++itshm){
41 std::cout << *itshm << std::endl;
43 std::cout << "MyStdCont" << std::endl;
45 for(; itstd != itstdend; ++itstd){
46 std::cout << *itstd << std::endl;
51 } //namespace interprocess{
54 #include <boost/interprocess/detail/config_end.hpp>
56 #endif //#ifndef BOOST_INTERPROCESS_TEST_PRINTCONTAINER_HPP