libsigc++: track_obj(), track_object()

libsigc++ 2.12.2

Classes | Functions
track_obj(), track_object()
Adaptors

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

## Classes
class | sigc::track_obj_functor1< T_functor, T_obj1 >
| track_obj_functor1 wraps a functor and stores a reference to a trackable object. More...
class | sigc::track_obj_functor2< T_functor, T_obj1, T_obj2 >
| track_obj_functor2 wraps a functor and stores 2 references to trackable objects. More...
class | sigc::track_obj_functor3< T_functor, T_obj1, T_obj2, T_obj3 >
| track_obj_functor3 wraps a functor and stores 3 references to trackable objects. More...
class | sigc::track_obj_functor4< T_functor, T_obj1, T_obj2, T_obj3, T_obj4 >
| track_obj_functor4 wraps a functor and stores 4 references to trackable objects. More...
class | sigc::track_obj_functor5< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5 >
| track_obj_functor5 wraps a functor and stores 5 references to trackable objects. More...
class | sigc::track_obj_functor6< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6 >
| track_obj_functor6 wraps a functor and stores 6 references to trackable objects. More...
class | sigc::track_obj_functor7< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6, T_obj7 >
| track_obj_functor7 wraps a functor and stores 7 references to trackable objects. More...

## Functions
template <typename T_functor , typename T_obj1 >
track_obj_functor1< T_functor, T_obj1 > | sigc::track_obj (const T_functor &_A_func, const T_obj1 &_A_obj1)
| Creates an adaptor of type sigc::track_obj_functor1 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 >
track_obj_functor2< T_functor, T_obj1, T_obj2 > | sigc::track_obj (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2)
| Creates an adaptor of type sigc::track_obj_functor2 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 >
track_obj_functor3< T_functor, T_obj1, T_obj2, T_obj3 > | sigc::track_obj (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3)
| Creates an adaptor of type sigc::track_obj_functor3 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 >
track_obj_functor4< T_functor, T_obj1, T_obj2, T_obj3, T_obj4 > | sigc::track_obj (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3, const T_obj4 &_A_obj4)
| Creates an adaptor of type sigc::track_obj_functor4 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 >
track_obj_functor5< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5 > | sigc::track_obj (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3, const T_obj4 &_A_obj4, const T_obj5 &_A_obj5)
| Creates an adaptor of type sigc::track_obj_functor5 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 , typename T_obj6 >
track_obj_functor6< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6 > | sigc::track_obj (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3, const T_obj4 &_A_obj4, const T_obj5 &_A_obj5, const T_obj6 &_A_obj6)
| Creates an adaptor of type sigc::track_obj_functor6 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 , typename T_obj6 , typename T_obj7 >
track_obj_functor7< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6, T_obj7 > | sigc::track_obj (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3, const T_obj4 &_A_obj4, const T_obj5 &_A_obj5, const T_obj6 &_A_obj6, const T_obj7 &_A_obj7)
| Creates an adaptor of type sigc::track_obj_functor7 which wraps a functor.
template <typename T_functor , typename T_obj1 >
track_obj_functor1< T_functor, T_obj1 > | sigc::track_object (const T_functor &_A_func, const T_obj1 &_A_obj1)
| Creates an adaptor of type sigc::track_obj_functor1 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 >
track_obj_functor2< T_functor, T_obj1, T_obj2 > | sigc::track_object (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2)
| Creates an adaptor of type sigc::track_obj_functor2 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 >
track_obj_functor3< T_functor, T_obj1, T_obj2, T_obj3 > | sigc::track_object (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3)
| Creates an adaptor of type sigc::track_obj_functor3 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 >
track_obj_functor4< T_functor, T_obj1, T_obj2, T_obj3, T_obj4 > | sigc::track_object (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3, const T_obj4 &_A_obj4)
| Creates an adaptor of type sigc::track_obj_functor4 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 >
track_obj_functor5< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5 > | sigc::track_object (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3, const T_obj4 &_A_obj4, const T_obj5 &_A_obj5)
| Creates an adaptor of type sigc::track_obj_functor5 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 , typename T_obj6 >
track_obj_functor6< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6 > | sigc::track_object (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3, const T_obj4 &_A_obj4, const T_obj5 &_A_obj5, const T_obj6 &_A_obj6)
| Creates an adaptor of type sigc::track_obj_functor6 which wraps a functor.
template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 , typename T_obj6 , typename T_obj7 >
track_obj_functor7< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6, T_obj7 > | sigc::track_object (const T_functor &_A_func, const T_obj1 &_A_obj1, const T_obj2 &_A_obj2, const T_obj3 &_A_obj3, const T_obj4 &_A_obj4, const T_obj5 &_A_obj5, const T_obj6 &_A_obj6, const T_obj7 &_A_obj7)
| Creates an adaptor of type sigc::track_obj_functor7 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. Up to 7 objects can be tracked. operator()() can have up to 7 arguments.

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

Example:
  struct bar : public sigc::trackable {};
  sigc::signal<void> some_signal;
  void foo(bar&);
  {
  bar some_bar;
  some_signal.connect([&some_bar](){ foo(some_bar); });
  // NOT disconnected automatically when some_bar goes out of scope
  some_signal.connect(sigc::track_object([&some_bar](){ foo(some_bar); }, some_bar);
  // disconnected automatically when some_bar goes out of scope
  }
  sigc::signal
  Convenience wrapper for the numbered sigc::signal# templates.
  Definition signal.h:4055
  sigc::bind
  bind_functor< I_location, T_functor, T_bound1 > bind(const T_functor &_A_func, T_bound1 _A_b1)
  Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor.
  Definition bind.h:2114
  sigc::track_object
  track_obj_functor1< T_functor, T_obj1 > track_object(const T_functor &_A_func, const T_obj1 &_A_obj1)
  Creates an adaptor of type sigc::track_obj_functor1 which wraps a functor.
  Definition track_obj.h:905
  sigc::trackable
  Base class for objects with auto-disconnection.
  Definition trackable.h:107

## Function Documentation

## ◆ track_obj() [1/7]

template <typename T_functor , typename T_obj1 >

track_obj_functor1< T_functor, T_obj1 > sigc::track_obj | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.4:

Deprecated:
  Use sigc::track_object() instead.

## ◆ track_obj() [2/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 >

track_obj_functor2< T_functor, T_obj1, T_obj2 > sigc::track_obj | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object.
  _A_obj2 | Trackable object.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.4:

Deprecated:
  Use sigc::track_object() instead.

## ◆ track_obj() [3/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 >

track_obj_functor3< T_functor, T_obj1, T_obj2, T_obj3 > sigc::track_obj | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object.
  _A_obj2 | Trackable object.
  _A_obj3 | Trackable object.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.4:

Deprecated:
  Use sigc::track_object() instead.

## ◆ track_obj() [4/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 >

track_obj_functor4< T_functor, T_obj1, T_obj2, T_obj3, T_obj4 > sigc::track_obj | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3,
|  | const T_obj4 & | _A_obj4
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object.
  _A_obj2 | Trackable object.
  _A_obj3 | Trackable object.
  _A_obj4 | Trackable object.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.4:

Deprecated:
  Use sigc::track_object() instead.

## ◆ track_obj() [5/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 >

track_obj_functor5< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5 > sigc::track_obj | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3,
|  | const T_obj4 & | _A_obj4,
|  | const T_obj5 & | _A_obj5
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object.
  _A_obj2 | Trackable object.
  _A_obj3 | Trackable object.
  _A_obj4 | Trackable object.
  _A_obj5 | Trackable object.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.4:

Deprecated:
  Use sigc::track_object() instead.

## ◆ track_obj() [6/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 , typename T_obj6 >

track_obj_functor6< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6 > sigc::track_obj | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3,
|  | const T_obj4 & | _A_obj4,
|  | const T_obj5 & | _A_obj5,
|  | const T_obj6 & | _A_obj6
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object.
  _A_obj2 | Trackable object.
  _A_obj3 | Trackable object.
  _A_obj4 | Trackable object.
  _A_obj5 | Trackable object.
  _A_obj6 | Trackable object.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.4:

Deprecated:
  Use sigc::track_object() instead.

## ◆ track_obj() [7/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 , typename T_obj6 , typename T_obj7 >

track_obj_functor7< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6, T_obj7 > sigc::track_obj | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3,
|  | const T_obj4 & | _A_obj4,
|  | const T_obj5 & | _A_obj5,
|  | const T_obj6 & | _A_obj6,
|  | const T_obj7 & | _A_obj7
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object.
  _A_obj2 | Trackable object.
  _A_obj3 | Trackable object.
  _A_obj4 | Trackable object.
  _A_obj5 | Trackable object.
  _A_obj6 | Trackable object.
  _A_obj7 | Trackable object.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.4:

Deprecated:
  Use sigc::track_object() instead.

## ◆ track_object() [1/7]

template <typename T_functor , typename T_obj1 >

track_obj_functor1< T_functor, T_obj1 > sigc::track_object | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object, derived directly or indirectly from sigc::trackable.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.12:

## ◆ track_object() [2/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 >

track_obj_functor2< T_functor, T_obj1, T_obj2 > sigc::track_object | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj2 | Trackable object, derived directly or indirectly from sigc::trackable.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.12:

## ◆ track_object() [3/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 >

track_obj_functor3< T_functor, T_obj1, T_obj2, T_obj3 > sigc::track_object | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj2 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj3 | Trackable object, derived directly or indirectly from sigc::trackable.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.12:

## ◆ track_object() [4/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 >

track_obj_functor4< T_functor, T_obj1, T_obj2, T_obj3, T_obj4 > sigc::track_object | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3,
|  | const T_obj4 & | _A_obj4
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj2 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj3 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj4 | Trackable object, derived directly or indirectly from sigc::trackable.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.12:

## ◆ track_object() [5/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 >

track_obj_functor5< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5 > sigc::track_object | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3,
|  | const T_obj4 & | _A_obj4,
|  | const T_obj5 & | _A_obj5
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj2 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj3 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj4 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj5 | Trackable object, derived directly or indirectly from sigc::trackable.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.12:

## ◆ track_object() [6/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 , typename T_obj6 >

track_obj_functor6< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6 > sigc::track_object | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3,
|  | const T_obj4 & | _A_obj4,
|  | const T_obj5 & | _A_obj5,
|  | const T_obj6 & | _A_obj6
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj2 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj3 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj4 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj5 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj6 | Trackable object, derived directly or indirectly from sigc::trackable.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.12:

## ◆ track_object() [7/7]

template <typename T_functor , typename T_obj1 , typename T_obj2 , typename T_obj3 , typename T_obj4 , typename T_obj5 , typename T_obj6 , typename T_obj7 >

track_obj_functor7< T_functor, T_obj1, T_obj2, T_obj3, T_obj4, T_obj5, T_obj6, T_obj7 > sigc::track_object | ( | const T_functor & | _A_func,
|  | const T_obj1 & | _A_obj1,
|  | const T_obj2 & | _A_obj2,
|  | const T_obj3 & | _A_obj3,
|  | const T_obj4 & | _A_obj4,
|  | const T_obj5 & | _A_obj5,
|  | const T_obj6 & | _A_obj6,
|  | const T_obj7 & | _A_obj7
| ) |  |
| inline

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

Parameters

  _A_func | Functor that shall be wrapped.
  _A_obj1 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj2 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj3 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj4 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj5 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj6 | Trackable object, derived directly or indirectly from sigc::trackable.
  _A_obj7 | Trackable object, derived directly or indirectly from sigc::trackable.

Returns
  Adaptor that executes _A_func() on invocation.

Since libsigc++ 2.12: