|
SObjectizer 5.8
|
Interface for holders of message_sink instances. More...
#include <message_sink.hpp>
Public Member Functions | |
| abstract_sink_owner_t ()=default | |
| virtual | ~abstract_sink_owner_t () noexcept=default |
| virtual abstract_message_sink_t & | sink () noexcept=0 |
| Get a reference to the underlying message sink. | |
| virtual const abstract_message_sink_t & | sink () const noexcept=0 |
| Get a const reference to the underlying message sink. | |
Friends | |
| class | intrusive_ptr_t< abstract_sink_owner_t > |
Additional Inherited Members | |
Protected Member Functions inherited from so_5::atomic_refcounted_t | |
| atomic_refcounted_t (const atomic_refcounted_t &)=delete | |
| atomic_refcounted_t & | operator= (const atomic_refcounted_t &)=delete |
| atomic_refcounted_t () noexcept | |
| Default constructor. | |
| ~atomic_refcounted_t () noexcept=default | |
| Destructor. | |
| void | inc_ref_count () noexcept |
| Increments reference count. | |
| unsigned long | dec_ref_count () noexcept |
| Decrement reference count. | |
Interface for holders of message_sink instances.
There is mbox_t, which is a kind of smart pointer to abstract_message_box_t. It's a very useful type that allows to hold references to message boxes safely. But mbox_t exists because all message boxes should be dynamically allocated objects. The situation with message sinks is a bit more complicated. Not all message sinks are dynamically allocated, some may be parts of other objects. But if a message sink is dynamically allocated then it's good to have something like mbox_t, but for message sinks.
The type abstract_sink_owner_t is a proxy for a real message sink object. Instances of abstract_sink_owner_t are always allocated dynamically. They can hold real message sinks as members (in this case abstract_sink_owner lives on the heap and the message sink lives inside it), or they can hold references to message sinks that live elsewhere.
The presence of abstract_sink_owner_t allows to have msink_t type, which is very similar to mbox_t.
Note that the abstract_sink_owner_t is an abstract class. The real implementations of sink owners must be derived from this class.
Definition at line 191 of file message_sink.hpp.
|
default |
|
virtualdefaultnoexcept |
|
nodiscardpure virtualnoexcept |
Get a const reference to the underlying message sink.
Implemented in so_5::simple_sink_owner_t< Sink_Type >.
|
nodiscardpure virtualnoexcept |
Get a reference to the underlying message sink.
Implemented in so_5::simple_sink_owner_t< Sink_Type >.
|
friend |
Definition at line 139 of file message_sink.hpp.