function< _Res(_GLIBCXX_TEMPLATE_ARGS)> Class Template Reference

#include <functional_iterate.h>

List of all members.

Public Types

typedef _Res result_type

Public Member Functions

 function ()
 Default construct creates an empty function call wrapper.
 function (_M_clear_type *)
 Default construct creates an empty function call wrapper.
 function (const function &__x)
 Function copy constructor.
template<typename _Functor>
 function (_Functor __f, typename __enable_if< _Useless,!is_integral< _Functor >::value >::__type=_Useless())
 Builds a function that targets a copy of the incoming function object.
function & operator= (const function &__x)
 Function assignment operator.
function & operator= (_M_clear_type *)
 Function assignment to zero.
template<typename _Functor>
__enable_if< function &,!is_integral<
_Functor >::value >::__type 
operator= (_Functor __f)
 Function assignment to a new target.
void swap (function &__x)
 Swap the targets of two function objects.
 operator _Safe_bool () const
 Determine if the function wrapper has a target.
_Res operator() (_GLIBCXX_PARAMS) const
 Invokes the function targeted by *this.
const type_info & target_type () const
 Determine the type of the target of this function object wrapper.
template<typename _Functor>
_Functor * target ()
 Access the stored target function object.
template<typename _Functor>
const _Functor * target () const

Private Types

typedef _Hidden_type *_Hidden_type::* _Safe_bool
typedef _Res _Signature_type (_GLIBCXX_TEMPLATE_ARGS)
typedef _Res(*) _Invoker_type (const _Any_data &_GLIBCXX_COMMA _GLIBCXX_PARAMS)

Private Member Functions

template<typename _Function>
void operator== (const function< _Function > &) const
template<typename _Function>
void operator!= (const function< _Function > &) const

Private Attributes

_Invoker_type _M_invoker

Classes

struct  _Hidden_type
struct  _Useless


Detailed Description

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
class function< _Res(_GLIBCXX_TEMPLATE_ARGS)>

Definition at line 595 of file functional_iterate.h.


Member Typedef Documentation

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
typedef _Res(*) function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::_Invoker_type(const _Any_data &_GLIBCXX_COMMA _GLIBCXX_PARAMS) [private]

Definition at line 824 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
typedef _Hidden_type* _Hidden_type::* function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::_Safe_bool [private]

Definition at line 619 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
typedef _Res function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::_Signature_type(_GLIBCXX_TEMPLATE_ARGS) [private]

Definition at line 621 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
typedef _Res function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::result_type

Definition at line 626 of file functional_iterate.h.


Constructor & Destructor Documentation

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::function (  )  [inline]

Default construct creates an empty function call wrapper.

Postcondition:
!(bool)*this

Definition at line 634 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::function ( _M_clear_type *   )  [inline]

Default construct creates an empty function call wrapper.

Postcondition:
!(bool)*this

Definition at line 640 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::function ( const function< _Res(_GLIBCXX_TEMPLATE_ARGS)> &  __x  ) 

Function copy constructor.

Parameters:
x A function object with identical call signature.
Precondition:
(bool)*this == (bool)x
The newly-created function contains a copy of the target of x (if it has one).

Definition at line 830 of file functional_iterate.h.

References std::tr1::__clone_functor.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
template<typename _Functor>
function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::function ( _Functor  __f,
typename __enable_if< _Useless,!is_integral< _Functor >::value >::__type  = _Useless() 
)

Builds a function that targets a copy of the incoming function object.

Parameters:
f A function object that is callable with parameters of type T1, T2, ..., TN and returns a value convertible to Res.
The newly-created function object will target a copy of f. If f is reference_wrapper<F>, then this function object will contain a reference to the function object f.get(). If f is a NULL function pointer or NULL pointer-to-member, the newly-created object will be empty.

If f is a non-NULL function pointer or an object of type reference_wrapper<F>, this function will not throw.

Definition at line 843 of file functional_iterate.h.


Member Function Documentation

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::operator _Safe_bool (  )  const [inline]

Determine if the function wrapper has a target.

Returns:
true when this function object contains a target, or false when it is empty.
This function will not throw an exception.

Definition at line 765 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
template<typename _Function>
void function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::operator!= ( const function< _Function > &   )  const [private]

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
_Res function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::operator() ( _GLIBCXX_PARAMS   )  const

Invokes the function targeted by *this.

Returns:
the result of the target.
Exceptions:
bad_function_call when !(bool)*this
The function call operator invokes the target function object stored by this.

Definition at line 858 of file functional_iterate.h.

References _GLIBCXX_ARGS, _GLIBCXX_COMMA, and std::abort().

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
template<typename _Functor>
__enable_if<function&, !is_integral<_Functor>::value>::__type function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::operator= ( _Functor  __f  )  [inline]

Function assignment to a new target.

Parameters:
f A function object that is callable with parameters of type T1, T2, ..., TN and returns a value convertible to Res.
Returns:
*this
This function object wrapper will target a copy of f. If f is reference_wrapper<F>, then this function object will contain a reference to the function object f.get(). If f is a NULL function pointer or NULL pointer-to-member, this object will be empty.

If f is a non-NULL function pointer or an object of type reference_wrapper<F>, this function will not throw.

Definition at line 727 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
function& function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::operator= ( _M_clear_type *   )  [inline]

Function assignment to zero.

Postcondition:
!(bool)*this
Returns:
*this
The target of *this is deallocated, leaving it empty.

Definition at line 699 of file functional_iterate.h.

References std::tr1::__destroy_functor.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
function& function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::operator= ( const function< _Res(_GLIBCXX_TEMPLATE_ARGS)> &  __x  )  [inline]

Function assignment operator.

Parameters:
x A function with identical call signature.
Postcondition:
(bool)*this == (bool)x
Returns:
*this
The target of x is copied to *this. If x has no target, then *this will be empty.

If x targets a function pointer or a reference to a function object, then this operation will not throw an exception.

Definition at line 686 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
template<typename _Function>
void function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::operator== ( const function< _Function > &   )  const [private]

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
void function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::swap ( function< _Res(_GLIBCXX_TEMPLATE_ARGS)> &  __x  )  [inline]

Swap the targets of two function objects.

Parameters:
f A function with identical call signature.
Swap the targets of this function object and f. This function will not throw an exception.

Definition at line 742 of file functional_iterate.h.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
template<typename _Functor>
const _Functor * function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::target (  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 910 of file functional_iterate.h.

References std::tr1::__get_functor_ptr.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
template<typename _Functor>
_Functor * function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::target (  ) 

Access the stored target function object.

Returns:
Returns a pointer to the stored target function object, if typeid(Functor).equals(target_type()); otherwise, a NULL pointer.
This function will not throw an exception.

Definition at line 890 of file functional_iterate.h.

References std::tr1::__get_functor_ptr.

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
const type_info & function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::target_type (  )  const

Determine the type of the target of this function object wrapper.

Returns:
the type identifier of the target function object, or typeid(void) if !(bool)*this.
This function will not throw an exception.

Definition at line 873 of file functional_iterate.h.

References std::tr1::__get_type_info.


Member Data Documentation

template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
_Invoker_type function< _Res(_GLIBCXX_TEMPLATE_ARGS)>::_M_invoker [private]

Definition at line 826 of file functional_iterate.h.


The documentation for this class was generated from the following file:
Generated on Tue Feb 2 16:57:42 2010 for GNU C++ STL by  doxygen 1.4.7