casacore
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 
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 // A couple of the simple methods are independent and can be called without
52 // constructing.
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  //
72  static void addMessage(MeasurementSet& ms, String message,
73  String app="",
74  String cliComm="",
75  String origin="");
76 
77  // Add message and/or CLI command to the history table
78  void addMessage(String message, String cliComm="", String origin="");
79  // In this version the LogIO object need to have a valid LogSink with
80  // messages in it.
81  void addMessage(LogIO& message, String cliComm="");
82  void addMessage(LogSinkInterface& sink, String cliComm="");
83 
84  void cliCommand(String& cliComm);
85  void cliCommand(LogIO& cliComm);
86  void cliCommand(LogSinkInterface& sink);
87 
88  private:
89 
90  // Prevent use of default constructor
92 
96 
97 };
98 
99 
100 } //# NAMESPACE CASACORE - END
101 
102 #endif
A Table intended to hold a MeasurementSet OBSERVATIONLOG table.
Definition: MSHistory.h:78
MSHistoryHandler()
Prevent use of default constructor.
MSHistoryHandler & operator=(MSHistoryHandler &other)
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.
A Table intended to hold astronomical data (a set of Measurements).
A class to provide a simple interface to history writing.
void cliCommand(String &cliComm)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
static void addMessage(MeasurementSet &ms, String message, String app="", String cliComm="", String origin="")
Add a string message.
this file contains all the compiler specific defines
Definition: mainpage.dox:28