Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::basic_quadindex< IndexType > Struct Template Reference

A tuple of four indices. More...

#include <geogram/mesh/index.h>

Public Types

enum  KeepOrderType { KEEP_ORDER }
 This type is used to overload basic_quadindex constructors with versions that keep the order of the stored indices. More...
 

Public Member Functions

 basic_quadindex ()
 Constructs a new uninitialized basic_quadindex.
 
 basic_quadindex (IndexType i, IndexType j, IndexType k, IndexType l)
 Creates a basic_quadindex from four integers. More...
 
 basic_quadindex (IndexType i, IndexType j, IndexType k, IndexType l, KeepOrderType order)
 Creates a basic_quadindex from four integers and keeps their order. More...
 
bool operator< (const basic_quadindex< IndexType > &rhs) const
 Compares two basic_quadindex. More...
 
bool operator== (const basic_quadindex< IndexType > &rhs) const
 Compares two basic_quadindex. More...
 
bool operator!= (const basic_quadindex< IndexType > &rhs) const
 Compares two basic_quadindex. More...
 
 basic_quadindex (const basic_quadindex< IndexType > &rhs)=default
 Constructs a basic_quadindex from another one. More...
 
basic_quadindex< IndexType > & operator= (const basic_quadindex< IndexType > &rhs)=default
 Assigns a basic_quadindex to this one. More...
 

Public Attributes

IndexType indices [4]
 The array of 4 indices.
 

Related Functions

(Note that these are not member functions.)

template<class IndexType >
std::ostream & operator<< (std::ostream &out, const basic_quadindex< IndexType > &Q)
 Writes a basic_quadindex to a stream. More...
 

Detailed Description

template<class IndexType>
struct GEO::basic_quadindex< IndexType >

A tuple of four indices.

Can be used as a key in associative data structures (std::map, std::set). The indices are defined by IndexType, generally signed or unsigned integers.

Template Parameters
IndexTypetype of the indices

Definition at line 458 of file index.h.

Member Enumeration Documentation

◆ KeepOrderType

template<class IndexType >
enum GEO::basic_quadindex::KeepOrderType

This type is used to overload basic_quadindex constructors with versions that keep the order of the stored indices.

Enumerator
KEEP_ORDER 

Value to pass to basic_quadindex ordered constructor

Definition at line 469 of file index.h.

Constructor & Destructor Documentation

◆ basic_quadindex() [1/3]

template<class IndexType >
GEO::basic_quadindex< IndexType >::basic_quadindex ( IndexType  i,
IndexType  j,
IndexType  k,
IndexType  l 
)
inline

Creates a basic_quadindex from four integers.

The integers are reordered.

Parameters
[in]ifirst integer
[in]jsecond integer
[in]kthird integer
[in]lfourth integer

Definition at line 488 of file index.h.

◆ basic_quadindex() [2/3]

template<class IndexType >
GEO::basic_quadindex< IndexType >::basic_quadindex ( IndexType  i,
IndexType  j,
IndexType  k,
IndexType  l,
KeepOrderType  order 
)
inline

Creates a basic_quadindex from four integers and keeps their order.

The integers are not sorted.

Parameters
[in]ifirst integer
[in]jsecond integer
[in]kthird integer
[in]lfourth integer
[in]orderargument of type KeepOrderType used to select the right constructor. Use basic_quadindex::KEEP_ORDER for this argument.

Definition at line 513 of file index.h.

◆ basic_quadindex() [3/3]

template<class IndexType >
GEO::basic_quadindex< IndexType >::basic_quadindex ( const basic_quadindex< IndexType > &  rhs)
default

Constructs a basic_quadindex from another one.

Parameters
[in]rhsthe basic_quadindex this basic_quadindex should be copied from

Member Function Documentation

◆ operator!=()

template<class IndexType >
bool GEO::basic_quadindex< IndexType >::operator!= ( const basic_quadindex< IndexType > &  rhs) const
inline

Compares two basic_quadindex.

Parameters
[in]rhsthe basic_quadindex to compare this basic_quadindex with.
Returns
true if one of the indices in rhs differs from the index in this basic_quadindex at the same position, false otherwise.

Definition at line 569 of file index.h.

◆ operator<()

template<class IndexType >
bool GEO::basic_quadindex< IndexType >::operator< ( const basic_quadindex< IndexType > &  rhs) const
inline

Compares two basic_quadindex.

Parameters
[in]rhsthe basic_quadindex to compares this basic_quadindex with.
Returns
true if rhs is smaller than this basic_quadindex according to the lexicographic order, false otherwise.

Definition at line 534 of file index.h.

◆ operator=()

template<class IndexType >
basic_quadindex<IndexType>& GEO::basic_quadindex< IndexType >::operator= ( const basic_quadindex< IndexType > &  rhs)
default

Assigns a basic_quadindex to this one.

Parameters
[in]rhsthe basic_quadindex this basic_quadindex should be assigned from
Returns
a reference to this basic_quadindex

◆ operator==()

template<class IndexType >
bool GEO::basic_quadindex< IndexType >::operator== ( const basic_quadindex< IndexType > &  rhs) const
inline

Compares two basic_quadindex.

Parameters
[in]rhsthe basic_quadindex to compare this basic_quadindex with.
Returns
true of all indices of this basic_quadindex correspond to the indices in rhs at the same positions, false otherwise.

Definition at line 553 of file index.h.

Friends And Related Function Documentation

◆ operator<<()

template<class IndexType >
std::ostream & operator<< ( std::ostream &  out,
const basic_quadindex< IndexType > &  Q 
)
related

Writes a basic_quadindex to a stream.

Displays all the indices of the basic_quadindex Q.

Parameters
[in]outthe output stream
[in]Qthe basic_quadindex to write
Template Parameters
IndexTypetype of the indices
Returns
a reference to the output stream out

Definition at line 617 of file index.h.


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