xtd 0.2.0
Loading...
Searching...
No Matches
xtd::diagnostics::switch_base Class Reference
Inheritance diagram for xtd::diagnostics::switch_base:
xtd::object xtd::iequatable< switch_base > xtd::interface xtd::equality_operators< type_t, equatable_t > xtd::diagnostics::boolean_switch xtd::diagnostics::source_switch xtd::diagnostics::trace_switch

Definition

Provides an abstract base class to create new debugging and tracing switches.

Provides an abstract base class to create new debugging and tracing switches.
Definition switch_base.h:36
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::switch_base
Header
#include <xtd/diagnostics/switch_base>
Namespace
xtd::diagnostics
Library
xtd.core
Remarks
A switch provides an efficient mechanism for controlling tracing and debugging output at run time using external settings. The switch_base class implements default behavior for switches, allowing you to change the switch level at run time.
This class is the base class for the boolean_switch, source_switch and the trace_switch classes. These switches meet most debugging and tracing needs.
Notes to implementers
If you need trace levels, or mechanisms for setting switch levels different from those provided by boolean_switch, source_switch and trace_switch, you can inherit from switch_base. When inheriting from this class, you must implement the switch_setting method.

Public Properties

const std::map< xtd::string, xtd::string > & attributes () const noexcept
 Gets the custom switch attributes.
 
std::map< xtd::string, xtd::string > & attributes () noexcept
 Gets the custom switch attributes.
 
void attributes (const std::map< xtd::string, xtd::string > &attributes) noexcept
 Sets the custom switch attributes.
 
const xtd::stringdescription () const noexcept
 Gets a description of the switch.
 
const xtd::stringdisplay_name () const noexcept
 Gets a name used to identify the switch.
 

Public Methods

bool equals (const switch_base &value) const noexcept override
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current 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.
 

Protected constructors

 switch_base (const xtd::string &display_name, const xtd::string &description)
 Initializes a new instance of the switch_base class.
 
 switch_base (const xtd::string &display_name, const xtd::string &description, const xtd::string &default_switch_value)
 Initializes a new instance of the switch_base class.
 

Protected Properties

int32 switch_setting () const noexcept
 Gets the current setting for this switch.
 
void switch_setting (int32 switch_setting)
 Sets the current setting for this switch.
 
const xtd::stringvalue () const noexcept
 Gets the value of the switch.
 
void value (const xtd::string &value)
 Sets the value of the switch.
 

Protected Methods

virtual std::vector< xtd::stringget_supported_attributes () const noexcept
 Gets the custom attributes supported by the switch.
 
virtual void on_switch_setting_changed ()
 Invoked when the switch_setting property is changed.
 
virtual void on_value_changed ()
 Invoked when the value property is changed.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class 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.
 
- Public Member Functions inherited from xtd::iequatable< switch_base >
virtual bool equals (const switch_base &) const noexcept=0
 Indicates wheth er the current object is equal to another object of the same type.
 
- 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.
 

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