mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: debug: move debug declaration into Foam namespace
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,6 +30,10 @@ Description
|
||||
#include "dictionary.H"
|
||||
#include "IFstream.H"
|
||||
#include "OSspecific.H"
|
||||
#include "Ostream.H"
|
||||
//#include "HashTable.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "simpleObjectRegistry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -54,15 +58,34 @@ public:
|
||||
|
||||
~deleteControlDictPtr()
|
||||
{
|
||||
if (controlDictPtr_)
|
||||
{
|
||||
delete controlDictPtr_;
|
||||
controlDictPtr_ = 0;
|
||||
}
|
||||
deleteDemandDrivenData(controlDictPtr_);
|
||||
}
|
||||
};
|
||||
|
||||
deleteControlDictPtr deleteControlDictPtr_;
|
||||
|
||||
|
||||
// Debug switch read and write callback tables.
|
||||
simpleObjectRegistry* debugObjectsPtr_(NULL);
|
||||
simpleObjectRegistry* infoObjectsPtr_(NULL);
|
||||
simpleObjectRegistry* optimisationObjectsPtr_(NULL);
|
||||
class deleteDebugSwitchPtr
|
||||
{
|
||||
public:
|
||||
|
||||
deleteDebugSwitchPtr()
|
||||
{}
|
||||
|
||||
~deleteDebugSwitchPtr()
|
||||
{
|
||||
deleteDemandDrivenData(debugObjectsPtr_);
|
||||
deleteDemandDrivenData(infoObjectsPtr_);
|
||||
deleteDemandDrivenData(optimisationObjectsPtr_);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
deleteDebugSwitchPtr deleteDebugSwitchPtr_;
|
||||
//! \endcond
|
||||
|
||||
|
||||
@ -165,6 +188,61 @@ int Foam::debug::optimisationSwitch(const char* name, const int defaultValue)
|
||||
}
|
||||
|
||||
|
||||
void Foam::debug::addDebugObject(const char* name, simpleRegIOobject* obj)
|
||||
{
|
||||
debugObjects().insert(name, obj);
|
||||
}
|
||||
|
||||
|
||||
void Foam::debug::addInfoObject(const char* name, simpleRegIOobject* obj)
|
||||
{
|
||||
infoObjects().insert(name, obj);
|
||||
}
|
||||
|
||||
|
||||
void Foam::debug::addOptimisationObject
|
||||
(
|
||||
const char* name,
|
||||
simpleRegIOobject* obj
|
||||
)
|
||||
{
|
||||
optimisationObjects().insert(name, obj);
|
||||
}
|
||||
|
||||
|
||||
Foam::simpleObjectRegistry& Foam::debug::debugObjects()
|
||||
{
|
||||
if (!debugObjectsPtr_)
|
||||
{
|
||||
debugObjectsPtr_ = new simpleObjectRegistry(1000);
|
||||
}
|
||||
|
||||
return *debugObjectsPtr_;
|
||||
}
|
||||
|
||||
|
||||
Foam::simpleObjectRegistry& Foam::debug::infoObjects()
|
||||
{
|
||||
if (!infoObjectsPtr_)
|
||||
{
|
||||
infoObjectsPtr_ = new simpleObjectRegistry(1000);
|
||||
}
|
||||
|
||||
return *infoObjectsPtr_;
|
||||
}
|
||||
|
||||
|
||||
Foam::simpleObjectRegistry& Foam::debug::optimisationObjects()
|
||||
{
|
||||
if (!optimisationObjectsPtr_)
|
||||
{
|
||||
optimisationObjectsPtr_ = new simpleObjectRegistry(1000);
|
||||
}
|
||||
|
||||
return *optimisationObjectsPtr_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user