OPALX (Object Oriented Parallel Accelerator Library for Exascal)
master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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 "
ast.hpp
"
21
#include "
error_handler.hpp
"
22
#include "
skipper.hpp
"
23
24
#include <list>
25
26
namespace
SDDS
{
27
struct
array
{
28
enum
attributes
{
29
NAME
,
30
SYMBOL
,
31
UNITS
,
32
DESCRIPTION
,
33
FORMAT_STRING
,
34
GROUP_NAME
,
35
TYPE
,
36
FIELD_LENGTH
,
37
DIMENSIONS
,
38
ARRAY
39
};
40
41
template
<attributes A>
42
struct
complainUnsupported
{
43
static
bool
apply
() {
44
std::string attributeString;
45
switch
(A) {
46
case
NAME
:
47
attributeString =
"name"
;
48
break
;
49
case
SYMBOL
:
50
attributeString =
"symbol"
;
51
break
;
52
case
UNITS
:
53
attributeString =
"units"
;
54
break
;
55
case
DESCRIPTION
:
56
attributeString =
"description"
;
57
break
;
58
case
FORMAT_STRING
:
59
attributeString =
"format_string"
;
60
break
;
61
case
GROUP_NAME
:
62
attributeString =
"group_name"
;
63
break
;
64
case
TYPE
:
65
attributeString =
"type"
;
66
break
;
67
case
FIELD_LENGTH
:
68
attributeString =
"field_length"
;
69
break
;
70
case
DIMENSIONS
:
71
attributeString =
"dimensions"
;
72
break
;
73
case
ARRAY
:
74
attributeString =
"array"
;
75
break
;
76
default
:
77
return
true
;
78
}
79
std::cerr << attributeString <<
" not supported yet"
<< std::endl;
80
return
false
;
81
}
82
};
83
};
84
85
struct
arrayList
: std::list<array> {};
86
87
inline
std::ostream&
operator<<
(std::ostream& out,
const
array
&) {
return
out; }
88
}
// namespace SDDS
89
90
// Array parsing is now handled by SimpleParser
91
#endif
/* ARRAY_HPP_ */
ast.hpp
error_handler.hpp
SDDS
Definition
SDDSParser.h:40
SDDS::operator<<
std::ostream & operator<<(std::ostream &out, const array &)
Definition
array.hpp:87
skipper.hpp
SDDS::arrayList
Definition
array.hpp:85
SDDS::array::complainUnsupported
Definition
array.hpp:42
SDDS::array::complainUnsupported::apply
static bool apply()
Definition
array.hpp:43
SDDS::array
Definition
array.hpp:27
SDDS::array::attributes
attributes
Definition
array.hpp:28
SDDS::array::ARRAY
@ ARRAY
Definition
array.hpp:38
SDDS::array::UNITS
@ UNITS
Definition
array.hpp:31
SDDS::array::DESCRIPTION
@ DESCRIPTION
Definition
array.hpp:32
SDDS::array::DIMENSIONS
@ DIMENSIONS
Definition
array.hpp:37
SDDS::array::TYPE
@ TYPE
Definition
array.hpp:35
SDDS::array::FIELD_LENGTH
@ FIELD_LENGTH
Definition
array.hpp:36
SDDS::array::NAME
@ NAME
Definition
array.hpp:29
SDDS::array::GROUP_NAME
@ GROUP_NAME
Definition
array.hpp:34
SDDS::array::SYMBOL
@ SYMBOL
Definition
array.hpp:30
SDDS::array::FORMAT_STRING
@ FORMAT_STRING
Definition
array.hpp:33
src
Utilities
SDDSParser
array.hpp
Generated on Mon Jun 1 2026 10:40:53 for OPALX (Object Oriented Parallel Accelerator Library for Exascal) by
1.9.8