英文:
Read MD groups in QuickFixGo
问题
你可以使用以下步骤来使用该函数:
-
首先,确保你已经安装了
quickfix包。你可以通过运行go get github.com/quickfixgo/quickfix命令来安装它。 -
导入
quickfix包到你的代码中:import "github.com/quickfixgo/quickfix" -
在你的代码中,使用
FieldMap类型的变量来调用该函数。例如:fm := quickfix.NewFieldMap() -
使用
fm变量调用SetField方法来设置字段的值。例如:fm.SetField(35, "D") -
使用
fm变量调用GetField方法来获取字段的值。例如:value := fm.GetField(35) -
根据你的需求,可以根据函数的返回值进行相应的处理。
关于 FieldGroupReader 接口的实现示例代码片段,你可以在 quickfix 的 GitHub 仓库中找到。具体来说,你可以查看 field_map_test.go 文件中的代码示例。该文件位于 github.com/quickfixgo/quickfix 仓库的 field 目录下。
希望对你有所帮助!
英文:
How can I use the function:
https://github.com/quickfixgo/quickfix/blob/master/field_map.go#L150
Has anybody got an example code snippet showing how to implement the FieldGroupReader interface?
Many thanks
答案1
得分: 1
很可能你应该使用预定义的实现之一。例如 https://godoc.org/github.com/quickfixgo/quickfix/fix44/massquote#NoPartyIDsRepeatingGroup
如果你想实现一个非标准的组,你可以参考 https://github.com/quickfixgo/quickfix/blob/102166066b60662e45cc963e405d281cd3e20101/fix44/massquote/MassQuote.generated.go#L3895
英文:
Most likely you should be using one of the pre-defined implementation. Such as https://godoc.org/github.com/quickfixgo/quickfix/fix44/massquote#NoPartyIDsRepeatingGroup
If you want to implement a non-standard group you can follow e.g. https://github.com/quickfixgo/quickfix/blob/102166066b60662e45cc963e405d281cd3e20101/fix44/massquote/MassQuote.generated.go#L3895
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论