Allow the specification of custom container types in Thrift IDL files
authorMark Slee <mcslee@apache.org>
Thu, 12 Oct 2006 02:47:27 +0000 (02:47 +0000)
committerMark Slee <mcslee@apache.org>
Thu, 12 Oct 2006 02:47:27 +0000 (02:47 +0000)
commit4f8da1dfb4dc857265506e0c865fe3d9c7cdf771
tree21a9636f18c2fe3ff0cdd5fa721ab95a98f4b639
parent3950f47d6fd95ddc7e0df4563a6a53c348a7b784
Allow the specification of custom container types in Thrift IDL files

Summary: If you want your map to be a hash_map instead of an stl::map, we now have a directive in Thrift to let you do that.

Instead of:
map<i32,i32>

You can do:
map[cpp:hash_map<int32_t,int32_t>]<i32,i32>

This tells the Thrift compiler to explicitly use whatever type was specified in the brackets when generating C++ code, instead of the implied Thrift type.

Reviewed By: aditya

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664828 13f79535-47bb-0310-9956-ffa450edef68
compiler/cpp/src/generate/t_cpp_generator.cc
compiler/cpp/src/parse/t_container.h [new file with mode: 0644]
compiler/cpp/src/parse/t_list.h
compiler/cpp/src/parse/t_map.h
compiler/cpp/src/parse/t_set.h
compiler/cpp/src/parse/t_type.h
compiler/cpp/src/thrift.l
compiler/cpp/src/thrift.y