FixedList.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-2020 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::FixedList
29 
30 Description
31  A 1D vector of objects of type <T> with a fixed length <N>.
32 
33 SourceFiles
34  FixedList.C
35  FixedListI.H
36  FixedListIO.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef FixedList_H
41 #define FixedList_H
42 
43 #include "bool.H"
44 #include "label.H"
45 #include "uLabel.H"
46 #include "zero.H"
47 #include "contiguous.H"
48 #include "autoPtr.H"
49 #include "Swap.H"
50 #include "HashFwd.H"
51 #include "SLListFwd.H"
52 #include "ListPolicy.H"
53 
54 #include <initializer_list>
55 #include <iterator>
56 #include <type_traits>
57 #include <limits>
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 // Forward Declarations
65 
66 template<class T, unsigned N> class FixedList;
67 template<class T> class UList;
68 
69 template<class T, unsigned N>
70 Istream& operator>>(Istream& is, FixedList<T, N>& list);
71 
72 
73 /*---------------------------------------------------------------------------*\
74  Class FixedList Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 template<class T, unsigned N>
78 class FixedList
79 {
80  static_assert
81  (
83  "Size must be positive (non-zero) and fit as a signed int value"
84  );
85 
86  // Private Data
87 
88  //- Vector of values of type T of length N.
89  T v_[N];
90 
91 
92 protected:
93 
94  // Protected Member Functions
95 
96  //- Write the FixedList with its compound type
97  void writeEntry(Ostream& os) const;
98 
99 
100 public:
101 
102  // STL Type Definitions
103 
104  //- The value type the FixedList contains
105  typedef T value_type;
106 
107  //- The pointer type for non-const access to value_type items
108  typedef T* pointer;
109 
110  //- The pointer type for const access to value_type items
111  typedef const T* const_pointer;
112 
113  //- The type used for storing into value_type objects
114  typedef T& reference;
115 
116  //- The type used for reading from constant value_type objects.
117  typedef const T& const_reference;
118 
119  //- Random access iterator for traversing FixedList
120  typedef T* iterator;
121 
122  //- Random access iterator for traversing FixedList
123  typedef const T* const_iterator;
124 
125  //- The type to represent the size of a FixedList
126  typedef label size_type;
127 
128  //- The difference between iterator objects
129  typedef label difference_type;
130 
131  //- Reverse iterator (non-const access)
132  typedef std::reverse_iterator<iterator> reverse_iterator;
133 
134  //- Reverse iterator (const access)
135  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
136 
137 
138  // Static Functions
139 
140  //- Return a null FixedList
141  inline static const FixedList<T, N>& null();
142 
143 
144  // Constructors
145 
146  //- Default construct
147  FixedList() = default;
148 
149  //- Construct and initialize all entries to given value
150  inline explicit FixedList(const T& val);
151 
152  //- Construct and initialize all entries to zero
153  inline explicit FixedList(const Foam::zero);
154 
155  //- Copy construct from C-array
156  inline explicit FixedList(const T list[N]);
157 
158  //- Copy construct
159  inline FixedList(const FixedList<T, N>& list);
160 
161  //- Move construct by using move assignment for the individual
162  //- list elements
163  inline FixedList(FixedList<T, N>&& list);
164 
165  //- Construct given begin/end iterators
166  // Uses std::distance when verifying the size.
167  template<class InputIterator>
168  inline FixedList(InputIterator begIter, InputIterator endIter);
169 
170  //- Construct from an initializer list
171  inline FixedList(std::initializer_list<T> list);
172 
173  //- Construct from UList
174  inline explicit FixedList(const UList<T>& list);
175 
176  //- Copy construct from a subset of the input
177  inline FixedList
178  (
179  const UList<T>& list,
180  const FixedList<label, N>& indices
181  );
182 
183  //- Construct from SLList
184  inline explicit FixedList(const SLList<T>& list);
185 
186  //- Construct from Istream
187  explicit FixedList(Istream& is);
188 
189  //- Clone
190  inline autoPtr<FixedList<T, N>> clone() const;
191 
192 
193  // Member Functions
194 
195  // Access
196 
197  //- Return a const pointer to the first data element.
198  // Similar to the STL front() method and the string::data() method
199  // This can be used (with caution) when interfacing with C code
200  inline const T* cdata() const noexcept;
201 
202  //- Return a pointer to the first data element.
203  // Similar to the STL front() method and the string::data() method
204  // This can be used (with caution) when interfacing with C code
205  inline T* data() noexcept;
206 
207  //- The first element of the list, position [0]
208  inline T& first() noexcept;
209 
210  //- The first element of the list, position [0]
211  inline const T& first() const noexcept;
212 
213  //- The last element of the list, position [N-1]
214  inline T& last() noexcept;
215 
216  //- The last element of the list, position [N-1]
217  inline const T& last() const noexcept;
218 
219 
220  //- Return the forward circular index, i.e. next index
221  //- which returns to the first at the end of the list
222  inline label fcIndex(const label i) const;
223 
224  //- Return forward circular value (ie, next value in the list)
225  inline const T& fcValue(const label i) const;
226 
227  //- Return forward circular value (ie, next value in the list)
228  inline T& fcValue(const label i);
229 
230  //- Return the reverse circular index, i.e. previous index
231  //- which returns to the last at the beginning of the list
232  inline label rcIndex(const label i) const;
233 
234  //- Return reverse circular value (ie, previous value in the list)
235  inline const T& rcValue(const label i) const;
236 
237  //- Return reverse circular value (ie, previous value in the list)
238  inline T& rcValue(const label i);
239 
240 
241  // Check
242 
243  //- Check start is within valid range [0,size)
244  inline void checkStart(const label start) const;
245 
246  //- Check size is identical to template parameter N
247  inline void checkSize(const label size) const;
248 
249  //- Check index is within valid range [0,N)
250  inline void checkIndex(const label i) const;
251 
252  //- True if all entries have identical values, and list is non-empty
253  inline bool uniform() const;
254 
255 
256  // Search
257 
258  //- Find index of the first occurrence of the value.
259  // Any occurrences before the start pos are ignored.
260  // Linear search.
261  // \return -1 if not found.
262  label find(const T& val, label pos = 0) const;
263 
264  //- Find index of the last occurrence of the value.
265  // Any occurrences after the end pos are ignored.
266  // Linear search.
267  // \return position in list or -1 if not found.
268  label rfind(const T& val, label pos = -1) const;
269 
270  //- True if the value if found in the list.
271  // Any occurrences before the start pos are ignored.
272  // Linear search.
273  inline bool found(const T& val, label pos = 0) const;
274 
275 
276  // Edit
277 
278  //- Dummy function, to make FixedList consistent with List
279  inline void resize(const label n);
280 
281  //- Dummy function, to make FixedList consistent with List
282  inline void setSize(const label n);
283 
284  //- Assign all entries to the given value
285  inline void fill(const T& val);
286 
287  //- Assign all entries to zero
288  inline void fill(const Foam::zero);
289 
290  //- Move element to the first position.
291  void moveFirst(const label i);
292 
293  //- Move element to the last position.
294  void moveLast(const label i);
295 
296  //- Swap element with the first element.
297  void swapFirst(const label i);
298 
299  //- Swap element with the last element.
300  void swapLast(const label i);
301 
302  //- Transfer by swapping using a move assignment for the content
303  //- of the individual list elements
304  inline void transfer(FixedList<T, N>& list);
305 
306 
307  // Member Operators
308 
309  //- Return element of FixedList
310  inline T& operator[](const label i);
311 
312  //- Return element of constant FixedList
313  inline const T& operator[](const label i) const;
314 
315  //- Assignment to array operator. Takes linear time
316  inline void operator=(const T list[N]);
317 
318  //- Assignment to UList operator. Takes linear time
319  inline void operator=(const UList<T>& list);
320 
321  //- Assignment to SLList operator. Takes linear time
322  inline void operator=(const SLList<T>& list);
323 
324  //- Assignment to an initializer list. Takes linear time
325  inline void operator=(std::initializer_list<T> list);
326 
327  //- Assign all entries to the given value. fill()
328  inline void operator=(const T& val);
329 
330  //- Assign all entries to zero. fill()
331  inline void operator=(const Foam::zero);
332 
333  //- Copy assignment
334  inline void operator=(const FixedList<T, N>& list);
335 
336  //- Move assignment
337  inline void operator=(FixedList<T, N>&& list);
338 
339 
340  // Random access iterator (non-const)
341 
342  //- Return an iterator to begin traversing the FixedList
343  inline iterator begin();
344 
345  //- Return an iterator to end traversing the FixedList
346  inline iterator end();
347 
348 
349  // Random access iterator (const)
350 
351  //- Return const_iterator to begin traversing the constant FixedList
352  inline const_iterator cbegin() const;
353 
354  //- Return const_iterator to end traversing the constant FixedList
355  inline const_iterator cend() const;
356 
357  //- Return const_iterator to begin traversing the constant FixedList
358  inline const_iterator begin() const;
359 
360  //- Return const_iterator to end traversing the constant FixedList
361  inline const_iterator end() const;
362 
363 
364  // Reverse iterator (non-const)
365 
366  //- Return reverse_iterator to begin reverse traversing the FixedList
367  inline reverse_iterator rbegin();
368 
369  //- Return reverse_iterator to end reverse traversing the FixedList
370  inline reverse_iterator rend();
371 
372 
373  // Reverse iterator (const)
374 
375  //- Return const_reverse_iterator to begin reverse traversing FixedList
376  inline const_reverse_iterator crbegin() const;
377 
378  //- Return const_reverse_iterator to end reverse traversing FixedList
379  inline const_reverse_iterator crend() const;
380 
381  //- Return const_reverse_iterator to begin reverse traversing FixedList
382  inline const_reverse_iterator rbegin() const;
383 
384  //- Return const_reverse_iterator to end reverse traversing FixedList
385  inline const_reverse_iterator rend() const;
386 
387 
388  // STL Member Functions
389 
390  //- Always false since zero-sized FixedList is compile-time disabled.
391  static constexpr bool empty() noexcept { return !N; }
392 
393  //- Return the number of elements in the FixedList
394  static constexpr label size() noexcept { return N; }
395 
396  //- The dimensioned size (template parameter N) of the FixedList
397  static constexpr unsigned max_size() noexcept { return N; }
398 
399  //- Swap lists by swapping the content of the individual list elements
400  inline void swap(FixedList<T, N>& list);
401 
402 
403  // STL Member Operators
404 
405  //- Equality operation on FixedLists of the same type.
406  // Returns true when the FixedLists are element-wise equal
407  // (using FixedList::value_type::operator==). Takes linear time
408  bool operator==(const FixedList<T, N>& list) const;
409 
410  //- The opposite of the equality operation. Takes linear time
411  bool operator!=(const FixedList<T, N>& list) const;
412 
413  //- Compare two FixedLists lexicographically. Takes linear time
414  bool operator<(const FixedList<T, N>& list) const;
415 
416  //- Compare two FixedLists lexicographically. Takes linear time
417  bool operator>(const FixedList<T, N>& list) const;
418 
419  //- Return true if !(a > b). Takes linear time
420  bool operator<=(const FixedList<T, N>& list) const;
421 
422  //- Return true if !(a < b). Takes linear time
423  bool operator>=(const FixedList<T, N>& list) const;
424 
425 
426  // Writing
427 
428  //- Write the list as a dictionary entry with keyword
429  void writeEntry(const word& keyword, Ostream& os) const;
430 
431  //- Write List, with line-breaks in ASCII when length exceeds shortLen.
432  // Using '0' suppresses line-breaks entirely.
433  Ostream& writeList(Ostream& os, const label shortLen=0) const;
434 
435 
436  // IOstream Operators
437 
438  //- Read from Istream, discarding contents of existing List
439  friend Istream& operator>> <T, N>
440  (
441  Istream& is,
442  FixedList<T, N>& list
443  );
444 
445 
446  // Hashing
447 
448  //- Hashing function class for FixedList
449  // Normally use the global Hash specialization, but can also use
450  // this one for inheritance in sub-classes
451  template<class HashT=Foam::Hash<T>>
452  struct Hash
453  {
454  inline unsigned operator()
455  (
456  const FixedList<T, N>& obj,
457  unsigned seed=0
458  ) const
459  {
461  {
462  return Hasher(obj.cdata(), N*sizeof(T), seed);
463  }
464 
465  for (const T& val : obj)
466  {
467  seed = HashT()(val, seed);
468  }
469  return seed;
470  }
471  };
472 };
473 
474 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
475 
476 //- FixedList is contiguous if the type is contiguous
477 template<class T, unsigned N>
478 struct is_contiguous<FixedList<T, N>> : is_contiguous<T> {};
479 
480 //- Check for FixedList of labels
481 template<class T, unsigned N>
483 
484 //- Check for FixedList of scalars
485 template<class T, unsigned N>
487 
488 
489 // * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * * //
490 
491 //- Swap FixedList contents - see FixedList::swap().
492 // Internally this actually swaps the individual list elements
493 template<class T, unsigned N>
494 inline void Swap(FixedList<T, N>& lhs, FixedList<T, N>& rhs);
495 
496 
497 //- Hashing for FixedList data, which uses Hasher for contiguous data and
498 //- element-wise incrementally hashing otherwise.
499 template<class T, unsigned N>
500 struct Hash<FixedList<T, N>>
501 {
502  inline unsigned operator()
503  (
504  const FixedList<T, N>& obj,
505  unsigned seed=0
506  ) const
507  {
509  {
510  return Hasher(obj.cdata(), N*sizeof(T), seed);
511  }
512 
513  for (const T& val : obj)
514  {
515  seed = Hash<T>()(val, seed);
516  }
517  return seed;
518  }
519 };
520 
521 
522 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
523 
524 //- Write List to Ostream, as per FixedList::writeList() with default length.
525 // The default short-length is given by Detail::ListPolicy::short_length
526 template<class T, unsigned N>
527 Ostream& operator<<(Ostream& os, const FixedList<T, N>& list)
528 {
529  return list.writeList(os, Detail::ListPolicy::short_length<T>::value);
530 }
531 
532 
533 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
534 
535 } // End namespace Foam
536 
537 
538 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
539 
540 #include "FixedListI.H"
541 
542 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
543 
544 #ifdef NoRepository
545  #include "FixedList.C"
546 #endif
547 
548 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
549 
550 #endif
551 
552 // ************************************************************************* //
Foam::FixedList::fcValue
const T & fcValue(const label i) const
Return forward circular value (ie, next value in the list)
Definition: FixedListI.H:223
Foam::FixedList::clone
autoPtr< FixedList< T, N > > clone() const
Clone.
Definition: FixedListI.H:163
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::FixedList::writeEntry
void writeEntry(Ostream &os) const
Write the FixedList with its compound type.
Definition: FixedListIO.C:37
Foam::FixedList::swapLast
void swapLast(const label i)
Swap element with the last element.
Definition: FixedList.C:118
Foam::FixedList::begin
iterator begin()
Return an iterator to begin traversing the FixedList.
Definition: FixedListI.H:506
Foam::FixedList::crbegin
const_reverse_iterator crbegin() const
Return const_reverse_iterator to begin reverse traversing FixedList.
Definition: FixedListI.H:570
Foam::FixedList::checkIndex
void checkIndex(const label i) const
Check index is within valid range [0,N)
Definition: FixedListI.H:283
Foam::Hasher
unsigned Hasher(const void *data, size_t len, unsigned seed=0)
Bob Jenkins's 96-bit mixer hashing function (lookup3)
Definition: Hasher.C:473
Foam::FixedList::transfer
void transfer(FixedList< T, N > &list)
Definition: FixedListI.H:375
Foam::FixedList::last
T & last() noexcept
The last element of the list, position [N-1].
Definition: FixedListI.H:202
Foam::FixedList::operator<=
bool operator<=(const FixedList< T, N > &list) const
Return true if !(a > b). Takes linear time.
Definition: FixedList.C:192
Foam::FixedList::const_pointer
const typedef T * const_pointer
The pointer type for const access to value_type items.
Definition: FixedList.H:110
Foam::FixedList::max_size
static constexpr unsigned max_size() noexcept
The dimensioned size (template parameter N) of the FixedList.
Definition: FixedList.H:396
Foam::FixedList::cdata
const T * cdata() const noexcept
Return a const pointer to the first data element.
Definition: FixedListI.H:173
Foam::FixedList::checkStart
void checkStart(const label start) const
Check start is within valid range [0,size)
Definition: FixedListI.H:258
Foam::FixedList::pointer
T * pointer
The pointer type for non-const access to value_type items.
Definition: FixedList.H:107
Foam::FixedList::size
static constexpr label size() noexcept
Return the number of elements in the FixedList.
Definition: FixedList.H:393
Foam::FixedList::find
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
Definition: FixedList.C:35
Foam::FixedList::size_type
label size_type
The type to represent the size of a FixedList.
Definition: FixedList.H:125
FixedListI.H
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::FixedList::operator!=
bool operator!=(const FixedList< T, N > &list) const
The opposite of the equality operation. Takes linear time.
Definition: FixedList.C:178
Foam::FixedList::resize
void resize(const label n)
Dummy function, to make FixedList consistent with List.
Definition: FixedListI.H:323
ListPolicy.H
Foam::Swap
void Swap(DynamicList< T, SizeMin1 > &a, DynamicList< T, SizeMin2 > &b)
Definition: DynamicListI.H:913
Foam::FixedList::fill
void fill(const T &val)
Assign all entries to the given value.
Definition: FixedListI.H:340
Foam::FixedList::difference_type
label difference_type
The difference between iterator objects.
Definition: FixedList.H:128
Foam::FixedList::fcIndex
label fcIndex(const label i) const
Definition: FixedListI.H:216
Foam::is_contiguous_label
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:83
Foam::FixedList::reference
T & reference
The type used for storing into value_type objects.
Definition: FixedList.H:113
Swap.H
Swap arguments as per std::swap, but in Foam namespace.
Foam::FixedList::first
T & first() noexcept
The first element of the list, position [0].
Definition: FixedListI.H:188
Foam::LList
Template class for non-intrusive linked lists.
Definition: LList.H:54
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::uniform
Definition: uniform.H:50
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::Hash
Hash function class. The default definition is for primitives, non-primitives used to hash entries on...
Definition: Hash.H:55
Foam::FixedList::operator==
bool operator==(const FixedList< T, N > &list) const
Equality operation on FixedLists of the same type.
Definition: FixedList.C:134
SLListFwd.H
Forward declarations for SLList.
Foam::FixedList::operator<
bool operator<(const FixedList< T, N > &list) const
Compare two FixedLists lexicographically. Takes linear time.
Definition: FixedList.C:154
Foam::FixedList::rfind
label rfind(const T &val, label pos=-1) const
Find index of the last occurrence of the value.
Definition: FixedList.C:57
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::FixedList::iterator
T * iterator
Random access iterator for traversing FixedList.
Definition: FixedList.H:119
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::Detail::ListPolicy::short_length
Number of items before requiring line-breaks in the list output.
Definition: ListPolicy.H:61
Foam::FixedList::rcValue
const T & rcValue(const label i) const
Return reverse circular value (ie, previous value in the list)
Definition: FixedListI.H:244
Foam::FixedList::cend
const_iterator cend() const
Return const_iterator to end traversing the constant FixedList.
Definition: FixedListI.H:546
Foam::FixedList::const_reference
const typedef T & const_reference
The type used for reading from constant value_type objects.
Definition: FixedList.H:116
bool.H
System bool.
zero.H
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::FixedList::crend
const_reverse_iterator crend() const
Return const_reverse_iterator to end reverse traversing FixedList.
Definition: FixedListI.H:594
Foam::FixedList::moveFirst
void moveFirst(const label i)
Move element to the first position.
Definition: FixedList.C:82
Foam::FixedList::value_type
T value_type
The value type the FixedList contains.
Definition: FixedList.H:104
Foam::FixedList::rend
reverse_iterator rend()
Return reverse_iterator to end reverse traversing the FixedList.
Definition: FixedListI.H:578
Foam::FixedList::setSize
void setSize(const label n)
Dummy function, to make FixedList consistent with List.
Definition: FixedListI.H:331
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::is_contiguous_scalar
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:91
Foam::FixedList::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Reverse iterator (const access)
Definition: FixedList.H:134
Foam::FixedList::end
iterator end()
Return an iterator to end traversing the FixedList.
Definition: FixedListI.H:530
Foam::FixedList::cbegin
const_iterator cbegin() const
Return const_iterator to begin traversing the constant FixedList.
Definition: FixedListI.H:522
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::FixedList::operator>
bool operator>(const FixedList< T, N > &list) const
Compare two FixedLists lexicographically. Takes linear time.
Definition: FixedList.C:185
Foam::FixedList::writeList
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
Definition: FixedListIO.C:68
Foam::FixedList::operator>=
bool operator>=(const FixedList< T, N > &list) const
Return true if !(a < b). Takes linear time.
Definition: FixedList.C:199
Foam::FixedList::Hash
Hashing function class for FixedList.
Definition: FixedList.H:451
label.H
contiguous.H
Foam::FixedList::swapFirst
void swapFirst(const label i)
Swap element with the first element.
Definition: FixedList.C:106
Foam::FixedList
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:104
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::FixedList::FixedList
FixedList()=default
Default construct.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
N
const Vector< label > N(dict.get< Vector< label >>("N"))
Foam::FixedList::const_iterator
const typedef T * const_iterator
Random access iterator for traversing FixedList.
Definition: FixedList.H:122
Foam::FixedList::empty
static constexpr bool empty() noexcept
Always false since zero-sized FixedList is compile-time disabled.
Definition: FixedList.H:390
Foam::FixedList::found
bool found(const T &val, label pos=0) const
True if the value if found in the list.
Definition: FixedListI.H:313
uLabel.H
Foam::FixedList::checkSize
void checkSize(const label size) const
Check size is identical to template parameter N.
Definition: FixedListI.H:271
Foam::FixedList::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator (non-const access)
Definition: FixedList.H:131
Foam::FixedList::rcIndex
label rcIndex(const label i) const
Definition: FixedListI.H:237
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:55
HashFwd.H
Forward definition for Hash function class and the definition for the Hasher function.
FixedList.C
Foam::FixedList::rbegin
reverse_iterator rbegin()
Return reverse_iterator to begin reverse traversing the FixedList.
Definition: FixedListI.H:554
Foam::is_contiguous
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:75
Foam::FixedList::swap
void swap(FixedList< T, N > &list)
Swap lists by swapping the content of the individual list elements.
Definition: FixedListI.H:360
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62
Foam::FixedList::moveLast
void moveLast(const label i)
Move element to the last position.
Definition: FixedList.C:94
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177
autoPtr.H