On 5 December 2012 22:28, Jimmie Houchin <jlhouchin@gmail.com> wrote:
Hello,
In one of my callbacks I have an fnSpec with an enum.
^#( void (enum sessionStatus))
from
typedef void (*SESSION_STATUS_CALLBACK)(O2GSessionStatus eSessionStatus);
How are enums handled in NB? What would be the proper type for the fnSpec and how do I access the values in an enum in my class?
typedef enum { Disconnected = 0, Connecting = 1, TradingSessionRequested = 2, Connected = 3, Reconnecting = 4, Disconnecting = 5, SessionLost = 6, PriceSessionReconnecting = 7 } O2GSessionStatus;
enums are unsigned integer values , so you must change the signature to use 'uint' or 'uint32' type. Then make a shared pool with constants , initialize them with proper values and you done.
Thanks.
Jimmie
-- Best regards, Igor Stasenko.