casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PassiveTableDD.h
Go to the documentation of this file.
1 //# PassiveTableDD.h: PassiveCachingDD class with casacore::Table-specific support
2 //# Copyright (C) 2000
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 TRIALDISPLAY_PASSIVETABLEDD_H
29 #define TRIALDISPLAY_PASSIVETABLEDD_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/Vector.h>
33 #include <casa/Containers/Record.h>
36 
37 namespace casacore{
38 
39  class Table;
40  class Regex;
41 }
42 
43 namespace casa { //# NAMESPACE CASA - BEGIN
44 
45 
46 // <summary>
47 // Class adding casacore::Table-specific support functions to PassiveCachingDD.
48 // </summary>
49 
50 // <synopsis>
51 // This class adds support functions useful for dealing with Tables
52 // to the PassiveCachingDD class.
53 // </synopsis>
54 
56 
57  public:
58 
59  // Constructor taking a pointer to an already constructed Table.
60  // The casacore::Table will be deleted by this class.
62 
63  // Constructor taking a casacore::String which describes the full pathname
64  // of a casacore::Table on disk.
65  PassiveTableDD(const casacore::String tablename);
66 
67  // Destructor.
68  virtual ~PassiveTableDD();
69 
70  // Install the default options for this DisplayData.
71  virtual void setDefaultOptions();
72 
73  // Apply options stored in <src>rec</src> to the DisplayData. A
74  // return value of <src>true</src> means a refresh is needed.
75  // <src>recOut</src> contains any fields which were implicitly
76  // changed as a result of the call to this function.
78 
79  // Retrieve the current and default options and parameter types.
80  virtual casacore::Record getOptions( bool scrub=false ) const;
81 
82  // Return the current options of this DisplayData as an
83  // AttributeBuffer.
85 
86  protected:
87 
88  // Get the value of the named keyword, or the first keyword matching
89  // <src>regex</src>, and return it in <src>value</src>. The return
90  // value is <src>true</src> for success, and <src>false</src> for
91  // failure, which is the result if the wrong type <src>T</src> is
92  // requested.
93  // <group>
94  template <class T> casacore::Bool getTableKeyword(T &value,
95  const casacore::String keyword) const;
96  template <class T> casacore::Bool getTableKeyword(T &value, const casacore::Regex &regex) const;
97  // </group>
98 
99  // Get the value of the named keyword, or the first keyword matching
100  // <src>regex</src> for the named column, and return it in
101  // <src>value</src>. The return value is <src>true</src> for
102  // success, and <src>false</src> for failure, which is the result if
103  // the wrong type <src>T</src> is requested, or if the keyword
104  // doesn't exist.
105  // <group>
106  template <class T> casacore::Bool getColumnKeyword(T &value, const casacore::String column,
107  const casacore::String keyword) const;
108  template <class T> casacore::Bool getColumnKeyword(T &value, const casacore::String column,
109  const casacore::Regex &regex) const;
110  // </group>
111 
112  // Get the names of the columns of the table having the given type.
114 
115  // Return the casacore::Table pointer for use by derived classes. If a query
116  // is active (via <src>setOptions</src>), then the result of the
117  // query is returned, otherwise the construction casacore::Table is returned.
119 
120  // (Required) default constructor.
121  PassiveTableDD();
122 
123  // (Required) copy constructor.
124  PassiveTableDD(const PassiveTableDD &other);
125 
126  // (Required) copy assignment.
127  void operator=(const PassiveTableDD &other);
128 
129  private:
130 
131  // Store the primary table here.
133 
134  // Store the result of a query on the table here.
136 
137  // Option: what is the query string, or is it unset?
140 
141  // Install the default options for this DisplayData.
142  void installDefaultOptions();
143 
144  // Arrange the query table (generally called after installing new
145  // options).
147 
148  };
149 
150 
151 } //# NAMESPACE CASA - END
152 
153 #ifndef AIPS_NO_TEMPLATE_SRC
154 #include <display/DisplayDatas/PassiveTableDDTemplates.tcc>
155 #endif
156 
157 #endif
casacore::Bool getColumnKeyword(T &value, const casacore::String column, const casacore::String keyword) const
Get the value of the named keyword, or the first keyword matching regex for the named column...
void installDefaultOptions()
Install the default options for this DisplayData.
casacore::Vector< casacore::String > getColumnNamesOfType(const casacore::DataType type)
Get the names of the columns of the table having the given type.
Main interface class to a read/write table.
Definition: Table.h:153
virtual void setDefaultOptions()
Install the default options for this DisplayData.
Buffer for storing Attributes.
virtual Type type()
Return the type enum.
virtual ~PassiveTableDD()
Destructor.
void operator=(const PassiveTableDD &other)
(Required) copy assignment.
casacore::Table * itsQueryTable
Store the result of a query on the table here.
casacore::Bool getTableKeyword(T &value, const casacore::String keyword) const
Get the value of the named keyword, or the first keyword matching regex, and return it in value...
casacore::Bool itsOptQueryStringUnset
virtual AttributeBuffer optionsAsAttributes()
Return the current options of this DisplayData as an AttributeBuffer.
casacore::Table * itsTable
Store the primary table here.
Regular expression class.
Definition: Regex.h:198
casacore::Table * table()
Return the casacore::Table pointer for use by derived classes.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual casacore::Bool setOptions(casacore::Record &rec, casacore::Record &recOut)
Apply options stored in rec to the DisplayData.
casacore::String itsOptQueryString
Option: what is the query string, or is it unset?
Class providing passive behaviour for CachingDisplayDatas.
TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
Definition: ExprNode.h:1440
Class adding casacore::Table-specific support functions to PassiveCachingDD.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool arrangeQueryTable()
Arrange the query table (generally called after installing new options).
PassiveTableDD()
(Required) default constructor.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual casacore::Record getOptions(bool scrub=false) const
Retrieve the current and default options and parameter types.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42