Safir SDK Core
|
Class that provides methods for special applications that injects entities into the system apart from the normal handler. More...
#include <Safir/Dob/ConnectionAspectInjector.h>
Public Member Functions | |
ConnectionAspectInjector (const ConnectionBase &connection) | |
Constructor. More... | |
void | InjectChanges (const Dob::EntityPtr &entity, const Dob::Typesystem::InstanceId &instanceId, const Dob::Typesystem::Int64 timestamp, const Dob::Typesystem::HandlerId &handlerId) const |
Merge the changed members based on the timestamps. More... | |
void | InjectDelete (const Dob::Typesystem::EntityId &entityId, const Dob::Typesystem::Int64 timestamp, const Dob::Typesystem::HandlerId &handlerId) const |
Delete the given instance based on the timestamp. More... | |
void | InitialSet (const Dob::EntityPtr &entity, const Dob::Typesystem::InstanceId &instanceId, const Dob::Typesystem::HandlerId &handlerId) const |
Allows an application to inject an initial entity state. More... | |
void | SubscribeEntity (const Dob::Typesystem::TypeId typeId, const bool includeUpdates, const bool includeSubclasses, const bool restartSubscription, const bool wantsGhostDelete, const bool wantsLastState, const bool doesntWantSourceIsPermanentStore, const bool wantsAllStateChanges, const bool timestampChangeInfo, Dob::EntitySubscriber *const entitySubscriber) const |
Special entity subscription. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Safir::Dob::ConnectionAspectBase | |
ConnectionAspectBase (const ConnectionBase &connection) | |
Constructor. More... | |
virtual | ~ConnectionAspectBase () |
Destructor. More... | |
long | GetControllerId () const |
Get the id of the controller. More... | |
Class that provides methods for special applications that injects entities into the system apart from the normal handler.
Safir::Dob::ConnectionAspectInjector::ConnectionAspectInjector | ( | const ConnectionBase & | connection | ) |
Constructor.
[in] | connection | The connection to operate through. |
void Safir::Dob::ConnectionAspectInjector::InitialSet | ( | const Dob::EntityPtr & | entity, |
const Dob::Typesystem::InstanceId & | instanceId, | ||
const Dob::Typesystem::HandlerId & | handlerId | ||
) | const |
Allows an application to inject an initial entity state.
[in] | entity | Entity to create. |
[in] | instanceId | Instance id. |
[in] | handlerId | The handler id to which the state belongs. |
void Safir::Dob::ConnectionAspectInjector::InjectChanges | ( | const Dob::EntityPtr & | entity, |
const Dob::Typesystem::InstanceId & | instanceId, | ||
const Dob::Typesystem::Int64 | timestamp, | ||
const Dob::Typesystem::HandlerId & | handlerId | ||
) | const |
Merge the changed members based on the timestamps.
All members of the given entity that are marked as changed will be merged into the current entity object in the pool given that the top member has a timestamp that is "newer" than the corresponding timestamp in the Dob.
[in] | entity | Entity to create or update. |
[in] | instanceId | Instance id. |
[in] | timestamp | Timestamp valid for the top members that are marked as changed. |
[in] | handlerId | Handler id. |
void Safir::Dob::ConnectionAspectInjector::InjectDelete | ( | const Dob::Typesystem::EntityId & | entityId, |
const Dob::Typesystem::Int64 | timestamp, | ||
const Dob::Typesystem::HandlerId & | handlerId | ||
) | const |
void Safir::Dob::ConnectionAspectInjector::SubscribeEntity | ( | const Dob::Typesystem::TypeId | typeId, |
const bool | includeUpdates, | ||
const bool | includeSubclasses, | ||
const bool | restartSubscription, | ||
const bool | wantsGhostDelete, | ||
const bool | wantsLastState, | ||
const bool | doesntWantSourceIsPermanentStore, | ||
const bool | wantsAllStateChanges, | ||
const bool | timestampChangeInfo, | ||
Dob::EntitySubscriber *const | entitySubscriber | ||
) | const |
Special entity subscription.
Special subscription that also give the subscriber "ghost" entities, that is, entities with no current owner.
[in] | typeId | Type id of the entity to subscribe for. |
[in] | includeUpdates | True => Subscription includes update, as well as create and delete. False => Subscription includes no updates, only create and deletion. |
[in] | includeSubclasses | True => Subscription for this entity type and all its subclasses. False => No subclasses will be included. |
[in] | restartSubscription | True => OnNewEntity callbacks are generated even if the subscription already exists. False => OnNewEntity callbacks are generated only for instances that are not previously subscribed. |
[in] | wantsGhostDelete | True => Wants notification that an "inject new" or InitialSet was immediately deleted by owner. False => Normal subscription, only get deletes when an OnNew has been called. |
[in] | wantsLastState | True => Guarantee OnUpdated/OnNew even if application dies immediately after set. False => Normal subscription, call OnDeleted only in this case. |
[in] | doesntWantSourceIsPermanentStore | True => Doesnt want OnNew if only accept of an accept of an InitialSet. False => Normal Subscription. Gets OnNew for all states. (This flag is only applicable for AsynchronousPermanent types) |
[in] | wantsAllStateChanges | True => Wants OnDoDispatch called for all state changes, even if they do not result in a callback. ONLY MEANT FOR DOSE_MAIN! False => Normal Subscription. |
[in] | timestampChangeInfo | True => ChangeInfo is based on timestamps instead of contents False => ChangeInfo is based on object contents, as with normal subscribe. |
[in] | entitySubscriber | EntitySubscriber that will receive the entities. |