A factory to create instances of the leaf nodes of BaseType (Byte, ... Grid). Clients of libdap++ which require special behavior for the types should subclass this factory and provide an implementation which creates instances of those specializations. Make sure to pass a reference to the new factory to DDS's constructor since by default it uses this factory.
To define and use your own factory, first make sure that you are not using the compile time constant 'DEFAULT_BASETYPE_FACTORY.' Then pass a pointer to an instance of your factory to the DDS/DataDDS constructors. When the parser is used to build a DDS from a DAP response, the factory will be used to instantiate the different variable-type classes.
- Note:
- The easiest way to subclass this is to follow the pattern of using a separate class declaration and implementation. It's possible to use one file to hold both, but that is complicated somewhat because DDS.h, which includes this class, also includes many of the type classes (Array.h, ..., Grid.h) and the order of their inclusion can create compilation problems where the Vector and/or Constructor base classes are not defined. It's easiest to split the declaration and implementation and include forward declarations of the type classes in the declaration (
.h) file and then include the type class' headers in the implementation (
.cc) file.
- Author:
- James Gallagher
- See also:
- DDS
Definition at line 77 of file BaseTypeFactory.h.