casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
35 
36 
37 namespace casacore { //# NAMESPACE CASACORE - BEGIN
38 
39 class MSHistoryColumns;
40 class LogIO;
41 class 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
60  MSHistoryHandler(MeasurementSet& ms, const String &app="");
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);
87  void cliCommand(LogSinkInterface& sink);
88 
89  private:
90 
91  // Prevent use of default constructor
93 
97 
98 };
99 
100 
101 } //# NAMESPACE CASACORE - END
102 
103 #endif
A Table intended to hold a MeasurementSet OBSERVATIONLOG table.
Definition: MSHistory.h:78
MSHistoryHandler()
Prevent use of default constructor.
A class to provide easy read-write access to MSHistory columns.
ostream-like interface to creating log messages.
Definition: LogIO.h:167
MSHistoryColumns * msHistCol_p
~MSHistoryHandler()
Destructor.
Accepts LogMessages and posts them to some destination.
MSHistoryHandler & operator=(const MSHistoryHandler &other)
void cliCommand(const String &cliComm)
virtual Origin origin() const =0
ABSTRACT METHODS //.
A Table intended to hold astronomical data (a set of Measurements).
A class to provide a simple interface to history writing.
static void addMessage(MeasurementSet &ms, const String &message, const String &app="", const String &cliComm="", const String &origin="")
Add a string message.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42