X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Fcondition%2Fevaluation-internal.hpp;fp=include%2Flttng%2Fcondition%2Fevaluation-internal.hpp;h=f74927c24b0c71d35c8b597dd3d39788c2a4edde;hp=0000000000000000000000000000000000000000;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hpb=4878de5c7deb512bbdac4fdfc498907efa06fb7c diff --git a/include/lttng/condition/evaluation-internal.hpp b/include/lttng/condition/evaluation-internal.hpp new file mode 100644 index 000000000..f74927c24 --- /dev/null +++ b/include/lttng/condition/evaluation-internal.hpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2017 Jérémie Galarneau + * + * SPDX-License-Identifier: LGPL-2.1-only + * + */ + +#ifndef LTTNG_EVALUATION_INTERNAL_H +#define LTTNG_EVALUATION_INTERNAL_H + +#include +#include +#include +#include +#include + +struct lttng_payload; +struct lttng_payload_view; + +typedef void (*evaluation_destroy_cb)(struct lttng_evaluation *evaluation); +typedef int (*evaluation_serialize_cb)( + const struct lttng_evaluation *evaluation, + struct lttng_payload *payload); + +struct lttng_evaluation_comm { + /* enum lttng_condition_type type */ + int8_t type; + char payload[]; +} LTTNG_PACKED; + +struct lttng_evaluation { + enum lttng_condition_type type; + evaluation_serialize_cb serialize; + evaluation_destroy_cb destroy; +}; + +void lttng_evaluation_init(struct lttng_evaluation *evaluation, + enum lttng_condition_type type); + +ssize_t lttng_evaluation_create_from_payload( + const struct lttng_condition *condition, + struct lttng_payload_view *view, + struct lttng_evaluation **evaluation); + +int lttng_evaluation_serialize(const struct lttng_evaluation *evaluation, + struct lttng_payload *payload); + +#endif /* LTTNG_EVALUATION_INTERNAL_H */