1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Collects all the data for profiling
33 \*---------------------------------------------------------------------------*/
35 #ifndef profilingPool_H
36 #define profilingPool_H
38 #include "regIOobject.H"
39 #include "clockTime.H"
43 #include "profilingInfo.H"
44 #include "profilingStack.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 // Forward declaration of classes
55 // // Forward declaration of friend functions and operators
56 // Istream& operator>>(Istream&, profilingPool&);
57 // Ostream& operator<<(Ostream&, const profilingPool&);
60 /*---------------------------------------------------------------------------*\
61 Class profilingPool Declaration
62 \*---------------------------------------------------------------------------*/
70 typedef std::multimap<Foam::string,Foam::profilingInfo*> mapType;
71 typedef std::pair<Foam::string,Foam::profilingInfo*> mapValues;
72 typedef mapType::iterator mapIterator;
73 typedef mapType::const_iterator mapConstIterator;
80 profilingStack theStack_;
82 clockTime globalTime_;
85 // Private Member Functions
87 //- Disallow default bitwise copy construct
88 profilingPool(const profilingPool&);
90 //- Disallow default bitwise assignment
91 void operator=(const profilingPool&);
94 // Static data members
96 //- The only possible Pool-Object
97 static profilingPool *thePool_;
103 profilingPool(const IOobject&);
117 const mapType& map() const
122 profilingStack& stack()
127 const profilingStack& stack() const
134 static void initprofiling(const IOobject&);
136 static profilingInfo& getInfo(const string& name);
138 static void remove(const profilingInfo& info);
140 static void rememberTimer(const profilingInfo& info, clockTime& timer);
142 virtual bool writeData(Ostream&) const;
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 // ************************************************************************* //