OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
version.hpp
Go to the documentation of this file.
1//
2// Struct version
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 VERSION_HPP_
18#define VERSION_HPP_
19
20#include "ast.hpp"
21#include "skipper.hpp"
22#include "error_handler.hpp"
23
24#include <boost/config/warning_disable.hpp>
25#include <boost/spirit/include/qi.hpp>
26#include <boost/fusion/include/adapt_struct.hpp>
27
28#define BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
29#define BOOST_SPIRIT_QI_DEBUG
30
31namespace SDDS {
32 struct version
33 {
35 };
36
37 inline std::ostream& operator<<(std::ostream& out, const version& head) {
38 out << "layout version is " << head.layoutVersion_m;
39 return out;
40 }
41}
42
45 (short, layoutVersion_m)
46)
47
48namespace SDDS { namespace parser
49{
50 namespace qi = boost::spirit::qi;
51 namespace ascii = boost::spirit::ascii;
52 namespace phx = boost::phoenix;
53
54 template <typename Iterator>
55 struct version_parser: qi::grammar<Iterator, version(), skipper<Iterator> >
56 {
57 version_parser(error_handler<Iterator> & _error_handler);
58
59 qi::rule<Iterator, version(), skipper<Iterator> > start;
60 };
61}}
62#endif /* VERSION_HPP_ */
BOOST_FUSION_ADAPT_STRUCT(SDDS::version,(short, layoutVersion_m)) namespace SDDS
Definition: version.hpp:43
int version
opal version of input file
Definition: Options.cpp:97
std::ostream & operator<<(std::ostream &out, const array &)
Definition: array.hpp:97
short layoutVersion_m
Definition: version.hpp:34