[{"id":3367,"web_url":"https://patchwork.libcamera.org/comment/3367/","msgid":"<20200107192044.GL533370@oden.dyn.berto.se>","date":"2020-01-07T19:20:44","subject":"Re: [libcamera-devel] [PATCH 11/14] libcamera: bound_method: Rename\n\tBound*Method to BoundMethod*","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-01-04 07:09:44 +0200, Laurent Pinchart wrote:\n> Most of the bound method classes are named with a BoundMethod prefix,\n> except for BoundMemberMethod and BoundStaticMethod. Rename them to\n> BoundMethodMember and BoundMethodStatic respectively to make the code\n> more coherent.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  Documentation/Doxyfile.in        |  6 +++---\n>  include/libcamera/bound_method.h | 12 ++++++------\n>  include/libcamera/object.h       |  2 +-\n>  include/libcamera/signal.h       | 12 ++++++------\n>  4 files changed, 16 insertions(+), 16 deletions(-)\n> \n> diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in\n> index 5ae8773bd3ad..8e6fbdbb92b6 100644\n> --- a/Documentation/Doxyfile.in\n> +++ b/Documentation/Doxyfile.in\n> @@ -870,12 +870,12 @@ EXCLUDE_PATTERNS       =\n>  # Note that the wildcards are matched against the file with absolute path, so to\n>  # exclude all test directories use the pattern */test/*\n>  \n> -EXCLUDE_SYMBOLS        = libcamera::BoundMemberMethod \\\n> -                         libcamera::BoundMethodArgs \\\n> +EXCLUDE_SYMBOLS        = libcamera::BoundMethodArgs \\\n>                           libcamera::BoundMethodBase \\\n> +                         libcamera::BoundMethodMember \\\n>                           libcamera::BoundMethodPack \\\n>                           libcamera::BoundMethodPackBase \\\n> -                         libcamera::BoundStaticMethod \\\n> +                         libcamera::BoundMethodStatic \\\n>                           libcamera::SignalBase \\\n>                           std::*\n>  \n> diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h\n> index 0a91f44a2054..ca501493bce2 100644\n> --- a/include/libcamera/bound_method.h\n> +++ b/include/libcamera/bound_method.h\n> @@ -156,12 +156,12 @@ public:\n>  };\n>  \n>  template<typename T, typename R, typename... Args>\n> -class BoundMemberMethod : public BoundMethodArgs<R, Args...>\n> +class BoundMethodMember : public BoundMethodArgs<R, Args...>\n>  {\n>  public:\n>  \tusing PackType = typename BoundMethodArgs<R, Args...>::PackType;\n>  \n> -\tBoundMemberMethod(T *obj, Object *object, R (T::*func)(Args...),\n> +\tBoundMethodMember(T *obj, Object *object, R (T::*func)(Args...),\n>  \t\t\t  ConnectionType type = ConnectionTypeAuto)\n>  \t\t: BoundMethodArgs<R, Args...>(obj, object, type), func_(func)\n>  \t{\n> @@ -189,12 +189,12 @@ private:\n>  };\n>  \n>  template<typename T, typename... Args>\n> -class BoundMemberMethod<T, void, Args...> : public BoundMethodArgs<void, Args...>\n> +class BoundMethodMember<T, void, Args...> : public BoundMethodArgs<void, Args...>\n>  {\n>  public:\n>  \tusing PackType = typename BoundMethodArgs<void *, Args...>::PackType;\n>  \n> -\tBoundMemberMethod(T *obj, Object *object, void (T::*func)(Args...),\n> +\tBoundMethodMember(T *obj, Object *object, void (T::*func)(Args...),\n>  \t\t\t  ConnectionType type = ConnectionTypeAuto)\n>  \t\t: BoundMethodArgs<void, Args...>(obj, object, type), func_(func)\n>  \t{\n> @@ -221,10 +221,10 @@ private:\n>  };\n>  \n>  template<typename R, typename... Args>\n> -class BoundStaticMethod : public BoundMethodArgs<R, Args...>\n> +class BoundMethodStatic : public BoundMethodArgs<R, Args...>\n>  {\n>  public:\n> -\tBoundStaticMethod(R (*func)(Args...))\n> +\tBoundMethodStatic(R (*func)(Args...))\n>  \t\t: BoundMethodArgs<R, Args...>(nullptr, nullptr, ConnectionTypeAuto),\n>  \t\t  func_(func)\n>  \t{\n> diff --git a/include/libcamera/object.h b/include/libcamera/object.h\n> index 04aa18394d55..9344af30bc79 100644\n> --- a/include/libcamera/object.h\n> +++ b/include/libcamera/object.h\n> @@ -35,7 +35,7 @@ public:\n>  \t\t       Args... args)\n>  \t{\n>  \t\tT *obj = static_cast<T *>(this);\n> -\t\tauto *method = new BoundMemberMethod<T, R, FuncArgs...>(obj, this, func, type);\n> +\t\tauto *method = new BoundMethodMember<T, R, FuncArgs...>(obj, this, func, type);\n>  \t\treturn method->activate(args..., true);\n>  \t}\n>  \n> diff --git a/include/libcamera/signal.h b/include/libcamera/signal.h\n> index 7fbe5a2c528f..432d95d0ed1c 100644\n> --- a/include/libcamera/signal.h\n> +++ b/include/libcamera/signal.h\n> @@ -60,7 +60,7 @@ public:\n>  \t{\n>  \t\tObject *object = static_cast<Object *>(obj);\n>  \t\tobject->connect(this);\n> -\t\tslots_.push_back(new BoundMemberMethod<T, void, Args...>(obj, object, func, type));\n> +\t\tslots_.push_back(new BoundMethodMember<T, void, Args...>(obj, object, func, type));\n>  \t}\n>  \n>  \ttemplate<typename T, typename R, typename std::enable_if<!std::is_base_of<Object, T>::value>::type * = nullptr>\n> @@ -69,13 +69,13 @@ public:\n>  #endif\n>  \tvoid connect(T *obj, R (T::*func)(Args...))\n>  \t{\n> -\t\tslots_.push_back(new BoundMemberMethod<T, R, Args...>(obj, nullptr, func));\n> +\t\tslots_.push_back(new BoundMethodMember<T, R, Args...>(obj, nullptr, func));\n>  \t}\n>  \n>  \ttemplate<typename R>\n>  \tvoid connect(R (*func)(Args...))\n>  \t{\n> -\t\tslots_.push_back(new BoundStaticMethod<R, Args...>(func));\n> +\t\tslots_.push_back(new BoundMethodStatic<R, Args...>(func));\n>  \t}\n>  \n>  \tvoid disconnect()\n> @@ -100,11 +100,11 @@ public:\n>  \t\t\t/*\n>  \t\t\t * If the object matches the slot, the slot is\n>  \t\t\t * guaranteed to be a member slot, so we can safely\n> -\t\t\t * cast it to BoundMemberMethod<T, Args...> to match\n> +\t\t\t * cast it to BoundMethodMember<T, Args...> to match\n>  \t\t\t * func.\n>  \t\t\t */\n>  \t\t\tif (slot->match(obj) &&\n> -\t\t\t    static_cast<BoundMemberMethod<T, R, Args...> *>(slot)->match(func)) {\n> +\t\t\t    static_cast<BoundMethodMember<T, R, Args...> *>(slot)->match(func)) {\n>  \t\t\t\titer = slots_.erase(iter);\n>  \t\t\t\tdelete slot;\n>  \t\t\t} else {\n> @@ -119,7 +119,7 @@ public:\n>  \t\tfor (auto iter = slots_.begin(); iter != slots_.end(); ) {\n>  \t\t\tBoundMethodArgs<R, Args...> *slot = *iter;\n>  \t\t\tif (slot->match(nullptr) &&\n> -\t\t\t    static_cast<BoundStaticMethod<R, Args...> *>(slot)->match(func)) {\n> +\t\t\t    static_cast<BoundMethodStatic<R, Args...> *>(slot)->match(func)) {\n>  \t\t\t\titer = slots_.erase(iter);\n>  \t\t\t\tdelete slot;\n>  \t\t\t} else {\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x143.google.com (mail-lf1-x143.google.com\n\t[IPv6:2a00:1450:4864:20::143])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9FA666063B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Jan 2020 20:20:45 +0100 (CET)","by mail-lf1-x143.google.com with SMTP id v201so540207lfa.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 07 Jan 2020 11:20:45 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tu16sm229914ljo.22.2020.01.07.11.20.44\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 07 Jan 2020 11:20:44 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=buczOpOY8FjdSc6dKnSj1E56QoOGqvEN1lAfnCCWx74=;\n\tb=VdFEb+j2xoKFmPpeGThKjUQtnzlC3VfF9roOQA/oYnsnge4Bwg3Cg0QqN2snMvcdvt\n\th/+AzaZea0EzrzgUs7yKbA9qlAM5ujx9HETg6ivN0mBvgVSG0shcDZVOl2/ecu50lhGd\n\t6k4PpovcX7MzLAPK0rN1877BtZ1mC/IDL+fBaL5D3Gzsu/8eK1bx7jRsQuYgyoODnafP\n\tR/6QDC6Pvf5jbN0AssSBw1dCRO/Bh/xfrRoIHp6bAUJZVbVuVtn+86NDa9OUk3NJBtuA\n\tVnuY5mZ/fPgCw5AyAYETN8EemlSCBWv0rNf/dKvT07xYG+Uh+MnRq4BIdKetvgaWKmaM\n\t7xFg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=buczOpOY8FjdSc6dKnSj1E56QoOGqvEN1lAfnCCWx74=;\n\tb=VlKXm3ERP8m/ve4D1YZvywkMF0jYEkJlRknitFa/fGKhHt7emlEY54DDyUjU9GQTIS\n\tj6LSgja/g8Ky6B2tqhYvpICSl7GG3SGj6HMxhqN63cc9Zn+Z4D4NktLKW5TYbvFmraSe\n\tT5+iMrRsFlPUMZA0thOz/l89rv7wG8HiTxc71p7bBuiAAjF1JWOyuWSeKkLnnk4mZSNm\n\tWtOXMQ4K6rcQEI+dzIJtIUNhJqXs5kTkawVs47wDQbWXMgeeCCY2guAGYS9loGlRtyjA\n\txeOBDuo2g5KOfF9MzepZ53FbqLfYUpnRyt7AIPbsbHbbmnWpaJ+VQr5+qMCMXMY/Dq00\n\t5vwQ==","X-Gm-Message-State":"APjAAAXE41lZQGazW41aUqg1GtdYs0SWcQgjSxyArLMHl0i92KXZnobL\n\tmK0kqxMBlShYu4RWF2S4cObBWUWxNTNJ3Q==","X-Google-Smtp-Source":"APXvYqxbdm7gwxFykVJEd0H13031KQge4+JLQk7LCC1YRgQru4uIGxlzO9o/toZb+vDFFoJgQa9cXg==","X-Received":"by 2002:a19:f00d:: with SMTP id p13mr602346lfc.37.1578424845009; \n\tTue, 07 Jan 2020 11:20:45 -0800 (PST)","Date":"Tue, 7 Jan 2020 20:20:44 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200107192044.GL533370@oden.dyn.berto.se>","References":"<20200104050947.7673-1-laurent.pinchart@ideasonboard.com>\n\t<20200104050947.7673-12-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200104050947.7673-12-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 11/14] libcamera: bound_method: Rename\n\tBound*Method to BoundMethod*","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 07 Jan 2020 19:20:45 -0000"}}]