Libannhoo_md_sdk  1.6.1
for index, tick(entrust and trade), and snapshot with solar flare
 All Classes Namespaces Files Functions Variables Pages
ah_md_spi_inl.h
1 /*************************************************************************
2  > File Name: ah_md_spi_inl.h
3  > Author: leaker
4  > Mail: xiao13149920@foxmail.com
5  > Created Time: Mon 21 Dec 2020 09:49:35 AM CST
6  ************************************************************************/
7 
8 #ifndef __AH_MD_SPI_INL_H__
9 #define __AH_MD_SPI_INL_H__
10 
11 #include <memory>
12 #include <string>
13 
16 
17 // #ifdef TEST_VEAHION
18 #define SECONDS 1
19 #define USECONDS 100
20 #define BULKSIZE 100
21 // #endif
22 
23 namespace annhoo {
24 class AHMdSpiInl : public IAHMdSpi {
25 public:
26  AHMdSpiInl(const std::string& index_filename,
27  // const std::string& entrust,
28  // const std::string& trade,
29  const std::string& tick_filename, const std::string& snap_shot_filename, const char* delimiter = ", ",
30  const char* suffix = "\n");
31  virtual ~AHMdSpiInl();
32 
33  AHMdSpiInl(const AHMdSpiInl& r) = delete;
34  AHMdSpiInl(AHMdSpiInl&& r) = delete;
35  AHMdSpiInl& operator=(const AHMdSpiInl& r) = delete;
36  AHMdSpiInl& operator=(AHMdSpiInl&& r) = delete;
37 
38 public:
39  virtual void OnIndexCB(AHIndex* index) override;
40  virtual void OnTickCB(AHTick* tick, uint16_t type) override;
41  virtual void OnSnapshotCB(AHSnapshot* snap_shot) override;
42 
43 private:
44  int index_fd;
45  int snapshot_fd;
46  std::string delimiter;
47  std::string suffix;
48 };
49 } // namespace annhoo
50 
51 #endif
This is the main interface to use library libAHQuotes.
Definition: ah_md_spi.h:26
virtual void OnIndexCB(AHIndex *index) override
Callback for AHIndex.
annhoo quotes struct.
Contains data defined for index.
Definition: ah_md_common.h:40
virtual void OnSnapshotCB(AHSnapshot *snap_shot) override
Callback for AHSnapshot.
Contains data defined for snapshot.
Definition: ah_md_common.h:67
virtual void OnTickCB(AHTick *tick, uint16_t type) override
Callback for AHEntrust or AHTrade.
annhoo markdata quotes api.