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

A wrapper to provide access to objects through C-arrays of pointers. More...

#include <mbl_data_array_ptr_wrapper.h>

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

List of all members.

Public Member Functions

 mbl_data_array_ptr_wrapper ()
 Default constructor.
 mbl_data_array_ptr_wrapper (const T *const *data, unsigned long n)
 Constructor.
 mbl_data_array_ptr_wrapper (const vcl_vector< const T * > &data)
 Constructor.
void set (const T *const *data, unsigned long n)
 Initialise to return elements from data[i].
virtual ~mbl_data_array_ptr_wrapper ()
 Default destructor.
virtual unsigned long size () const
 Number of objects available.
const T *const * data () const
 Return pointer to start of data array.
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

const T *const * data_
unsigned long n_
unsigned long index_

Detailed Description

template<class T>
class mbl_data_array_ptr_wrapper< T >

A wrapper to provide access to objects through C-arrays of pointers.

Definition at line 17 of file mbl_data_array_ptr_wrapper.h.


Constructor & Destructor Documentation

Default constructor.

Definition at line 15 of file mbl_data_array_ptr_wrapper.txx.

template<class T >
mbl_data_array_ptr_wrapper< T >::mbl_data_array_ptr_wrapper ( const T *const *  data,
unsigned long  n 
)

Constructor.

Sets up object to return n examples beginning at data[0]. The data must be kept in scope, this does not take a copy.

Definition at line 22 of file mbl_data_array_ptr_wrapper.txx.

template<class T >
mbl_data_array_ptr_wrapper< T >::mbl_data_array_ptr_wrapper ( const vcl_vector< const T * > &  data)

Constructor.

Sets up object to wrap a vcl_vector. The data must be kept in scope, this does not take a copy.

Definition at line 31 of file mbl_data_array_ptr_wrapper.txx.

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

Default destructor.

Definition at line 54 of file mbl_data_array_ptr_wrapper.txx.


Member Function Documentation

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

Create copy on heap and return base pointer.

Implements mbl_data_wrapper< T >.

Definition at line 96 of file mbl_data_array_ptr_wrapper.txx.

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

Return current object.

Implements mbl_data_wrapper< T >.

Definition at line 74 of file mbl_data_array_ptr_wrapper.txx.

template<class T>
const T* const* mbl_data_array_ptr_wrapper< T >::data ( ) const [inline]

Return pointer to start of data array.

Definition at line 48 of file mbl_data_array_ptr_wrapper.h.

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

Return current index.

First example has index 0

Implements mbl_data_wrapper< T >.

Definition at line 88 of file mbl_data_array_ptr_wrapper.txx.

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

Name of the class.

Implements mbl_data_wrapper< T >.

template<class T >
bool mbl_data_array_ptr_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 118 of file mbl_data_array_ptr_wrapper.txx.

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

Move to next object, returning true if is valid.

Implements mbl_data_wrapper< T >.

Definition at line 81 of file mbl_data_array_ptr_wrapper.txx.

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

Reset so that current() returns first object.

Implements mbl_data_wrapper< T >.

Definition at line 67 of file mbl_data_array_ptr_wrapper.txx.

template<class T >
void mbl_data_array_ptr_wrapper< T >::set ( const T *const *  data,
unsigned long  n 
)

Initialise to return elements from data[i].

Sets up object to return n examples beginning at data[0]. The data must be kept in scope, this does not take a copy.

Definition at line 44 of file mbl_data_array_ptr_wrapper.txx.

template<class T >
void mbl_data_array_ptr_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 104 of file mbl_data_array_ptr_wrapper.txx.

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

Number of objects available.

Implements mbl_data_wrapper< T >.

Definition at line 60 of file mbl_data_array_ptr_wrapper.txx.


Member Data Documentation

template<class T>
const T* const* mbl_data_array_ptr_wrapper< T >::data_ [private]

Definition at line 19 of file mbl_data_array_ptr_wrapper.h.

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

Definition at line 21 of file mbl_data_array_ptr_wrapper.h.

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

Definition at line 20 of file mbl_data_array_ptr_wrapper.h.


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