Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
Timeable.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This file is part of the gobelijn software.
4  * Gobelijn is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or any later
7  * version. Gobelijn is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9  * or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for details. You should have received
11  * a copy of the GNU General Public License along with the software. If not,
12  * see <http://www.gnu.org/licenses/>.
13  *
14  * Copyright 2012, Jan Broeckhove.
15  */
21 #include "ClockCLib.h"
22 #include "Stopwatch.h"
23 #include <chrono>
24 
25 namespace UA_CoMP {
26 namespace Timekeeper {
27 
32 template <typename C = ClockCLib, typename D = C::duration>
33 class Timeable
34 {
35 public:
37  using Duration = D;
38 
40  using Timings = UA_CoMP::Timekeeper::CumulativeRecords<D>;
41 
43  using Clock = C;
44 
46  using Stopwatch = UA_CoMP::Clock::Stopwatch<C>;
47 
48 public:
50  virtual ~Timeable() {}
51 
53  virtual TimingsType GetTimings() const = 0;
54 };
55 
56 } // namespace Timekeeper
57 } // namespace UA_CoMP
UA_CoMP::Timekeeper::CumulativeRecords< D > Timings
Records with timing info.
Definition: Timeable.h:40
virtual ~Timeable()
Destructor virtual for polymorphic class.
Definition: Timeable.h:50
virtual TimingsType GetTimings() const =0
Timings in duration units specified above.
UA_CoMP::Clock::Stopwatch< C > Stopwatch
Clock used to obtain timing info.
Definition: Timeable.h:46
C Clock
Type for clock.
Definition: Timeable.h:43
Definition of Stopwatch.
Records durations associated with a name.
Definition: Timeable.h:33
D Duration
Type for time duration units.
Definition: Timeable.h:37