[libcamera-devel] [PATCH 11/14] libcamera: bound_method: Rename Bound*Method to BoundMethod*
Niklas Söderlund
niklas.soderlund at ragnatech.se
Tue Jan 7 20:20:44 CET 2020
Hi Laurent,
Thanks for your work.
On 2020-01-04 07:09:44 +0200, Laurent Pinchart wrote:
> Most of the bound method classes are named with a BoundMethod prefix,
> except for BoundMemberMethod and BoundStaticMethod. Rename them to
> BoundMethodMember and BoundMethodStatic respectively to make the code
> more coherent.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> Documentation/Doxyfile.in | 6 +++---
> include/libcamera/bound_method.h | 12 ++++++------
> include/libcamera/object.h | 2 +-
> include/libcamera/signal.h | 12 ++++++------
> 4 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in
> index 5ae8773bd3ad..8e6fbdbb92b6 100644
> --- a/Documentation/Doxyfile.in
> +++ b/Documentation/Doxyfile.in
> @@ -870,12 +870,12 @@ EXCLUDE_PATTERNS =
> # Note that the wildcards are matched against the file with absolute path, so to
> # exclude all test directories use the pattern */test/*
>
> -EXCLUDE_SYMBOLS = libcamera::BoundMemberMethod \
> - libcamera::BoundMethodArgs \
> +EXCLUDE_SYMBOLS = libcamera::BoundMethodArgs \
> libcamera::BoundMethodBase \
> + libcamera::BoundMethodMember \
> libcamera::BoundMethodPack \
> libcamera::BoundMethodPackBase \
> - libcamera::BoundStaticMethod \
> + libcamera::BoundMethodStatic \
> libcamera::SignalBase \
> std::*
>
> diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h
> index 0a91f44a2054..ca501493bce2 100644
> --- a/include/libcamera/bound_method.h
> +++ b/include/libcamera/bound_method.h
> @@ -156,12 +156,12 @@ public:
> };
>
> template<typename T, typename R, typename... Args>
> -class BoundMemberMethod : public BoundMethodArgs<R, Args...>
> +class BoundMethodMember : public BoundMethodArgs<R, Args...>
> {
> public:
> using PackType = typename BoundMethodArgs<R, Args...>::PackType;
>
> - BoundMemberMethod(T *obj, Object *object, R (T::*func)(Args...),
> + BoundMethodMember(T *obj, Object *object, R (T::*func)(Args...),
> ConnectionType type = ConnectionTypeAuto)
> : BoundMethodArgs<R, Args...>(obj, object, type), func_(func)
> {
> @@ -189,12 +189,12 @@ private:
> };
>
> template<typename T, typename... Args>
> -class BoundMemberMethod<T, void, Args...> : public BoundMethodArgs<void, Args...>
> +class BoundMethodMember<T, void, Args...> : public BoundMethodArgs<void, Args...>
> {
> public:
> using PackType = typename BoundMethodArgs<void *, Args...>::PackType;
>
> - BoundMemberMethod(T *obj, Object *object, void (T::*func)(Args...),
> + BoundMethodMember(T *obj, Object *object, void (T::*func)(Args...),
> ConnectionType type = ConnectionTypeAuto)
> : BoundMethodArgs<void, Args...>(obj, object, type), func_(func)
> {
> @@ -221,10 +221,10 @@ private:
> };
>
> template<typename R, typename... Args>
> -class BoundStaticMethod : public BoundMethodArgs<R, Args...>
> +class BoundMethodStatic : public BoundMethodArgs<R, Args...>
> {
> public:
> - BoundStaticMethod(R (*func)(Args...))
> + BoundMethodStatic(R (*func)(Args...))
> : BoundMethodArgs<R, Args...>(nullptr, nullptr, ConnectionTypeAuto),
> func_(func)
> {
> diff --git a/include/libcamera/object.h b/include/libcamera/object.h
> index 04aa18394d55..9344af30bc79 100644
> --- a/include/libcamera/object.h
> +++ b/include/libcamera/object.h
> @@ -35,7 +35,7 @@ public:
> Args... args)
> {
> T *obj = static_cast<T *>(this);
> - auto *method = new BoundMemberMethod<T, R, FuncArgs...>(obj, this, func, type);
> + auto *method = new BoundMethodMember<T, R, FuncArgs...>(obj, this, func, type);
> return method->activate(args..., true);
> }
>
> diff --git a/include/libcamera/signal.h b/include/libcamera/signal.h
> index 7fbe5a2c528f..432d95d0ed1c 100644
> --- a/include/libcamera/signal.h
> +++ b/include/libcamera/signal.h
> @@ -60,7 +60,7 @@ public:
> {
> Object *object = static_cast<Object *>(obj);
> object->connect(this);
> - slots_.push_back(new BoundMemberMethod<T, void, Args...>(obj, object, func, type));
> + slots_.push_back(new BoundMethodMember<T, void, Args...>(obj, object, func, type));
> }
>
> template<typename T, typename R, typename std::enable_if<!std::is_base_of<Object, T>::value>::type * = nullptr>
> @@ -69,13 +69,13 @@ public:
> #endif
> void connect(T *obj, R (T::*func)(Args...))
> {
> - slots_.push_back(new BoundMemberMethod<T, R, Args...>(obj, nullptr, func));
> + slots_.push_back(new BoundMethodMember<T, R, Args...>(obj, nullptr, func));
> }
>
> template<typename R>
> void connect(R (*func)(Args...))
> {
> - slots_.push_back(new BoundStaticMethod<R, Args...>(func));
> + slots_.push_back(new BoundMethodStatic<R, Args...>(func));
> }
>
> void disconnect()
> @@ -100,11 +100,11 @@ public:
> /*
> * If the object matches the slot, the slot is
> * guaranteed to be a member slot, so we can safely
> - * cast it to BoundMemberMethod<T, Args...> to match
> + * cast it to BoundMethodMember<T, Args...> to match
> * func.
> */
> if (slot->match(obj) &&
> - static_cast<BoundMemberMethod<T, R, Args...> *>(slot)->match(func)) {
> + static_cast<BoundMethodMember<T, R, Args...> *>(slot)->match(func)) {
> iter = slots_.erase(iter);
> delete slot;
> } else {
> @@ -119,7 +119,7 @@ public:
> for (auto iter = slots_.begin(); iter != slots_.end(); ) {
> BoundMethodArgs<R, Args...> *slot = *iter;
> if (slot->match(nullptr) &&
> - static_cast<BoundStaticMethod<R, Args...> *>(slot)->match(func)) {
> + static_cast<BoundMethodStatic<R, Args...> *>(slot)->match(func)) {
> iter = slots_.erase(iter);
> delete slot;
> } else {
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list