bes Updated for version 3.20.13
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 std::string &name)
 
static bool isArrayTemplate (const std::string &typeName)
 
static bool isSimpleType (const std::string &typeName)
 
static std::unique_ptr< libdap::Array > makeArrayTemplateVariable (const std::string &type, const std::string &name, bool addTemplateVar)
 
static std::unique_ptr< libdap::BaseType > makeVariable (const libdap::Type &type, const std::string &name)
 
static std::unique_ptr< libdap::BaseType > makeVariable (const std::string &type, const std::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 std::string &  name)
static

Get the Type enumeration value which matches the given name.

Definition at line 146 of file MyBaseTypeFactory.cc.

◆ isArrayTemplate()

bool ncml_module::MyBaseTypeFactory::isArrayTemplate ( const std::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 222 of file MyBaseTypeFactory.cc.

◆ isSimpleType()

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

Definition at line 203 of file MyBaseTypeFactory.cc.

◆ makeArrayTemplateVariable()

std::unique_ptr< libdap::Array > ncml_module::MyBaseTypeFactory::makeArrayTemplateVariable ( const std::string &  type,
const std::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 229 of file MyBaseTypeFactory.cc.

◆ makeVariable() [1/2]

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

Return a new variable of the given type

Parameters
typethe DAP type
namethe name to give the new variable

Definition at line 70 of file MyBaseTypeFactory.cc.

◆ makeVariable() [2/2]

unique_ptr< libdap::BaseType > ncml_module::MyBaseTypeFactory::makeVariable ( const std::string &  type,
const std::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

Definition at line 133 of file MyBaseTypeFactory.cc.


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