xtd 0.2.0
Loading...
Searching...
No Matches
xtd::diagnostics::trace_event_cache Class Reference
Inheritance diagram for xtd::diagnostics::trace_event_cache:
xtd::object

Definition

Provides trace event data specific to a thread and a process.

Provides trace event data specific to a thread and a process.
Definition trace_event_cache.h:30
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
#define core_export_
Define shared library export.
Definition core_export.h:13
Inheritance
xtd::objectxtd::diagnostics::trace_event_cache
Header
#include <xtd/diagnostics/trace_event_cache>
Namespace
xtd::diagnostics
Library
xtd.core

Public Constructors

 trace_event_cache ()=default
 Initializes a new instance of the trace_event_cache class.
 

Public Properties

xtd::string call_stack () const noexcept
 Gets the call stack for the current thread.
 
const xtd::date_timedate_time () const noexcept
 Gets the date and time at which the event trace occurred.
 
std::vector< xtd::stringlogical_operation_stack () const noexcept
 Gets the correlation data, contained in a stack.
 
int32 process_id () const noexcept
 Gets the unique identifier of the current process.
 
xtd::string thread_id () const noexcept
 Gets a unique identifier for the current managed thread.
 
std::chrono::nanoseconds timestamp () const noexcept
 Gets the current number of ticks in the timer mechanism.
 
int64 timestamp_milliseconds () const noexcept
 Gets the current number of ticks in the timer mechanism, in milliseconds.
 
int64 timestamp_nanoseconds () const noexcept
 Gets the current number of ticks in the timer mechanism, in nanoseconds.
 
int64 timestamp_ticks () const noexcept
 Gets the current number of ticks in the timer mechanism, in nanoseconds.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ trace_event_cache()

xtd::diagnostics::trace_event_cache::trace_event_cache ( )
default

Initializes a new instance of the trace_event_cache class.

Member Function Documentation

◆ call_stack()

xtd::string xtd::diagnostics::trace_event_cache::call_stack ( ) const
noexcept

Gets the call stack for the current thread.

Returns
string A string containing stack trace information. This value can be an empty string ("").
Remarks
The Callstack property gets the call stack from the StackTrace property of the Environment class. The property value lists method calls in reverse chronological order. That is, the most recent method call is described first. One line of stack trace information is listed for each method call on the stack. For more information, see StackTrace.

◆ date_time()

const xtd::date_time & xtd::diagnostics::trace_event_cache::date_time ( ) const
noexcept

Gets the date and time at which the event trace occurred.

Returns
DateTime A DateTime structure whose value is a date and time expressed in Coordinated Universal Time (UTC).
Remarks
The first time the property is accessed in an instance of the trace_event_cache class, the current time is returned. Subsequent queries of this property in that instance return that same DateTime value, allowing it to be used as a timestamp.

◆ logical_operation_stack()

std::vector< xtd::string > xtd::diagnostics::trace_event_cache::logical_operation_stack ( ) const
noexcept

Gets the correlation data, contained in a stack.

Returns
A Stack containing correlation data.
Remarks
The correlation data is stored as an object in the call context with the name "System.Diagnostics.Trace.CorrelationManagerSlot". The CorrelationManager class provides methods used to store a logical operation identity in a thread-bound context and automatically tag each trace event generated by the thread with the stored identity. The CorrelationManager is accessed through the Trace.CorrelationManager property. Each call to the StartLogicalOperation method pushes a new logical operation identity onto the stack. Each call to the StopLogicalOperation method pops a logical operation identity from the stack

◆ process_id()

int32 xtd::diagnostics::trace_event_cache::process_id ( ) const
noexcept

Gets the unique identifier of the current process.

Returns
int32 The system-generated unique identifier of the current process.
Remarks
Until the process terminates, the process identifier uniquely identifies the process throughout the system.

◆ thread_id()

xtd::string xtd::diagnostics::trace_event_cache::thread_id ( ) const
noexcept

Gets a unique identifier for the current managed thread.

Returns
string A string that represents a unique integer identifier for this managed thread.
Remarks
The thread identifier is the value of the Thread.ManagedThreadId property formatted as a string.

◆ timestamp()

std::chrono::nanoseconds xtd::diagnostics::trace_event_cache::timestamp ( ) const
noexcept

Gets the current number of ticks in the timer mechanism.

Returns
std::chrono::nanoseconds The nanoseconds counter value of the underlying timer mechanism.
Remarks
The get accessor calls the Stopwatch.GetTimestamp method to get the timestamp. If the Stopwatch class uses a high-resolution performance counter, GetTimestamp returns the current value of that counter. If the Stopwatch class uses the system timer, GetTimestamp returns the Ticks property of DateTime.Now.

◆ timestamp_milliseconds()

int64 xtd::diagnostics::trace_event_cache::timestamp_milliseconds ( ) const
noexcept

Gets the current number of ticks in the timer mechanism, in milliseconds.

Returns
int64 The millisecond counter value of the underlying timer mechanism.
Remarks
The get accessor calls the Stopwatch.GetTimestamp method to get the timestamp. If the Stopwatch class uses a high-resolution performance counter, GetTimestamp returns the current value of that counter. If the Stopwatch class uses the system timer, GetTimestamp returns the Ticks property of DateTime.Now.

◆ timestamp_nanoseconds()

int64 xtd::diagnostics::trace_event_cache::timestamp_nanoseconds ( ) const
noexcept

Gets the current number of ticks in the timer mechanism, in nanoseconds.

Returns
int64 The nanosecond counter value of the underlying timer mechanism.
Remarks
The get accessor calls the Stopwatch.GetTimestamp method to get the timestamp. If the Stopwatch class uses a high-resolution performance counter, GetTimestamp returns the current value of that counter. If the Stopwatch class uses the system timer, GetTimestamp returns the Ticks property of DateTime.Now.

◆ timestamp_ticks()

int64 xtd::diagnostics::trace_event_cache::timestamp_ticks ( ) const
noexcept

Gets the current number of ticks in the timer mechanism, in nanoseconds.

Returns
int64 The tick counter value of the underlying timer mechanism.
Remarks
The get accessor calls the Stopwatch.GetTimestamp method to get the timestamp. If the Stopwatch class uses a high-resolution performance counter, GetTimestamp returns the current value of that counter. If the Stopwatch class uses the system timer, GetTimestamp returns the Ticks property of DateTime.Now.

The documentation for this class was generated from the following file: