UIndirectList

This commit is contained in:
mattijs
2009-03-12 19:25:21 +00:00
parent 6c387489d7
commit 0128b2be68
49 changed files with 390 additions and 197 deletions

View File

@ -1,100 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::IndirectList
Description
SourceFiles
IndirectListI.H
\*---------------------------------------------------------------------------*/
#ifndef IndirectList_H
#define IndirectList_H
#include "List.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class IndirectList Declaration
\*---------------------------------------------------------------------------*/
template<class T>
class IndirectList
{
// Private data
const UList<T>& completeList_;
List<label> addresses_;
// Private Member Functions
//- Disallow default bitwise assignment
void operator=(const IndirectList<T>&);
public:
// Constructors
//- Construct given the complete list and the addressing array
inline IndirectList(const UList<T>&, const List<label>&);
// Member Functions
// Access
inline label size() const;
inline const UList<T>& completeList() const;
inline const List<label>& addresses() const;
// Member Operators
//- Return const access to an element
inline const T& operator[](const label) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "IndirectListI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,77 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
//- Construct given size
template<class T>
inline Foam::IndirectList<T>::IndirectList
(
const Foam::UList<T>& completeList,
const Foam::List<label>& addresses
)
:
completeList_(completeList),
addresses_(addresses)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
inline Foam::label Foam::IndirectList<T>::size() const
{
return addresses_.size();
}
template<class T>
inline const Foam::UList<T>& Foam::IndirectList<T>::
completeList() const
{
return completeList_;
}
template<class T>
inline const Foam::List<Foam::label>& Foam::IndirectList<T>::addresses() const
{
return addresses_;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>
inline const T& Foam::IndirectList<T>::operator[](const Foam::label i) const
{
return completeList_[addresses_[i]];
}
// ************************************************************************* //