ObjectBox C and C++ API  4.0.3
obx::ExpiredObjects Class Reference

Removal of expired objects; see OBXPropertyFlags_EXPIRATION_TIME. More...

#include <objectbox.hpp>

Public Member Functions

size_t remove (Transaction &tx, obx_schema_id typeId=0)
 Removes expired objects of one or all entity types. More...
 
void removeAsync (Store &store, obx_schema_id typeId=0, AsyncStatusCallback callback={})
 Asynchronously removes expired objects of one or all entity types. More...
 

Detailed Description

Removal of expired objects; see OBXPropertyFlags_EXPIRATION_TIME.

Member Function Documentation

◆ remove()

size_t obx::ExpiredObjects::remove ( Transaction tx,
obx_schema_id  typeId = 0 
)

Removes expired objects of one or all entity types.

Parameters
typeIdType of the objects to be remove; if zero (the default), all types are included. Hint: if you only have the entity type's name, use Store::getEntityTypeIdNoThrow() to get the ID.
Returns
the count of removed objects.
See also
OBXPropertyFlags_EXPIRATION_TIME to define a property for the expiration time.

◆ removeAsync()

void obx::ExpiredObjects::removeAsync ( Store store,
obx_schema_id  typeId = 0,
AsyncStatusCallback  callback = {} 
)

Asynchronously removes expired objects of one or all entity types.

Parameters
typeIdType of the objects to be remove; if zero (the default), all types are included. Hint: if you only have the entity type's name, use Store::getEntityTypeIdNoThrow() to get the ID.
See also
OBXPropertyFlags_EXPIRATION_TIME to define a property for the expiration time.