Rev 2 of Thrift, the Pillar successor
Summary: End-to-end communications and serialization in C++ is working
Reviewed By: aditya
Test Plan: See the new top-level test/ folder. It vaguely resembles a unit test, though it could be more automated.
Revert Plan: Revertible
Notes: Still a LOT of optimization work to be done on the generated C++ code, which should be using dynamic memory in a number of places. Next major task is writing the PHP/Java/Python generators.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664712 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/src/parse/t_struct.h b/compiler/src/parse/t_struct.h
index fcc00e7..38eb750 100644
--- a/compiler/src/parse/t_struct.h
+++ b/compiler/src/parse/t_struct.h
@@ -5,19 +5,24 @@
#include <string>
#include "t_type.h"
-#include "t_list.h"
+#include "t_field.h"
class t_struct : public t_type {
public:
- t_struct(std::string name, t_list* members) :
- t_type(name), members_(members) {}
+ t_struct() {}
~t_struct() {}
- t_list* get_members() { return members_; }
- bool is_struct() { return true; }
+ /** Set the struct name */
+ void set_name(const std::string& name) { name_ = name; }
+
+ /** Add a new field to the list */
+ void append(t_field* elem) { members_.push_back(elem); }
+
+ const std::vector<t_field*>& get_members() { return members_; }
+ bool is_struct() const { return true; }
private:
- t_list* members_;
+ std::vector<t_field*> members_;
};
#endif