bes  Updated for version 3.20.6
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 #include "BESObj.h"
40 
65 class BESContainer: public BESObj {
66 private:
67  std::string d_symbolic_name;
68  std::string d_real_name;
69  std::string d_relative_name;
70  std::string d_container_type;
71 
72  std::string d_constraint;
73  std::string d_dap4_constraint;
74  std::string d_dap4_function;
75 
76  std::string d_attributes;
77 
78 protected:
79  BESContainer()
80  {
81  }
82 
94  BESContainer(const std::string &sym_name, const std::string &real_name, const std::string &type) :
95  d_symbolic_name(sym_name), d_real_name(real_name), d_relative_name(""), d_container_type(type),
96  d_constraint(""), d_dap4_constraint(""), d_dap4_function(""), d_attributes("")
97  {
98  }
99 
100  BESContainer(const BESContainer &copy_from);
101 
102  void _duplicate(BESContainer &copy_to);
103 
104 public:
105 
106  virtual ~BESContainer()
107  {
108  }
109 
112  virtual BESContainer * ptr_duplicate() = 0;
113 
118  void set_constraint(const std::string &s)
119  {
120  d_constraint = s;
121  }
122 
127  void set_dap4_constraint(const std::string &s)
128  {
129  d_dap4_constraint = s;
130  }
131 
136  void set_dap4_function(const std::string &s)
137  {
138  d_dap4_function = s;
139  }
140 
146  void set_real_name(const std::string &real_name)
147  {
148  d_real_name = real_name;
149  }
150 
152  void set_relative_name(const std::string &relative) {
153  d_relative_name = relative;
154  }
155 
161  void set_container_type(const std::string &type)
162  {
163  d_container_type = type;
164  }
165 
170  void set_attributes(const std::string &attrs)
171  {
172  d_attributes = attrs;
173  }
174 
180  std::string get_real_name() const
181  {
182  return d_real_name;
183  }
184 
186  std::string get_relative_name() const {
187  return d_relative_name;
188  }
189 
194  std::string get_constraint() const
195  {
196  return d_constraint;
197  }
198 
203  std::string get_dap4_constraint() const
204  {
205  return d_dap4_constraint;
206  }
207 
212  std::string get_dap4_function() const
213  {
214  return d_dap4_function;
215  }
216 
221  std::string get_symbolic_name() const
222  {
223  return d_symbolic_name;
224  }
225 
232  std::string get_container_type() const
233  {
234  return d_container_type;
235  }
236 
237 
242  std::string get_attributes() const
243  {
244  return d_attributes;
245  }
246 
258  virtual std::string access() = 0;
259  virtual bool release() = 0;
260 
261  virtual void dump(std::ostream &strm) const;
262 };
263 
264 #endif // BESContainer_h_
BESContainer::set_real_name
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.
Definition: BESContainer.h:146
BESContainer::ptr_duplicate
virtual BESContainer * ptr_duplicate()=0
pure abstract method to duplicate this instances of BESContainer
BESContainer::set_attributes
void set_attributes(const std::string &attrs)
set desired attributes for this container
Definition: BESContainer.h:170
BESContainer::get_dap4_function
std::string get_dap4_function() const
retrieve the constraint expression for this container
Definition: BESContainer.h:212
BESContainer::get_container_type
std::string get_container_type() const
retrieve the type of data this container holds, such as cedar or netcdf.
Definition: BESContainer.h:232
BESContainer::get_symbolic_name
std::string get_symbolic_name() const
retrieve the symbolic name for this container
Definition: BESContainer.h:221
BESContainer::get_relative_name
std::string get_relative_name() const
Get the relative name of the object in this container.
Definition: BESContainer.h:186
BESContainer::set_dap4_function
void set_dap4_function(const std::string &s)
set the constraint for this container
Definition: BESContainer.h:136
BESContainer::get_constraint
std::string get_constraint() const
retrieve the constraint expression for this container
Definition: BESContainer.h:194
BESContainer::BESContainer
BESContainer(const std::string &sym_name, const std::string &real_name, const std::string &type)
construct a container with the given symbolic name, real name and container type.
Definition: BESContainer.h:94
BESContainer::access
virtual std::string access()=0
returns the true name of this container
BESObj
top level BES object to house generic methods
Definition: BESObj.h:49
BESContainer::get_attributes
std::string get_attributes() const
retrieve the attributes desired from this container
Definition: BESContainer.h:242
BESContainer
A container is something that holds data. E.G., a netcdf file or a database entry.
Definition: BESContainer.h:65
BESContainer::get_real_name
std::string get_real_name() const
retrieve the real name for this container, such as a file name.
Definition: BESContainer.h:180
BESContainer::set_constraint
void set_constraint(const std::string &s)
set the constraint for this container
Definition: BESContainer.h:118
BESContainer::set_container_type
void set_container_type(const std::string &type)
set the type of data that this container represents, such as cedar or netcdf.
Definition: BESContainer.h:161
BESContainer::set_relative_name
void set_relative_name(const std::string &relative)
Set the relative name of the object in this container.
Definition: BESContainer.h:152
BESContainer::_duplicate
void _duplicate(BESContainer &copy_to)
duplicate this instance into the passed container
Definition: BESContainer.cc:54
BESContainer::set_dap4_constraint
void set_dap4_constraint(const std::string &s)
set the constraint for this container
Definition: BESContainer.h:127
BESContainer::dump
virtual void dump(std::ostream &strm) const
dumps information about this object
Definition: BESContainer.cc:73
BESContainer::get_dap4_constraint
std::string get_dap4_constraint() const
retrieve the constraint expression for this container
Definition: BESContainer.h:203