7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for iteration over components"
11 #include <boost/test/unit_test.hpp>
12 #include <boost/timer.hpp>
36 m_root = boost::static_pointer_cast<
Component>(allocate_component<Group>(
"root"));
38 top_component_names.push_back(comp1->
name());
39 component_names.push_back(comp1->
name());
41 component_names.push_back(comp1_1->
name());
43 component_names.push_back(comp1_2->
name());
45 top_component_names.push_back(comp2->
name());
46 component_names.push_back(comp2->
name());
48 component_names.push_back(comp2_1->
name());
50 component_names.push_back(comp2_2->
name());
52 top_component_names.push_back(group1->
name());
53 component_names.push_back(group1->
name());
54 top_group_names.push_back(group1->
name());
55 group_names.push_back(group1->
name());
58 component_names.push_back(comp3->
name());
59 special_component_names.push_back(comp3->
name());
60 group1_component_names.push_back(comp3->
name());
62 component_names.push_back(group1_1->
name());
63 group_names.push_back(group1_1->
name());
64 group1_group_names.push_back(group1_1->
name());
65 group1_component_names.push_back(group1_1->
name());
68 component_names.push_back(group1_2->
name());
69 group_names.push_back(group1_2->
name());
70 group1_group_names.push_back(group1_2->
name());
71 group1_component_names.push_back(group1_2->
name());
72 special_component_names.push_back(group1_2->
name());
74 top_component_names.push_back(group2->
name());
75 component_names.push_back(group2->
name());
76 top_group_names.push_back(group2->
name());
77 group_names.push_back(group2->
name());
79 component_names.push_back(group2_1->
name());
80 group_names.push_back(group2_1->
name());
82 component_names.push_back(group2_1_1->
name());
83 group_names.push_back(group2_1_1->
name());
84 group2_1_1->
add_tag(
"very_special");
86 component_names.push_back(link2->
name());
88 top_component_names.push_back(group3->
name());
89 component_names.push_back(group3->
name());
90 top_group_names.push_back(group3->
name());
91 group_names.push_back(group3->
name());
93 component_names.push_back(group3_1->
name());
94 group_names.push_back(group3_1->
name());
96 component_names.push_back(link1->
name());
97 top_component_names.push_back(link1->
name());
171 const Group& group2 = find_parent_component<Group>(const_group2_1());
172 BOOST_CHECK_EQUAL(group2.
uri().
string() ,
"cpath:/group2");
175 BOOST_CHECK_EQUAL(root.uri().string() ,
"cpath:/");
178 BOOST_CHECK_EQUAL(group22.uri().string() ,
"cpath:/group2");
181 BOOST_CHECK_EQUAL(root2.uri().string() ,
"cpath:/");
202 BOOST_CHECK_EQUAL(comp.
name(), top_component_names[counter++]);
209 BOOST_FOREACH(
const Component& comp, const_root())
210 BOOST_CHECK_EQUAL(comp.
name(), top_component_names[counter++]);
217 BOOST_FOREACH(
const Component& comp, find_components<Group>(const_root()))
218 BOOST_CHECK_EQUAL(comp.
name(), top_group_names[counter++]);
224 BOOST_FOREACH(
const Component& comp, find_components_with_name<Group>(const_root(),
"group1"))
225 BOOST_CHECK_EQUAL(comp.
name(),
"group1");
233 BOOST_CHECK_THROW(find_component_with_name<Group>(
root(),
"comp1"),
ValueNotFound);
235 BOOST_CHECK_EQUAL(find_component_with_name<Group>(
root(),
"group1").
name(),
"group1");
236 BOOST_CHECK_EQUAL(find_component_ptr_with_name<Group>(
root(),
"comp1"),
Handle<Group>());
237 BOOST_CHECK_EQUAL(find_component_ptr_with_name<Group>(
root(),
"group1")->
name(),
"group1");
251 BOOST_CHECK_EQUAL(it->name(), component_names[counter++]);
259 BOOST_CHECK_EQUAL(it->name(), component_names[counter++]);
282 typedef boost::filter_iterator< IsComponentName , Component::const_iterator > FilterIterator;
283 FilterIterator filterIterator(
IsComponentName(
"group1"), const_root().recursive_begin(), const_root().recursive_end());
284 FilterIterator last_filterIterator(
IsComponentName(
"group1"), const_root().recursive_end(), const_root().recursive_end());
285 for (; filterIterator != last_filterIterator; ++filterIterator)
286 BOOST_CHECK_EQUAL(filterIterator->name(),
"group1");
287 FilterIterator empty_begin(
IsComponentName(
"nonExistingGroup"), const_root().recursive_begin(), const_root().recursive_end());
288 FilterIterator empty_end(
IsComponentName(
"nonExistingGroup"), const_root().recursive_end(), const_root().recursive_end());
289 BOOST_CHECK_EQUAL(empty_begin == empty_end,
true);
297 BOOST_CHECK_EQUAL(comp.
name(), component_names[counter++]);
304 BOOST_FOREACH(
const Component& comp, find_components_recursively<Group>(const_root()))
305 BOOST_CHECK_EQUAL(comp.
name(), group_names[counter++]);
312 BOOST_CHECK_EQUAL(comp.
name(),
"group1");
319 BOOST_CHECK_EQUAL(comp.
name(),
"group1");
325 BOOST_FOREACH(
const Component& comp, find_components_recursively_with_name<Group>(const_root(),
"group1"))
326 BOOST_CHECK_EQUAL(comp.
name(),
"group1");
333 BOOST_CHECK_EQUAL(find_components_recursively_with_name<Group>(const_root(),
"comp1").empty(),
true);
336 BOOST_CHECK_EQUAL(range.begin() == range.end(),
true);
344 BOOST_CHECK_THROW(find_component_recursively_with_name<Group>(
root(),
"comp1"),
ValueNotFound);
345 BOOST_CHECK_EQUAL(find_component_recursively_with_name<Group>(
root(),
"group1").
name(),
"group1");
346 BOOST_CHECK_EQUAL(find_component_ptr_recursively_with_name<Group>(
root(),
"comp1"),
Handle<Group>());
347 BOOST_CHECK_EQUAL(find_component_ptr_recursively_with_name<Group>(
root(),
"group1")->
name(),
"group1");
356 BOOST_FOREACH(
Group&
group, find_components<Group>(group1()))
357 BOOST_CHECK_EQUAL(group.
name(),group1_group_names[counter++]);
358 BOOST_CHECK_EQUAL(counter, group1_group_names.size());
361 BOOST_FOREACH(
const Group& group, find_components<Group>(const_group1()))
362 BOOST_CHECK_EQUAL(group.
name(),group1_group_names[counter++]);
363 BOOST_CHECK_EQUAL(counter, group1_group_names.size());
367 BOOST_CHECK_EQUAL(group.
name(),group1_component_names[counter++]);
368 BOOST_CHECK_EQUAL(counter, group1_component_names.size());
372 BOOST_CHECK_EQUAL(group.
name(),group1_component_names[counter++]);
373 BOOST_CHECK_EQUAL(counter, group1_component_names.size());
380 BOOST_CHECK_EQUAL(find_components_with_filter<Group>(group1(),
IsComponentTag(
"special")).empty() ,
false);
381 BOOST_CHECK_EQUAL(find_components_with_filter<Group>(const_group1(),
IsComponentTag(
"special")).empty() ,
false);
386 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
389 BOOST_FOREACH(
const Group& group, find_components_with_filter<Group>(const_group1(),
IsComponentTag(
"special")))
390 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
394 BOOST_CHECK_EQUAL(group.
name(),special_component_names[counter++]);
398 BOOST_CHECK_EQUAL(group.
name(),special_component_names[counter++]);
405 BOOST_CHECK_EQUAL(find_components_with_tag<Group>(group2(),
"special").empty() ,
true);
406 BOOST_CHECK_EQUAL(find_components_with_tag<Group>(const_group2(),
"special").empty() ,
true);
410 BOOST_CHECK_EQUAL(find_components_with_tag<Group>(group1(),
"special").empty() ,
false);
411 BOOST_CHECK_EQUAL(find_components_with_tag<Group>(const_group1(),
"special").empty() ,
false);
415 BOOST_FOREACH(
Group&
group, find_components_with_tag<Group>(group1(),
"special"))
416 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
418 BOOST_FOREACH(
const Group& group, find_components_with_tag<Group>(group1(),
"special"))
419 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
423 BOOST_CHECK_EQUAL(group.
name(),special_component_names[counter++]);
424 BOOST_CHECK_EQUAL(counter,special_component_names.size());
428 BOOST_CHECK_EQUAL(group.
name(),special_component_names[counter++]);
429 BOOST_CHECK_EQUAL(counter,special_component_names.size());
434 BOOST_CHECK_EQUAL(find_components_with_name<Group>(group1(),
"group1_2").empty() ,
false);
435 BOOST_CHECK_EQUAL(find_components_with_name<Group>(const_group1(),
"group1_2").empty() ,
false);
439 BOOST_FOREACH(
Group&
group, find_components_with_name<Group>(group1(),
"group1_2"))
440 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
442 BOOST_FOREACH(
const Group& group, find_components_with_name<Group>(const_group1(),
"group1_2"))
443 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
446 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
449 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
457 BOOST_FOREACH(
Group&
group, find_components_recursively<Group>(group1()))
458 BOOST_CHECK_EQUAL(group.
name(),group1_group_names[counter++]);
459 BOOST_CHECK_EQUAL(counter, group1_group_names.size());
462 BOOST_FOREACH(
const Group& group, find_components_recursively<Group>(group1()))
463 BOOST_CHECK_EQUAL(group.
name(),group1_group_names[counter++]);
464 BOOST_CHECK_EQUAL(counter, group1_group_names.size());
468 BOOST_CHECK_EQUAL(group.
name(),group1_component_names[counter++]);
469 BOOST_CHECK_EQUAL(counter, group1_component_names.size());
473 BOOST_CHECK_EQUAL(group.
name(),group1_component_names[counter++]);
474 BOOST_CHECK_EQUAL(counter, group1_component_names.size());
481 BOOST_CHECK_EQUAL(find_components_recursively_with_filter<Group>(group1(),
IsComponentTag(
"special")).empty() ,
false);
482 BOOST_CHECK_EQUAL(find_components_recursively_with_filter<Group>(const_group1(),
IsComponentTag(
"special")).empty() ,
false);
487 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
489 BOOST_FOREACH(
const Group& group, find_components_recursively_with_filter<Group>(const_group1(),
IsComponentTag(
"special")))
490 BOOST_CHECK_EQUAL(group.
name(),
"group1_2");
494 BOOST_CHECK_EQUAL(group.
name(),special_component_names[counter++]);
495 BOOST_CHECK_EQUAL(counter, special_component_names.size());
499 BOOST_CHECK_EQUAL(group.
name(),special_component_names[counter++]);
500 BOOST_CHECK_EQUAL(counter, special_component_names.size());
506 BOOST_CHECK_EQUAL(find_components_recursively_with_tag<Group>(group2(),
"very_special").empty() ,
false);
507 BOOST_CHECK_EQUAL(find_components_recursively_with_tag<Group>(const_group2(),
"very_special").empty() ,
false);
511 BOOST_FOREACH(
Group&
group, find_components_recursively_with_tag<Group>(group2(),
"very_special"))
512 BOOST_CHECK_EQUAL(group.
name(),
"group2_1_1");
514 BOOST_FOREACH(
const Group& group, find_components_recursively_with_tag<Group>(const_group2(),
"very_special"))
515 BOOST_CHECK_EQUAL(group.
name(),
"group2_1_1");
518 BOOST_CHECK_EQUAL(group.
name(),
"group2_1_1");
521 BOOST_CHECK_EQUAL(group.
name(),
"group2_1_1");
526 BOOST_CHECK_EQUAL(find_components_recursively_with_name<Group>(group2(),
"group2_1_1").empty() ,
false);
527 BOOST_CHECK_EQUAL(find_components_recursively_with_name<Group>(const_group2(),
"group2_1_1").empty() ,
false);
531 BOOST_FOREACH(
Group&
group, find_components_recursively_with_name<Group>(group2(),
"group2_1_1"))
532 BOOST_CHECK_EQUAL(group.
name(),
"group2_1_1");
534 BOOST_FOREACH(
const Group& group, find_components_recursively_with_name<Group>(const_group2(),
"group2_1_1"))
535 BOOST_CHECK_EQUAL(group.
name(),
"group2_1_1");
538 BOOST_CHECK_EQUAL(group.
name(),
"group2_1_1");
541 BOOST_CHECK_EQUAL(group.
name(),
"group2_1_1");
551 BOOST_CHECK_EQUAL(find_component<Group>(group2()).
name() ,
"group2_1" );
552 BOOST_CHECK(find_component_ptr<Group>(group2()) !=
nullptr );
553 BOOST_CHECK_EQUAL(find_component_ptr<Group>(group2())->
name() ,
"group2_1" );
554 BOOST_CHECK_EQUAL(find_component<Group>(const_group2()).
name() ,
"group2_1" );
555 BOOST_CHECK(find_component_ptr<Group>(const_group2()) !=
nullptr );
556 BOOST_CHECK_EQUAL(find_component_ptr<Group>(const_group2())->
name() ,
"group2_1" );
566 BOOST_CHECK_EQUAL(find_component_with_filter<Group>(group2(),
IsComponentName(
"group2_1")).
name() ,
"group2_1" );
567 BOOST_CHECK(find_component_ptr_with_filter<Group>(group2(),
IsComponentName(
"group2_1")) !=
nullptr );
568 BOOST_CHECK_EQUAL(find_component_ptr_with_filter<Group>(group2(),
IsComponentName(
"group2_1"))->
name() ,
"group2_1" );
569 BOOST_CHECK_EQUAL(find_component_with_filter<Group>(const_group2(),
IsComponentName(
"group2_1")).
name() ,
"group2_1" );
570 BOOST_CHECK(find_component_ptr_with_filter<Group>(const_group2(),
IsComponentName(
"group2_1")) !=
nullptr );
571 BOOST_CHECK_EQUAL(find_component_ptr_with_filter<Group>(const_group2(),
IsComponentName(
"group2_1"))->
name() ,
"group2_1" );
581 BOOST_CHECK_EQUAL(find_component_with_name<Group>(group2(),
"group2_1").
name() ,
"group2_1" );
582 BOOST_CHECK(find_component_ptr_with_name<Group>(group2(),
"group2_1") !=
nullptr );
583 BOOST_CHECK_EQUAL(find_component_ptr_with_name<Group>(group2(),
"group2_1")->
name() ,
"group2_1" );
584 BOOST_CHECK_EQUAL(find_component_with_name<Group>(const_group2(),
"group2_1").
name() ,
"group2_1" );
585 BOOST_CHECK(find_component_ptr_with_name<Group>(const_group2(),
"group2_1") !=
nullptr );
586 BOOST_CHECK_EQUAL(find_component_ptr_with_name<Group>(const_group2(),
"group2_1")->
name() ,
"group2_1" );
596 BOOST_CHECK_EQUAL(find_component_with_tag<Group>(group1(),
"special").
name() ,
"group1_2" );
597 BOOST_CHECK(find_component_ptr_with_tag<Group>(group1(),
"special") !=
nullptr );
598 BOOST_CHECK_EQUAL(find_component_ptr_with_tag<Group>(group1(),
"special")->
name() ,
"group1_2" );
599 BOOST_CHECK_EQUAL(find_component_with_tag<Group>(const_group1(),
"special").
name() ,
"group1_2" );
600 BOOST_CHECK(find_component_ptr_with_tag<Group>(const_group1(),
"special") !=
nullptr );
601 BOOST_CHECK_EQUAL(find_component_ptr_with_tag<Group>(const_group1(),
"special")->
name() ,
"group1_2" );
611 BOOST_CHECK_EQUAL(find_component_recursively<Group>(group2_1()).
name() ,
"group2_1_1" );
612 BOOST_CHECK(find_component_ptr_recursively<Group>(group2_1()) !=
nullptr );
613 BOOST_CHECK_EQUAL(find_component_ptr_recursively<Group>(group2_1())->
name() ,
"group2_1_1" );
614 BOOST_CHECK_EQUAL(find_component_recursively<Group>(const_group2_1()).
name() ,
"group2_1_1" );
615 BOOST_CHECK(find_component_ptr_recursively<Group>(const_group2_1()) !=
nullptr );
616 BOOST_CHECK_EQUAL(find_component_ptr_recursively<Group>(const_group2_1())->
name() ,
"group2_1_1" );
626 BOOST_CHECK_EQUAL(find_component_recursively_with_filter<Group>(group2(),
IsComponentTag(
"very_special")).
name() ,
"group2_1_1" );
627 BOOST_CHECK(find_component_ptr_recursively_with_filter<Group>(group2(),
IsComponentTag(
"very_special")) !=
nullptr );
628 BOOST_CHECK_EQUAL(find_component_ptr_recursively_with_filter<Group>(group2(),
IsComponentTag(
"very_special"))->
name() ,
"group2_1_1" );
629 BOOST_CHECK_EQUAL(find_component_recursively_with_filter<Group>(const_group2(),
IsComponentTag(
"very_special")).
name() ,
"group2_1_1" );
630 BOOST_CHECK(find_component_ptr_recursively_with_filter<Group>(const_group2(),
IsComponentTag(
"very_special")) !=
nullptr );
631 BOOST_CHECK_EQUAL(find_component_ptr_recursively_with_filter<Group>(const_group2(),
IsComponentTag(
"very_special"))->
name() ,
"group2_1_1" );
641 BOOST_CHECK_EQUAL(find_component_recursively_with_name<Group>(group2(),
"group2_1_1").
name() ,
"group2_1_1" );
642 BOOST_CHECK(find_component_ptr_recursively_with_name<Group>(group2(),
"group2_1_1") !=
nullptr );
643 BOOST_CHECK_EQUAL(find_component_ptr_recursively_with_name<Group>(group2(),
"group2_1_1")->
name() ,
"group2_1_1" );
644 BOOST_CHECK_EQUAL(find_component_recursively_with_name<Group>(const_group2(),
"group2_1_1").
name() ,
"group2_1_1" );
645 BOOST_CHECK(find_component_ptr_recursively_with_name<Group>(const_group2(),
"group2_1_1") !=
nullptr );
646 BOOST_CHECK_EQUAL(find_component_ptr_recursively_with_name<Group>(const_group2(),
"group2_1_1")->
name() ,
"group2_1_1" );
656 BOOST_CHECK_EQUAL(find_component_recursively_with_tag<Group>(group2(),
"very_special").
name() ,
"group2_1_1" );
657 BOOST_CHECK(find_component_ptr_recursively_with_tag<Group>(group2(),
"very_special") !=
nullptr );
658 BOOST_CHECK_EQUAL(find_component_ptr_recursively_with_tag<Group>(group2(),
"very_special")->
name() ,
"group2_1_1" );
659 BOOST_CHECK_EQUAL(find_component_recursively_with_tag<Group>(const_group2(),
"very_special").
name() ,
"group2_1_1" );
660 BOOST_CHECK(find_component_ptr_recursively_with_tag<Group>(const_group2(),
"very_special") !=
nullptr );
661 BOOST_CHECK_EQUAL(find_component_ptr_recursively_with_tag<Group>(const_group2(),
"very_special")->
name() ,
"group2_1_1" );
671 for (
Uint i = 0; i < 250 ; ++i)
678 std::cout <<
"iterate by [tag] over " << counter <<
" components in " << timer.elapsed() <<
" seconds" << std::endl;
688 for (
Uint i = 0; i < 250 ; ++i)
694 const Uint counter =
count(find_components_recursively<Group>(*mg) );
695 std::cout <<
"iterate by [type] over " << counter <<
" components in " << timer.elapsed() <<
" seconds" << std::endl;
705 for (
Uint i = 0; i < 10 ; ++i)
710 std::vector< Handle<Group> > vector =
range_to_vector(find_components_recursively<Group>(*mg));
711 BOOST_CHECK_EQUAL(vector.size() , 10u);
714 std::vector< Handle<Group const> > const_vector =
range_to_vector(find_components_recursively<Group>(*const_mg));
715 BOOST_CHECK_EQUAL(const_vector.size(), 10u);
718 BOOST_CHECK_EQUAL(const_vector.size(), 10u);
726 BOOST_FOREACH(
Component& comp, new_range )
731 BOOST_FOREACH(
Group& comp, new_range2 )
736 BOOST_FOREACH(
const Group& comp, new_range5 )
743 BOOST_FOREACH(
Group& comp, filtered_range( component_begin<Group>(
root()), component_end<Group>(
root()) ,
IsComponentName(
"group1") ) )
746 CFLogVar(group_range(component_begin<Group>(
root()),component_end<Group>(
root())).as_vector().size());
747 CFLogVar(group_range(component_begin<Group>(
root()),component_end<Group>(
root())).as_const_vector().size());
748 CFLogVar(group_range(component_begin<Group>(
root()),component_end<Group>(
root())).size());
759 BOOST_FOREACH(
const Group& comp, new_range3 )
764 BOOST_FOREACH(
const Group& comp, new_range6 )
772 BOOST_AUTO_TEST_SUITE_END()
ComponentReference< Component >::type find_component_recursively_with_filter(Component &parent, const Predicate &pred)
std::string name(ComponentWrapper &self)
boost::python::object get_child(ComponentWrapper &self, const std::string &name)
ComponentIteratorRangeSelector< Component, Component, Predicate >::type find_components_with_filter(Component &parent, const Predicate &pred)
ParentT & find_parent_component_with_filter(ComponentT &comp, const Predicate &pred)
std::vector< std::string > component_names
list of all component names
ComponentIteratorRangeSelector< Component, Component, Predicate >::type find_components_recursively_with_filter(Component &parent, const Predicate &pred)
Safe pointer to an object. This is the supported method for referring to components.
bool ExceptionOutputs
if exception contructor should output
std::vector< std::string > top_group_names
list of all group names at the top level
~ComponentIterationFixture()
common tear-down for each test case
ComponentReference< Component >::type find_component_with_tag(Component &parent, StringConverter tag)
ComponentIteratorRange< T, Predicate >::type make_filtered_range(const ComponentIterator< T > &from, const ComponentIterator< T > &to, const Predicate &pred)
URI uri() const
Construct the full path.
bool ExceptionDumps
if exception contructor should dump backtrace
const std::string & name() const
Access the name of the component.
Conversions from and to std::string.
ComponentIteratorRangeSelector< Component, Component, IsComponentName >::type find_components_with_name(Component &parent, StringConverter name)
ComponentIteratorRangeSelector< Component, Component, IsComponentTag >::type find_components_with_tag(Component &parent, StringConverter tag)
std::vector< std::string > group_names
list of all group names
#define CF3_DEBUG_POINT
Definition of a macro for placing a debug point in the code.
ComponentIteratorRangeSelector< Component, Component, IsComponentName >::type find_components_recursively_with_name(Component &parent, StringConverter name)
Common_API std::string to_str(const T &v)
Converts to std::string.
Handle< Component const > root() const
Holds the Component class, as well as the ComponentIterator class plus some functions related to comp...
const Group & const_group1()
ComponentHandle< Component >::type find_component_ptr_recursively_with_name(Component &parent, StringConverter name)
ComponentIterationFixture()
common setup for each test case
ComponentReference< Component >::type find_component_recursively_with_name(Component &parent, StringConverter name)
ComponentHandle< Component >::type find_component_ptr_recursively(Component &parent)
ComponentHandle< Component >::type find_component_ptr_recursively_with_filter(Component &parent, const Predicate &pred)
ComponentHandle< Component >::type find_component_ptr_recursively_with_tag(Component &parent, StringConverter tag)
BOOST_AUTO_TEST_CASE(test_find_parent)
std::vector< std::string > group1_group_names
list of all group names at in group1
ComponentReference< Component >::type find_component_with_name(Component &parent, StringConverter name)
std::vector< std::string > group1_component_names
list of all group names at in group1
const Component & const_root()
const root
std::vector< std::string > special_component_names
list of all components with a tag "special"
ComponentHandle< Component >::type find_component_ptr_with_name(Component &parent, StringConverter name)
Component for grouping other components.
ComponentIteratorRangeSelector< Component, Component >::type find_components(Component &parent)
std::vector< std::string > top_component_names
list of all component names on the first level
ComponentIterator class, can linearize a complete tree of components
ComponentHandle< Component >::type find_component_ptr_with_tag(Component &parent, StringConverter tag)
Top-level namespace for coolfluid.
std::vector< Handle< const T > > range_to_const_vector(boost::iterator_range< ComponentIterator< T > > range)
ComponentReference< Component >::type find_component_with_filter(Component &parent, const Predicate &pred)
static ExceptionManager & instance()
Gets the instance of the manager.
impl< typename boost::is_abstract< Predicate >::type >::type type
ComponentHandle< Component >::type find_component_ptr(Component &parent)
void add_tag(const std::string &tag)
ComponentReference< Component >::type find_component(Component &parent)
ComponentIteratorRange< T, Predicate > make_new_range(ComponentIterator< T > from, ComponentIterator< T > to, const Predicate &pred=IsComponentTrue())
std::vector< Handle< T > > range_to_vector(boost::iterator_range< ComponentIterator< T > > range)
Create a vector of handles of components, given an iterator_range.
#define CFLogVar(x)
log the value of a variable
ComponentReference< Component >::type find_component_recursively_with_tag(Component &parent, StringConverter tag)
bool ExceptionAborts
if exception contructor should abort execution immedietly
static boost::proto::terminal< ExpressionGroupTag >::type group
Use group(expr1, expr2, ..., exprN) to evaluate a group of expressions.
boost::shared_ptr< Component > m_root
unsigned int Uint
typedef for unsigned int
ComponentIteratorRangeSelector< Component, Component >::type find_components_recursively(Component &parent)
ComponentHandle< Component >::type find_component_ptr_with_filter(Component &parent, const Predicate &pred)
const Group & const_group3()
ComponentReference< Component >::type find_component_recursively(Component &parent)
Component & root()
mutable root
Base class for defining CF components.
Handle< Component > create_component(const std::string &name, const std::string &builder)
Build a (sub)component of this component using the extended type_name of the component.
Most basic kernel library.
std::string string() const
Uint count(const RangeT &range)
Count the elements in a range.
ComponentIteratorRangeSelector< Component, Component, IsComponentTag >::type find_components_recursively_with_tag(Component &parent, StringConverter tag)
const Group & const_group2_1()
const Group & const_group2()