libsigc++
3.6.0
|
A bound_argument<Foo> object stores a bound (for instance, with sigc::bind(), or sigc::bind_return()) argument. More...
#include <sigc++/adaptors/bound_argument.h>
Public Member Functions | |
bound_argument (const T_type &arg) | |
Constructor. More... | |
T_type & | invoke () |
Retrieve the entity to pass to the bound functor or return. More... | |
const T_type & | visit () const |
Retrieve the entity to visit in visit_each(). More... | |
A bound_argument<Foo> object stores a bound (for instance, with sigc::bind(), or sigc::bind_return()) argument.
If Foo is a wrapped reference to a class Bar (std::reference_wrapper<Bar>) then this object is implemented on top of a limit_reference. When the slot is invoked, the limit_reference::invoke() method provides the argument (a Bar&). When the slot is visited (e.g. visit_each<>()), we simply visit the limit_reference, which will visit the derived type, or a sigc::trackable base if necessary.
Likewise, If Foo is a wrapped const reference to a class Bar (std::reference_wrapper<const Bar>) then this object is implemented on top of a const_limit_reference.
If Foo is something else (such as an argument that is bound by value) bound_argument just stores a cop of that value, and both invoke() and visit() simply return it.
This object is used by the bind_functor<> and bind_return_functor<> objects, depending on whether the argument is bound as a parameter or as a return value.
The general template implementation is used for parameters that are passed by value. T_type The type of the bound argument.
|
inline |
Constructor.
arg | The argument to bind. |
|
inline |
Retrieve the entity to pass to the bound functor or return.
|
inline |
Retrieve the entity to visit in visit_each().