pixled-lib  1.0
Public Types | Public Member Functions | List of all members
pixled::FctWrapper< R > Class Template Reference

#include <function.h>

Public Types

typedef R Type
 

Public Member Functions

 FctWrapper (const base::Function< R > &fct)
 
 FctWrapper (R value)
 
 FctWrapper (const FctWrapper< R > &other)
 
 FctWrapper (FctWrapper< R > &&other)
 
FctWrapperoperator= (const FctWrapper< R > &other)
 
FctWrapperoperator= (FctWrapper< R > &&other)
 
const base::Function< R > & operator* () const
 
const base::Function< R > & get () const
 
 ~FctWrapper ()
 

Detailed Description

template<typename R>
class pixled::FctWrapper< R >

A smart pointer used to manage dynamically allocated virtual base::Function instances.

Template Parameters
Rfunction return type

Member Typedef Documentation

◆ Type

template<typename R >
typedef R pixled::FctWrapper< R >::Type

Function return type.

Constructor & Destructor Documentation

◆ FctWrapper() [1/4]

template<typename R >
pixled::FctWrapper< R >::FctWrapper ( const base::Function< R > &  fct)
inline

Initializes this wrapper with a copy of the input function.

Doing so, this FctWrapper automatically takes the ownership of a dynamically allocated copy of fct, that does not need to be dynamically allocated and that can be safely destroyed once this FctWrapper has been initialized.

Parameters
fctfunction to wrap

◆ FctWrapper() [2/4]

template<typename R >
pixled::FctWrapper< R >::FctWrapper ( value)
inline

Initializes this FctWrapper with a Constant value.

Parameters
valuevalue of the Constant

◆ FctWrapper() [3/4]

template<typename R >
pixled::FctWrapper< R >::FctWrapper ( const FctWrapper< R > &  other)
inline

FctWrapper copy constructor.

This FctWrapper is initialized with a copy of the wrapped function of other, that is left unchanged.

Parameters
otherFctWrapper to copy from

◆ FctWrapper() [4/4]

template<typename R >
pixled::FctWrapper< R >::FctWrapper ( FctWrapper< R > &&  other)
inline

FctWrapper move constructor.

This FctWrapper is initialized with the wrapped function of other, that is left dangling.

Parameters
otherFctWrapper to move from

◆ ~FctWrapper()

template<typename R >
pixled::FctWrapper< R >::~FctWrapper ( )
inline

FctWrapper destructor.

If this FctWrapper is not dangling, the internal function is destroyed.

Member Function Documentation

◆ operator=() [1/2]

template<typename R >
FctWrapper& pixled::FctWrapper< R >::operator= ( const FctWrapper< R > &  other)
inline

FctWrapper copy assignment.

If this FctWrapper is not dangling, the internal function is destroyed.

Then, the internal function is replaced with a copy of the wrapped function of other, that is left unchanged.

Parameters
otherFctWrapper to copy from

◆ operator=() [2/2]

template<typename R >
FctWrapper& pixled::FctWrapper< R >::operator= ( FctWrapper< R > &&  other)
inline

FctWrapper move assignment.

If this FctWrapper is not dangling, the internal function is destroyed.

Then, the internal function is replaced with the the wrapped function of other, that is left dangling.

Parameters
otherFctWrapper to move from

◆ operator*()

template<typename R >
const base::Function<R>& pixled::FctWrapper< R >::operator* ( ) const
inline

Indirection operator.

Returns a reference to the wrapped function.

Returns
wrapped function

◆ get()

template<typename R >
const base::Function<R>& pixled::FctWrapper< R >::get ( ) const
inline

Gets a reference to the wrapped function.


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