In the CTF writer API, a Stream object may only
be created using Writer.create_stream(), therefore
rendering Stream.__init__() useless for the user,
since the resulting object is not, and cannot, be
associated with a Writer object.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
raise ValueError("Failed to set packet context type.")
class Stream:
- def __init__(self, stream_class):
- """
- Create a stream of the given class.
- """
-
- if not isinstance(stream_class, CTFWriter.StreamClass):
- raise TypeError("Invalid stream_class argument must be of type StreamClass.")
-
- self._s = nbt._bt_ctf_stream_create(stream_class._sc)
-
- if self._s is None:
- raise ValueError("Stream creation failed.")
+ def __init__(self):
+ raise NotImplementedError("Stream cannot be instantiated; use Writer.create_stream()")
def __del__(self):
nbt._bt_ctf_stream_put(self._s)