This is a little tricky, so make sure you understand this. Indexes are sorted by symbol, then class, then file. If there is only one class for a symbol, or one file definition for a class/symbol, they are added inline to the entry. However, if there are multiple classes or definitions, the function for it returns an arrayref of IndexElements instead. Which members are defined and undefined should follow common sense. For example, if a symbol is defined in multiple classes, the symbol’s IndexElement will not define File(), Type(), or Prototype(); those will be defined in child elements. Similarly, the child elements will not define Symbol() since it’s redundant.
Diagrams may be clearer. If a member isn’t listed for an element, it isn’t defined.
A symbol that only has one class and definiton
[Element]
- Symbol
- Class
- File
- Type
- Prototype
- Summary
A symbol that is defined by multiple classes, each with only one definition
[Element]
- Symbol
- Class
[Element]
- Class
- File
- Type
- Prototype
- Summary
[Element]
- ...A symbol that is defined by one class, but has multiple definitions
[Element]
- Symbol
- Class
- File
[Element]
- File
- Type
- Protype
- Summary
[Element]
- ...
A symbol that is defined by multiple classes which have multiple definitions
[Element]
- Symbol
- Class
[Element]
- Class
- File
[Element]
- File
- Type
- Prototype
- Summary
[Element]
- ...
[Element]
- ...Why is it done this way?
Because it makes it easier to generate nice indexes since all the splitting and combining is done for you. If a symbol has only one class, you just want to link to it, you don’t want to break out a subindex for just one class. However, if it has multiple classes, you do want the subindex and to link to each one individually. Whether Class() or File() returns an array or not determines whether you need to add a subindex for it.