gitee.com/haifengat/gotap_dipper@v0.0.4-0.20231212021028-041a6fa876e5/generate/trade.h.tpl (about)

     1  #pragma once
     2  #ifdef _WINDOWS  //64位系统没有预定义 WIN32
     3  #ifdef __cplusplus  // 有定义表示是 c++ 代码, 此值为 ld 类型, 内容为c+标准版本号
     4  #define DLL_EXPORT_C_DECL extern "C" __declspec(dllexport)
     5  #else
     6  #define DLL_EXPORT_DECL __declspec(dllexport)
     7  #endif
     8  #else
     9  #ifdef __cplusplus  // 有定义表示是 c++ 代码, 此值为 ld 类型, 内容为c+标准版本号
    10  #define DLL_EXPORT_C_DECL extern "C"
    11  #else
    12  #define DLL_EXPORT_DECL extern
    13  #endif
    14  #endif
    15  
    16  #include "../v9.3.7.5_20220228/iTapTradeAPI.h"
    17  
    18  #if defined WIN32 || defined WIN64
    19  #define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
    20  #include "stddef.h"
    21  #pragma comment(lib, "../v9.3.7.5_20220228/iTapTradeAPI_64.lib")
    22  #ifdef WIN32
    23  #define WINAPI      __cdecl
    24  #else
    25  #define WINAPI      __stdcall
    26  #endif
    27  #else
    28  #define WINAPI
    29  #endif
    30  
    31  class Trade: public ITapTrade::ITapTradeAPINotify
    32  {
    33  public:
    34      Trade(void);
    35      [[ range .On ]]
    36  	typedef void (WINAPI *[[ .FuncName ]]Type)([[ range $n, $var := .Params ]][[if gt $n 0]], [[end]][[ .Type ]] [[ .Name ]][[ end ]]);
    37  	void *_[[ .FuncName ]];
    38  	virtual void [[ .FuncName ]]([[ range $n, $var := .Params ]][[if gt $n 0]], [[end]][[ .Type ]] [[ .Name ]][[ end ]]){if (_[[ .FuncName ]]) (([[ .FuncName ]]Type)_[[ .FuncName ]])([[ range $n, $var := .Params ]][[if gt $n 0]], [[end]] [[ .Name|trim ]][[ end ]]);}
    39      [[ end ]]
    40  };