|
||||||||||||
• Files |
Arrays The root code that led to Guildhall started so many years ago that C++ was not yet a settled thing. The Pink project started out using CFront, an MPW precompiler that would effect a C++ implementation by translating it to C code. Eventually we had good compilers to work with, including the CompTech compiler that Taligent worked on. At that time, standard C++ templates for arrays weren't a thing, because templates weren't a thing. It's also true that templates can be capricious things. Taligent had some moments where the teams went template crazy, building templates on top of templates on top of templates. At one point we had a situation where a single of line of code could instantiate huge amounts of object code. As I started to implement my own version of the APIs my apps were using, working downward to the underyling HAL, I developed and debugged several simple arrays, a few pointer arrays detailed in the Primitives section and other arrays for the scalars and TString. By the time C++ standard library templates were starting to see wider usage, I had what I needed, so I didn't bother to look at that stuff. Don't fix what ain't broke. Somebody said that. So I continued to upgrade what I already had. When I normalized the scalar types and lived through Apple's upgrade to 64 bits, I expanded the array offerings to accommodate every scalar type available. At the same time I tried to normalize the methods in each one so anything purporting to be an array would offer the same assortment of methods. Here's what those methods look like for the ulong type (unsigned 32-bit integer).
The methods listed above do not, of course, apply to every array class. TStringArray, for example, won't have the calculations. TNBoolArray doesn't offer the sorting as the resulting order would have so much ambiguity it would be meaningless. But where possible, every array class presents these methods. Constructible Classes
TDictionary of course could have been named TNamedStringArray but TDictionary seemed like the more familiar term. TCompendium is actually a named array of TDictionary objects. There are a few other templates and classes defined in this section, but they're a bit out of service due to neglect so I'm leaving them undocumented. |