xtd 0.2.0
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 namespace __s__ {
15 template<class type_t> xtd::type_object __typeof_() noexcept;
16 template<class type_t> xtd::type_object __typeof_(const type_t& value) noexcept;
17 xtd::type_object __typeof_(const xtd::type& value) noexcept;
18 }
19}
21
22
24namespace xtd {
26
39 class type_object : public object, public xtd::iequatable<type_object> {
40 public:
42 type_object(const type_object&) noexcept = default;
43 type_object& operator=(const type_object&) noexcept;
45
51 xtd::string full_name() const noexcept;
52
56 xtd::string name() const noexcept;
57
61 xtd::string namespace_() const noexcept;
63
69 bool equals(const object& obj) const noexcept override;
73 bool equals(const type_object& type) const noexcept override;
74
77 xtd::size get_hash_code() const noexcept override;
78
81 xtd::string to_string() const noexcept override;
83
84 private:
85 template<class type_t>
86 friend type_object xtd::__s__::__typeof_() noexcept;
87 template<class type_t>
88 friend type_object xtd::__s__::__typeof_(const type_t& value) noexcept;
89 friend type_object xtd::__s__::__typeof_(const xtd::type& value) noexcept;
90 friend class xtd::object;
91
92 type_object() noexcept;
93 type_object(const xtd::type& type) noexcept;
94
95 const xtd::type& type_;
96 };
97
98}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Represents type declarations: class types, interface types, array types, value types,...
Definition type_object.hpp:39
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.