X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-writer%2Fevent.h;fp=include%2Fbabeltrace%2Fctf-writer%2Fevent.h;h=0928e083362c61bf9e597265f044db4a87907001;hb=8c18d80b69a10f94980d33e6f1c1bdb26b447487;hp=fc7ec5d574cf98f2ebb84398998e886ea21fd548;hpb=faec0807cd032e833756c134daecb3668a780cf9;p=babeltrace.git diff --git a/include/babeltrace/ctf-writer/event.h b/include/babeltrace/ctf-writer/event.h index fc7ec5d5..0928e083 100644 --- a/include/babeltrace/ctf-writer/event.h +++ b/include/babeltrace/ctf-writer/event.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_EVENT_H +#define BABELTRACE_CTF_WRITER_EVENT_H + /* * BabelTrace - CTF Writer: Event * @@ -29,3 +32,51 @@ #include #include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bt_ctf_event_get and bt_ctf_event_put: increment and decrement + * the event's reference count. + * + * You may also use bt_ctf_get() and bt_ctf_put() with event objects. + * + * These functions ensure that the event won't be destroyed while it + * is in use. The same number of get and put (plus one extra put to + * release the initial reference done at creation) have to be done to + * destroy an event. + * + * When the event's reference count is decremented to 0 by a + * bt_ctf_event_put, the event is freed. + * + * @param event Event instance. + */ +extern void bt_ctf_event_get(struct bt_ctf_event *event); +extern void bt_ctf_event_put(struct bt_ctf_event *event); + +/* + * bt_ctf_event_class_get and bt_ctf_event_class_put: increment and decrement + * the event class' reference count. + * + * You may also use bt_ctf_get() and bt_ctf_put() with event class objects. + * + * These functions ensure that the event class won't be destroyed while it + * is in use. The same number of get and put (plus one extra put to + * release the initial reference done at creation) have to be done to + * destroy an event class. + * + * When the event class' reference count is decremented to 0 by a + * bt_ctf_event_class_put, the event class is freed. + * + * @param event_class Event class. + */ +extern void bt_ctf_event_class_get(struct bt_ctf_event_class *event_class); +extern void bt_ctf_event_class_put(struct bt_ctf_event_class *event_class); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_CTF_WRITER_EVENT_H */