TPIE

2362a60
node_map_dump.h
1 // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
2 // vi:set ts=4 sts=4 sw=4 noet :
3 // Copyright 2012, The TPIE development team
4 //
5 // This file is part of TPIE.
6 //
7 // TPIE is free software: you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation, either version 3 of the License, or (at your
10 // option) any later version.
11 //
12 // TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with TPIE. If not, see <http://www.gnu.org/licenses/>
19 
20 #ifndef __TPIE_PIPELINING_NODE_MAP_DUMP_H__
21 #define __TPIE_PIPELINING_NODE_MAP_DUMP_H__
22 
23 #include <tpie/pipelining/tokens.h>
24 #include <tpie/pipelining/node.h>
25 
26 namespace tpie {
27 
28 namespace pipelining {
29 
30 namespace bits {
31 
32 inline void node_map::dump(std::ostream & os) const {
33  os << this << " node_map\n";
34  if (m_authority)
35  os << "Non-authoritative" << std::endl;
36  else
37  os << "Authoritative" << std::endl;
38  for (mapit i = m_tokens.begin(); i != m_tokens.end(); ++i) {
39  os << i->first << " -> " << i->second << std::endl;
40  }
41  for (relmapit i = m_relations.begin(); i != m_relations.end(); ++i) {
42  os << i->first << " -> " << i->second.first << " edge type " << i->second.second << std::endl;
43  }
44 }
45 
46 } // namespace bits
47 
48 } // namespace pipelining
49 
50 } // namespace tpie
51 
52 #endif // __TPIE_PIPELINING_NODE_MAP_DUMP_H__
Pipeline tokens.