JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches

iterator over the data in the column of a JKQTPDatastore More...

#include <jkqtpdatastorage.h>

Collaboration diagram for JKQTPColumnIterator:
[legend]

Public Types

typedef const double & const_reference
 
typedef int difference_type
 
typedef std::forward_iterator_tag iterator_category
 
typedef double * pointer
 
typedef double & reference
 
typedef JKQTPColumnIterator self_type
 
typedef double value_type
 

Public Member Functions

 JKQTPColumnIterator ()
 constructs an invalid iterator
 
 JKQTPColumnIterator (const JKQTPColumnIterator &)=default
 
 JKQTPColumnIterator (JKQTPColumnIterator &&)=default
 
size_t getImageColumns () const
 if the data in the column is interpreted as an image, this is the number of columns (x-dimension) of the image
 
QPoint getImagePosition () const
 returns the referenced position/row interpreted as an image pixel, returns (-1,-1) for an invalid operator
 
int getImagePositionX () const
 returns the referenced position/row interpreted as an image pixel, x-component, returns -1 for an invalid operator
 
int getImagePositionY () const
 returns the referenced position/row interpreted as an image pixel, y-component, returns -1 for an invalid operator
 
size_t getImageRows () const
 if the data in the column is interpreted as an image, this is the number of rows (y-dimension) of the image
 
int getPosition () const
 returns the referenced position/row, or -1 for an invalid iterator
 
bool isValid () const
 checks the iterator for validity (i.e. points to an existing column and position is in a valid range)
 
 operator bool () const
 checks the iterator for validity (i.e. points to an existing column and position is in a valid range)
 
bool operator!= (const self_type &rhs) const
 comparison operator (unequals), inverse result of operator==()
 
reference operator* () const
 dereferences the iterator, throws an exception if the iterator is invalid (see isValid() ) or the value does not exist in the column
 
self_type operator+ (difference_type rhs) const
 
self_type operator++ ()
 
self_type operator++ (int)
 
self_type operator+= (int inc)
 
self_type operator- (difference_type rhs) const
 
difference_type operator- (self_type rhs) const
 
self_type operator-- ()
 
self_type operator-- (int)
 
self_type operator-= (int dec)
 
bool operator< (const self_type &rhs) const
 comparison operator (less than)
 
bool operator<= (const self_type &rhs) const
 comparison operator (less than, or equal)
 
JKQTPColumnIteratoroperator= (const JKQTPColumnIterator &)=default
 
JKQTPColumnIteratoroperator= (JKQTPColumnIterator &&)=default
 
bool operator== (const self_type &rhs) const
 comparison operator (equals)
 
bool operator> (const self_type &rhs) const
 comparison operator (larger than)
 
bool operator>= (const self_type &rhs) const
 comparison operator (larger than, or equal)
 
reference operator[] (difference_type off) const
 dereferences the iterator at offset off, throws an exception if the iterator is invalid (see isValid() ) or the value does not exist in the column
 

Protected Member Functions

 JKQTPColumnIterator (JKQTPColumn *col, int startpos=0)
 constructs an iterator for the data represented by col, starting with row startpos
 
JKQTPColumngetColumn ()
 returns the referenced column
 
const JKQTPColumngetColumn () const
 returns the referenced column
 

Private Attributes

JKQTPColumncol_
 references the column this iterator iterates over
 
int pos_
 current row in col_ this iterator points to
 

Friends

class JKQTPColumn
 
class JKQTPColumnConstIterator
 
class JKQTPDatastore
 
self_type operator+ (difference_type off, const self_type &right)
 
self_type operator- (difference_type off, const self_type &right)
 

Detailed Description

iterator over the data in the column of a JKQTPDatastore

See also
JKQTPColumn, JKQTPDatastore::begin(), JKQTPDatastore::end(), JKQTPDatastore, JKQTPConstColumnIterator

Member Typedef Documentation

◆ const_reference

typedef const double& JKQTPColumnIterator::const_reference

◆ difference_type

◆ iterator_category

typedef std::forward_iterator_tag JKQTPColumnIterator::iterator_category

◆ pointer

◆ reference

◆ self_type

◆ value_type

Constructor & Destructor Documentation

◆ JKQTPColumnIterator() [1/4]

JKQTPColumnIterator::JKQTPColumnIterator ( JKQTPColumn col,
int  startpos = 0 
)
inlineprotected

constructs an iterator for the data represented by col, starting with row startpos

◆ JKQTPColumnIterator() [2/4]

JKQTPColumnIterator::JKQTPColumnIterator ( )
inline

constructs an invalid iterator

◆ JKQTPColumnIterator() [3/4]

JKQTPColumnIterator::JKQTPColumnIterator ( const JKQTPColumnIterator )
inlinedefault

◆ JKQTPColumnIterator() [4/4]

JKQTPColumnIterator::JKQTPColumnIterator ( JKQTPColumnIterator &&  )
inlinedefault

Member Function Documentation

◆ getColumn() [1/2]

JKQTPColumn * JKQTPColumnIterator::getColumn ( )
inlineprotected

returns the referenced column

◆ getColumn() [2/2]

const JKQTPColumn * JKQTPColumnIterator::getColumn ( ) const
inlineprotected

returns the referenced column

◆ getImageColumns()

size_t JKQTPColumnIterator::getImageColumns ( ) const
inline

if the data in the column is interpreted as an image, this is the number of columns (x-dimension) of the image

See also
JKQTPColumn::imageColumns

◆ getImagePosition()

QPoint JKQTPColumnIterator::getImagePosition ( ) const
inline

returns the referenced position/row interpreted as an image pixel, returns (-1,-1) for an invalid operator

◆ getImagePositionX()

int JKQTPColumnIterator::getImagePositionX ( ) const
inline

returns the referenced position/row interpreted as an image pixel, x-component, returns -1 for an invalid operator

◆ getImagePositionY()

int JKQTPColumnIterator::getImagePositionY ( ) const
inline

returns the referenced position/row interpreted as an image pixel, y-component, returns -1 for an invalid operator

◆ getImageRows()

size_t JKQTPColumnIterator::getImageRows ( ) const
inline

if the data in the column is interpreted as an image, this is the number of rows (y-dimension) of the image

See also
JKQTPColumn::imageColumns

◆ getPosition()

int JKQTPColumnIterator::getPosition ( ) const
inline

returns the referenced position/row, or -1 for an invalid iterator

◆ isValid()

bool JKQTPColumnIterator::isValid ( ) const
inline

checks the iterator for validity (i.e. points to an existing column and position is in a valid range)

◆ operator bool()

JKQTPColumnIterator::operator bool ( ) const
inline

checks the iterator for validity (i.e. points to an existing column and position is in a valid range)

◆ operator!=()

bool JKQTPColumnIterator::operator!= ( const self_type rhs) const
inline

comparison operator (unequals), inverse result of operator==()

See also
operator==()

◆ operator*()

reference JKQTPColumnIterator::operator* ( ) const
inline

dereferences the iterator, throws an exception if the iterator is invalid (see isValid() ) or the value does not exist in the column

◆ operator+()

self_type JKQTPColumnIterator::operator+ ( difference_type  rhs) const
inline

◆ operator++() [1/2]

self_type JKQTPColumnIterator::operator++ ( )
inline

◆ operator++() [2/2]

self_type JKQTPColumnIterator::operator++ ( int  )
inline

◆ operator+=()

self_type JKQTPColumnIterator::operator+= ( int  inc)
inline

◆ operator-() [1/2]

self_type JKQTPColumnIterator::operator- ( difference_type  rhs) const
inline

◆ operator-() [2/2]

difference_type JKQTPColumnIterator::operator- ( self_type  rhs) const
inline

◆ operator--() [1/2]

self_type JKQTPColumnIterator::operator-- ( )
inline

◆ operator--() [2/2]

self_type JKQTPColumnIterator::operator-- ( int  )
inline

◆ operator-=()

self_type JKQTPColumnIterator::operator-= ( int  dec)
inline

◆ operator<()

bool JKQTPColumnIterator::operator< ( const self_type rhs) const
inline

comparison operator (less than)

rules:

  • ivalid iterators are never smaller than valid operators
  • two valid operator must reference the same column
  • a valid operator is smaller than another, if it points to a pos_ before another
See also
operator<=(), operator>(), operator>=()

◆ operator<=()

bool JKQTPColumnIterator::operator<= ( const self_type rhs) const
inline

comparison operator (less than, or equal)

See also
operator==(), operator<(), operator>(), operator>=()

◆ operator=() [1/2]

JKQTPColumnIterator & JKQTPColumnIterator::operator= ( const JKQTPColumnIterator )
inlinedefault

◆ operator=() [2/2]

JKQTPColumnIterator & JKQTPColumnIterator::operator= ( JKQTPColumnIterator &&  )
inlinedefault

◆ operator==()

bool JKQTPColumnIterator::operator== ( const self_type rhs) const
inline

comparison operator (equals)

two iterators are equal, if:

  • they are both invalid (see isValid() )
  • they point to the same column and are both invalid (isValid()) or equal to end()
  • they point to the same column and the same row therein
See also
operator!=()

◆ operator>()

bool JKQTPColumnIterator::operator> ( const self_type rhs) const
inline

comparison operator (larger than)

rules:

  • ivalid iterators are always larger than valid operators
  • two valid operator must reference the same column
  • a valid operator is smaller than another, if it points to a pos_ before another
See also
operator<=(), operator<(), operator>=()

◆ operator>=()

bool JKQTPColumnIterator::operator>= ( const self_type rhs) const
inline

comparison operator (larger than, or equal)

See also
operator==(), operator<(), operator>(), operator<=()

◆ operator[]()

reference JKQTPColumnIterator::operator[] ( difference_type  off) const
inline

dereferences the iterator at offset off, throws an exception if the iterator is invalid (see isValid() ) or the value does not exist in the column

Friends And Related Symbol Documentation

◆ JKQTPColumn

friend class JKQTPColumn
friend

◆ JKQTPColumnConstIterator

friend class JKQTPColumnConstIterator
friend

◆ JKQTPDatastore

friend class JKQTPDatastore
friend

◆ operator+

self_type operator+ ( difference_type  off,
const self_type right 
)
friend

◆ operator-

self_type operator- ( difference_type  off,
const self_type right 
)
friend

Member Data Documentation

◆ col_

JKQTPColumn* JKQTPColumnIterator::col_
private

references the column this iterator iterates over

◆ pos_

int JKQTPColumnIterator::pos_
private

current row in col_ this iterator points to


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