OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
ast.hpp
Go to the documentation of this file.
1//
2// Namespace ast
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 AST_HPP_
18#define AST_HPP_
19
20#include <string>
21#include <variant>
22#include <vector>
23
24namespace SDDS {
25 namespace ast {
27
29
31
32 struct nil {};
33
34 typedef std::variant<float, double, short, long, char, std::string> variant_t;
35
36 typedef std::vector<variant_t> columnData_t;
37
38 inline std::string getDataTypeString(datatype type) {
39 switch (type) {
40 case FLOAT:
41 return "float";
42 case DOUBLE:
43 return "double";
44 case SHORT:
45 return "short";
46 case LONG:
47 return "long";
48 case CHARACTER:
49 return "char";
50 case STRING:
51 return "string";
52 default:
53 return "unknown";
54 }
55 }
56
57 } // namespace ast
58
59 namespace parser {
60 // String parsing is now handled by ValueParser
61 }
62} // namespace SDDS
63
64#endif // AST_HPP_
std::string getDataTypeString(datatype type)
Definition ast.hpp:38
endianess
Definition ast.hpp:30
@ BIGENDIAN
Definition ast.hpp:30
@ LITTLEENDIAN
Definition ast.hpp:30
@ ASCII
Definition ast.hpp:28
@ BINARY
Definition ast.hpp:28
std::vector< variant_t > columnData_t
Definition ast.hpp:36
@ STRING
Definition ast.hpp:26
@ DOUBLE
Definition ast.hpp:26
@ LONG
Definition ast.hpp:26
@ FLOAT
Definition ast.hpp:26
@ CHARACTER
Definition ast.hpp:26
@ SHORT
Definition ast.hpp:26
std::variant< float, double, short, long, char, std::string > variant_t
Definition ast.hpp:34