xtd 0.2.0
Loading...
Searching...
No Matches
switch_base.hpp
Go to the documentation of this file.
1
4#pragma once
5#include <cstdint>
6#include <map>
7#include <vector>
8#include "../iequatable.hpp"
9#include "../object.hpp"
10#include "../string.hpp"
11#include "source_levels.hpp"
12
14namespace xtd {
16 namespace diagnostics {
36 class core_export_ switch_base : public xtd::object, public xtd::iequatable<switch_base> {
37 public:
39 switch_base(const switch_base& value) = default;
40 switch_base& operator =(const switch_base& value) = default;
42
44
48 const std::map<xtd::string, xtd::string>& attributes() const noexcept;
51 std::map<xtd::string, xtd::string>& attributes() noexcept;
54 void attributes(const std::map<xtd::string, xtd::string>& attributes) noexcept;
55
59 const xtd::string& description() const noexcept;
60
64 const xtd::string& display_name() const noexcept;
66
68
70 using object::equals;
71 bool equals(const switch_base& value) const noexcept override;
73
74 protected:
76
84 switch_base(const xtd::string& display_name, const xtd::string& description);
90 switch_base(const xtd::string& display_name, const xtd::string& description, const xtd::string& default_switch_value);
92
94
98 int32 switch_setting() const noexcept;
101 void switch_setting(int32 switch_setting);
102
108 const xtd::string& value() const noexcept;
114 void value(const xtd::string& value);
116
118
125 virtual std::vector<xtd::string> get_supported_attributes() const noexcept;
126
128 virtual void on_switch_setting_changed();
129
134 virtual void on_value_changed();
136
137 private:
138 xtd::string display_name_;
139 xtd::string description_;
140 std::map<xtd::string, xtd::string> attributes_;
141 int32 switch_setting_ = 0;
142 xtd::string value_;
143 };
144 }
145}
Provides an abstract base class to create new debugging and tracing switches.
Definition switch_base.hpp:36
const std::map< xtd::string, xtd::string > & attributes() const noexcept
Gets the custom switch attributes.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
#define core_export_
Define shared library export.
Definition core_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::diagnostics::source_levels enum class.