X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fstream-class-internal.h;h=a7c98266154852267bd0390a7e962a4f50b076a6;hb=e011d2c1930972adc9b85f2c4067c62c207fc4ff;hp=4338742e7688e21a20210236ca1fe287549a87b2;hpb=de3dd40e6fcad56e227f5fc8a8290fbaa88b4e07;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/stream-class-internal.h b/include/babeltrace/ctf-ir/stream-class-internal.h index 4338742e..a7c98266 100644 --- a/include/babeltrace/ctf-ir/stream-class-internal.h +++ b/include/babeltrace/ctf-ir/stream-class-internal.h @@ -31,27 +31,34 @@ #include #include #include -#include +#include #include -#include +#include +#include #include struct bt_ctf_stream_class { - struct bt_ctf_base base; + struct bt_object base; GString *name; struct bt_ctf_clock *clock; GPtrArray *event_classes; /* Array of pointers to bt_ctf_event_class */ + /* event class id (int64_t) to event class */ + GHashTable *event_classes_ht; int id_set; - uint32_t id; - uint32_t next_event_id; - uint32_t next_stream_id; - /* Weak reference; a stream class does not have ownership of a trace */ - struct bt_ctf_trace *trace; + int64_t id; + int64_t next_event_id; + int64_t next_stream_id; struct bt_ctf_field_type *packet_context_type; struct bt_ctf_field_type *event_header_type; struct bt_ctf_field_type *event_context_type; int frozen; int byte_order; + + /* + * This flag indicates if the stream class is valid. A valid + * stream class is _always_ frozen. + */ + int valid; }; BT_HIDDEN @@ -62,20 +69,30 @@ int bt_ctf_stream_class_serialize(struct bt_ctf_stream_class *stream_class, struct metadata_context *context); BT_HIDDEN -int bt_ctf_stream_class_set_byte_order(struct bt_ctf_stream_class *stream_class, - enum bt_ctf_byte_order byte_order); +void bt_ctf_stream_class_set_byte_order( + struct bt_ctf_stream_class *stream_class, int byte_order); /* Set stream_class id without checking if the stream class is frozen */ BT_HIDDEN -int _bt_ctf_stream_class_set_id(struct bt_ctf_stream_class *stream_class, - uint32_t id); +void _bt_ctf_stream_class_set_id(struct bt_ctf_stream_class *stream_class, + int64_t id); BT_HIDDEN int bt_ctf_stream_class_set_id_no_check( - struct bt_ctf_stream_class *stream_class, uint32_t id); + struct bt_ctf_stream_class *stream_class, int64_t id); BT_HIDDEN -int bt_ctf_stream_class_set_trace(struct bt_ctf_stream_class *stream_class, - struct bt_ctf_trace *trace); +int bt_ctf_stream_class_map_clock_class( + struct bt_ctf_stream_class *stream_class, + struct bt_ctf_field_type *packet_context_type, + struct bt_ctf_field_type *event_header_type); + +static inline +struct bt_ctf_trace *bt_ctf_stream_class_borrow_trace( + struct bt_ctf_stream_class *stream_class) +{ + assert(stream_class); + return (void *) bt_object_borrow_parent(stream_class); +} #endif /* BABELTRACE_CTF_IR_STREAM_CLASS_INTERNAL_H */