ARTS 2.5.9 (git: 825fa5f2)
wsv_aux.h
Go to the documentation of this file.
1/* Copyright (C) 2000-2012 Stefan Buehler <sbuehler@ltu.se>
2
3 This program is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
6 later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 USA. */
17
28#ifndef wsv_aux_h
29#define wsv_aux_h
30
31#include <tokval.h>
32
33#include "array.h"
34#include "arts.h"
35#include "exceptions.h"
36
39
41bool is_agenda_group_id(const Index group_id);
42
44Index get_wsv_group_id(const String& name);
45
47String get_array_groups_as_string(bool basetype_is_group = false,
48 bool return_basetype_only = false);
49
58class WsvRecord {
59 public:
61 WsvRecord();
62
67 WsvRecord(const char* name,
68 const char* description,
69 const String& group,
70 const TokVal& val);
71
75 WsvRecord(const char* name,
76 const char* description,
77 const Index group,
78 const TokVal& val);
79
84 WsvRecord(const char* name, const char* description, const String& group);
85
89 WsvRecord(const char* name, const char* description, const Index group);
90
92 [[nodiscard]] const String& Name() const { return mname; }
93
95 [[nodiscard]] const String& Description() const { return mdescription; }
96
98 [[nodiscard]] Index Group() const { return mgroup; }
99
100 [[nodiscard]] bool has_defaults() const;
101
102 [[nodiscard]] std::shared_ptr<void> get_copy() const;
103
104 [[nodiscard]] const TokVal& default_value() const { return defval; }
105 void update_default_value(ArtsType auto&& v) {defval=std::forward<decltype(v)>(v);}
106
107 private:
109
111
113
115};
116
117#endif // wsv_aux_h
This file contains the definition of Array.
The global header file for ARTS.
Definition: tokval.h:245
This class contains all static information for one workspace variable.
Definition: wsv_aux.h:58
String mname
Definition: wsv_aux.h:108
void update_default_value(ArtsType auto &&v)
Definition: wsv_aux.h:105
bool has_defaults() const
Definition: wsv_aux.cc:86
String mdescription
Definition: wsv_aux.h:110
const String & Name() const
Name of this workspace variable.
Definition: wsv_aux.h:92
WsvRecord()
Default constructor.
Definition: wsv_aux.cc:29
const TokVal & default_value() const
Definition: wsv_aux.h:104
const String & Description() const
A text describing this workspace variable.
Definition: wsv_aux.h:95
Index Group() const
The wsv group to which this variable belongs.
Definition: wsv_aux.h:98
Index mgroup
Definition: wsv_aux.h:112
TokVal defval
Definition: wsv_aux.h:114
std::shared_ptr< void > get_copy() const
Definition: wsv_aux.cc:90
The declarations of all the exception classes.
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
#define v
Index get_wsv_group_id(const String &name)
Returns the id of the given group.
Definition: groups.cc:360
bool is_agenda_group_id(const Index group_id)
Check if group is an agenda group.
Definition: groups.cc:399
String get_array_groups_as_string(bool basetype_is_group=false, bool return_basetype_only=false)
Return string list of array types.
Definition: groups.cc:404
void get_wsv_group_ids(ArrayOfIndex &ids, String name)
Returns list of ids of the given group names.
Definition: groups.cc:367