Loading...
Searching...
No Matches
labelRanges Class Reference

A list of labelRange with constrained list capabilities. More...

#include <labelRanges.H>

Classes

class  const_iterator
 Forward input iterator with const access. More...

Public Types

typedef labelRange value_type
 The value type the list contains.

Public Member Functions

 labelRanges ()=default
 Default construct.
 labelRanges (const labelRanges &)=default
 Default copy construct.
 labelRanges (labelRanges &&)=default
 Default move construct.
labelRangesoperator= (const labelRanges &)=default
 Default copy assignment.
labelRangesoperator= (labelRanges &&)=default
 Default move assignment.
 labelRanges (const label initialCapacity)
 Construct an empty list with given initial capacity.
 labelRanges (const UList< labelRange > &list)
 Copy construct from list of ranges.
 labelRanges (List< labelRange > &&list)
 Move construct from list of ranges.
template<int AnySizeMin>
 labelRanges (DynamicList< labelRange, AnySizeMin > &&list)
 Move construct from list of ranges.
 labelRanges (Istream &is)
 Construct from Istream.
const UList< labelRange > & ranges () const noexcept
 The list of ranges.
void clear () noexcept
 Clear the addressable list of ranges.
bool empty () const noexcept
 True if list of ranges is empty.
void reserve (const label len)
 Reserve space for at least this size.
label totalSize () const noexcept
 The linear size (sum of all the element sizes).
bool contains (const label value) const noexcept
 True if the value is contained within any of the sub-ranges.
bool add (const labelRange &range)
 Add the range to the list.
bool remove (const labelRange &range)
 Remove the range from the list.
template<class... Args>
labelRangeemplace_back (Args &&... args)
 Construct a range element at the end of the list, return reference to the new element.
void sort ()
 Inplace sort of the range elements.
List< label > labels () const
 Return flattened list of all range labels.
label operator[] (const label i) const
 Return the value at linear index 'i', -1 for out-of-range.
const_iterator cbegin () const noexcept
 A const_iterator set to the beginning of the list.
const const_iterator cend () const noexcept
 A const_iterator set to beyond the end of the list.
const_iterator begin () const noexcept
 A const_iterator set to the beginning of the list.
const const_iterator end () const noexcept
 A const_iterator set to beyond the end of the list.
const_iterator cbegin (const label i) const
 Return const_iterator at linear offset i from begin, clamped to [0,size] range.
const_iterator begin (const label i) const
 Return const_iterator at linear offset i from begin, clamped to [0,size] range.
IstreamreadList (Istream &is)
 Read List of labelRange from Istream, discarding contents.
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write List of labelRange, with line-breaks in ASCII when length exceeds shortLen.
bool found (const label value) const
 Same as contains().
template<class... Args>
Foam::labelRangeemplace_back (Args &&... args)

Friends

Istreamoperator>> (Istream &is, labelRanges &list)
 Use the readList() method to read contents from Istream.
Ostreamoperator<< (Ostream &os, const labelRanges &list)
 Write to Ostream. Uses the writeList() method.

Detailed Description

A list of labelRange with constrained list capabilities.

Source files

Definition at line 54 of file labelRanges.H.

Member Typedef Documentation

◆ value_type

The value type the list contains.

Definition at line 83 of file labelRanges.H.

Constructor & Destructor Documentation

◆ labelRanges() [1/8]

labelRanges ( )
default

Default construct.

Referenced by labelRanges(), labelRanges(), operator<<, operator=(), operator=(), and operator>>.

Here is the caller graph for this function:

◆ labelRanges() [2/8]

labelRanges ( const labelRanges & )
default

Default copy construct.

References labelRanges().

Here is the call graph for this function:

◆ labelRanges() [3/8]

labelRanges ( labelRanges && )
default

Default move construct.

References labelRanges().

Here is the call graph for this function:

◆ labelRanges() [4/8]

labelRanges ( const label initialCapacity)
inlineexplicit

Construct an empty list with given initial capacity.

Definition at line 24 of file labelRangesI.H.

◆ labelRanges() [5/8]

labelRanges ( const UList< labelRange > & list)
inlineexplicit

Copy construct from list of ranges.

Definition at line 30 of file labelRangesI.H.

◆ labelRanges() [6/8]

labelRanges ( List< labelRange > && list)
inline

Move construct from list of ranges.

Definition at line 36 of file labelRangesI.H.

◆ labelRanges() [7/8]

template<int AnySizeMin>
labelRanges ( DynamicList< labelRange, AnySizeMin > && list)
inline

Move construct from list of ranges.

Definition at line 43 of file labelRangesI.H.

◆ labelRanges() [8/8]

labelRanges ( Istream & is)
explicit

Construct from Istream.

Member Function Documentation

◆ operator=() [1/2]

labelRanges & operator= ( const labelRanges & )
default

Default copy assignment.

References labelRanges().

Here is the call graph for this function:

◆ operator=() [2/2]

labelRanges & operator= ( labelRanges && )
default

Default move assignment.

References labelRanges().

Here is the call graph for this function:

◆ ranges()

const UList< labelRange > & ranges ( ) const
inlinenoexcept

The list of ranges.

Definition at line 153 of file labelRanges.H.

References Foam::noexcept.

◆ clear()

void clear ( )
inlinenoexcept

Clear the addressable list of ranges.

Definition at line 158 of file labelRanges.H.

References Foam::noexcept.

◆ empty()

bool empty ( ) const
inlinenoexcept

True if list of ranges is empty.

Definition at line 163 of file labelRanges.H.

References Foam::noexcept.

◆ reserve()

void reserve ( const label len)
inline

Reserve space for at least this size.

Definition at line 168 of file labelRanges.H.

◆ totalSize()

Foam::label totalSize ( ) const
inlinenoexcept

The linear size (sum of all the element sizes).

Definition at line 129 of file labelRangesI.H.

References Foam::noexcept, and range.

◆ contains()

bool contains ( const label value) const
inlinenoexcept

True if the value is contained within any of the sub-ranges.

Definition at line 143 of file labelRangesI.H.

References range.

Referenced by found().

Here is the caller graph for this function:

◆ add()

bool add ( const labelRange & range)

Add the range to the list.

References add(), and range.

Referenced by add().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove()

bool remove ( const labelRange & range)

Remove the range from the list.

References range, and remove().

Referenced by remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplace_back() [1/2]

template<class... Args>
labelRange & emplace_back ( Args &&... args)
inline

Construct a range element at the end of the list, return reference to the new element.

References args, emplace_back(), and sort().

Referenced by emplace_back().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sort()

void sort ( )
inline

Inplace sort of the range elements.

Definition at line 164 of file labelRangesI.H.

References Foam::sort().

Referenced by emplace_back().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ labels()

List< label > labels ( ) const

Return flattened list of all range labels.

References labels().

Referenced by labels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]()

label operator[] ( const label i) const

Return the value at linear index 'i', -1 for out-of-range.

◆ cbegin() [1/2]

Foam::labelRanges::const_iterator cbegin ( ) const
inlinenoexcept

A const_iterator set to the beginning of the list.

Definition at line 173 of file labelRangesI.H.

References Foam::noexcept.

Referenced by begin(), and cbegin().

Here is the caller graph for this function:

◆ cend()

const Foam::labelRanges::const_iterator cend ( ) const
inlinenoexcept

A const_iterator set to beyond the end of the list.

Definition at line 180 of file labelRangesI.H.

References Foam::noexcept.

Referenced by cbegin().

Here is the caller graph for this function:

◆ begin() [1/2]

Foam::labelRanges::const_iterator begin ( ) const
inlinenoexcept

A const_iterator set to the beginning of the list.

Definition at line 187 of file labelRangesI.H.

References Foam::noexcept.

◆ end()

const Foam::labelRanges::const_iterator end ( ) const
inlinenoexcept

A const_iterator set to beyond the end of the list.

Definition at line 194 of file labelRangesI.H.

References Foam::noexcept.

◆ cbegin() [2/2]

Foam::labelRanges::const_iterator cbegin ( const label i) const
inline

Return const_iterator at linear offset i from begin, clamped to [0,size] range.

Definition at line 201 of file labelRangesI.H.

References cbegin(), cend(), and range.

Here is the call graph for this function:

◆ begin() [2/2]

Foam::labelRanges::const_iterator begin ( const label i) const
inline

Return const_iterator at linear offset i from begin, clamped to [0,size] range.

Definition at line 229 of file labelRangesI.H.

References cbegin().

Here is the call graph for this function:

◆ readList()

Istream & readList ( Istream & is)

Read List of labelRange from Istream, discarding contents.

References readList().

Referenced by readList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeList()

Ostream & writeList ( Ostream & os,
const label shortLen = 0 ) const

Write List of labelRange, with line-breaks in ASCII when length exceeds shortLen.

Using '0' suppresses line-breaks entirely.

References os(), and writeList().

Referenced by writeList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ found()

bool found ( const label value) const
inline

Same as contains().

Definition at line 339 of file labelRanges.H.

References contains(), and found().

Referenced by found().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplace_back() [2/2]

template<class... Args>
Foam::labelRange & emplace_back ( Args &&... args)
inline

Definition at line 158 of file labelRangesI.H.

References args.

◆ operator>>

Istream & operator>> ( Istream & is,
labelRanges & list )
friend

Use the readList() method to read contents from Istream.

References labelRanges().

◆ operator<<

Ostream & operator<< ( Ostream & os,
const labelRanges & list )
friend

Write to Ostream. Uses the writeList() method.

References labelRanges(), and os().


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