\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.12 - 2D Arrangements
CGAL::Arr_consolidated_curve_data_traits_2< Traits, Data >::Data_container Class Reference

#include <CGAL/Arr_consolidated_curve_data_traits_2.h>

Definition

The Data_container class nested within the consolidated curve-data traits and associated with the Traits::X_monotone_curve_2 type is maintained as a list with unique data objects.

This representation is simple and efficient in terms of memory consumption. It also requires that the Data class supports only the equality operator. Note however that most set operations require linear time.

Creation

 Data_container ()
 default constructor.
 
 Data_container (const Data &data)
 constructs set containing a single data object.
 

Access Functions

std::size_t size () const
 returns the number of data objects in the set.
 
Data_iterator begin () const
 returns an iterator pointing to the first data object.
 
Data_iterator end () const
 returns a past-the-end iterator for the data objects.
 
const Data & front () const
 returns the first data object inserted into the set. More...
 
const Data & back () const
 returns the last data object inserted into the set. More...
 

Predicates

bool operator== (const Data_container &other) const
 check if the two sets contain the same data objects (regardless of order).
 
Data_iterator find (const Data &data)
 find the given data object in the set and returns an iterator for this object, or end() if it is not found.
 

Modifiers

bool insert (const Data &data)
 inserts the given data object into the set. More...
 
bool erase (const Data &data)
 erases the given data object from the set. More...
 
void clear ()
 clears the set.
 

Member Function Documentation

◆ back()

template<typename Traits , typename Data >
const Data& CGAL::Arr_consolidated_curve_data_traits_2< Traits, Data >::Data_container::back ( ) const

returns the last data object inserted into the set.

Precondition
The number of data objects is not \( 0\).

◆ erase()

template<typename Traits , typename Data >
bool CGAL::Arr_consolidated_curve_data_traits_2< Traits, Data >::Data_container::erase ( const Data &  data)

erases the given data object from the set.

Returns true on success, or false if the set does not contain the object.

◆ front()

template<typename Traits , typename Data >
const Data& CGAL::Arr_consolidated_curve_data_traits_2< Traits, Data >::Data_container::front ( ) const

returns the first data object inserted into the set.

Precondition
The number of data objects is not \( 0\).

◆ insert()

template<typename Traits , typename Data >
bool CGAL::Arr_consolidated_curve_data_traits_2< Traits, Data >::Data_container::insert ( const Data &  data)

inserts the given data object into the set.

Returns true on success, or false if the set already contains the object.