我正在使用QFIX_1_13_3,我对C ++ API有疑问。 FIX :: Message :: bodyLength()(带有默认参数)是在FIX :: Application :: fromApp()中调用的正确API,以便获取传入二进制消息FIX :: Message的总大小?从这里看起来像是,但只是想确认一下:
http://www.quickfixengine.org/quickfix/doc/html/_message_8h_source.html#l00062
00197 int bodyLength( int beginStringField = FIELD::BeginString,
00198 int bodyLengthField = FIELD::BodyLength,
00199 int checkSumField = FIELD::CheckSum ) const
00200 { return m_header.calculateLength(beginStringField, bodyLengthField, checkSumField)
00201 + calculateLength(beginStringField, bodyLengthField, checkSumField)
00202 + m_trailer.calculateLength(beginStringField, bodyLengthField, checkSumField);
00203 }
我打算做的是将内存映射文件memcpy整个收到的消息FIX :: Message:
void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) {
...
memcpy(persistFilePos, &message, message::bodyLength());
}
这有意义吗?