LiteCore
Couchbase Lite cross-platform core implementation
|
Configuration struct for registering a predictive model. More...
#include <c4PredictiveQuery.h>
Data Fields | |
void * | context |
A pointer to any external data needed by the prediction callback, which will receive this as its first parameter. | |
C4SliceResult(* | prediction )(void *context, FLDict input, C4Database *database, C4Error *error) |
Called from within a query (or document indexing) to run the prediction. | |
void(* | unregistered )(void *context) |
Called if the model is unregistered, so it can release resources. | |
Configuration struct for registering a predictive model.
void* C4PredictiveModel::context |
A pointer to any external data needed by the prediction
callback, which will receive this as its first parameter.
C4SliceResult(* C4PredictiveModel::prediction) (void *context, FLDict input, C4Database *database, C4Error *error) |
Called from within a query (or document indexing) to run the prediction.
context | The value of the C4PredictiveModel's context field; typically a pointer to external data needed by the implementation. |
input | The input dictionary from the query. |
database | The database being queried. DO NOT use this reference to write to documents or to run queries! |
error | Store an error here on failure. It is NOT a failure for input parameters to be missing or the wrong type, since this can easily happen when the query reaches a document that doesn't contain input data, or if the document's schema is incorrect. This should not abort the entire query! Instead just return a null slice. |
void(* C4PredictiveModel::unregistered) (void *context) |
Called if the model is unregistered, so it can release resources.