xtd - Reference Guide 0.2.0
object.h
Go to the documentation of this file.
1 #pragma once
5 #include <cstdint>
6 #include <string>
7 #include <memory>
8 #include "core_export.h"
9 
11 namespace xtd {
13  class ustring;
15 
30  class core_export_ object {
31  public:
33 
37  object() = default;
39 
41  object(const object&) = default;
42  object& operator =(const object&) = default;
43  virtual ~object() = default;
45 
47 
55  virtual bool equals(const object& obj) const noexcept;
56 
64  static bool equals(const object& object_a, const object& object_b) noexcept;
65 
68  virtual size_t get_hash_code() const noexcept;
69 
75  //virtual type get_type() const;
76 
82  template<typename object_t>
83  std::unique_ptr<object_t> memberwise_clone() const {return std::make_unique<object_t>(dynamic_cast<const object_t&>(*this));}
84 
92  static bool reference_equals(const object& object_a, const object& object_b) noexcept;
93 
99  virtual xtd::ustring to_string() const noexcept;
101  };
102 
104  std::ostream& operator <<(std::ostream& os, const object& obj) noexcept;
106 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:51
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1100
std::unique_ptr< object_t > memberwise_clone() const
Gets the type of the current instance.
Definition: object.h:83
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:30