Allow chaining calls to add_class_maker()
This commit is contained in:
parent
258237cbf3
commit
036dd57524
2 changed files with 4 additions and 2 deletions
|
@ -79,7 +79,7 @@ namespace wren {
|
||||||
ClassManager();
|
ClassManager();
|
||||||
~ClassManager() noexcept;
|
~ClassManager() noexcept;
|
||||||
|
|
||||||
void add_class_maker (std::string_view module_name, std::string_view class_name, make_foreign_class_t);
|
ClassManager& add_class_maker (std::string_view module_name, std::string_view class_name, make_foreign_class_t);
|
||||||
foreign_class_t make_class(std::string_view module_name, std::string_view class_name);
|
foreign_class_t make_class(std::string_view module_name, std::string_view class_name);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace wren {
|
||||||
ClassManager::ClassManager() = default;
|
ClassManager::ClassManager() = default;
|
||||||
ClassManager::~ClassManager() noexcept = default;
|
ClassManager::~ClassManager() noexcept = default;
|
||||||
|
|
||||||
void ClassManager::add_class_maker (std::string_view module_name, std::string_view class_name, make_foreign_class_t maker) {
|
ClassManager& ClassManager::add_class_maker (std::string_view module_name, std::string_view class_name, make_foreign_class_t maker) {
|
||||||
using detail::TempClassName;
|
using detail::TempClassName;
|
||||||
using detail::ClassNameOwning;
|
using detail::ClassNameOwning;
|
||||||
|
|
||||||
|
@ -83,6 +83,8 @@ namespace wren {
|
||||||
m_classes.insert(it_found, std::make_pair(ClassNameOwning{module_name, class_name}, maker));
|
m_classes.insert(it_found, std::make_pair(ClassNameOwning{module_name, class_name}, maker));
|
||||||
else
|
else
|
||||||
it_found->second = maker;
|
it_found->second = maker;
|
||||||
|
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreign_class_t ClassManager::make_class (std::string_view module_name, std::string_view class_name) {
|
foreign_class_t ClassManager::make_class (std::string_view module_name, std::string_view class_name) {
|
||||||
|
|
Loading…
Reference in a new issue