templates.thrift_cpp.include.interface_cast.body.vm Maven / Gradle / Ivy
#parse("thrift_cpp/include/cxx_schema_include.vm")
#parse("thrift_cpp/include/cxx.helper.vm")
#set( $output_basename = "${interfaceName}_cast")
#set( $output_filename = "${output_basename}.${source_type}")
## 当前代码名字空间
#set($source_namespace = "net.gdface.utils")
$codewriter.setCurrentCxxFilename($output_filename)
#define($use_pointer)#if(!$cxxType.primitive)*#end#end
## 返回正确的thrift 类型
#define($native_type)${cxxType.stubType.type}#end
##### thrift stub类型字段有效性检查 #########################
#define($stub_issetcheck)
#if(${cxxType.enum} && !${type.isRequired($name)})if(left.__isset.$name)##
#elseif(!${cxxType.enum} && !${cxxType.primitive})if(left.__isset.$name)##
#end
#end###define($stub_issetcheck)
##### UI type类型字段有效性检查 #########################
#define($ui_issetcheck)
#if(${cxxType.enum} && !${type.isRequired($name)})if(left.__get_${name}())##
#elseif(!${cxxType.enum} && !${cxxType.primitive})if(left.__get_${name}())##
#end
#end###define($ui_issetcheck)
######################################
$header_begin
/**
* $interfaceName 接口数据类型转换定义(C++11)
* C++11 compiler or VS2015 or above required
* $GENERAED_BY
*/
#if( $source_type == "cpp" )
\#include "${output_basename}.h"
using namespace ${cxxhelper.cxxNamespace($source_namespace,true)};
#if($schemainfo.sql2java4x)
\#include "common_utilits.h"
using namespace ::gdface;
#end
#else
\#include
\#include
\#include
\#include
\#include
\#include
\#include
\#include
© 2015 - 2025 Weber Informatics LLC | Privacy Policy