mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: include file tracking: missed out adding files to list of files to check
This commit is contained in:
@ -70,11 +70,52 @@ Foam::dlLibraryTable& Foam::functionEntries::codeStream::libs
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const IOdictionary& d = static_cast<const IOdictionary&>(dict.topDict());
|
const baseIOdictionary& d = static_cast<const baseIOdictionary&>
|
||||||
|
(
|
||||||
|
dict.topDict()
|
||||||
|
);
|
||||||
return const_cast<Time&>(d.time()).libs();
|
return const_cast<Time&>(d.time()).libs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::functionEntries::codeStream::doingMasterOnlyReading
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const dictionary& topDict = dict.topDict();
|
||||||
|
|
||||||
|
if (isA<baseIOdictionary>(topDict))
|
||||||
|
{
|
||||||
|
const baseIOdictionary& d = static_cast<const baseIOdictionary&>
|
||||||
|
(
|
||||||
|
topDict
|
||||||
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "codeStream : baseIOdictionary:" << dict.name()
|
||||||
|
<< " master-only-reading:" << d.globalObject()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return d.globalObject();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "codeStream : not a baseIOdictionary:" << dict.name()
|
||||||
|
<< " master-only-reading:" << regIOobject::masterOnlyReading
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fall back to regIOobject::masterOnlyReading
|
||||||
|
return regIOobject::masterOnlyReading;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::functionEntries::codeStream::streamingFunctionType
|
Foam::functionEntries::codeStream::streamingFunctionType
|
||||||
Foam::functionEntries::codeStream::getFunction
|
Foam::functionEntries::codeStream::getFunction
|
||||||
(
|
(
|
||||||
@ -96,7 +137,10 @@ Foam::functionEntries::codeStream::getFunction
|
|||||||
|
|
||||||
// see if library is loaded
|
// see if library is loaded
|
||||||
void* lib = NULL;
|
void* lib = NULL;
|
||||||
if (isA<IOdictionary>(parentDict.topDict()))
|
|
||||||
|
const dictionary& topDict = parentDict.topDict();
|
||||||
|
|
||||||
|
if (isA<baseIOdictionary>(topDict))
|
||||||
{
|
{
|
||||||
lib = libs(parentDict).findLibrary(libPath);
|
lib = libs(parentDict).findLibrary(libPath);
|
||||||
}
|
}
|
||||||
@ -111,7 +155,7 @@ Foam::functionEntries::codeStream::getFunction
|
|||||||
// avoid compilation if possible by loading an existing library
|
// avoid compilation if possible by loading an existing library
|
||||||
if (!lib)
|
if (!lib)
|
||||||
{
|
{
|
||||||
if (isA<IOdictionary>(parentDict.topDict()))
|
if (isA<baseIOdictionary>(topDict))
|
||||||
{
|
{
|
||||||
// Cached access to dl libs. Guarantees clean up upon destruction
|
// Cached access to dl libs. Guarantees clean up upon destruction
|
||||||
// of Time.
|
// of Time.
|
||||||
@ -178,10 +222,10 @@ Foam::functionEntries::codeStream::getFunction
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Only block if we're not doing master-only reading. (flag set by
|
//- Only block if we're not doing master-only reading. (flag set by
|
||||||
// regIOobject::read, IOdictionary constructor)
|
// regIOobject::read, baseIOdictionary constructor)
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!regIOobject::masterOnlyReading
|
!doingMasterOnlyReading(topDict)
|
||||||
&& regIOobject::fileModificationSkew > 0
|
&& regIOobject::fileModificationSkew > 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -246,7 +290,7 @@ Foam::functionEntries::codeStream::getFunction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isA<IOdictionary>(parentDict.topDict()))
|
if (isA<baseIOdictionary>(topDict))
|
||||||
{
|
{
|
||||||
// Cached access to dl libs. Guarantees clean up upon destruction
|
// Cached access to dl libs. Guarantees clean up upon destruction
|
||||||
// of Time.
|
// of Time.
|
||||||
@ -282,7 +326,7 @@ Foam::functionEntries::codeStream::getFunction
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool haveLib = lib;
|
bool haveLib = lib;
|
||||||
if (!regIOobject::masterOnlyReading)
|
if (!doingMasterOnlyReading(topDict))
|
||||||
{
|
{
|
||||||
reduce(haveLib, andOp<bool>());
|
reduce(haveLib, andOp<bool>());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -123,6 +123,10 @@ class codeStream
|
|||||||
//- Helper function: parent (of parent etc.) of dictionary up to the top
|
//- Helper function: parent (of parent etc.) of dictionary up to the top
|
||||||
static const dictionary& topDict(const dictionary&);
|
static const dictionary& topDict(const dictionary&);
|
||||||
|
|
||||||
|
//- Helper function: access IOobject for master-only-reading
|
||||||
|
// functionality
|
||||||
|
static bool doingMasterOnlyReading(const dictionary& dict);
|
||||||
|
|
||||||
//- Helper function: access to dlLibraryTable of Time
|
//- Helper function: access to dlLibraryTable of Time
|
||||||
static dlLibraryTable& libs(const dictionary& dict);
|
static dlLibraryTable& libs(const dictionary& dict);
|
||||||
|
|
||||||
|
|||||||
@ -24,10 +24,10 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "includeEntry.H"
|
#include "includeEntry.H"
|
||||||
#include "dictionary.H"
|
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "addToMemberFunctionSelectionTable.H"
|
#include "addToMemberFunctionSelectionTable.H"
|
||||||
#include "stringOps.H"
|
#include "stringOps.H"
|
||||||
|
#include "Time.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -127,6 +127,9 @@ bool Foam::functionEntries::includeEntry::execute
|
|||||||
(
|
(
|
||||||
includeFileName(is.name().path(), rawFName, parentDict)
|
includeFileName(is.name().path(), rawFName, parentDict)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Read contents of file into parentDict
|
||||||
IFstream ifs(fName);
|
IFstream ifs(fName);
|
||||||
|
|
||||||
if (ifs)
|
if (ifs)
|
||||||
@ -135,6 +138,21 @@ bool Foam::functionEntries::includeEntry::execute
|
|||||||
{
|
{
|
||||||
Info<< fName << endl;
|
Info<< fName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add watch on included file
|
||||||
|
const dictionary& top = parentDict.topDict();
|
||||||
|
if (isA<regIOobject>(top))
|
||||||
|
{
|
||||||
|
regIOobject& rio = const_cast<regIOobject&>
|
||||||
|
(
|
||||||
|
dynamic_cast<const regIOobject&>(top)
|
||||||
|
);
|
||||||
|
//Info<< rio.name() << " : adding depenency on included file "
|
||||||
|
// << fName << endl;
|
||||||
|
|
||||||
|
rio.addWatch(fName);
|
||||||
|
}
|
||||||
|
|
||||||
parentDict.read(ifs);
|
parentDict.read(ifs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -165,6 +183,9 @@ bool Foam::functionEntries::includeEntry::execute
|
|||||||
(
|
(
|
||||||
includeFileName(is.name().path(), rawFName, parentDict)
|
includeFileName(is.name().path(), rawFName, parentDict)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Read contents of file into parentDict
|
||||||
IFstream ifs(fName);
|
IFstream ifs(fName);
|
||||||
|
|
||||||
if (ifs)
|
if (ifs)
|
||||||
@ -173,6 +194,21 @@ bool Foam::functionEntries::includeEntry::execute
|
|||||||
{
|
{
|
||||||
Info<< fName << endl;
|
Info<< fName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add watch on included file
|
||||||
|
const dictionary& top = parentDict.topDict();
|
||||||
|
if (isA<regIOobject>(top))
|
||||||
|
{
|
||||||
|
regIOobject& rio = const_cast<regIOobject&>
|
||||||
|
(
|
||||||
|
dynamic_cast<const regIOobject&>(top)
|
||||||
|
);
|
||||||
|
//Info<< rio.name() << " : adding depenency on included file "
|
||||||
|
// << fName << endl;
|
||||||
|
|
||||||
|
rio.addWatch(fName);
|
||||||
|
}
|
||||||
|
|
||||||
entry.read(parentDict, ifs);
|
entry.read(parentDict, ifs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,6 +26,7 @@ License
|
|||||||
#include "includeIfPresentEntry.H"
|
#include "includeIfPresentEntry.H"
|
||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
|
#include "regIOobject.H"
|
||||||
#include "addToMemberFunctionSelectionTable.H"
|
#include "addToMemberFunctionSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -78,6 +79,18 @@ bool Foam::functionEntries::includeIfPresentEntry::execute
|
|||||||
{
|
{
|
||||||
Info<< fName << endl;
|
Info<< fName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add watch on included file
|
||||||
|
const dictionary& top = parentDict.topDict();
|
||||||
|
if (isA<regIOobject>(top))
|
||||||
|
{
|
||||||
|
regIOobject& rio = const_cast<regIOobject&>
|
||||||
|
(
|
||||||
|
dynamic_cast<const regIOobject&>(top)
|
||||||
|
);
|
||||||
|
rio.addWatch(fName);
|
||||||
|
}
|
||||||
|
|
||||||
parentDict.read(ifs);
|
parentDict.read(ifs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +114,18 @@ bool Foam::functionEntries::includeIfPresentEntry::execute
|
|||||||
{
|
{
|
||||||
Info<< fName << endl;
|
Info<< fName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add watch on included file
|
||||||
|
const dictionary& top = parentDict.topDict();
|
||||||
|
if (isA<regIOobject>(top))
|
||||||
|
{
|
||||||
|
regIOobject& rio = const_cast<regIOobject&>
|
||||||
|
(
|
||||||
|
dynamic_cast<const regIOobject&>(top)
|
||||||
|
);
|
||||||
|
rio.addWatch(fName);
|
||||||
|
}
|
||||||
|
|
||||||
entry.read(parentDict, ifs);
|
entry.read(parentDict, ifs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user