[860] | 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 |
|
---|
| 22 | namespace asap {
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | The History subtable of the Scantable
|
---|
| 26 |
|
---|
| 27 | @author Malte Marquarding
|
---|
| 28 | */
|
---|
| 29 | class STHistory : public STSubTable {
|
---|
| 30 | public:
|
---|
| 31 | STHistory() {;}
|
---|
[3106] | 32 | explicit STHistory(casacore::Table tab);
|
---|
[1353] | 33 | explicit STHistory( const Scantable& parent );
|
---|
[860] | 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 | */
|
---|
[3106] | 44 | casacore::uInt addEntry( const casacore::String& item);
|
---|
[860] | 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 | */
|
---|
[3106] | 52 | void getEntry( casacore::String& item, casacore::uInt id);
|
---|
[860] | 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 | */
|
---|
[2820] | 64 | std::vector<std::string> getHistory(int nrow=-1, int start=0 ) const;
|
---|
[860] | 65 |
|
---|
[3106] | 66 | const casacore::String& name() const { return name_; }
|
---|
[860] | 67 |
|
---|
[2820] | 68 | int nrow() const { return table_.nrow(); }
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | void drop();
|
---|
| 72 |
|
---|
[860] | 73 | private:
|
---|
| 74 | void setup();
|
---|
[3106] | 75 | static const casacore::String name_;
|
---|
| 76 | casacore::ScalarColumn<casacore::String> itemCol_;
|
---|
[860] | 77 | };
|
---|
| 78 |
|
---|
| 79 | }
|
---|
| 80 |
|
---|
| 81 | #endif
|
---|