filter.h
Go to the documentation of this file.
00001 // File: $Id$
00002 // Author: John Wu <John.Wu at ACM.org>
00003 // Copyright 2010-2012 the Regents of the University of California
00004 #ifndef IBIS_FILTER_H
00005 #define IBIS_FILTER_H
00006 
00014 #include "quaere.h"             // ibis::quaere
00015 #include "whereClause.h"        // ibis::whereClause
00016 #include "selectClause.h"       // ibis::selectClause
00017 
00018 namespace ibis {
00019     class filter;       // forward definition
00020 } // namespace ibis
00021 
00025 class ibis::filter : public ibis::quaere {
00026 public:
00028     explicit filter(const ibis::whereClause* w);
00030     filter(const ibis::selectClause* s, const ibis::constPartList* p,
00031            const ibis::whereClause* w);
00033     virtual ~filter();
00034 
00035     virtual void    roughCount(uint64_t& nmin, uint64_t& nmax) const;
00036     virtual int64_t count() const;
00037     virtual table*  select() const;
00038     virtual table*  select(const char*) const;
00039     virtual table*  select(const ibis::table::stringList& colnames) const;
00040 
00041     static table*   sift(const ibis::selectClause  &sel,
00042                          const ibis::constPartList &pl,
00043                          const ibis::whereClause   &wc);
00044     static table*   sift0(const ibis::selectClause  &,
00045                           const ibis::constPartList &);
00046     static table*   sift0S(const ibis::selectClause  &,
00047                            const ibis::constPartList &);
00048     static table*   sift1(const ibis::selectClause  &,
00049                           const ibis::constPartList &,
00050                           const ibis::whereClause   &);
00051     static table*   sift1S(const ibis::selectClause  &,
00052                            const ibis::constPartList &,
00053                            const ibis::whereClause   &);
00054     static table*   sift2(const ibis::selectClause  &,
00055                           const ibis::constPartList &,
00056                           const ibis::whereClause   &);
00057     static table*   sift2(const ibis::selectClause  &,
00058                           const ibis::constPartList &,
00059                           const ibis::array_t<ibis::bitvector*> &);
00060     static table*   sift2(const ibis::selectClause  &,
00061                           const ibis::constPartList &,
00062                           const ibis::whereClause   &,
00063                           ibis::array_t<ibis::bitvector*> &);
00064     static table*   sift2S(const ibis::selectClause  &,
00065                            const ibis::constPartList &,
00066                            const ibis::whereClause   &);
00067     static table*   sift2S(const ibis::selectClause  &,
00068                            const ibis::constPartList &,
00069                            const ibis::array_t<ibis::bitvector*> &);
00070     static table*   sift2S(const ibis::selectClause  &,
00071                            const ibis::constPartList &,
00072                            const ibis::whereClause   &,
00073                            ibis::array_t<ibis::bitvector*> &);
00074 
00075 protected:
00077     const ibis::whereClause *wc_;
00079     const ibis::constPartList *parts_;
00083     const ibis::selectClause *sel_;
00086     mutable array_t<ibis::bitvector*> hits_;
00088     mutable array_t<ibis::bitvector*> cand_;
00089 
00092     filter() : wc_(0), parts_(0), sel_(0) {}
00093 
00094 private:
00095     filter(const filter&); // no copying
00096     filter& operator=(const filter&); // no assignment
00097 }; // class ibis::filter
00098 #endif

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive