00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00028 #ifndef wsv_aux_h
00029 #define wsv_aux_h
00030
00031 #include "arts.h"
00032 #include "array.h"
00033 #include "exceptions.h"
00034
00035
00036 void get_wsv_group_ids(ArrayOfIndex& ids, String name);
00037 Index get_wsv_group_id(const String& name);
00038 String get_array_groups_as_string();
00039
00040
00049 class WsvRecord {
00050 public:
00051
00053 WsvRecord() : mname(),
00054 mdescription(),
00055 mgroup(-1),
00056 mimplicit(false)
00057 { }
00058
00063 WsvRecord(const char name[],
00064 const char description[],
00065 const String group,
00066 const bool implicit = false)
00067 : mname(name),
00068 mdescription(description),
00069 mgroup(-1),
00070 mimplicit(implicit)
00071 {
00072
00073 mgroup = get_wsv_group_id(group);
00074 if (mgroup == -1)
00075 {
00076 ostringstream os;
00077
00078 os << "Unknown WSV Group " << group << " WSV " << mname;
00079 throw runtime_error( os.str() );
00080 }
00081 }
00082
00086 WsvRecord(const char name[],
00087 const char description[],
00088 const Index group,
00089 const bool implicit = false)
00090 : mname(name),
00091 mdescription(description),
00092 mgroup(group),
00093 mimplicit(implicit)
00094 {
00095
00096 }
00098 const String& Name() const { return mname; }
00100 const String& Description() const { return mdescription; }
00102 Index Group() const { return mgroup; }
00104 bool Implicit() const { return mimplicit; }
00105 private:
00106 String mname;
00107 String mdescription;
00108 Index mgroup;
00109 bool mimplicit;
00110 };
00111
00114 ostream& operator<<(ostream& os, const WsvRecord& wr);
00115
00116
00118
00125 template <typename OutputStream, typename Container> void
00126 PrintWsvNames (OutputStream& outstream, const Container& container)
00127 {
00128 for (typename Container::const_iterator it = container.begin ();
00129 it != container.end (); it++ )
00130 {
00131 PrintWsvName (outstream, *it);
00132 }
00133
00134 }
00135
00136 #endif // wsv_aux_h