A dynamic list of packed unsigned integers, with the number of bits per item specified by the <Width> template parameter. More...
Classes | |
struct | hasher |
class | reference |
Public Types | |
typedef unsigned int | block_type |
typedef unsigned int | const_reference |
Public Member Functions | |
constexpr | PackedList () noexcept |
PackedList (const label numElem) | |
PackedList (const label numElem, const unsigned int val) | |
PackedList (Istream &is) | |
PackedList (const PackedList< Width > &list) | |
PackedList (PackedList< Width > &&list) | |
PackedList (const PackedList< Width > &list, const labelUList &addr) | |
template<class Addr > | |
PackedList (const PackedList< Width > &list, const IndirectListBase< label, Addr > &addr) | |
PackedList (const PackedList< Width > &list, const labelRange &range) | |
PackedList (const labelUList &values) | |
template<class Addr > | |
PackedList (const IndirectListBase< label, Addr > &values) | |
autoPtr< PackedList< Width > > | clone () const |
void | checkIndex (const label i) const |
label | size () const noexcept |
bool | empty () const noexcept |
label | capacity () const noexcept |
bool | uniform () const |
bool | equal (const PackedList< Width > &other) const |
unsigned int | get (const label i) const |
bool | set (const label i, unsigned int val=~0u) |
bool | unset (const label i) |
labelList | values () const |
template<class IntType = unsigned int> | |
List< IntType > | unpack () const |
template<class IntType = unsigned int> | |
List< IntType > | unpack (const labelRange &range) const |
template<class IntType = unsigned int> | |
List< IntType > | unpack (const labelUList &locations) const |
void | fill (const unsigned int val) |
bool | trim (label minpos=-1) |
void | reset () |
void | setCapacity (const label numElem) |
void | resize (const label numElem, const unsigned int val=0u) |
void | resize_nocopy (const label numElem) |
void | reserve (const label numElem) |
void | clear () |
void | clearStorage () |
void | shrink () |
void | swap (PackedList< Width > &rhs) |
void | transfer (PackedList< Width > &rhs) |
label | nBlocks () const |
const List< unsigned int > & | storage () const |
List< unsigned int > & | storage () |
const unsigned int * | cdata () const noexcept |
unsigned int * | data () noexcept |
const char * | cdata_bytes () const noexcept |
char * | data_bytes () noexcept |
std::streamsize | size_bytes () const noexcept |
std::streamsize | byteSize () const noexcept |
Ostream & | printBits (Ostream &os, bool debugOutput=false) const |
Istream & | readList (Istream &is) |
Ostream & | writeList (Ostream &os, const label shortLen=0) const |
void | writeEntry (const word &keyword, Ostream &os) const |
PackedList< Width > & | append (const unsigned int val) |
unsigned int | remove () |
unsigned int | operator[] (const label i) const |
reference | operator[] (const label i) |
void | operator= (const PackedList< Width > &lst) |
void | operator= (PackedList< Width > &&lst) |
void | operator= (const unsigned int val) |
InfoProxy< PackedList< Width > > | info () const |
void | assign (const unsigned int val) |
void | assign (const PackedList< Width > &rhs) |
void | setSize (const label n, unsigned int val=0u) |
template<unsigned Width> | |
PackedList (const PackedList< Width > &list, const labelUList &addr) | |
template<unsigned Width> | |
PackedList (const PackedList< Width > &list, const labelRange &range) | |
template<class IntType > | |
Foam::List< IntType > | unpack () const |
template<class IntType > | |
Foam::List< IntType > | unpack (const labelRange &range) const |
template<class IntType > | |
Foam::List< IntType > | unpack (const labelUList &locations) const |
template<unsigned Width> | |
constexpr | PackedList () noexcept |
template<unsigned Width> | |
PackedList (const label numElem) | |
template<unsigned Width> | |
PackedList (const label numElem, const unsigned int val) | |
template<unsigned Width> | |
PackedList (Istream &is) | |
template<unsigned Width> | |
PackedList (const PackedList< Width > &list) | |
template<unsigned Width> | |
PackedList (PackedList< Width > &&list) | |
template<unsigned Width> | |
PackedList (const labelUList &values) | |
Static Public Member Functions | |
static constexpr label | num_blocks (label numElem) noexcept |
static constexpr block_type | mask_lower (unsigned elementOffset) |
Static Public Attributes | |
static constexpr unsigned | bits_per_block = (std::numeric_limits<block_type>::digits) |
static constexpr unsigned | element_width = (Width) |
static constexpr unsigned | elem_per_block = (bits_per_block / Width) |
static constexpr block_type | max_value = ((1u << Width) - 1) |
Protected Types | |
typedef List< block_type > | block_container |
Protected Member Functions | |
void | setPair (Istream &is) |
void | writeEntry (Ostream &os) const |
void | clear_trailing_bits () |
void | copyAssign (const PackedList< Width > &rhs) |
unsigned int | repeated_value (unsigned val) |
unsigned int | readValue (Istream &is) |
void | setPair (Istream &is) |
Static Protected Member Functions | |
static unsigned int | repeated_value (unsigned val) |
static unsigned int | readValue (Istream &is) |
Protected Attributes | |
block_container | blocks_ |
label | size_ |
Friends | |
Ostream & | operator (Ostream &os, const InfoProxy< PackedList< Width >> &info) |
Istream & | operator>> (Istream &is, PackedList< Width > &list) |
A dynamic list of packed unsigned integers, with the number of bits per item specified by the <Width> template parameter.
Resizing is similar to DynamicList so that clear() and resize() affect the addressed size, but not the allocated size. The reserve() and setCapacity() methods can be used to influence the allocation.
In a non-const context, the '[]' operator returns a reference to an existing value. When accessing out-of-range elements, some caution is required to ensure that the const version of the [] operator is actually being called. The get() method is functionally identical the the '[]' operator, but is always const access.
The set() and unset() methods return a bool if the value changed.
With const access, the get() method and 'operator[]' are identical. With non-const access, the 'operator[]' may be marginally slower get().
The set() method may be marginally faster than using the 'operator[]' supports auto-vivification and also returns a bool if the value changed, which can be useful for branching on changed values.
In a const context, reading an out-of-range element returns zero without affecting the list size. For example,
Also note that all unused internal storage elements are guaranteed to always be bit-wise zero. This property must not be violated by any inheriting classes.
Definition at line 104 of file PackedList.H.
typedef unsigned int block_type |
Definition at line 132 of file PackedList.H.
|
protected |
Definition at line 177 of file PackedList.H.
typedef unsigned int const_reference |
Definition at line 224 of file PackedList.H.
|
inlineconstexprnoexcept |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
PackedList | ( | const PackedList< Width > & | list, |
const labelUList & | addr | ||
) |
PackedList | ( | const PackedList< Width > & | list, |
const IndirectListBase< label, Addr > & | addr | ||
) |
Definition at line 47 of file PackedList.C.
PackedList | ( | const PackedList< Width > & | list, |
const labelRange & | range | ||
) |
|
inlineexplicit |
|
inlineexplicit |
Definition at line 252 of file PackedListI.H.
PackedList | ( | const PackedList< Width > & | list, |
const labelUList & | addr | ||
) |
Definition at line 28 of file PackedList.C.
PackedList | ( | const PackedList< Width > & | list, |
const labelRange & | range | ||
) |
Definition at line 65 of file PackedList.C.
|
inlineconstexprnoexcept |
Definition at line 170 of file PackedListI.H.
|
inline |
Definition at line 178 of file PackedListI.H.
|
inline |
Definition at line 187 of file PackedListI.H.
|
inline |
Definition at line 203 of file PackedListI.H.
|
inline |
Definition at line 213 of file PackedListI.H.
|
inline |
Definition at line 221 of file PackedListI.H.
|
inline |
Definition at line 231 of file PackedListI.H.
|
inlinestaticconstexprnoexcept |
Definition at line 159 of file PackedList.H.
Referenced by PackedList< 2 >::fill(), PackedList< 2 >::nBlocks(), PackedList< 2 >::reserve(), PackedList< 2 >::resize(), PackedList< 2 >::setCapacity(), PackedList< 2 >::shrink(), and PackedList< 2 >::size_bytes().
|
inlinestaticconstexpr |
Definition at line 166 of file PackedList.H.
Referenced by PackedList< 2 >::resize().
|
inlinestaticprotected |
Definition at line 27 of file PackedListI.H.
Referenced by PackedList< 2 >::fill(), and PackedList< 2 >::resize().
|
inlinestaticprotected |
Definition at line 34 of file PackedListI.H.
Referenced by PackedList< 2 >::readList().
|
inlineprotected |
Definition at line 51 of file PackedListI.H.
Referenced by PackedList< 2 >::readList().
|
protected |
Definition at line 27 of file PackedListIO.C.
|
inlineprotected |
Definition at line 76 of file PackedListI.H.
Referenced by PackedList< 2 >::fill(), PackedList< 2 >::resize(), and PackedList< 2 >::setCapacity().
|
inlineprotected |
Definition at line 135 of file PackedListI.H.
|
inline |
Definition at line 274 of file PackedListI.H.
|
inline |
Definition at line 352 of file PackedListI.H.
Referenced by PackedList< 2 >::operator[]().
|
inlinenoexcept |
Definition at line 370 of file PackedListI.H.
Referenced by bitSet::andEq(), PackedList< 2 >::append(), Foam::apply(), bitSet::bound(), polyDualMesh::calcFeatures(), meshRefinement::calculateEdgeWeights(), primitiveMesh::checkClosedBoundary(), PackedList< 2 >::equal(), bitSet::extend(), PackedList< 2 >::fill(), meshRefinement::gAverage(), PackedList< 2 >::get(), Foam::inplaceSubset(), bitSet::intersects(), Foam::invert(), bitSet::minusEq(), PackedList< 2 >::nBlocks(), noiseModel::octaves(), PackedList::hasher::operator()(), Foam::operator<<(), bitSet::orEq(), PackedList< 2 >::remove(), PackedList< 2 >::resize(), PackedList< 2 >::set(), PackedList< 2 >::setCapacity(), PackedList< 2 >::shrink(), PackedList< 2 >::size_bytes(), syncTools::syncEdgeList(), syncTools::syncFaceList(), syncTools::syncPointList(), PackedList< 2 >::unset(), meshRefinement::weightedSum(), PackedList< 2 >::writeList(), and bitSet::xorEq().
|
inlinenoexcept |
Definition at line 377 of file PackedListI.H.
Referenced by bitSet::andEq(), ensightMesh::correct(), PackedList< 2 >::fill(), bitSet::minusEq(), bitSet::orEq(), and bitSet::xorEq().
|
inlinenoexcept |
Definition at line 384 of file PackedListI.H.
Referenced by Foam::operator<<().
Definition at line 86 of file PackedList.C.
Referenced by PackedList< 2 >::writeList().
bool equal | ( | const PackedList< Width > & | other | ) | const |
Definition at line 145 of file PackedList.C.
Referenced by Foam::operator!=(), and Foam::operator==().
|
inline |
Definition at line 623 of file PackedListI.H.
Referenced by bitSet::bitSet(), hexRef8::consistentUnrefinement(), PackedList::reference::operator unsigned int(), PackedList< 2 >::operator[](), PackedList< 2 >::PackedList(), and PackedList< 2 >::writeList().
|
inline |
Definition at line 646 of file PackedListI.H.
Referenced by PackedList::reference::operator=(), PackedList< 2 >::readList(), syncTools::syncFaceList(), and fileMonitor::updateStates().
|
inline |
Definition at line 677 of file PackedListI.H.
Foam::labelList values | ( | ) | const |
Definition at line 168 of file PackedList.C.
List<IntType> unpack | ( | ) | const |
List<IntType> unpack | ( | const labelRange & | range | ) | const |
List<IntType> unpack | ( | const labelUList & | locations | ) | const |
|
inline |
Definition at line 721 of file PackedListI.H.
Referenced by PackedList< 2 >::assign(), and PackedList< 2 >::operator=().
|
inline |
Definition at line 90 of file PackedListI.H.
|
inline |
Definition at line 498 of file PackedListI.H.
Referenced by dynamicRefineFvMesh::calculateProtectedCells(), PackedList< 2 >::clear(), distanceSurface::filterRegionProximity(), dynamicMultiMotionSolverFvMesh::init(), and topoBitSet::reset().
|
inline |
Definition at line 464 of file PackedListI.H.
|
inline |
Definition at line 402 of file PackedListI.H.
Referenced by dynamicRefineFvMesh::calculateProtectedCells(), cuttingSurfaceBase::cellSelection(), fvMeshSubsetProxy::correct(), ensightMesh::correct(), dynamicMultiMotionSolverFvMesh::init(), isoSurfaceTopo::isoSurfaceTopo(), PatchTools::matchEdges(), cuttingSurfaceBase::performCut(), PackedList< 2 >::readList(), PackedList< 2 >::remove(), PackedList< 2 >::resize_nocopy(), PackedList< 2 >::set(), PackedList< 2 >::setSize(), Foam::simpleGeometricFilter(), and topoBitSet::topoBitSet().
|
inline |
Definition at line 392 of file PackedListI.H.
|
inline |
Definition at line 479 of file PackedListI.H.
Referenced by PackedList< 2 >::append(), and PackedList< 2 >::resize().
|
inline |
Definition at line 505 of file PackedListI.H.
Referenced by dynamicRefineFvMesh::calculateProtectedCells(), and PackedList< 2 >::readList().
|
inline |
Definition at line 513 of file PackedListI.H.
Referenced by ensightMesh::correct(), distanceSurface::createGeometry(), distanceSurface::filterKeepLargestRegion(), distanceSurface::filterKeepNearestRegions(), and distanceSurface::filterRegionProximity().
|
inline |
Definition at line 521 of file PackedListI.H.
|
inline |
Definition at line 596 of file PackedListI.H.
Referenced by bitSet::swap().
|
inline |
Definition at line 609 of file PackedListI.H.
Referenced by bitSet::transfer().
|
inline |
Definition at line 547 of file PackedListI.H.
|
inline |
Definition at line 540 of file PackedListI.H.
Referenced by fileMonitor::updateStates().
|
inline |
Definition at line 533 of file PackedListI.H.
|
inlinenoexcept |
Definition at line 554 of file PackedListI.H.
Referenced by PackedList::hasher::operator()().
|
inlinenoexcept |
Definition at line 561 of file PackedListI.H.
|
inlinenoexcept |
Definition at line 568 of file PackedListI.H.
Referenced by syncTools::syncFaceList(), and PackedList< 2 >::writeList().
|
inlinenoexcept |
Definition at line 575 of file PackedListI.H.
Referenced by PackedList< 2 >::readList(), and syncTools::syncFaceList().
|
inlinenoexcept |
Definition at line 582 of file PackedListI.H.
Referenced by PackedList< 2 >::byteSize(), PackedList::hasher::operator()(), PackedList< 2 >::readList(), syncTools::syncFaceList(), and PackedList< 2 >::writeList().
|
inlinenoexcept |
Definition at line 589 of file PackedListI.H.
Foam::Ostream & printBits | ( | Ostream & | os, |
bool | debugOutput = false |
||
) | const |
Definition at line 37 of file PackedListIO.C.
Foam::Istream & readList | ( | Istream & | is | ) |
Definition at line 57 of file PackedListIO.C.
Foam::Ostream & writeList | ( | Ostream & | os, |
const label | shortLen = 0 |
||
) | const |
Definition at line 172 of file PackedListIO.C.
Referenced by Foam::operator<<().
Definition at line 237 of file PackedListIO.C.
|
inline |
Definition at line 690 of file PackedListI.H.
Referenced by PackedList< 2 >::readList().
|
inline |
Definition at line 702 of file PackedListI.H.
|
inline |
Definition at line 748 of file PackedListI.H.
|
inline |
Definition at line 756 of file PackedListI.H.
|
inline |
|
inline |
|
inline |
Definition at line 780 of file PackedListI.H.
|
inline |
Definition at line 507 of file PackedList.H.
|
inline |
Definition at line 547 of file PackedList.H.
|
inline |
Definition at line 551 of file PackedList.H.
|
inline |
Definition at line 554 of file PackedList.H.
Referenced by distributedTriSurfaceMesh::getVolumeType(), meshRefinement::markOutsideFaces(), and tetDecomposer::setRefinement().
Foam::List<IntType> unpack | ( | ) | const |
Definition at line 177 of file PackedList.C.
Foam::List<IntType> unpack | ( | const labelRange & | range | ) | const |
Definition at line 229 of file PackedList.C.
Foam::List<IntType> unpack | ( | const labelUList & | locations | ) | const |
Definition at line 263 of file PackedList.C.
|
inlineprotected |
Definition at line 149 of file PackedListI.H.
|
inlineprotected |
Definition at line 154 of file PackedListI.H.
|
inlineprotected |
Definition at line 159 of file PackedListI.H.
|
friend |
|
friend |
|
staticconstexpr |
Definition at line 137 of file PackedList.H.
Referenced by PackedList< 2 >::mask_lower().
|
staticconstexpr |
Definition at line 140 of file PackedList.H.
|
staticconstexpr |
Definition at line 143 of file PackedList.H.
Referenced by PackedList< 2 >::capacity(), PackedList< 2 >::num_blocks(), and PackedList< 2 >::resize().
|
staticconstexpr |
Definition at line 148 of file PackedList.H.
Referenced by PackedList::reference::get(), and PackedList::reference::set().
|
protected |
Definition at line 180 of file PackedList.H.
Referenced by bitSet::andEq(), PackedList< 2 >::capacity(), PackedList< 2 >::cdata(), PackedList< 2 >::cdata_bytes(), PackedList< 2 >::clearStorage(), PackedList< 2 >::copyAssign(), PackedList< 2 >::data(), PackedList< 2 >::data_bytes(), PackedList< 2 >::equal(), PackedList< 2 >::fill(), bitSet::intersects(), bitSet::minusEq(), bitSet::orEq(), PackedList< 2 >::reserve(), PackedList< 2 >::reset(), PackedList< 2 >::resize(), PackedList< 2 >::setCapacity(), PackedList< 2 >::shrink(), PackedList< 2 >::storage(), PackedList< 2 >::swap(), PackedList< 2 >::transfer(), and bitSet::xorEq().
|
protected |
Definition at line 183 of file PackedList.H.
Referenced by PackedList< 2 >::append(), PackedList< 2 >::checkIndex(), PackedList< 2 >::clear(), PackedList< 2 >::clearStorage(), PackedList< 2 >::copyAssign(), PackedList< 2 >::empty(), PackedList< 2 >::get(), PackedList< 2 >::resize(), PackedList< 2 >::set(), PackedList< 2 >::setCapacity(), PackedList< 2 >::size(), PackedList< 2 >::swap(), and PackedList< 2 >::transfer().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.