xtd 0.2.0
switch_base.hpp
Go to the documentation of this file.
1
4#pragma once
5#include <cstdint>
7#include "../array.hpp"
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
47 using attribute_collection = std::map<xtd::string, xtd::string>;
48
51
55 const attribute_collection& attributes() const noexcept;
62
66 const xtd::string& description() const noexcept;
67
71 const xtd::string& display_name() const noexcept;
73
75
80 bool equals(const xtd::object& obj) const noexcept override;
84 bool equals(const switch_base& other) const noexcept override;
86
87 protected:
89
97 switch_base(const xtd::string& display_name, const xtd::string& description);
103 switch_base(const xtd::string& display_name, const xtd::string& description, const xtd::string& default_switch_value);
105
107
111 int32 switch_setting() const noexcept;
115
121 const xtd::string& value() const noexcept;
127 void value(const xtd::string& value);
129
131
138 virtual xtd::array<xtd::string> get_supported_attributes() const noexcept;
139
142
147 virtual void on_value_changed();
149
150 private:
151 xtd::string display_name_;
152 xtd::string description_;
153 attribute_collection attributes_;
154 int32 switch_setting_ = 0;
155 xtd::string value_;
156 };
157 }
158}
Contains xtd::array class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
virtual xtd::array< xtd::string > get_supported_attributes() const noexcept
Gets the custom attributes supported by the switch.
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
const attribute_collection & attributes() const noexcept
Gets the custom switch attributes.
const xtd::string & description() const noexcept
Gets a description of the switch.
std::map< xtd::string, xtd::string > attribute_collection
Represents the attributes collection.
Definition switch_base.hpp:47
int32 switch_setting() const noexcept
Gets the current setting for this switch.
const xtd::string & value() const noexcept
Gets the value of 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.
const xtd::string & display_name() const noexcept
Gets a name used to identify the switch.
switch_base(const xtd::string &display_name, const xtd::string &description)
Initializes a new instance of the switch_base class.
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:44
#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
@ other
The operating system is other.
Definition platform_id.hpp:58
Contains xtd::iequatable interface.
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.
Contains xtd::collections::generic::sorted_dictionary <key_t, value_t> class.
Contains xtd::diagnostics::source_levels enum class.
Contains xtd::string alias.