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
26namespace SDDS {
27 struct array {
40
41 template <attributes A>
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_ */
std::ostream & operator<<(std::ostream &out, const array &)
Definition array.hpp:87
@ DESCRIPTION
Definition array.hpp:32
@ FIELD_LENGTH
Definition array.hpp:36
@ FORMAT_STRING
Definition array.hpp:33