Make parent parameters const for some object creation functions
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 13 Feb 2019 17:13:26 +0000 (12:13 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commit58085ca4d234fafe66bf875c32364598e180eafa
tree2f0a3ec0fce8d450753b7ad978cd32dd8aa5eae5
parent4237f1f2ad5a6745990fa5511169b8d088e94541
Make parent parameters const for some object creation functions

The goal of this patch is for a filter message iterator to be able to
create new messages with existing streams, packets, or clock classes
(not created by itself). This can be used to replace an original message
by a similar one, but slightly different.

One use case is `flt.utils.trimmer` which potentially needs to remove
original stream activity beginning/end messages and insert its own ones
to represent the trimming time range. `flt.utils.trimmer` also needs to
change the beginning and end times of discarded events/packets messages,
which it can do now by creating new messages using the original stream.

We cannot apply this to something like bt_stream_create() (making the
stream class and trace parameters const) because a stream has a parent
(trace object), therefore clashes could exist if any filter can add a
new stream to a trace which it did not create. Events, packets, and
messages have no parent.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
19 files changed:
include/babeltrace/graph/message-discarded-events.h
include/babeltrace/graph/message-discarded-packets.h
include/babeltrace/graph/message-event.h
include/babeltrace/graph/message-inactivity.h
include/babeltrace/graph/message-packet-beginning.h
include/babeltrace/graph/message-packet-end.h
include/babeltrace/graph/message-stream-activity-beginning.h
include/babeltrace/graph/message-stream-activity-end.h
include/babeltrace/graph/message-stream-beginning.h
include/babeltrace/graph/message-stream-end.h
include/babeltrace/trace-ir/packet.h
lib/graph/message/discarded-items.c
lib/graph/message/event.c
lib/graph/message/inactivity.c
lib/graph/message/packet.c
lib/graph/message/stream-activity.c
lib/graph/message/stream.c
lib/trace-ir/clock-snapshot.c
lib/trace-ir/packet.c
This page took 0.026186 seconds and 4 git commands to generate.