Skip to content

Commit

Permalink
Improve consistency of APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryAWE committed Feb 1, 2025
1 parent 8a93dd3 commit cbf8f95
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 272 deletions.
16 changes: 8 additions & 8 deletions ext/container/src/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1816,20 +1816,20 @@ namespace detail
{
template_class<script_array, UseGeneric> c(engine, "array<T>", asOBJ_GC);
c
.template template_callback<&array_template_callback>()
.template_callback(fp<&array_template_callback>)
.default_factory()
.template factory<asUINT>("uint", use_explicit)
.template factory<asUINT, const void*>("uint, const T&in")
.list_factory("repeat T")
.opAssign()
.opEquals()
.template addref<&script_array::addref>()
.template release<&script_array::release>()
.template get_refcount<&script_array::get_refcount>()
.template set_gc_flag<&script_array::set_gc_flag>()
.template get_gc_flag<&script_array::get_gc_flag>()
.template enum_refs<&script_array::enum_refs>()
.template release_refs<&script_array::release_refs>()
.addref(fp<&script_array::addref>)
.release(fp<&script_array::release>)
.get_refcount(fp<&script_array::get_refcount>)
.set_gc_flag(fp<&script_array::set_gc_flag>)
.get_gc_flag(fp<&script_array::get_gc_flag>)
.enum_refs(fp<&script_array::enum_refs>)
.release_refs(fp<&script_array::release_refs>)
.method("T& opIndex(uint idx)", fp<&script_array::opIndex>)
.method("const T& opIndex(uint idx) const", fp<&script_array::opIndex>)
.method("T& get_front() property", fp<&script_array::get_front>)
Expand Down
14 changes: 7 additions & 7 deletions ext/container/src/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ static void register_script_dictionary_impl(asIScriptEngine* engine)
ref_class<dictionary, UseGeneric> c(engine, "dictionary", asOBJ_GC);
c
.factory_function("", &dictionary_factory_default)
.template addref<&dictionary::addref>()
.template release<&dictionary::release>()
.template get_refcount<&dictionary::get_refcount>()
.template set_gc_flag<&dictionary::set_gc_flag>()
.template get_gc_flag<&dictionary::get_gc_flag>()
.template enum_refs<&dictionary::enum_refs>()
.template release_refs<&dictionary::release_refs>();
.addref(fp<&dictionary::addref>)
.release(fp<&dictionary::release>)
.get_refcount(fp<&dictionary::get_refcount>)
.set_gc_flag(fp<&dictionary::set_gc_flag>)
.get_gc_flag(fp<&dictionary::get_gc_flag>)
.enum_refs(fp<&dictionary::enum_refs>)
.release_refs(fp<&dictionary::release_refs>);

const char* try_emplace_decl = "bool try_emplace(const string&in k, const ?&in value)";
const char* get_decl = "bool get(const string&in k, ?&out value) const";
Expand Down
4 changes: 2 additions & 2 deletions ext/utility/src/vocabulary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ namespace detail
{
template_class<script_optional, UseGeneric> c(engine, "optional<T>", asOBJ_SCOPED);
c
.template template_callback<&optional_template_callback>()
.template_callback(fp<&optional_template_callback>)
.default_factory()
.template factory<const void*>("const T&in")
.template release<&script_optional::release>()
.release(fp<&script_optional::release>)
.opAssign()
.method("optional<T>& opAssign(const T&in)", fp<&optional_opAssign_value>)
.method("bool get_has_value() const property", fp<&script_optional::has_value>)
Expand Down
Loading

0 comments on commit cbf8f95

Please sign in to comment.