IOobject, regIOobject: rationalised handling of paths for global and local objects
now all path functions in 'IOobject' are either templated on the type or require a 'globalFile' argument to specify if the type is case global e.g. 'IOdictionary' or decomposed in parallel, e.g. almost everything else. The 'global()' and 'globalFile()' virtual functions are now in 'regIOobject' abstract base-class and overridden as required by derived classes. The path functions using 'global()' and 'globalFile()' to differentiate between global and processor local objects are now also in 'regIOobject' rather than 'IOobject' to ensure the path returned is absolutely consistent with the type. Unfortunately there is still potential for unexpected IO behaviour inconsistent with the global/local nature of the type due to the 'fileOperation' classes searching the processor directory for case global objects before searching the case directory. This approach appears to be a work-around for incomplete integration with and rationalisation of 'IOobject' but with the changes above it is no longer necessary. Unfortunately this "up" searching is baked-in at a low level and mixed-up with various complex ways to pick the processor directory name out of the object path and will take some unravelling but this work will undertaken as time allows.
This commit is contained in:
@ -658,10 +658,10 @@ int main(int argc, char *argv[])
|
||||
// Read dictionary. (disable class type checking so we can load
|
||||
// field)
|
||||
Info<< "Loading dictionary " << fieldName << endl;
|
||||
const word oldTypeName = IOdictionary::typeName;
|
||||
const_cast<word&>(IOdictionary::typeName) = word::null;
|
||||
const word oldTypeName = localIOdictionary::typeName;
|
||||
const_cast<word&>(localIOdictionary::typeName) = word::null;
|
||||
|
||||
IOdictionary fieldDict
|
||||
localIOdictionary fieldDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -674,7 +674,7 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
);
|
||||
|
||||
const_cast<word&>(IOdictionary::typeName) = oldTypeName;
|
||||
const_cast<word&>(localIOdictionary::typeName) = oldTypeName;
|
||||
|
||||
// Fake type back to what was in field
|
||||
const_cast<word&>(fieldDict.type()) =
|
||||
|
||||
Reference in New Issue
Block a user