•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Search Results
mpqc::utility::Observable< Derived > Class Template Reference
Collaboration diagram for mpqc::utility::Observable< Derived >:

Documentation
template<typename Derived>
class mpqc::utility::Observable< Derived >
helps to set up messaging between objects via the Observer pattern
Use as a base class for any class that wants to send messages to other recipients. Recipients register callbacks by calling Observable::register_message .
Public Types | |
typedef std::map< void *, std::function< void()> > messages_type | |
Public Member Functions | |
template<typename Observer > | |
std::shared_ptr< void *const > register_message (Observer *observer, std::function< void()> message) const | |
![]() | |
virtual ~enable_shared_from_this ()=default | |
std::shared_ptr< Derived > shared_from_this () | |
returns the pointer to this object More... | |
std::shared_ptr< std::add_const_t< Derived > > shared_from_this () const | |
returns the pointer to this object More... | |
![]() | |
virtual ~virt_base_of_enable_shared_from_this ()=default | |
bool shared_from_this_possible () const | |
template<typename Target , typename = std::enable_if_t<!std::is_const_v<Target>>> | |
std::shared_ptr< Target > cast_shared_from_this_to () | |
returns the pointer to this cast to a particular type More... | |
template<typename Target > | |
std::shared_ptr< std::add_const_t< Target > > cast_shared_from_this_to () const | |
returns the pointer to this cast to a particular type More... | |
Protected Member Functions | |
void message () | |
Member Typedef Documentation
◆ messages_type
template<typename Derived >
typedef std::map<void *, std::function<void()> > mpqc::utility::Observable< Derived >::messages_type |
Member Function Documentation
◆ message()
template<typename Derived >
|
inlineprotected |
◆ register_message()
template<typename Derived >
template<typename Observer >
|
inline |
adds a message to the list, returns a receipt that the observer needs to destroy at the end of its life (i.e., in the dtor).
The documentation for this class was generated from the following file:
- mpqc/util/misc/observer.h