CVR-Lib last update 20 Sep 2009

cvr::channelProcessingInterface< T > Class Template Reference
[Programming interfaces]

Class channelProcessingInterface. More...

#include <cvrChannelProcessingInterface.h>

Inheritance diagram for cvr::channelProcessingInterface< T >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~channelProcessingInterface ()
virtual bool apply (channel_type &srcdest) const =0
virtual bool apply (const channel_type &src, channel_type &dest) const =0


Detailed Description

template<typename T>
class cvr::channelProcessingInterface< T >

Class channelProcessingInterface.

Very simple interface to allow virtualization of classes that transform a channel into another one of the same type.

Note that it is required that the apply methods do not alter the internal state of the class.


Constructor & Destructor Documentation

template<typename T>
virtual cvr::channelProcessingInterface< T >::~channelProcessingInterface (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<typename T>
virtual bool cvr::channelProcessingInterface< T >::apply ( const channel_type &  src,
channel_type &  dest 
) const [pure virtual]

On-copy processing apply.

The inherited methods take the src channel and process it leaving the result in the dest channel.

Parameters:
src channel with the source data.
dest channel where the result will be left.
Returns:
true if apply successful or false otherwise.

template<typename T>
virtual bool cvr::channelProcessingInterface< T >::apply ( channel_type &  srcdest  )  const [pure virtual]

On-place processing apply.

The inherited methods should take the srcdest channel, process it in some way, and on the same channel leave the result. No restrictions are imposed on whether the memory block of the resulting channel will be the same that the one in the original channel. As a matter of fact, it usually won't be.

If you need to ensure the memory constancy, and assuming the resulting channel will always have the same size than the original one, then you can use the following code:

 channelProcessingInterfaceInheritedClass<T> theFunctor;
 channel<T> tmp;
 theFunctor.apply(srcdest,tmp);
 srcdest.fill(tmp)

which of course will be slower as it requires to copy all the data of the result in the original channel.

Parameters:
srcdest channel with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.


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

Generated on Sun Sep 20 22:08:44 2009 for CVR-Lib by Doxygen 1.5.8