FIX 消息的面向对象封装
More...
#include <fix_codec.hpp>
|
| void | set (int tag, const std::string &value) |
| | 设置字符串类型字段
|
| |
| void | set (int tag, int value) |
| | 设置整数类型字段
|
| |
| std::string | get_string (int tag) const |
| | 获取字符串类型字段值
|
| |
| int | get_int (int tag) const |
| | 获取整数类型字段值
|
| |
| bool | has (int tag) const |
| | 检查标签是否存在
|
| |
| const std::unordered_map< int, std::string > & | get_fields () const |
| | 获取所有字段的只读引用
|
| |
FIX 消息的面向对象封装
封装 FIX 消息的字段,提供类型安全的访问接口。
- 使用示例
FIX 消息的面向对象封装
Definition fix_codec.hpp:46
void set(int tag, const std::string &value)
设置字符串类型字段
Definition fix_codec.hpp:53
std::string get_string(int tag) const
获取字符串类型字段值
Definition fix_codec.hpp:68
int get_int(int tag) const
获取整数类型字段值
Definition fix_codec.hpp:82
◆ get_fields()
| const std::unordered_map< int, std::string > & fix40::FixMessage::get_fields |
( |
| ) |
const |
|
inline |
获取所有字段的只读引用
- Returns
- const std::unordered_map<int, std::string>& 字段映射
◆ get_int()
| int fix40::FixMessage::get_int |
( |
int |
tag | ) |
const |
|
inline |
获取整数类型字段值
- Parameters
-
- Returns
- int 字段值
- Exceptions
-
| std::runtime_error | 标签不存在或转换失败时抛出异常 |
◆ get_string()
| std::string fix40::FixMessage::get_string |
( |
int |
tag | ) |
const |
|
inline |
获取字符串类型字段值
- Parameters
-
- Returns
- std::string 字段值
- Exceptions
-
| std::runtime_error | 标签不存在时抛出异常 |
◆ has()
| bool fix40::FixMessage::has |
( |
int |
tag | ) |
const |
|
inline |
检查标签是否存在
- Parameters
-
- Returns
- true 标签存在
-
false 标签不存在
◆ set() [1/2]
| void fix40::FixMessage::set |
( |
int |
tag, |
|
|
const std::string & |
value |
|
) |
| |
|
inline |
◆ set() [2/2]
| void fix40::FixMessage::set |
( |
int |
tag, |
|
|
int |
value |
|
) |
| |
|
inline |
设置整数类型字段
- Parameters
-
| tag | 标签编号 |
| value | 字段值(自动转换为字符串) |
◆ FixCodec
The documentation for this class was generated from the following file: