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
27#ifndef MS_MSHISTORYHANDLER_H
28#define MS_MSHISTORYHANDLER_H
29
30#include <casacore/casa/aips.h>
31#include <casacore/ms/MeasurementSets/MeasurementSet.h>
32#include <casacore/ms/MeasurementSets/MSHistory.h>
33
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37class MSHistoryColumns;
38class LogIO;
39class LogSinkInterface;
40// <summary>
41// A class to provide a simple interface to history writing
42// </summary>
43// <use visibility=local>
44// <etymology>
45// Handle the history info that needs to be archived in ms
46// </etymology>
47// <synopsis>
48// This class provides access to the MS history via single method calls
49// One of the methods is static and can be called on a MeasurementSet without
50// constructing any MSHistoryHandler objects.
51// </synopsis>
52
54{
55
56 public:
57 //Construct the history handler from an ms
59
61 // Destructor
63
64
65
66 //Add a string message
67
68 // This method does not need construction ...can be called explicitly
69 // it flushes the history table of the ms
70 static void addMessage(MeasurementSet& ms, const String& message,
71 const String& app="",
72 const String& cliComm="",
73 const String& origin="");
74
75 // Add message and/or CLI command to the history table. It does not flush the table (the
76 // destructor will flush).
77 void addMessage(const String& message, const String& cliComm="", const String& origin="");
78 // In this version the LogIO object need to have a valid LogSink with
79 // messages in it.
80 void addMessage(LogIO& message, const String& cliComm="");
81 void addMessage(LogSinkInterface& sink, const String& cliComm="");
82
83 void cliCommand(const String& cliComm);
84 void cliCommand(LogIO& cliComm);
86
87 private:
88
89 // Prevent use of default constructor
91
95
96};
97
98
99} //# NAMESPACE CASACORE - END
100
101#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:223
this file contains all the compiler specific defines
Definition mainpage.dox:28