xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
trace_event_cache.h
Go to the documentation of this file.
1 #pragma once
5 #include <chrono>
6 #include <string>
7 #include <thread>
8 #include <vector>
9 #include "../object.h"
10 #include "../ustring.h"
11 
13 namespace xtd {
15  namespace diagnostics {
22  class trace_event_cache : public object {
23  public:
24  //using clock = std::chrono::high_resolution_clock;
25  using clock = std::chrono::system_clock;
27  trace_event_cache() = default;
28 
31  trace_event_cache& operator=(const trace_event_cache& tec) = default;
33 
38  xtd::ustring call_stack() const;
39 
43  clock::time_point date_time() const;
44 
48  std::vector<xtd::ustring> logical_operation_stack() const;
49 
53  int32_t process_id() const;
54 
58  xtd::ustring thread_id() const;
59 
63  int64_t timestamp() const;
64 
65  private:
66  mutable clock::time_point date_time_ = clock::time_point::min();
67  };
68  }
69 }
trace_event_cache()=default
Initializes a new instance of the trace_event_cache class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
xtd::ustring thread_id() const
Gets a unique identifier for the current managed thread.
Provides trace event data specific to a thread and a process.
Definition: trace_event_cache.h:22
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
xtd::ustring call_stack() const
Gets the call stack for the current thread.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:26
int32_t process_id() const
Gets the unique identifier of the current process.
clock::time_point date_time() const
Gets the date and time at which the event trace occurred.
int64_t timestamp() const
Gets the current number of ticks in the timer mechanism.
std::vector< xtd::ustring > logical_operation_stack() const
Gets the correlation data, contained in a stack.