| Xlight API用户手册 v1.6.0.23 Xlight极速柜台接口文档

载入中...
搜索中...
未找到
xlt_privilege_api.h
浏览该文件的文档.
1#pragma once
2
3#include "xlt_trade_api.h"
4#include "xlt_privilege_struct.h"
5#include "xlt_privilege_config.h"
6#include "xlt_privilege_list.h"
7
8 namespace x1 {
12 class XLTPrivilegeSpi : public XLTTradeSpi {
13 public:
14 ~XLTPrivilegeSpi() override = default;
15
22 virtual void on_token(uint64_t session_id, const xlt_msg_desc_t* msg_desc, const xlt_internal_token_info_t* token) {};
23
30 virtual void on_quote_login_info(uint64_t session_id, const xlt_msg_desc_t* msg_desc, const xlt_internal_quote_login_info_t* quote_login_info) {};
38 virtual void on_fund_transfer_exec_result(uint64_t session_id, const xlt_msg_desc_t* msg_desc, const xlt_fund_transfer_exec_result_t* fund_transfer_exec_result) {};
46 virtual void on_dump_final_file(uint64_t session_id, uint64_t request_id, bool success, const xlt_error_info_t* error_info) {};
47
55 virtual void on_unbind_user_tgw(uint64_t session_id, uint64_t request_id, uint64_t account_index, const xlt_error_info_t* error_info) {};
64 virtual void on_query_brief_assets(uint64_t session_id, uint64_t request_id, const XLTBriefAssetList* brief_assets, bool is_last, const xlt_error_info_t* error_info) {};
73 virtual void on_query_brief_positions(uint64_t session_id, uint64_t request_id, const XLTBriefPositionList* brief_positions, bool is_last, const xlt_error_info_t* error_info) {};
74 };
75
76
80 class XLTPrivilege: public XLTTradeApi {
81 public:
86 static XLTPrivilege* create();
92 static uint64_t xid_to_token_id(uint64_t xid);
99 bool initialize(XLTPrivilegeConfig* config, XLTPrivilegeSpi* spi);
105 void stop();
114 bool login(uint64_t request_id, const char* account_name, const char* password, const char* pub_key);
121 bool dump_final_file(uint64_t session_id, uint64_t request_id);
129 bool unbind_user_tgw(uint64_t session_id, uint64_t request_id, uint64_t account_index);
137 bool insert_fund_transfer_exec(uint64_t session_id, uint64_t request_id, const xlt_fund_transfer_exec_request_t* fund_transfer_exec_req);
145 bool submit_counter_fund_transfer_request(uint64_t session_id, uint64_t request_id, const xlt_counter_fund_transfer_request_t* fund_transfer_request);
153 bool submit_counter_fund_transfer_result(uint64_t session_id, uint64_t request_id, const xlt_counter_fund_transfer_result_t* fund_transfer_result);
161 bool submit_cluster_fund_transfer_request(uint64_t session_id, uint64_t request_id, const xlt_cluster_fund_transfer_request_t* cluster_fund_transfer_request);
169 bool submit_cluster_fund_transfer_result(uint64_t session_id, uint64_t request_id, const xlt_cluster_fund_transfer_result_t* cluster_fund_transfer_result);
177 bool query_brief_assets(uint64_t session_id, uint64_t request_id, uint64_t account_index = 0);
188 bool query_brief_positions(uint64_t session_id, uint64_t request_id, const char* security_code, ExchangeIndex exchange_index, uint64_t account_index = 0);
189 private:
190 XLTPrivilege() = default;
191 };
192}
x1::XLTBriefAssetList
只读简要资金信息列表
定义 xlt_privilege_list.h:76
x1::XLTBriefPositionList
只读简要持仓信息列表
定义 xlt_privilege_list.h:87
x1::XLTPrivilegeConfig
定义 xlt_privilege_config.h:8
x1::XLTPrivilegeSpi
管理接口回调类
定义 xlt_privilege_api.h:12
x1::XLTPrivilegeSpi::on_dump_final_file
virtual void on_dump_final_file(uint64_t session_id, uint64_t request_id, bool success, const xlt_error_info_t *error_info)
导出下场文件响应
定义 xlt_privilege_api.h:46
x1::XLTPrivilegeSpi::~XLTPrivilegeSpi
~XLTPrivilegeSpi() override=default
x1::XLTPrivilegeSpi::on_fund_transfer_exec_result
virtual void on_fund_transfer_exec_result(uint64_t session_id, const xlt_msg_desc_t *msg_desc, const xlt_fund_transfer_exec_result_t *fund_transfer_exec_result)
资金划转执行结果回调 subscribe_trade_message或rebuild_trade_message指定任意消息类型时，交易系统会在账户资金发生变动时推送该通知。
定义 xlt_privilege_api.h:38
x1::XLTPrivilegeSpi::on_query_brief_positions
virtual void on_query_brief_positions(uint64_t session_id, uint64_t request_id, const XLTBriefPositionList *brief_positions, bool is_last, const xlt_error_info_t *error_info)
简要持仓查询响应
定义 xlt_privilege_api.h:73
x1::XLTPrivilegeSpi::on_token
virtual void on_token(uint64_t session_id, const xlt_msg_desc_t *msg_desc, const xlt_internal_token_info_t *token)
token信息推送
定义 xlt_privilege_api.h:22
x1::XLTPrivilegeSpi::on_quote_login_info
virtual void on_quote_login_info(uint64_t session_id, const xlt_msg_desc_t *msg_desc, const xlt_internal_quote_login_info_t *quote_login_info)
行情登录信息推送
定义 xlt_privilege_api.h:30
x1::XLTPrivilegeSpi::on_unbind_user_tgw
virtual void on_unbind_user_tgw(uint64_t session_id, uint64_t request_id, uint64_t account_index, const xlt_error_info_t *error_info)
解绑用户与交易网关的绑定关系响应
定义 xlt_privilege_api.h:55
x1::XLTPrivilegeSpi::on_query_brief_assets
virtual void on_query_brief_assets(uint64_t session_id, uint64_t request_id, const XLTBriefAssetList *brief_assets, bool is_last, const xlt_error_info_t *error_info)
简要资产查询响应
定义 xlt_privilege_api.h:64
x1::XLTPrivilege
管理接口类
定义 xlt_privilege_api.h:80
x1::XLTPrivilege::query_brief_assets
bool query_brief_assets(uint64_t session_id, uint64_t request_id, uint64_t account_index=0)
请求查询简要资产信息
x1::XLTPrivilege::query_brief_positions
bool query_brief_positions(uint64_t session_id, uint64_t request_id, const char *security_code, ExchangeIndex exchange_index, uint64_t account_index=0)
请求查询简要持仓信息
x1::XLTPrivilege::unbind_user_tgw
bool unbind_user_tgw(uint64_t session_id, uint64_t request_id, uint64_t account_index)
解绑用户与交易网关的绑定关系
x1::XLTPrivilege::submit_cluster_fund_transfer_request
bool submit_cluster_fund_transfer_request(uint64_t session_id, uint64_t request_id, const xlt_cluster_fund_transfer_request_t *cluster_fund_transfer_request)
提交双中心资金划转请求
x1::XLTPrivilege::xid_to_token_id
static uint64_t xid_to_token_id(uint64_t xid)
根据订单ID获取token_id
x1::XLTPrivilege::stop
void stop()
停止特权API 断开所有特权session连接，清空所有session上的回调指针，停止回调。
x1::XLTPrivilege::dump_final_file
bool dump_final_file(uint64_t session_id, uint64_t request_id)
导出下场文件
x1::XLTPrivilege::submit_counter_fund_transfer_result
bool submit_counter_fund_transfer_result(uint64_t session_id, uint64_t request_id, const xlt_counter_fund_transfer_result_t *fund_transfer_result)
提交资金划转结果
x1::XLTPrivilege::insert_fund_transfer_exec
bool insert_fund_transfer_exec(uint64_t session_id, uint64_t request_id, const xlt_fund_transfer_exec_request_t *fund_transfer_exec_req)
插入资金划转执行请求
x1::XLTPrivilege::login
bool login(uint64_t request_id, const char *account_name, const char *password, const char *pub_key)
用户登录请求
x1::XLTPrivilege::submit_cluster_fund_transfer_result
bool submit_cluster_fund_transfer_result(uint64_t session_id, uint64_t request_id, const xlt_cluster_fund_transfer_result_t *cluster_fund_transfer_result)
提交双中心资金划转结果
x1::XLTPrivilege::submit_counter_fund_transfer_request
bool submit_counter_fund_transfer_request(uint64_t session_id, uint64_t request_id, const xlt_counter_fund_transfer_request_t *fund_transfer_request)
提交资金划转请求
x1::XLTPrivilege::initialize
bool initialize(XLTPrivilegeConfig *config, XLTPrivilegeSpi *spi)
初始化API，登录之前必须调用此函数，只能初始化一次
x1::XLTPrivilege::create
static XLTPrivilege * create()
创建实例（只能创建一次）
x1::XLTTradeApi
接口类
定义 xlt_trade_api.h:305
x1::XLTTradeSpi
交易回调类
定义 xlt_trade_api.h:21
x1
定义 xlt_data_type.h:13
x1::ExchangeIndex
ExchangeIndex
交易所编号定义
定义 xlt_data_type.h:57
x1::xlt_cluster_fund_transfer_request_t
双中心资金划转请求
定义 xlt_trade_struct.h:333
x1::xlt_cluster_fund_transfer_result_t
双中心资金划转结果
定义 xlt_trade_struct.h:344
x1::xlt_counter_fund_transfer_request_t
主柜资金划转申请
定义 xlt_trade_struct.h:305
x1::xlt_counter_fund_transfer_result_t
主柜资金划转结果
定义 xlt_trade_struct.h:317
x1::xlt_error_info_t
错误信息
定义 xlt_struct.h:18
x1::xlt_fund_transfer_exec_request_t
资金划转执行请求
定义 xlt_privilege_struct.h:69
x1::xlt_fund_transfer_exec_result_t
资金划转执行结果
定义 xlt_privilege_struct.h:81
x1::xlt_internal_quote_login_info_t
行情登陆流水信息
定义 xlt_privilege_struct.h:34
x1::xlt_internal_token_info_t
token信息
定义 xlt_privilege_struct.h:18
x1::xlt_msg_desc_t
消息推送描述信息
定义 xlt_trade_struct.h:64
xlt_privilege_config.h
xlt_privilege_list.h
xlt_privilege_struct.h
本文件定义XLT特权数据结构体
xlt_trade_api.h
本接口定义XLT的主要接口类，包括交易回调接口类。