31#ifndef ETL_SHARED_MESSAGE_INCLUDED
32#define ETL_SHARED_MESSAGE_INCLUDED
36#include "reference_counted_message.h"
40#include "static_assert.h"
66 template <
typename TPool,
typename TMessage>
72 p_rcmessage = owner.allocate(
message);
74 if (p_rcmessage != ETL_NULLPTR)
92 if (p_rcmessage != ETL_NULLPTR)
113 : p_rcmessage(
other.p_rcmessage)
123 : p_rcmessage(etl::move(
other.p_rcmessage))
125 other.p_rcmessage = ETL_NULLPTR;
143 p_rcmessage =
other.p_rcmessage;
165 p_rcmessage = etl::move(other.p_rcmessage);
166 other.p_rcmessage = ETL_NULLPTR;
179 if ((p_rcmessage != ETL_NULLPTR) &&
215 return p_rcmessage != ETL_NULLPTR;
Definition reference_counted_message.h:48
virtual ETL_NODISCARD etl::ireference_counter & get_reference_counter()=0
Get a reference to the reference counter.
virtual ETL_NODISCARD etl::imessage & get_message()=0
Get a reference to the message.
virtual void release()=0
Release back to the owner.
Definition shared_message.h:49
ETL_NODISCARD bool is_valid() const
Checks if the shared message is valid.
Definition shared_message.h:213
ETL_NODISCARD uint32_t get_reference_count() const
Get the current reference count for this shared message.
Definition shared_message.h:205
ETL_NODISCARD etl::imessage & get_message()
Get a reference to the contained message.
Definition shared_message.h:189
shared_message(const etl::shared_message &other)
Copy constructor.
Definition shared_message.h:112
~shared_message()
Definition shared_message.h:177
ETL_NODISCARD const etl::imessage & get_message() const
Get a const reference to the contained message.
Definition shared_message.h:197
shared_message(etl::ireference_counted_message &rcm)
Constructor.
Definition shared_message.h:102
shared_message(TPool &owner, const TMessage &message)
Constructor.
Definition shared_message.h:67
shared_message & operator=(const etl::shared_message &other)
Copy assignment operator.
Definition shared_message.h:132
is_base_of
Definition type_traits_generator.h:1252
bitset_ext
Definition absolute.h:38
T * create(Args &&... args)
Creates the object from a type. Variadic parameter constructor.
Definition variant_pool_generator.h:348
pair holds two objects of arbitrary type
Definition utility.h:164