aboutsummaryrefslogtreecommitdiff
path: root/src/container.cpp
blob: f8c49312a29225005d6867903d52685d84b9619a (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
27
28
#include "yacppdic/container.hpp"

#include "yacppdic/detail/internal/wrapper/function_wrapper.hpp"
#include "yacppdic/detail/internal/wrapper/object_wrapper.hpp"

namespace yacppdic
{

void Container::add(
	const ObjectIdentifier &type,
	const WrapperPtr<IGenericWrapper> &wrapper
) noexcept
{
	_bindings.insert({ type, wrapper });
}

void Container::remove(const ObjectIdentifier &type) noexcept
{
	_bindings.erase(type);
}

auto Container::at(const ObjectIdentifier &type) const noexcept
	-> Container::WrapperPtr<IGenericWrapper>
{
	return _bindings.at(type);
}

} // namespace yacppdic