Xlight API用户手册 v1.6.0.23
Xlight极速柜台接口文档
载入中...
搜索中...
未找到
xlt_quote_config.h
浏览该文件的文档.
1
8#pragma once
9
10#include <sys/socket.h>
11#include <cstring>
12#include "xlt_quote_data_type.h"
13
14namespace x1 {
15
21 public:
22 XLTQuoteConfig() = default;
28 void set_trading_day(uint64_t trading_day) { trading_day_ = trading_day; }
36 bool set_local_addr(const char* agw, const char* quote);
44 bool add_agw_addr(const char* ip_addr, uint16_t port);
49 void set_use_level2(bool use_level2) { use_level2_ = use_level2; };
50
51 /*================= 以下为获取配置参数接口,为内部使用 ============*/
56 uint64_t trading_day() const { return trading_day_; }
62 sockaddr get_local_addr(uint64_t index) const;
67 uint64_t agw_count() const { return agw_count_; };
72 sockaddr* agw_addrs() { return agw_addr_; }
77 bool use_level2() const { return use_level2_; };
78
79 private:
80 uint64_t trading_day_ = 0;
81 sockaddr local_addr_[3] = {};
82 uint64_t agw_count_ = 0;
83 sockaddr agw_addr_[32] = {};
84 bool use_level2_ = false;
85 };
86}
API行情配置类 用户需要在调用XLTQuoteApi::initialize方法前,创建此类实例,并设置相应的配置参数,然后将此实例传递给XLTQuoteApi::initialize方法。
定义 xlt_quote_config.h:20
sockaddr get_local_addr(uint64_t index) const
获取指定本地地址
void set_trading_day(uint64_t trading_day)
设置交易日,格式YYYYMMDD,如20230901
定义 xlt_quote_config.h:28
uint64_t trading_day() const
获取交易日,格式YYYYMMDD,如20230901
定义 xlt_quote_config.h:56
void set_use_level2(bool use_level2)
设置是否使用level2行情,默认不使用
定义 xlt_quote_config.h:49
uint64_t agw_count() const
获取agw地址数量
定义 xlt_quote_config.h:67
sockaddr * agw_addrs()
获取指定agw地址列表
定义 xlt_quote_config.h:72
XLTQuoteConfig()=default
bool use_level2() const
获取是否使用level2行情
定义 xlt_quote_config.h:77
bool add_agw_addr(const char *ip_addr, uint16_t port)
添加网关地址
bool set_local_addr(const char *agw, const char *quote)
设置本地网卡IP地址
定义 xlt_data_type.h:13
本文件定义XLT 行情API中使用的基本数据类型和常量