ownedMessage
Functions
-
template<typename Payload>
void addOwnedMessage(std::vector<std::unique_ptr<Message<Payload>>> &owners, std::vector<Message<Payload>*> &views) Append a new owned message and a borrowed pointer to it.
Note
If message construction or either insertion throws, both vectors retain their previous sizes and entries. Vector capacity may change. Exceptions are propagated after releasing any newly created message.
Note
Existing message addresses remain stable when either vector grows. The owner must outlive all uses of its borrowed messages. The views may contain only a subset of the messages in owners, as in nested output collections.
- Template Parameters:
Payload – Message payload type.
- Parameters:
owners – Storage that owns the messages and controls their lifetime.
views – Borrowed message pointers exposed to consumers.