[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
|   | VectorAccessor [Data Accessors] |  | 
Accessor for items that are STL compatible vectors. More...
#include <vigra/accessor.hxx>

| Public Types | |
| typedef VECTOR::value_type | component_type | 
| Public Member Functions | |
| template<class ITERATOR, class DIFFERENCE> | |
| component_type const & | getComponent (ITERATOR const &i, DIFFERENCE const &diff, int idx) const | 
| template<class ITERATOR> | |
| component_type const & | getComponent (ITERATOR const &i, int idx) const | 
| template<class V, class ITERATOR, class DIFFERENCE> | |
| void | setComponent (V const &value, ITERATOR const &i, DIFFERENCE const &diff, int idx) const | 
| template<class V, class ITERATOR> | |
| void | setComponent (V const &value, ITERATOR const &i, int idx) const | 
It encapsulates access to a vector's access functionality.
Usage:
#include <vigra/accessor.hxx>
 Namespace: vigra
The accessor has two modes of operation:
begin() and end() functions:
typedef std::list<std::vector<int> > ListOfVectors; ListOfVectors ll; ... typedef vigra::SequenceAccessor<ListOfVectors::value_type> ListOfVectorsAccessor; ListOfVectorsAccessor a; for(ListOfVectors::iterator li = ll.begin(); li != ll.end(); ++li) { for(ListOfVectorsAccessor::iterator i = a.begin(li); i != a.end(li); ++i) { *i = 10; } }
operator[] ): typedef std::list<std::vector<int> > ListOfVectors; ListOfVectors ll; ... typedef vigra::SequenceAccessor<ListOfVectors::value_type> ListOfVectorsAccessor; ListOfVectorsAccessor a; for(ListOfVectors::iterator li = ll.begin(); li != ll.end(); ++li) { for(int i = 0; i != a.size(li); ++i) { a.setComponent(10, li, i); } }
Required Interface:
    VECTOR v;
    VECTOR::iterator i;
    value_type d;
    int index;
    d = v[index];
    v[index] = d;
    i = v.begin();
    i = v.end();
    v.size();
| typedef VECTOR::value_type component_type | 
the vector's value_type
Reimplemented from SequenceAccessor< VECTOR >.
Reimplemented in RGBAccessor.
| component_type const& getComponent | ( | ITERATOR const & | i, | |
| DIFFERENCE const & | diff, | |||
| int | idx | |||
| ) | const | 
Read the component data at given vector index at an offset of given iterator position
| component_type const& getComponent | ( | ITERATOR const & | i, | |
| int | idx | |||
| ) | const | 
Read the component data at given vector index at given iterator position
| template<class V, class ITERATOR, class DIFFERENCE> | ||||
| void setComponent | ( | V const & | value, | |
| ITERATOR const & | i, | |||
| DIFFERENCE const & | diff, | |||
| int | idx | |||
| ) | const | |||
Set the component data at given vector index at an offset of given iterator position. The type V of the passed in value is automatically converted to component_type. In case of a conversion floating point -> intergral this includes rounding and clipping. 
| template<class V, class ITERATOR> | ||||
| void setComponent | ( | V const & | value, | |
| ITERATOR const & | i, | |||
| int | idx | |||
| ) | const | |||
Set the component data at given vector index at given iterator position. The type V of the passed in value is automatically converted to component_type. In case of a conversion floating point -> intergral this includes rounding and clipping. 
| 
© Ullrich Köthe     (ullrich.koethe@iwr.uni-heidelberg.de)  | 
html generated using doxygen and Python
 |