-
Notifications
You must be signed in to change notification settings - Fork 5
Object Life Times
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 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.
Event objects are kept alive until the end of the corresponding callback. Events itself only hold non-owning references to definitions.
The writer holds all definitions written to it in a number of containers.
Every definition written to the writer (using writer::write(Def)) will be kept alive until the writer is closed.
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.)