cairomm 1.19.1
Cairo::Path::const_iterator Class Reference

A custom const_iterator for iterating over a Path. More...

#include <cairomm/path.h>

Public Types

using iterator_category = std::forward_iterator_tag
using value_type = const Element
using difference_type = std::ptrdiff_t
using pointer = const Element*
using reference = const Element&

Public Member Functions

bool operator== (const const_iterator & iter) const
bool operator!= (const const_iterator & iter) const
const_iteratoroperator++ ()
const_iterator operator++ (int)
reference operator* ()
pointer operator-> ()

Protected Member Functions

 const_iterator (cairo_path_data_t * path_data)

Protected Attributes

Element m_node

Detailed Description

A custom const_iterator for iterating over a Path.

This is made slightly complicated because each element can have different numbers of sub-elements, so advancing the const_iterator must advance the base pointer a different amount based on the current element.

Also, because of the way the base cairo path structure is set up, you can only traverse the list forward, because the only guarantee about the structure is that the first element is a header type which tells the location of the next header.

Since cairomm 1.20
Examples
path-iter.cc.

Member Typedef Documentation

◆ difference_type

◆ iterator_category

◆ pointer

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ const_iterator()

Cairo::Path::const_iterator::const_iterator ( cairo_path_data_t * path_data)
protected

Member Function Documentation

◆ operator!=()

bool Cairo::Path::const_iterator::operator!= ( const const_iterator & iter) const
inline

◆ operator*()

reference Cairo::Path::const_iterator::operator* ( )
inline

◆ operator++() [1/2]

const_iterator & Cairo::Path::const_iterator::operator++ ( )

◆ operator++() [2/2]

const_iterator Cairo::Path::const_iterator::operator++ ( int )

◆ operator->()

pointer Cairo::Path::const_iterator::operator-> ( )
inline

◆ operator==()

bool Cairo::Path::const_iterator::operator== ( const const_iterator & iter) const
inline

Member Data Documentation

◆ m_node

Element Cairo::Path::const_iterator::m_node
protected

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