RandomAccessNDLocatorConcept Struct Template Reference
[N-Dimensional Locator]

#include <gil_concept.hpp>

List of all members.


Detailed Description

template<typename Loc>
struct RandomAccessNDLocatorConcept< Loc >

N-dimensional locator over immutable values.

template <typename Loc>
concept RandomAccessNDLocatorConcept : ValueType<Loc> {    
    typename value_type;        // value over which the locator navigates
    typename reference;         // result of dereferencing
    typename difference_type; where PointNDConcept<difference_type>; // return value of operator-.
    typename const_t;           // same as Loc, but operating over immutable values
    typename cached_location_t; // type to store relative location (for efficient repeated access)
    typename domain_t = value_type;
    typename point_t  = difference_type;
    
    static const size_t num_dimensions; // dimensionality of the locator
    where num_dimensions = point_t::num_dimensions;
    
    // The difference_type and iterator type along each dimension. The iterators may only differ in 
    // difference_type. Their value_type must be the same as Loc::value_type
    template <size_t D> struct axis {
        typename coord_t = point_t::axis<D>::coord_t;
        typename iterator; where RandomAccessTraversalConcept<iterator>; // iterator along D-th axis.
        where iterator::value_type == value_type;
    };

    // Defines the type of a locator similar to this type, except it invokes Deref upon dereferencing
    template <PixelDereferenceAdaptorConcept Deref> struct add_deref {
        typename type;        where RandomAccessNDLocatorConcept<type>;
        static type make(const Loc& loc, const Deref& deref);
    };
    
    Loc& operator+=(const difference_type&);
    Loc& operator-=(const difference_type&);
    Loc operator+(const difference_type&) const;
    Loc operator-(const difference_type&) const;
    
    reference operator*() const;
    reference operator[](const difference_type&) const;
 
    // Storing relative location for faster repeated access and accessing it   
    cached_location_t Loc::cache_location(const difference_type&) const;
    reference operator[](const cached_location_t&) const;
    
    // Accessing iterators along a given dimension at the current location or at a given offset
    template <size_t D> axis<D>::iterator&       Loc::axis_iterator();
    template <size_t D> axis<D>::iterator const& Loc::axis_iterator() const;
    template <size_t D> axis<D>::iterator        Loc::axis_iterator(const difference_type&) const;
};


Public Member Functions

void constraints ()

Public Attributes

Loc loc

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

Copyright © 2006 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google