cohtml::IDataStorageHandler

Class that will handle data storage requests.

#include <DataStorage.h>

Public Functions

Name
IDataStorageHandler()
virtual~IDataStorageHandler()
virtual voidOnDataStorageRead(const cohtml::IDataStorageRequest * request, cohtml::IDataStorageResponse * response) =0
Called when data storage needs a key or value data.
virtual boolOnDataStorageWrite(const char * id, const char * key, const char * value) =0
Called when data storage needs a data to be stored for a specific ID and key If data collection for that ID doesn’t exist it should be created.
virtual voidOnDataStorageRemove(const char * id, const char * key) =0
Called when data storage needs a data to be removed from the collection.
virtual voidOnDataStorageClear(const char * id) =0
Called when data storage needs all data for a given collection to be cleared.
virtual unsigned longOnDataStorageCount(const char * id) =0
Called when data storage needs the count of all data stored in a specific collection.

Public Functions Documentation

function IDataStorageHandler

IDataStorageHandler()

function ~IDataStorageHandler

virtual ~IDataStorageHandler()

function OnDataStorageRead

virtual void OnDataStorageRead(
    const cohtml::IDataStorageRequest * request,
    cohtml::IDataStorageResponse * response
) =0

Called when data storage needs a key or value data.

Parameters:

  • request object describing the data requested
  • response object where to pass the data read

function OnDataStorageWrite

virtual bool OnDataStorageWrite(
    const char * id,
    const char * key,
    const char * value
) =0

Called when data storage needs a data to be stored for a specific ID and key If data collection for that ID doesn’t exist it should be created.

Parameters:

  • id of the data collection
  • key for storing the value
  • value that needs to be stored

function OnDataStorageRemove

virtual void OnDataStorageRemove(
    const char * id,
    const char * key
) =0

Called when data storage needs a data to be removed from the collection.

Parameters:

  • id of the data collection
  • key that needs to be removed

function OnDataStorageClear

virtual void OnDataStorageClear(
    const char * id
) =0

Called when data storage needs all data for a given collection to be cleared.

Parameters:

  • id of the data collection

function OnDataStorageCount

virtual unsigned long OnDataStorageCount(
    const char * id
) =0

Called when data storage needs the count of all data stored in a specific collection.

Parameters:

  • id of the data collection