thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject generating custom container types in Thrift
Date Mon, 17 Dec 2012 23:58:01 GMT
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: 


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: 

[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 

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