bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
agg_util::DDSLoader Class Reference
Collaboration diagram for agg_util::DDSLoader:
Collaboration graph

Public Types

enum  ResponseType { eRT_RequestDDX = 0 , eRT_RequestDataDDS }
 

Public Member Functions

void cleanup ()
 restore dhi to clean state
 
 DDSLoader (BESDataHandlerInterface &dhi)
 Create a loader that will hijack dhi on a load call, then restore it's state.
 
 DDSLoader (const DDSLoader &proto)
 
BESDataHandlerInterfacegetDHI () const
 
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.
 
DDSLoaderoperator= (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. exception on load()) Destroys the BESDDSResponse if non-null, which is also the case on failed load() call.
 

Static Public Member Functions

static bool checkResponseIsValidType (ResponseType type, BESDapResponse *pResponse)
 
static std::string getActionForType (ResponseType type)
 
static std::string getActionNameForType (ResponseType type)
 
static std::unique_ptr< BESDapResponsemakeResponseForType (ResponseType type)
 

Detailed Description

Definition at line 62 of file DDSLoader.h.

Member Enumeration Documentation

◆ ResponseType

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.

Definition at line 93 of file DDSLoader.h.

Constructor & Destructor Documentation

◆ DDSLoader() [1/2]

DDSLoader::DDSLoader ( BESDataHandlerInterface & dhi)
explicit

Create a loader that will hijack dhi on a load call, then restore it's state.

Parameters
dhiDHI to hijack during load, needs to be a valid object for the scope of this object's life.

Definition at line 75 of file DDSLoader.cc.

◆ DDSLoader() [2/2]

DDSLoader::DDSLoader ( const DDSLoader & proto)

Definition at line 82 of file DDSLoader.cc.

◆ ~DDSLoader()

DDSLoader::~DDSLoader ( )
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 133 of file DDSLoader.cc.

Member Function Documentation

◆ checkResponseIsValidType()

bool DDSLoader::checkResponseIsValidType ( ResponseType type,
BESDapResponse * pResponse )
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 466 of file DDSLoader.cc.

◆ cleanup()

void DDSLoader::cleanup ( )

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 252 of file DDSLoader.cc.

◆ getActionForType()

std::string DDSLoader::getActionForType ( ResponseType type)
static

Convert the type into the action in BESResponseNames.h for the type.

Parameters
typethe response type
Returns
either DDX_RESPONSE or DATA_RESPONSE

Definition at line 442 of file DDSLoader.cc.

◆ getActionNameForType()

std::string DDSLoader::getActionNameForType ( ResponseType type)
static

Convert the type in the action name in BESResponseNames.h

Parameters
typethe response type
Returns
either DDX_RESPONSE_STR or DATA_RESPONSE_STR

Definition at line 454 of file DDSLoader.cc.

◆ getDHI()

BESDataHandlerInterface & agg_util::DDSLoader::getDHI ( ) const
inline

Return a reference to the dhi we are using. A little dangerous to bare this rep, so be careful in its usage!

Returns

Definition at line 119 of file DDSLoader.h.

◆ loadInto()

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.

Parameters
locationthe file to load
typethe response type requested, must match type of pResponse
pResponsethe response object to fill in, which must match the request type.
See also
load()
Exceptions
Ifthere is a problem loading the location.

Definition at line 150 of file DDSLoader.cc.

◆ makeResponseForType()

unique_ptr< BESDapResponse > DDSLoader::makeResponseForType ( ResponseType type)
static

Make a new response object for the requested type.

Definition at line 427 of file DDSLoader.cc.

◆ operator=()

DDSLoader & DDSLoader::operator= ( const DDSLoader & rhs)

Definition at line 89 of file DDSLoader.cc.


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