00001 /* 00002 * Copyright (c) 2004 CSIRO ICT Centre 00003 * 00004 * $Id: NestedLoopFilter.cpp 587 2004-12-03 15:06:33Z nch $ 00005 */ 00006 00007 #include <list> 00008 #include "String.h" 00009 00010 #include "ActiveObject.h" 00011 #include "Object.h" 00012 #include "Matcher.h" 00013 #include "NestedLoopFilter.h" 00014 00015 00016 String NestedLoopFilter::s_name("NestedLoopFilter"); 00017 00018 00019 NestedLoopFilter::NestedLoopFilter(Matcher * matcher) 00020 : Filter(matcher) 00021 { 00022 } 00023 00024 NestedLoopFilter::~NestedLoopFilter() 00025 { 00026 } 00027 00028 void NestedLoopFilter::filter() 00029 { 00030 preFilter(); 00031 00032 // load all objects from the active producer into the active list 00033 Object const * activeObject = 0; 00034 while ((activeObject = matcher->nextActiveObject()) != 0) 00035 { 00036 matcher->addActiveObject(activeObject); 00037 } 00038 00039 // while the test producer has more objects... 00040 Object const * testObj = 0; 00041 while ((testObj = matcher->nextTestObject()) != 0) 00042 { 00043 matcher->test(testObj); 00044 } 00045 00046 postFilter(); 00047 }