Change-Id: I326e1e7900fd5d7ff4dcf525a8c353c195f293da
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
{"double", "double"},
{"bundle", "bundle"},
};
+
+ type_init_map_ = {
+ {"char", "0"},
+ {"int", "0"},
+ {"short", "0"},
+ {"long", "0"},
+ {"bool", "false"},
+ {"float", "0.0f"},
+ {"double", "0.0"},
+ };
}
void CppGeneratorBase::GenStructuresForHeader(std::ofstream& stream) {
[&]()->std::string {
std::string str;
for (auto& i : st.GetElements().GetElms()) {
- str += NLine(1) + Tab(1)
- + ConvertTypeToString(i->GetType()) + " "
- + i->GetID() + "_;";
+ str += NLine(1) + Tab(1)
+ + ConvertTypeToString(i->GetType()) + " "
+ + i->GetID() + "_";
+ if (type_init_map_.find(i->GetType().ToString())
+ == type_init_map_.end()) {
+ str += ";";
+ } else {
+ str += " = " + type_init_map_[i->GetType().ToString()] + ";";
+ }
}
str += NLine(1);
return str;
private:
std::map<std::string, std::string> type_map_;
std::map<std::string, std::string> parcel_type_map_;
+ std::map<std::string, std::string> type_init_map_;
std::map<std::string, const BaseType*> serializer_list_;
};