CrossMatch.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2004 CSIRO ICT Centre
00003  *
00004  * $Id: CrossMatch.h 1192 2005-09-20 15:21:27Z rsc $
00005  */
00006 
00007 /*
00008  * Implements the Matcher interface for catalogue cross matching.
00009  *
00010  * Implements the generic matcher methods required for various filter
00011  * algorithms. Also provides an efficient plane sweep filter.
00012  *
00013  * Two object producers are required, plus two object consumers to report
00014  * those objects that don't match and a pair consumer for those that do.
00015  *
00016  * The active list is required to maintain an efficient set of active
00017  * objects for testing against the test obejcts.
00018  *
00019  * The producers and active list are owned by this class and are deleted
00020  * by the destructor.
00021  */
00022 
00023 #ifndef CROSSMATCH_DEFINED
00024 #define CROSSMATCH_DEFINED
00025 
00026 #include "String.h"
00027 
00028 #include "ActiveList.h"
00029 #include "Matcher.h"
00030 #include "ObjectConsumer.h"
00031 
00032 class Object;
00033 class ObjectPairConsumer;
00034 class ObjectProducer;
00035 
00036 
00037 class CrossMatch : public Matcher
00038 {
00039   public:
00040     CrossMatch(ObjectProducer * activeProd,
00041                ObjectProducer * testProd,
00042                ActiveList * activeList,
00043                ObjectPairConsumer * pairCons,
00044                ObjectConsumer * uActiveCons,
00045                ObjectConsumer * uTestCons);
00046     virtual ~CrossMatch();
00047 
00048     virtual String const & getName() const { return name(); };
00049     static String const & name() { return s_name; };
00050 
00051     virtual void getReady();
00052     virtual void finished();
00053     virtual void doFilter();
00054 
00055     virtual Object const * nextActiveObject() { return nextObject(activeProducer); };
00056     virtual Object const * nextTestObject() { return nextObject(testProducer); };
00057 
00058     virtual double getLowerBound(Object const * testObject);
00059     virtual double getUpperBound(Object const * testObject);
00060 
00061     virtual void addActiveObject(Object const * activeObject)
00062                     { activeList->pushBack(activeObject); };
00063 
00064     virtual void reportActiveNoMatch(Object const * activeObject)
00065                     { reportNoMatch(uActiveConsumer, activeObject); };
00066     virtual void reportTestNoMatch(Object const * testObject)
00067                     { reportNoMatch(uTestConsumer, testObject); };
00068 
00069     virtual void test(Object const * testObject);
00070 
00071     virtual void flushActiveObjects(double lowerBound);
00072     virtual void flushActiveObjects(Object const * activeObject);
00073 
00074   protected:
00075     virtual double setAngularUpperLimit(Object const * testObject) const;
00076 
00077   private:
00078     static String const s_name;
00079 
00080     ObjectProducer * activeProducer;
00081     ObjectProducer * testProducer;
00082     ObjectConsumer * uActiveConsumer;
00083     ObjectConsumer * uTestConsumer;
00084     ActiveList *     activeList;
00085 
00086     CrossMatch();
00087     CrossMatch(CrossMatch const &);
00088     CrossMatch & operator=(CrossMatch const &);
00089 
00090     void test(Object const * & testObject, double & lowerBound, double & upperBound);
00091 
00092     void raceThroughProducer(ObjectProducer * producer,
00093                              Object const * currentObject,
00094                              ObjectConsumer * uCons);
00095     Object const * raceThroughProducer(ObjectProducer * producer,
00096                                        Object const * currentObject,
00097                                        double limit,
00098                                        ObjectConsumer * uCons);
00099 
00100     Object const * reportUnmatchedObject(ObjectProducer * producer,
00101                                          Object const * currentObject,
00102                                          ObjectConsumer * uCons);
00103 };
00104 
00105 
00106 #endif // ifndef CROSSMATCH_DEFINED
Generated on Mon Oct 4 10:39:55 2010 for Matching.kdevelop by  doxygen 1.6.3