Ciprian 

this is really cool to see how pushing and enhancing NativeBoost.
Really a cool nd warm feeling.
Tx for your energy and time.

Stef

On Dec 11, 2012, at 8:33 PM, Ciprian Teodorov wrote:

> Hi guys,
> 
> today I have commited to the NativeBoost repository a new core class, the 
> NBExternalEnumerationType, 
> which reifies the enum declarations in C and offers a nice interface 
> (especially in terms of debug/inspect).
> 
> To use it just subclass the NBExternalEnumeration and add an #enumDecl method 
> to the class side such as:
> 

Did you add this cool class comment :)

> NBExternalEnumeration subclass: #NBTestEnumeration
>       instanceVariableNames: ''
>       classVariableNames: ''
>       poolDictionaries: ''
>       category: 'NativeBoost-Tests'
> 
> NBTestEnumeration class>>enumDecl
>       ^ {(#AAA -> 1).
>       (#BBB -> 2).
>       (#CCC -> 3).
>       (#DDD -> 2400)} asDictionary 
> 
> DO NOT FORGET to call the #initialize method on your class. The rest is 
> automatically done ;)
> 
> You can use your new enum in two ways:
>       • add it to a client class poolDictionaries list (see  
> #NBExternalEnumTests for an example), and then just write CCC in your code -- 
> CCC here is an item of your enum
>       • or you can send the name of an item to your class --- 
> NBTestEnumeration DDD
> The NBExternalEnumeration implements  (instance and class) some more API 
> methods like:
>       • #itemAt: retrieves the item having a specific value  --- 
> NBTestEnumeration itemAt: 2
>       • #includes: checks the existence of a specific item in the enum --- 
> NBTestEnumeration includes: #AAA
> Having this already gives us a nice interface to working with enums. Now I 
> plan to improve a little bit on performance and usage scenarios:
>       • the possibility to accept smalltalk integers as valid input/output 
> for functions(or callbacks) that use enums as arguments/return. 
>       • support the different representation types for the enum values 
> (int/uint)
> So that will be for now. Feel free to try it out and send me any comments 
> and/or improvement ideas, It will be my pleasure to improve it. 
> Cheers,
> -- 
> Dr. Ciprian TEODOROV
> Ingénieur Développement CAO
> 
> tél : 06 08 54 73 48
> mail : [email protected]
> www.teodorov.ro


Reply via email to