Default values and nullification for thrift code
Summary: All things are null now, unless you specify a default value!
Reviewed By: marc
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664963 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/parse/t_field.h b/compiler/cpp/src/parse/t_field.h
index 35414ef..058b9fb 100644
--- a/compiler/cpp/src/parse/t_field.h
+++ b/compiler/cpp/src/parse/t_field.h
@@ -15,12 +15,14 @@
type_(type),
name_(name),
key_(0),
+ value_(NULL),
xsd_optional_(false) {}
t_field(t_type* type, std::string name, int32_t key) :
type_(type),
name_(name),
key_(key),
+ value_(NULL),
xsd_optional_(false) {}
~t_field() {}
@@ -45,10 +47,19 @@
return xsd_optional_;
}
+ void set_value(t_const_value* value) {
+ value_ = value;
+ }
+
+ t_const_value* get_value() {
+ return value_;
+ }
+
private:
t_type* type_;
std::string name_;
int32_t key_;
+ t_const_value* value_;
bool xsd_optional_;