C++ 的数据记录和提取软件
我有兴趣了解有哪些库、工具或框架可以让 C++ 程序记录数据以供以后分析和提取。我提供了我的设想的描述,以让您了解我想要做什么,但您的建议不一定完全符合它。
我想为我的程序指定不同的记录类型来记录。例如,我从设备获得的每种类型的消息可能有一个不同的记录类型,主要算法的结果有一个记录类型,每种操作员输入都有一个记录类型。理想情况下,添加新记录类型所需的代码更改相当少:为要记录的数据定义一个结构,将其与记录类型 ID 相关联,然后添加将实例记录到文件的代码。
主程序运行后,我想运行一个数据提取工具,它可以提供记录的数据的摘要,并允许我在指定的运行时间段内提取特定的记录类型。我可以向该工具提供 exec,它将使用调试器工具用来找出结构中字段名称以在提取报告中使用的一些相同的钩子。如果提取报告可以指定为 .txt、.xml、.csv(用于在 Excel 中打开)或 .hdf(用于在 Matlab 中打开),那就太好了。
这适用于 Linux 和 GCC 编译器。理想的建议是自由开源软件,但也欢迎专有解决方案。让我知道!
I am interested to learn about what libraries, tools, or frameworks there are for having a C++ program record data for later analysis and extraction. I provide a description of what I envision to give an idea of what I'm looking to do, but your suggestions need not fit it exactly.
I'd like to specify different record types for my program to record. For example, there might be a distinct record type for each type of message I get from a device, a record type for the results of major algorithms, a record type for each kind of operator input. Ideally the code changes for adding a new record type would be fairly minimal: Define a struct for the data to record, correlate it to a record type ID, and add the code to record instances to file.
After the main program runs, I'd like to run a data extraction tool that could give a summary of the data recorded and allow me to extract specific record types over a specified time period of the run. I could provide the exec to the tool and it would use some of the same hooks a debugger tool uses to figure out the names of the fields in the struct for use in the extraction report. It would be nice if the extraction report could be specified as .txt, .xml, .csv (for opening in Excel), or .hdf (for opening in Matlab).
This would be for Linux and GCC compiler. Ideally suggestions would be FOSS, but proprietary solutions are welcome too. Let me know!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你所描述的并没有什么特别的。只是通用序列化和反序列化。如果您想要某个特定的库,您应该描述您到底想如何处理记录的数据。
有关序列化支持,请查看 Boost::Serialization 和 s11n。
What you described isn't anything special. Just generic serialization and de-serialization. If you want some specific library you should describe what exactly you want to do with the recorded data.
For serialization support, look into Boost::Serialization and s11n.