Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Safir::Dob::ResponseProxy Class Reference

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...
 

Detailed Description

Proxy class for a response.

Constructor & Destructor Documentation

Safir::Dob::ResponseProxy::ResponseProxy ( Internal::ResponseProxyImpl *  pImpl)
explicit

Member Function Documentation

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())"

Returns
Binary blob of the received response.
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.

Returns
Original request.
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())"

Returns
Original request blob.
const Dob::Typesystem::HandlerId Safir::Dob::ResponseProxy::GetRequestHandlerId ( ) const

Get the handler id to which the original request was sent.

Returns
Handler id.
const Dob::RequestId Safir::Dob::ResponseProxy::GetRequestId ( ) const

Get request id.

Retrieves the request id generated when the request was sent.

Returns
Request id.
const Dob::Typesystem::InstanceId Safir::Dob::ResponseProxy::GetRequestInstanceId ( ) const

Get the instance id used in the original request.

(Only for entity requests)

Returns
Instance id.
const Dob::Typesystem::TypeId Safir::Dob::ResponseProxy::GetRequestTypeId ( ) const

Get type id of the entity or service sent in the original request.

Returns
Type id.
const Dob::ResponsePtr Safir::Dob::ResponseProxy::GetResponse ( ) const

Get response.

Retrieves a smart pointer to the response.

Returns
Response
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.

Returns
Connection info.
const Dob::Typesystem::TypeId Safir::Dob::ResponseProxy::GetTypeId ( ) const

Get type id.

Retrieves type id of the response.

Returns
Type id.
bool Safir::Dob::ResponseProxy::IsSuccess ( ) const

Get response success or failure status.

Returns
Success or failure.