PackedList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2017-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::PackedList
29 
30 Description
31  A dynamic list of packed unsigned integers, with the number of bits
32  per item specified by the <Width> template parameter.
33 
34  Resizing is similar to DynamicList so that clear() and resize() affect
35  the addressed size, but not the allocated size. The reserve() and
36  setCapacity() methods can be used to influence the allocation.
37 
38 Note
39  In a const context, the '[]' operator simply returns the stored value,
40  with out-of-range elements returned as zero.
41 
42  In a non-const context, the '[]' operator returns a reference to an
43  existing value. When accessing out-of-range elements, some caution
44  is required to ensure that the const version of the [] operator is actually
45  being called.
46  The get() method is functionally identical the the '[]' operator, but
47  is always const access.
48 
49  The set() and unset() methods return a bool if the value changed.
50 
51  With const access, the get() method and 'operator[]' are identical.
52  With non-const access, the 'operator[]' may be marginally slower get().
53 
54  The set() method may be marginally faster than using the 'operator[]'
55  supports auto-vivification and also returns a bool if the value changed,
56  which can be useful for branching on changed values.
57 
58  \code
59  list.set(5, 4);
60  changed = list.set(5, 8);
61  if (changed) ...
62  \endcode
63 
64  In a const context, reading an out-of-range element returns zero without
65  affecting the list size.
66  For example,
67  \code
68  list.resize(4);
69  Info<< list.get(10) << "\n"; // print zero, but doesn't adjust list
70  list.set(8); // auto-vivify
71  \endcode
72 
73  Also note that all unused internal storage elements are guaranteed to
74  always be bit-wise zero. This property must not be violated by any
75  inheriting classes.
76 
77 Note
78  Iterators for this class have been intentionally removed, for performance
79  reasons.
80 
81 See also
82  Foam::BitOps
83  Foam::DynamicList
84 
85 SourceFiles
86  PackedListI.H
87  PackedList.C
88  PackedListIO.C
89 
90 \*---------------------------------------------------------------------------*/
91 
92 #ifndef PackedList_H
93 #define PackedList_H
94 
95 #include "BitOps.H"
96 #include "labelList.H"
97 #include "IndirectListBase.H"
98 #include "InfoProxy.H"
99 #include "PackedListCore.H"
100 
101 #include <type_traits>
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 namespace Foam
106 {
107 
108 // Forward declarations
109 template<unsigned Width> class PackedList;
110 class labelRange;
111 
112 class Istream;
113 class Ostream;
114 
115 template<unsigned Width>
117 
118 template<unsigned Width>
119 Ostream& operator<<(Ostream& os, const PackedList<Width>& list);
120 
121 template<unsigned Width>
123 
124 
125 /*---------------------------------------------------------------------------*\
126  Class PackedList Declaration
127 \*---------------------------------------------------------------------------*/
128 
129 template<unsigned Width>
130 class PackedList
131 :
133 {
134 public:
135 
136  // Types and dimension information
137 
138  //- The storage block type for bit elements
139  typedef unsigned int block_type;
140 
141  //- The number of bits in a single block
142  static constexpr unsigned bits_per_block
143  = (std::numeric_limits<block_type>::digits);
144 
145  //- The width of an individual element (in bits).
146  static constexpr unsigned element_width = (Width);
147 
148  //- The number of elements stored per data block.
149  static constexpr unsigned elem_per_block = (bits_per_block / Width);
150 
151  //- The max value for an element which is also the bit-mask of the
152  //- individual element.
153  // Eg, for Width=2: ((1 << 2) - 1) == 0b0011
154  static constexpr block_type max_value = ((1u << Width) - 1);
155 
156  //- Calculate the number of blocks required to _address_ the
157  //- requested number of elements.
158  //
159  // We calculate this:
160  // \code
161  // (numElem / elem_per_block)
162  // + (numElem % elem_per_block) ? 1 : 0
163  // \endcode
164  // But avoiding the modulus operation
165  static constexpr label num_blocks(label numElem)
166  {
167  return ((numElem - 1 + elem_per_block) / elem_per_block);
168  }
169 
170  //- Masking for all bits below the element offset.
171  // Ill-defined when elementOffset is out of range.
172  static constexpr block_type mask_lower(unsigned elementOffset)
173  {
174  return (~0u >> (bits_per_block - Width * elementOffset));
175  }
176 
177 
178 protected:
179 
180  // Protected Data
181 
182  //- The internal container for storing the blocks
184 
185  //- The blocks of raw data
187 
188  //- Number of entries used
189  label size_;
190 
191  //- Enforce non-zero Width to fit within the block storage and require
192  //- at least 2 items per storage block for general efficiency.
193  //
194  // Thus 1/2 of the base storage size is (sizeof(block_type)*8/2),
195  // or (sizeof(block_type) << 2)
196  static_assert
197  (
198  Width && Width <= (sizeof(block_type) << 2),
199  "Width must be > 0 and minimum of two items per data block"
200  );
201 
202 
203  // Protected Member Functions
204 
205  //- A fill value for complete blocks
206  inline static unsigned int repeated_value(unsigned val);
207 
208  //- Read a list entry (allows for specialization)
209  inline static unsigned int readValue(Istream& is);
210 
211  //- Read an index/value pair and set accordingly.
212  // For bool specialization, read a single index value
213  inline void setPair(Istream& is);
214 
215  //- Write as a dictionary entry
216  void writeEntry(Ostream& os) const;
217 
218  //- Clear any partial rubbish in the last addressable block
219  // This \a rubbish may have arisen from block-wise operations etc.
220  inline void clear_trailing_bits();
221 
222 
223 public:
224 
225  // Forward declaration of access classes
226 
227  class reference;
228  typedef unsigned int const_reference;
229 
230 
231  // Constructors
232 
233  //- Null constructor
234  inline constexpr PackedList() noexcept;
235 
236  //- Construct for given number of elements, initializes values to 0
237  inline explicit PackedList(const label numElem);
238 
239  //- Construct for given number of elements, and the specified
240  //- value for each element
241  inline PackedList(const label numElem, const unsigned int val);
242 
243  //- Construct from Istream
244  inline PackedList(Istream& is);
245 
246  //- Copy construct
247  inline PackedList(const PackedList<Width>& list);
248 
249  //- Move construct
250  inline PackedList(PackedList<Width>&& list);
251 
252  //- Copy construct a subset
253  PackedList(const PackedList<Width>& list, const labelUList& addr);
254 
255  //- Copy construct a subset
256  template<class Addr>
257  PackedList
258  (
259  const PackedList<Width>& list,
260  const IndirectListBase<label, Addr>& addr
261  );
262 
263  //- Copy construct a subset range
264  PackedList(const PackedList<Width>& list, const labelRange& range);
265 
266  //- Construct from a list of values
267  inline explicit PackedList(const labelUList& values);
268 
269  //- Construct from a indirect list of values
270  template<class Addr>
271  inline explicit PackedList(const IndirectListBase<label, Addr>& values);
272 
273  //- Clone
274  inline autoPtr<PackedList<Width>> clone() const;
275 
276 
277  // Member Functions
278 
279  // Query
280 
281  //- Check index is within valid range [0,size)
282  inline void checkIndex(const label i) const;
283 
284  //- Number of entries.
285  inline label size() const noexcept;
286 
287  //- True if the list is empty (ie, size() is zero).
288  inline bool empty() const noexcept;
289 
290  //- The number of elements that can be stored with reallocating
291  inline label capacity() const;
292 
293  //- True if all entries have identical values, and list is non-empty
294  bool uniform() const;
295 
296  //- Test for equality of sizes and the bits set
297  bool equal(const PackedList<Width>& other) const;
298 
299 
300  // Access
301 
302  //- Get value at index i or 0 for out-of-range.
303  // Never auto-vivify entries.
304  inline unsigned int get(const label i) const;
305 
306  //- Set value at index i, default value set is the max_value.
307  // Does auto-vivify for non-existent, non-zero entries.
308  // \return true if value changed.
309  inline bool set(const label i, unsigned int val = ~0u);
310 
311  //- Unset the entry at index i.
312  // Never auto-vivify entries.
313  // \return true if the value changed.
314  inline bool unset(const label i);
315 
316  //- Return the values as a list of labels
317  labelList values() const;
318 
319  //- Return the values as a list of integral type.
320  // The default integral type is unsigned int.
321  template<class IntType = unsigned int>
322  List<IntType> unpack() const;
323 
324  //- Return the range of values as a list of integral type.
325  // The default integral type is unsigned int.
326  template<class IntType = unsigned int>
327  List<IntType> unpack(const labelRange& range) const;
328 
329  //- Extract the values for the specified locations as
330  //- a list of integral type.
331  // The default integral type is unsigned int.
332  template<class IntType = unsigned int>
333  List<IntType> unpack(const labelUList& locations) const;
334 
335 
336  // Edit
337 
338  //- Assign all entries to the given value. Takes linear time.
339  inline void assign(const unsigned int val);
340 
341  //- Copy assignment.
342  inline void assign(const PackedList<Width>& rhs);
343 
344  //- Trim any trailing zero elements, optionally specifying a
345  //- a minimum position, below which trimming will not occur.
346  //
347  // \return true if trimming changed the size.
348  inline bool trim(label minpos=-1);
349 
350  //- Clear all bits but do not adjust the addressable size.
351  inline void reset();
352 
353  //- Alter the size of the underlying storage.
354  // The addressed size will be truncated if needed to fit, but will
355  // remain otherwise untouched.
356  inline void setCapacity(const label nElem);
357 
358  //- Reset addressable list size, does not shrink the allocated size.
359  // Optionally specify a value for new elements.
360  inline void resize(const label nElem, const unsigned int val = 0u);
361 
362  //- Alias for resize()
363  inline void setSize(const label nElem, const unsigned int val = 0u);
364 
365  //- Reserve allocation space for at least this size.
366  // Never shrinks the allocated size.
367  // The list size is adjusted as per DynamicList with
368  // SizeInc=0, SizeMult=2, SizeDiv=1
369  inline void reserve(const label nElem);
370 
371  //- Clear the list, i.e. set addressable size to zero.
372  // Does not adjust the underlying storage
373  inline void clear();
374 
375  //- Clear the list and delete storage.
376  inline void clearStorage();
377 
378  //- Shrink the allocated space to what is actually used.
379  inline void shrink();
380 
381  //- Swap contents with argument
382  inline void swap(PackedList<Width>& rhs);
383 
384  //- Transfer the contents of the argument list into this list
385  // and annul the argument list.
386  inline void transfer(PackedList<Width>& rhs);
387 
388 
389  // Low-level access
390 
391  //- The number of bytes used in the underlying storage
392  //- including any unused padding.
393  inline std::streamsize byteSize() const;
394 
395  //- The number of internal storage blocks
396  inline label nBlocks() const;
397 
398  //- Return the underlying storage blocks
399  inline const List<unsigned int>& storage() const;
400 
401  //- Return the underlying storage blocks
402  // Manipulate with utmost caution
403  inline List<unsigned int>& storage();
404 
405 
406  // IO
407 
408  //- Print bit patterns, optionally with extra debug
409  Ostream& printBits(Ostream& os, bool debugOutput=false) const;
410 
411  //- Clear list and read from stream
412  Istream& read(Istream& is);
413 
414  //- Write List, with line-breaks in ASCII when length exceeds shortLen.
415  // Using '0' suppresses line-breaks entirely.
416  Ostream& writeList(Ostream& os, const label shortLen=0) const;
417 
418  //- Write as a dictionary entry with keyword
419  void writeEntry(const word& keyword, Ostream& os) const;
420 
421 
422  // Member Operators
423 
424  //- Append a value at the end of the list
425  inline PackedList<Width>& append(const unsigned int val);
426 
427  //- Remove and return the last element
428  inline unsigned int remove();
429 
430  //- Identical to get() - get value at index.
431  // Never auto-vivify entries.
432  inline unsigned int operator[](const label i) const;
433 
434  //- Non-const access to value at index.
435  // Fatal for out-of-range indices
436  inline reference operator[](const label i);
437 
438  //- Assignment of all entries to the given value. Takes linear time.
439  inline void operator=(const unsigned int val);
440 
441  //- Copy assignment.
442  inline void operator=(const PackedList<Width>& lst);
443 
444  //- Move assignment.
445  inline void operator=(PackedList<Width>&& lst);
446 
447 
448  // Access helpers
449 
450  //- A reference supporting read/write access to an entry
451  class reference
452  {
453  protected:
454  friend class PackedList; // Access for parent
455  void operator&() = delete; // Refuse to provide its address
456 
457  //- Reference to the block
458  block_type& ref_;
459 
460  //- The bit shift to access the given sub-portion
461  unsigned shift_;
462 
463  //- Construct by taking reference of block from within
464  //- the list and the specified index.
465  inline reference(PackedList* parent, const label index);
466 
467  //- Get value as unsigned, no range-checking
468  inline unsigned int get() const;
469 
470  //- Set value, returning true if changed, no range-checking
471  inline bool set(unsigned int val);
472 
473  public:
474 
475  //- Value assignment
476  inline void operator=(const reference& other);
477 
478  //- Value assignment.
479  inline void operator=(const unsigned int val);
480 
481  //- Conversion operator.
482  inline operator unsigned int () const;
483  };
484 
485 
486  // IOstream Operators
487 
488  //- Return info proxy.
490  {
491  return *this;
492  }
493 
494  friend Ostream& operator<< <Width>
495  (
496  Ostream& os,
498  );
499 
500  friend Istream& operator>> <Width>
501  (
502  Istream& is,
503  PackedList<Width>& list
504  );
505 };
506 
507 
508 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
509 
510 //- Write List to Ostream, as per UList::writeList() with default length.
511 // The default short-length is given by Detail::ListPolicy::short_length
512 template<unsigned Width>
513 Ostream& operator<<(Ostream& os, const PackedList<Width>& list)
514 {
516 }
517 
518 
519 //- Test for equality of sizes and the bits set
520 template<unsigned Width>
521 inline bool operator==(const PackedList<Width>& a, const PackedList<Width>& b);
522 
523 //- Test for inequality of sizes or the bits set
524 template<unsigned Width>
525 inline bool operator!=(const PackedList<Width>& a, const PackedList<Width>& b);
526 
527 
528 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
529 
530 } // End namespace Foam
531 
532 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
533 
534 #include "PackedListI.H"
535 
536 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
537 
538 #ifdef NoRepository
539  #include "PackedList.C"
540  #include "PackedListIO.C"
541 #endif
542 
543 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
544 
545 #endif
546 
547 // ************************************************************************* //
Foam::PackedList::element_width
static constexpr unsigned element_width
The width of an individual element (in bits).
Definition: PackedList.H:145
BitOps.H
Foam::PackedList::reset
void reset()
Clear all bits but do not adjust the addressable size.
Definition: PackedListI.H:495
Foam::val
label ListType::const_reference val
Definition: ListOps.H:407
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::InfoProxy
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:47
Foam::PackedList::reference::ref_
block_type & ref_
Reference to the block.
Definition: PackedList.H:457
Foam::operator&
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
Foam::PackedList::operator
friend Ostream & operator(Ostream &os, const InfoProxy< PackedList< Width >> &info)
Foam::PackedList::read
Istream & read(Istream &is)
Clear list and read from stream.
Definition: PackedListIO.C:64
Foam::PackedList::reference
A reference supporting read/write access to an entry.
Definition: PackedList.H:450
Foam::PackedList::clone
autoPtr< PackedList< Width > > clone() const
Clone.
Definition: PackedListI.H:270
InfoProxy.H
PackedListI.H
Foam::PackedList::block_type
unsigned int block_type
The storage block type for bit elements.
Definition: PackedList.H:138
Foam::PackedList::nBlocks
label nBlocks() const
The number of internal storage blocks.
Definition: PackedListI.H:544
Foam::PackedList::clear_trailing_bits
void clear_trailing_bits()
Clear any partial rubbish in the last addressable block.
Definition: PackedListI.H:83
Foam::PackedList::empty
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
Definition: PackedListI.H:373
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:228
Foam::PackedList::PackedList
constexpr PackedList() noexcept
Null constructor.
Definition: PackedListI.H:166
Foam::PackedList::checkIndex
void checkIndex(const label i) const
Check index is within valid range [0,size)
Definition: PackedListI.H:348
Foam::PackedList::resize
void resize(const label nElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
Definition: PackedListI.H:388
Foam::PackedList::swap
void swap(PackedList< Width > &rhs)
Swap contents with argument.
Definition: PackedListI.H:558
Foam::PackedList::get
unsigned int get(const label i) const
Get value at index i or 0 for out-of-range.
Definition: PackedListI.H:585
PackedListCore.H
Foam::PackedList::mask_lower
static constexpr block_type mask_lower(unsigned elementOffset)
Masking for all bits below the element offset.
Definition: PackedList.H:171
Foam::operator!=
bool operator!=(const eddy &a, const eddy &b)
Definition: eddy.H:235
Foam::PackedList::size_
label size_
Number of entries used.
Definition: PackedList.H:188
Foam::uniform
Definition: uniform.H:50
Foam::PackedList::printBits
Ostream & printBits(Ostream &os, bool debugOutput=false) const
Print bit patterns, optionally with extra debug.
Definition: PackedListIO.C:44
Foam::PackedList::blocks_
block_container blocks_
The blocks of raw data.
Definition: PackedList.H:185
Foam::PackedList::repeated_value
static unsigned int repeated_value(unsigned val)
A fill value for complete blocks.
Definition: PackedListI.H:34
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::PackedList::block_container
List< block_type > block_container
The internal container for storing the blocks.
Definition: PackedList.H:182
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
labelList.H
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
IndirectListBase.H
Foam::PackedList::setCapacity
void setCapacity(const label nElem)
Alter the size of the underlying storage.
Definition: PackedListI.H:461
Foam::PackedList::operator=
void operator=(const unsigned int val)
Assignment of all entries to the given value. Takes linear time.
Definition: PackedListI.H:742
Foam::PackedList::unset
bool unset(const label i)
Unset the entry at index i.
Definition: PackedListI.H:639
Foam::Detail::ListPolicy::short_length
Number of items before requiring line-breaks in the list ouput.
Definition: ListPolicy.H:61
Foam::PackedList::const_reference
unsigned int const_reference
Definition: PackedList.H:226
Foam::PackedList::remove
unsigned int remove()
Remove and return the last element.
Definition: PackedListI.H:664
Foam::labelRange
A range or interval of labels defined by a start and a size.
Definition: labelRange.H:58
Foam::PackedList::writeList
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
Definition: PackedListIO.C:204
Foam::PackedList::num_blocks
static constexpr label num_blocks(label numElem)
Definition: PackedList.H:164
Foam::PackedList::byteSize
std::streamsize byteSize() const
Definition: PackedListI.H:551
PackedListIO.C
Foam::PackedList::transfer
void transfer(PackedList< Width > &rhs)
Transfer the contents of the argument list into this list.
Definition: PackedListI.H:571
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PackedList::append
PackedList< Width > & append(const unsigned int val)
Append a value at the end of the list.
Definition: PackedListI.H:652
Foam::PackedList::equal
bool equal(const PackedList< Width > &other) const
Test for equality of sizes and the bits set.
Definition: PackedList.C:152
Foam::PackedList::setPair
void setPair(Istream &is)
Read an index/value pair and set accordingly.
Definition: PackedListI.H:58
Foam::PackedList::unpack
List< IntType > unpack() const
Return the values as a list of integral type.
Foam::PackedList::assign
void assign(const unsigned int val)
Assign all entries to the given value. Takes linear time.
Definition: PackedListI.H:683
Foam::PackedList::max_value
static constexpr block_type max_value
Definition: PackedList.H:153
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::PackedList::writeEntry
void writeEntry(Ostream &os) const
Write as a dictionary entry.
Definition: PackedListIO.C:34
Foam::PackedList::capacity
label capacity() const
The number of elements that can be stored with reallocating.
Definition: PackedListI.H:380
Foam::PackedList::setSize
void setSize(const label nElem, const unsigned int val=0u)
Alias for resize()
Definition: PackedListI.H:451
range
scalar range
Definition: LISASMDCalcMethod1.H:12
Foam::PackedList::elem_per_block
static constexpr unsigned elem_per_block
The number of elements stored per data block.
Definition: PackedList.H:148
Foam::List< block_type >
Foam::PackedList
A dynamic list of packed unsigned integers, with the number of bits per item specified by the <Width>...
Definition: PackedList.H:108
Foam::PackedList::size
label size() const noexcept
Number of entries.
Definition: PackedListI.H:366
Foam::UList< label >
Foam::PackedList::reserve
void reserve(const label nElem)
Reserve allocation space for at least this size.
Definition: PackedListI.H:476
Foam::PackedList::trim
bool trim(label minpos=-1)
Definition: PackedListI.H:97
Foam::PackedList::storage
const List< unsigned int > & storage() const
Return the underlying storage blocks.
Definition: PackedListI.H:537
Foam::Detail::PackedListCore
Template-invariant parts for PackedList.
Definition: PackedListCore.H:53
Foam::PackedList::clearStorage
void clearStorage()
Clear the list and delete storage.
Definition: PackedListI.H:510
Foam::PackedList::set
bool set(const label i, unsigned int val=~0u)
Set value at index i, default value set is the max_value.
Definition: PackedListI.H:608
Foam::PackedList::shrink
void shrink()
Shrink the allocated space to what is actually used.
Definition: PackedListI.H:518
Foam::IndirectListBase
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
Definition: IndirectListBase.H:57
Foam::PackedList::values
labelList values() const
Return the values as a list of labels.
Definition: PackedList.C:175
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::PackedList::reference::shift_
unsigned shift_
The bit shift to access the given sub-portion.
Definition: PackedList.H:460
Foam::PackedList::bits_per_block
static constexpr unsigned bits_per_block
The number of bits in a single block.
Definition: PackedList.H:142
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &)
Definition: boundaryPatch.C:102
Foam::PackedList::clear
void clear()
Clear the list, i.e. set addressable size to zero.
Definition: PackedListI.H:502
Foam::PackedList::info
InfoProxy< PackedList< Width > > info() const
Return info proxy.
Definition: PackedList.H:488
Foam::PackedList::readValue
static unsigned int readValue(Istream &is)
Read a list entry (allows for specialization)
Definition: PackedListI.H:41
PackedList.C