Skip to content

Object Life Times

Mario Bielert edited this page Dec 12, 2016 · 1 revision

Reader

The reader holds all read definitions in a net of smart pointers and containers. Also each event is kept alive until the callback returns to the reader object.

Definitions

Definitions are kept alive inside the reader, thus all definitions will be kept alive, from the their callback until the reader object dies. Also, after thedefinitions_done callback, all definitions are loaded.

Events

Event objects are kept alive until the end of the corresponding callback. Events itself only hold non-owning references to definitions.

Writer

The writer holds all definitions written to it in a number of containers.

Definitions

Every definition written to the writer (using writer::write(Def)) will be kept alive until the writer is closed.

Events

Events won't be kept alive from the writer. As they only hold non-owning references to definitions, every referenced definition should be written to the writer prior to referencing it in an event. (OR every referenced definition must be kept alive until the event was written, which may turn out tricky.)

Clone this wiki locally