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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:37 +0000 (18:19 -0400)
commit6a6975d2be9be143a6b46ff5865b66bd9ba6fa2b
tree059232f3ebbbbc763fb266446665e6f8cbf1cbdb
parent2df5d26fbe0d7418b4cec4e5229ae1aba81b7b5a
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.026397 seconds and 4 git commands to generate.