获取 QuickFix::Field::OrdType 的值
get the value of QuickFix::Field::OrdType?
我从quickfixengine.org
下载了QuickFix.dll
当我声明一个属于命名空间QuickFix::Fields
的对象时,我无法获取其相应的基值(我的意思是 OrdType
的 char 值,OrderID
的字符串值等)。因为没有与之关联的属性。
有没有其他方法可以实现相同的目标?
代码为:
......
QuickField::Fields::OrdType ordType;
message.Get(OrdType);//message is a NewOrderSingle
//type object defined prevviously in the code
//Now i wish to get the value contained in "ordType" but it has no
//properties to access its data member(s)
这是您想要看到的:
QuickField::Fields::OrdType ordType;
message.get(ordType);
char char_value = ordType.getValue();
建议:查看类文档。 场基类是FIX::FieldBase
,它导出为FIX::StringField
、FIX::BoolField
、FIX::IntField
等。 所有这些都有一个getValue()
函数,该函数返回转换为正确数据类型的原始字段值。
执行此操作的另一种方法(不太合法)是使用 Message::getField(int)
将字段的值作为字符串返回。 所以你可以使用 std::string str_value = message.get(40);
,但你会有一个字符串而不是一个字符(或 int 或 bool 或其他什么)。
相关文章:
- 数组索引的值没有增加
- 'short int'持有的值溢出,但"自动"不会溢出?
- 是默认情况下分配给char数组常量的值
- 这个指针和内存代码打印是什么?我不知道是打印垃圾还是如何打印我需要的值
- 为什么我无法更改"set<set>"循环中的值<int>
- 有效地使用std::unordered_map来插入或增加键的值
- <streamsize>C++ 中 numeric_limits::max() 的值
- 为什么不能修改对象中的值?另外,我如何改进此链表?
- 无法获取webot::PositionSensor对象中位置传感器的值
- 正在将无序映射设置为无序映射的值
- 着色器纹理值与创建纹理时写入的值不同
- 无法按cpp中的值返回矢量
- 指针没有更新它在void函数内部指向的值
- 不能将 "void *" 类型的值分配给类型 "TCHAR" 的实体
- 获取从C++中同一类中的构造函数调用的方法返回的值
- 为什么在我的函数类型后使用引用运算符 (&) 允许我修改它返回的值?
- 如何在c++中获取要更新的值
- C++RapidXml-使用first_node()遍历以修改XML文件中节点的值
- ";结果类型必须是可从输入范围的值类型""构造的;创建std::vector时
- 获取 QuickFix::Field::OrdType 的值