tobicore  7.0.0
 All Classes Functions Variables Typedefs Enumerator Friends Groups Pages
TCTimestamp.hpp
1 /*
2  Copyright (C) 2009-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
3  Michele Tavella <michele.tavella@epfl.ch>
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef TCTIMESTAMP_HPP
20 #define TCTIMESTAMP_HPP
21 #include "TCTime.hpp"
22 #include <string>
23 
24 typedef struct timeval TCTimeval;
25 
30 class TCTimestamp {
31  public:
34  TCTimestamp(void);
35 
38  virtual ~TCTimestamp(void);
39 
42  virtual void Unset(void);
43 
48  virtual bool IsSet(void);
49 
54  virtual void Tic(void);
55 
64  virtual double Toc(TCTimeval* timestamp);
65 
72  virtual double Toc(void);
73 
79  virtual void Get(std::string* timestamp) const;
80 
87  virtual bool Set(const std::string& timestamp);
88 
94  virtual void Set(const TCTimeval* timestamp);
95 
96  public:
97 
100  TCTimeval timestamp;
101 };
102 
103 #endif