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

Class that provides methods for special applications that injects entities into the system apart from the normal handler. More...

#include <Safir/Dob/ConnectionAspectInjector.h>

Inheritance diagram for Safir::Dob::ConnectionAspectInjector:
Collaboration diagram for Safir::Dob::ConnectionAspectInjector:

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

Detailed Description

Class that provides methods for special applications that injects entities into the system apart from the normal handler.

Constructor & Destructor Documentation

Safir::Dob::ConnectionAspectInjector::ConnectionAspectInjector ( const ConnectionBase connection)

Constructor.

Parameters
[in]connectionThe connection to operate through.

Member Function Documentation

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.

Parameters
[in]entityEntity to create.
[in]instanceIdInstance id.
[in]handlerIdThe 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.

Parameters
[in]entityEntity to create or update.
[in]instanceIdInstance id.
[in]timestampTimestamp valid for the top members that are marked as changed.
[in]handlerIdHandler id.
void Safir::Dob::ConnectionAspectInjector::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.

The given instance is deleted if the timestamp is "newer" than all top member timestamps for the current instance.

Parameters
[in]entityIdEntity id of the instance to delete.
[in]timestampTimestamp Time of deletion.
[in]handlerIdHandler id.
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.

Parameters
[in]typeIdType id of the entity to subscribe for.
[in]includeUpdatesTrue => Subscription includes update, as well as create and delete. False => Subscription includes no updates, only create and deletion.
[in]includeSubclassesTrue => Subscription for this entity type and all its subclasses. False => No subclasses will be included.
[in]restartSubscriptionTrue => OnNewEntity callbacks are generated even if the subscription already exists. False => OnNewEntity callbacks are generated only for instances that are not previously subscribed.
[in]wantsGhostDeleteTrue => 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]wantsLastStateTrue => Guarantee OnUpdated/OnNew even if application dies immediately after set. False => Normal subscription, call OnDeleted only in this case.
[in]doesntWantSourceIsPermanentStoreTrue => 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]wantsAllStateChangesTrue => 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]timestampChangeInfoTrue => ChangeInfo is based on timestamps instead of contents False => ChangeInfo is based on object contents, as with normal subscribe.
[in]entitySubscriberEntitySubscriber that will receive the entities.