DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::DigitalSetInserter< TDigitalSet > Class Template Reference

Aim: this output iterator class is designed to allow algorithms to insert points in the digital set. Using the assignment operator, even when dereferenced, causes the digital set to insert a point. More...

#include <DGtal/kernel/sets/DigitalSetInserter.h>

Public Types

using iterator_category = std::output_iterator_tag
 
using value_type = void
 
using difference_type = void
 
using pointer = void
 
using reference = void
 

Public Member Functions

 DigitalSetInserter (TDigitalSet &aSet)
 
DigitalSetInserter< TDigitalSet > & operator= (typename TDigitalSet::Point aPoint)
 
DigitalSetInserter< TDigitalSet > & operator* ()
 
DigitalSetInserter< TDigitalSet > & operator++ ()
 
DigitalSetInserter< TDigitalSet > operator++ (int)
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CDigitalSet< TDigitalSet >))
 

Private Attributes

TDigitalSet * mySet
 

Detailed Description

template<typename TDigitalSet>
class DGtal::DigitalSetInserter< TDigitalSet >

Aim: this output iterator class is designed to allow algorithms to insert points in the digital set. Using the assignment operator, even when dereferenced, causes the digital set to insert a point.

Description of template class 'DigitalSetInserter'

Template Parameters
TDigitalSetany model of CDigitalSet
Examples
geometry/curves/exampleGridCurve3d-2.cpp.

Definition at line 65 of file DigitalSetInserter.h.

Member Typedef Documentation

◆ difference_type

template<typename TDigitalSet >
using DGtal::DigitalSetInserter< TDigitalSet >::difference_type = void

Definition at line 75 of file DigitalSetInserter.h.

◆ iterator_category

template<typename TDigitalSet >
using DGtal::DigitalSetInserter< TDigitalSet >::iterator_category = std::output_iterator_tag

Definition at line 73 of file DigitalSetInserter.h.

◆ pointer

template<typename TDigitalSet >
using DGtal::DigitalSetInserter< TDigitalSet >::pointer = void

Definition at line 76 of file DigitalSetInserter.h.

◆ reference

template<typename TDigitalSet >
using DGtal::DigitalSetInserter< TDigitalSet >::reference = void

Definition at line 77 of file DigitalSetInserter.h.

◆ value_type

template<typename TDigitalSet >
using DGtal::DigitalSetInserter< TDigitalSet >::value_type = void

Definition at line 74 of file DigitalSetInserter.h.

Constructor & Destructor Documentation

◆ DigitalSetInserter()

template<typename TDigitalSet >
DGtal::DigitalSetInserter< TDigitalSet >::DigitalSetInserter ( TDigitalSet & aSet)
inlineexplicit

Constructor.

Parameters
aSetany digital set

Definition at line 83 of file DigitalSetInserter.h.

84 : mySet(&aSet) {}

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TDigitalSet >
DGtal::DigitalSetInserter< TDigitalSet >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalSet< TDigitalSet >) )
private

◆ operator*()

template<typename TDigitalSet >
DigitalSetInserter< TDigitalSet > & DGtal::DigitalSetInserter< TDigitalSet >::operator* ( )
inline

Dereference operator

Returns
a reference to *this

Definition at line 100 of file DigitalSetInserter.h.

101 { return *this; }

◆ operator++() [1/2]

template<typename TDigitalSet >
DigitalSetInserter< TDigitalSet > & DGtal::DigitalSetInserter< TDigitalSet >::operator++ ( )
inline

Pre-increment operator

Returns
a reference to *this

Definition at line 106 of file DigitalSetInserter.h.

107 { return *this; }

◆ operator++() [2/2]

template<typename TDigitalSet >
DigitalSetInserter< TDigitalSet > DGtal::DigitalSetInserter< TDigitalSet >::operator++ ( int )
inline

Post-increment operator

Returns
*this

Definition at line 112 of file DigitalSetInserter.h.

113 { return *this; }

◆ operator=()

template<typename TDigitalSet >
DigitalSetInserter< TDigitalSet > & DGtal::DigitalSetInserter< TDigitalSet >::operator= ( typename TDigitalSet::Point aPoint)
inline

Assignment operator.

Parameters
aPointthe point to insert

Definition at line 93 of file DigitalSetInserter.h.

94 { mySet->insert(aPoint); return *this; }
const Point aPoint(3, 4)

References aPoint(), and DGtal::DigitalSetInserter< TDigitalSet >::mySet.

Field Documentation

◆ mySet

template<typename TDigitalSet >
TDigitalSet* DGtal::DigitalSetInserter< TDigitalSet >::mySet
private

Aliasing pointer on the underlying set

Definition at line 121 of file DigitalSetInserter.h.

Referenced by DGtal::DigitalSetInserter< TDigitalSet >::operator=().


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