33#ifndef API_MIP_DELEGATE_RESPONSE
34#define API_MIP_DELEGATE_RESPONSE
53 return response.mReserved;
68 DelegateResponse(std::shared_ptr<T> data) : mData(data), mDelegateResponseError(nullptr) {
70 throw std::invalid_argument(
"Created an empty DelegateResponse");
80 if (mDelegateResponseError->GetMessage().empty()) {
81 throw std::invalid_argument(
"Created an empty DelegateResponse");
93 if (!mDelegateResponseError) {
94 throw std::invalid_argument(
"Created an empty DelegateResponse");
103 std::shared_ptr<T>
GetData()
const {
return mData; }
110 std::shared_ptr<mip::DelegateResponseError>
GetError()
const {
111 return mDelegateResponseError;
121 std::shared_ptr<T> mData;
122 std::shared_ptr<mip::DelegateResponseError> mDelegateResponseError;
Base class for all DelegateResponse classes.
Delegate Response Error. Thrown or returned in response to encountering an error in a delegate method...
Template class to return delegate operation results.
std::shared_ptr< T > GetData() const
Returns the requested data, nullptr if call triggered an exception.
DelegateResponse(const std::exception_ptr &exception)
Create a DelegateResponse to wrap returned objects or exceptions.
std::shared_ptr< mip::DelegateResponseError > GetError() const
Return any error generated during the call, nullptr if call completed successfully.
DelegateResponse(mip::Error &error)
Create a DelegateResponse to wrap returned objects or exceptions.
DelegateResponse(std::shared_ptr< T > data)
Create a DelegateResponse to wrap returned objects or exceptions.
A file containing the MIP SDK error types.