Skip to content

Commit 601fa09

Browse files
committed
wip
1 parent 534facd commit 601fa09

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

doc/mrdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ exclude-symbols:
2424

2525
sort-members: false
2626
extract-friends: false
27-
implementation-detail: impl
27+
#implementation-detail: impl
2828
inherit-base-members: never
2929

3030
# Metadata Extraction

include/boost/openmethod/core.hpp

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,19 +1044,45 @@ struct valid_method_parameter<virtual_<T>, Registry>
10441044
Registry::rtti::template is_polymorphic<virtual_type<T, Registry>>> {
10451045
};
10461046

1047+
template<class Registry>
1048+
using method_base = std::conditional_t<
1049+
Registry::has_deferred_static_rtti, deferred_method_info, method_info>;
1050+
10471051
} // namespace detail
10481052

1053+
//! See specialization.
10491054
template<
10501055
typename Name, typename ReturnType,
10511056
class Registry = BOOST_OPENMETHOD_DEFAULT_REGISTRY>
10521057
class method;
10531058

1059+
//! An open-method.
1060+
//!
1061+
//! `method` implements an open-method that takes a parameter list -
1062+
//! `Parameters` - and returns a `ReturnType`. `Name` can be any type. Its
1063+
//! purpose is to make it possible to have multiple methods with the same
1064+
//! signature. Typically, `Name` is a class whose name reflects the method's
1065+
//! purpose.
1066+
//!
1067+
//! `Parameters` must contain at least one virtual parameter, i.e. a parameter
1068+
//! that has a type in the form `virtual_ptr<T,{nbsp}Policy>` or `virtual_<T>`.
1069+
//! The dynamic types of the virtual arguments (the arguments corresponding to
1070+
//! virtual parameters in the method's signature) are taken into account to
1071+
//! select the overrider to call.
1072+
//!
1073+
//! A `method` is attached to a `Registry`, which contains policies that
1074+
//! influence several parts of the dispatch mechanism - for example, how to
1075+
//! obtain a v-table pointer for an object, how to report errors, whether to
1076+
//! perform sanity checks, etc.
1077+
//!
1078+
//! @tparam Name A type representing the method's name.
1079+
//! @tparam ReturnType The return type of the method.
1080+
//! @tparam Parameters The types of the method's parameters.
1081+
//! @tparam Registry The registry in which the method is registered.
10541082
template<
10551083
typename Name, typename... Parameters, typename ReturnType, class Registry>
10561084
class method<Name, ReturnType(Parameters...), Registry>
1057-
: public std::conditional_t<
1058-
Registry::has_deferred_static_rtti, detail::deferred_method_info,
1059-
detail::method_info> {
1085+
: public detail::method_base<Registry> {
10601086
// Aliases used in implementation only. Everything extracted from template
10611087
// arguments is capitalized like the arguments themselves.
10621088
using RegistryType = Registry;
@@ -1067,8 +1093,8 @@ class method<Name, ReturnType(Parameters...), Registry>
10671093
using VirtualParameters =
10681094
typename detail::virtual_types<DeclaredParameters>;
10691095
using Signature = auto(Parameters...) -> ReturnType;
1070-
using FunctionPointer = auto (*)(detail::remove_virtual<Parameters>...)
1071-
-> ReturnType;
1096+
using FunctionPointer = auto(*)(detail::remove_virtual<Parameters>...)
1097+
-> ReturnType;
10721098
static constexpr auto Arity = boost::mp11::mp_count_if<
10731099
mp11::mp_list<Parameters...>, detail::is_virtual>::value;
10741100

@@ -1137,9 +1163,9 @@ class method<Name, ReturnType(Parameters...), Registry>
11371163

11381164
public:
11391165
// Public aliases.
1140-
using name_type = Name;
1141-
using return_type = ReturnType;
1142-
using function_type = ReturnType (*)(detail::remove_virtual<Parameters>...);
1166+
//using name_type = Name;
1167+
//using return_type = ReturnType;
1168+
//using function_type = ReturnType (*)(detail::remove_virtual<Parameters>...);
11431169

11441170
static method fn;
11451171

0 commit comments

Comments
 (0)