ARTS  2.4.0(git:4fb77825)
m_copy.h
Go to the documentation of this file.
1 /* Copyright (C) 2002-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 
29 #ifndef m_copy_h
30 #define m_copy_h
31 
32 #include "agenda_class.h"
33 #include "messages.h"
34 #include "mystring.h"
35 #include "workspace_ng.h"
36 
37 /* Workspace method: Doxygen documentation will be auto-generated */
38 template <class T>
39 void Copy( // WS Generic Output:
40  T& out,
41  const String& /* out_name */,
42  // WS Generic Input:
43  const T& in,
44  const String& /* in_name */,
45  const Verbosity&) {
46  out = in;
47 }
48 
49 /* Workspace method: Doxygen documentation will be auto-generated */
50 inline void Copy(Workspace& ws,
51  // WS Generic Output:
52  Agenda& out,
53  const String& out_name,
54  // WS Generic Input:
55  const Agenda& in,
56  const String& /* in_name */,
57  const Verbosity& verbosity) {
58  out = in;
59  out.set_name(out_name);
60  out.check(ws, verbosity);
61 }
62 
63 /* Workspace method: Doxygen documentation will be auto-generated */
64 inline void Copy(Workspace& ws,
65  // WS Generic Output:
66  ArrayOfAgenda& out,
67  const String& out_name,
68  // WS Generic Input:
69  const ArrayOfAgenda& in,
70  const String& /* in_name */,
71  const Verbosity& verbosity) {
72  out = in;
73  for (ArrayOfAgenda::iterator it = out.begin(); it != out.end(); it++) {
74  (*it).set_name(out_name);
75  (*it).check(ws, verbosity);
76  }
77 }
78 
79 #endif // m_copy_h
ARTS::Var::verbosity
Verbosity verbosity(Workspace &ws) noexcept
Definition: autoarts.h:7112
Agenda
The Agenda class.
Definition: agenda_class.h:44
Array
This can be used to make arrays out of anything.
Definition: array.h:108
agenda_class.h
Declarations for agendas.
messages.h
Declarations having to do with the four output streams.
my_basic_string< char >
Verbosity
Definition: messages.h:49
Agenda::check
void check(Workspace &ws, const Verbosity &verbosity)
Checks consistency of an agenda.
Definition: agenda_class.cc:80
workspace_ng.h
This file contains the Workspace class.
Workspace
Workspace class.
Definition: workspace_ng.h:40
Agenda::set_name
void set_name(const String &nname)
Set agenda name.
Definition: agenda_class.cc:647
mystring.h
This file contains the definition of String, the ARTS string class.
Copy
void Copy(T &out, const String &, const T &in, const String &, const Verbosity &)
WORKSPACE METHOD: Copy.
Definition: m_copy.h:39