ENH: mutable libs() access in Time and other classes (#1737)

- This reflects the pre-existing coding situation where const_cast was
  used throughout to effect the same.

STYLE: fix private/protected access

- CodedField, codedMixedFvPatchField
This commit is contained in:
Mark Olesen
2020-07-14 10:48:50 +02:00
parent 41d3e6f1d4
commit 1e7c6ea2f1
30 changed files with 79 additions and 88 deletions

View File

@ -89,7 +89,7 @@ void Foam::codedPoints0MotionSolver::prepare
Foam::dlLibraryTable& Foam::codedPoints0MotionSolver::libs() const
{
return const_cast<Time&>(mesh().time()).libs();
return mesh().time().libs();
}

View File

@ -103,7 +103,7 @@ protected:
// Protected Member Functions
//- Get the loaded dynamic libraries
//- Mutable access to the loaded dynamic libraries
virtual dlLibraryTable& libs() const;
//- Adapt the context for the current object

View File

@ -94,7 +94,7 @@ Foam::displacementMotionSolver::New
{
Info<< "Selecting motion solver: " << solverTypeName << endl;
const_cast<Time&>(mesh.time()).libs().open
mesh.time().libs().open
(
solverDict,
"motionSolverLibs",

View File

@ -116,7 +116,7 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
Info<< "Selecting motion solver: " << solverName << nl;
const_cast<Time&>(mesh.time()).libs().open
mesh.time().libs().open
(
solverDict,
"motionSolverLibs",