bes  Updated for version 3.20.5
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 
39 using std::list;
40 using std::string;
41 
42 #include "BESObj.h"
43 
68 class BESContainer: public BESObj {
69 private:
70  string d_symbolic_name;
71  string d_real_name;
72  string d_relative_name;
73  string d_container_type;
74 
75  string d_constraint;
76  string d_dap4_constraint;
77  string d_dap4_function;
78 
79  string d_attributes;
80 
81 protected:
82  BESContainer()
83  {
84  }
85 
97  BESContainer(const string &sym_name, const string &real_name, const string &type) :
98  d_symbolic_name(sym_name), d_real_name(real_name), d_relative_name(""), d_container_type(type),
99  d_constraint(""), d_dap4_constraint(""), d_dap4_function(""), d_attributes("")
100  {
101  }
102 
103  BESContainer(const BESContainer &copy_from);
104 
105  void _duplicate(BESContainer &copy_to);
106 
107 public:
108 
109  virtual ~BESContainer()
110  {
111  }
112 
115  virtual BESContainer * ptr_duplicate() = 0;
116 
121  void set_constraint(const string &s)
122  {
123  d_constraint = s;
124  }
125 
130  void set_dap4_constraint(const string &s)
131  {
132  d_dap4_constraint = s;
133  }
134 
139  void set_dap4_function(const string &s)
140  {
141  d_dap4_function = s;
142  }
143 
149  void set_real_name(const string &real_name)
150  {
151  d_real_name = real_name;
152  }
153 
155  void set_relative_name(const std::string &relative) {
156  d_relative_name = relative;
157  }
158 
164  void set_container_type(const string &type)
165  {
166  d_container_type = type;
167  }
168 
173  void set_attributes(const string &attrs)
174  {
175  d_attributes = attrs;
176  }
177 
183  string get_real_name() const
184  {
185  return d_real_name;
186  }
187 
189  std::string get_relative_name() const {
190  return d_relative_name;
191  }
192 
197  string get_constraint() const
198  {
199  return d_constraint;
200  }
201 
206  string get_dap4_constraint() const
207  {
208  return d_dap4_constraint;
209  }
210 
215  string get_dap4_function() const
216  {
217  return d_dap4_function;
218  }
219 
224  string get_symbolic_name() const
225  {
226  return d_symbolic_name;
227  }
228 
235  string get_container_type() const
236  {
237  return d_container_type;
238  }
239 
240 
245  string get_attributes() const
246  {
247  return d_attributes;
248  }
249 
261  virtual string access() = 0;
262  virtual bool release() = 0;
263 
264  virtual void dump(ostream &strm) const;
265 };
266 
267 #endif // BESContainer_h_
void set_relative_name(const std::string &relative)
Set the relative name of the object in this container.
Definition: BESContainer.h:155
void set_real_name(const string &real_name)
set the real name for this container, such as a file name if reading a data file.
Definition: BESContainer.h:149
std::string get_relative_name() const
Get the relative name of the object in this container.
Definition: BESContainer.h:189
BESContainer(const string &sym_name, const string &real_name, const string &type)
construct a container with the given symbolic name, real name and container type.
Definition: BESContainer.h:97
virtual void dump(ostream &strm) const
dumps information about this object
Definition: BESContainer.cc:70
string get_dap4_constraint() const
retrieve the constraint expression for this container
Definition: BESContainer.h:206
virtual string access()=0
returns the true name of this container
Base object for bes objects.
Definition: BESObj.h:51
void set_container_type(const string &type)
set the type of data that this container represents, such as cedar or netcdf.
Definition: BESContainer.h:164
void set_constraint(const string &s)
set the constraint for this container
Definition: BESContainer.h:121
void set_dap4_constraint(const string &s)
set the constraint for this container
Definition: BESContainer.h:130
void _duplicate(BESContainer &copy_to)
duplicate this instance into the passed container
Definition: BESContainer.cc:51
void set_attributes(const string &attrs)
set desired attributes for this container
Definition: BESContainer.h:173
void set_dap4_function(const string &s)
set the constraint for this container
Definition: BESContainer.h:139
string get_constraint() const
retrieve the constraint expression for this container
Definition: BESContainer.h:197
string get_real_name() const
retrieve the real name for this container, such as a file name.
Definition: BESContainer.h:183
string get_container_type() const
retrieve the type of data this container holds, such as cedar or netcdf.
Definition: BESContainer.h:235
A container is something that holds data. E.G., a netcdf file or a database entry.
Definition: BESContainer.h:68
string get_attributes() const
retrieve the attributes desired from this container
Definition: BESContainer.h:245
string get_dap4_function() const
retrieve the constraint expression for this container
Definition: BESContainer.h:215
virtual BESContainer * ptr_duplicate()=0
pure abstract method to duplicate this instances of BESContainer
string get_symbolic_name() const
retrieve the symbolic name for this container
Definition: BESContainer.h:224