Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.
Class scoped_connection
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore

Class scoped_connection

boost::signals::scoped_connection — Limits a signal-slot connection lifetime to a particular scope.

Synopsis

class scoped_connection : private noncopyable   // Exposition only
{
public:
  // construct/copy/destruct
  scoped_connection(const connection&);
  ~scoped_connection();

  // connection management
  void disconnect() const;
  bool connected() const;
};

Description

scoped_connection construct/copy/destruct

  1. scoped_connection(const connection& other);

    Effects: this references the connection referenced by other.
    Throws: Will not throw.

  2. ~scoped_connection();

    Effects: If this->connected(), disconnects the signal-slot connection.

scoped_connection connection management

  1. void disconnect() const;

    Effects: If this->connected(), disconnects the signal and slot referenced by this; otherwise, this operation is a no-op.
    Postconditions: !this->connected().

  2. bool connected() const;

    Returns: true if this references a non-NULL connection that is still active (connected), and false otherwise.
    Throws: Will not throw.

Last revised: , at GMTCopyright © 2001-2003 Douglas Gregor