[Plib-devel] PUI/puAux Class Notes
Brought to you by:
sjbaker
From: Fay J. F C. AAC/W. <joh...@eg...> - 2005-02-03 13:02:10
|
Gentlemen, In putting Erik Hofmann's "puList" code into my private copy of "puAux", I have come upon a couple of issues having to do with PUI classes. I would appreciate any guidance anybody could give. (1) With the new class, the total number of classes in PUI and puAux is now 30. The bitmap that defines what class (puValue::type) has 32 bits; thus we have space for exactly two more types of widget. While this is not an emergency yet, I can see it turning into one. What should we do about it? I see two alternatives: - Adopt SSG's style of typing. This, I think, assigns the same bit to two different classes if their parent classes differ. Each class thus has a unique bit pattern but not a unique bit. - Increase the number of bits available. There is a non-portable 64-bit integer type, but the "P" in PLIB makes this a nonstarter. The alternative is to define a structure or an array, making the "getType" more complicated. (2) "puValue" in PUI has a "getTypeString" function that prints out the name of the PUI class. Is there a way to extend this to print out puAux class names? One could define a function pointer, initialize it to null in PUI, and set it to point to a function in puAux in each constructor method in puAux, but this strikes me as being extremely ugly. Does anybody have an alternative? John F. Fay joh...@eg... 850-729-6330 |