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

Proxy class for entity injections. More...

#include <Safir/Dob/InjectedEntityProxy.h>

Public Member Functions

const Dob::Typesystem::TypeId GetTypeId () const
 Get type id. More...
 
const Dob::Typesystem::InstanceId GetInstanceId () const
 Get instance id. More...
 
const Dob::Typesystem::EntityId GetEntityId () const
 Get entity id. More...
 
const Dob::EntityPtr GetInjection () const
 Get the entity state that is about to be injected. More...
 
const char * GetInjectionBlob () const
 Get binary blob of the entity that is about to be injected. More...
 
const Dob::EntityPtr GetCurrent () const
 Get the current entity state. More...
 
 InjectedEntityProxy (Internal::InjectedEntityProxyImpl *pImpl)
 

Detailed Description

Proxy class for entity injections.

Constructor & Destructor Documentation

Safir::Dob::InjectedEntityProxy::InjectedEntityProxy ( Internal::InjectedEntityProxyImpl *  pImpl)
explicit

Member Function Documentation

const Dob::EntityPtr Safir::Dob::InjectedEntityProxy::GetCurrent ( ) const

Get the current entity state.

This method retrieves the entity as it is before the injection has been completed.

Can be used when a "current" state exists, i.e. from within the following callbacks:

  • EntityInjectionHandler::OnInjectedUpdatedEntity
  • EntityInjectionHandler::OnInjectedDeletedEntity

No change flags will be set in the returned entity.

Returns
Previous entity.
const Dob::Typesystem::EntityId Safir::Dob::InjectedEntityProxy::GetEntityId ( ) const

Get entity id.

Aggregation of type id and instance id.

Returns
Entity id.
const Dob::EntityPtr Safir::Dob::InjectedEntityProxy::GetInjection ( ) const

Get the entity state that is about to be injected.

Retrieves a smart pointer to the entity that is about to be injected.

Change flags will be set in the entity to indicate which members are part of the injection.

Note that this method cannot be called in an OnInjectedDeletedEntity, since there then is no entity to get...

Returns
entity.
const char* Safir::Dob::InjectedEntityProxy::GetInjectionBlob ( ) const

Get binary blob of the entity that is about to be injected.

This method will give you a pointer to the underlying representation of the object. Note that this pointer is only valid while the InjectedEntityProxy 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())"

Change flags will be set in the entity to indicate which members are part of the injection.

Returns
Binary blob of the entity that is about to be injected.
const Dob::Typesystem::InstanceId Safir::Dob::InjectedEntityProxy::GetInstanceId ( ) const

Get instance id.

Retrieves instance id of the Entity that is about to be injected.

Returns
Instance id.
const Dob::Typesystem::TypeId Safir::Dob::InjectedEntityProxy::GetTypeId ( ) const

Get type id.

Retrieves type id of the Entity that is about to be injected.

Returns
Type id.