ocra-recipes
Doxygen documentation for the ocra-recipes repository
|
Functors to locate a parent or a child. More...
#include <Composite.h>
Public Member Functions | |
bool | operator() (const parenthood_t *p) const |
parentIs (const parent_t *parent) | |
Public Attributes | |
const parent_t * | parent_ |
Functors to locate a parent or a child.
Example: class MyComposite : public MyComponent, public Composite<MyComponent, MyComposite> { ... }; MyComposite node; ... MyComponent child; attach(node, child);
MyComponent::iterator it = std::find_if(node.begin_children(), node.end_children(), MyComponent::parenthood_t::childIs(&child)); now it points to the parenthood objects that binds node and child ocra_assert(&it->getParent() == &node); ocra_assert(&it->getChild() == &child);
Definition at line 300 of file Composite.h.
|
inline |
Definition at line 303 of file Composite.h.
|
inline |
Definition at line 302 of file Composite.h.
const parent_t* ocra::Parenthood< ComponentDerived, CompositeDerived, ParenthoodInfo >::parentIs::parent_ |
Definition at line 304 of file Composite.h.