All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.thrift_cpp.erpc_proxy.schema.interface_constant.h.vm Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
#parse("thrift_cpp/include/cxx_schema_include.vm")
#parse("thrift_cpp/include/service_decorator.include.vm")
#parse("thrift_cpp/include/cxx.helper.vm")
#set( $output_filename = "${schemainfo.programName}_constant.h")
#set( $serviceMetadata = ${sourceinfo.thriftServiceMetadata})
$codewriter.setCurrentCxxFilename($output_filename)
/**
 * ${schemainfo.programName} 服务全局常量定义 
* $GENERAED_BY
*/ #ifndef BINARY_OUTPUT_SIZE // used by erpc_list_cast.hpp,for output binary \#define BINARY_OUTPUT_SIZE $schemainfo.binaryOutputSize #endif /** BINARY_OUTPUT_SIZE */ // default value for annotation @max_length #ifndef ERRMSG_MAX_LENGTH \#define ERRMSG_MAX_LENGTH $schemainfo.errmsgMaxLength #endif /** ERRMSG_MAX_LENGTH */ // max length for output error message buffer of each service port #ifndef DEFAULT_MAX_LENGTH \#define DEFAULT_MAX_LENGTH $schemainfo.defaultMaxLength #endif /** DEFAULT_MAX_LENGTH */ #ifndef _EXISTS_LIST_STRING \#define _EXISTS_LIST_STRING ${schemainfo.existsListString} #endif /** _EXISTS_LIST_STRING */ #ifndef _EXISTS_LIST_BINARY \#define _EXISTS_LIST_BINARY ${schemainfo.existsListBinary} #endif /** _EXISTS_LIST_BINARY */ #ifndef _USE_STRING #if($schemainfo.useStringInServices || $schemainfo.useStringInTypes) \#define _USE_STRING 1 #else \#define _USE_STRING 0 #end #endif /** _USE_STRING */ #ifndef _USE_BINARY #if($schemainfo.useBinaryInServices || $schemainfo.useBinaryInTypes) \#define _USE_BINARY 1 #else \#define _USE_BINARY 0 #end #endif /** _USE_BINARY */ ////////////////define constant for types///////////////////// #foreach($entry in $structGenseqMap.entries()) #foreach($type in $entry.value) #if($type.bean) #if(${schemainfo.isThriftStruct($type.baseClass)}) #set($thriftTypeMetadata = ${schemainfo.getThriftStructMetadata($type.baseClass)}) #elseif(${schemainfo.isDecoratorType($type.baseClass)}) #set($thriftTypeMetadata = ${schemainfo.getThriftStructMetadata($type.decoratorClassName)}) #end #foreach($name in $type.fields) #set($field = ${type.getField($name)}) #set($fieldMetadata = ${thriftTypeMetadata.getField($name)}) #if($fieldMetadata.erpcType.protocolType.string && $type.lengthLimitOf($field)) #set($max_size_macro_name = "${type.baseClass.simpleName}_${name}_MAX_SIZE" ) #ifndef $max_size_macro_name \#define $max_size_macro_name $type.lengthLimitOf($field) #endif /** $max_size_macro_name */ #end###if($fieldMetadata.erpcType.protocolType.string && $type.lengthLimitOf($field)) #if(${type.invalidValueOf($field)}) #set($invalid_value_macro_name = "${type.baseClass.simpleName}_${name}_INVALID" ) #set($invalidValue = ${type.invalidValueOf($field)}) #ifndef $invalid_value_macro_name #if(${fieldMetadata.erpcType.protocolType.string} || ${fieldMetadata.erpcType.protocolType.binary}) \#define $invalid_value_macro_name "$invalidValue" #else \#define $invalid_value_macro_name $invalidValue #end #endif /** $invalid_value_macro_name */ #end###if(${type.invalidValueOf($field)}) #end##foreach name #end###if($type.bean) #end##foreach($type) #end##foreach($entry)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy