A subset of an existing mbl_data_wrapper. More...
#include <mbl_selected_data_wrapper.h>
Public Member Functions | |
mbl_selected_data_wrapper (const mbl_selected_data_wrapper< T > &p) | |
Copy constructor. | |
mbl_selected_data_wrapper (const mbl_data_wrapper< T > &data, const vcl_vector< unsigned > &subset) | |
Constructor. | |
mbl_selected_data_wrapper () | |
Default constructor. | |
virtual | ~mbl_selected_data_wrapper () |
Default destructor. | |
mbl_selected_data_wrapper< T > & | operator= (const mbl_selected_data_wrapper< T > &b) |
Copy operator. | |
void | set (const mbl_data_wrapper< T > &data, const vcl_vector< unsigned > &selection) |
Set the wrappers data. | |
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 | |
mbl_data_wrapper< T > * | data_ |
vcl_vector< unsigned > | selection_ |
unsigned | index_ |
A subset of an existing mbl_data_wrapper.
This wraps another mbl_data_wrapper, and acts like a rearrangement of the original data. The rearrangement does not have to refer to all of the original data, and can refer to the same data more than once.
Definition at line 23 of file mbl_selected_data_wrapper.h.
mbl_selected_data_wrapper< T >::mbl_selected_data_wrapper | ( | const mbl_selected_data_wrapper< T > & | p | ) |
Copy constructor.
Definition at line 31 of file mbl_selected_data_wrapper.txx.
mbl_selected_data_wrapper< T >::mbl_selected_data_wrapper | ( | const mbl_data_wrapper< T > & | data, |
const vcl_vector< unsigned > & | subset | ||
) |
Constructor.
This will take its own copy of selection and the data wrapper, but not the underlying data.
Definition at line 22 of file mbl_selected_data_wrapper.txx.
mbl_selected_data_wrapper< T >::mbl_selected_data_wrapper | ( | ) |
Default constructor.
Definition at line 15 of file mbl_selected_data_wrapper.txx.
mbl_selected_data_wrapper< T >::~mbl_selected_data_wrapper | ( | ) | [virtual] |
Default destructor.
Definition at line 50 of file mbl_selected_data_wrapper.txx.
mbl_data_wrapper< T > * mbl_selected_data_wrapper< T >::clone | ( | ) | const [virtual] |
Create copy on heap and return base pointer.
This will create an independent iterator on the underlying data. The original data is not copied. Be careful of destruction of underlying data.
Implements mbl_data_wrapper< T >.
Definition at line 119 of file mbl_selected_data_wrapper.txx.
const T & mbl_selected_data_wrapper< T >::current | ( | ) | [virtual] |
Return current object.
Implements mbl_data_wrapper< T >.
Definition at line 91 of file mbl_selected_data_wrapper.txx.
unsigned long mbl_selected_data_wrapper< T >::index | ( | ) | const [virtual] |
Return current index.
First example has index 0
Implements mbl_data_wrapper< T >.
Definition at line 112 of file mbl_selected_data_wrapper.txx.
virtual vcl_string mbl_selected_data_wrapper< T >::is_a | ( | ) | const [virtual] |
Name of the class.
Implements mbl_data_wrapper< T >.
bool mbl_selected_data_wrapper< 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 142 of file mbl_selected_data_wrapper.txx.
bool mbl_selected_data_wrapper< T >::next | ( | ) | [virtual] |
Move to next object, returning true if is valid.
Implements mbl_data_wrapper< T >.
Definition at line 98 of file mbl_selected_data_wrapper.txx.
mbl_selected_data_wrapper< T > & mbl_selected_data_wrapper< T >::operator= | ( | const mbl_selected_data_wrapper< T > & | b | ) |
Copy operator.
Definition at line 57 of file mbl_selected_data_wrapper.txx.
void mbl_selected_data_wrapper< T >::reset | ( | ) | [virtual] |
Reset so that current() returns first object.
Implements mbl_data_wrapper< T >.
Definition at line 82 of file mbl_selected_data_wrapper.txx.
void mbl_selected_data_wrapper< T >::set | ( | const mbl_data_wrapper< T > & | data, |
const vcl_vector< unsigned > & | selection | ||
) |
Set the wrappers data.
This will take its own copy of selection and the data wrapper, but not the underlying data.
Definition at line 39 of file mbl_selected_data_wrapper.txx.
void mbl_selected_data_wrapper< 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 128 of file mbl_selected_data_wrapper.txx.
unsigned long mbl_selected_data_wrapper< T >::size | ( | ) | const [virtual] |
Number of objects available.
Implements mbl_data_wrapper< T >.
Definition at line 75 of file mbl_selected_data_wrapper.txx.
mbl_data_wrapper<T>* mbl_selected_data_wrapper< T >::data_ [private] |
Definition at line 25 of file mbl_selected_data_wrapper.h.
unsigned mbl_selected_data_wrapper< T >::index_ [private] |
Definition at line 27 of file mbl_selected_data_wrapper.h.
vcl_vector<unsigned> mbl_selected_data_wrapper< T >::selection_ [private] |
Definition at line 26 of file mbl_selected_data_wrapper.h.