Files
openfoam/src/OpenFOAM/global/debug/debug.H
Mark Olesen c90a167e5a bugfixing, documentation in global/debug
- catch missing "controlDict" file immediately via findEtcFile() instead of
  checking IFstream::good(). This avoids segfaulting, since the error
  handling in IFstream uses classes that are not yet initialized.
- use new dictionary features (eg, lookupOrAddDefault) to reduce code
- fixed debug::switchSet to use ref-to-pointer so pointer actually gets set!
2008-12-12 19:25:48 +01:00

89 lines
2.8 KiB
C++

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace
Foam::debug
Description
Namespace for handling debugging switches.
SourceFiles
debug.C
\*---------------------------------------------------------------------------*/
#ifndef debug_H
#define debug_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class dictionary;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace debug
{
//- The central control dictionary.
// Located in ~/.OpenFOAM/VERSION or $WM_PROJECT_DIR/etc
// @sa Foam::findEtcFile()
dictionary& controlDict();
//- The DebugSwitches sub-dictionary in the central controlDict.
dictionary& debugSwitches();
//- The InfoSwitches sub-dictionary in the central controlDict.
dictionary& infoSwitches();
//- The OptimisationSwitches sub-dictionary in the central controlDict.
dictionary& optimisationSwitches();
//- Lookup debug switch or add default value.
int debugSwitch(const char* name, const int defaultValue=0);
//- Lookup info switch or add default value.
int infoSwitch(const char* name, const int defaultValue=0);
//- Lookup optimisation switch or add default value.
int optimisationSwitch(const char* name, const int defaultValue=0);
//- Internal function to lookup a sub-dictionary from controlDict.
dictionary& switchSet(const char* subDictName, dictionary*& subDictPtr);
} // End namespace debug
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //