OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
include.hpp
Go to the documentation of this file.
1//
2// Struct include
3//
4// Copyright (c) 2015, Christof Metzger-Kraus, Helmholtz-Zentrum Berlin
5// All rights reserved
6//
7// This file is part of OPAL.
8//
9// OPAL is free software: you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// You should have received a copy of the GNU General Public License
15// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
16//
17#ifndef INCLUDE_HPP_
18#define INCLUDE_HPP_
19
20#include <array>
21#include <iostream>
22#include <list>
23#include <ostream>
24#include <string_view>
25#include <utility>
26
27namespace SDDS {
28 struct include {
29 enum class attributes {
32 };
33
34 template <attributes A>
36 static bool apply() {
37 constexpr std::array<std::pair<attributes, std::string_view>, 2> unsupportedAttributeNames = {{
38 { attributes::FILENAME, "filename" },
39 { attributes::INCLUDE, "include" }
40 }};
41
42 for (const auto& item : unsupportedAttributeNames) {
43 if (item.first == A) {
44 std::cerr << item.second << " not supported yet" << std::endl;
45 return false;
46 }
47 }
48
49 return true;
50 }
51 };
52 };
53
54 struct includeList : std::list<include> {};
55
56 inline std::ostream& operator<<(std::ostream& out, const include&) {
57 return out;
58 }
59}
60
61#endif /* INCLUDE_HPP_ */
std::ostream & operator<<(std::ostream &out, const array &)
Definition array.hpp:72