Enum issue with blinkc

38 views
Skip to first unread message

Thomas Lo

unread,
Jul 25, 2013, 3:18:01 PM7/25/13
to the-blink...@googlegroups.com
First thanks for the great work in blink. It is very beneficial for us to consider using this instead of the like of google proto buf or other serialization format in financial trading system. The self described approach along with FIX association is very important.

I started to look at the code generation side I somehow hit a problem with the enumeration class file generation. I am using the enumeration definition associated with a specific int code something like this:

AuthorizationType = MODIFY/1 | REMOVE/2 | TRADE/3 | MONITOR/4 | USER/5 | LIQUIDITY/6


But the class generated is this:



public enum AuthorizationType

{

  MODIFY (1),

  REMOVE (2),

  TRADE (3),

  MONITOR (4),

  USER (5),

  LIQUIDITY (6);

}


and this causes compilation error because there is no such constructor. Do you know if there is something missing on my side?


Thanks again for this open source project. It is great work and has a lot of potential.


david.rosenborg

unread,
Jul 29, 2013, 5:54:05 AM7/29/13
to the-blink...@googlegroups.com
Hi,

Looks like a case of wishful/lazy programming. blinkc should obviously generate a matching constructor and member for that purpose. We'll fix and post an update to GitHub. Note that the values only serve an informational purpose in the code. The actual values used in the encoding and decoding  of enum fields come from the schema.

/D

Thomas Lo

unread,
Jul 30, 2013, 1:20:06 PM7/30/13
to the-blink...@googlegroups.com
Super thanks. 
Reply all
Reply to author
Forward
0 new messages