bes  Updated for version 3.20.6
MyBaseTypeFactory.h
1 // This file is part of the "NcML Module" project, a BES module designed
3 // to allow NcML files to be used to be used as a wrapper to add
4 // AIS to existing datasets of any format.
5 //
6 // Copyright (c) 2009 OPeNDAP, Inc.
7 // Author: Michael Johnson <m.johnson@opendap.org>
8 //
9 // For more information, please also see the main website: http://opendap.org/
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU Lesser General Public
13 // License as published by the Free Software Foundation; either
14 // version 2.1 of the License, or (at your option) any later version.
15 //
16 // This library is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // Lesser General Public License for more details.
20 //
21 // You should have received a copy of the GNU Lesser General Public
22 // License along with this library; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 //
25 // Please see the files COPYING and COPYRIGHT for more information on the GLPL.
26 //
27 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
29 #ifndef __NCML_MODULE__MYBASETYPEFACTORY_H__
30 #define __NCML_MODULE__MYBASETYPEFACTORY_H__
31 
32 #include <memory>
33 #include <string>
34 
35 // libdap
36 #include "Array.h"
37 #include "BaseType.h" // need the Type enum...
38 
39 namespace libdap {
40 class BaseTypeFactory;
41 }
42 
43 namespace ncml_module {
57 protected:
58  // static class for now
60  virtual ~MyBaseTypeFactory();
61 
62 private:
63  // disallow copies
65  MyBaseTypeFactory& operator=(const MyBaseTypeFactory& rhs);
66 
67 public:
68 
69  static libdap::Type getType(const string& name);
70 
72  static bool isSimpleType(const string& typeName);
73 
78  static bool isArrayTemplate(const string& typeName);
79 
84  static std::auto_ptr<libdap::BaseType> makeVariable(const libdap::Type& type, const string& name);
85 
90  static std::auto_ptr<libdap::BaseType> makeVariable(const string& type, const string& name);
91 
100  static std::auto_ptr<libdap::Array> makeArrayTemplateVariable(const string& type, const string& name,
101  bool addTemplateVar);
102 
103 private:
104  //data rep
105 
106  // Singleton factory we will use to create variables by type name
107  static libdap::BaseTypeFactory* _spFactory;
108 };
109 
110 }
111 
112 #endif /* __NCML_MODULE__MYBASETYPEFACTORY_H__ */
BaseTypeFactory
ncml_module::MyBaseTypeFactory::isSimpleType
static bool isSimpleType(const string &typeName)
Definition: MyBaseTypeFactory.cc:197
ncml_module::MyBaseTypeFactory::makeArrayTemplateVariable
static std::auto_ptr< libdap::Array > makeArrayTemplateVariable(const string &type, const string &name, bool addTemplateVar)
Definition: MyBaseTypeFactory.cc:222
ncml_module::MyBaseTypeFactory::getType
static libdap::Type getType(const string &name)
Definition: MyBaseTypeFactory.cc:140
Type
Type
Type of JSON value.
Definition: cmr_module/rapidjson/rapidjson.h:603
ncml_module::MyBaseTypeFactory::makeVariable
static std::auto_ptr< libdap::BaseType > makeVariable(const libdap::Type &type, const string &name)
libdap
Definition: BESDapFunctionResponseCache.h:35
ncml_module::MyBaseTypeFactory
Wrapper for the BaseTypeFactory that lets us create by type name.
Definition: MyBaseTypeFactory.h:56
ncml_module::MyBaseTypeFactory::isArrayTemplate
static bool isArrayTemplate(const string &typeName)
Definition: MyBaseTypeFactory.cc:216
ncml_module
NcML Parser for adding/modifying/removing metadata (attributes) to existing local datasets using NcML...
Definition: AggregationElement.cc:72