OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
description.hpp
Go to the documentation of this file.
1//
2// Struct description
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 DESCRIPTION_HPP_
18#define DESCRIPTION_HPP_
19
20#include <optional>
21#include <ostream>
22#include <string>
23
24namespace SDDS {
25 struct description {
26 std::optional<std::string> text_m;
27 std::optional<std::string> content_m;
28 };
29
30 inline std::ostream& operator<<(std::ostream& out, const description& desc) {
31 if (desc.text_m) out << "text = " << *desc.text_m << ", ";
32 if (desc.content_m) out << "content = " << *desc.content_m;
33 return out;
34 }
35}
36
37#endif /* DESCRIPTION_HPP_ */
std::ostream & operator<<(std::ostream &out, const array &)
Definition array.hpp:72
std::optional< std::string > content_m
std::optional< std::string > text_m