MIP SDK — C++ 1.18
API Reference Documentation for C++
Loading...
Searching...
No Matches
DelegateResponse< T > Class Template Reference

Template class to return delegate operation results. More...

#include <mip/delegate_response.h>

Inheritance diagram for DelegateResponse< T >:
DelegateResponseBase

Public Member Functions

 DelegateResponse (std::shared_ptr< T > data)
 Create a DelegateResponse to wrap returned objects or exceptions.
 
 DelegateResponse (mip::Error &error)
 Create a DelegateResponse to wrap returned objects or exceptions.
 
 DelegateResponse (const std::exception_ptr &exception)
 Create a DelegateResponse to wrap returned objects or exceptions.
 
std::shared_ptr< T > GetData () const
 Returns the requested data, nullptr if call triggered an exception.
 
std::shared_ptr< mip::DelegateResponseError > GetError () const
 Return any error generated during the call, nullptr if call completed successfully.
 
virtual ~DelegateResponse ()
 

Protected Member Functions

 DelegateResponse ()
 
- Protected Member Functions inherited from DelegateResponseBase
 DelegateResponseBase ()
 

Private Attributes

std::shared_ptr< T > mData
 
std::shared_ptr< mip::DelegateResponseError > mDelegateResponseError
 

Additional Inherited Members

- Static Protected Member Functions inherited from DelegateResponseBase
static long GetReserved (const DelegateResponseBase &response)
 
- Protected Attributes inherited from DelegateResponseBase
long mReserved
 

Detailed Description

template<class T>
class DelegateResponse< T >

Template class to return delegate operation results.

Constructor & Destructor Documentation

◆ DelegateResponse() [1/4]

template<class T >
DelegateResponse< T >::DelegateResponse ( std::shared_ptr< T > data)
inline

Create a DelegateResponse to wrap returned objects or exceptions.

Parameters
dataThe type of data that the delegate has created to return wrapped in a shared pointer

◆ DelegateResponse() [2/4]

template<class T >
DelegateResponse< T >::DelegateResponse ( mip::Error & error)
inline

Create a DelegateResponse to wrap returned objects or exceptions.

Parameters
errorThe error that was encountered while processing the delegate

◆ DelegateResponse() [3/4]

template<class T >
DelegateResponse< T >::DelegateResponse ( const std::exception_ptr & exception)
inlineexplicit

Create a DelegateResponse to wrap returned objects or exceptions.

Parameters
exceptionIf the delegate encountered an exception it will populate this field with a exception in a shared pointer

◆ ~DelegateResponse()

template<class T >
virtual DelegateResponse< T >::~DelegateResponse ( )
inlinevirtual

◆ DelegateResponse() [4/4]

template<class T >
DelegateResponse< T >::DelegateResponse ( )
inlineprotected

Member Function Documentation

◆ GetData()

template<class T >
std::shared_ptr< T > DelegateResponse< T >::GetData ( ) const
inline

Returns the requested data, nullptr if call triggered an exception.

Returns
The data in a shared pointer of the templated type or nullptr.

◆ GetError()

template<class T >
std::shared_ptr< mip::DelegateResponseError > DelegateResponse< T >::GetError ( ) const
inline

Return any error generated during the call, nullptr if call completed successfully.

Returns
Exception pointer due to any failure in the delegate call or nullptr.

Member Data Documentation

◆ mData

template<class T >
std::shared_ptr<T> DelegateResponse< T >::mData
private

◆ mDelegateResponseError

template<class T >
std::shared_ptr<mip::DelegateResponseError> DelegateResponse< T >::mDelegateResponseError
private

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