Couchbase Lite C
Couchbase Lite C API
Data Fields
CBLPredictiveModel Struct Reference

Predictive Model
More...

#include <cbl/CBLPrediction.h>

Data Fields

void *_cbl_nullable context
 A pointer to any external data needed by the prediction callback, which will receive this as its first parameter. More...
 
FLMutableDict _cbl_nullable(* prediction )(void *_cbl_nullable context, FLDict input)
 Prediction callback, called from within a query (or document indexing) to run the prediction. More...
 
void(* _cbl_nullable )(void *context)
 Unregistered callback, called if the model is unregistered, so it can release resources. More...
 

Detailed Description

Predictive Model

Field Documentation

◆ _cbl_nullable

void(* CBLPredictiveModel::_cbl_nullable) (void *context)

Unregistered callback, called if the model is unregistered, so it can release resources.

◆ context

void* _cbl_nullable CBLPredictiveModel::context

A pointer to any external data needed by the prediction callback, which will receive this as its first parameter.

◆ prediction

FLMutableDict _cbl_nullable(* CBLPredictiveModel::prediction) (void *_cbl_nullable context, FLDict input)

Prediction callback, called from within a query (or document indexing) to run the prediction.

Parameters
contextThe value of the CBLPredictiveModel's context field.
inputThe input dictionary from the query.
Returns
The output of the prediction function as an FLMutableDict, or NULL if there is no output.
Note
The output FLMutableDict will be automatically released after the prediction callback is called.
Warning
This function must be "pure": given the same input parameters it must always produce the same output (otherwise indexes or queries may be messed up). It MUST NOT alter the database or any documents, nor run a query: either of those are very likely to cause a crash.

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