xtd 0.2.0
Loading...
Searching...
No Matches
type_object.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "iequatable.hpp"
6#include "object.hpp"
7#include "type.hpp"
8#include "string.hpp"
9
11namespace xtd {
12 class type_object;
13
14 template<class type_t> auto type_of() noexcept -> const xtd::type_object&;
15 auto type_of(const auto& value) noexcept -> xtd::type_object;
16 auto type_of(const xtd::type& value) noexcept -> xtd::type_object;
17}
19
20
22namespace xtd {
24
37 class type_object : public object, public xtd::iequatable<type_object> {
38 public:
40 type_object(const type_object&) noexcept = default;
41 type_object& operator=(const type_object&) noexcept;
43
49 xtd::string full_name() const noexcept;
50
54 xtd::string name() const noexcept;
55
59 xtd::string namespace_() const noexcept;
61
67 bool equals(const object& obj) const noexcept override;
71 bool equals(const type_object& type) const noexcept override;
72
75 xtd::size get_hash_code() const noexcept override;
76
79 xtd::string to_string() const noexcept override;
81
82 private:
83 template<class type_t>
84 friend auto xtd::type_of() noexcept -> const type_object&;
85 friend auto xtd::type_of(const auto& value) noexcept -> type_object;
86 friend auto xtd::type_of(const xtd::type& value) noexcept -> type_object;
87 friend class xtd::object;
88
89 type_object() noexcept;
90 type_object(const xtd::type& type) noexcept;
91
92 const xtd::type& type_;
93 };
94
95}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Represents type declarations: class types, interface types, array types, value types,...
Definition type_object.hpp:37
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
xtd::string namespace_() const noexcept
Gets the namespace of the type_object.
xtd::string full_name() const noexcept
Gets the fully qualified name of the type_object, including the namespace of the type_object.
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
xtd::string name() const noexcept
Gets the name of the type_object.
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
std::type_info type
Stores information about a type.
Definition type.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
Contains xtd::iequatable interface.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.
Contains xtd::string alias.
Contains xtd::type type.