casacore
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>
33 #include <casacore/casa/BasicSL/String.h>
34 #include <casacore/tables/Tables/TableLock.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.
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);
90  // </group>
91 
92  // Copy constructor (copy semantics).
93  TableAttr (const TableAttr& that);
94 
95  // Assignment (copy semantics).
96  // <group>
98  TableAttr& operator= (const Table& table);
99  // </group>
100 
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
String: the storage and methods of handling collections of characters.
Definition: String.h:225
TableLock lockOptions_p
Definition: TableAttr.h:126
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:110
Bool openWritable() const
Definition: TableAttr.h:117
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).
TableAttr & operator=(const TableAttr &that)
Assignment (copy semantics).
const String & name() const
Get info.
Definition: TableAttr.h:115
const TableLock & lockOptions() const
Definition: TableAttr.h:119
void setRW()
Set the keyword to read/write access.
Definition: TableAttr.h:107
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:44
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const Bool True
Definition: aipstype.h:43