bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESContainer.h
1// BESContainer.h
2
3// This file is part of bes, A C++ back-end server implementation framework
4// for the OPeNDAP Data Access Protocol.
5
6// Copyright (c) 2004-2009 University Corporation for Atmospheric Research
7// Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
8//
9// This library is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Lesser General Public
11// License as published by the Free Software Foundation; either
12// version 2.1 of the License, or (at your option) any later version.
13//
14// This library is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// Lesser General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22//
23// You can contact University Corporation for Atmospheric Research at
24// 3080 Center Green Drive, Boulder, CO 80301
25
26// (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27// Please read the full copyright statement in the file COPYRIGHT_UCAR.
28//
29// Authors:
30// pwest Patrick West <pwest@ucar.edu>
31// jgarcia Jose Garcia <jgarcia@ucar.edu>
32
33#ifndef BESContainer_h_
34#define BESContainer_h_ 1
35
36#include <list>
37#include <string>
38#include <utility>
39
40#include "BESObj.h"
41
66class BESContainer: public BESObj {
67
68 std::string d_symbolic_name;
69 std::string d_real_name;
70 std::string d_relative_name;
71 std::string d_container_type;
72
73 std::string d_constraint;
74 std::string d_dap4_constraint;
75 std::string d_dap4_function;
76
77 std::string d_attributes;
78
79protected:
80 BESContainer() = default;
81
93 BESContainer(std::string sym_name, std::string real_name, std::string type) :
94 d_symbolic_name(std::move(sym_name)), d_real_name(std::move(real_name)), d_container_type(std::move(type))
95 {
96 }
97
98 // TODO Delete this copy ctor if possible. This class has an odd notion of
99 // copying. See _duplicate() that takes an object to copy to instead of
100 // copy from. jhrg 10/18/22
101 BESContainer(const BESContainer &copy_from);
102
103 void _duplicate(BESContainer &copy_to);
104
105public:
106
107 ~BESContainer() override = default;
108
109 BESContainer& operator=(const BESContainer& other) = delete;
110
113 virtual BESContainer * ptr_duplicate() = 0;
114
119 void set_constraint(const std::string &s)
120 {
121 d_constraint = s;
122 }
123
128 void set_dap4_constraint(const std::string &s)
129 {
130 d_dap4_constraint = s;
131 }
132
137 void set_dap4_function(const std::string &s)
138 {
139 d_dap4_function = s;
140 }
141
147 void set_real_name(const std::string &real_name)
148 {
149 d_real_name = real_name;
150 }
151
153 void set_relative_name(const std::string &relative) {
154 d_relative_name = relative;
155 }
156
162 void set_container_type(const std::string &type)
163 {
164 d_container_type = type;
165 }
166
171 void set_attributes(const std::string &attrs)
172 {
173 d_attributes = attrs;
174 }
175
181 std::string get_real_name() const
182 {
183 return d_real_name;
184 }
185
187 std::string get_relative_name() const {
188 return d_relative_name;
189 }
190
195 std::string get_constraint() const
196 {
197 return d_constraint;
198 }
199
204 std::string get_dap4_constraint() const
205 {
206 return d_dap4_constraint;
207 }
208
213 std::string get_dap4_function() const
214 {
215 return d_dap4_function;
216 }
217
222 std::string get_symbolic_name() const
223 {
224 return d_symbolic_name;
225 }
226
233 std::string get_container_type() const
234 {
235 return d_container_type;
236 }
237
238
243 std::string get_attributes() const
244 {
245 return d_attributes;
246 }
247
259 virtual std::string access() = 0;
260 virtual bool release() = 0;
261
262 void dump(std::ostream &strm) const override;
263};
264
265#endif // BESContainer_h_
A container is something that holds data. E.G., a netcdf file or a database entry.
void set_container_type(const std::string &type)
set the type of data that this container represents, such as cedar or netcdf.
void set_constraint(const std::string &s)
set the constraint for this container
std::string get_attributes() const
retrieve the attributes desired from this container
BESContainer(std::string sym_name, std::string real_name, std::string type)
construct a container with the given symbolic name, real name and container type.
std::string get_symbolic_name() const
retrieve the symbolic name for this container
virtual BESContainer * ptr_duplicate()=0
pure abstract method to duplicate this instances of BESContainer
std::string get_relative_name() const
Get the relative name of the object in this container.
void set_dap4_function(const std::string &s)
set the constraint for this container
void set_attributes(const std::string &attrs)
set desired attributes for this container
void dump(std::ostream &strm) const override
dumps information about this object
std::string get_dap4_constraint() const
retrieve the constraint expression for this container
std::string get_dap4_function() const
retrieve the constraint expression for this container
void set_real_name(const std::string &real_name)
set the real name for this container, such as a file name if reading a data file.
virtual std::string access()=0
returns the true name of this container
std::string get_container_type() const
retrieve the type of data this container holds, such as cedar or netcdf.
void set_dap4_constraint(const std::string &s)
set the constraint for this container
void set_relative_name(const std::string &relative)
Set the relative name of the object in this container.
void _duplicate(BESContainer &copy_to)
duplicate this instance into the passed container
std::string get_real_name() const
retrieve the real name for this container, such as a file name.
std::string get_constraint() const
retrieve the constraint expression for this container
top level BES object to house generic methods
Definition BESObj.h:54