| 126 | } |
| 127 | |
| 128 | NodeID Node::getChild(int alt) const |
| 129 | { |
| 130 | const auto kids = childrenCount(); |
| 131 | |
| 132 | if (kids <= 0) |
| 133 | { |
| 134 | throw std::exception(); |
| 135 | } |
| 136 | else if (kids <= 2) |
| 137 | { |
| 138 | if (alt == 0) |
| 139 | { |
| 140 | return static_cast<NodeID>(static_cast<int>(reinterpret_cast<ptrdiff_t>(m_childrenOrFirstChild) >> 2)); |
| 141 | } |
| 142 | else |
| 143 | { |
| 144 | return NodeID{-m_noOfChildren}; |
| 145 | } |
| 146 | } |
| 147 | else |
| 148 | { |
| 149 | return getPtr()[alt]; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | void Node::addChild() |
| 154 | { |
no outgoing calls