|
| class | MR |
| class | MR.Const_ConstChildren |
| | read-only access to the children of an Object, as returned by Object.constChildren() Object stores its children as std::shared_ptr<Object>, and a const Object cannot hand them out directly without either dropping constness or copying the whole vector. This class solves that: it is a lightweight non-owning view on the object's children, which produces std::shared_ptr<const Object> on the fly. Typical use: for ( const auto & child : obj.constChildren() ) processRecursively( *child ); It is also indexable, so a plain loop works too: for ( size_t i = 0; i < obj.constChildren().size(); ++i ) process( *obj.constChildren()[i] ); The view refers to the object's own storage, so use it as a temporary and do not store it: it is invalidated by anything that adds, removes or reorders the object's children, exactly like an iterator of the underlying vector. Generated from class MR.ConstChildren. This is the const half of the class. More...
|
| class | MR.Const_ConstChildren.Const_Iterator |
| | dereferences to std::shared_ptr<const Object>, constructed on each dereference Generated from class MR.ConstChildren.Iterator. This is the const half of the class. More...
|
| class | MR.Const_ConstChildren.Iterator |
| | dereferences to std::shared_ptr<const Object>, constructed on each dereference Generated from class MR.ConstChildren.Iterator. This is the non-const half of the class. More...
|
| class | MR.ConstChildren |
| | read-only access to the children of an Object, as returned by Object.constChildren() Object stores its children as std::shared_ptr<Object>, and a const Object cannot hand them out directly without either dropping constness or copying the whole vector. This class solves that: it is a lightweight non-owning view on the object's children, which produces std::shared_ptr<const Object> on the fly. Typical use: for ( const auto & child : obj.constChildren() ) processRecursively( *child ); It is also indexable, so a plain loop works too: for ( size_t i = 0; i < obj.constChildren().size(); ++i ) process( *obj.constChildren()[i] ); The view refers to the object's own storage, so use it as a temporary and do not store it: it is invalidated by anything that adds, removes or reorders the object's children, exactly like an iterator of the underlying vector. Generated from class MR.ConstChildren. This is the non-const half of the class. More...
|