libsigc++
3.6.0
|
Base type for adaptors. More...
#include <sigc++/adaptors/adapts.h>
Public Member Functions | |
adapts (const T_functor & functor) | |
Constructs an adaptor that wraps the passed functor. More... | |
Public Attributes | |
adaptor_type | functor_ |
Adaptor that is invoked from operator()(). More... | |
Base type for adaptors.
sigc::adapts wraps adaptors, functors, function pointers and class methods. It contains a single member functor which is always a sigc::adaptor_base. The adaptor_type alias defines the exact type that is used to store the adaptor, functor, function pointer or class method passed into the constructor. It differs from T_functor unless T_functor inherits from sigc::adaptor_base.
If you implement your own adaptor, you must also provide your specialization of sigc::visitor<>::do_visit_each<>() that will forward the call to the functor(s) your adapter is wrapping. Otherwise, pointers stored within the functor won't be invalidated when a sigc::trackable object is destroyed and you can end up executing callbacks on destroyed objects.
Your specialization of sigc::visitor<> must be in namespace sigc.
|
inlineexplicit |
Constructs an adaptor that wraps the passed functor.
functor | Functor to invoke from operator()(). |
|
mutable |
Adaptor that is invoked from operator()().