Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: webrtc/base/sigslottester.h.pump

Issue 2066443003: Add SigslotTester0 for testing signals without argument. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/sigslottester.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/sigslottester.h.pump
diff --git a/webrtc/base/sigslottester.h.pump b/webrtc/base/sigslottester.h.pump
index 4410991d9e16e8a34ab4afc2ff1936ac8b44cdfc..27cd6541ccebe7277b86c3c78c629307358a2ac0 100755
--- a/webrtc/base/sigslottester.h.pump
+++ b/webrtc/base/sigslottester.h.pump
@@ -40,7 +40,24 @@
namespace rtc {
-// For all the templates below:
+// Base version for testing signals that passes no arguments.
+class SigslotTester0 : public sigslot::has_slots<> {
+ public:
+ explicit SigslotTester0(sigslot::signal0<>* signal) : callback_count_(0) {
+ signal->connect(this, &SigslotTester0::OnSignalCallback);
+ }
+
+ int callback_count() const { return callback_count_; }
+
+ private:
+ void OnSignalCallback() { callback_count_++; }
+ int callback_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(SigslotTester0);
+};
+
+// Versions below are for testing signals that pass arguments. For all the
+// templates below:
// - A1-A5 is the type of the argument i in the callback. Signals may and often
// do use const-references here for efficiency.
// - C1-C5 is the type of the variable to capture argument i. These should be
« no previous file with comments | « webrtc/base/sigslottester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698