Commit 0f491b10 authored by Wescoeur's avatar Wescoeur Committed by Ronan

feat(Object): save arguments types in MetaObjectSignalInfo

parent 8bd7220f
......@@ -360,26 +360,14 @@ constexpr StringLiteral<N> makeStringLiteral (RawStringLiteral<N> &raw) {
// Compile-time string list.
// -----------------------------------------------------------------------------
template<typename... T>
using StringLiteralList = std::tuple<T...>;
template<std::size_t... N>
using StringLiteralList = std::tuple<StringLiteral<N>...>;
constexpr StringLiteralList<> makeStringLiteralList () {
return {};
template<std::size_t... N>
constexpr StringLiteralList<N...> makeStringLiteralList (RawStringLiteral<N>& ...list) {
return std::make_tuple(StringLiteral<N>(list)...);
}
template<std::size_t N, typename... T>
constexpr auto makeStringLiteralList (RawStringLiteral<N> &raw, T&... list) L_AUTO_CONSTEXPR_RETURN(
std::tuple_cat(std::make_tuple(StringLiteral<N>(raw)), makeStringLiteralList(list...))
)
template<std::size_t N, typename T>
constexpr auto appendStringLiteral (
const StringLiteralList<T> &list,
const StringLiteral<N> &stringLiteral
) L_AUTO_CONSTEXPR_RETURN(
std::tuple_cat(list, stringLiteral)
)
#endif // ifdef __cplusplus
LINPHONE_END_NAMESPACE
......
......@@ -53,6 +53,8 @@
#define L_INTERNAL_SIGNAL_INDEX(NAME, LINE) L_CONCAT(lSignalIndexOf ## _, L_CONCAT(NAME ## _, LINE))
#define L_INTERNAL_STRINGIFY(NOOP, VALUE) #VALUE
// -----------------------------------------------------------------------------
// Public macros API.
// -----------------------------------------------------------------------------
......@@ -97,7 +99,8 @@
lMetaSignals(counter.prev(), context), \
std::make_tuple(LinphonePrivate::Private::makeMetaObjectSignalInfo( \
L_CALL(L_RESOLVE_OVERLOAD, TYPES)(&lType::NAME), \
#NAME \
#NAME, \
makeStringLiteralList(L_APPLY(L_INTERNAL_STRINGIFY, , L_CALL(L_EXPAND_VARIADIC, TYPES))) \
)) \
) \
)
......@@ -125,19 +128,21 @@ namespace Private {
* Meta data of one object's signal.
* Useful to get arguments number, params and signal name.
*/
template<typename Signal, int NameLength>
template<typename Signal, int NameLength, typename ArgumentsTypes>
struct MetaObjectSignalInfo {
Signal signal;
StringLiteral<NameLength> name;
ArgumentsTypes argumentsTypes;
static constexpr int argumentsNumber = FunctionPointer<Signal>::ArgumentsNumber;
};
template<typename Signal, int NameLength>
constexpr MetaObjectSignalInfo<Signal, NameLength> makeMetaObjectSignalInfo (
template<typename Signal, int NameLength, typename ArgumentsTypes>
constexpr MetaObjectSignalInfo<Signal, NameLength, ArgumentsTypes> makeMetaObjectSignalInfo (
Signal signal,
RawStringLiteral<NameLength> &name
RawStringLiteral<NameLength> &name,
const ArgumentsTypes &argumentsTypes
) {
return { signal, { name } };
return { signal, { name }, argumentsTypes };
}
};
......
......@@ -17,7 +17,6 @@
*/
#include "object/object-p.h"
#include "object/object-p.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment