ARTS 2.5.11 (git: 6827797f)
wsv_aux.h
Go to the documentation of this file.
1
11#ifndef wsv_aux_h
12#define wsv_aux_h
13
14#include <tokval.h>
15
16#include "array.h"
17#include "arts.h"
18#include "exceptions.h"
19
22
24bool is_agenda_group_id(const Index group_id);
25
27Index get_wsv_group_id(const String& name);
28
30String get_array_groups_as_string(bool basetype_is_group = false,
31 bool return_basetype_only = false);
32
41class WsvRecord {
42 public:
44 WsvRecord();
45
50 WsvRecord(const char* name,
51 const char* description,
52 const String& group,
53 const TokVal& val);
54
58 WsvRecord(const char* name,
59 const char* description,
60 const Index group,
61 const TokVal& val);
62
67 WsvRecord(const char* name, const char* description, const String& group);
68
72 WsvRecord(const char* name, const char* description, const Index group);
73
75 [[nodiscard]] const String& Name() const { return mname; }
76
78 [[nodiscard]] const String& Description() const { return mdescription; }
79
81 [[nodiscard]] Index Group() const { return mgroup; }
82
83 [[nodiscard]] bool has_defaults() const;
84
85 [[nodiscard]] std::shared_ptr<void> get_copy() const;
86
87 [[nodiscard]] const TokVal& default_value() const { return defval; }
88 void update_default_value(ArtsType auto&& v) {defval=std::forward<decltype(v)>(v);}
89
90 private:
92
94
95 Index mgroup{-1};
96
98};
99
100#endif // wsv_aux_h
This file contains the definition of Array.
The global header file for ARTS.
Definition: tokval.h:244
This class contains all static information for one workspace variable.
Definition: wsv_aux.h:41
String mname
Definition: wsv_aux.h:91
void update_default_value(ArtsType auto &&v)
Definition: wsv_aux.h:88
bool has_defaults() const
Definition: wsv_aux.cc:69
String mdescription
Definition: wsv_aux.h:93
const String & Name() const
Name of this workspace variable.
Definition: wsv_aux.h:75
WsvRecord()
Default constructor.
Definition: wsv_aux.cc:12
const TokVal & default_value() const
Definition: wsv_aux.h:87
const String & Description() const
A text describing this workspace variable.
Definition: wsv_aux.h:78
Index Group() const
The wsv group to which this variable belongs.
Definition: wsv_aux.h:81
Index mgroup
Definition: wsv_aux.h:95
TokVal defval
Definition: wsv_aux.h:97
std::shared_ptr< void > get_copy() const
Definition: wsv_aux.cc:73
The declarations of all the exception classes.
#define v
Index get_wsv_group_id(const String &name)
Returns the id of the given group.
Definition: groups.cc:346
bool is_agenda_group_id(const Index group_id)
Check if group is an agenda group.
Definition: groups.cc:385
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:390
void get_wsv_group_ids(ArrayOfIndex &ids, String name)
Returns list of ids of the given group names.
Definition: groups.cc:353