[Quickfix-developers] Using DataDictionary.getFieldName from Ruby
Brought to you by:
orenmnero
|
From: Toli K. <to...@ma...> - 2006-10-11 21:27:08
|
Oren,
the fixed you checked works for me - I can now compile/install the
latest (HEAD) version on Quickfix (thanks!)
(the OS/X problem miraculously disappeared with the new code as well).
I'm now seeing another problem when i try using the
Quickfix::DataDictionary.getValueName function.
the Java API show that it takes 2 args: getValueName(int field, String value)
and the C++ takes 3:
bool getValueName( int field, const std::string& value, std::string&
name ) const
Ruby interface clearly wants three args passed in:
>> d = Quickfix::DataDictionary.new("/usr/local/share/quickfix/FIX42.xml")
=> #<Quickfix::DataDictionary:0x23ff4b4>
>> d.getValueName(Quickfix::Side.new.getField, Quickfix::Side_BUY())
ArgumentError: wrong # of arguments(2 for 3)
from (irb):19:in `getValueName'
from (irb):19
when i pas another string (or a var pointing to a string) as the 3rd
param, i get this error:
>> name = "future name"
=> "future name"
>> d.getValueName(Quickfix::Side.new.getField, Quickfix::Side_BUY(), name)
TypeError: in method 'getValueName', argument 4 of type 'std::string &'
from (irb):21:in `getValueName'
from (irb):21
I'm somewhat at a loss as to what i need to pass into this function.
The SWIG code (QuickfixRuby.cpp:line 53138-53184) shows that the last
arg is being converted to a pass-by-reference parameter to a C++ call.
Reading up on SWIG indicates that pass-by-ref stuff should just work
"magically" from Ruby
(http://www.goto.info.waseda.ac.jp/~fukusima/ruby/swig-examples/reference/index.html)
any idea what i may be doing wrong? Or is some SWIG magic not working
correctly with respect to DataDictionary code generated?
I'm seeing the same problem with other methods that expect a C++
pass-by-ref parameter, such as DataDictionary.getFieldName as well
thanks!
--
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.
|