Document FlattenableHelper design decision
Change-Id: I163979c7b1b868e4396a9c70b262d0c4815f4e40
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h
index 954b976..39deb64 100644
--- a/include/binder/Parcel.h
+++ b/include/binder/Parcel.h
@@ -479,6 +479,8 @@
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
+ // FlattenableHelperInterface and FlattenableHelper avoid generating a vtable entry in objects
+ // following Flattenable template/protocol.
class FlattenableHelperInterface {
protected:
~FlattenableHelperInterface() { }
@@ -493,6 +495,9 @@
#pragma clang diagnostic pop
#endif
+ // Concrete implementation of FlattenableHelperInterface that delegates virtual calls to the
+ // specified class T implementing the Flattenable protocol. It "virtualizes" a compile-time
+ // protocol.
template<typename T>
class FlattenableHelper : public FlattenableHelperInterface {
friend class Parcel;