-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFixParser.hpp
100 lines (73 loc) · 2.69 KB
/
FixParser.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef FIX_PARSER_HPP
#define FIX_PARSER_HPP
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <limits>
#include <iomanip>
#include <type_traits>
#include <algorithm>
#include <fstream>
#include "zmq.hpp"
namespace FIX{
class message{
public:
message();
// ~message();
virtual std::string to_string() = 0;
// virtual ~message();
};
class order: message{
public:
std::string MsgType;
std::string OrderID;
float OrderQty;
std::string OrdType;
float Price;
std::string SenderCompID;
long SendingTime;
std::string Side;
float POVTargetPercentage;
order();
order(const std::string &MsgType,
const std::string &OrderID,
const float &OrderQty,
const std::string &OrdType,
const float &Price,
const std::string &SenderCompID,
const long &SendingTime,
const std::string &Side,
const float &POVTargetPercentage);
order(const std::string &msg);
std::string to_string() override;
// inline bool compareID(const order & other) const;
// inline bool operator> (const order & other) const;
// inline bool operator< (const order & other) const;
// inline bool operator>= (const order & other) const;
// inline bool operator<= (const order & other) const;
// ~order();
};
class ACK: message{
// conveying ACK ORDER or ACK FILL or ACK CANCELLED message
public:
std::string TargetCompID; // to send to specific client
std::string MsgType; // ACK ORDER / ACK FILL / ACK CANCELLED
std::string OrderID; // original order id
float OrderQty; // quantity invloved
float Price;
ACK(const std::string & TargetCompID,
const std::string & MsgType,
const std::string OrderID,
const float & OrderQty,
const float & Price);
ACK(const std::string & msg);
std::string to_string() override;
};
std::vector<FIX::order> parseQuotes(const std::string & marketData);
// template <typename T, typename A>
void sendAllMessages(std::vector<FIX::ACK> & filledOrders, zmq::socket_t & publisher, std::ofstream & log, float & cumulativeQuantity);
void sendAllMessages(std::vector<FIX::order> & filledOrders, zmq::socket_t & publisher, std::ofstream & log);
};
#endif