PackedList with unsigned template parameter

This commit is contained in:
Mark Olesen
2009-01-29 14:51:51 +01:00
parent 6ac84bf1ef
commit 55d4fb2ec2
5 changed files with 100 additions and 100 deletions

View File

@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<int nBits> template<unsigned nBits>
Foam::PackedList<nBits>::PackedList(const label size, const unsigned int val) Foam::PackedList<nBits>::PackedList(const label size, const unsigned int val)
: :
StorageList(packedLength(size), 0u), StorageList(packedLength(size), 0u),
@ -38,7 +38,7 @@ Foam::PackedList<nBits>::PackedList(const label size, const unsigned int val)
} }
template<int nBits> template<unsigned nBits>
Foam::PackedList<nBits>::PackedList(const UList<label>& lst) Foam::PackedList<nBits>::PackedList(const UList<label>& lst)
: :
StorageList(packedLength(lst.size()), 0u), StorageList(packedLength(lst.size()), 0u),
@ -76,7 +76,7 @@ Foam::PackedList<nBits>::PackedList(const UList<label>& lst)
#endif #endif
template<int nBits> template<unsigned nBits>
unsigned int Foam::PackedList<nBits>::count() const unsigned int Foam::PackedList<nBits>::count() const
{ {
register unsigned int c = 0; register unsigned int c = 0;
@ -110,7 +110,7 @@ unsigned int Foam::PackedList<nBits>::count() const
} }
template<int nBits> template<unsigned nBits>
bool Foam::PackedList<nBits>::trim() bool Foam::PackedList<nBits>::trim()
{ {
if (!size_) if (!size_)
@ -162,7 +162,7 @@ bool Foam::PackedList<nBits>::trim()
} }
template<int nBits> template<unsigned nBits>
Foam::labelList Foam::PackedList<nBits>::values() const Foam::labelList Foam::PackedList<nBits>::values() const
{ {
labelList elems(size()); labelList elems(size());
@ -175,10 +175,10 @@ Foam::labelList Foam::PackedList<nBits>::values() const
} }
template<int nBits> template<unsigned nBits>
Foam::Ostream& Foam::PackedList<nBits>::iteratorBase::print(Ostream& os) const Foam::Ostream& Foam::PackedList<nBits>::iteratorBase::print(Ostream& os) const
{ {
os << "iterator<" << nBits << "> [" os << "iterator<" << label(nBits) << "> ["
<< (index_ * packing() + offset_) << "]" << (index_ * packing() + offset_) << "]"
<< " index:" << index_ << " offset:" << offset_ << " index:" << index_ << " offset:" << offset_
<< " value:" << unsigned(*this) << " value:" << unsigned(*this)
@ -188,10 +188,10 @@ Foam::Ostream& Foam::PackedList<nBits>::iteratorBase::print(Ostream& os) const
} }
template<int nBits> template<unsigned nBits>
Foam::Ostream& Foam::PackedList<nBits>::print(Ostream& os) const Foam::Ostream& Foam::PackedList<nBits>::print(Ostream& os) const
{ {
os << "PackedList<" << nBits << ">" os << "PackedList<" << label(nBits) << ">"
<< " max_value:" << max_value() << " max_value:" << max_value()
<< " packing:" << packing() << nl << " packing:" << packing() << nl
<< "values: " << size() << "/" << capacity() << "( "; << "values: " << size() << "/" << capacity() << "( ";
@ -255,7 +255,7 @@ Foam::Ostream& Foam::PackedList<nBits>::print(Ostream& os) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<int nBits> template<unsigned nBits>
void Foam::PackedList<nBits>::operator=(const PackedList<nBits>& lst) void Foam::PackedList<nBits>::operator=(const PackedList<nBits>& lst)
{ {
setCapacity(lst.size()); setCapacity(lst.size());
@ -263,7 +263,7 @@ void Foam::PackedList<nBits>::operator=(const PackedList<nBits>& lst)
} }
template<int nBits> template<unsigned nBits>
void Foam::PackedList<nBits>::operator=(const UList<label>& lst) void Foam::PackedList<nBits>::operator=(const UList<label>& lst)
{ {
setCapacity(lst.size()); setCapacity(lst.size());
@ -277,7 +277,7 @@ void Foam::PackedList<nBits>::operator=(const UList<label>& lst)
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
//template<int nBits> //template<unsigned nBits>
//Foam::Ostream& ::Foam::operator<<(Ostream& os, const PackedList<nBits>& lst) //Foam::Ostream& ::Foam::operator<<(Ostream& os, const PackedList<nBits>& lst)
//{ //{
// os << lst(); // os << lst();

View File

@ -86,9 +86,9 @@ namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
template<int nBits> class PackedList; template<unsigned nBits> class PackedList;
// template<int nBits> // template<unsigned nBits>
// Ostream& operator<<(Ostream&, const PackedList<nBits>&); // Ostream& operator<<(Ostream&, const PackedList<nBits>&);
@ -102,7 +102,7 @@ TemplateName(PackedList);
Class PackedList Declaration Class PackedList Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template <int nBits=1> template<unsigned nBits=1>
class PackedList class PackedList
: :
private List<unsigned int> private List<unsigned int>

View File

@ -30,42 +30,42 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<int nBits> template<unsigned nBits>
inline unsigned int Foam::PackedList<nBits>::max_bits() inline unsigned int Foam::PackedList<nBits>::max_bits()
{ {
return sizeof(StorageType)*CHAR_BIT - 1; return sizeof(StorageType)*CHAR_BIT - 1;
} }
template<int nBits> template<unsigned nBits>
inline unsigned int Foam::PackedList<nBits>::max_value() inline unsigned int Foam::PackedList<nBits>::max_value()
{ {
return (1 << nBits) - 1; return (1 << nBits) - 1;
} }
template<int nBits> template<unsigned nBits>
inline unsigned int Foam::PackedList<nBits>::packing() inline unsigned int Foam::PackedList<nBits>::packing()
{ {
return sizeof(StorageType)*CHAR_BIT / nBits; return sizeof(StorageType)*CHAR_BIT / nBits;
} }
template<int nBits> template<unsigned nBits>
inline unsigned int Foam::PackedList<nBits>::maskLower(unsigned offset) inline unsigned int Foam::PackedList<nBits>::maskLower(unsigned offset)
{ {
return (1 << (nBits * offset)) - 1; return (1 << (nBits * offset)) - 1;
} }
template<int nBits> template<unsigned nBits>
inline Foam::label Foam::PackedList<nBits>::packedLength(const label nElem) inline Foam::label Foam::PackedList<nBits>::packedLength(const label nElem)
{ {
return (nElem + packing() - 1) / packing(); return (nElem + packing() - 1) / packing();
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::checkIndex(const label i) const inline void Foam::PackedList<nBits>::checkIndex(const label i) const
{ {
if (!size_) if (!size_)
@ -85,7 +85,7 @@ inline void Foam::PackedList<nBits>::checkIndex(const label i) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::PackedList() inline Foam::PackedList<nBits>::PackedList()
: :
StorageList(), StorageList(),
@ -93,7 +93,7 @@ inline Foam::PackedList<nBits>::PackedList()
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::PackedList(const label size) inline Foam::PackedList<nBits>::PackedList(const label size)
: :
StorageList(packedLength(size), 0u), StorageList(packedLength(size), 0u),
@ -101,7 +101,7 @@ inline Foam::PackedList<nBits>::PackedList(const label size)
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::PackedList(const PackedList<nBits>& lst) inline Foam::PackedList<nBits>::PackedList(const PackedList<nBits>& lst)
: :
StorageList(lst), StorageList(lst),
@ -109,14 +109,14 @@ inline Foam::PackedList<nBits>::PackedList(const PackedList<nBits>& lst)
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::PackedList(const Xfer<PackedList<nBits> >& lst) inline Foam::PackedList<nBits>::PackedList(const Xfer<PackedList<nBits> >& lst)
{ {
transfer(lst()); transfer(lst());
} }
template<int nBits> template<unsigned nBits>
inline Foam::autoPtr<Foam::PackedList<nBits> > inline Foam::autoPtr<Foam::PackedList<nBits> >
Foam::PackedList<nBits>::clone() const Foam::PackedList<nBits>::clone() const
{ {
@ -128,7 +128,7 @@ Foam::PackedList<nBits>::clone() const
// iteratorBase // iteratorBase
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iteratorBase::iteratorBase() inline Foam::PackedList<nBits>::iteratorBase::iteratorBase()
: :
list_(0), list_(0),
@ -137,7 +137,7 @@ inline Foam::PackedList<nBits>::iteratorBase::iteratorBase()
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iteratorBase::iteratorBase inline Foam::PackedList<nBits>::iteratorBase::iteratorBase
( (
const iteratorBase& iter const iteratorBase& iter
@ -149,7 +149,7 @@ inline Foam::PackedList<nBits>::iteratorBase::iteratorBase
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iteratorBase::iteratorBase inline Foam::PackedList<nBits>::iteratorBase::iteratorBase
( (
const PackedList<nBits>* lst, const PackedList<nBits>* lst,
@ -162,7 +162,7 @@ inline Foam::PackedList<nBits>::iteratorBase::iteratorBase
{} {}
template<int nBits> template<unsigned nBits>
inline unsigned int inline unsigned int
Foam::PackedList<nBits>::iteratorBase::get() const Foam::PackedList<nBits>::iteratorBase::get() const
{ {
@ -171,7 +171,7 @@ Foam::PackedList<nBits>::iteratorBase::get() const
} }
template<int nBits> template<unsigned nBits>
inline bool inline bool
Foam::PackedList<nBits>::iteratorBase::set(const unsigned int val) Foam::PackedList<nBits>::iteratorBase::set(const unsigned int val)
{ {
@ -204,7 +204,7 @@ w << " out-of-range 0 ... " << label(max_value())
template<int nBits> template<unsigned nBits>
inline void inline void
Foam::PackedList<nBits>::iteratorBase::incr() Foam::PackedList<nBits>::iteratorBase::incr()
{ {
@ -217,7 +217,7 @@ Foam::PackedList<nBits>::iteratorBase::incr()
} }
template<int nBits> template<unsigned nBits>
inline void inline void
Foam::PackedList<nBits>::iteratorBase::decr() Foam::PackedList<nBits>::iteratorBase::decr()
{ {
@ -230,7 +230,7 @@ Foam::PackedList<nBits>::iteratorBase::decr()
} }
template<int nBits> template<unsigned nBits>
inline void inline void
Foam::PackedList<nBits>::iteratorBase::seek Foam::PackedList<nBits>::iteratorBase::seek
( (
@ -245,7 +245,7 @@ Foam::PackedList<nBits>::iteratorBase::seek
} }
template<int nBits> template<unsigned nBits>
inline bool inline bool
Foam::PackedList<nBits>::iteratorBase::valid() const Foam::PackedList<nBits>::iteratorBase::valid() const
{ {
@ -254,7 +254,7 @@ Foam::PackedList<nBits>::iteratorBase::valid() const
} }
template<int nBits> template<unsigned nBits>
inline bool inline bool
Foam::PackedList<nBits>::iteratorBase::validate() Foam::PackedList<nBits>::iteratorBase::validate()
{ {
@ -276,7 +276,7 @@ Foam::PackedList<nBits>::iteratorBase::validate()
} }
template<int nBits> template<unsigned nBits>
inline bool Foam::PackedList<nBits>::iteratorBase::operator== inline bool Foam::PackedList<nBits>::iteratorBase::operator==
( (
const iteratorBase& iter const iteratorBase& iter
@ -286,7 +286,7 @@ inline bool Foam::PackedList<nBits>::iteratorBase::operator==
} }
template<int nBits> template<unsigned nBits>
inline bool Foam::PackedList<nBits>::iteratorBase::operator!= inline bool Foam::PackedList<nBits>::iteratorBase::operator!=
( (
const iteratorBase& iter const iteratorBase& iter
@ -296,7 +296,7 @@ inline bool Foam::PackedList<nBits>::iteratorBase::operator!=
} }
template<int nBits> template<unsigned nBits>
inline unsigned int inline unsigned int
Foam::PackedList<nBits>::iteratorBase::operator=(const iteratorBase& iter) Foam::PackedList<nBits>::iteratorBase::operator=(const iteratorBase& iter)
{ {
@ -306,7 +306,7 @@ Foam::PackedList<nBits>::iteratorBase::operator=(const iteratorBase& iter)
} }
template<int nBits> template<unsigned nBits>
inline unsigned int inline unsigned int
Foam::PackedList<nBits>::iteratorBase::operator=(const unsigned int val) Foam::PackedList<nBits>::iteratorBase::operator=(const unsigned int val)
{ {
@ -324,7 +324,7 @@ Foam::PackedList<nBits>::iteratorBase::operator=(const unsigned int val)
} }
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iteratorBase::operator inline Foam::PackedList<nBits>::iteratorBase::operator
unsigned int () const unsigned int () const
{ {
@ -343,21 +343,21 @@ unsigned int () const
// const_iterator, iterator // const_iterator, iterator
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iterator::iterator() inline Foam::PackedList<nBits>::iterator::iterator()
: :
iteratorBase() iteratorBase()
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::const_iterator::const_iterator() inline Foam::PackedList<nBits>::const_iterator::const_iterator()
: :
iteratorBase() iteratorBase()
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iterator::iterator inline Foam::PackedList<nBits>::iterator::iterator
( (
const iteratorBase& iter const iteratorBase& iter
@ -369,7 +369,7 @@ inline Foam::PackedList<nBits>::iterator::iterator
} }
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::const_iterator::const_iterator inline Foam::PackedList<nBits>::const_iterator::const_iterator
( (
const iteratorBase& iter const iteratorBase& iter
@ -381,7 +381,7 @@ inline Foam::PackedList<nBits>::const_iterator::const_iterator
} }
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::iterator::iterator inline Foam::PackedList<nBits>::iterator::iterator
( (
const PackedList<nBits>* lst, const PackedList<nBits>* lst,
@ -392,7 +392,7 @@ inline Foam::PackedList<nBits>::iterator::iterator
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::const_iterator::const_iterator inline Foam::PackedList<nBits>::const_iterator::const_iterator
( (
const PackedList<nBits>* lst, const PackedList<nBits>* lst,
@ -403,7 +403,7 @@ inline Foam::PackedList<nBits>::const_iterator::const_iterator
{} {}
template<int nBits> template<unsigned nBits>
inline Foam::PackedList<nBits>::const_iterator::const_iterator inline Foam::PackedList<nBits>::const_iterator::const_iterator
( (
const iterator& iter const iterator& iter
@ -413,7 +413,7 @@ inline Foam::PackedList<nBits>::const_iterator::const_iterator
{} {}
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iterator& inline typename Foam::PackedList<nBits>::iterator&
Foam::PackedList<nBits>::iterator::operator=(const iteratorBase& iter) Foam::PackedList<nBits>::iterator::operator=(const iteratorBase& iter)
{ {
@ -422,7 +422,7 @@ Foam::PackedList<nBits>::iterator::operator=(const iteratorBase& iter)
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator& inline typename Foam::PackedList<nBits>::const_iterator&
Foam::PackedList<nBits>::const_iterator::operator=(const iteratorBase& iter) Foam::PackedList<nBits>::const_iterator::operator=(const iteratorBase& iter)
{ {
@ -431,7 +431,7 @@ Foam::PackedList<nBits>::const_iterator::operator=(const iteratorBase& iter)
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iterator& inline typename Foam::PackedList<nBits>::iterator&
Foam::PackedList<nBits>::iterator::operator++() Foam::PackedList<nBits>::iterator::operator++()
{ {
@ -440,7 +440,7 @@ Foam::PackedList<nBits>::iterator::operator++()
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator& inline typename Foam::PackedList<nBits>::const_iterator&
Foam::PackedList<nBits>::const_iterator::operator++() Foam::PackedList<nBits>::const_iterator::operator++()
{ {
@ -449,7 +449,7 @@ Foam::PackedList<nBits>::const_iterator::operator++()
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iterator inline typename Foam::PackedList<nBits>::iterator
Foam::PackedList<nBits>::iterator::operator++(int) Foam::PackedList<nBits>::iterator::operator++(int)
{ {
@ -459,7 +459,7 @@ Foam::PackedList<nBits>::iterator::operator++(int)
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator inline typename Foam::PackedList<nBits>::const_iterator
Foam::PackedList<nBits>::const_iterator::operator++(int) Foam::PackedList<nBits>::const_iterator::operator++(int)
{ {
@ -469,7 +469,7 @@ Foam::PackedList<nBits>::const_iterator::operator++(int)
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iterator& inline typename Foam::PackedList<nBits>::iterator&
Foam::PackedList<nBits>::iterator::operator--() Foam::PackedList<nBits>::iterator::operator--()
{ {
@ -478,7 +478,7 @@ Foam::PackedList<nBits>::iterator::operator--()
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator& inline typename Foam::PackedList<nBits>::const_iterator&
Foam::PackedList<nBits>::const_iterator::operator--() Foam::PackedList<nBits>::const_iterator::operator--()
{ {
@ -487,7 +487,7 @@ Foam::PackedList<nBits>::const_iterator::operator--()
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iterator inline typename Foam::PackedList<nBits>::iterator
Foam::PackedList<nBits>::iterator::operator--(int) Foam::PackedList<nBits>::iterator::operator--(int)
{ {
@ -497,7 +497,7 @@ Foam::PackedList<nBits>::iterator::operator--(int)
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator inline typename Foam::PackedList<nBits>::const_iterator
Foam::PackedList<nBits>::const_iterator::operator--(int) Foam::PackedList<nBits>::const_iterator::operator--(int)
{ {
@ -507,7 +507,7 @@ Foam::PackedList<nBits>::const_iterator::operator--(int)
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iteratorBase& inline typename Foam::PackedList<nBits>::iteratorBase&
Foam::PackedList<nBits>::iterator::operator*() Foam::PackedList<nBits>::iterator::operator*()
{ {
@ -515,7 +515,7 @@ Foam::PackedList<nBits>::iterator::operator*()
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iteratorBase& inline typename Foam::PackedList<nBits>::iteratorBase&
Foam::PackedList<nBits>::iterator::operator()() Foam::PackedList<nBits>::iterator::operator()()
{ {
@ -523,7 +523,7 @@ Foam::PackedList<nBits>::iterator::operator()()
} }
template<int nBits> template<unsigned nBits>
inline unsigned int inline unsigned int
Foam::PackedList<nBits>::const_iterator::operator*() const Foam::PackedList<nBits>::const_iterator::operator*() const
{ {
@ -531,7 +531,7 @@ Foam::PackedList<nBits>::const_iterator::operator*() const
} }
template<int nBits> template<unsigned nBits>
inline unsigned int inline unsigned int
Foam::PackedList<nBits>::const_iterator::operator()() const Foam::PackedList<nBits>::const_iterator::operator()() const
{ {
@ -539,7 +539,7 @@ Foam::PackedList<nBits>::const_iterator::operator()() const
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iterator inline typename Foam::PackedList<nBits>::iterator
Foam::PackedList<nBits>::begin() Foam::PackedList<nBits>::begin()
{ {
@ -547,7 +547,7 @@ Foam::PackedList<nBits>::begin()
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator inline typename Foam::PackedList<nBits>::const_iterator
Foam::PackedList<nBits>::begin() const Foam::PackedList<nBits>::begin() const
{ {
@ -555,7 +555,7 @@ Foam::PackedList<nBits>::begin() const
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator inline typename Foam::PackedList<nBits>::const_iterator
Foam::PackedList<nBits>::cbegin() const Foam::PackedList<nBits>::cbegin() const
{ {
@ -563,7 +563,7 @@ Foam::PackedList<nBits>::cbegin() const
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iterator inline typename Foam::PackedList<nBits>::iterator
Foam::PackedList<nBits>::end() Foam::PackedList<nBits>::end()
{ {
@ -571,7 +571,7 @@ Foam::PackedList<nBits>::end()
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator inline typename Foam::PackedList<nBits>::const_iterator
Foam::PackedList<nBits>::end() const Foam::PackedList<nBits>::end() const
{ {
@ -579,7 +579,7 @@ Foam::PackedList<nBits>::end() const
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::const_iterator inline typename Foam::PackedList<nBits>::const_iterator
Foam::PackedList<nBits>::cend() const Foam::PackedList<nBits>::cend() const
{ {
@ -589,21 +589,21 @@ Foam::PackedList<nBits>::cend() const
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<int nBits> template<unsigned nBits>
inline Foam::label Foam::PackedList<nBits>::size() const inline Foam::label Foam::PackedList<nBits>::size() const
{ {
return size_; return size_;
} }
template<int nBits> template<unsigned nBits>
inline bool Foam::PackedList<nBits>::empty() const inline bool Foam::PackedList<nBits>::empty() const
{ {
return !size_; return !size_;
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::resize inline void Foam::PackedList<nBits>::resize
( (
const label nElem, const label nElem,
@ -674,7 +674,7 @@ inline void Foam::PackedList<nBits>::resize
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::setSize inline void Foam::PackedList<nBits>::setSize
( (
const label newSize, const label newSize,
@ -686,14 +686,14 @@ inline void Foam::PackedList<nBits>::setSize
template<int nBits> template<unsigned nBits>
inline Foam::label Foam::PackedList<nBits>::capacity() const inline Foam::label Foam::PackedList<nBits>::capacity() const
{ {
return packing() * StorageList::size(); return packing() * StorageList::size();
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::setCapacity(const label nElem) inline void Foam::PackedList<nBits>::setCapacity(const label nElem)
{ {
StorageList::setSize(packedLength(nElem), 0u); StorageList::setSize(packedLength(nElem), 0u);
@ -706,7 +706,7 @@ inline void Foam::PackedList<nBits>::setCapacity(const label nElem)
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::reserve inline void Foam::PackedList<nBits>::reserve
( (
const label nElem const label nElem
@ -722,14 +722,14 @@ inline void Foam::PackedList<nBits>::reserve
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::clear() inline void Foam::PackedList<nBits>::clear()
{ {
size_ = 0; size_ = 0;
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::clearStorage() inline void Foam::PackedList<nBits>::clearStorage()
{ {
StorageList::clear(); StorageList::clear();
@ -737,7 +737,7 @@ inline void Foam::PackedList<nBits>::clearStorage()
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::shrink() inline void Foam::PackedList<nBits>::shrink()
{ {
label len = packedLength(size_); label len = packedLength(size_);
@ -749,7 +749,7 @@ inline void Foam::PackedList<nBits>::shrink()
} }
} }
template<int nBits> template<unsigned nBits>
inline Foam::List<unsigned int>& inline Foam::List<unsigned int>&
Foam::PackedList<nBits>::storage() Foam::PackedList<nBits>::storage()
{ {
@ -757,7 +757,7 @@ Foam::PackedList<nBits>::storage()
} }
template<int nBits> template<unsigned nBits>
inline const Foam::List<unsigned int>& inline const Foam::List<unsigned int>&
Foam::PackedList<nBits>::storage() const Foam::PackedList<nBits>::storage() const
{ {
@ -765,7 +765,7 @@ Foam::PackedList<nBits>::storage() const
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::transfer(PackedList<nBits>& lst) inline void Foam::PackedList<nBits>::transfer(PackedList<nBits>& lst)
{ {
size_ = lst.size_; size_ = lst.size_;
@ -775,7 +775,7 @@ inline void Foam::PackedList<nBits>::transfer(PackedList<nBits>& lst)
} }
template<int nBits> template<unsigned nBits>
inline Foam::Xfer< Foam::PackedList<nBits> > inline Foam::Xfer< Foam::PackedList<nBits> >
Foam::PackedList<nBits>::xfer() Foam::PackedList<nBits>::xfer()
{ {
@ -783,7 +783,7 @@ Foam::PackedList<nBits>::xfer()
} }
template<int 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
{ {
# ifdef DEBUGList # ifdef DEBUGList
@ -794,7 +794,7 @@ inline unsigned int Foam::PackedList<nBits>::get(const label i) const
} }
template<int 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
{ {
if (i < size_) if (i < size_)
@ -808,7 +808,7 @@ inline unsigned int Foam::PackedList<nBits>::operator[](const label i) const
} }
template<int nBits> template<unsigned nBits>
inline bool Foam::PackedList<nBits>::set inline bool Foam::PackedList<nBits>::set
( (
const label i, const label i,
@ -831,7 +831,7 @@ inline bool Foam::PackedList<nBits>::set
} }
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::append(const unsigned int val) inline void Foam::PackedList<nBits>::append(const unsigned int val)
{ {
label elemI = size_; label elemI = size_;
@ -842,7 +842,7 @@ inline void Foam::PackedList<nBits>::append(const unsigned int val)
} }
template<int nBits> template<unsigned nBits>
inline unsigned int Foam::PackedList<nBits>::remove() inline unsigned int Foam::PackedList<nBits>::remove()
{ {
if (!size_) if (!size_)
@ -861,7 +861,7 @@ inline unsigned int Foam::PackedList<nBits>::remove()
} }
template<int nBits> template<unsigned nBits>
inline typename Foam::PackedList<nBits>::iteratorBase inline typename Foam::PackedList<nBits>::iteratorBase
Foam::PackedList<nBits>::operator[](const label i) Foam::PackedList<nBits>::operator[](const label i)
{ {
@ -870,7 +870,7 @@ Foam::PackedList<nBits>::operator[](const label i)
// specialization for nBits=1 isn't worth the bother // specialization for nBits=1 isn't worth the bother
template<int nBits> template<unsigned nBits>
inline void Foam::PackedList<nBits>::operator=(const unsigned int val) inline void Foam::PackedList<nBits>::operator=(const unsigned int val)
{ {
if (val) if (val)

View File

@ -223,7 +223,7 @@ public:
// PackedList versions // PackedList versions
template <int nBits, class CombineOp> template <unsigned nBits, class CombineOp>
static void syncFaceList static void syncFaceList
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -231,14 +231,14 @@ public:
const CombineOp& cop const CombineOp& cop
); );
template <int nBits> template <unsigned nBits>
static void swapFaceList static void swapFaceList
( (
const polyMesh& mesh, const polyMesh& mesh,
PackedList<nBits>& faceValues PackedList<nBits>& faceValues
); );
template <int nBits, class CombineOp> template <unsigned nBits, class CombineOp>
static void syncPointList static void syncPointList
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -247,7 +247,7 @@ public:
const unsigned int nullValue const unsigned int nullValue
); );
template <int nBits, class CombineOp> template <unsigned nBits, class CombineOp>
static void syncEdgeList static void syncEdgeList
( (
const polyMesh& mesh, const polyMesh& mesh,

View File

@ -1570,7 +1570,7 @@ void Foam::syncTools::swapFaceList
} }
template <int nBits, class CombineOp> template <unsigned nBits, class CombineOp>
void Foam::syncTools::syncFaceList void Foam::syncTools::syncFaceList
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -1582,7 +1582,7 @@ void Foam::syncTools::syncFaceList
{ {
FatalErrorIn FatalErrorIn
( (
"syncTools<int nBits, class CombineOp>::syncFaceList" "syncTools<unsigned nBits, class CombineOp>::syncFaceList"
"(const polyMesh&, PackedList<nBits>&, const CombineOp&)" "(const polyMesh&, PackedList<nBits>&, const CombineOp&)"
) << "Number of values " << faceValues.size() ) << "Number of values " << faceValues.size()
<< " is not equal to the number of faces in the mesh " << " is not equal to the number of faces in the mesh "
@ -1691,7 +1691,7 @@ void Foam::syncTools::syncFaceList
} }
template <int nBits> template <unsigned nBits>
void Foam::syncTools::swapFaceList void Foam::syncTools::swapFaceList
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -1702,7 +1702,7 @@ void Foam::syncTools::swapFaceList
} }
template <int nBits, class CombineOp> template <unsigned nBits, class CombineOp>
void Foam::syncTools::syncPointList void Foam::syncTools::syncPointList
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -1715,7 +1715,7 @@ void Foam::syncTools::syncPointList
{ {
FatalErrorIn FatalErrorIn
( (
"syncTools<int nBits, class CombineOp>::syncPointList" "syncTools<unsigned nBits, class CombineOp>::syncPointList"
"(const polyMesh&, PackedList<nBits>&, const CombineOp&" "(const polyMesh&, PackedList<nBits>&, const CombineOp&"
", const unsigned int&)" ", const unsigned int&)"
) << "Number of values " << pointValues.size() ) << "Number of values " << pointValues.size()
@ -1870,7 +1870,7 @@ void Foam::syncTools::syncPointList
} }
template <int nBits, class CombineOp> template <unsigned nBits, class CombineOp>
void Foam::syncTools::syncEdgeList void Foam::syncTools::syncEdgeList
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -1883,7 +1883,7 @@ void Foam::syncTools::syncEdgeList
{ {
FatalErrorIn FatalErrorIn
( (
"syncTools<int nBits, class CombineOp>::syncEdgeList" "syncTools<unsigned nBits, class CombineOp>::syncEdgeList"
"(const polyMesh&, PackedList<nBits>&, const CombineOp&" "(const polyMesh&, PackedList<nBits>&, const CombineOp&"
", const unsigned int&)" ", const unsigned int&)"
) << "Number of values " << edgeValues.size() ) << "Number of values " << edgeValues.size()