aboutsummaryrefslogtreecommitdiff
path: root/src/DI/object_type.cpp
blob: f6004cb02d8e1019c708d6089d89e27c7616a00f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "object_type.hpp"

BaseObjectType::BaseObjectType(const std::type_info &type_info) noexcept
	: _type_info(type_info)
{
}

bool BaseObjectType::operator==(const BaseObjectType &object_type) const noexcept
{
	return hash() == object_type.hash();
}

std::size_t BaseObjectType::hash() const noexcept
{
	return _type_info.hash_code();
}

std::string_view BaseObjectType::name() const noexcept
{
	return std::string_view(_type_info.name());
}

std::size_t ObjectTypeHasher::operator()(const BaseObjectType &object_type) const
{
	return object_type.hash();
}