Public Member Functions | Private Attributes
mbl_data_wrapper_mixer< T > Class Template Reference

Concatenate together data in two or more mbl_data_wrapper objects. More...

#include <mbl_data_wrapper_mixer.h>

Inheritance diagram for mbl_data_wrapper_mixer< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mbl_data_wrapper_mixer ()
 Default constructor.
 mbl_data_wrapper_mixer (mbl_data_wrapper< T > **wrapper, unsigned long n_wrappers)
 Constructor.
 mbl_data_wrapper_mixer (vcl_vector< mbl_data_wrapper< T > * > wrapper)
 Constructor.
 mbl_data_wrapper_mixer (mbl_data_wrapper< T > &wrapper1, mbl_data_wrapper< T > &wrapper2)
 Construct to mix two data wrappers.
void set (mbl_data_wrapper< T > **wrapper, unsigned long n_wrappers)
 Sets up object to return examples from wrapper[i] (i=0..n-1) in turn.
virtual ~mbl_data_wrapper_mixer ()
 Default destructor.
virtual unsigned long size () const
 Number of objects available.
virtual void reset ()
 Reset so that current() returns first object.
virtual const T & current ()
 Return current object.
virtual bool next ()
 Move to next object, returning true if is valid.
virtual unsigned long index () const
 Return current index.
virtual void set_index (unsigned long n)
 Move to element n.
virtual mbl_data_wrapper< T > * clone () const
 Create copy on heap and return base pointer.
virtual vcl_string is_a () const
 Name of the class.
virtual bool is_class (vcl_string const &s) const
 True if this is (or is derived from) class named s.

Private Attributes

vcl_vector< mbl_data_wrapper
< T > * > 
wrapper_
unsigned long n_
unsigned long index_
unsigned long current_wrapper_

Detailed Description

template<class T>
class mbl_data_wrapper_mixer< T >

Concatenate together data in two or more mbl_data_wrapper objects.

Definition at line 17 of file mbl_data_wrapper_mixer.h.


Constructor & Destructor Documentation

template<class T >
mbl_data_wrapper_mixer< T >::mbl_data_wrapper_mixer ( )

Default constructor.

Definition at line 15 of file mbl_data_wrapper_mixer.txx.

template<class T >
mbl_data_wrapper_mixer< T >::mbl_data_wrapper_mixer ( mbl_data_wrapper< T > **  wrapper,
unsigned long  n_wrappers 
)

Constructor.

Sets up object to return examples from wrapper[i] (i=0..n-1) in turn The wrappers must be kept in scope, this does not take a copy.

Definition at line 22 of file mbl_data_wrapper_mixer.txx.

template<class T >
mbl_data_wrapper_mixer< T >::mbl_data_wrapper_mixer ( vcl_vector< mbl_data_wrapper< T > * >  wrapper)

Constructor.

Sets up object to return examples from wrapper[i] (i=0..n-1) in turn The wrappers must be kept in scope, this does not take a copy.

Definition at line 29 of file mbl_data_wrapper_mixer.txx.

template<class T >
mbl_data_wrapper_mixer< T >::mbl_data_wrapper_mixer ( mbl_data_wrapper< T > &  wrapper1,
mbl_data_wrapper< T > &  wrapper2 
)

Construct to mix two data wrappers.

Constructor.

Sets up object to return examples from wrapper1 then wrapper2 The wrappers must be kept in scope, this does not take a copy (Pointers are retained).

Definition at line 36 of file mbl_data_wrapper_mixer.txx.

template<class T >
mbl_data_wrapper_mixer< T >::~mbl_data_wrapper_mixer ( ) [virtual]

Default destructor.

Definition at line 64 of file mbl_data_wrapper_mixer.txx.


Member Function Documentation

template<class T >
mbl_data_wrapper< T > * mbl_data_wrapper_mixer< T >::clone ( ) const [virtual]

Create copy on heap and return base pointer.

Implements mbl_data_wrapper< T >.

Definition at line 121 of file mbl_data_wrapper_mixer.txx.

template<class T >
const T & mbl_data_wrapper_mixer< T >::current ( ) [virtual]

Return current object.

Implements mbl_data_wrapper< T >.

Definition at line 86 of file mbl_data_wrapper_mixer.txx.

template<class T >
unsigned long mbl_data_wrapper_mixer< T >::index ( ) const [virtual]

Return current index.

First example has index 0

Implements mbl_data_wrapper< T >.

Definition at line 114 of file mbl_data_wrapper_mixer.txx.

template<class T>
virtual vcl_string mbl_data_wrapper_mixer< T >::is_a ( ) const [virtual]

Name of the class.

Implements mbl_data_wrapper< T >.

template<class T >
bool mbl_data_wrapper_mixer< T >::is_class ( vcl_string const &  s) const [virtual]

True if this is (or is derived from) class named s.

Implements mbl_data_wrapper< T >.

Definition at line 151 of file mbl_data_wrapper_mixer.txx.

template<class T >
bool mbl_data_wrapper_mixer< T >::next ( ) [virtual]

Move to next object, returning true if is valid.

Implements mbl_data_wrapper< T >.

Definition at line 93 of file mbl_data_wrapper_mixer.txx.

template<class T >
void mbl_data_wrapper_mixer< T >::reset ( ) [virtual]

Reset so that current() returns first object.

Implements mbl_data_wrapper< T >.

Definition at line 77 of file mbl_data_wrapper_mixer.txx.

template<class T >
void mbl_data_wrapper_mixer< T >::set ( mbl_data_wrapper< T > **  wrapper,
unsigned long  n_wrappers 
)

Sets up object to return examples from wrapper[i] (i=0..n-1) in turn.

Initialise to return elements from data[i].

The wrappers must be kept in scope, this does not take a copy.

Definition at line 47 of file mbl_data_wrapper_mixer.txx.

template<class T >
void mbl_data_wrapper_mixer< T >::set_index ( unsigned long  n) [virtual]

Move to element n.

First example has index 0

Reimplemented from mbl_data_wrapper< T >.

Definition at line 129 of file mbl_data_wrapper_mixer.txx.

template<class T >
unsigned long mbl_data_wrapper_mixer< T >::size ( ) const [virtual]

Number of objects available.

Implements mbl_data_wrapper< T >.

Definition at line 70 of file mbl_data_wrapper_mixer.txx.


Member Data Documentation

template<class T>
unsigned long mbl_data_wrapper_mixer< T >::current_wrapper_ [private]

Definition at line 22 of file mbl_data_wrapper_mixer.h.

template<class T>
unsigned long mbl_data_wrapper_mixer< T >::index_ [private]

Definition at line 21 of file mbl_data_wrapper_mixer.h.

template<class T>
unsigned long mbl_data_wrapper_mixer< T >::n_ [private]

Definition at line 20 of file mbl_data_wrapper_mixer.h.

template<class T>
vcl_vector<mbl_data_wrapper<T> *> mbl_data_wrapper_mixer< T >::wrapper_ [private]

Definition at line 19 of file mbl_data_wrapper_mixer.h.


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