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  " --timestamp <monotonic|wall> print microsecond-precision timestamps.\n" \
16  " monotonic: stamps increase monotonically.\n" \
17  " wall: 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 */
wall_clock_timestampert
Definition: timestamper.h:75
timestampert::clockt::NONE
@ NONE
timestampert
timestampert::stamp
virtual std::string stamp() const
Default timestamp: the empty string.
Definition: timestamper.h:57
timestampert::clockt
clockt
Derived types of timestampert.
Definition: timestamper.h:45
timestampert::clockt::MONOTONIC
@ MONOTONIC
monotonic_timestampert
timestampert::make
static std::unique_ptr< const timestampert > make(clockt clock_type)
Factory method to build timestampert subclasses.
Definition: timestamper.cpp:19
monotonic_timestampert::stamp
virtual std::string stamp() const override
See HELP_TIMESTAMP in util/timestamper.h for time stamp format.
Definition: timestamper.cpp:41
monotonic_timestampert
Definition: timestamper.h:67
timestampert::clockt::WALL_CLOCK
@ WALL_CLOCK
wall_clock_timestampert
timestampert::~timestampert
virtual ~timestampert()=default
wall_clock_timestampert::stamp
virtual std::string stamp() const override
See HELP_TIMESTAMP in util/timestamper.h for time stamp format.
Definition: timestamper.cpp:57
timestampert
Timestamp class hierarchy.
Definition: timestamper.h:41