libdap++  Updated for version 3.8.2
Constructor.h
Go to the documentation of this file.
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
5 // Access Protocol.
6 
7 // Copyright (c) 2002,2003 OPeNDAP, Inc.
8 // Author: James Gallagher <jgallagher@opendap.org>
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 //
24 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25 
26 #ifndef _constructor_h
27 #define _constructor_h 1
28 
29 #include <vector>
30 
31 #ifndef _basetype_h
32 #include "BaseType.h"
33 #endif
34 
35 #define FILE_METHODS 1
36 
37 namespace libdap
38 {
39 
41 class Constructor: public BaseType
42 {
43 private:
44  Constructor(); // No default ctor.
45  BaseType *find_hdf4_dimension_attribute_home(AttrTable::entry *source);
46 
47 protected:
48  std::vector<BaseType *> _vars;
49 
50  void _duplicate(const Constructor &s);
51 #if 0
52  virtual AttrTable *find_matching_container(AttrTable::entry *source,
53  BaseType **dest_variable);
54 #endif
55  Constructor(const string &n, const Type &t);
56  Constructor(const string &n, const string &d, const Type &t);
57 
58  Constructor(const Constructor &copy_from);
59 public:
60  typedef std::vector<BaseType *>::const_iterator Vars_citer ;
61  typedef std::vector<BaseType *>::iterator Vars_iter ;
62  typedef std::vector<BaseType *>::reverse_iterator Vars_riter ;
63 
64  virtual ~Constructor();
65 
66  Constructor &operator=(const Constructor &rhs);
67 #if 0
68  virtual void transfer_attributes(AttrTable::entry *entry);
69 #endif
70  virtual void transfer_attributes(AttrTable *at_container);
71 
72  Vars_iter var_begin();
73  Vars_iter var_end();
74  Vars_riter var_rbegin();
75  Vars_riter var_rend();
76  Vars_iter get_vars_iter(int i);
77  BaseType *get_var_index(int i);
78 
79  virtual bool is_linear();
80 
81  virtual void print_decl(ostream &out, string space = " ",
82  bool print_semi = true,
83  bool constraint_info = false,
84  bool constrained = false);
85 
86  virtual void print_xml(ostream &out, string space = " ",
87  bool constrained = false);
88 
89 #if FILE_METHODS
90  virtual void print_decl(FILE *out, string space = " ",
91  bool print_semi = true,
92  bool constraint_info = false,
93  bool constrained = false);
94  virtual void print_xml(FILE *out, string space = " ",
95  bool constrained = false);
96 #endif
97 
98  virtual void dump(ostream &strm) const ;
99 };
100 
101 } // namespace libdap
102 
103 #endif // _constructor_h
virtual ~Constructor()
Definition: Constructor.cc:83
std::vector< BaseType * >::reverse_iterator Vars_riter
Definition: Constructor.h:62
Contains the attributes for a dataset.
Definition: AttrTable.h:146
std::vector< BaseType * > _vars
Definition: Constructor.h:48
std::vector< BaseType * >::iterator Vars_iter
Definition: Constructor.h:61
Vars_riter var_rend()
Definition: Constructor.cc:310
Type
Identifies the data type.
Definition: BaseType.h:131
Constructor & operator=(const Constructor &rhs)
Definition: Constructor.cc:87
virtual void print_xml(ostream &out, string space=" ", bool constrained=false)
Definition: Constructor.cc:448
virtual bool is_linear()
Check to see whether this variable can be printed simply.
Definition: Constructor.cc:488
Vars_riter var_rbegin()
Definition: Constructor.cc:302
virtual void transfer_attributes(AttrTable *at_container)
Definition: Constructor.cc:260
BaseType * get_var_index(int i)
Definition: Constructor.cc:328
virtual void dump(ostream &strm) const
dumps information about this object
Definition: Constructor.cc:502
std::vector< BaseType * >::const_iterator Vars_citer
Definition: Constructor.h:60
The basic data type for the DODS DAP types.
Definition: BaseType.h:190
virtual void print_decl(ostream &out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false)
Print an ASCII representation of the variable structure.
Definition: Constructor.cc:361
Vars_iter var_begin()
Definition: Constructor.cc:101
Vars_iter var_end()
Definition: Constructor.cc:295
Vars_iter get_vars_iter(int i)
Definition: Constructor.cc:319
void _duplicate(const Constructor &s)
Definition: Constructor.cc:57