Data Structures | Public Member Functions | Private Types | Private Member Functions | Static Private Attributes | Friends
labelRanges Class Reference

A list of labelRange. More...

Inheritance diagram for labelRanges:
Inheritance graph
[legend]
Collaboration diagram for labelRanges:
Collaboration graph
[legend]

Data Structures

class  const_iterator
 An STL const_iterator. More...
 

Public Member Functions

 labelRanges ()
 Construct null. More...
 
 labelRanges (const label)
 Construct given size. More...
 
 labelRanges (Istream &)
 Construct from Istream. More...
 
bool contains (const label) const
 Return true if the value is within any of the ranges. More...
 
bool add (const labelRange &)
 Add the range to the list. More...
 
bool remove (const labelRange &)
 Remove the range from the list. More...
 
const_iterator cbegin () const
 const_iterator set to the beginning of the list More...
 
const const_iteratorcend () const
 const_iterator set to beyond the end of the list More...
 
const_iterator begin () const
 const_iterator set to the beginning of the list More...
 
const const_iteratorend () const
 const_iterator set to beyond the end of the list More...
 

Private Types

typedef DynamicList< labelRangeParentType
 

Private Member Functions

void insertBefore (const label, const labelRange &)
 Insert range before specified insertion index, by copying up. More...
 
void purgeEmpty ()
 Purge empty ranges, by copying down. More...
 
OstreamprintRange (Ostream &, const labelRange &) const
 Print the range for debugging purposes. More...
 
- Private Member Functions inherited from DynamicList< labelRange >
 DynamicList ()
 Construct null. More...
 
 DynamicList (const label)
 Construct given size. More...
 
 DynamicList (const DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Construct copy. More...
 
 DynamicList (const UList< T > &)
 Construct from UList. Size set to UList size. More...
 
 DynamicList (const UIndirectList< T > &)
 Construct from UIndirectList. Size set to UIndirectList size. More...
 
 DynamicList (const Xfer< List< T > > &)
 Construct by transferring the parameter contents. More...
 
 DynamicList (Istream &)
 Construct from Istream. Size set to size of list read. More...
 
label capacity () const
 Size of the underlying storage. More...
 
void setCapacity (const label)
 Alter the size of the underlying storage. More...
 
void setSize (const label)
 Alter the addressed list size. More...
 
void setSize (const label, const T &)
 Alter the addressed list size and fill new space with a. More...
 
void resize (const label)
 Alter the addressed list size. More...
 
void resize (const label, const T &)
 Alter the addressed list size and fill new space with a. More...
 
void reserve (const label)
 Reserve allocation space for at least this size. More...
 
void clear ()
 Clear the addressed list, i.e. set the size to zero. More...
 
void clearStorage ()
 Clear the list and delete storage. More...
 
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink ()
 Shrink the allocated space to the number of elements used. More...
 
void transfer (List< T > &)
 Transfer contents of the argument List into this. More...
 
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer contents of the argument DynamicList into this. More...
 
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container as a plain List. More...
 
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append (const T &)
 Append an element at the end of the list. More...
 
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append (const UList< T > &)
 Append a List at the end of this list. More...
 
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append (const UIndirectList< T > &)
 Append a UIndirectList at the end of this list. More...
 
T remove ()
 Remove and return the top element. More...
 
Toperator() (const label)
 Return non-const access to an element, resizing list if. More...
 
void operator= (const T &)
 Assignment of all addressed entries to the given value. More...
 
void operator= (const DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Assignment from DynamicList. More...
 
void operator= (const UList< T > &)
 Assignment from UList. More...
 
void operator= (const UIndirectList< T > &)
 Assignment from UIndirectList. More...
 

Static Private Attributes

static const const_iterator endIter_
 const_iterator returned by end(), cend() More...
 

Friends

Istreamoperator>> (Istream &, labelRanges &)
 
Ostreamoperator<< (Ostream &, const labelRanges &)
 

Detailed Description

A list of labelRange.

Source files

Definition at line 58 of file labelRanges.H.

Member Typedef Documentation

◆ ParentType

typedef DynamicList<labelRange> ParentType
private

Definition at line 64 of file labelRanges.H.

Constructor & Destructor Documentation

◆ labelRanges() [1/3]

labelRanges ( )
inline

Construct null.

Definition at line 29 of file labelRangesI.H.

◆ labelRanges() [2/3]

labelRanges ( const label  nElem)
inlineexplicit

Construct given size.

Definition at line 35 of file labelRangesI.H.

◆ labelRanges() [3/3]

labelRanges ( Istream is)

Construct from Istream.

Definition at line 119 of file labelRanges.C.

Member Function Documentation

◆ insertBefore()

void insertBefore ( const label  insert,
const labelRange range 
)
private

Insert range before specified insertion index, by copying up.

Definition at line 37 of file labelRanges.C.

References Foam::endl(), Foam::Info, insert(), Foam::nl, range, and setSize().

Here is the call graph for this function:

◆ purgeEmpty()

void purgeEmpty ( )
private

Purge empty ranges, by copying down.

Definition at line 78 of file labelRanges.C.

References forAll, DynamicList< labelRange >::operator, and DynamicList< labelRange >::setSize().

Here is the call graph for this function:

◆ printRange()

Foam::Ostream & printRange ( Ostream os,
const labelRange range 
) const
private

Print the range for debugging purposes.

Definition at line 100 of file labelRanges.C.

References range.

◆ contains()

bool contains ( const label  value) const
inline

Return true if the value is within any of the ranges.

Definition at line 152 of file labelRangesI.H.

References forAll, and DynamicList< labelRange >::operator.

◆ add()

bool add ( const labelRange range)

Add the range to the list.

Definition at line 127 of file labelRanges.C.

References labelRange::clear(), forAll, labelRange::intersects(), and range.

Referenced by main().

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.

Definition at line 185 of file labelRanges.C.

References labelRange::debug, Foam::endl(), labelRange::first(), forAll, Foam::Info, labelRange::last(), and range.

Referenced by main().

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

◆ cbegin()

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

const_iterator set to the beginning of the list

Definition at line 126 of file labelRangesI.H.

◆ cend()

const Foam::labelRanges::const_iterator & cend ( ) const
inline

const_iterator set to beyond the end of the list

Definition at line 132 of file labelRangesI.H.

References labelRanges::endIter_.

◆ begin()

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

const_iterator set to the beginning of the list

Definition at line 138 of file labelRangesI.H.

◆ end()

const Foam::labelRanges::const_iterator & end ( ) const
inline

const_iterator set to beyond the end of the list

Definition at line 144 of file labelRangesI.H.

References labelRanges::endIter_.

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
labelRanges  
)
friend

◆ operator<<

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

Field Documentation

◆ endIter_

const Foam::labelRanges::const_iterator endIter_
staticprivate

const_iterator returned by end(), cend()

Definition at line 173 of file labelRanges.H.

Referenced by labelRanges::cend(), and labelRanges::end().


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