bes  Updated for version 3.20.6
ncml_module::MyBaseTypeFactory Class Reference

Wrapper for the BaseTypeFactory that lets us create by type name. More...

#include <MyBaseTypeFactory.h>

Collaboration diagram for ncml_module::MyBaseTypeFactory:
Collaboration graph

Static Public Member Functions

static libdap::Type getType (const string &name)
 
static bool isArrayTemplate (const string &typeName)
 
static bool isSimpleType (const string &typeName)
 
static std::auto_ptr< libdap::Array > makeArrayTemplateVariable (const string &type, const string &name, bool addTemplateVar)
 
static std::auto_ptr< libdap::BaseType > makeVariable (const libdap::Type &type, const string &name)
 
static std::auto_ptr< libdap::BaseType > makeVariable (const string &type, const string &name)
 

Detailed Description

Wrapper for the BaseTypeFactory that lets us create by type name.

The regular BaseTypeFactory doesn't have a factory method by type name, so this wrapper will add the desired functionality. It is a static class rather than a subclass.

Note that we can create normal libdap::Array by name, but this is deprecated since it fails with constraints. We have added special functionality for Array<T> to define an NCMLArray<T> as the return type. This allows hyperslab constraints to work.

Definition at line 56 of file MyBaseTypeFactory.h.

Member Function Documentation

◆ getType()

libdap::Type ncml_module::MyBaseTypeFactory::getType ( const string &  name)
static

Get the Type enumeration value which matches the given name.

Definition at line 140 of file MyBaseTypeFactory.cc.

◆ isArrayTemplate()

bool ncml_module::MyBaseTypeFactory::isArrayTemplate ( const string &  typeName)
static
Returns
whether the desired type is of the form Array<T> for some basic type T. This is a special case for creating Arrays of subclass NCMLArray<T> so we can handle constraints.

Definition at line 216 of file MyBaseTypeFactory.cc.

◆ isSimpleType()

bool ncml_module::MyBaseTypeFactory::isSimpleType ( const string &  typeName)
static
Returns
whether the typeName refers to a simple (non-container) type.

Definition at line 197 of file MyBaseTypeFactory.cc.

◆ makeArrayTemplateVariable()

std::auto_ptr< libdap::Array > ncml_module::MyBaseTypeFactory::makeArrayTemplateVariable ( const string &  type,
const string &  name,
bool  addTemplateVar 
)
static

Make an Array<T> where T is the DAP simple type for the values in the Array. This creates the proper template class of NCMLArray<T> now rather than Array so we can handle constraints.

Parameters
typethe parameterized name of the Array type, e.g. "Array<String>", Array<UInt32>, etc.
namethe name to give the new Array
addTemplateVarwhether to create and add the template var so that var() is non-null.

Definition at line 222 of file MyBaseTypeFactory.cc.

◆ makeVariable() [1/2]

static std::auto_ptr<libdap::BaseType> ncml_module::MyBaseTypeFactory::makeVariable ( const libdap::Type type,
const string &  name 
)
static

Return a new variable of the given type

Parameters
typethe DAP type
namethe name to give the new variable

◆ makeVariable() [2/2]

static std::auto_ptr<libdap::BaseType> ncml_module::MyBaseTypeFactory::makeVariable ( const string &  type,
const string &  name 
)
static

Return a new variable of the given type name. Return null if type is not valid.

Parameters
typethe DAP type to create.
namethe name to give the new variable

The documentation for this class was generated from the following files: