OPAL (Object Oriented Parallel Accelerator Library)
2024.2
OPAL
optimizer
Util
SDDSParser
array.hpp
Go to the documentation of this file.
1
//
2
// Struct array
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 ARRAY_HPP_
18
#define ARRAY_HPP_
19
20
#include <array>
21
#include <iostream>
22
#include <list>
23
#include <ostream>
24
#include <string_view>
25
#include <utility>
26
27
namespace
SDDS
{
28
struct
array
{
29
enum class
attributes
{
30
NAME
,
31
SYMBOL
,
32
UNITS
,
33
DESCRIPTION
,
34
FORMAT_STRING
,
35
GROUP_NAME
,
36
TYPE
,
37
FIELD_LENGTH
,
38
DIMENSIONS
,
39
ARRAY
40
};
41
42
template
<attributes A>
43
struct
complainUnsupported
{
44
static
bool
apply
() {
45
constexpr
std::array<std::pair<attributes, std::string_view>, 10> unsupportedAttributeNames = {{
46
{
attributes::NAME
,
"name"
},
47
{
attributes::SYMBOL
,
"symbol"
},
48
{
attributes::UNITS
,
"units"
},
49
{
attributes::DESCRIPTION
,
"description"
},
50
{
attributes::FORMAT_STRING
,
"format_string"
},
51
{
attributes::GROUP_NAME
,
"group_name"
},
52
{
attributes::TYPE
,
"type"
},
53
{
attributes::FIELD_LENGTH
,
"field_length"
},
54
{
attributes::DIMENSIONS
,
"dimensions"
},
55
{
attributes::ARRAY
,
"array"
}
56
}};
57
58
for
(
const
auto
& item : unsupportedAttributeNames) {
59
if
(item.first == A) {
60
std::cerr << item.second <<
" not supported yet"
<< std::endl;
61
return
false
;
62
}
63
}
64
65
return
true
;
66
}
67
};
68
};
69
70
struct
arrayList
: std::list<array> {};
71
72
inline
std::ostream&
operator<<
(std::ostream& out,
const
array
&) {
73
return
out;
74
}
75
}
76
77
#endif
/* ARRAY_HPP_ */
SDDS
Definition
SDDSParser.h:33
SDDS::operator<<
std::ostream & operator<<(std::ostream &out, const array &)
Definition
array.hpp:72
SDDS::array
Definition
array.hpp:28
SDDS::array::attributes
attributes
Definition
array.hpp:29
SDDS::array::attributes::GROUP_NAME
@ GROUP_NAME
SDDS::array::attributes::FIELD_LENGTH
@ FIELD_LENGTH
SDDS::array::attributes::DESCRIPTION
@ DESCRIPTION
SDDS::array::attributes::UNITS
@ UNITS
SDDS::array::attributes::SYMBOL
@ SYMBOL
SDDS::array::attributes::TYPE
@ TYPE
SDDS::array::attributes::NAME
@ NAME
SDDS::array::attributes::DIMENSIONS
@ DIMENSIONS
SDDS::array::attributes::ARRAY
@ ARRAY
SDDS::array::attributes::FORMAT_STRING
@ FORMAT_STRING
SDDS::array::complainUnsupported
Definition
array.hpp:43
SDDS::array::complainUnsupported::apply
static bool apply()
Definition
array.hpp:44
SDDS::arrayList
Definition
array.hpp:70
Generated on Wed Sep 30 2026 07:14:50 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.8