On 7 December 2012 13:38, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
2012/12/7 Igor Stasenko <siguctua@gmail.com>:
Hi there,
i just uploaded new version of config - 1.8 (development), where i introduced the new public core classs: NBExternalTypeArray.
The class provides a generic functionality for working with arrays which elements is of foreign (C) type. And since it is a subclass of ArrayedCollection, you can use them naturally as any other Array(s)/Collection(s) in smalltalk.
Here the class comment: -------------- I am abstract class which provides a convenient interface to work with arrays which elements are values of some external (C) type. In order to use me with concrete element type, you must create a subclass of me and initialize element type properly.
Subclassing using public subclass: - if you want to create a public subclass of me, then you should make sure that in class-side #initialize method, you add self-send #initElementType: and specify the element type name to use. (And of course, initialize the class before attempting to create any instances).
Subclassing with anonymous subclass: To create an anonymous subclass of me, use #ofType: protocol, i.e.:
floatArrayClass := NBExternalTypeArray ofType: 'float'.
Hi Igor, couldn't it be simply renamed NBExternalArray ofType: 'float' External type of type ... sounds a bit redundant and I find external array sufficiently speaking, don't you?
Makes sense.. i thought about it btw.. but was already in "finishing" phase. :)
Nicolas
-- Best regards, Igor Stasenko.