Safir SDK Core
|
Proxy class for a response. More...
#include <Safir/Dob/ResponseProxy.h>
Public Member Functions | |
bool | IsSuccess () const |
Get response success or failure status. More... | |
const Dob::Typesystem::TypeId | GetTypeId () const |
Get type id. More... | |
const Dob::ResponsePtr | GetResponse () const |
Get response. More... | |
const Dob::ConnectionInfoPtr | GetResponseSenderConnectionInfo () const |
Get info about the response sender. More... | |
const char * | GetBlob () const |
Get binary blob of the received response. More... | |
ResponseProxy (Internal::ResponseProxyImpl *pImpl) | |
Methods to retrieve info about the original request. | |
const Dob::RequestId | GetRequestId () const |
Get request id. More... | |
const Dob::Typesystem::TypeId | GetRequestTypeId () const |
Get type id of the entity or service sent in the original request. More... | |
const Dob::Typesystem::InstanceId | GetRequestInstanceId () const |
Get the instance id used in the original request. More... | |
const Dob::Typesystem::ObjectPtr | GetRequest () const |
Get the original request. More... | |
const char * | GetRequestBlob () const |
Get the original request blob. More... | |
const Dob::Typesystem::HandlerId | GetRequestHandlerId () const |
Get the handler id to which the original request was sent. More... | |
Proxy class for a response.
|
explicit |
const char* Safir::Dob::ResponseProxy::GetBlob | ( | ) | const |
Get binary blob of the received response.
This method will give you a pointer to the underlying representation of the object. Note that this pointer is only valid while the ResponseProxy is in scope. If you want to keep the blob you must copy it using methods in Safir::Dob::Typesystem.
This method is mainly useful if all you want to do with a received object is to write it to a database or pass it over a C-interface to a library or plugin.
As an example, if you want to copy the bytes into a std::vector<char> you could do it like this "v = std::vector<char>(blob,blob+Safir::Dob::Typesystem::BlobOperations.GetSize())"
const Dob::Typesystem::ObjectPtr Safir::Dob::ResponseProxy::GetRequest | ( | ) | const |
Get the original request.
Retrieves the original request. Depending on the type of request this can be a Dob::EntityPtr or a Dob::ServicePtr.
const char* Safir::Dob::ResponseProxy::GetRequestBlob | ( | ) | const |
Get the original request blob.
Retrieves the blob of the original request. If the request was a delete request NULL will be returned.
This method will give you a pointer to the underlying representation of the object. Note that this pointer is only valid while the ResponseProxy is in scope. If you want to keep the blob you must copy it using methods in Safir::Dob::Typesystem.
This method is mainly useful if all you want to do with a received object is to write it to a database or pass it over a C-interface to a library or plugin.
As an example, if you want to copy the bytes into a std::vector<char> you could do it like this "v = std::vector<char>(blob,blob+Safir::Dob::Typesystem::BlobOperations.GetSize())"
const Dob::Typesystem::HandlerId Safir::Dob::ResponseProxy::GetRequestHandlerId | ( | ) | const |
Get the handler id to which the original request was sent.
const Dob::RequestId Safir::Dob::ResponseProxy::GetRequestId | ( | ) | const |
Get request id.
Retrieves the request id generated when the request was sent.
const Dob::Typesystem::InstanceId Safir::Dob::ResponseProxy::GetRequestInstanceId | ( | ) | const |
Get the instance id used in the original request.
(Only for entity requests)
const Dob::Typesystem::TypeId Safir::Dob::ResponseProxy::GetRequestTypeId | ( | ) | const |
Get type id of the entity or service sent in the original request.
const Dob::ResponsePtr Safir::Dob::ResponseProxy::GetResponse | ( | ) | const |
const Dob::ConnectionInfoPtr Safir::Dob::ResponseProxy::GetResponseSenderConnectionInfo | ( | ) | const |
Get info about the response sender.
Retrieves a smart pointer to info about the connection sending the response.
const Dob::Typesystem::TypeId Safir::Dob::ResponseProxy::GetTypeId | ( | ) | const |
Get type id.
Retrieves type id of the response.
bool Safir::Dob::ResponseProxy::IsSuccess | ( | ) | const |
Get response success or failure status.