casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageHistory.h
Go to the documentation of this file.
1 #ifndef IMAGEANALYSIS_IMAGEHISTORY_H
2 #define IMAGEANALYSIS_IMAGEHISTORY_H
3 
5 
6 #include <casa/namespace.h>
7 
8 namespace casac {
9 
10 class variant;
11 
12 }
13 
14 namespace casa {
15 
16 template <class T> class ImageHistory {
17  // <summary>
18  // Top level interface accessing image history data.
19  // </summary>
20 
21  // <reviewed reviewer="" date="" tests="" demos="">
22  // </reviewed>
23 
24  // <prerequisite>
25  // </prerequisite>
26 
27  // <etymology>
28  // Image History access
29  // </etymology>
30 
31  // <synopsis>
32  // Top level interface for accessing image history.
33  // </synopsis>
34 
35 public:
36 
37  ImageHistory() = delete;
38 
39  ImageHistory(const SPIIT image);
40 
41  // destructor
43 
44  // add a line to the history
45  void addHistory(
46  const casacore::String& origin, const casacore::String& history
47  );
48 
49  void addHistory(
50  const casacore::LogOrigin& origin, const casacore::String& history
51  );
52  // add multiple history lines, all which have the same origin
53  void addHistory(
54  const casacore::String& origin,
55  const std::vector<casacore::String>& history
56  );
57 
58  void addHistory(
60  const std::vector<casacore::String>& history
61  );
62 
63  void addHistory(
64  const casacore::String& origin, const std::vector<string>& history
65  );
66 
67  void addHistory(
68  const std::vector<std::pair<casacore::LogOrigin, casacore::String> >& history
69  );
70 
71  void addHistory(
72  const std::vector<std::pair<casacore::String, casacore::String>>& history
73  );
74 
75  // erase all messages. Cannot be undone!
76  void clear();
77 
78  std::vector<casacore::String> get(casacore::Bool list) const;
79  std::vector<string> getAsStdStrings(casacore::Bool list) const;
80 
81  // return a vector<String> containing a formatted application
82  // summary. Nothing is written to them image that is useful for
83  // history writing.
84  static std::vector<std::pair<casacore::String, casacore::String>>
86  const casacore::LogOrigin& origin, const casacore::String& taskname,
87  const vector<casacore::String>& paramNames,
88  const vector<casac::variant>& paramValues,
89  const casacore::String& imageName
90  );
91 
92  // <group>
93  //Append the specified image's history to this image's history
94  template <class U> void append(SPCIIU image);
95 
96  template <class U> void append(SPIIU image);
97  // </group>
98 
99  casacore::String getClass() const { const static casacore::String s = "ImageHistory"; return s; }
100 
102 
103 private:
104 
105  const SPIIT _image;
106 
107 };
108 }
109 
110 #ifndef AIPS_NO_TEMPLATE_SRC
111 #include <imageanalysis/ImageAnalysis/ImageHistory.tcc>
112 #endif
113 
114 #endif
casacore::String getClass() const
Definition: ImageHistory.h:99
void append(SPCIIU image)
Append the specified image&#39;s history to this image&#39;s history.
static std::vector< std::pair< casacore::String, casacore::String > > getApplicationHistory(const casacore::LogOrigin &origin, const casacore::String &taskname, const vector< casacore::String > &paramNames, const vector< casac::variant > &paramValues, const casacore::String &imageName)
return a vector&lt;String&gt; containing a formatted application summary.
~ImageHistory()
destructor
Definition: ImageHistory.h:42
ostream-like interface to creating log messages.
Definition: LogIO.h:167
#define SPCIIU
Definition: ImageTypedefs.h:38
std::vector< string > getAsStdStrings(casacore::Bool list) const
#define SPIIT
Definition: ImageTypedefs.h:34
casacore::LogIO & getLogSink()
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual Origin origin() const =0
ABSTRACT METHODS //.
LogOrigin: The source code location of the originator of a LogMessage.
Definition: LogOrigin.h:94
void clear()
erase all messages.
void addHistory(const casacore::String &origin, const casacore::String &history)
add a line to the history
ImageHistory()=delete
Top level interface accessing image history data.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
const SPIIT _image
Definition: ImageHistory.h:105
#define SPIIU
Definition: ImageTypedefs.h:37