From f763a99a501650eff2c60288aa6f10ef916d769e Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 6 Oct 2016 10:41:18 +0900 Subject: Imported Upstream version 1.62.0 Change-Id: I9d4c1ddb7b7d8f0069217ecc582700f9fda6dd4c Signed-off-by: DongHun Kwak --- doc/html/signals2/api_changes.html | 34 +++++----- doc/html/signals2/examples.html | 12 ++-- doc/html/signals2/faq.html | 20 +++--- doc/html/signals2/rationale.html | 64 +++++++++---------- doc/html/signals2/reference.html | 16 ++--- doc/html/signals2/tests.html | 12 ++-- doc/html/signals2/thread-safety.html | 26 ++++---- doc/html/signals2/tutorial.html | 118 +++++++++++++++++------------------ 8 files changed, 152 insertions(+), 150 deletions(-) (limited to 'doc/html/signals2') diff --git a/doc/html/signals2/api_changes.html b/doc/html/signals2/api_changes.html index c50771ff56..e7ea4805ac 100644 --- a/doc/html/signals2/api_changes.html +++ b/doc/html/signals2/api_changes.html @@ -4,9 +4,9 @@ Signals2 API Changes - + - + @@ -26,7 +26,7 @@

Signals2 API Changes

-
+ @@ -37,7 +37,7 @@ library are summarized below. We also provide some notes on dealing with each change while porting existing Boost.Signals code to Boost.Signals2.

-
    +
    • The namespace boost::signals has been replaced by boost::signals2 to avoid conflict with the original Boost.Signals implementation, as well as the Qt "signals" macro. @@ -73,7 +73,7 @@

      Automatic connection management is now achieved through the use of shared_ptr/weak_ptr - and signals2::slot::track(), as described in the + and signals2::slot::track(), as described in the tutorial. However, the old (thread-unsafe) Boost.Signals scheme of automatic connection management is still supported via the boost::signals2::trackable class. @@ -107,7 +107,7 @@ move the connection creation from the constructor to to the an adl_postconstruct function, where a reference to the owning shared_ptr is available for - passing to signals2::slot::track. + passing to signals2::slot::track. The deconstruct function would be used create objects of the class and run their associated adl_postconstruct function. You can enforce use of deconstruct by @@ -161,7 +161,7 @@

      The signals2::signal class has an additional typedef signals2::signal::extended_slot_type - and new signals2::signal::connect_extended() + and new signals2::signal::connect_extended() methods. These allow connection of slots which take an additional signals2::connection argument, giving them thread-safe access to their signal/slot connection when they are invoked. There is also a @@ -174,7 +174,7 @@ if you have slots which need access to their signals2::connection to the signal invoking them (for example to block or disconnect their connection) you may wish to connect the slots with - signals2::signal::connect_extended(). + signals2::signal::connect_extended(). This also requires adding an additional connection argument to the slot. More information on how and why to use extended slots is available in the tutorial. @@ -197,14 +197,14 @@

    • The signal::combiner() method, which formerly returned a reference to the - signal's combiner has been replaced by signals2::signal::combiner - (which now returns the combiner by value) and signals2::signal::set_combiner. + signal's combiner has been replaced by signals2::signal::combiner + (which now returns the combiner by value) and signals2::signal::set_combiner.

      During porting it should be straightforward to replace uses of the old reference-returning signal::combiner() - function with the new "by-value" signals2::signal::combiner - and signals2::signal::set_combiner functions. + function with the new "by-value" signals2::signal::combiner + and signals2::signal::set_combiner functions. However, you will need to inspect each call of the combiner method in your code to determine if your program logic has been broken by the changed return type. @@ -248,7 +248,7 @@

      Signals2 API Development

      -
      +
      Version 1.56
      Version 1.45
      Version 1.40
      @@ -271,7 +271,7 @@

      Version 1.45

      - Version 1.45 added slot::track_foreign(). This method allows tracking + Version 1.45 added slot::track_foreign(). This method allows tracking of objects owned by shared_ptr classes other than boost::shared_ptr, for example std::shared_ptr.

      @@ -283,7 +283,7 @@ Version 1.40 adds a few new features to the shared_connection_block class to make it more flexible:

      -
        +
        • shared_connection_block is now default constructible.

        • @@ -292,7 +292,7 @@ immediately blocking its connection.

        • - The shared_connection_block::connection() query has been + The shared_connection_block::connection() query has been added, to provide access to the shared_connection_blocks associated connection.

        • @@ -311,7 +311,7 @@ variadic templates (i.e. BOOST_NO_CXX11_VARIADIC_TEMPLATES is defined by Boost.Config).

          -
            +
            • The "portable syntax" signal and slot classes, i.e. signals2::signal0, signal1, etc.

            • diff --git a/doc/html/signals2/examples.html b/doc/html/signals2/examples.html index f5b9efc254..e1b9689027 100644 --- a/doc/html/signals2/examples.html +++ b/doc/html/signals2/examples.html @@ -4,9 +4,9 @@ Example programs - + - + @@ -26,7 +26,7 @@

              Example programs

              -
              +
              Miscellaneous Tutorial Examples
              Document-View
              Postconstructors and Predestructors with deconstruct()
              @@ -34,7 +34,7 @@

              Miscellaneous Tutorial Examples

              -
              +
              hello_world_slot
              hello_world_multi_slot
              ordering_slots
              @@ -149,7 +149,7 @@

              Document-View

              -
              +
              doc_view
              doc_view_acm
              doc_view_acm_deconstruct
              @@ -194,7 +194,7 @@

              Postconstructors and Predestructors with deconstruct()

              -
              +
              postconstructor_ex1
              postconstructor_ex2
              predestructor_example
              diff --git a/doc/html/signals2/faq.html b/doc/html/signals2/faq.html index d7f8016710..020169240a 100644 --- a/doc/html/signals2/faq.html +++ b/doc/html/signals2/faq.html @@ -4,9 +4,9 @@ Frequently Asked Questions - + - + @@ -27,20 +27,22 @@

              Frequently Asked Questions

              -
              -
              1. Don't noncopyable signal semantics mean that a class +
              +
              1. Don't noncopyable signal semantics mean that a class with a signal member will be noncopyable as well?
              -
              2. Is Boost.Signals2 thread-safe? +
              2. Is Boost.Signals2 thread-safe?
              - +
              ++ @@ -55,7 +57,7 @@ @@ -69,7 +71,7 @@ with signal invocation, you will need to use automatic connection management. That is, the objects will need to be owned by shared_ptr and passed to the slot's - track() method before the slot is connected. + track() method before the slot is connected. The signals2::trackable scheme of automatic connection management is NOT thread-safe, and is only provided to ease porting of single-threaded code from Boost.Signals to Boost.Signals2. diff --git a/doc/html/signals2/rationale.html b/doc/html/signals2/rationale.html index 8b061bc956..4b283787d5 100644 --- a/doc/html/signals2/rationale.html +++ b/doc/html/signals2/rationale.html @@ -4,9 +4,9 @@ Design Rationale - + - + @@ -26,18 +26,18 @@

              Users need to have fine control over the connection of signals to slots and their eventual disconnection. The primary approach taken by Boost.Signals2 is to return a @@ -45,14 +45,14 @@ connected/disconnected query, manual disconnection, and an automatic disconnection on destruction mode (signals2::scoped_connection). In addition, two other interfaces are supported by the - signal::disconnect overloaded method:

              -
                + signal::disconnect overloaded method:

                +
                • Pass slot to disconnect: in this interface model, the disconnection of a slot connected with - sig.connect(typeof(sig)::slot_type(slot_func)) is + sig.connect(typeof(sig)::slot_type(slot_func)) is performed via - sig.disconnect(slot_func). Internally, + sig.disconnect(slot_func). Internally, a linear search using slot comparison is performed and the slot, if found, is removed from the list. Unfortunately, querying connectedness ends up as a @@ -64,7 +64,7 @@ slots to be arbitrary function objects. While this approach is essentially equivalent to the connection approach taken by Boost.Signals2, it is possibly more error-prone for several reasons:

                  -
                    +
                    • Connections and disconnections must be paired, so the problem becomes similar to the problems incurred when pairing new and delete for @@ -80,14 +80,14 @@

                    This type of interface is supported in Boost.Signals2 via the slot grouping mechanism, and the overload of - signal::disconnect + signal::disconnect which takes an argument of the signal's Group type.

                -Automatic Connection Management

                +Automatic Connection Management

              Automatic connection management in Signals2 depends on the use of boost::shared_ptr to manage the lifetimes of tracked objects. This is differs from @@ -129,7 +129,7 @@

              -optional_last_value as the Default Combiner

              +optional_last_value as the Default Combiner

              The default combiner for Boost.Signals2 has changed from the last_value combiner used by default in the original Boost.Signals library. @@ -145,7 +145,7 @@

              -Combiner Interface

              +Combiner Interface

              The Combiner interface was chosen to mimic a call to an algorithm in the C++ standard library. It is felt that by viewing slot call results as merely a sequence of values accessed by input @@ -273,14 +273,14 @@ private:

              -Connection Interfaces: += operator

              +Connection Interfaces: += operator

              Boost.Signals2 supports a connection syntax with the form - sig.connect(slot), but a + sig.connect(slot), but a more terse syntax sig += slot has been suggested (and has been used by other signals & slots implementations). There are several reasons as to why this syntax has been rejected:

              -
                +
                • It's unnecessary: the connection syntax supplied by Boost.Signals2 is no less powerful that that supplied by the += @@ -313,7 +313,7 @@ private:

                -Signals2 Mutex Classes

                +Signals2 Mutex Classes

              The Boost.Signals2 library provides 2 mutex classes: boost::signals2::mutex, and boost::signals2::dummy_mutex. The motivation for providing @@ -331,14 +331,14 @@ private:

              -Comparison with other Signal/Slot implementations

              -
              -
              libsigc++
              -
              .NET delegates
              +Comparison with other Signal/Slot implementations
              +

              -libsigc++

              +libsigc++

              libsigc++ is a C++ signals & slots library that originally started as part of an initiative to wrap the C interfaces to GTK libraries in C++, and has @@ -350,7 +350,7 @@ private: connections. There are some major differences in design that separate these libraries:

              -
                +
                • Slot definitions: slots in libsigc++ are created using a set of primitives defined by the library. These primitives allow binding of @@ -368,14 +368,14 @@ private:

                -.NET delegates

                +.NET delegates

              Microsoft has introduced the .NET Framework and an associated set of languages and language extensions, one of which is the delegate. Delegates are similar to signals and slots, but they are more limited than most C++ signals and slots implementations in that they:

              -
                +
                • Require exact type matches between a delegate and what it is calling.

                • Only return the result of the last target called, with no option for customization.

                • diff --git a/doc/html/signals2/reference.html b/doc/html/signals2/reference.html index 446c431ccb..4efe8e2d18 100644 --- a/doc/html/signals2/reference.html +++ b/doc/html/signals2/reference.html @@ -4,9 +4,9 @@ Reference - + - + @@ -26,7 +26,7 @@

                  Reference

                  -
                  +
                  Header <boost/signals2.hpp>
                  Header <boost/signals2/connection.hpp>
                  Header <boost/signals2/deconstruct.hpp>
                  @@ -56,7 +56,7 @@
                  namespace boost {
                     namespace signals2 {
                       class connection;
                  -    void swap(connection&, connection&);
                  +    void swap(connection&, connection&);
                       class scoped_connection;
                     }
                   }
                  @@ -95,7 +95,7 @@ namespace signals2 { template<typename T> class last_value; - template<> class last_value<void>; + template<> class last_value<void>; class no_slots_error; } @@ -117,7 +117,7 @@ namespace signals2 { template<typename T> class optional_last_value; - template<> class optional_last_value<void>; + template<> class optional_last_value<void>; } }
                  @@ -148,7 +148,7 @@ template<typename Signature, typename Combiner, typename Group, typename GroupCompare, typename SlotFunction, typename ExtendedSlotFunction, typename Mutex> - void swap(signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>&, + void swap(signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>&, signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>&); } } @@ -180,7 +180,7 @@ template<typename Group> class group_type; template<typename GroupCompare> class group_compare_type; template<typename SlotFunction> class slot_function_type; - template<typename ExtendedSlotFunction> class extended_slot_function_type; + template<typename ExtendedSlotFunction> class extended_slot_function_type; template<typename Mutex> class mutex_type; } } diff --git a/doc/html/signals2/tests.html b/doc/html/signals2/tests.html index 8e1077d4fe..2a51f4816c 100644 --- a/doc/html/signals2/tests.html +++ b/doc/html/signals2/tests.html @@ -4,11 +4,11 @@ Testsuite - + - + - +
              -

              1.

              +

              1.

              Don't noncopyable signal semantics mean that a class with a signal member will be noncopyable as well?

              -

              2.

              +

              2.

              Is Boost.Signals2 thread-safe?

              @@ -26,10 +26,10 @@

              Testsuite

              - +

              -Acceptance tests

              +Acceptance tests
              @@ -54,7 +54,7 @@ - diff --git a/doc/html/signals2/thread-safety.html b/doc/html/signals2/thread-safety.html index bb0eae45d5..0fe5dc4603 100644 --- a/doc/html/signals2/thread-safety.html +++ b/doc/html/signals2/thread-safety.html @@ -4,9 +4,9 @@ Thread-Safety - + - + @@ -26,14 +26,14 @@

              The primary motivation for Boost.Signals2 is to provide a version of the original Boost.Signals library which can be used safely in a @@ -50,7 +50,7 @@

              -Signals and combiners

              +Signals and combiners

              Each signal object default-constructs a Mutex object to protect its internal state. Furthermore, a Mutex is created @@ -62,7 +62,7 @@ signal's methods are called. The mutex is usually held until the method completes, however there is one major exception to this rule. When a signal is invoked by calling - signal::operator(), + signal::operator(), the invocation first acquires a lock on the signal's mutex. Then it obtains a handle to the signal's slot list and combiner. Next it releases the signal's mutex, before invoking the combiner to @@ -82,7 +82,7 @@ find the next callable slot while iterating through the signal's slot list.

              -
                +
                • The Mutex associated with the connection to the slot is locked.

                • All the tracked weak_ptr associated with the @@ -109,7 +109,7 @@ Note that since we unlock the connection's mutex before executing its associated slot, it is possible a slot will still be executing after it has been disconnected by a - connection::disconnect(), if + connection::disconnect(), if the disconnect was called concurrently with signal invocation.

                  @@ -126,7 +126,7 @@ Future signal invocations will receive a handle to the newly created deep copy of the slot list, and the old slot list will be destroyed once it is no longer in use. Similarly, if you change a signal's combiner with - signal::set_combiner + signal::set_combiner while a signal invocation is running concurrently, the concurrent signal invocation will continue to use the old combiner undisturbed, while future signal invocations will receive a handle to the new combiner. @@ -164,7 +164,7 @@

                -Connections and other classes

                +Connections and other classes

              The methods of the signals2::connection class are thread-safe, with the exception of assignment and swap. This is achived via locking the mutex diff --git a/doc/html/signals2/tutorial.html b/doc/html/signals2/tutorial.html index 1e91c6fe38..b97d3af3ae 100644 --- a/doc/html/signals2/tutorial.html +++ b/doc/html/signals2/tutorial.html @@ -4,10 +4,10 @@ Tutorial - + - - + + @@ -26,20 +26,20 @@

              This tutorial is not meant to be read linearly. Its top-level structure roughly separates different concepts in the library (e.g., handling calling multiple slots, passing values to and from @@ -59,7 +59,7 @@ will not need to read the Advanced sectio

              -Hello, World! (Beginner)

              +Hello, World! (Beginner)

              The following example writes "Hello, World!" using signals and slots. First, we create a signal sig, a signal that takes no arguments and has a void return value. Next, we connect @@ -89,14 +89,14 @@ World!".

              -Calling Multiple Slots

              -
              +

              -Connecting Multiple Slots (Beginner)

              +Connecting Multiple Slots (Beginner)

              Calling a single slot from a signal isn't very interesting, so we can make the Hello, World program more interesting by splitting the work of printing "Hello, World!" into two completely separate @@ -140,7 +140,7 @@ Hello, World!

              -Ordering Slot Call Groups (Intermediate)

              +Ordering Slot Call Groups (Intermediate)

              Slots are free to have side effects, and that can mean that some slots will have to be called before others even if they are not connected in that order. The Boost.Signals2 library allows slots to be placed into groups that are ordered in @@ -166,7 +166,7 @@ group parameter and those that don't? The "unnamed" slots (i.e., those that have been connected without specifying a group name) can be placed at the front or back of the slot list (by passing boost::signals2::at_front or boost::signals2::at_back -as the last parameter to connect, respectively), +as the last parameter to connect, respectively), and default to the end of the list. When a group is specified, the final at_front or at_back parameter describes where the slot @@ -204,14 +204,14 @@ Hello, World!

              -Passing Values to and from Slots

              -
              -
              Slot Arguments (Beginner)
              -
              Signal Return Values (Advanced)
              +Passing Values to and from Slots
              +

              -Slot Arguments (Beginner)

              +Slot Arguments (Beginner)

              Signals can propagate arguments to each of the slots they call. For instance, a signal that propagates mouse motion events might want to pass along the new mouse coordinates and whether the mouse @@ -272,7 +272,7 @@ connected to sig must therefore be able to t

              -Signal Return Values (Advanced)

              +Signal Return Values (Advanced)

              Just as slots can receive arguments, they can also return values. These values can then be returned back to the caller of the signal through a combiner. The combiner is a mechanism @@ -451,20 +451,20 @@ struct DistributeRequest {

              +

              -Disconnecting Slots (Beginner)

              +Disconnecting Slots (Beginner)

              Slots aren't expected to exist indefinitely after they are connected. Often slots are only used to receive a few events and are then disconnected, and the programmer needs control to decide @@ -473,8 +473,8 @@ when a slot should no longer be connected.

              boost::signals2::connection class. The connection class uniquely represents the connection between a particular signal and a particular slot. The -connected() method checks if the signal and slot are -still connected, and the disconnect() method +connected() method checks if the signal and slot are +still connected, and the disconnect() method disconnects the signal and slot if they are connected before it is called. Each call to the signal's connect() method returns a connection object, which can be used to determine if the @@ -490,7 +490,7 @@ connection still exists or to disconnect the signal and slot.

              -Blocking Slots (Beginner)

              +Blocking Slots (Beginner)

              Slots can be temporarily "blocked", meaning that they will be ignored when the signal is invoked but have not been permanently disconnected. This is typically used to prevent infinite recursion in cases where @@ -499,7 +499,7 @@ invoked again. A boost::signals2::shared_connection_block object will temporarily block a slot. The connection is unblocked by either destroying or calling -unblock +unblock on all the shared_connection_block objects that reference the connection. Here is an example of @@ -519,7 +519,7 @@ blocking/unblocking slots:

              -Scoped Connections (Intermediate)

              +Scoped Connections (Intermediate)

              The boost::signals2::scoped_connection class references a signal/slot connection that will be disconnected when the scoped_connection class goes out of scope. This @@ -540,22 +540,22 @@ e.g.,

               // doesn't compile due to compiler attempting to copy a temporary scoped_connection object
              -// boost::signals2::scoped_connection c0 = sig.connect(ShortLived());
              +// boost::signals2::scoped_connection c0 = sig.connect(ShortLived());
               
               // okay
              -boost::signals2::scoped_connection c1(sig.connect(ShortLived()));
              +boost::signals2::scoped_connection c1(sig.connect(ShortLived()));
               
               // also okay
               boost::signals2::scoped_connection c2;
              -c2 = sig.connect(ShortLived());
              +c2 = sig.connect(ShortLived());
               

              -Disconnecting Equivalent Slots (Intermediate)

              +Disconnecting Equivalent Slots (Intermediate)

              One can disconnect slots that are equivalent to a given function object using a form of the -signal::disconnect method, so long as +signal::disconnect method, so long as the type of the function object has an accessible == operator. For instance: @@ -610,7 +610,7 @@ public: // ... NewsMessageArea *newsMessageArea = new NewsMessageArea(/* ... */); // ... -deliverNews.connect(boost::bind(&NewsMessageArea::displayNews, +deliverNews.connect(boost::bind(&NewsMessageArea::displayNews, newsMessageArea, _1));

              However, what if the user closes the news message area, @@ -618,21 +618,21 @@ destroying the newsMessageArea object that deliverNews knows about? Most likely, a segmentation fault will occur. However, with Boost.Signals2 one may track any object which is managed by a shared_ptr, by using -slot::track. A slot will automatically +slot::track. A slot will automatically disconnect when any of its tracked objects expire. In addition, Boost.Signals2 will ensure that no tracked object expires while the slot it is associated with is in mid-execution. It does so by creating temporary shared_ptr copies of the slot's tracked objects before executing it. To track NewsMessageArea, we use a shared_ptr to manage its lifetime, and pass the shared_ptr to the slot via its -slot::track +slot::track method before connecting it, e.g.:

               // ...
               boost::shared_ptr<NewsMessageArea> newsMessageArea(new NewsMessageArea(/* ... */));
               // ...
              -deliverNews.connect(signal_type::slot_type(&NewsMessageArea::displayNews,
              +deliverNews.connect(signal_type::slot_type(&NewsMessageArea::displayNews,
                 newsMessageArea.get(), _1).track(newsMessageArea));
               

              @@ -647,14 +647,14 @@ deliverNews.newsMessageArea itself, a copy of the shared_ptr would have been bound into the slot function, preventing the shared_ptr from expiring. However, the use of - slot::track + slot::track implies we wish to allow the tracked object to expire, and automatically disconnect the connection when this occurs.

              shared_ptr classes other than boost::shared_ptr (such as std::shared_ptr) may also be tracked for connection management - purposes. They are supported by the slot::track_foreign method. + purposes. They are supported by the slot::track_foreign method.

              @@ -696,10 +696,10 @@ deliverNews.

              -When Can Disconnections Occur? (Intermediate)

              +When Can Disconnections Occur? (Intermediate)

              Signal/slot disconnections occur when any of these conditions occur:

              -
                +
                • The connection is explicitly disconnected via the connection's disconnect method directly, or indirectly via the signal's disconnect method, or @@ -731,7 +731,7 @@ signal.

                -Passing Slots (Intermediate)

                +Passing Slots (Intermediate)

              Slots in the Boost.Signals2 library are created from arbitrary function objects, and therefore have no fixed type. However, it is commonplace to require that slots be passed through interfaces that @@ -920,7 +920,7 @@ private: access to a signals2::connection object which references the invoking signal-slot connection. The difficulty is, the connection object is returned by the - signal::connect + signal::connect method, and therefore is not available until after the slot is already connected to the signal. This can be particularly troublesome in a multi-threaded environment where the signal may be invoked @@ -928,11 +928,11 @@ private:

              Therefore, the signal classes provide - signal::connect_extended + signal::connect_extended methods, which allow slots which take an extra argument to be connected to a signal. The extra argument is a signals2::connection object which refers to the signal-slot connection currently invoking the slot. - signal::connect_extended + signal::connect_extended uses slots of the type given by the signal::extended_slot_type typedef. @@ -941,7 +941,7 @@ private: The examples section includes an extended_slot program which demonstrates the syntax for using - signal::connect_extended. + signal::connect_extended.

              @@ -974,13 +974,13 @@ private: for its Mutex types, you could write:

              namespace bs2 = boost::signals2;
              -using bs2::keywords;
              +using namespace bs2::keywords;
               bs2::signal_type<void (int), mutex_type<bs2::dummy_mutex> >::type sig;
               

              -Linking against the Signals2 library

              +Linking against the Signals2 library

              Unlike the original Boost.Signals library, Boost.Signals2 is currently header-only.

              -- cgit v1.2.3

              dead_slot_test.cpp

              run

              Ensure that calling connect with a slot +

              Ensure that calling connect with a slot that has already expired does not actually connect to the slot.