List of all members | Public Member Functions | Public Attributes | Private Attributes
mdet::Channel::Discriminator::Proxy< Functor > Class Template Referenceabstract

Templated specialization of the mdet::Channel::Discriminator::Callable interface. More...

#include <Channel.h>

Inheritance diagram for mdet::Channel::Discriminator::Proxy< Functor >:
Inheritance graph
[legend]

Public Member Functions

virtual CallableClone () const =0
 To allow proper copy semantics (see implemetation). More...
 
double operator() (double t) const
 Define the interface via which we will make the calls. More...
 
 Proxy (const Functor &f)
 

Public Attributes

Channel::Discriminator::Callableconst
 

Private Attributes

const Functor & fFunctor
 

Detailed Description

template<class Functor>
class mdet::Channel::Discriminator::Proxy< Functor >

Templated specialization of the mdet::Channel::Discriminator::Callable interface.

The template argument provides the specific type of the object that provides the real final target function; object to which a reference is kept.

Note that, at last, in mdet::Channel::Discriminator::operator()(double t) the underlying type of the final object resolving the call is not known (allowing to skip what would have been a template parameter in the hosting class).

The combination of mdet::Channel::Discriminator::Callable and mdet::Channel::Discriminator::Proxy corresponds to a pattern better exemplified by Boost's shared_ptr. See http://www.artima.com/cppsource/top_cpp_aha_moments.html http://tinyurl.com/r66ql

Definition at line 101 of file MDetector/Channel.h.

Constructor & Destructor Documentation

template<class Functor>
mdet::Channel::Discriminator::Proxy< Functor >::Proxy ( const Functor &  f)
inline

Definition at line 103 of file MDetector/Channel.h.

Member Function Documentation

virtual Callable* mdet::Channel::Discriminator::Callable::Clone ( ) const
pure virtualinherited

To allow proper copy semantics (see implemetation).

template<class Functor>
double mdet::Channel::Discriminator::Proxy< Functor >::operator() ( double  t) const
inlinevirtual

Define the interface via which we will make the calls.

Implements mdet::Channel::Discriminator::Callable.

Definition at line 104 of file MDetector/Channel.h.

References mdet::Channel::Discriminator::Proxy< Functor >::fFunctor.

Member Data Documentation

template<class Functor>
Channel::Discriminator::Callable* mdet::Channel::Discriminator::Proxy< Functor >::const
Initial value:
{
return new Channel::Discriminator::Proxy<Functor>(fFunctor)

Definition at line 110 of file MDetector/Channel.h.

template<class Functor>
const Functor& mdet::Channel::Discriminator::Proxy< Functor >::fFunctor
private

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

, generated on Tue Sep 26 2023.