Thrift compiler now compiles both native Java and C++ code
Summary: Compiles to both C++ and Java, plus a host of other cool options like command line control over which languages to output code in
Reviewed By: aditya
Test Plan: The unit test checkins are coming momentarily...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664713 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/src/parse/t_field.h b/compiler/src/parse/t_field.h
index 304bb16..fc38456 100644
--- a/compiler/src/parse/t_field.h
+++ b/compiler/src/parse/t_field.h
@@ -11,6 +11,9 @@
*/
class t_field {
public:
+ t_field(t_type* type, std::string name) :
+ type_(type), name_(name), key_(0) {}
+
t_field(t_type* type, std::string name, uint32_t key) :
type_(type), name_(name), key_(key) {}
diff --git a/compiler/src/parse/t_function.h b/compiler/src/parse/t_function.h
index 1caf54a..b248db7 100644
--- a/compiler/src/parse/t_function.h
+++ b/compiler/src/parse/t_function.h
@@ -19,29 +19,10 @@
~t_function() {}
- /**
- * Implementation of the Fowler / Noll / Vo (FNV) Hash
- * http://www.isthe.com/chongo/tech/comp/fnv/
- */
- static uint32_t fnv32(const char *s) {
- uint32_t hash = (uint32_t)216613626;
- while (*s) {
- hash +=
- (hash << 1) +
- (hash << 4) +
- (hash << 7) +
- (hash << 8) +
- (hash << 24);
- hash ^= *s++;
- }
- return hash;
- }
-
t_type* get_returntype() const { return returntype_; }
const std::string& get_name() const { return name_; }
t_struct* get_arglist() const { return arglist_; }
- uint32_t get_hash() const { return fnv32(name_.c_str()); }
-
+
private:
t_type* returntype_;
std::string name_;
diff --git a/compiler/src/parse/t_struct.h b/compiler/src/parse/t_struct.h
index 38eb750..6e87c8c 100644
--- a/compiler/src/parse/t_struct.h
+++ b/compiler/src/parse/t_struct.h
@@ -10,6 +10,8 @@
class t_struct : public t_type {
public:
t_struct() {}
+ t_struct(const std::string& name) : t_type(name) {}
+
~t_struct() {}
/** Set the struct name */