casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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: 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 #ifndef TABLES_TABLEATTR_H
29 #define TABLES_TABLEATTR_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 //# Forward Declarations
39 class Table;
40 
41 
42 // <summary>
43 // Some attributes of a table.
44 // </summary>
45 
46 // <use visibility=local>
47 
48 // <reviewed reviewer="Mark Wieringa" date="1996/04/15" tests="tTableRecord">
49 // </reviewed>
50 
51 // <prerequisite>
52 //# Classes you should understand before using this one.
53 // <li> <linkto class=TableRecord>TableRecord</linkto>
54 // <li> <linkto class=Table>Table</linkto>
55 // </prerequisite>
56 
57 // <synopsis>
58 // This class holds some attributes of a table.
59 // These attributes are name, readable/writable, and lock options.
60 // <br>
61 // The primary use of the class is to be able to pass the various
62 // attributes of the parent table to its subtables (e.g. in classes
63 // like <linkto class=TableRecord>TableRecord</linkto> and
64 // <linkto class=TableKeyword>TableKeyword</linkto>).
65 // </synopsis>
66 
67 // <motivation>
68 // This class makes it possible to have more attributes without
69 // having to alter the classes using subtables.
70 // </motivation>
71 
72 //# <todo asof="$DATE:$">
73 //# A List of bugs, limitations, extensions or planned refinements.
74 //# </todo>
75 
76 
77 class TableAttr
78 {
79 public:
80  // Default constructor results in empty name.
81  TableAttr();
82 
83  // Construct the attributes from the table.
84  explicit TableAttr (const Table& table);
85 
86  // Construct with given values.
87  // <group>
88  explicit TableAttr (const String& name, Bool openWritable = False);
89  TableAttr (const String& name, Bool openWritable, const TableLock&);
90  // </group>
91 
92  // Copy constructor (copy semantics).
93  TableAttr (const TableAttr& that);
94 
95  // Assignment (copy semantics).
96  // <group>
97  TableAttr& operator= (const TableAttr& that);
98  TableAttr& operator= (const Table& table);
99  // </group>
100 
101  ~TableAttr();
102 
103  // Set the object to for another table.
104  void set (const Table& table);
105 
106  // Set the keyword to read/write access.
107  void setRW()
108  { openWritable_p = True; }
109 
110  void setName (const String& name)
111  { name_p = name; }
112 
113  // Get info.
114  // <group>
115  const String& name() const
116  { return name_p; }
118  { return openWritable_p; }
119  const TableLock& lockOptions() const
120  { return lockOptions_p; }
121  // </group>
122 
123 private:
127 };
128 
129 
130 
131 } //# NAMESPACE CASACORE - END
132 
133 #endif
Main interface class to a read/write table.
Definition: Table.h:153
TableAttr()
Default constructor results in empty name.
const TableLock & lockOptions() const
Definition: TableAttr.h:119
Bool openWritable() const
Definition: TableAttr.h:117
void setRW()
Set the keyword to read/write access.
Definition: TableAttr.h:107
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const Bool False
Definition: aipstype.h:44
Class to hold table lock options.
Definition: TableLock.h:65
void set(const Table &table)
Set the object to for another table.
const String & name() const
Get info.
Definition: TableAttr.h:115
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setName(const String &name)
Definition: TableAttr.h:110
TableAttr & operator=(const TableAttr &that)
Assignment (copy semantics).
Some attributes of a table.
Definition: TableAttr.h:77
TableLock lockOptions_p
Definition: TableAttr.h:126
const Bool True
Definition: aipstype.h:43
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42