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

Class that provides a methods to postpone the reception of data from the Dob. More...

#include <Safir/Dob/ConnectionAspectPostpone.h>

Inheritance diagram for Safir::Dob::ConnectionAspectPostpone:
Collaboration diagram for Safir::Dob::ConnectionAspectPostpone:

Public Member Functions

 ConnectionAspectPostpone (const ConnectionBase &connection)
 Constructor. More...
 
void Postpone (const bool redispatchCurrent) const
 Postpone dispatching of current callback method for the dispatched type and its subclasses. More...
 
void ResumePostponed () const
 Resume dispatching of postponed objects. More...
 
void IncompleteInjectionState () const
 Discard the currently dispatched injected entity instance and wait for an update. 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 a methods to postpone the reception of data from the Dob.

Sometimes it can by handy for an application to postpone the reception of data received in callbacks from the Dob.

For instance, setting up a subscription can potentially give a lot of initial OnNewEntity callbacks. If the application, for each subscription response, sends a request, the out-queue will probably fill up giving an Overflow exception. In this situation the application can postpone further callbacks.

Constructor & Destructor Documentation

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

Constructor.

Parameters
connectionThe connection that you want to operate through.

Member Function Documentation

void Safir::Dob::ConnectionAspectPostpone::IncompleteInjectionState ( ) const

Discard the currently dispatched injected entity instance and wait for an update.

A create or update of an object from an external source can have produced an inconsistent entity state (from the perspective of the application, not the Dob) and this method gives the local owner the possibility to wait for the entity instance to be completly updated.

This method can be called from within the following callbacks:

The dispatching of the injected entity instance is resumed when it is updated by the external source.

void Safir::Dob::ConnectionAspectPostpone::Postpone ( const bool  redispatchCurrent) const

Postpone dispatching of current callback method for the dispatched type and its subclasses.

Used by a consumer to postpone dispatching of current callback method for the dispatched type and its subclasses.

This method can be called from within the following callbacks:

but NOT from the following callbacks:

The dispatching is automatically resumed when an OnNotRequestOverflow or OnNotMessageOverflow is dispatched to the application which means that the application doesn't need to invoke ResumePostponed() by itself when the original postpone has been made because of an overflow situation.

Note that the postpone only applies to the currently dispatching consumer, other consumers will not be affected by the postpone.

If you are postponing a request (OnCreateRequest, OnUpdateRequest, OnDeleteRequest or OnServiceRequest), special care must be taken to the handling of the ResponseSender object. If redispatchCurrent is to True the current ResponseSender must be discarded (you will get a new ResponseSender). If redispatchCurrent is set to False a response for the current request must be sent.

Parameters
[in]redispatchCurrentTrue indicates that the currently dispatched object shall be dispatched again once the dispatching is resumed.
void Safir::Dob::ConnectionAspectPostpone::ResumePostponed ( ) const

Resume dispatching of postponed objects.

Allows the application to explicitly resume dispatching of postponed objects.

Needs to be inoked only if the original postpone is not related to an overflow towards the Dob.

See also
Postpone