VM2D  1.12
Vortex methods for 2D flows simulation
TimesGen.h
Go to the documentation of this file.
1 /*--------------------------------*- VMlib -*----------------*---------------*\
2 | ## ## ## ## ## ## ## | | Version 1.12 |
3 | ## ## ### ### ## ## | VMlib: VM2D/VM3D Library | 2024/01/14 |
4 | ## ## ## # ## ## ## #### | Open Source Code *----------------*
5 | #### ## ## ## ## ## ## | https://www.github.com/vortexmethods/VM2D |
6 | ## ## ## #### ### #### | https://www.github.com/vortexmethods/VM3D |
7 | |
8 | Copyright (C) 2017-2024 Ilia Marchevsky |
9 *-----------------------------------------------------------------------------*
10 | File name: TimesGen.h |
11 | Info: Source code of VMlib |
12 | |
13 | This file is part of VMlib. |
14 | VMLib is free software: you can redistribute it and/or modify it |
15 | under the terms of the GNU General Public License as published by |
16 | the Free Software Foundation, either version 3 of the License, or |
17 | (at your option) any later version. |
18 | |
19 | VMlib is distributed in the hope that it will be useful, but WITHOUT |
20 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
21 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
22 | for more details. |
23 | |
24 | You should have received a copy of the GNU General Public License |
25 | along with VMlib. If not, see <http://www.gnu.org/licenses/>. |
26 \*---------------------------------------------------------------------------*/
27 
28 
37 #ifndef TIMESGEN_H
38 #define TIMESGEN_H
39 
40 #include "defs.h"
41 
42 namespace VMlib
43 {
44 
51  class TimesGen
52  {
53  protected:
56  static void ToZeroPeriod(timePeriod& period)
57  {
58  period.first = 0;
59  period.second = 0;
60  }//ToZero(...)
61 
62  public:
64  TimesGen() {};
65 
67  virtual ~TimesGen() {};
68 
69 
71  virtual void GenerateStatHeader() const = 0;
72 
74  virtual void GenerateStatString() const = 0;
75 
77  virtual void ToZero() = 0;
78 
82  static double dT(const timePeriod& t)
83  {
84  return (t.second - t.first);
85  }//dT(...)
86  };
87 
88 }//namespace VMlib
89 
90 #endif
virtual ~TimesGen()
Деструктор
Definition: TimesGen.h:67
virtual void ToZero()=0
Обнуление состояния временной статистики
Класс для сбора статистики времени исполнения основных шагов алгоритма и вывода ее в файл ...
Definition: TimesGen.h:51
Описание базовых вспомогательных функций
virtual void GenerateStatString() const =0
Сохранение строки со статистикой в файл временной статистики
TimesGen()
Конструктор
Definition: TimesGen.h:64
static double dT(const timePeriod &t)
Definition: TimesGen.h:82
std::pair< double, double > timePeriod
Тип для хранения начала и конца промежутка времени
Definition: defs.h:70
virtual void GenerateStatHeader() const =0
Генерация заголовка файла временной статистики
static void ToZeroPeriod(timePeriod &period)
Definition: TimesGen.h:56