/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "SubList.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
inline Foam::SubList::SubList
(
const UList& list,
const label subSize
)
:
UList(list.v_, subSize)
{
#ifdef FULLDEBUG
list.checkSize(subSize);
#endif
}
template
inline Foam::SubList::SubList
(
const UList& list,
const label subSize,
const label startIndex
)
:
UList(&(list.v_[startIndex]), subSize)
{
#ifdef FULLDEBUG
// Artificially allow the start of a zero-sized subList to be
// one past the end of the original list.
if (subSize)
{
list.checkStart(startIndex);
list.checkSize(startIndex + subSize);
}
else
{
// Start index needs to fall between 0 and size. One position
// behind the last element is allowed
list.checkSize(startIndex);
}
#endif
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
inline const Foam::SubList& Foam::SubList::null()
{
return NullObjectRef>();
}
template
inline void Foam::SubList::transfer(UList& l)
{
UList::deepCopy(l);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template
inline Foam::SubList::operator const Foam::List&() const
{
return *reinterpret_cast* >(this);
}
template
inline void Foam::SubList::operator=(const SubList& sl)
{
UList::deepCopy(sl);
}
template
inline void Foam::SubList::operator=(const UList& l)
{
UList::deepCopy(l);
}
template
inline void Foam::SubList::operator=(const T& t)
{
UList::operator=(t);
}
template
inline void Foam::SubList::operator=(const zero)
{
UList::operator=(Zero);
}
// ************************************************************************* //