source: branches/plotter2/src/STHistory.h@ 2980

Last change on this file since 2980 was 2820, checked in by Malte Marquarding, 11 years ago

Issue #293: added scantbale.drop_history and added extra parameters to scantable.history to allow selection of rows

File size: 1.6 KB
Line 
1//
2// C++ Interface: STHistory
3//
4// Description:
5//
6//
7// Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2006
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef ASAPSTHISTORY_H
13#define ASAPSTHISTORY_H
14
15#include <casa/aips.h>
16#include <casa/BasicSL/String.h>
17#include <tables/Tables/Table.h>
18#include <tables/Tables/ScalarColumn.h>
19
20#include "STSubTable.h"
21
22namespace asap {
23
24/**
25The History subtable of the Scantable
26
27@author Malte Marquarding
28*/
29class STHistory : public STSubTable {
30public:
31 STHistory() {;}
32 explicit STHistory(casa::Table tab);
33 explicit STHistory( const Scantable& parent );
34
35 virtual ~STHistory();
36
37 STHistory& operator=(const STHistory& other);
38
39 /**
40 * add another row to this table
41 * @param item the histor string
42 * @return an ID (irrelevant)
43 */
44 casa::uInt addEntry( const casa::String& item);
45
46 /**
47 * Just for consistency sake, doesn't do anything
48 * as IDs are irrelevant in this class
49 * @param item a string
50 * @param id an uInt ID
51 */
52 void getEntry( casa::String& item, casa::uInt id);
53
54 /**
55 * add all rows from another STHistory table
56 * @param other a STHistory reference
57 */
58 void append(const STHistory& other);
59
60 /**
61 * Get all rows in the table as a vector
62 * @return a vector of strings
63 */
64 std::vector<std::string> getHistory(int nrow=-1, int start=0 ) const;
65
66 const casa::String& name() const { return name_; }
67
68 int nrow() const { return table_.nrow(); }
69
70
71 void drop();
72
73private:
74 void setup();
75 static const casa::String name_;
76 casa::ScalarColumn<casa::String> itemCol_;
77};
78
79}
80
81#endif
Note: See TracBrowser for help on using the repository browser.