40 concept l61Obj = std::derived_from<std::remove_cvref_t<T>,
Object>;
43 concept l61ObjPtr = std::derived_from<Object, std::remove_pointer_t<T>>;
60 virtual std::string
toString()
const;
72 virtual std::size_t
hashCode()
const;
94 const std::type_info&
typeInfo()
const;
120 explicit operator std::string()
const;
129 explicit operator nlohmann::json()
const;
148 template<l61Obj T, l61Obj Ty>
151 return dynamic_cast<const T*
>(&value) !=
nullptr;
167 template<l61Obj T, l61Obj Ty>
170 return typeid(T) == value.typeInfo();
187 template<l61Obj T, l61Obj Ty>
190 return std::derived_from<Ty, std::type_identity_t<T>>;
195template <l61::meta::l61Obj T>
196struct nlohmann::adl_serializer<T>
201 j = obj.toJsonValue();
210template <l61::meta::l61Obj T>
211struct std::formatter<T> : formatter<std::string> {
212 auto format(
const T& obj, std::format_context& ctx)
const {
213 return std::formatter<std::string>::format(
220template <l61::meta::l61Obj T>
225 return obj.hashCode();
virtual std::size_t hashCode() const
Returns a hash code for the object.
Definition Object.cpp:55
std::string typeName() const
Returns the demangled name of the type.
Definition Object.cpp:60
virtual nlohmann::json toJsonValue() const
Serializes the object into JSON form.
Definition Object.cpp:70
virtual std::string toString() const
Returns a human-readable string representation of the object.
Definition Object.cpp:50
const std::type_info & typeInfo() const
Returns RTTI type information object.
Definition Object.cpp:65
virtual ~Object()=default
static void to_json(json &j, const T &obj)
Definition Object.hpp:198
std::size_t operator()(const T &obj) const noexcept
Definition Object.hpp:223