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
40// <summary>
41// Some attributes of a table.
42// </summary>
43
44// <use visibility=local>
45
46// <reviewed reviewer="Mark Wieringa" date="1996/04/15" tests="tTableRecord">
47// </reviewed>
48
49// <prerequisite>
50//# Classes you should understand before using this one.
51// <li> <linkto class=TableRecord>TableRecord</linkto>
52// <li> <linkto class=Table>Table</linkto>
53// </prerequisite>
54
55// <synopsis>
56// This class holds some attributes of a table.
57// These attributes are name, readable/writable, and lock options.
58// <br>
59// The primary use of the class is to be able to pass the various
60// attributes of the parent table to its subtables (e.g. in classes
61// like <linkto class=TableRecord>TableRecord</linkto> and
62// <linkto class=TableKeyword>TableKeyword</linkto>).
63// </synopsis>
64
65// <motivation>
66// This class makes it possible to have more attributes without
67// having to alter the classes using subtables.
68// </motivation>
69
70//# <todo asof="$DATE:$">
71//# A List of bugs, limitations, extensions or planned refinements.
72//# </todo>
73
74
76{
77public:
78 // Default constructor results in empty name.
80
81 // Construct the attributes from the table.
82 explicit TableAttr (const Table& table);
83
84 // Construct with given values.
85 // <group>
88 // </group>
89
90 // Copy constructor (copy semantics).
91 TableAttr (const TableAttr& that);
92
93 // Assignment (copy semantics).
94 // <group>
96 TableAttr& operator= (const Table& table);
97 // </group>
98
100
101 // Set the object to for another table.
102 void set (const Table& table);
103
104 // Set the keyword to read/write access.
105 void setRW()
106 { openWritable_p = True; }
107
108 void setName (const String& name)
109 { name_p = name; }
110
111 // Get info.
112 // <group>
113 const String& name() const
114 { return name_p; }
116 { return openWritable_p; }
117 const TableLock& lockOptions() const
118 { return lockOptions_p; }
119 // </group>
120
121private:
125};
126
127
128
129} //# NAMESPACE CASACORE - END
130
131#endif
String: the storage and methods of handling collections of characters.
Definition String.h:223
TableLock lockOptions_p
Definition TableAttr.h:124
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:108
TableAttr & operator=(const TableAttr &that)
Assignment (copy semantics).
Bool openWritable() const
Definition TableAttr.h:115
const String & name() const
Get info.
Definition TableAttr.h:113
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:117
void setRW()
Set the keyword to read/write access.
Definition TableAttr.h:105
TableAttr(const String &name, Bool openWritable, const TableLock &)
this file contains all the compiler specific defines
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