xtd 0.2.0
Loading...
Searching...
No Matches
xtd::diagnostics::trace_filter Class Referenceabstract
Inheritance diagram for xtd::diagnostics::trace_filter:
xtd::abstract_object xtd::object xtd::diagnostics::event_type_filter xtd::diagnostics::source_filter

Definition

Provides the base class for trace filter implementations.

Provides the base class for trace filter implementations.
Definition trace_filter.h:33
#define abstract_
This keyword is used to represents an abstract class.
Definition abstract.h:23
#define core_export_
Define shared library export.
Definition core_export.h:13
Inheritance
xtd::objectxtd::abstract_objectxtd::diagnostics::trace_filter
Header
#include <xtd/diagnostics/trace_filter>
Namespace
xtd::diagnostics
Library
xtd.core
Remarks
Trace filters can be used by trace listeners to provide an extra layer of filtering beyond that provided by trace switches. The trace filter for a trace listener can be found in the listener's filter property. Trace switches determine if a trace is to be sent to the trace listeners. Trace filters allow the individual trace listeners to determine whether or not the trace is to be written to the associated output medium. For example, as determined by each trace filter, a trace may be written to the console by a console_trace_listener, but not to the event log by a event_log_trace_listener.
Filters that inherit from the trace_filter class can be used by trace listeners that inherit from the trace_listener class to perform filtering of events being traced. trace_filter contains a single method, should_trace, which takes event data and returns a flag indicating whether the event should be traced.

Public Methods

virtual bool should_trace (const xtd::diagnostics::trace_event_cache &cache, const xtd::ustring &source, xtd::diagnostics::trace_event_type event_type, int32 id, const xtd::ustring &message, std::any data1, const std::vector< std::any > &data_array) noexcept=0
 When overridden in a derived class, determines whether the trace listener should trace the event.
 

Protected constructors

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

Protectted methods

bool should_trace (const xtd::diagnostics::trace_event_cache &cache, const xtd::ustring &source, xtd::diagnostics::trace_event_type event_type, int32 id, const xtd::ustring &message) noexcept
 determines whether the trace listener should trace the event.
 
bool should_trace (const xtd::diagnostics::trace_event_cache &cache, const xtd::ustring &source, xtd::diagnostics::trace_event_type event_type, int32 id, const xtd::ustring &message, std::any data1) noexcept
 determines whether the trace listener should trace the event.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
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 >
std::unique_ptr< object_t > memberwise_clone () const noexcept
 Creates a shallow copy of the current object.
 
virtual xtd::ustring to_string () const noexcept
 Returns a sxd::ustring that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 
- Protected Member Functions inherited from xtd::abstract_object
 abstract_object ()=default
 Initializes a new instance of the xtd::abstract_object class.
 

Constructor & Destructor Documentation

◆ trace_filter()

xtd::diagnostics::trace_filter::trace_filter ( )
protecteddefault

Initializes a new instance of the trace_filter class.

Member Function Documentation

◆ should_trace() [1/3]

bool xtd::diagnostics::trace_filter::should_trace ( const xtd::diagnostics::trace_event_cache cache,
const xtd::ustring source,
xtd::diagnostics::trace_event_type  event_type,
int32  id,
const xtd::ustring message 
)
protectednoexcept

determines whether the trace listener should trace the event.

Parameters
cacheThe trace_event_cache that contains information for the trace event.
sourceThe name of the source.
event_typeOne of the trace_event_type values specifying the type of event that has caused the trace
idA trace identifier number.
messageMessage to write.

◆ should_trace() [2/3]

bool xtd::diagnostics::trace_filter::should_trace ( const xtd::diagnostics::trace_event_cache cache,
const xtd::ustring source,
xtd::diagnostics::trace_event_type  event_type,
int32  id,
const xtd::ustring message,
std::any  data1 
)
protectednoexcept

determines whether the trace listener should trace the event.

Parameters
cacheThe trace_event_cache that contains information for the trace event.
sourceThe name of the source.
event_typeOne of the trace_event_type values specifying the type of event that has caused the trace
idA trace identifier number.
messageMessage to write.
data1A trace data object.

◆ should_trace() [3/3]

virtual bool xtd::diagnostics::trace_filter::should_trace ( const xtd::diagnostics::trace_event_cache cache,
const xtd::ustring source,
xtd::diagnostics::trace_event_type  event_type,
int32  id,
const xtd::ustring message,
std::any  data1,
const std::vector< std::any > &  data_array 
)
pure virtualnoexcept

When overridden in a derived class, determines whether the trace listener should trace the event.

Parameters
cacheThe trace_event_cache that contains information for the trace event.
sourceThe name of the source.
event_typeOne of the trace_event_type values specifying the type of event that has caused the trace
idA trace identifier number.
messageMessage to write.
data1A trace data object.
data_arrayA trace data object.

Implemented in xtd::diagnostics::event_type_filter, and xtd::diagnostics::source_filter.


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