mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
src/OpenFOAM/containers: Updated formatting and comments
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -83,7 +83,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "Dictionary.C"
|
||||
#include "Dictionary.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -88,7 +88,6 @@ Foam::DictionaryBase<IDLListType, T>::DictionaryBase(Istream& is)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
// Find and return T
|
||||
template<class IDLListType, class T>
|
||||
bool Foam::DictionaryBase<IDLListType, T>::found(const word& keyword) const
|
||||
{
|
||||
@ -96,7 +95,6 @@ bool Foam::DictionaryBase<IDLListType, T>::found(const word& keyword) const
|
||||
}
|
||||
|
||||
|
||||
// Find and return T*, return NULL if not found
|
||||
template<class IDLListType, class T>
|
||||
const T* Foam::DictionaryBase<IDLListType, T>::lookupPtr
|
||||
(
|
||||
@ -116,7 +114,6 @@ const T* Foam::DictionaryBase<IDLListType, T>::lookupPtr
|
||||
}
|
||||
|
||||
|
||||
// Find and return T*, return NULL if not found
|
||||
template<class IDLListType, class T>
|
||||
T* Foam::DictionaryBase<IDLListType, T>::lookupPtr(const word& keyword)
|
||||
{
|
||||
@ -133,7 +130,6 @@ T* Foam::DictionaryBase<IDLListType, T>::lookupPtr(const word& keyword)
|
||||
}
|
||||
|
||||
|
||||
// Find and return T*, FatalError if keyword not found
|
||||
template<class IDLListType, class T>
|
||||
const T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword) const
|
||||
{
|
||||
@ -150,7 +146,6 @@ const T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword) const
|
||||
}
|
||||
|
||||
|
||||
// Find and return T*, FatalError if keyword not found
|
||||
template<class IDLListType, class T>
|
||||
T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword)
|
||||
{
|
||||
@ -167,7 +162,6 @@ T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword)
|
||||
}
|
||||
|
||||
|
||||
// Return the table of contents
|
||||
template<class IDLListType, class T>
|
||||
Foam::wordList Foam::DictionaryBase<IDLListType, T>::toc() const
|
||||
{
|
||||
@ -188,7 +182,6 @@ Foam::wordList Foam::DictionaryBase<IDLListType, T>::toc() const
|
||||
}
|
||||
|
||||
|
||||
// Add at head of dictionary
|
||||
template<class IDLListType, class T>
|
||||
void Foam::DictionaryBase<IDLListType, T>::insert(const word& keyword, T* tPtr)
|
||||
{
|
||||
@ -198,7 +191,6 @@ void Foam::DictionaryBase<IDLListType, T>::insert(const word& keyword, T* tPtr)
|
||||
}
|
||||
|
||||
|
||||
// Add at tail of dictionary
|
||||
template<class IDLListType, class T>
|
||||
void Foam::DictionaryBase<IDLListType, T>::append(const word& keyword, T* tPtr)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -183,7 +183,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "DictionaryBase.C"
|
||||
#include "DictionaryBase.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -97,7 +97,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "PtrDictionary.C"
|
||||
#include "PtrDictionary.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -111,7 +111,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "PtrListDictionary.C"
|
||||
#include "PtrListDictionary.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "UDictionary.C"
|
||||
#include "UDictionary.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "UPtrDictionary.C"
|
||||
#include "UPtrDictionary.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,7 +28,6 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct given initial table size
|
||||
template<class T, class Key, class Hash>
|
||||
Foam::HashPtrTable<T, Key, Hash>::HashPtrTable(const label size)
|
||||
:
|
||||
@ -36,7 +35,6 @@ Foam::HashPtrTable<T, Key, Hash>::HashPtrTable(const label size)
|
||||
{}
|
||||
|
||||
|
||||
// Construct as copy
|
||||
template<class T, class Key, class Hash>
|
||||
Foam::HashPtrTable<T, Key, Hash>::HashPtrTable
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -153,7 +153,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "HashPtrTable.C"
|
||||
#include "HashPtrTable.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -166,7 +166,6 @@ void Foam::HashSet<Key, Hash>::operator^=(const HashSet<Key, Hash>& rhs)
|
||||
}
|
||||
|
||||
|
||||
// same as HashTable::erase()
|
||||
template<class Key, class Hash>
|
||||
void Foam::HashSet<Key, Hash>::operator-=(const HashSet<Key, Hash>& rhs)
|
||||
{
|
||||
|
||||
@ -218,7 +218,7 @@ typedef HashSet<label, Hash<label>> labelHashSet;
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "HashSet.C"
|
||||
#include "HashSet.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -363,15 +363,13 @@ bool Foam::HashTable<T, Key, Hash>::iteratorBase::erase()
|
||||
}
|
||||
|
||||
|
||||
|
||||
// NOTE:
|
||||
// We use (const iterator&) here, but manipulate its contents anyhow.
|
||||
// The parameter should be (iterator&), but then the compiler doesn't find
|
||||
// it correctly and tries to call as (iterator) instead.
|
||||
//
|
||||
template<class T, class Key, class Hash>
|
||||
bool Foam::HashTable<T, Key, Hash>::erase(const iterator& iter)
|
||||
{
|
||||
// NOTE: We use (const iterator&) here, but manipulate its contents anyhow.
|
||||
// The parameter should be (iterator&), but then the compiler doesn't find
|
||||
// it correctly and tries to call as (iterator) instead.
|
||||
//
|
||||
// Adjust iterator after erase
|
||||
return const_cast<iterator&>(iter).erase();
|
||||
}
|
||||
|
||||
@ -546,13 +546,13 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "HashTableI.H"
|
||||
#include "HashTableI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifndef NoHashTableC
|
||||
#ifdef NoRepository
|
||||
# include "HashTable.C"
|
||||
#include "HashTable.C"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -397,13 +397,13 @@ private:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "StaticHashTableI.H"
|
||||
#include "StaticHashTableI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifndef NoStaticHashTableC
|
||||
#ifdef NoRepository
|
||||
# include "StaticHashTable.C"
|
||||
#include "StaticHashTable.C"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -345,12 +345,12 @@ Foam::StaticHashTable<T, Key, Hash>::begin()
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
if (debug)
|
||||
{
|
||||
Info<< "StaticHashTable is empty\n";
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
return StaticHashTable<T, Key, Hash>::endIter_;
|
||||
}
|
||||
@ -377,12 +377,12 @@ Foam::StaticHashTable<T, Key, Hash>::cbegin() const
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
if (debug)
|
||||
{
|
||||
Info<< "StaticHashTable is empty\n";
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
return StaticHashTable<T, Key, Hash>::endConstIter_;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -147,7 +147,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ILList.C"
|
||||
#include "ILList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -368,7 +368,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "LList.C"
|
||||
#include "LList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -270,7 +270,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "LPtrList.C"
|
||||
#include "LPtrList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,6 @@ bool Foam::UILList<LListBase, T>::operator==
|
||||
}
|
||||
|
||||
|
||||
// Comparison for inequality
|
||||
template<class LListBase, class T>
|
||||
bool Foam::UILList<LListBase, T>::operator!=
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -380,7 +380,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "UILList.C"
|
||||
#include "UILList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -139,7 +139,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "BinSum.C"
|
||||
#include "BinSum.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -254,12 +254,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "CompactListListI.H"
|
||||
#include "CompactListListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "CompactListList.C"
|
||||
#include "CompactListList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -197,7 +197,7 @@ Distribution<Type> operator+
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "Distribution.C"
|
||||
#include "Distribution.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -254,7 +254,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "DynamicList.C"
|
||||
#include "DynamicList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -44,7 +44,7 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
|
||||
List<T>(nElem),
|
||||
capacity_(nElem)
|
||||
{
|
||||
// we could also enforce SizeInc granularity when (!SizeMult || !SizeDiv)
|
||||
// We could also enforce SizeInc granularity when (!SizeMult || !SizeDiv)
|
||||
List<T>::size(0);
|
||||
}
|
||||
|
||||
@ -115,10 +115,11 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setCapacity
|
||||
|
||||
if (nextFree > capacity_)
|
||||
{
|
||||
// truncate addressed sizes too
|
||||
// Truncate addressed sizes too
|
||||
nextFree = capacity_;
|
||||
}
|
||||
// we could also enforce SizeInc granularity when (!SizeMult || !SizeDiv)
|
||||
|
||||
// We could also enforce SizeInc granularity when (!SizeMult || !SizeDiv)
|
||||
|
||||
List<T>::setSize(capacity_);
|
||||
List<T>::size(nextFree);
|
||||
@ -131,21 +132,21 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::reserve
|
||||
const label nElem
|
||||
)
|
||||
{
|
||||
// allocate more capacity?
|
||||
// Allocate more capacity?
|
||||
if (nElem > capacity_)
|
||||
{
|
||||
// TODO: convince the compiler that division by zero does not occur
|
||||
// if (SizeInc && (!SizeMult || !SizeDiv))
|
||||
// {
|
||||
// // resize with SizeInc as the granularity
|
||||
// capacity_ = nElem;
|
||||
// unsigned pad = SizeInc - (capacity_ % SizeInc);
|
||||
// if (pad != SizeInc)
|
||||
// {
|
||||
// capacity_ += pad;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// TODO: convince the compiler that division by zero does not occur
|
||||
// if (SizeInc && (!SizeMult || !SizeDiv))
|
||||
// {
|
||||
// // resize with SizeInc as the granularity
|
||||
// capacity_ = nElem;
|
||||
// unsigned pad = SizeInc - (capacity_ % SizeInc);
|
||||
// if (pad != SizeInc)
|
||||
// {
|
||||
// capacity_ += pad;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
{
|
||||
capacity_ = max
|
||||
(
|
||||
@ -154,7 +155,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::reserve
|
||||
);
|
||||
}
|
||||
|
||||
// adjust allocated size, leave addressed size untouched
|
||||
// Adjust allocated size, leave addressed size untouched
|
||||
label nextFree = List<T>::size();
|
||||
List<T>::setSize(capacity_);
|
||||
List<T>::size(nextFree);
|
||||
@ -168,21 +169,21 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
|
||||
const label nElem
|
||||
)
|
||||
{
|
||||
// allocate more capacity?
|
||||
// Allocate more capacity?
|
||||
if (nElem > capacity_)
|
||||
{
|
||||
// TODO: convince the compiler that division by zero does not occur
|
||||
// if (SizeInc && (!SizeMult || !SizeDiv))
|
||||
// {
|
||||
// // resize with SizeInc as the granularity
|
||||
// capacity_ = nElem;
|
||||
// unsigned pad = SizeInc - (capacity_ % SizeInc);
|
||||
// if (pad != SizeInc)
|
||||
// {
|
||||
// capacity_ += pad;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// TODO: convince the compiler that division by zero does not occur
|
||||
// if (SizeInc && (!SizeMult || !SizeDiv))
|
||||
// {
|
||||
// // resize with SizeInc as the granularity
|
||||
// capacity_ = nElem;
|
||||
// unsigned pad = SizeInc - (capacity_ % SizeInc);
|
||||
// if (pad != SizeInc)
|
||||
// {
|
||||
// capacity_ += pad;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
{
|
||||
capacity_ = max
|
||||
(
|
||||
@ -194,7 +195,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
|
||||
List<T>::setSize(capacity_);
|
||||
}
|
||||
|
||||
// adjust addressed size
|
||||
// Adjust addressed size
|
||||
List<T>::size(nElem);
|
||||
}
|
||||
|
||||
@ -209,7 +210,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
|
||||
label nextFree = List<T>::size();
|
||||
setSize(nElem);
|
||||
|
||||
// set new elements to constant value
|
||||
// Set new elements to constant value
|
||||
while (nextFree < nElem)
|
||||
{
|
||||
this->operator[](nextFree++) = t;
|
||||
@ -260,10 +261,10 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::shrink()
|
||||
label nextFree = List<T>::size();
|
||||
if (capacity_ > nextFree)
|
||||
{
|
||||
// use the full list when resizing
|
||||
// Use the full list when resizing
|
||||
List<T>::size(capacity_);
|
||||
|
||||
// the new size
|
||||
// The new size
|
||||
capacity_ = nextFree;
|
||||
List<T>::setSize(capacity_);
|
||||
List<T>::size(nextFree);
|
||||
@ -277,7 +278,7 @@ inline void
|
||||
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer(List<T>& lst)
|
||||
{
|
||||
capacity_ = lst.size();
|
||||
List<T>::transfer(lst); // take over storage, clear addressing for lst.
|
||||
List<T>::transfer(lst); // Take over storage, clear addressing for lst.
|
||||
}
|
||||
|
||||
|
||||
@ -288,7 +289,7 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer
|
||||
DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
|
||||
)
|
||||
{
|
||||
// take over storage as-is (without shrink), clear addressing for lst.
|
||||
// Take over storage as-is (without shrink), clear addressing for lst.
|
||||
capacity_ = lst.capacity_;
|
||||
lst.capacity_ = 0;
|
||||
|
||||
@ -421,13 +422,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
|
||||
|
||||
if (capacity_ >= lst.size())
|
||||
{
|
||||
// can copy w/o reallocating, match initial size to avoid reallocation
|
||||
// Can copy w/o reallocating, match initial size to avoid reallocation
|
||||
List<T>::size(lst.size());
|
||||
List<T>::operator=(lst);
|
||||
}
|
||||
else
|
||||
{
|
||||
// make everything available for the copy operation
|
||||
// Make everything available for the copy operation
|
||||
List<T>::size(capacity_);
|
||||
|
||||
List<T>::operator=(lst);
|
||||
@ -444,13 +445,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
|
||||
{
|
||||
if (capacity_ >= lst.size())
|
||||
{
|
||||
// can copy w/o reallocating, match initial size to avoid reallocation
|
||||
// Can copy w/o reallocating, match initial size to avoid reallocation
|
||||
List<T>::size(lst.size());
|
||||
List<T>::operator=(lst);
|
||||
}
|
||||
else
|
||||
{
|
||||
// make everything available for the copy operation
|
||||
// Make everything available for the copy operation
|
||||
List<T>::size(capacity_);
|
||||
|
||||
List<T>::operator=(lst);
|
||||
@ -467,13 +468,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
|
||||
{
|
||||
if (capacity_ >= lst.size())
|
||||
{
|
||||
// can copy w/o reallocating, match initial size to avoid reallocation
|
||||
// Can copy w/o reallocating, match initial size to avoid reallocation
|
||||
List<T>::size(lst.size());
|
||||
List<T>::operator=(lst);
|
||||
}
|
||||
else
|
||||
{
|
||||
// make everything available for the copy operation
|
||||
// Make everything available for the copy operation
|
||||
List<T>::size(capacity_);
|
||||
|
||||
List<T>::operator=(lst);
|
||||
@ -481,4 +482,5 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -365,7 +365,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "FixedList.C"
|
||||
#include "FixedList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -125,7 +125,6 @@ inline Foam::label Foam::FixedList<T, Size>::rcIndex(const label i) const
|
||||
}
|
||||
|
||||
|
||||
// Check start is within valid range (0 ... size-1).
|
||||
template<class T, unsigned Size>
|
||||
inline void Foam::FixedList<T, Size>::checkStart(const label start) const
|
||||
{
|
||||
@ -138,7 +137,6 @@ inline void Foam::FixedList<T, Size>::checkStart(const label start) const
|
||||
}
|
||||
|
||||
|
||||
// Check size is within valid range (0 ... size).
|
||||
template<class T, unsigned Size>
|
||||
inline void Foam::FixedList<T, Size>::checkSize(const label size) const
|
||||
{
|
||||
@ -151,8 +149,6 @@ inline void Foam::FixedList<T, Size>::checkSize(const label size) const
|
||||
}
|
||||
|
||||
|
||||
// Check index i is within valid range (0 ... size-1)
|
||||
// The check for zero-sized list is already done in static assert
|
||||
template<class T, unsigned Size>
|
||||
inline void Foam::FixedList<T, Size>::checkIndex(const label i) const
|
||||
{
|
||||
@ -168,17 +164,17 @@ inline void Foam::FixedList<T, Size>::checkIndex(const label i) const
|
||||
template<class T, unsigned Size>
|
||||
inline void Foam::FixedList<T, Size>::resize(const label s)
|
||||
{
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
checkSize(s);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class T, unsigned Size>
|
||||
inline void Foam::FixedList<T, Size>::setSize(const label s)
|
||||
{
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
checkSize(s);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class T, unsigned Size>
|
||||
@ -237,24 +233,22 @@ inline const T& Foam::FixedList<T, Size>::last() const
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
// element access
|
||||
template<class T, unsigned Size>
|
||||
inline T& Foam::FixedList<T, Size>::operator[](const label i)
|
||||
{
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
checkIndex(i);
|
||||
# endif
|
||||
#endif
|
||||
return v_[i];
|
||||
}
|
||||
|
||||
|
||||
// const element access
|
||||
template<class T, unsigned Size>
|
||||
inline const T& Foam::FixedList<T, Size>::operator[](const label i) const
|
||||
{
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
checkIndex(i);
|
||||
# endif
|
||||
#endif
|
||||
return v_[i];
|
||||
}
|
||||
|
||||
@ -435,12 +429,12 @@ inline unsigned Foam::FixedList<T, Size>::Hash<HashT>::operator()
|
||||
{
|
||||
if (contiguous<T>())
|
||||
{
|
||||
// hash directly
|
||||
// Hash directly
|
||||
return Hasher(lst.v_, sizeof(lst.v_), seed);
|
||||
}
|
||||
else
|
||||
{
|
||||
// hash incrementally
|
||||
// Hash incrementally
|
||||
unsigned val = seed;
|
||||
|
||||
for (unsigned i=0; i<Size; i++)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -120,12 +120,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//# include "HistogramI.H"
|
||||
// #include "HistogramI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "Histogram.C"
|
||||
#include "Histogram.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -251,12 +251,12 @@ List<T> readList(Istream&);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "ListI.H"
|
||||
#include "ListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "List.C"
|
||||
#include "List.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -150,7 +150,7 @@ namespace ListListOps
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ListListOps.C"
|
||||
#include "ListListOps.C"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -291,7 +291,7 @@ void inplaceRotateList(ListType<DataType>& list, label n);
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ListOpsTemplates.C"
|
||||
#include "ListOpsTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -411,8 +411,6 @@ void Foam::inplaceSubset
|
||||
}
|
||||
|
||||
|
||||
// As clarification:
|
||||
// coded as inversion from pointEdges to edges but completely general.
|
||||
template<class InList, class OutList>
|
||||
void Foam::invertManyToMany
|
||||
(
|
||||
|
||||
@ -31,7 +31,7 @@ License
|
||||
|
||||
#if (UINT_MAX == 0xFFFFFFFF)
|
||||
// 32-bit counting, Hamming weight method
|
||||
# define COUNT_PACKEDBITS(sum, x) \
|
||||
#define COUNT_PACKEDBITS(sum, x) \
|
||||
{ \
|
||||
x -= (x >> 1) & 0x55555555; \
|
||||
x = (x & 0x33333333) + ((x >> 2) & 0x33333333); \
|
||||
@ -39,7 +39,7 @@ License
|
||||
}
|
||||
#elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
|
||||
// 64-bit counting, Hamming weight method
|
||||
# define COUNT_PACKEDBITS(sum, x) \
|
||||
#define COUNT_PACKEDBITS(sum, x) \
|
||||
{ \
|
||||
x -= (x >> 1) & 0x5555555555555555; \
|
||||
x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); \
|
||||
@ -47,7 +47,7 @@ License
|
||||
}
|
||||
#else
|
||||
// Arbitrary number of bits, Brian Kernighan's method
|
||||
# define COUNT_PACKEDBITS(sum, x) for (; x; ++sum) { x &= x - 1; }
|
||||
#define COUNT_PACKEDBITS(sum, x) for (; x; ++sum) { x &= x - 1; }
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -639,7 +639,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "PackedList.C"
|
||||
#include "PackedList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -52,7 +52,7 @@ inline unsigned int Foam::PackedList<nBits>::packing()
|
||||
template<unsigned nBits>
|
||||
inline unsigned int Foam::PackedList<nBits>::maskLower(unsigned offset)
|
||||
{
|
||||
// return (1u << (nBits * offset)) - 1;
|
||||
// Return (1u << (nBits * offset)) - 1;
|
||||
// The next one works more reliably with overflows
|
||||
// eg, when compiled without optimization
|
||||
return (~0u >> ( sizeof(StorageType)*CHAR_BIT - nBits * offset));
|
||||
@ -266,8 +266,6 @@ Foam::PackedList<nBits>::clone() const
|
||||
|
||||
// * * * * * * * * * * * * * * * * Iterators * * * * * * * * * * * * * * * * //
|
||||
|
||||
// iteratorBase
|
||||
|
||||
template<unsigned nBits>
|
||||
inline Foam::PackedList<nBits>::iteratorBase::iteratorBase()
|
||||
:
|
||||
@ -315,7 +313,7 @@ Foam::PackedList<nBits>::iteratorBase::set(const unsigned int val)
|
||||
|
||||
if (val >= max_value())
|
||||
{
|
||||
// overflow is max_value, fill everything
|
||||
// Overflow is max_value, fill everything
|
||||
stored |= mask;
|
||||
}
|
||||
else
|
||||
@ -372,7 +370,7 @@ inline void Foam::PackedList<nBits>::iteratorBase::operator=
|
||||
const unsigned int val
|
||||
)
|
||||
{
|
||||
// lazy evaluation - increase size on assigment
|
||||
// Lazy evaluation - increase size on assigment
|
||||
if (index_ >= list_->size_)
|
||||
{
|
||||
list_->resize(index_ + 1);
|
||||
@ -386,7 +384,7 @@ template<unsigned nBits>
|
||||
inline Foam::PackedList<nBits>::iteratorBase::operator
|
||||
unsigned int () const
|
||||
{
|
||||
// lazy evaluation - return 0 for out-of-range
|
||||
// Lazy evaluation - return 0 for out-of-range
|
||||
if (index_ >= list_->size_)
|
||||
{
|
||||
return 0;
|
||||
@ -396,8 +394,6 @@ unsigned int () const
|
||||
}
|
||||
|
||||
|
||||
// const_iterator, iterator
|
||||
|
||||
template<unsigned nBits>
|
||||
inline Foam::PackedList<nBits>::iterator::iterator()
|
||||
:
|
||||
@ -420,7 +416,7 @@ inline Foam::PackedList<nBits>::iterator::iterator
|
||||
:
|
||||
iteratorBase(iter)
|
||||
{
|
||||
// avoid going past end()
|
||||
// Avoid going past end()
|
||||
// eg, iter = iterator(list, Inf)
|
||||
if (this->index_ > this->list_->size_)
|
||||
{
|
||||
@ -437,7 +433,7 @@ inline Foam::PackedList<nBits>::const_iterator::const_iterator
|
||||
:
|
||||
iteratorBase(iter)
|
||||
{
|
||||
// avoid going past end()
|
||||
// Avoid going past end()
|
||||
// eg, iter = iterator(list, Inf)
|
||||
if (this->index_ > this->list_->size_)
|
||||
{
|
||||
@ -527,7 +523,7 @@ inline void Foam::PackedList<nBits>::iterator::operator=
|
||||
this->list_ = iter.list_;
|
||||
this->index_ = iter.index_;
|
||||
|
||||
// avoid going past end()
|
||||
// Avoid going past end()
|
||||
// eg, iter = iterator(list, Inf)
|
||||
if (this->index_ > this->list_->size_)
|
||||
{
|
||||
@ -545,7 +541,7 @@ inline void Foam::PackedList<nBits>::const_iterator::operator=
|
||||
this->list_ = iter.list_;
|
||||
this->index_ = iter.index_;
|
||||
|
||||
// avoid going past end()
|
||||
// Avoid going past end()
|
||||
// eg, iter = iterator(list, Inf)
|
||||
if (this->index_ > this->list_->size_)
|
||||
{
|
||||
@ -742,15 +738,15 @@ inline void Foam::PackedList<nBits>::resize
|
||||
|
||||
if (size_ > oldSize)
|
||||
{
|
||||
// fill new elements or newly exposed elements
|
||||
// Fill new elements or newly exposed elements
|
||||
if (val)
|
||||
{
|
||||
// fill value for complete segments
|
||||
// Fill value for complete segments
|
||||
unsigned int fill = val;
|
||||
|
||||
if (val >= max_value())
|
||||
{
|
||||
// fill everything
|
||||
// Fill everything
|
||||
fill = maskLower(packing());
|
||||
}
|
||||
else
|
||||
@ -761,7 +757,7 @@ inline void Foam::PackedList<nBits>::resize
|
||||
}
|
||||
}
|
||||
|
||||
// fill in complete segments
|
||||
// Fill in complete segments
|
||||
const label oldLen = packedLength(oldSize);
|
||||
const label newLen = packedLength(size_);
|
||||
for (label i=oldLen; i < newLen; ++i)
|
||||
@ -769,7 +765,7 @@ inline void Foam::PackedList<nBits>::resize
|
||||
StorageList::operator[](i) = fill;
|
||||
}
|
||||
|
||||
// finish previous partial segment, preserve existing value
|
||||
// Finish previous partial segment, preserve existing value
|
||||
{
|
||||
const unsigned int off = oldSize % packing();
|
||||
if (off)
|
||||
@ -783,7 +779,7 @@ inline void Foam::PackedList<nBits>::resize
|
||||
}
|
||||
|
||||
|
||||
// mask off the (new) final partial segment
|
||||
// Mask off the (new) final partial segment
|
||||
{
|
||||
const unsigned int off = size_ % packing();
|
||||
if (off)
|
||||
@ -797,10 +793,10 @@ inline void Foam::PackedList<nBits>::resize
|
||||
}
|
||||
else if (size_ < oldSize)
|
||||
{
|
||||
// resize shrinking
|
||||
// Resize shrinking
|
||||
// - clear newly exposed elements
|
||||
|
||||
// fill in complete segments
|
||||
// Fill in complete segments
|
||||
const label oldLen = packedLength(oldSize);
|
||||
const label newLen = packedLength(size_);
|
||||
for (label i=newLen; i < oldLen; ++i)
|
||||
@ -808,7 +804,7 @@ inline void Foam::PackedList<nBits>::resize
|
||||
StorageList::operator[](i) = 0u;
|
||||
}
|
||||
|
||||
// mask off the final partial segment
|
||||
// Mask off the final partial segment
|
||||
{
|
||||
const unsigned int off = size_ % packing();
|
||||
if (off)
|
||||
@ -846,12 +842,12 @@ inline void Foam::PackedList<nBits>::setCapacity(const label nElem)
|
||||
{
|
||||
StorageList::setSize(packedLength(nElem), 0u);
|
||||
|
||||
// truncate addressed size too
|
||||
// Truncate addressed size too
|
||||
if (size_ > nElem)
|
||||
{
|
||||
size_ = nElem;
|
||||
|
||||
// mask off the final partial segment
|
||||
// Mask off the final partial segment
|
||||
const unsigned int off = size_ % packing();
|
||||
if (off)
|
||||
{
|
||||
@ -868,7 +864,7 @@ inline void Foam::PackedList<nBits>::reserve(const label nElem)
|
||||
{
|
||||
const label len = packedLength(nElem);
|
||||
|
||||
// need more capacity?
|
||||
// Need more capacity?
|
||||
if (len > StorageList::size())
|
||||
{
|
||||
// Like DynamicList with SizeInc=0, SizeMult=2, SizeDiv=1
|
||||
@ -911,7 +907,7 @@ inline void Foam::PackedList<nBits>::clearStorage()
|
||||
template<unsigned nBits>
|
||||
inline void Foam::PackedList<nBits>::shrink()
|
||||
{
|
||||
// any uneed space allocated?
|
||||
// Any uneed space allocated?
|
||||
const label len = packedLength();
|
||||
if (len < StorageList::size())
|
||||
{
|
||||
@ -967,7 +963,7 @@ inline Foam::Xfer<Foam::PackedList<nBits>> Foam::PackedList<nBits>::xfer()
|
||||
template<unsigned nBits>
|
||||
inline unsigned int Foam::PackedList<nBits>::get(const label i) const
|
||||
{
|
||||
// lazy evaluation - return 0 for out-of-range
|
||||
// Lazy evaluation - return 0 for out-of-range
|
||||
if (i < 0 || i >= size_)
|
||||
{
|
||||
return 0;
|
||||
@ -982,7 +978,7 @@ inline unsigned int Foam::PackedList<nBits>::get(const label i) const
|
||||
template<unsigned nBits>
|
||||
inline unsigned int Foam::PackedList<nBits>::operator[](const label i) const
|
||||
{
|
||||
// lazy evaluation - return 0 for out-of-range
|
||||
// Lazy evaluation - return 0 for out-of-range
|
||||
if (i < 0 || i >= size_)
|
||||
{
|
||||
return 0;
|
||||
@ -1003,12 +999,12 @@ inline bool Foam::PackedList<nBits>::set
|
||||
{
|
||||
if (i < 0)
|
||||
{
|
||||
// lazy evaluation - ignore out-of-bounds
|
||||
// Lazy evaluation - ignore out-of-bounds
|
||||
return false;
|
||||
}
|
||||
else if (i >= size_)
|
||||
{
|
||||
// lazy evaluation - increase size on assigment
|
||||
// Lazy evaluation - increase size on assigment
|
||||
resize(i + 1);
|
||||
}
|
||||
|
||||
@ -1080,7 +1076,7 @@ inline void Foam::PackedList<nBits>::operator=(const unsigned int val)
|
||||
|
||||
if (val >= max_value())
|
||||
{
|
||||
// fill everything
|
||||
// Fill everything
|
||||
fill = maskLower(packing());
|
||||
}
|
||||
else
|
||||
@ -1096,7 +1092,7 @@ inline void Foam::PackedList<nBits>::operator=(const unsigned int val)
|
||||
StorageList::operator[](i) = fill;
|
||||
}
|
||||
|
||||
// mask off the final partial segment
|
||||
// Mask off the final partial segment
|
||||
{
|
||||
const unsigned int off = size_ % packing();
|
||||
if (off)
|
||||
|
||||
@ -432,12 +432,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "PtrListI.H"
|
||||
#include "PtrListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "PtrList.C"
|
||||
#include "PtrList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,7 +48,6 @@ void Foam::ParSortableList<Type>::write
|
||||
}
|
||||
|
||||
|
||||
// Copy src, starting at destI into dest.
|
||||
template<class Type>
|
||||
void Foam::ParSortableList<Type>::copyInto
|
||||
(
|
||||
@ -122,7 +121,6 @@ void Foam::ParSortableList<Type>::checkAndSend
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from List, sorting the elements
|
||||
template<class Type>
|
||||
Foam::ParSortableList<Type>::ParSortableList(const UList<Type>& values)
|
||||
:
|
||||
@ -134,7 +132,6 @@ Foam::ParSortableList<Type>::ParSortableList(const UList<Type>& values)
|
||||
}
|
||||
|
||||
|
||||
// Construct given size. Sort later on.
|
||||
template<class Type>
|
||||
Foam::ParSortableList<Type>::ParSortableList(const label size)
|
||||
:
|
||||
@ -146,7 +143,6 @@ Foam::ParSortableList<Type>::ParSortableList(const label size)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
// Sort
|
||||
template<class Type>
|
||||
void Foam::ParSortableList<Type>::sort()
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -204,7 +204,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ParSortableList.C"
|
||||
#include "ParSortableList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -137,7 +137,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "SortableList.C"
|
||||
#include "SortableList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -34,9 +34,9 @@ inline Foam::SubList<T>::SubList
|
||||
:
|
||||
UList<T>(list.v_, subSize)
|
||||
{
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
list.checkSize(subSize);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ inline Foam::SubList<T>::SubList
|
||||
:
|
||||
UList<T>(&(list.v_[startIndex]), subSize)
|
||||
{
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
|
||||
// Artificially allow the start of a zero-sized subList to be
|
||||
// one past the end of the original list.
|
||||
@ -65,7 +65,7 @@ inline Foam::SubList<T>::SubList
|
||||
// behind the last element is allowed
|
||||
list.checkSize(startIndex);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -165,7 +165,7 @@ public:
|
||||
#include "UIndirectListI.H"
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "UIndirectListIO.C"
|
||||
#include "UIndirectListIO.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -391,7 +391,7 @@ inline void reverse(UList<T>&);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "UListI.H"
|
||||
#include "UListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -459,7 +459,7 @@ inline void reverse(UList<T>&);
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "UList.C"
|
||||
#include "UList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -68,7 +68,6 @@ inline Foam::label Foam::UList<T>::rcIndex(const label i) const
|
||||
}
|
||||
|
||||
|
||||
// Check start is within valid range (0 ... size-1).
|
||||
template<class T>
|
||||
inline void Foam::UList<T>::checkStart(const label start) const
|
||||
{
|
||||
@ -81,7 +80,6 @@ inline void Foam::UList<T>::checkStart(const label start) const
|
||||
}
|
||||
|
||||
|
||||
// Check size is within valid range (0 ... size).
|
||||
template<class T>
|
||||
inline void Foam::UList<T>::checkSize(const label size) const
|
||||
{
|
||||
@ -94,7 +92,6 @@ inline void Foam::UList<T>::checkSize(const label size) const
|
||||
}
|
||||
|
||||
|
||||
// Check index i is within valid range (0 ... size-1).
|
||||
template<class T>
|
||||
inline void Foam::UList<T>::checkIndex(const label i) const
|
||||
{
|
||||
@ -158,20 +155,18 @@ inline T* Foam::UList<T>::data()
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// element access
|
||||
template<class T>
|
||||
inline T& Foam::UList<T>::operator[](const label i)
|
||||
{
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
checkIndex(i);
|
||||
# endif
|
||||
#endif
|
||||
return v_[i];
|
||||
}
|
||||
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Template specialization for bool
|
||||
template<>
|
||||
inline const bool& Foam::UList<bool>::operator[](const label i) const
|
||||
@ -186,22 +181,19 @@ namespace Foam
|
||||
return Foam::pTraits<bool>::zero;
|
||||
}
|
||||
}
|
||||
|
||||
} // end of namespace Foam
|
||||
}
|
||||
|
||||
|
||||
// const element access
|
||||
template<class T>
|
||||
inline const T& Foam::UList<T>::operator[](const label i) const
|
||||
{
|
||||
# ifdef FULLDEBUG
|
||||
#ifdef FULLDEBUG
|
||||
checkIndex(i);
|
||||
# endif
|
||||
#endif
|
||||
return v_[i];
|
||||
}
|
||||
|
||||
|
||||
// Allow cast to a const List<T>&
|
||||
template<class T>
|
||||
inline Foam::UList<T>::operator const Foam::List<T>&() const
|
||||
{
|
||||
|
||||
@ -273,12 +273,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "UPtrListI.H"
|
||||
#include "UPtrListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "UPtrList.C"
|
||||
#include "UPtrList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -125,7 +125,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "NamedEnum.C"
|
||||
#include "NamedEnum.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Reference in New Issue
Block a user