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