libsigc++ 3.6.0
Classes | Functions
track_obj(), track_object()

sigc::track_object() tracks trackable objects, referenced from a functor. More...

Classes

class  sigc::track_obj_functor< T_functor, T_obj >
 track_obj_functor wraps a functor and stores a reference to a trackable object. More...
 

Functions

template <typename T_functor , typename... T_obj>
decltype(autosigc::track_obj (const T_functor &func, const T_obj &... obj)
 Creates an adaptor of type sigc::track_obj_functor which wraps a functor.
 
template <typename T_functor , typename T_obj1 , typename... T_objs>
decltype(autosigc::track_object (const T_functor &func, const T_obj1 &obj1, const T_objs &... objs)
 Creates an adaptor of type sigc::track_obj_functor which wraps a functor.
 

Detailed Description

sigc::track_object() tracks trackable objects, referenced from a functor.

It can be useful when you assign a C++11 lambda expression or a std::function<> to a slot, or connect it to a signal, and the lambda expression or std::function<> contains references to sigc::trackable derived objects.

The functor returned by sigc::track_object() is formally an adaptor, but it does not alter the signature, return type or behaviour of the supplied functor.

track_obj() is a deprecated alternative to track_object().

Example:
struct bar : public sigc::trackable {};
sigc::signal<void()> some_signal;
void foo(bar&);
{
some_signal.connect([&some_bar](){ foo(some_bar); });
// NOT disconnected automatically when some_bar goes out of scope
// disconnected automatically when some_bar goes out of scope
}
decltype(auto) ptr_fun(T_return(*func)(T_args...))
Creates a functor of type sigc::pointer_functor which wraps an existing non-member function.
Definition ptr_fun.h:107
decltype(auto) track_object(const T_functor &func, const T_obj1 &obj1, const T_objs &... objs)
Creates an adaptor of type sigc::track_obj_functor which wraps a functor.
Definition track_obj.h:161
Base class for objects with auto-disconnection.
Definition trackable.h:115

Function Documentation

◆ track_obj()

template <typename T_functor , typename... T_obj>
decltype(auto) sigc::track_obj ( const T_functor &  func,
const T_obj &...  obj 
)
inline

Creates an adaptor of type sigc::track_obj_functor which wraps a functor.

Parameters
funcFunctor that shall be wrapped.
objTrackable objects.
Returns
Adaptor that executes func() on invocation.
Since libsigc++ 2.4:
Deprecated:
Use sigc::track_object() instead.

◆ track_object()

template <typename T_functor , typename T_obj1 , typename... T_objs>
decltype(auto) sigc::track_object ( const T_functor &  func,
const T_obj1 obj1,
const T_objs &...  objs 
)
inline

Creates an adaptor of type sigc::track_obj_functor which wraps a functor.

Parameters
funcFunctor that shall be wrapped.
obj1Trackable object, derived directly or indirectly from sigc::trackable.
objsZero or more trackable objects, derived directly or indirectly from sigc::trackable.
Returns
Adaptor that executes func() on invocation.
Since libsigc++ 3.4:
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy