diff options
author | HampusM <hampus@hampusmat.com> | 2022-06-11 22:03:46 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-11 22:03:46 +0200 |
commit | 77d97c914a157037b6729d0f3b0fb265aacf4741 (patch) | |
tree | 60b4e9463f1d36450129bf518b79e1d9ae7fa970 /src | |
parent | 203db8ffe8d4ee82ca126926232f4d4de21b7aec (diff) |
refactor: clean up container API
Diffstat (limited to 'src')
-rw-r--r-- | src/container.cpp | 28 | ||||
-rw-r--r-- | src/object_identifier.cpp | 6 |
2 files changed, 3 insertions, 31 deletions
diff --git a/src/container.cpp b/src/container.cpp deleted file mode 100644 index f8c4931..0000000 --- a/src/container.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#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 diff --git a/src/object_identifier.cpp b/src/object_identifier.cpp index a743271..44ca1b3 100644 --- a/src/object_identifier.cpp +++ b/src/object_identifier.cpp @@ -1,10 +1,10 @@ -#include "yacppdic/object_identifier.hpp" +#include "yacppdic/detail/internal/object_identifier.hpp" #include "yacppdic/detail/internal/hash.hpp" #include <functional> -namespace yacppdic +namespace yacppdic::internal { ObjectIdentifier::ObjectIdentifier(const std::type_info &type_info) noexcept @@ -44,5 +44,5 @@ auto ObjectIdentifier::tag() const noexcept -> std::string_view return _tag; } -} // namespace yacppdic +} // namespace yacppdic::internal |