casacore
Loading...
Searching...
No Matches
MSHistoryHandler.h
Go to the documentation of this file.
1// # MSHistoryHandler: allow simple access to write or read HISTORY subtable
2// # Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This program is free software; you can redistribute it and/or modify
6// # it under the terms of the GNU General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or
8// # (at your option) any later version.
9// #
10// # This program is distributed in the hope that it will be useful,
11// # but WITHOUT ANY WARRANTY; without even the implied warranty of
12// # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// # GNU General Public License for more details.
14// #
15// # You should have received a copy of the GNU General Public License
16// # along with this program; if not, write to the Free Software
17// # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef MS_MSHISTORYHANDLER_H
27#define MS_MSHISTORYHANDLER_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/ms/MeasurementSets/MeasurementSet.h>
31#include <casacore/ms/MeasurementSets/MSHistory.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
36class LogIO;
38// <summary>
39// A class to provide a simple interface to history writing
40// </summary>
41// <use visibility=local>
42// <etymology>
43// Handle the history info that needs to be archived in ms
44// </etymology>
45// <synopsis>
46// This class provides access to the MS history via single method calls
47// One of the methods is static and can be called on a MeasurementSet without
48// constructing any MSHistoryHandler objects.
49// </synopsis>
50
52 public:
53 // Construct the history handler from an ms
54 MSHistoryHandler(MeasurementSet& ms, const String& app = "");
55
57 // Destructor
59
60 // Add a string message
61
62 // This method does not need construction ...can be called explicitly
63 // it flushes the history table of the ms
64 static void addMessage(MeasurementSet& ms, const String& message, const String& app = "",
65 const String& cliComm = "", const String& origin = "");
66
67 // Add message and/or CLI command to the history table. It does not flush the table (the
68 // destructor will flush).
69 void addMessage(const String& message, const String& cliComm = "", const String& origin = "");
70 // In this version the LogIO object need to have a valid LogSink with
71 // messages in it.
72 void addMessage(LogIO& message, const String& cliComm = "");
73 void addMessage(LogSinkInterface& sink, const String& cliComm = "");
74
75 void cliCommand(const String& cliComm);
76 void cliCommand(LogIO& cliComm);
78
79 private:
80 // Prevent use of default constructor
82
86};
87
88} // namespace casacore
89
90#endif
void cliCommand(LogIO &cliComm)
~MSHistoryHandler()
Destructor.
void addMessage(LogIO &message, const String &cliComm="")
In this version the LogIO object need to have a valid LogSink with messages in it.
static void addMessage(MeasurementSet &ms, const String &message, const String &app="", const String &cliComm="", const String &origin="")
Add a string message.
void addMessage(const String &message, const String &cliComm="", const String &origin="")
Add message and/or CLI command to the history table.
void cliCommand(LogSinkInterface &sink)
void addMessage(LogSinkInterface &sink, const String &cliComm="")
MSHistoryHandler()
Prevent use of default constructor.
MSHistoryColumns * msHistCol_p
MSHistoryHandler(MeasurementSet &ms, const String &app="")
Construct the history handler from an ms.
void cliCommand(const String &cliComm)
MSHistoryHandler & operator=(const MSHistoryHandler &other)
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28