Commit ed94a271 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: use HashTable iterator 'val()' method instead of 'object()'

parent 53efb24a
......@@ -142,7 +142,7 @@ void Foam::radiation::laserDTRM::initialiseReflection()
key,
reflectionModel::New
(
iter.object(),
iter.val(),
mesh_
)
);
......
......@@ -46,7 +46,7 @@ void Foam::phaseSystem::createSubModels
key,
modelType::New
(
iter.object(),
iter.val(),
phasePairs_[key]
)
);
......@@ -76,7 +76,7 @@ void Foam::phaseSystem::createSubModels
key,
modelType::New
(
iter.object(),
iter.val(),
mesh
)
);
......
......@@ -61,7 +61,7 @@ HeatAndMassTransferPhaseSystem
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......@@ -194,7 +194,7 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......@@ -231,7 +231,7 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const
// Source term due to mass transfer
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......@@ -318,7 +318,7 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
// Source term due to mass transfer
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......
......@@ -82,7 +82,7 @@ massTransfer() const
// Reset the interfacial mass flow rates
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......@@ -99,11 +99,9 @@ massTransfer() const
// Sum up the contribution from each interface composition model
forAllConstIters(interfaceCompositionModels_, modelIter)
{
const phasePair& pair =
*(this->phasePairs_[modelIter.key()]);
const phasePair& pair = *(this->phasePairs_[modelIter.key()]);
const interfaceCompositionModel& compositionModel =
*(modelIter.object());
const interfaceCompositionModel& compositionModel = *(modelIter.val());
const phaseModel& phase = pair.phase1();
const phaseModel& otherPhase = pair.phase2();
......@@ -185,7 +183,7 @@ correctThermo()
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......
......@@ -44,7 +44,7 @@ ThermalPhaseChangePhaseSystem
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......@@ -106,7 +106,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
// Accumulate mDotL contributions from boundaries
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......@@ -201,7 +201,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......@@ -270,7 +270,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......@@ -305,7 +305,7 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
forAllConstIters(this->phasePairs_, phasePairIter)
{
const phasePair& pair = *(phasePairIter.object());
const phasePair& pair = *(phasePairIter.val());
if (pair.ordered())
{
......
......@@ -48,7 +48,7 @@ void Foam::phaseSystem::createSubModels
key,
modelType::New
(
iter.object(),
iter.val(),
phasePairs_[key]()
)
);
......
......@@ -39,7 +39,7 @@ void printTable(const HashPtrTable<T>& table)
forAllConstIters(table, iter)
{
const T* ptr = iter.object();
const T* ptr = iter.val();
Info<< iter.key() << " = ";
if (ptr)
{
......
......@@ -112,7 +112,7 @@ int main()
Info<< "\nerase table2 by iterator" << nl;
forAllIters(table2, iter)
{
Info<< "erasing " << iter.key() << " => " << iter.object() << " ... ";
Info<< "erasing " << iter.key() << " => " << iter.val() << " ... ";
table2.erase(iter);
Info<< "erased" << endl;
}
......
......@@ -38,7 +38,7 @@ void printTable(const PtrMap<T>& table)
forAllConstIters(table, iter)
{
const T* ptr = iter.object();
const T* ptr = iter.val();
Info<< iter.key() << " = ";
if (ptr)
{
......
......@@ -652,6 +652,7 @@ protected:
}
//- The object (value) associated with the iterator
// \deprecated(2019-01) use val() method
inline mapped_type& object() const
{
return entry_->mapped();
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -194,7 +194,7 @@ Foam::label Foam::IOobjectList::append(const IOobjectList& other)
InfoInFunction << "Copy append " << iter.key() << nl;
}
set(iter.key(), new IOobject(*(iter.object())));
set(iter.key(), new IOobject(*(iter.val())));
++count;
}
}
......@@ -253,7 +253,7 @@ const Foam::IOobject* Foam::IOobjectList::cfindObject
InfoInFunction << "Found " << objName << endl;
}
return iter.object();
return iter.val();
}
else if (IOobject::debug)
{
......@@ -422,9 +422,10 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const IOobjectList& list)
{
os << nl << list.size() << nl << token::BEGIN_LIST << nl;
forAllConstIters(list, it)
forAllConstIters(list, iter)
{
os << it.key() << token::SPACE << it.object()->headerClassName() << nl;
os << iter.key() << token::SPACE
<< iter.val()->headerClassName() << nl;
}
os << token::END_LIST;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -42,7 +42,7 @@ Foam::HashTable<Foam::wordHashSet> Foam::IOobjectList::classesImpl
forAllConstIters(list, iter)
{
const word& key = iter.key();
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (matchName(key))
{
......@@ -68,7 +68,7 @@ Foam::label Foam::IOobjectList::countImpl
forAllConstIters(list, iter)
{
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (matchClass(io->headerClassName()) && matchName(io->name()))
{
......@@ -92,7 +92,7 @@ Foam::label Foam::IOobjectList::countTypeImpl
forAllConstIters(list, iter)
{
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (io->isHeaderClassName<Type>() && matchName(io->name()))
{
......@@ -120,7 +120,7 @@ Foam::wordList Foam::IOobjectList::namesImpl
forAllConstIters(list, iter)
{
const word& key = iter.key();
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (matchClass(io->headerClassName()) && matchName(key))
{
......@@ -155,7 +155,7 @@ Foam::wordList Foam::IOobjectList::namesTypeImpl
forAllConstIters(list, iter)
{
const word& key = iter.key();
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (io->isHeaderClassName<Type>() && matchName(key))
{
......@@ -188,7 +188,7 @@ Foam::IOobjectList Foam::IOobjectList::lookupImpl
forAllConstIters(list, iter)
{
const word& key = iter.key();
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (matchName(key))
{
......@@ -219,7 +219,7 @@ Foam::IOobjectList Foam::IOobjectList::lookupClassImpl
forAllConstIters(list, iter)
{
const word& key = iter.key();
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (matchClass(io->headerClassName()) && matchName(key))
{
......@@ -249,7 +249,7 @@ Foam::IOobjectList Foam::IOobjectList::lookupClassTypeImpl
forAllConstIters(list, iter)
{
const word& key = iter.key();
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (io->isHeaderClassName<Type>() && matchName(key))
{
......@@ -278,7 +278,7 @@ const Foam::IOobject* Foam::IOobjectList::cfindObject
if (iter.found())
{
const IOobject* io = iter.object();
const IOobject* io = iter.val();
if (io->isHeaderClassName<Type>())
{
......@@ -635,7 +635,7 @@ Foam::label Foam::IOobjectList::filterClasses
// Matches? either prune (pruning) or keep (!pruning)
if
(
(pred(iter.object()->headerClassName()) ? pruning : !pruning)
(pred(iter.val()->headerClassName()) ? pruning : !pruning)
&& erase(iter)
)
{
......
......@@ -271,7 +271,7 @@ Foam::dictionary::const_searcher Foam::dictionary::csearch
if (iter.found())
{
finder.set(iter.object());
finder.set(iter.val());
return finder;
}
......@@ -427,7 +427,7 @@ const Foam::dictionary* Foam::dictionary::cfindScopedDict
if (iter.found())
{
const entry *eptr = iter.object();
const entry *eptr = iter.val();
if (eptr->isDict())
{
......@@ -534,7 +534,7 @@ Foam::dictionary* Foam::dictionary::makeScopedDict(const fileName& dictPath)
if (iter.found())
{
entry *eptr = iter.object();
entry *eptr = iter.val();
if (eptr->isDict())
{
......
......@@ -90,9 +90,9 @@ Foam::objectRegistry::~objectRegistry()
for (iterator iter = begin(); iter != end(); ++iter)
{
if (iter.object()->ownedByRegistry())
if (iter.val()->ownedByRegistry())
{
myObjects[nObjects++] = iter.object();
myObjects[nObjects++] = iter.val();
}
}
......
......@@ -42,12 +42,12 @@ Foam::HashTable<Foam::wordHashSet> Foam::objectRegistry::classesImpl
// Summary (key,val) = (class-name, object-names)
forAllConstIters(list, iter)
{
const regIOobject* obj = iter.object();
const regIOobject* obj = iter.val();
if (matchName(obj->name()))
{
// Create entry (if needed) and insert
summary(iter.object()->type()).insert(obj->name());
summary(iter.val()->type()).insert(obj->name());
}
}
......@@ -68,7 +68,7 @@ Foam::label Foam::objectRegistry::countImpl
forAllConstIters(list, iter)
{
const regIOobject* obj = iter.object();
const regIOobject* obj = iter.val();
if (matchClass(obj->type()) && matchName(obj->name()))
{
......@@ -92,7 +92,7 @@ Foam::label Foam::objectRegistry::countTypeImpl
forAllConstIters(list, iter)
{
const regIOobject* obj = iter.object();
const regIOobject* obj = iter.val();
if
(
......@@ -123,7 +123,7 @@ Foam::wordList Foam::objectRegistry::namesImpl
label count=0;
forAllConstIters(list, iter)
{
const regIOobject* obj = iter.object();
const regIOobject* obj = iter.val();
if (matchClass(obj->type()) && matchName(obj->name()))
{
......@@ -157,7 +157,7 @@ Foam::wordList Foam::objectRegistry::namesTypeImpl
label count = 0;
forAllConstIters(list, iter)
{
const regIOobject* obj = iter.object();
const regIOobject* obj = iter.val();
if
(
......@@ -235,7 +235,7 @@ Foam::label Foam::objectRegistry::count
forAllConstIters(*this, iter)
{
const regIOobject* obj = iter.object();
const regIOobject* obj = iter.val();
if
(
......@@ -337,7 +337,7 @@ Foam::HashTable<const Type*> Foam::objectRegistry::lookupClass
forAllConstIters(*this, iter)
{
const regIOobject* obj = iter.object();
const regIOobject* obj = iter.val();
if (strict ? isType<Type>(*obj) : bool(isA<Type>(*obj)))
{
......@@ -359,7 +359,7 @@ Foam::HashTable<Type*> Foam::objectRegistry::lookupClass
forAllIters(*this, iter)
{
regIOobject* obj = iter.object();
regIOobject* obj = iter.val();
if (strict ? isType<Type>(*obj) : bool(isA<Type>(*obj)))
{
......
......@@ -84,7 +84,7 @@ void Foam::transformList(const tensor& rotTensor, Map<T>& field)
{
forAllIters(field, iter)
{
T& value = iter.object();
T& value = iter.val();
value = transform(rotTensor, value);
}
}
......@@ -112,7 +112,7 @@ void Foam::transformList(const tensor& rotTensor, EdgeMap<T>& field)
{
forAllIters(field, iter)
{
T& value = iter.object();
T& value = iter.val();
value = transform(rotTensor, value);
}
}
......
......@@ -646,7 +646,7 @@ void Foam::argList::setCasePaths()
if (optIter.found())
{
caseDir = optIter.object();
caseDir = optIter.val();
caseDir.clean();
if (caseDir.empty() || caseDir == ".")
......
......@@ -65,7 +65,7 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID
}
// Mesh has patch group
const labelList& patchIDs = fnd.object();
const labelList& patchIDs = fnd.val();
if (&mesh == &thisPatch.boundaryMesh().mesh())
{
......
......@@ -739,7 +739,7 @@ void Foam::globalPoints::remove
forAllConstIters(oldMeshToProcPoint, iter)
{
const label localPointi = iter.key();
const labelPairList& pointInfo = oldProcPoints[iter.object()];
const labelPairList& pointInfo = oldProcPoints[iter.val()];
if (pointInfo.size() == 2)
{
......
......@@ -390,7 +390,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const
else
{
// Second occurrence. Store.
const labelPair& edgeInfo = fnd.object();
const labelPair& edgeInfo = fnd.val();
neighbourEdges[patchi][edgei - pp.nInternalEdges()] =
edgeInfo;
......@@ -704,7 +704,7 @@ Foam::labelList Foam::polyBoundaryMesh::indices
if (iter.found())
{
// Hash the patch ids for the group
labelHashSet groupIndices(iter.object());
labelHashSet groupIndices(iter.val());
groupIndices.erase(patchIndices); // Skip existing
patchIndices.append(groupIndices.sortedToc());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment