Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 874 Bytes

code-cpp.asciidoc

File metadata and controls

34 lines (29 loc) · 874 Bytes

Generated Files

  • all constants go into a single .cpp/.h pair

  • all type definitions (enums and structs) go into another .cpp/.h pair

  • each service gets its own .cpp/.h pair

$ tree gen-cpp
|-- example_constants.cpp
|-- example_constants.h
|-- example_types.cpp
|-- example_types.h
|-- Twitter.cpp
|-- Twitter.h
`-- Twitter_server.skeleton.cpp

Types

Thrift maps the various base and container types to C++ types as follows:

  • bool: bool

  • binary: std::string

  • byte: int8_t

  • i16: int16_t

  • i32: int32_t

  • i64: int64_t

  • double: double

  • string: std::string

  • list<t1>: std::vector<t1>

  • set<t1>: std::set<t1>

  • map<t1,t2>: std::map<T1, T2>