Add operator<< for printing some dispatcher structs
When working on dispatcher code, it's very convenient to be able to
quickly print some of the dispatcher structs, like TouchState,
TouchedWindow, etc. Add operator<< to some of these structs in this CL.
This removes the need to memorize the specific function that needs to be
called, like "dump", "getDescription", etc.
Bug: 211379801
Test: none
Change-Id: I663b217a3449daa34476ac6f28f188cdf0618278
diff --git a/services/inputflinger/dispatcher/TouchState.h b/services/inputflinger/dispatcher/TouchState.h
index 39e63e5..f016936 100644
--- a/services/inputflinger/dispatcher/TouchState.h
+++ b/services/inputflinger/dispatcher/TouchState.h
@@ -17,6 +17,7 @@
#pragma once
#include <bitset>
+#include <ostream>
#include <set>
#include "TouchedWindow.h"
@@ -79,5 +80,7 @@
std::string dump() const;
};
+std::ostream& operator<<(std::ostream& out, const TouchState& state);
+
} // namespace inputdispatcher
} // namespace android