* \brief In the parent-child hierarchy, return the first parent of type \param type or null pointer if there is none. */
| 443 | * \brief In the parent-child hierarchy, return the first parent of type \param type or null pointer if there is none. |
| 444 | */ |
| 445 | AbstractAspect* AbstractAspect::parent(AspectType type) const { |
| 446 | AbstractAspect* parent = parentAspect(); |
| 447 | if (!parent) |
| 448 | return nullptr; |
| 449 | |
| 450 | if (parent->inherits(type)) |
| 451 | return parent; |
| 452 | |
| 453 | return parent->parent(type); |
| 454 | } |
| 455 | |
| 456 | /** |
| 457 | * \brief Return my parent Aspect or 0 if I currently don't have one. |