casacore
Loading...
Searching...
No Matches
TaQLNodeResult.h
Go to the documentation of this file.
1//# TaQLNodeResult.h: Classes holding the result of a node tree visit
2//# Copyright (C) 2005
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_TAQLNODERESULT_H
27#define TABLES_TAQLNODERESULT_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <memory>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35// <summary>
36// Abstract base class to hold the result of a visit to the node tree.
37// </summary>
38
39// <use visibility=local>
40
41// <reviewed reviewer="" date="" tests="tTableGram">
42// </reviewed>
43
44// <prerequisite>
45//# Classes you should understand before using this one.
46// <li> <linkto class=TaQLNodeVisitor>TaQLNodeVisitor</linkto>
47// <li> Note 199 describing
48// <a href="../notes/199.html">
49// TaQL</a>
50// </prerequisite>
51
52// <synopsis>
53// TaQLNodeResultRep is the abstract base class for classes holding
54// values filled by visitors to the raw TaQL parse tree. Visitors are
55// classes derived from <linkto class=TaQLNodeVisitor>TaQLNodeVisitor</linkto>
56// which traverse the parse tree.
57// TaQLNodeResultRep is the counted referenced letter class in the envelope
58// class <linkto class=TaQLNodeResult>TaQLNodeResult</linkto>.
59// </synopsis>
60
62{
63public:
64 // Default constructor.
67
68 // Destructor.
69 virtual ~TaQLNodeResultRep() = default;
70
71 // Letter objects cannot be copied.
72 // <group>
75 // </group>
76};
77
78
79// <summary>
80// Envelope class to hold the result of a visit to the node tree.
81// </summary>
82
83// <use visibility=local>
84
85// <reviewed reviewer="" date="" tests="tTableGram">
86// </reviewed>
87
88// <prerequisite>
89//# Classes you should understand before using this one.
90// <li> <linkto class=TaQLNodeVisitor>TaQLNodeVisitor</linkto>
91// <li> Note 199 describing
92// <a href="../notes/199.html">
93// TaQL</a>
94// </prerequisite>
95
96// <synopsis>
97// TaQLNodeResult is the envelope class for classes holding
98// values filled by visitors to the raw TaQL parse tree. Visitors are
99// classes derived from <linkto class=TaQLNodeVisitor>TaQLNodeVisitor</linkto>
100// which traverse the parse tree.
101// The counted referenced letter base class for the envelope is
102// class <linkto class=TaQLNodeResultRep>TaQLNodeResultRep</linkto>.
103// </synopsis>
105{
106public:
107 // Default constructor has no letter.
110
111 // Wrap the given pointer in a shared_ptr.
113 : itsRep (rep)
114 {}
115
116 // Does the envelope hold a letter?
117 Bool isValid() const
118 { return itsRep.get(); }
119
120 // Get the actual underlying object.
122 { return *(itsRep.get()); }
123
124private:
125 std::shared_ptr<TaQLNodeResultRep> itsRep;
126};
127
128} //# NAMESPACE CASACORE - END
129
130#endif
TaQLNodeResultRep(const TaQLNodeResultRep &)=delete
Letter objects cannot be copied.
virtual ~TaQLNodeResultRep()=default
Destructor.
TaQLNodeResultRep & operator=(const TaQLNodeResultRep &)=delete
TaQLNodeResultRep()
Default constructor.
Envelope class to hold the result of a visit to the node tree.
const TaQLNodeResultRep & getRep() const
Get the actual underlying object.
std::shared_ptr< TaQLNodeResultRep > itsRep
TaQLNodeResult(TaQLNodeResultRep *rep)
Wrap the given pointer in a shared_ptr.
Bool isValid() const
Does the envelope hold a letter?
TaQLNodeResult()
Default constructor has no letter.
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40