Motr  M0
FDMI filter evaluator description
Collaboration diagram for FDMI filter evaluator description:

Data Structures

struct  m0_fdmi_flt_operands
 
struct  m0_fdmi_eval_ctx
 
struct  m0_fdmi_eval_var_info
 

Typedefs

typedef int(* m0_fdmi_flt_op_cb_t) (struct m0_fdmi_flt_operands *opnds, struct m0_fdmi_flt_operand *res)
 

Functions

M0_INTERNAL void m0_fdmi_eval_init (struct m0_fdmi_eval_ctx *ctx)
 
M0_INTERNAL int m0_fdmi_eval_add_op_cb (struct m0_fdmi_eval_ctx *ctx, enum m0_fdmi_flt_op_code op, m0_fdmi_flt_op_cb_t cb)
 
M0_INTERNAL void m0_fdmi_eval_del_op_cb (struct m0_fdmi_eval_ctx *ctx, enum m0_fdmi_flt_op_code op)
 
M0_INTERNAL int m0_fdmi_eval_flt (struct m0_fdmi_eval_ctx *ctx, struct m0_conf_fdmi_filter *filter, struct m0_fdmi_eval_var_info *var_info)
 
M0_INTERNAL void m0_fdmi_eval_fini (struct m0_fdmi_eval_ctx *ctx)
 

Detailed Description

See also
FDMI Functional Specification
FDMI filter expression public API

Typedef Documentation

◆ m0_fdmi_flt_op_cb_t

typedef int(* m0_fdmi_flt_op_cb_t) (struct m0_fdmi_flt_operands *opnds, struct m0_fdmi_flt_operand *res)

Function type, implementing some operation of FDMI filter tree

Definition at line 51 of file flt_eval.h.

Function Documentation

◆ m0_fdmi_eval_add_op_cb()

M0_INTERNAL int m0_fdmi_eval_add_op_cb ( struct m0_fdmi_eval_ctx ctx,
enum m0_fdmi_flt_op_code  op,
m0_fdmi_flt_op_cb_t  cb 
)

Add operation handler to the evaluator context

Can be used by FDMI sources to add operation handlers for data types, specific to these FDMI sources

Parameters
ctxFDMI filter evaluator context
opoperation code
cbHandler to be registered
Returns
0 on sucess, error code otherwise

Definition at line 101 of file flt_eval.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_fdmi_eval_del_op_cb()

M0_INTERNAL void m0_fdmi_eval_del_op_cb ( struct m0_fdmi_eval_ctx ctx,
enum m0_fdmi_flt_op_code  op 
)

Delete operation handler from the evaluator context

Parameters
ctxFDMI filter evaluator context
opoperation code
See also
m0_fdmi_eval_add_op_cb

Definition at line 119 of file flt_eval.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_fdmi_eval_fini()

M0_INTERNAL void m0_fdmi_eval_fini ( struct m0_fdmi_eval_ctx ctx)

Finalize FDMI evaluator

Parameters
ctxFDMI filter evaluator context

Definition at line 204 of file flt_eval.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_fdmi_eval_flt()

M0_INTERNAL int m0_fdmi_eval_flt ( struct m0_fdmi_eval_ctx ctx,
struct m0_conf_fdmi_filter filter,
struct m0_fdmi_eval_var_info var_info 
)

Evaluate filter expression tree value

Result of filter expression is always boolean.

Parameters
filterFDMI filter
ctxFDMI filter evaluator context
var_infoInformation about how to get value of variable nodes
Returns
<0, if some error occured,
0, if result of evaluation is False
1, if result of evaluation is True

Definition at line 184 of file flt_eval.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_fdmi_eval_init()

M0_INTERNAL void m0_fdmi_eval_init ( struct m0_fdmi_eval_ctx ctx)

Initialize FDMI filter evaluator context

Parameters
ctxFDMI filter evaluator context

Definition at line 130 of file flt_eval.c.

Here is the call graph for this function:
Here is the caller graph for this function: