forked from quickfixgo/quickfix
/
Quote.generated.go
273 lines (224 loc) · 6.85 KB
/
Quote.generated.go
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
package quote
import (
"github.com/shopspring/decimal"
"time"
"github.com/quickfixgo/quickfix"
"github.com/quickfixgo/quickfix/field"
"github.com/quickfixgo/quickfix/fix40"
"github.com/quickfixgo/quickfix/tag"
)
//Quote is the fix40 Quote type, MsgType = S
type Quote struct {
fix40.Header
quickfix.Body
fix40.Trailer
//ReceiveTime is the time that this message was read from the socket connection
ReceiveTime time.Time
}
//FromMessage creates a Quote from a quickfix.Message instance
func FromMessage(m quickfix.Message) Quote {
return Quote{
Header: fix40.Header{Header: m.Header},
Body: m.Body,
Trailer: fix40.Trailer{Trailer: m.Trailer},
ReceiveTime: m.ReceiveTime,
}
}
//ToMessage returns a quickfix.Message instance
func (m Quote) ToMessage() quickfix.Message {
return quickfix.Message{
Header: m.Header.Header,
Body: m.Body,
Trailer: m.Trailer.Trailer,
ReceiveTime: m.ReceiveTime,
}
}
//New returns a Quote initialized with the required fields for Quote
func New(quoteid field.QuoteIDField, symbol field.SymbolField, bidpx field.BidPxField) (m Quote) {
m.Header = fix40.NewHeader()
m.Init()
m.Trailer.Init()
m.Header.Set(field.NewMsgType("S"))
m.Set(quoteid)
m.Set(symbol)
m.Set(bidpx)
return
}
//A RouteOut is the callback type that should be implemented for routing Message
type RouteOut func(msg Quote, sessionID quickfix.SessionID) quickfix.MessageRejectError
//Route returns the beginstring, message type, and MessageRoute for this Message type
func Route(router RouteOut) (string, string, quickfix.MessageRoute) {
r := func(msg quickfix.Message, sessionID quickfix.SessionID) quickfix.MessageRejectError {
return router(FromMessage(msg), sessionID)
}
return "FIX.4.0", "S", r
}
//SetIDSource sets IDSource, Tag 22
func (m Quote) SetIDSource(v string) {
m.Set(field.NewIDSource(v))
}
//SetSecurityID sets SecurityID, Tag 48
func (m Quote) SetSecurityID(v string) {
m.Set(field.NewSecurityID(v))
}
//SetSymbol sets Symbol, Tag 55
func (m Quote) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
//SetValidUntilTime sets ValidUntilTime, Tag 62
func (m Quote) SetValidUntilTime(v time.Time) {
m.Set(field.NewValidUntilTime(v))
}
//SetSymbolSfx sets SymbolSfx, Tag 65
func (m Quote) SetSymbolSfx(v string) {
m.Set(field.NewSymbolSfx(v))
}
//SetIssuer sets Issuer, Tag 106
func (m Quote) SetIssuer(v string) {
m.Set(field.NewIssuer(v))
}
//SetSecurityDesc sets SecurityDesc, Tag 107
func (m Quote) SetSecurityDesc(v string) {
m.Set(field.NewSecurityDesc(v))
}
//SetQuoteID sets QuoteID, Tag 117
func (m Quote) SetQuoteID(v string) {
m.Set(field.NewQuoteID(v))
}
//SetQuoteReqID sets QuoteReqID, Tag 131
func (m Quote) SetQuoteReqID(v string) {
m.Set(field.NewQuoteReqID(v))
}
//SetBidPx sets BidPx, Tag 132
func (m Quote) SetBidPx(value decimal.Decimal, scale int32) {
m.Set(field.NewBidPx(value, scale))
}
//SetOfferPx sets OfferPx, Tag 133
func (m Quote) SetOfferPx(value decimal.Decimal, scale int32) {
m.Set(field.NewOfferPx(value, scale))
}
//SetBidSize sets BidSize, Tag 134
func (m Quote) SetBidSize(value decimal.Decimal, scale int32) {
m.Set(field.NewBidSize(value, scale))
}
//SetOfferSize sets OfferSize, Tag 135
func (m Quote) SetOfferSize(value decimal.Decimal, scale int32) {
m.Set(field.NewOfferSize(value, scale))
}
//GetIDSource gets IDSource, Tag 22
func (m Quote) GetIDSource() (f field.IDSourceField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetSecurityID gets SecurityID, Tag 48
func (m Quote) GetSecurityID() (f field.SecurityIDField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetSymbol gets Symbol, Tag 55
func (m Quote) GetSymbol() (f field.SymbolField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetValidUntilTime gets ValidUntilTime, Tag 62
func (m Quote) GetValidUntilTime() (f field.ValidUntilTimeField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetSymbolSfx gets SymbolSfx, Tag 65
func (m Quote) GetSymbolSfx() (f field.SymbolSfxField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetIssuer gets Issuer, Tag 106
func (m Quote) GetIssuer() (f field.IssuerField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetSecurityDesc gets SecurityDesc, Tag 107
func (m Quote) GetSecurityDesc() (f field.SecurityDescField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetQuoteID gets QuoteID, Tag 117
func (m Quote) GetQuoteID() (f field.QuoteIDField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetQuoteReqID gets QuoteReqID, Tag 131
func (m Quote) GetQuoteReqID() (f field.QuoteReqIDField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetBidPx gets BidPx, Tag 132
func (m Quote) GetBidPx() (f field.BidPxField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetOfferPx gets OfferPx, Tag 133
func (m Quote) GetOfferPx() (f field.OfferPxField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetBidSize gets BidSize, Tag 134
func (m Quote) GetBidSize() (f field.BidSizeField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//GetOfferSize gets OfferSize, Tag 135
func (m Quote) GetOfferSize() (f field.OfferSizeField, err quickfix.MessageRejectError) {
err = m.Get(&f)
return
}
//HasIDSource returns true if IDSource is present, Tag 22
func (m Quote) HasIDSource() bool {
return m.Has(tag.IDSource)
}
//HasSecurityID returns true if SecurityID is present, Tag 48
func (m Quote) HasSecurityID() bool {
return m.Has(tag.SecurityID)
}
//HasSymbol returns true if Symbol is present, Tag 55
func (m Quote) HasSymbol() bool {
return m.Has(tag.Symbol)
}
//HasValidUntilTime returns true if ValidUntilTime is present, Tag 62
func (m Quote) HasValidUntilTime() bool {
return m.Has(tag.ValidUntilTime)
}
//HasSymbolSfx returns true if SymbolSfx is present, Tag 65
func (m Quote) HasSymbolSfx() bool {
return m.Has(tag.SymbolSfx)
}
//HasIssuer returns true if Issuer is present, Tag 106
func (m Quote) HasIssuer() bool {
return m.Has(tag.Issuer)
}
//HasSecurityDesc returns true if SecurityDesc is present, Tag 107
func (m Quote) HasSecurityDesc() bool {
return m.Has(tag.SecurityDesc)
}
//HasQuoteID returns true if QuoteID is present, Tag 117
func (m Quote) HasQuoteID() bool {
return m.Has(tag.QuoteID)
}
//HasQuoteReqID returns true if QuoteReqID is present, Tag 131
func (m Quote) HasQuoteReqID() bool {
return m.Has(tag.QuoteReqID)
}
//HasBidPx returns true if BidPx is present, Tag 132
func (m Quote) HasBidPx() bool {
return m.Has(tag.BidPx)
}
//HasOfferPx returns true if OfferPx is present, Tag 133
func (m Quote) HasOfferPx() bool {
return m.Has(tag.OfferPx)
}
//HasBidSize returns true if BidSize is present, Tag 134
func (m Quote) HasBidSize() bool {
return m.Has(tag.BidSize)
}
//HasOfferSize returns true if OfferSize is present, Tag 135
func (m Quote) HasOfferSize() bool {
return m.Has(tag.OfferSize)
}