mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: codeProperties was masking regIOobject::modified()
- file changes were not getting noticed, made modified 'sticky'
This commit is contained in:
@ -24,12 +24,12 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "codeProperties.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(Foam::codeProperties, 0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::codeProperties::codeProperties(const IOobject& io)
|
||||
@ -41,6 +41,20 @@ Foam::codeProperties::codeProperties(const IOobject& io)
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::codeProperties::modified() const
|
||||
{
|
||||
modified_ = modified_ || regIOobject::modified();
|
||||
|
||||
return modified_;
|
||||
}
|
||||
|
||||
|
||||
void Foam::codeProperties::setUnmodified() const
|
||||
{
|
||||
modified_ = false;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::codeProperties::read()
|
||||
{
|
||||
if (regIOobject::read())
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::codeProperties
|
||||
|
||||
Description
|
||||
IOdictionary + flag whether file has changed.
|
||||
IOdictionary with an internal flag to explicitly track when a file changed.
|
||||
|
||||
SourceFiles
|
||||
codeProperties.C
|
||||
@ -35,7 +35,6 @@ SourceFiles
|
||||
#ifndef codeProperties_H
|
||||
#define codeProperties_H
|
||||
|
||||
#include "MeshObject.H"
|
||||
#include "IOdictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -53,7 +52,7 @@ class codeProperties
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- File change
|
||||
//- Monitor file change
|
||||
mutable bool modified_;
|
||||
|
||||
public:
|
||||
@ -69,15 +68,12 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
bool modified() const
|
||||
{
|
||||
return modified_;
|
||||
}
|
||||
//- A sticky version of regIOobject::modified()
|
||||
// Must explicitly clear with setUnmodified()
|
||||
virtual bool modified() const;
|
||||
|
||||
void setUnmodified() const
|
||||
{
|
||||
modified_ = false;
|
||||
}
|
||||
//- Make modification unsticky
|
||||
void setUnmodified() const;
|
||||
|
||||
//- Read the dictionary
|
||||
virtual bool read();
|
||||
|
||||
Reference in New Issue
Block a user