ocra-recipes
Doxygen documentation for the ocra-recipes repository
Public Member Functions | Public Attributes | List of all members
ocra::Parenthood< ComponentDerived, CompositeDerived, ParenthoodInfo >::parentIs Struct Reference

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_tparent_
 

Detailed Description

template<class ComponentDerived, class CompositeDerived, class ParenthoodInfo = NoInfo>
struct ocra::Parenthood< ComponentDerived, CompositeDerived, ParenthoodInfo >::parentIs

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);

Note
The input range is must not contain null pointers!

Definition at line 300 of file Composite.h.

Constructor & Destructor Documentation

template<class ComponentDerived , class CompositeDerived , class ParenthoodInfo = NoInfo>
ocra::Parenthood< ComponentDerived, CompositeDerived, ParenthoodInfo >::parentIs::parentIs ( const parent_t parent)
inline

Definition at line 303 of file Composite.h.

Member Function Documentation

template<class ComponentDerived , class CompositeDerived , class ParenthoodInfo = NoInfo>
bool ocra::Parenthood< ComponentDerived, CompositeDerived, ParenthoodInfo >::parentIs::operator() ( const parenthood_t p) const
inline

Definition at line 302 of file Composite.h.

Member Data Documentation

template<class ComponentDerived , class CompositeDerived , class ParenthoodInfo = NoInfo>
const parent_t* ocra::Parenthood< ComponentDerived, CompositeDerived, ParenthoodInfo >::parentIs::parent_

Definition at line 304 of file Composite.h.


The documentation for this struct was generated from the following file: