Class shared_connection_block
boost::signalslib::shared_connection_block — Blocks a connection between a signal and a slot.
Synopsis
class shared_connection_block { public: // construct/copy/destruct shared_connection_block(boost::signalslib::connection &); ~shared_connection_block(); // connection blocking void unblock(); void block(); bool blocking() const; };
Description
A shared_connection_block object blocks a
connection, preventing the associated slot from executing when the
associated signal is invoked. The connection will remain
blocked until every shared_connection_block that references
the connection
releases its block. A shared_connection_block releases
its block when it is destroyed or its
unblock method is called.
A shared_connection_block is safe to use even
after the connection object it was constructed
from has been destroyed, or the connection it references has been
disconnected.
shared_connection_block
public
construct/copy/destruct
-
shared_connection_block(boost::signalslib::connection & conn);
Effects: Creates a
shared_connection_blockwhich references the connection referenced byconn. The connection will initially be blocked, and remain so until unblock is called, or theshared_connection_blockis destroyed.Postconditions: this->blocking() == true -
~shared_connection_block();
Effects: If blocking() is true, releases the connection block.
shared_connection_block connection blocking
-
void unblock();
Effects: If blocking() is true, releases the connection block. Note, the connection may remain blocked due to other
shared_connection_blockobjects.Postconditions: this->blocking() == false. -
void block();
Effects: If blocking() is false, reasserts a block on the connection.
Postconditions: this->blocking() == true. -
bool blocking() const;
Returns: trueifthisis asserting a block on the connection.Notes: this->blocking() == trueimpliesconnection::blocked() == truefor the connection. However,this->blocking() == falsedoes not necessarily implyconnection::blocked() == false, since the connection may be blocked by anothershared_connection_blockobject.