|
Ardour
9.0-rc2-125-gf6351399c3
|
#include <signals.h>
Public Types | |
| typedef std::function< R(A...)> | slot_function_type |
Public Member Functions | |
| ~SignalWithCombiner () | |
| void | connect_same_thread (ScopedConnection &c, const slot_function_type &slot) |
| void | connect_same_thread (ScopedConnectionList &clist, const slot_function_type &slot) |
| void | connect (ScopedConnectionList &clist, PBD::EventLoop::InvalidationRecord *ir, const slot_function_type &slot, PBD::EventLoop *event_loop) |
| void | connect (ScopedConnection &c, PBD::EventLoop::InvalidationRecord *ir, const slot_function_type &slot, PBD::EventLoop *event_loop) |
| std::conditional_t< std::is_void_v< R >, R, typename Combiner::result_type > | operator() (A... a) |
| bool | empty () const |
| size_t | size () const |
Public Member Functions inherited from PBD::SignalBase | |
| SignalBase () | |
| virtual | ~SignalBase () |
| void | set_debug_connection (bool yn) |
| void | set_debug_emission (bool yn) |
Static Public Member Functions | |
| static void | compositor (typename std::function< void(A...)> f, EventLoop *event_loop, EventLoop::InvalidationRecord *ir, A... a) |
Private Types | |
| typedef std::map< std::shared_ptr< Connection >, slot_function_type > | Slots |
Private Member Functions | |
| std::shared_ptr< Connection > | _connect (PBD::EventLoop::InvalidationRecord *ir, slot_function_type f) |
| void | disconnect (std::shared_ptr< Connection > c) |
Private Attributes | |
| Slots | _slots |
Friends | |
| class | Connection |
Additional Inherited Members | |
Protected Attributes inherited from PBD::SignalBase | |
| Glib::Threads::Mutex | _mutex |
| std::atomic< bool > | _in_dtor |
| bool | _debug_connection |
| bool | _debug_emission |
| typedef std::function<R(A...)> PBD::SignalWithCombiner< Combiner, R(A...)>::slot_function_type |
|
private |
| PBD::SignalWithCombiner< Combiner, R(A...)>::~SignalWithCombiner |
|
private |
|
static |
| void PBD::SignalWithCombiner< Combiner, R(A...)>::connect | ( | ScopedConnection & | c, |
| PBD::EventLoop::InvalidationRecord * | ir, | ||
| const slot_function_type & | slot, | ||
| PBD::EventLoop * | event_loop | ||
| ) |
See notes for the ScopedConnectionList variant of this function. This differs in that it stores the connection to the signal in a single ScopedConnection rather than a ScopedConnectionList.
| void PBD::SignalWithCombiner< Combiner, R(A...)>::connect | ( | ScopedConnectionList & | clist, |
| PBD::EventLoop::InvalidationRecord * | ir, | ||
| const slot_function_type & | slot, | ||
| PBD::EventLoop * | event_loop | ||
| ) |
Arrange for slot to be executed in the context of event_loop whenever this signal is emitted. Add the connection that represents this arrangement to clist.
If the event loop/thread in which slot will be executed will outlive the lifetime of any object referenced in slot, then an InvalidationRecord should be passed, allowing any request sent to the event_loop and not executed before the object is destroyed to be marked invalid.
"outliving the lifetime" doesn't have a specific, detailed meaning, but is best illustrated by two contrasting examples:
1) the main GUI event loop/thread - this will outlive more or less all objects in the application, and thus when arranging for slot to be called in that context, an invalidation record is highly advisable.
2) a secondary event loop/thread which will be destroyed along with the objects that are typically referenced by slot. Assuming that the event loop is stopped before the objects are destroyed, there is no reason to pass in an invalidation record, and MISSING_INVALIDATOR may be used.
| void PBD::SignalWithCombiner< Combiner, R(A...)>::connect_same_thread | ( | ScopedConnection & | c, |
| const slot_function_type & | slot | ||
| ) |
| void PBD::SignalWithCombiner< Combiner, R(A...)>::connect_same_thread | ( | ScopedConnectionList & | clist, |
| const slot_function_type & | slot | ||
| ) |
|
privatevirtual |
Implements PBD::SignalBase.
|
inline |
| std::conditional_t< std::is_void_v< R >, R, typename Combiner::result_type > PBD::SignalWithCombiner< Combiner, R(A...)>::operator() | ( | A... | a | ) |
If R is any kind of void type, then operator() return type must be R, else it must be Combiner::result_type.
Emit this signal. This will cause all slots connected to it be executed in the order that they were connected (cross-thread issues may alter the precise execution time of cross-thread slots).
|
inline |
|
friend |
|
private |