CBMC
timestamper.h
Go to the documentation of this file.
1 
5 #ifndef CPROVER_UTIL_TIMESTAMPER_H
6 #define CPROVER_UTIL_TIMESTAMPER_H
7 
8 #ifdef _WIN32
9 #define OPT_TIMESTAMP ""
10 #define HELP_TIMESTAMP ""
11 #else
12 #define OPT_TIMESTAMP "(timestamp):"
13 
14 # define HELP_TIMESTAMP \
15  " {y--timestamp} [{ymonotonic}|{ywall}] \t " \
16  "print microsecond-precision timestamps. {ymonotonic}: stamps increase " \
17  "monotonically. {ywall}: ISO-8601 wall clock timestamps.\n"
18 #endif
19 
20 #include <memory>
21 #include <string>
22 
42 {
43 public:
45  enum class clockt
46  {
48  NONE,
50  MONOTONIC,
53  };
54  virtual ~timestampert() = default;
55 
57  virtual std::string stamp() const
58  {
59  return "";
60  }
61 
63  static std::unique_ptr<const timestampert> make(clockt clock_type);
64 };
65 
66 #ifndef _WIN32
68 {
69 public:
72  virtual std::string stamp() const override;
73 };
74 
76 {
77 public:
80  virtual std::string stamp() const override;
81 };
82 #endif
83 
84 #endif /* CPROVER_UTIL_TIMESTAMPER_H */
virtual std::string stamp() const override
See HELP_TIMESTAMP in util/timestamper.h for time stamp format.
Definition: timestamper.cpp:41
Timestamp class hierarchy.
Definition: timestamper.h:42
clockt
Derived types of timestampert.
Definition: timestamper.h:46
@ MONOTONIC
monotonic_timestampert
@ WALL_CLOCK
wall_clock_timestampert
@ NONE
timestampert
virtual ~timestampert()=default
static std::unique_ptr< const timestampert > make(clockt clock_type)
Factory method to build timestampert subclasses.
Definition: timestamper.cpp:19
virtual std::string stamp() const
Default timestamp: the empty string.
Definition: timestamper.h:57
virtual std::string stamp() const override
See HELP_TIMESTAMP in util/timestamper.h for time stamp format.
Definition: timestamper.cpp:57