casacore
Loading...
Searching...
No Matches
TableAttr.h
Go to the documentation of this file.
1// # TableAttr.h: Some attributes of a table
2// # Copyright (C) 2001
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@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#ifndef TABLES_TABLEATTR_H
27#define TABLES_TABLEATTR_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/BasicSL/String.h>
32#include <casacore/tables/Tables/TableLock.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// # Forward Declarations
37class Table;
38
39// <summary>
40// Some attributes of a table.
41// </summary>
42
43// <use visibility=local>
44
45// <reviewed reviewer="Mark Wieringa" date="1996/04/15" tests="tTableRecord">
46// </reviewed>
47
48// <prerequisite>
49// # Classes you should understand before using this one.
50// <li> <linkto class=TableRecord>TableRecord</linkto>
51// <li> <linkto class=Table>Table</linkto>
52// </prerequisite>
53
54// <synopsis>
55// This class holds some attributes of a table.
56// These attributes are name, readable/writable, and lock options.
57// <br>
58// The primary use of the class is to be able to pass the various
59// attributes of the parent table to its subtables (e.g. in classes
60// like <linkto class=TableRecord>TableRecord</linkto> and
61// <linkto class=TableKeyword>TableKeyword</linkto>).
62// </synopsis>
63
64// <motivation>
65// This class makes it possible to have more attributes without
66// having to alter the classes using subtables.
67// </motivation>
68
69// # <todo asof="$DATE:$">
70// # A List of bugs, limitations, extensions or planned refinements.
71// # </todo>
72
73class TableAttr {
74 public:
75 // Default constructor results in empty name.
77
78 // Construct the attributes from the table.
79 explicit TableAttr(const Table& table);
80
81 // Construct with given values.
82 // <group>
85 // </group>
86
87 // Copy constructor (copy semantics).
88 TableAttr(const TableAttr& that);
89
90 // Assignment (copy semantics).
91 // <group>
93 TableAttr& operator=(const Table& table);
94 // </group>
95
97
98 // Set the object to for another table.
99 void set(const Table& table);
100
101 // Set the keyword to read/write access.
103
104 void setName(const String& name) { name_p = name; }
105
106 // Get info.
107 // <group>
108 const String& name() const { return name_p; }
109 Bool openWritable() const { return openWritable_p; }
110 const TableLock& lockOptions() const { return lockOptions_p; }
111 // </group>
112
113 private:
117};
118
119} // namespace casacore
120
121#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
TableLock lockOptions_p
Definition TableAttr.h:116
void set(const Table &table)
Set the object to for another table.
TableAttr(const String &name, Bool openWritable=False)
Construct with given values.
void setName(const String &name)
Definition TableAttr.h:104
TableAttr & operator=(const TableAttr &that)
Assignment (copy semantics).
Bool openWritable() const
Definition TableAttr.h:109
const String & name() const
Get info.
Definition TableAttr.h:108
TableAttr()
Default constructor results in empty name.
TableAttr(const Table &table)
Construct the attributes from the table.
TableAttr(const TableAttr &that)
Copy constructor (copy semantics).
const TableLock & lockOptions() const
Definition TableAttr.h:110
TableAttr & operator=(const Table &table)
void setRW()
Set the keyword to read/write access.
Definition TableAttr.h:102
TableAttr(const String &name, Bool openWritable, const TableLock &)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41