From patchwork Sat Jan 4 05:09:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2507 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9736D6061C for ; Sat, 4 Jan 2020 06:10:06 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 40566A49 for ; Sat, 4 Jan 2020 06:10:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1578114606; bh=WQ8oKGiEHxLEe6inw2XBqzTx7rvBSKWenfsUDa1pBQk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TJlZGPlVJxch2nMrJGFSGRGhlvHOdwbqf6IKqfnWKf5cqiD4/M1d6PYriUJyjaQnk isdpCWAvRAeV7Kjh59+42+9K9ozPG1btblb+7SRnG1wnSxCWNzzRsxIzYPK5Gr4McI 5aLKct8NmcSaCBbjJ8DDCyWlUY+iXiK/2N8tNkfo= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jan 2020 07:09:44 +0200 Message-Id: <20200104050947.7673-12-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200104050947.7673-1-laurent.pinchart@ideasonboard.com> References: <20200104050947.7673-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 11/14] libcamera: bound_method: Rename Bound*Method to BoundMethod* X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jan 2020 05:10:08 -0000 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 Reviewed-by: Niklas Söderlund --- 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 -class BoundMemberMethod : public BoundMethodArgs +class BoundMethodMember : public BoundMethodArgs { public: using PackType = typename BoundMethodArgs::PackType; - BoundMemberMethod(T *obj, Object *object, R (T::*func)(Args...), + BoundMethodMember(T *obj, Object *object, R (T::*func)(Args...), ConnectionType type = ConnectionTypeAuto) : BoundMethodArgs(obj, object, type), func_(func) { @@ -189,12 +189,12 @@ private: }; template -class BoundMemberMethod : public BoundMethodArgs +class BoundMethodMember : public BoundMethodArgs { public: using PackType = typename BoundMethodArgs::PackType; - BoundMemberMethod(T *obj, Object *object, void (T::*func)(Args...), + BoundMethodMember(T *obj, Object *object, void (T::*func)(Args...), ConnectionType type = ConnectionTypeAuto) : BoundMethodArgs(obj, object, type), func_(func) { @@ -221,10 +221,10 @@ private: }; template -class BoundStaticMethod : public BoundMethodArgs +class BoundMethodStatic : public BoundMethodArgs { public: - BoundStaticMethod(R (*func)(Args...)) + BoundMethodStatic(R (*func)(Args...)) : BoundMethodArgs(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(this); - auto *method = new BoundMemberMethod(obj, this, func, type); + auto *method = new BoundMethodMember(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(obj); object->connect(this); - slots_.push_back(new BoundMemberMethod(obj, object, func, type)); + slots_.push_back(new BoundMethodMember(obj, object, func, type)); } template::value>::type * = nullptr> @@ -69,13 +69,13 @@ public: #endif void connect(T *obj, R (T::*func)(Args...)) { - slots_.push_back(new BoundMemberMethod(obj, nullptr, func)); + slots_.push_back(new BoundMethodMember(obj, nullptr, func)); } template void connect(R (*func)(Args...)) { - slots_.push_back(new BoundStaticMethod(func)); + slots_.push_back(new BoundMethodStatic(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 to match + * cast it to BoundMethodMember to match * func. */ if (slot->match(obj) && - static_cast *>(slot)->match(func)) { + static_cast *>(slot)->match(func)) { iter = slots_.erase(iter); delete slot; } else { @@ -119,7 +119,7 @@ public: for (auto iter = slots_.begin(); iter != slots_.end(); ) { BoundMethodArgs *slot = *iter; if (slot->match(nullptr) && - static_cast *>(slot)->match(func)) { + static_cast *>(slot)->match(func)) { iter = slots_.erase(iter); delete slot; } else {