|
OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
#include <DDSLoader.h>

Public Types | |
| enum | ResponseType { eRT_RequestDDX = 0, eRT_RequestDataDDS, eRT_Num } |
| For telling the loader what type of BESDapResponse to load and return. More... | |
Public Member Functions | |
| void | cleanup () throw () |
| restore dhi to clean state More... | |
| DDSLoader (BESDataHandlerInterface &dhi) | |
| Create a loader that will hijack dhi on a load call, then restore it's state. More... | |
| DDSLoader (const DDSLoader &proto) | |
| BESDataHandlerInterface & | getDHI () const |
| Return a reference to the dhi we are using. More... | |
| std::auto_ptr< BESDapResponse > | load (const std::string &location, ResponseType type) |
| Load and return a new DDX or DataDDS structure for the local dataset referred to by location. More... | |
| void | loadInto (const std::string &location, ResponseType type, BESDapResponse *pResponse) |
| Load a DDX or DataDDS response into the given pResponse object, which must be non-null. More... | |
| DDSLoader & | operator= (const DDSLoader &) |
| virtual | ~DDSLoader () |
| Dtor restores the state of dhi Restores the state of the dhi to what it was when object if it is still hijacked (i.e. More... | |
Static Public Member Functions | |
| static bool | checkResponseIsValidType (ResponseType type, BESDapResponse *pResponse) |
| Return whether the given response's type matches the given ResposneType. More... | |
| static std::string | getActionForType (ResponseType type) |
| Convert the type into the action in BESResponseNames.h for the type. More... | |
| static std::string | getActionNameForType (ResponseType type) |
| Convert the type in the action name in BESResponseNames.h. More... | |
| static std::auto_ptr< BESDapResponse > | makeResponseForType (ResponseType type) |
| Make a new response object for the requested type. More... | |
Definition at line 64 of file DDSLoader.h.
For telling the loader what type of BESDapResponse to load and return.
It can handle a DDX load or a DataDDS load. The returned BesDapResponse will be of the proper subclass.
| Enumerator | |
|---|---|
| eRT_RequestDDX | |
| eRT_RequestDataDDS | |
| eRT_Num | |
Definition at line 97 of file DDSLoader.h.
| DDSLoader::DDSLoader | ( | BESDataHandlerInterface & | dhi | ) |
Create a loader that will hijack dhi on a load call, then restore it's state.
| dhi | DHI to hijack during load, needs to be a valid object for the scope of this object's life. |
Definition at line 65 of file DDSLoader.cc.
| DDSLoader::DDSLoader | ( | const DDSLoader & | proto | ) |
Definition at line 72 of file DDSLoader.cc.
|
virtual |
Dtor restores the state of dhi Restores the state of the dhi to what it was when object if it is still hijacked (i.e.
exception on load()) Destroys the BESDDSResponse if non-null, which is also the case on failed load() call.
Definition at line 127 of file DDSLoader.cc.
|
static |
Return whether the given response's type matches the given ResposneType.
If type==eRT_RequestDDX, pResponse must be BESDDSResponse If type==eRT_RequeastDataDDS, pResponse must be BESDataDDSResponse
Definition at line 373 of file DDSLoader.cc.
References eRT_RequestDataDDS, and eRT_RequestDDX.
| void DDSLoader::cleanup | ( | ) | ||
| throw | ( | |||
| ) | ||||
restore dhi to clean state
Ensures that the resources and dhi are all in the state they were at construction time. Probably not needed by users, but in case they want to catch an exception and then retry or something
Definition at line 209 of file DDSLoader.cc.
|
static |
Convert the type into the action in BESResponseNames.h for the type.
| type | the response type |
Definition at line 349 of file DDSLoader.cc.
References DATA_RESPONSE, DDS_RESPONSE, eRT_RequestDataDDS, eRT_RequestDDX, and THROW_NCML_INTERNAL_ERROR.
Referenced by loadInto().
|
static |
Convert the type in the action name in BESResponseNames.h.
| type | the response type |
Definition at line 361 of file DDSLoader.cc.
References DATA_RESPONSE_STR, DDX_RESPONSE_STR, eRT_RequestDataDDS, eRT_RequestDDX, and THROW_NCML_INTERNAL_ERROR.
Referenced by loadInto().
|
inline |
Return a reference to the dhi we are using.
A little dangerous to bare this rep, so be careful in its usage!
Definition at line 121 of file DDSLoader.h.
| auto_ptr< BESDapResponse > DDSLoader::load | ( | const std::string & | location, |
| ResponseType | type | ||
| ) |
Load and return a new DDX or DataDDS structure for the local dataset referred to by location.
Ownership of the response object passes to the caller via auto_ptr.
On exception, the dhi will be restored when this is destructed, or the user call directly call cleanup() to ensure this if they catch the exception and need the dhi restored immediately.
| location | the filename of the local file |
| type | whether to load DDX or DataDDS. |
type.| if | the underlying location cannot be loaded. |
Definition at line 132 of file DDSLoader.cc.
References loadInto(), and makeResponseForType().

| void DDSLoader::loadInto | ( | const std::string & | location, |
| ResponseType | type, | ||
| BESDapResponse * | pResponse | ||
| ) |
Load a DDX or DataDDS response into the given pResponse object, which must be non-null.
Similar to load(), but the caller passes in the response object to fill rather than wanting a new one.
If type == eRT_RequestDDX, pResponse MUST have type BESDDSReponse. If type == eRT_RequestDataDDS, pResponse MUST have type BESDataDDSResponse.
The location is loaded in pResponse based on the type of response requested.
| location | the file to load |
| type | the response type requested, must match type of pResponse |
| pResponse | the response object to fill in, which must match the request type. |
| If | there is a problem loading the location. |
Definition at line 141 of file DDSLoader.cc.
References BESDataHandlerInterface::action, BESDataHandlerInterface::action_name, BESDEBUG, BESDataHandlerInterface::container, BESRequestHandlerList::execute_current(), BESDapResponse::get_dap_client_protocol(), BESError::get_file(), BESError::get_line(), BESError::get_message(), BESDapResponse::get_request_xml_base(), getActionForType(), getActionNameForType(), ncml_module::NCMLUtil::getDDSFromEitherResponse(), BESDataHandlerInterface::response_handler, BESResponseHandler::set_response_object(), BESRequestHandlerList::TheList(), THROW_NCML_INTERNAL_ERROR, and VALID_PTR.
Referenced by load().

|
static |
Make a new response object for the requested type.
Definition at line 333 of file DDSLoader.cc.
References eRT_RequestDataDDS, eRT_RequestDDX, and THROW_NCML_INTERNAL_ERROR.
Referenced by ncml_module::NetcdfElement::createResponseObject(), and load().
Definition at line 79 of file DDSLoader.cc.
References BESDEBUG, and BESDataHandlerInterface::make_copy().
