src/OpenFOAM/containers: Updated formatting and comments

This commit is contained in:
Henry Weller
2016-02-28 18:21:58 +00:00
parent 0830ace954
commit 0db8ff34fd
45 changed files with 165 additions and 201 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -83,7 +83,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "Dictionary.C" #include "Dictionary.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -88,7 +88,6 @@ Foam::DictionaryBase<IDLListType, T>::DictionaryBase(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Find and return T
template<class IDLListType, class T> template<class IDLListType, class T>
bool Foam::DictionaryBase<IDLListType, T>::found(const word& keyword) const 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> template<class IDLListType, class T>
const T* Foam::DictionaryBase<IDLListType, T>::lookupPtr 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> template<class IDLListType, class T>
T* Foam::DictionaryBase<IDLListType, T>::lookupPtr(const word& keyword) 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> template<class IDLListType, class T>
const T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword) const 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> template<class IDLListType, class T>
T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword) 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> template<class IDLListType, class T>
Foam::wordList Foam::DictionaryBase<IDLListType, T>::toc() const 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> template<class IDLListType, class T>
void Foam::DictionaryBase<IDLListType, T>::insert(const word& keyword, T* tPtr) 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> template<class IDLListType, class T>
void Foam::DictionaryBase<IDLListType, T>::append(const word& keyword, T* tPtr) void Foam::DictionaryBase<IDLListType, T>::append(const word& keyword, T* tPtr)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -183,7 +183,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "DictionaryBase.C" #include "DictionaryBase.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -97,7 +97,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "PtrDictionary.C" #include "PtrDictionary.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -111,7 +111,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "PtrListDictionary.C" #include "PtrListDictionary.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,7 +76,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "UDictionary.C" #include "UDictionary.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,7 +76,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "UPtrDictionary.C" #include "UPtrDictionary.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,7 +28,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct given initial table size
template<class T, class Key, class Hash> template<class T, class Key, class Hash>
Foam::HashPtrTable<T, Key, Hash>::HashPtrTable(const label size) 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> template<class T, class Key, class Hash>
Foam::HashPtrTable<T, Key, Hash>::HashPtrTable Foam::HashPtrTable<T, Key, Hash>::HashPtrTable
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -153,7 +153,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "HashPtrTable.C" #include "HashPtrTable.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License 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> template<class Key, class Hash>
void Foam::HashSet<Key, Hash>::operator-=(const HashSet<Key, Hash>& rhs) void Foam::HashSet<Key, Hash>::operator-=(const HashSet<Key, Hash>& rhs)
{ {

View File

@ -218,7 +218,7 @@ typedef HashSet<label, Hash<label>> labelHashSet;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "HashSet.C" #include "HashSet.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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> template<class T, class Key, class Hash>
bool Foam::HashTable<T, Key, Hash>::erase(const iterator& iter) 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 // Adjust iterator after erase
return const_cast<iterator&>(iter).erase(); return const_cast<iterator&>(iter).erase();
} }

View File

@ -546,13 +546,13 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "HashTableI.H" #include "HashTableI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifndef NoHashTableC #ifndef NoHashTableC
#ifdef NoRepository #ifdef NoRepository
# include "HashTable.C" #include "HashTable.C"
#endif #endif
#endif #endif

View File

@ -397,13 +397,13 @@ private:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "StaticHashTableI.H" #include "StaticHashTableI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifndef NoStaticHashTableC #ifndef NoStaticHashTableC
#ifdef NoRepository #ifdef NoRepository
# include "StaticHashTable.C" #include "StaticHashTable.C"
#endif #endif
#endif #endif

View File

@ -345,12 +345,12 @@ Foam::StaticHashTable<T, Key, Hash>::begin()
} }
} }
# ifdef FULLDEBUG #ifdef FULLDEBUG
if (debug) if (debug)
{ {
Info<< "StaticHashTable is empty\n"; Info<< "StaticHashTable is empty\n";
} }
# endif #endif
return StaticHashTable<T, Key, Hash>::endIter_; return StaticHashTable<T, Key, Hash>::endIter_;
} }
@ -377,12 +377,12 @@ Foam::StaticHashTable<T, Key, Hash>::cbegin() const
} }
} }
# ifdef FULLDEBUG #ifdef FULLDEBUG
if (debug) if (debug)
{ {
Info<< "StaticHashTable is empty\n"; Info<< "StaticHashTable is empty\n";
} }
# endif #endif
return StaticHashTable<T, Key, Hash>::endConstIter_; return StaticHashTable<T, Key, Hash>::endConstIter_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -147,7 +147,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "ILList.C" #include "ILList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -368,7 +368,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "LList.C" #include "LList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -270,7 +270,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "LPtrList.C" #include "LPtrList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,7 +76,6 @@ bool Foam::UILList<LListBase, T>::operator==
} }
// Comparison for inequality
template<class LListBase, class T> template<class LListBase, class T>
bool Foam::UILList<LListBase, T>::operator!= bool Foam::UILList<LListBase, T>::operator!=
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -380,7 +380,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "UILList.C" #include "UILList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -139,7 +139,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "BinSum.C" #include "BinSum.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -254,12 +254,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "CompactListListI.H" #include "CompactListListI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "CompactListList.C" #include "CompactListList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -197,7 +197,7 @@ Distribution<Type> operator+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "Distribution.C" #include "Distribution.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -254,7 +254,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "DynamicList.C" #include "DynamicList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -44,7 +44,7 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
List<T>(nElem), List<T>(nElem),
capacity_(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); List<T>::size(0);
} }
@ -115,10 +115,11 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setCapacity
if (nextFree > capacity_) if (nextFree > capacity_)
{ {
// truncate addressed sizes too // Truncate addressed sizes too
nextFree = capacity_; 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>::setSize(capacity_);
List<T>::size(nextFree); List<T>::size(nextFree);
@ -131,21 +132,21 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::reserve
const label nElem const label nElem
) )
{ {
// allocate more capacity? // Allocate more capacity?
if (nElem > capacity_) if (nElem > capacity_)
{ {
// TODO: convince the compiler that division by zero does not occur // TODO: convince the compiler that division by zero does not occur
// if (SizeInc && (!SizeMult || !SizeDiv)) // if (SizeInc && (!SizeMult || !SizeDiv))
// { // {
// // resize with SizeInc as the granularity // // resize with SizeInc as the granularity
// capacity_ = nElem; // capacity_ = nElem;
// unsigned pad = SizeInc - (capacity_ % SizeInc); // unsigned pad = SizeInc - (capacity_ % SizeInc);
// if (pad != SizeInc) // if (pad != SizeInc)
// { // {
// capacity_ += pad; // capacity_ += pad;
// } // }
// } // }
// else // else
{ {
capacity_ = max 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(); label nextFree = List<T>::size();
List<T>::setSize(capacity_); List<T>::setSize(capacity_);
List<T>::size(nextFree); List<T>::size(nextFree);
@ -168,21 +169,21 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
const label nElem const label nElem
) )
{ {
// allocate more capacity? // Allocate more capacity?
if (nElem > capacity_) if (nElem > capacity_)
{ {
// TODO: convince the compiler that division by zero does not occur // TODO: convince the compiler that division by zero does not occur
// if (SizeInc && (!SizeMult || !SizeDiv)) // if (SizeInc && (!SizeMult || !SizeDiv))
// { // {
// // resize with SizeInc as the granularity // // resize with SizeInc as the granularity
// capacity_ = nElem; // capacity_ = nElem;
// unsigned pad = SizeInc - (capacity_ % SizeInc); // unsigned pad = SizeInc - (capacity_ % SizeInc);
// if (pad != SizeInc) // if (pad != SizeInc)
// { // {
// capacity_ += pad; // capacity_ += pad;
// } // }
// } // }
// else // else
{ {
capacity_ = max capacity_ = max
( (
@ -194,7 +195,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
List<T>::setSize(capacity_); List<T>::setSize(capacity_);
} }
// adjust addressed size // Adjust addressed size
List<T>::size(nElem); List<T>::size(nElem);
} }
@ -209,7 +210,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
label nextFree = List<T>::size(); label nextFree = List<T>::size();
setSize(nElem); setSize(nElem);
// set new elements to constant value // Set new elements to constant value
while (nextFree < nElem) while (nextFree < nElem)
{ {
this->operator[](nextFree++) = t; this->operator[](nextFree++) = t;
@ -260,10 +261,10 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::shrink()
label nextFree = List<T>::size(); label nextFree = List<T>::size();
if (capacity_ > nextFree) if (capacity_ > nextFree)
{ {
// use the full list when resizing // Use the full list when resizing
List<T>::size(capacity_); List<T>::size(capacity_);
// the new size // The new size
capacity_ = nextFree; capacity_ = nextFree;
List<T>::setSize(capacity_); List<T>::setSize(capacity_);
List<T>::size(nextFree); List<T>::size(nextFree);
@ -277,7 +278,7 @@ inline void
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer(List<T>& lst) Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer(List<T>& lst)
{ {
capacity_ = lst.size(); 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 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_; capacity_ = lst.capacity_;
lst.capacity_ = 0; lst.capacity_ = 0;
@ -421,13 +422,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
if (capacity_ >= lst.size()) 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>::size(lst.size());
List<T>::operator=(lst); List<T>::operator=(lst);
} }
else else
{ {
// make everything available for the copy operation // Make everything available for the copy operation
List<T>::size(capacity_); List<T>::size(capacity_);
List<T>::operator=(lst); List<T>::operator=(lst);
@ -444,13 +445,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
{ {
if (capacity_ >= lst.size()) 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>::size(lst.size());
List<T>::operator=(lst); List<T>::operator=(lst);
} }
else else
{ {
// make everything available for the copy operation // Make everything available for the copy operation
List<T>::size(capacity_); List<T>::size(capacity_);
List<T>::operator=(lst); List<T>::operator=(lst);
@ -467,13 +468,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
{ {
if (capacity_ >= lst.size()) 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>::size(lst.size());
List<T>::operator=(lst); List<T>::operator=(lst);
} }
else else
{ {
// make everything available for the copy operation // Make everything available for the copy operation
List<T>::size(capacity_); List<T>::size(capacity_);
List<T>::operator=(lst); List<T>::operator=(lst);
@ -481,4 +482,5 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -365,7 +365,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "FixedList.C" #include "FixedList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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> template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::checkStart(const label start) const 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> template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::checkSize(const label size) const 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> template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::checkIndex(const label i) const 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> template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::resize(const label s) inline void Foam::FixedList<T, Size>::resize(const label s)
{ {
# ifdef FULLDEBUG #ifdef FULLDEBUG
checkSize(s); checkSize(s);
# endif #endif
} }
template<class T, unsigned Size> template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::setSize(const label s) inline void Foam::FixedList<T, Size>::setSize(const label s)
{ {
# ifdef FULLDEBUG #ifdef FULLDEBUG
checkSize(s); checkSize(s);
# endif #endif
} }
template<class T, unsigned Size> template<class T, unsigned Size>
@ -237,24 +233,22 @@ inline const T& Foam::FixedList<T, Size>::last() const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// element access
template<class T, unsigned Size> template<class T, unsigned Size>
inline T& Foam::FixedList<T, Size>::operator[](const label i) inline T& Foam::FixedList<T, Size>::operator[](const label i)
{ {
# ifdef FULLDEBUG #ifdef FULLDEBUG
checkIndex(i); checkIndex(i);
# endif #endif
return v_[i]; return v_[i];
} }
// const element access
template<class T, unsigned Size> template<class T, unsigned Size>
inline const T& Foam::FixedList<T, Size>::operator[](const label i) const inline const T& Foam::FixedList<T, Size>::operator[](const label i) const
{ {
# ifdef FULLDEBUG #ifdef FULLDEBUG
checkIndex(i); checkIndex(i);
# endif #endif
return v_[i]; return v_[i];
} }
@ -435,12 +429,12 @@ inline unsigned Foam::FixedList<T, Size>::Hash<HashT>::operator()
{ {
if (contiguous<T>()) if (contiguous<T>())
{ {
// hash directly // Hash directly
return Hasher(lst.v_, sizeof(lst.v_), seed); return Hasher(lst.v_, sizeof(lst.v_), seed);
} }
else else
{ {
// hash incrementally // Hash incrementally
unsigned val = seed; unsigned val = seed;
for (unsigned i=0; i<Size; i++) for (unsigned i=0; i<Size; i++)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -120,12 +120,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//# include "HistogramI.H" // #include "HistogramI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "Histogram.C" #include "Histogram.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -251,12 +251,12 @@ List<T> readList(Istream&);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "ListI.H" #include "ListI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "List.C" #include "List.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -150,7 +150,7 @@ namespace ListListOps
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "ListListOps.C" #include "ListListOps.C"
#endif #endif

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -291,7 +291,7 @@ void inplaceRotateList(ListType<DataType>& list, label n);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "ListOpsTemplates.C" #include "ListOpsTemplates.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License 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> template<class InList, class OutList>
void Foam::invertManyToMany void Foam::invertManyToMany
( (

View File

@ -31,7 +31,7 @@ License
#if (UINT_MAX == 0xFFFFFFFF) #if (UINT_MAX == 0xFFFFFFFF)
// 32-bit counting, Hamming weight method // 32-bit counting, Hamming weight method
# define COUNT_PACKEDBITS(sum, x) \ #define COUNT_PACKEDBITS(sum, x) \
{ \ { \
x -= (x >> 1) & 0x55555555; \ x -= (x >> 1) & 0x55555555; \
x = (x & 0x33333333) + ((x >> 2) & 0x33333333); \ x = (x & 0x33333333) + ((x >> 2) & 0x33333333); \
@ -39,7 +39,7 @@ License
} }
#elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF) #elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
// 64-bit counting, Hamming weight method // 64-bit counting, Hamming weight method
# define COUNT_PACKEDBITS(sum, x) \ #define COUNT_PACKEDBITS(sum, x) \
{ \ { \
x -= (x >> 1) & 0x5555555555555555; \ x -= (x >> 1) & 0x5555555555555555; \
x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); \ x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); \
@ -47,7 +47,7 @@ License
} }
#else #else
// Arbitrary number of bits, Brian Kernighan's method // 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 #endif

View File

@ -639,7 +639,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "PackedList.C" #include "PackedList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -52,7 +52,7 @@ inline unsigned int Foam::PackedList<nBits>::packing()
template<unsigned nBits> template<unsigned nBits>
inline unsigned int Foam::PackedList<nBits>::maskLower(unsigned offset) 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 // The next one works more reliably with overflows
// eg, when compiled without optimization // eg, when compiled without optimization
return (~0u >> ( sizeof(StorageType)*CHAR_BIT - nBits * offset)); return (~0u >> ( sizeof(StorageType)*CHAR_BIT - nBits * offset));
@ -266,8 +266,6 @@ Foam::PackedList<nBits>::clone() const
// * * * * * * * * * * * * * * * * Iterators * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Iterators * * * * * * * * * * * * * * * * //
// iteratorBase
template<unsigned nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iteratorBase::iteratorBase() inline Foam::PackedList<nBits>::iteratorBase::iteratorBase()
: :
@ -315,7 +313,7 @@ Foam::PackedList<nBits>::iteratorBase::set(const unsigned int val)
if (val >= max_value()) if (val >= max_value())
{ {
// overflow is max_value, fill everything // Overflow is max_value, fill everything
stored |= mask; stored |= mask;
} }
else else
@ -372,7 +370,7 @@ inline void Foam::PackedList<nBits>::iteratorBase::operator=
const unsigned int val const unsigned int val
) )
{ {
// lazy evaluation - increase size on assigment // Lazy evaluation - increase size on assigment
if (index_ >= list_->size_) if (index_ >= list_->size_)
{ {
list_->resize(index_ + 1); list_->resize(index_ + 1);
@ -386,7 +384,7 @@ template<unsigned nBits>
inline Foam::PackedList<nBits>::iteratorBase::operator inline Foam::PackedList<nBits>::iteratorBase::operator
unsigned int () const unsigned int () const
{ {
// lazy evaluation - return 0 for out-of-range // Lazy evaluation - return 0 for out-of-range
if (index_ >= list_->size_) if (index_ >= list_->size_)
{ {
return 0; return 0;
@ -396,8 +394,6 @@ unsigned int () const
} }
// const_iterator, iterator
template<unsigned nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iterator::iterator() inline Foam::PackedList<nBits>::iterator::iterator()
: :
@ -420,7 +416,7 @@ inline Foam::PackedList<nBits>::iterator::iterator
: :
iteratorBase(iter) iteratorBase(iter)
{ {
// avoid going past end() // Avoid going past end()
// eg, iter = iterator(list, Inf) // eg, iter = iterator(list, Inf)
if (this->index_ > this->list_->size_) if (this->index_ > this->list_->size_)
{ {
@ -437,7 +433,7 @@ inline Foam::PackedList<nBits>::const_iterator::const_iterator
: :
iteratorBase(iter) iteratorBase(iter)
{ {
// avoid going past end() // Avoid going past end()
// eg, iter = iterator(list, Inf) // eg, iter = iterator(list, Inf)
if (this->index_ > this->list_->size_) if (this->index_ > this->list_->size_)
{ {
@ -527,7 +523,7 @@ inline void Foam::PackedList<nBits>::iterator::operator=
this->list_ = iter.list_; this->list_ = iter.list_;
this->index_ = iter.index_; this->index_ = iter.index_;
// avoid going past end() // Avoid going past end()
// eg, iter = iterator(list, Inf) // eg, iter = iterator(list, Inf)
if (this->index_ > this->list_->size_) if (this->index_ > this->list_->size_)
{ {
@ -545,7 +541,7 @@ inline void Foam::PackedList<nBits>::const_iterator::operator=
this->list_ = iter.list_; this->list_ = iter.list_;
this->index_ = iter.index_; this->index_ = iter.index_;
// avoid going past end() // Avoid going past end()
// eg, iter = iterator(list, Inf) // eg, iter = iterator(list, Inf)
if (this->index_ > this->list_->size_) if (this->index_ > this->list_->size_)
{ {
@ -742,15 +738,15 @@ inline void Foam::PackedList<nBits>::resize
if (size_ > oldSize) if (size_ > oldSize)
{ {
// fill new elements or newly exposed elements // Fill new elements or newly exposed elements
if (val) if (val)
{ {
// fill value for complete segments // Fill value for complete segments
unsigned int fill = val; unsigned int fill = val;
if (val >= max_value()) if (val >= max_value())
{ {
// fill everything // Fill everything
fill = maskLower(packing()); fill = maskLower(packing());
} }
else 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 oldLen = packedLength(oldSize);
const label newLen = packedLength(size_); const label newLen = packedLength(size_);
for (label i=oldLen; i < newLen; ++i) for (label i=oldLen; i < newLen; ++i)
@ -769,7 +765,7 @@ inline void Foam::PackedList<nBits>::resize
StorageList::operator[](i) = fill; StorageList::operator[](i) = fill;
} }
// finish previous partial segment, preserve existing value // Finish previous partial segment, preserve existing value
{ {
const unsigned int off = oldSize % packing(); const unsigned int off = oldSize % packing();
if (off) 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(); const unsigned int off = size_ % packing();
if (off) if (off)
@ -797,10 +793,10 @@ inline void Foam::PackedList<nBits>::resize
} }
else if (size_ < oldSize) else if (size_ < oldSize)
{ {
// resize shrinking // Resize shrinking
// - clear newly exposed elements // - clear newly exposed elements
// fill in complete segments // Fill in complete segments
const label oldLen = packedLength(oldSize); const label oldLen = packedLength(oldSize);
const label newLen = packedLength(size_); const label newLen = packedLength(size_);
for (label i=newLen; i < oldLen; ++i) for (label i=newLen; i < oldLen; ++i)
@ -808,7 +804,7 @@ inline void Foam::PackedList<nBits>::resize
StorageList::operator[](i) = 0u; StorageList::operator[](i) = 0u;
} }
// mask off the final partial segment // Mask off the final partial segment
{ {
const unsigned int off = size_ % packing(); const unsigned int off = size_ % packing();
if (off) if (off)
@ -846,12 +842,12 @@ inline void Foam::PackedList<nBits>::setCapacity(const label nElem)
{ {
StorageList::setSize(packedLength(nElem), 0u); StorageList::setSize(packedLength(nElem), 0u);
// truncate addressed size too // Truncate addressed size too
if (size_ > nElem) if (size_ > nElem)
{ {
size_ = nElem; size_ = nElem;
// mask off the final partial segment // Mask off the final partial segment
const unsigned int off = size_ % packing(); const unsigned int off = size_ % packing();
if (off) if (off)
{ {
@ -868,7 +864,7 @@ inline void Foam::PackedList<nBits>::reserve(const label nElem)
{ {
const label len = packedLength(nElem); const label len = packedLength(nElem);
// need more capacity? // Need more capacity?
if (len > StorageList::size()) if (len > StorageList::size())
{ {
// Like DynamicList with SizeInc=0, SizeMult=2, SizeDiv=1 // Like DynamicList with SizeInc=0, SizeMult=2, SizeDiv=1
@ -911,7 +907,7 @@ inline void Foam::PackedList<nBits>::clearStorage()
template<unsigned nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::shrink() inline void Foam::PackedList<nBits>::shrink()
{ {
// any uneed space allocated? // Any uneed space allocated?
const label len = packedLength(); const label len = packedLength();
if (len < StorageList::size()) if (len < StorageList::size())
{ {
@ -967,7 +963,7 @@ inline Foam::Xfer<Foam::PackedList<nBits>> Foam::PackedList<nBits>::xfer()
template<unsigned nBits> template<unsigned nBits>
inline unsigned int Foam::PackedList<nBits>::get(const label i) const 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_) if (i < 0 || i >= size_)
{ {
return 0; return 0;
@ -982,7 +978,7 @@ inline unsigned int Foam::PackedList<nBits>::get(const label i) const
template<unsigned nBits> template<unsigned nBits>
inline unsigned int Foam::PackedList<nBits>::operator[](const label i) const 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_) if (i < 0 || i >= size_)
{ {
return 0; return 0;
@ -1003,12 +999,12 @@ inline bool Foam::PackedList<nBits>::set
{ {
if (i < 0) if (i < 0)
{ {
// lazy evaluation - ignore out-of-bounds // Lazy evaluation - ignore out-of-bounds
return false; return false;
} }
else if (i >= size_) else if (i >= size_)
{ {
// lazy evaluation - increase size on assigment // Lazy evaluation - increase size on assigment
resize(i + 1); resize(i + 1);
} }
@ -1080,7 +1076,7 @@ inline void Foam::PackedList<nBits>::operator=(const unsigned int val)
if (val >= max_value()) if (val >= max_value())
{ {
// fill everything // Fill everything
fill = maskLower(packing()); fill = maskLower(packing());
} }
else else
@ -1096,7 +1092,7 @@ inline void Foam::PackedList<nBits>::operator=(const unsigned int val)
StorageList::operator[](i) = fill; StorageList::operator[](i) = fill;
} }
// mask off the final partial segment // Mask off the final partial segment
{ {
const unsigned int off = size_ % packing(); const unsigned int off = size_ % packing();
if (off) if (off)

View File

@ -432,12 +432,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "PtrListI.H" #include "PtrListI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "PtrList.C" #include "PtrList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,7 +48,6 @@ void Foam::ParSortableList<Type>::write
} }
// Copy src, starting at destI into dest.
template<class Type> template<class Type>
void Foam::ParSortableList<Type>::copyInto void Foam::ParSortableList<Type>::copyInto
( (
@ -122,7 +121,6 @@ void Foam::ParSortableList<Type>::checkAndSend
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from List, sorting the elements
template<class Type> template<class Type>
Foam::ParSortableList<Type>::ParSortableList(const UList<Type>& values) 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> template<class Type>
Foam::ParSortableList<Type>::ParSortableList(const label size) Foam::ParSortableList<Type>::ParSortableList(const label size)
: :
@ -146,7 +143,6 @@ Foam::ParSortableList<Type>::ParSortableList(const label size)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Sort
template<class Type> template<class Type>
void Foam::ParSortableList<Type>::sort() void Foam::ParSortableList<Type>::sort()
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -204,7 +204,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "ParSortableList.C" #include "ParSortableList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -137,7 +137,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "SortableList.C" #include "SortableList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -34,9 +34,9 @@ inline Foam::SubList<T>::SubList
: :
UList<T>(list.v_, subSize) UList<T>(list.v_, subSize)
{ {
# ifdef FULLDEBUG #ifdef FULLDEBUG
list.checkSize(subSize); list.checkSize(subSize);
# endif #endif
} }
@ -50,7 +50,7 @@ inline Foam::SubList<T>::SubList
: :
UList<T>(&(list.v_[startIndex]), subSize) UList<T>(&(list.v_[startIndex]), subSize)
{ {
# ifdef FULLDEBUG #ifdef FULLDEBUG
// Artificially allow the start of a zero-sized subList to be // Artificially allow the start of a zero-sized subList to be
// one past the end of the original list. // one past the end of the original list.
@ -65,7 +65,7 @@ inline Foam::SubList<T>::SubList
// behind the last element is allowed // behind the last element is allowed
list.checkSize(startIndex); list.checkSize(startIndex);
} }
# endif #endif
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -165,7 +165,7 @@ public:
#include "UIndirectListI.H" #include "UIndirectListI.H"
#ifdef NoRepository #ifdef NoRepository
# include "UIndirectListIO.C" #include "UIndirectListIO.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License 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 #ifdef NoRepository
# include "UList.C" #include "UList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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> template<class T>
inline void Foam::UList<T>::checkStart(const label start) const 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> template<class T>
inline void Foam::UList<T>::checkSize(const label size) const 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> template<class T>
inline void Foam::UList<T>::checkIndex(const label i) const inline void Foam::UList<T>::checkIndex(const label i) const
{ {
@ -158,20 +155,18 @@ inline T* Foam::UList<T>::data()
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// element access
template<class T> template<class T>
inline T& Foam::UList<T>::operator[](const label i) inline T& Foam::UList<T>::operator[](const label i)
{ {
# ifdef FULLDEBUG #ifdef FULLDEBUG
checkIndex(i); checkIndex(i);
# endif #endif
return v_[i]; return v_[i];
} }
namespace Foam namespace Foam
{ {
// Template specialization for bool // Template specialization for bool
template<> template<>
inline const bool& Foam::UList<bool>::operator[](const label i) const inline const bool& Foam::UList<bool>::operator[](const label i) const
@ -186,22 +181,19 @@ namespace Foam
return Foam::pTraits<bool>::zero; return Foam::pTraits<bool>::zero;
} }
} }
}
} // end of namespace Foam
// const element access
template<class T> template<class T>
inline const T& Foam::UList<T>::operator[](const label i) const inline const T& Foam::UList<T>::operator[](const label i) const
{ {
# ifdef FULLDEBUG #ifdef FULLDEBUG
checkIndex(i); checkIndex(i);
# endif #endif
return v_[i]; return v_[i];
} }
// Allow cast to a const List<T>&
template<class T> template<class T>
inline Foam::UList<T>::operator const Foam::List<T>&() const inline Foam::UList<T>::operator const Foam::List<T>&() const
{ {

View File

@ -273,12 +273,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
# include "UPtrListI.H" #include "UPtrListI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "UPtrList.C" #include "UPtrList.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -125,7 +125,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "NamedEnum.C" #include "NamedEnum.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //