Boost C++ Libraries

PrevUpHomeNext

Class bound_slot

boost::taar::cancellation_signals::bound_slot — Handle to a slot tied to an executor.

Synopsis

// In header: <boost/taar/core/cancellation_signals.hpp>



// Handle to a slot tied to an executor.

class bound_slot {
public:

  // public member functions
  bound_slot() = default;
  bound_slot(bound_slot &&);
  bound_slot & operator=(bound_slot &&) noexcept;
  bound_slot(bound_slot const &) = delete;
  bound_slot & operator=(bound_slot const &) = delete;
  ~bound_slot();
  boost::asio::cancellation_slot slot() const;
  void emit(boost::asio::cancellation_type = boost::asio::cancellation_type::all) const;
  void release();

  // private member functions
  bound_slot(std::shared_ptr< state >, std::shared_ptr< bound_record >);
};

Description

Destroying it removes the slot from the pool, so keep it alive for as long as the operation runs (typically by capturing it in the operation's completion handler).

bound_slot public member functions

  1. bound_slot() = default;
  2. bound_slot(bound_slot &&);
  3. bound_slot & operator=(bound_slot && other) noexcept;
  4. bound_slot(bound_slot const &) = delete;
  5. bound_slot & operator=(bound_slot const &) = delete;
  6. ~bound_slot();
  7. boost::asio::cancellation_slot slot() const;
    The cancellation slot to bind to the operation.
  8. void emit(boost::asio::cancellation_type ct = boost::asio::cancellation_type::all) const;
    Emit on this slot alone, dispatched through its executor.
  9. void release();
    Remove the slot from the pool now.

bound_slot private member functions

  1. bound_slot(std::shared_ptr< state > s, std::shared_ptr< bound_record > r);

PrevUpHomeNext