Re: [Quickfix-developers] Using DataDictionary.getFieldName from Ruby
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2006-10-12 07:08:12
|
Blech. That wasn't automatic at all. I definitely wouldn't describe it as magical. That pass-by-ref bliss only works for input arguments. Output arguments are another story. I slogged through it though and checked in something that will do the trick, at least for strings. In particular with getFieldName and getValueName, they now take two parameters and will return a string. nil is returned if the name is not found. --oren On Oct 11, 2006, at 4:26 PM, Toli Kuznets wrote: > 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) |