CppCMS

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | List of all members
booster::callback< Result(Params...)> Class Template Reference

This is Booster's implementation of std::tr1::callback/booster::callback. More...

`#include <booster/booster/callback.h>`

## Public Types
typedef intrusive_ptr< callable_type > | pointer_type
typedef Result | result_type

## Public Member Functions
| callback ()
template<typename F >
| callback (F func)
| callback (callback const &other)
template<typename F >
callback const & | operator= (F func)
callback const & | operator= (callback const &other)
result_type | operator() (Params...params) const
bool | empty () const
| operator bool () const
void | swap (callback &other)
pointer_type const & | get_pointer () const
pointer_type & | get_pointer ()

## Detailed Description

### template<typename Result, typename... Params>
class booster::callback< Result(Params...)>

This is Booster's implementation of std::tr1::callback/booster::callback.

This callback is created from generic object that can be "called" i.e. a class with operator() or callback pointer that has same signature as the callback.

See: http://www.boost.org/doc/html/function.html

Notes:

- this code is not taken from Boost and has slightly different interface.
- as most of compilers do not support Variadic templates yet, this class is explicitly specialized for Params of size 0 to 8. So maximal amout of parameters that can be used is 8.

## Member Typedef Documentation

template<typename Result , typename... Params>

typedef intrusive_ptr<callable_type> booster::callback< Result(Params...)>::pointer_type

Pointer to callable object

New in CppCMS 1.2

template<typename Result , typename... Params>

typedef Result booster::callback< Result(Params...)>::result_type

Type of result, for use with boost::bind

## Constructor & Destructor Documentation

template<typename Result , typename... Params>

booster::callback< Result(Params...)>::callback | ( |  | ) |

Default constructor, creates an empty callbacks

template<typename Result , typename... Params>
template<typename F >

booster::callback< Result(Params...)>::callback | ( | F | func | ) |

Creates a callback from a callbackal func of type F. func should be copyable. It is copied and stored inside callback object.

template<typename Result , typename... Params>

booster::callback< Result(Params...)>::callback | ( | callback< Result(Params...)> const & | other | ) |

Copy callback, Copies underlying callbackal object.

## Member Function Documentation

template<typename Result , typename... Params>

bool booster::callback< Result(Params...)>::empty | ( |  | ) | const

Return true if the callback is empty

template<typename Result , typename... Params>

pointer_type const& booster::callback< Result(Params...)>::get_pointer | ( |  | ) | const

Get underlying pointer to callable_type

New in CppCMS 1.2

template<typename Result , typename... Params>

pointer_type& booster::callback< Result(Params...)>::get_pointer | ( |  | ) |

Get underlying pointer to callable_type

New in CppCMS 1.2

template<typename Result , typename... Params>

booster::callback< Result(Params...)>::operator bool | ( |  | ) | const

Returns true if the callback is not empty

template<typename Result , typename... Params>

result_type booster::callback< Result(Params...)>::operator() | ( | Params... | params | ) | const

Calls underling callbackal object. If the callback is empty, throws bad_callback_call.

template<typename Result , typename... Params>
template<typename F >

callback const& booster::callback< Result(Params...)>::operator= | ( | F | func | ) |

Assign a callbackal func of type F. func should be copyable. It is copied and stored inside callback object.

template<typename Result , typename... Params>

callback const& booster::callback< Result(Params...)>::operator= | ( | callback< Result(Params...)> const & | other | ) |

Assignment operator. Copies underlying callbackal object.

template<typename Result , typename... Params>

void booster::callback< Result(Params...)>::swap | ( | callback< Result(Params...)> & | other | ) |

Swaps two callbackal object. Does not throw.

The documentation for this class was generated from the following file:

- booster/callback.h