arbb::closure< FunctionType > Class Template Reference

A statically-typed closure captured from a function of type FunctionType. More...

List of all members.

Public Member Functions

 closure ()
 Default constructor. Creates an empty closure.
 closure (const closure &other)
 Copy constructor.
 closure (const auto_closure &other)
 Converts other from an arbb::auto_closure to a statically typed arbb::closure.
void operator() (FunctionParams...arguments) const
 Executes the closure with the provided arguments.
bool empty () const
 Returns true if the closure is empty.
closure & operator= (const closure &other)
 Assignment operator.
closure & operator= (const auto_closure &other)
 Converts other from an arbb::auto_closure to a statically typed arbb::closure and assigns it.
bool operator== (const auto_closure &other)
 Returns true if the closure is the same as other.
bool operator!= (const auto_closure &other)
 Returns true if the closure is not the same as other.
bool operator== (const closure &other)
 Returns true if the closure is the same as other.
bool operator!= (const closure &other)
 Returns true if the closure is not the same as other.
 operator auto_closure () const
 Converts the closure to an arbb::auto_closure.

Detailed Description

template<typename FunctionType>
class arbb::closure< FunctionType >

A statically-typed closure captured from a function of type FunctionType.

Template Parameters:

FunctionType The type of the function captured by the closure. For example, void (arbb::f32&, arbb::f32).

See Also

Closures

Definition at line 39 of file closure.hpp.


Constructor & Destructor Documentation

template<typename FunctionType >
arbb::closure< FunctionType >::closure (  ) 

Default constructor. Creates an empty closure.

template<typename FunctionType >
arbb::closure< FunctionType >::closure ( const closure< FunctionType > &  other  ) 

Copy constructor.

template<typename FunctionType >
arbb::closure< FunctionType >::closure ( const auto_closure< FunctionType > &  other  ) 

Converts other from an arbb::auto_closure to a statically typed arbb::closure.

Exceptions:

arbb::exception If the type of other does not match the closure type being constructed.

Member Function Documentation

template<typename FunctionType >
void arbb::closure< FunctionType >::operator() ( FunctionParams...  arguments  )  const

Executes the closure with the provided arguments.

If the types of the arguments provided do not match those accepted by the function from which this closure was captured, a compilation error occurs.

Exceptions:

arbb::out_of_bounds If the closure attempted an out-of-bounds access.
arbb::arithmetic_error If the closure caused an arithmetic error, such as a divison by zero.
arbb::bad_alloc If the closure failed to allocate memory for a variable.
arbb::uninitialized_access If the closure attempted to access an uninitialized variable.
template<typename FunctionType >
bool arbb::closure< FunctionType >::empty (  )  const

Returns true if the closure is empty.

template<typename FunctionType >
closure& arbb::closure< FunctionType >::operator= ( const closure< FunctionType > &  other  ) 

Assignment operator.

template<typename FunctionType >
closure& arbb::closure< FunctionType >::operator= ( const auto_closure< FunctionType > &  other  ) 

Converts other from an arbb::auto_closure to a statically typed arbb::closure and assigns it.

Exceptions:

arbb::exception If the type of other does not match the destination closure type.
template<typename FunctionType >
bool arbb::closure< FunctionType >::operator== ( const auto_closure< FunctionType > &  other  ) 

Returns true if the closure is the same as other.

template<typename FunctionType >
bool arbb::closure< FunctionType >::operator!= ( const auto_closure< FunctionType > &  other  ) 

Returns true if the closure is not the same as other.

template<typename FunctionType >
bool arbb::closure< FunctionType >::operator== ( const closure< FunctionType > &  other  ) 

Returns true if the closure is the same as other.

template<typename FunctionType >
bool arbb::closure< FunctionType >::operator!= ( const closure< FunctionType > &  other  ) 

Returns true if the closure is not the same as other.

template<typename FunctionType >
arbb::closure< FunctionType >::operator auto_closure (  )  const [inline]

Converts the closure to an arbb::auto_closure.

Definition at line 96 of file closure.hpp.


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

Submit feedback on this help topic

Copyright © 2010, Intel Corporation. All rights reserved.