OPALX (Object Oriented Parallel Accelerator Library for Exascal)
master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
data.hpp
Go to the documentation of this file.
1
//
2
// Struct data
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 DATA_HPP_
18
#define DATA_HPP_
19
20
#include "
ast.hpp
"
21
#include "
error_handler.hpp
"
22
#include "
skipper.hpp
"
23
24
namespace
SDDS
{
25
struct
data
{
26
enum
attributes
{
27
MODE
,
28
LINES_PER_ROW
,
29
NO_ROW_COUNT
,
30
FIXED_ROW_COUNT
,
31
ADDITIONAL_HEADER_LINES
,
32
COLUMN_MAJOR_ORDER
,
33
ENDIAN
34
};
35
36
ast::datamode
mode_m
;
37
long
numberRows_m
;
38
39
bool
isASCII
()
const
{
40
if
(
mode_m
==
ast::BINARY
) {
41
std::cerr <<
"can't handle binary data yet"
<< std::endl;
42
return
false
;
43
}
44
return
true
;
45
}
46
47
template
<attributes A>
48
struct
complainUnsupported
{
49
static
bool
apply
() {
50
std::string attributeString;
51
switch
(A) {
52
case
LINES_PER_ROW
:
53
attributeString =
"lines_per_row"
;
54
break
;
55
case
NO_ROW_COUNT
:
56
attributeString =
"no_row_count"
;
57
break
;
58
case
FIXED_ROW_COUNT
:
59
attributeString =
"fixed_row_count"
;
60
break
;
61
case
ADDITIONAL_HEADER_LINES
:
62
attributeString =
"additional_header_lines"
;
63
break
;
64
case
COLUMN_MAJOR_ORDER
:
65
attributeString =
"column_major_order"
;
66
break
;
67
case
ENDIAN
:
68
attributeString =
"endian"
;
69
break
;
70
default
:
71
return
true
;
72
}
73
std::cerr << attributeString <<
" not supported yet"
<< std::endl;
74
return
false
;
75
}
76
};
77
};
78
79
inline
std::ostream&
operator<<
(std::ostream& out,
const
data
& data_) {
80
out <<
"mode = "
<< data_.
mode_m
;
81
return
out;
82
}
83
}
// namespace SDDS
84
85
// Data parsing is now handled by SimpleParser
86
#endif
/* DATA_HPP_ */
ast.hpp
error_handler.hpp
SDDS::ast::datamode
datamode
Definition
ast.hpp:28
SDDS::ast::BINARY
@ BINARY
Definition
ast.hpp:28
SDDS
Definition
SDDSParser.h:40
SDDS::operator<<
std::ostream & operator<<(std::ostream &out, const array &)
Definition
array.hpp:87
skipper.hpp
SDDS::data::complainUnsupported
Definition
data.hpp:48
SDDS::data::complainUnsupported::apply
static bool apply()
Definition
data.hpp:49
SDDS::data
Definition
data.hpp:25
SDDS::data::isASCII
bool isASCII() const
Definition
data.hpp:39
SDDS::data::attributes
attributes
Definition
data.hpp:26
SDDS::data::ENDIAN
@ ENDIAN
Definition
data.hpp:33
SDDS::data::LINES_PER_ROW
@ LINES_PER_ROW
Definition
data.hpp:28
SDDS::data::FIXED_ROW_COUNT
@ FIXED_ROW_COUNT
Definition
data.hpp:30
SDDS::data::COLUMN_MAJOR_ORDER
@ COLUMN_MAJOR_ORDER
Definition
data.hpp:32
SDDS::data::ADDITIONAL_HEADER_LINES
@ ADDITIONAL_HEADER_LINES
Definition
data.hpp:31
SDDS::data::NO_ROW_COUNT
@ NO_ROW_COUNT
Definition
data.hpp:29
SDDS::data::MODE
@ MODE
Definition
data.hpp:27
SDDS::data::numberRows_m
long numberRows_m
Definition
data.hpp:37
SDDS::data::mode_m
ast::datamode mode_m
Definition
data.hpp:36
src
Utilities
SDDSParser
data.hpp
Generated on Mon Jun 1 2026 10:40:53 for OPALX (Object Oriented Parallel Accelerator Library for Exascal) by
1.9.8