Interface Documentation
Version: invalid
topology_slot.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 #if !defined(__FLECSI_PRIVATE__)
19 #error Do not include this file directly!
20 #endif
21 
22 #include <optional>
23 
24 namespace flecsi {
25 namespace data {
26 
27 struct convert_tag {}; // must be recognized as a task argument
28 
29 template<typename TOPOLOGY_TYPE>
31  using data_t = typename TOPOLOGY_TYPE::core;
32  using coloring = typename TOPOLOGY_TYPE::coloring;
33 
34  data_t & allocate(const coloring & coloring_reference) {
35  return data.emplace(coloring_reference);
36  } // allocate
37 
38  void deallocate() {
39  // data.reset();
40  } // deallocate
41 
42  data_t & get() {
43  return *data;
44  }
45  const data_t & get() const {
46  return *data;
47  }
48 
49 private:
50  std::optional<data_t> data;
51 }; // struct topology_slot
52 
53 } // namespace data
54 } // namespace flecsi
Definition: topology_slot.hh:27
Definition: topology_slot.hh:30
Definition: control.hh:31