1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | 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_;
86 // Private Member Functions
88 //- Disallow default bitwise copy construct
89 profilingPool(const profilingPool&);
91 //- Disallow default bitwise assignment
92 void operator=(const profilingPool&);
95 // Static data members
97 //- The only possible Pool-Object
98 static profilingPool *thePool_;
122 const mapType& map() const
127 profilingStack& stack()
132 const profilingStack& stack() const
137 const Time& owner() const
144 static void initProfiling
150 static void stopProfiling(const Time&);
154 static profilingInfo& getInfo(const string& name);
156 static void remove(const profilingInfo& info);
158 static void rememberTimer(const profilingInfo& info, clockTime& timer);
160 virtual bool writeData(Ostream&) const;
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 // ************************************************************************* //