AMPS C/C++ Client Class Reference AMPS C/C++ Client Version 5.3.5.7

Public Member Functions | List of all members
AMPS::ConflatingRecoveryPointAdapter Class Reference

RecoveryPointAdapter implementation that delegates storage to another RecoveryPointAdapter but provides conflation so that only every X updates are saved and/or only the last update every Y milliseconds is saved. More...

`#include <RecoveryPointAdapter.hpp>`

Inheritance diagram for AMPS::ConflatingRecoveryPointAdapter:

## Public Member Functions
| ConflatingRecoveryPointAdapter (const std::shared_ptr< RecoveryPointAdapterImpl > &delegate_, unsigned updateThreshold_=10, double timeoutMillis_=2000.0, long updateIntervalMillis_=2000)
| Conflate updates to delegate_ where they will only be processed every updateIntervalMillis_ for subscriptions that have been updated at least updateThreshold_ times or haven't been updated for at least timeoutMillis_ milliseconds. More...
virtual bool | next (RecoveryPoint &current_)
| Recovery is done by iteration over elements in storage. More...
virtual void | update (RecoveryPoint &recoveryPoint_)
| Update the storage information with the given recovery point. More...
virtual void | purge ()
| Remove all data from the storage.
virtual void | purge (const Field &subId_)
| Remove the specified subId_ from the storage. More...
virtual void | close ()
| Take any necessary actions to close the associated storage.
virtual void | updateAll ()
| Push all updates to underlying adapter.
void | _runUpdateAll ()
| Lock is already held.
Public Member Functions inherited from AMPS::RecoveryPointAdapterImpl
virtual void | prune ()
| Take any necessary actions to reduce associated storage size.

## Detailed Description

RecoveryPointAdapter implementation that delegates storage to another RecoveryPointAdapter but provides conflation so that only every X updates are saved and/or only the last update every Y milliseconds is saved.

## Constructor & Destructor Documentation

## ◆ ConflatingRecoveryPointAdapter()

AMPS::ConflatingRecoveryPointAdapter::ConflatingRecoveryPointAdapter | ( | const std::shared_ptr< RecoveryPointAdapterImpl > & | delegate_,
|  | unsigned | updateThreshold_ = `10`,
|  | double | timeoutMillis_ = `2000.0`,
|  | long | updateIntervalMillis_ = `2000`
| ) |  |
| inline

Conflate updates to delegate_ where they will only be processed every updateIntervalMillis_ for subscriptions that have been updated at least updateThreshold_ times or haven't been updated for at least timeoutMillis_ milliseconds.

Parameters

  delegate_ | A shared pointer to the underlying delegate RecoveryPointAdapter.
  updateThreshold_ | The minimum number of updates for a given subId before a conflated update is delivered. Setting to 1 will prevent conflation from occurring.
  timeoutMillis_ | The maximum amount of time between conflated updates for a given subId. Setting to 0 will force all updates to be sent any time one update needs to be sent or every updateInterval.
  updateIntervalMillis_ | The amount of time the update thread can sit idle between sending conflated updates and checking for timeouts.

## Member Function Documentation

## ◆ next()

virtual bool AMPS::ConflatingRecoveryPointAdapter::next | ( | RecoveryPoint & | current_ | ) |
| inline virtual

Recovery is done by iteration over elements in storage.

This function modifies the passed in argument to be the next stored RecoveryPoint or an empty RecoveryPoint to indicate completion.

Parameters

  current_ | The RecoveryPoint to set as the next recovery item.

Implements AMPS::RecoveryPointAdapterImpl.

## ◆ purge()

virtual void AMPS::ConflatingRecoveryPointAdapter::purge | ( | const Field & | subId_ | ) |
| inline virtual

Remove the specified subId_ from the storage.

Parameters

  subId_ | The sub id to remove.

Implements AMPS::RecoveryPointAdapterImpl.

## ◆ update()

virtual void AMPS::ConflatingRecoveryPointAdapter::update | ( | RecoveryPoint & | recoveryPoint_ | ) |
| inline virtual

Update the storage information with the given recovery point.

Parameters

  recoveryPoint_ | The new/updated RecoveryPoint to save.

Implements AMPS::RecoveryPointAdapterImpl.

The documentation for this class was generated from the following file:

- include/amps/RecoveryPointAdapter.hpp