OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
associate.hpp
Go to the documentation of this file.
1//
2// Struct associate
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 ASSOCIATE_HPP_
18#define ASSOCIATE_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 associate {
29 enum class attributes {
30 NAME,
32 PATH,
35 SDDS,
37 };
38
39 template <attributes A>
41 static bool apply() {
42 constexpr std::array<std::pair<attributes, std::string_view>, 7> unsupportedAttributeNames = {{
43 { attributes::NAME, "name" },
44 { attributes::FILENAME, "filename" },
45 { attributes::PATH, "path" },
46 { attributes::DESCRIPTION, "description" },
47 { attributes::CONTENTS, "contents" },
48 { attributes::SDDS, "sdds" },
49 { attributes::ASSOCIATE, "associate" }
50 }};
51
52 for (const auto& item : unsupportedAttributeNames) {
53 if (item.first == A) {
54 std::cerr << item.second << " not supported yet" << std::endl;
55 return false;
56 }
57 }
58
59 return true;
60 }
61 };
62 };
63
64 struct associateList : std::list<associate> {};
65
66 inline std::ostream& operator<<(std::ostream& out, const associate&) {
67 return out;
68 }
69}
70
71#endif /* ASSOCIATE_HPP_ */
std::ostream & operator<<(std::ostream &out, const array &)
Definition array.hpp:72