78 uint32_t maxChanges)
C4API;
#define NODISCARD
Definition CompilerSupport.h:59
#define CBL_CORE_API
Definition c4Compat.h:134
#define C4NULLABLE
Definition c4Compat.h:38
#define C4API
Definition c4Compat.h:114
#define C4_ASSUME_NONNULL_BEGIN
Definition c4Compat.h:36
#define C4API_END_DECLS
Definition c4Compat.h:116
#define C4NONNULL
Definition c4Compat.h:39
#define C4API_BEGIN_DECLS
Definition c4Compat.h:115
#define C4_ASSUME_NONNULL_END
Definition c4Compat.h:37
struct C4Query C4Query
Opaque handle to a compiled query.
Definition c4Base.h:160
uint64_t C4SequenceNumber
A database sequence number, representing the order in which a revision was created.
Definition c4Base.h:91
struct C4CollectionObserver C4CollectionObserver
A collection-observer reference.
Definition c4Base.h:129
struct C4QueryObserver C4QueryObserver
A query-observer reference.
Definition c4Base.h:166
struct C4DocumentObserver C4DocumentObserver
A document-observer reference.
Definition c4Base.h:142
struct C4Collection C4Collection
Opaque handle to a namespace of documents in an opened database.
Definition c4Base.h:126
NODISCARD CBL_CORE_API C4CollectionObserver * c4dbobs_createOnCollection(C4Collection *collection, C4CollectionObserverCallback callback, void *context, C4Error *error)
Creates a new collection observer, with a callback that will be invoked after one or more documents i...
NODISCARD CBL_CORE_API C4QueryObserver * c4queryobs_create(C4Query *query, C4QueryObserverCallback callback, void *context)
Creates a new query observer, with a callback that will be invoked when the query results change,...
NODISCARD CBL_CORE_API C4DocumentObserver * c4docobs_createWithCollection(C4Collection *collection, C4String docID, C4DocumentObserverCallback callback, void *context, C4Error *error)
Creates a new document observer, with a callback that will be invoked when the document changes.
void(* C4CollectionObserverCallback)(C4CollectionObserver *observer, void *context)
Callback invoked by a collection/database observer.
Definition c4Observer.h:41
NODISCARD CBL_CORE_API C4CollectionObservation c4dbobs_getChanges(C4CollectionObserver *observer, C4CollectionChange outChanges[], uint32_t maxChanges)
Identifies which documents have changed in the collection since the last time this function was calle...
void(* C4DocumentObserverCallback)(C4DocumentObserver *observer, C4Collection *collection, C4String docID, C4SequenceNumber sequence, void *context)
Callback invoked by a document observer.
Definition c4Observer.h:99
CBL_CORE_API void c4queryobs_setEnabled(C4QueryObserver *obs, bool enabled)
Enables a query observer so its callback can be called, or disables it to stop callbacks.
NODISCARD CBL_CORE_API C4QueryEnumerator * c4queryobs_getEnumerator(C4QueryObserver *obs, bool forget, C4Error *error)
Returns the current query results, if any.
void(* C4QueryObserverCallback)(C4QueryObserver *observer, C4Query *query, void *context)
Callback invoked by a query observer, notifying that the query results have changed.
Definition c4Observer.h:167
CBL_CORE_API void c4dbobs_releaseChanges(C4CollectionChange changes[], uint32_t numChanges)
Releases the memory used by the C4CollectionChange structs (to hold the docID and revID strings....
Represents a change to a document in a collection, as returned from c4dbobs_getChanges.
Definition c4DocumentTypes.h:120
A struct to hold the results of a call to c4dbobs_getChanges.
Definition c4DocumentTypes.h:135
An error value.
Definition c4Error.h:133
A query result enumerator.
Definition c4QueryTypes.h:54
A simple reference to a block of memory.
Definition FLSlice.h:45