Interface Documentation
Version: 2.-1 (devel)
node.hh
Go to the documentation of this file.
1 /*
2  @@@@@@@@ @@ @@@@@@ @@@@@@@@ @@
3  /@@///// /@@ @@////@@ @@////// /@@
4  /@@ /@@ @@@@@ @@ // /@@ /@@
5  /@@@@@@@ /@@ @@///@@/@@ /@@@@@@@@@/@@
6  /@@//// /@@/@@@@@@@/@@ ////////@@/@@
7  /@@ /@@/@@//// //@@ @@ /@@/@@
8  /@@ @@@//@@@@@@ //@@@@@@ @@@@@@@@ /@@
9  // /// ////// ////// //////// //
10 
11  Copyright (c) 2016, Triad National Security, LLC
12  All rights reserved.
13  */
14 #pragma once
15 
18 #include <bitset>
19 
20 namespace flecsi {
21 namespace utils {
22 namespace ftest {
23 
24 struct node_t {
25 
26  using bitset_t = std::bitset<8>;
27  using action_t = std::function<int(int, char **)>;
28 
29  node_t(action_t const & action = {}, bitset_t const & bitset = {})
30  : action_(action), bitset_(bitset) {}
31 
32  bool initialize(node_t const & node) {
33  action_ = node.action_;
34  bitset_ = node.bitset_;
35  return true;
36  } // initialize
37 
38  action_t const & action() const {
39  return action_;
40  }
41 
42  action_t & action() {
43  return action_;
44  }
45 
46  bitset_t const & bitset() const {
47  return bitset_;
48  }
49 
50  bitset_t & bitset() {
51  return bitset_;
52  }
53 
54 private:
55  action_t action_ = {};
56  bitset_t bitset_ = 0;
57 
58 }; // struct node_t
59 
60 inline std::ostream &
61 operator<<(std::ostream & stream, node_t const & node) {
62  stream << "bitset: " << node.bitset() << std::endl;
63  stream << "action: " << &node.action() << std::endl;
64  return stream;
65 } // operator <<
66 
67 } // namespace ftest
68 } // namespace utils
69 } // namespace flecsi
std::ostream & operator<<(std::ostream &ostr, const filling_curve< D, T, DER > &k)
output for filling_curve using output_ function defined in the class
Definition: filling_curve.hh:206
Definition: node.hh:24
Definition: default_node.hh:20