Thrift: Generate structural fingerprints for thrift structs.
Summary:
We are going to write a dense protocol soon that eliminates some metadata.
To prevent version conflicts, we want each structure to have a
structural fingerprint that will change whenever the struct changes
in a way that will affect the dense protocol.
This change computes those fingerprints and puts them in
the generated C++ code.
Reviewed By: aditya, mcslee
Test Plan:
Recompiled thrift.
Thrifted DebugProtoTest with old and new compilers.
Compared output.
Also ran thrift with those "cout"s uncommented,
examined the fingerprint material,
and verified the hashes.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665227 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/parse/t_service.h b/compiler/cpp/src/parse/t_service.h
index c10ee11..f5665b6 100644
--- a/compiler/cpp/src/parse/t_service.h
+++ b/compiler/cpp/src/parse/t_service.h
@@ -43,6 +43,11 @@
return extends_;
}
+ virtual std::string get_fingerprint_material() const {
+ // Services should never be used in fingerprints.
+ throw "BUG: Can't get fingerprint material for service.";
+ }
+
private:
std::vector<t_function*> functions_;
t_service* extends_;