BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/eformat/include/eformat/DateAndTime.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file eformat/DateAndTime.h
5 * @author <a href="mailto:Andre.dos.Anjos@cern.ch">Andre DOS ANJOS</a>
6 * $Author: zhangy $
7 * $Revision: 1.1.1.1 $
8 * $Date: 2009/06/19 07:35:41 $
9 *
10 * @brief Describes how to create and interpret a date and time field.
11 */
12
13#ifndef EFORMAT_HELPER_DATEANDTIME_H
14#define EFORMAT_HELPER_DATEANDTIME_H
15
16#include <stdint.h>
17#include <string>
18
19namespace eformat {
20
21 namespace helper {
22
23 /**
24 * Interprets and composes a date and time field (32-bit unsigned integer)
25 */
27
28 public: // interface
29 /**
30 * Default constructor, it means, now
31 */
33
34 /**
35 * Build from an existing date in time
36 *
37 * @param val The value of the compiled date and time field
38 */
39 DateAndTime( uint32_t val );
40
41 /**
42 * Get the current representation
43 */
44 inline uint32_t code( void ) const { return m_val; }
45
46 /**
47 * Returns a string that represents the time in ISO8601
48 */
49 std::string iso8601( void ) const;
50
51 /**
52 * Returns a string that represents the time in a human readable format
53 */
54 std::string human( void ) const;
55
56 private: // implementation
57 uint32_t m_val; ///< my current value
58 };
59
60 } // namespace helper
61
62} // namespace eformat
63
64#endif /* EFORMAT_HELPER_DATEANDTIME_H */
std::string iso8601(void) const
std::string human(void) const