thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashoksavi...@comcast.net
Subject generating custom container types in Thrift
Date Mon, 17 Dec 2012 23:58:01 GMT
Hi 
The 'list' type in the Thrift IDL automatically maps to the std::vector class. I'd like to
have 'list' map to my custom container class for std::vector, namely Vector. The following
page seems to indicate that this is indeed possible within Thrift: 

----------------------------------------------------- 
http://thrift.apache.org/docs/types/ 

While defaults are provided, the type mappings are not explicitly fixed. 
Custom code generator directives have been added to allow substitution 
of custom types in various destination languages. 
----------------------------------------------------- 

The following grammar in the IDL page shows one potential way to do this: 

----------------------------------------------------- 
http://thrift.apache.org/docs/idl/ 
[29] ListType ::= 'list' '<' FieldType '>' CppType? 

[30] CppType ::= 'cpp_type' Literal 
----------------------------------------------------- 

However, I've read on a couple of other pages that 'cpp_type' is not supported. Could someone
please verify whether or not it is possible to have Thrift generate the list->Vector mapping
that I am interested in? If it is possible, is 'cpp_type' the correct directive to use? 

Thank you 
Ashok 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message