jnatural.h
Go to the documentation of this file.
00001 // File: $Id$
00002 // Author: John Wu <John.Wu at ACM.org>
00003 // Copyright 2008-2011 the Regents of the University of California
00004 #ifndef IBIS_JNATURAL_H
00005 #define IBIS_JNATURAL_H
00006 
00012 #include "quaere.h"     // ibis::quaere
00013 
00014 namespace ibis {
00015     class jNatural; // forward definition
00016 } // namespace ibis
00017 
00024 class FASTBIT_CXX_DLLSPEC ibis::jNatural : public ibis::quaere {
00025 public:
00026     jNatural(const ibis::part* partr, const ibis::part* parts,
00027              const char* colname, const char* condr, const char* conds,
00028              const char* sel);
00029     jNatural(const ibis::part* partr, const ibis::part* parts,
00030              const ibis::column* colr, const ibis::column* cols,
00031              const ibis::qExpr* condr, const ibis::qExpr* conds,
00032              const ibis::selectClause* sel, const ibis::fromClause* frm,
00033              const char* desc);
00034     virtual ~jNatural();
00035 
00036     virtual void roughCount(uint64_t& nmin, uint64_t& nmax) const;
00037     virtual int64_t count() const;
00038 
00039     virtual ibis::table* select() const;
00040     virtual ibis::table* select(const ibis::table::stringList& colnames) const;
00041 
00042 protected:
00043     std::string desc_;
00044     const ibis::selectClause *sel_;
00045     const ibis::fromClause *frm_;
00046     const ibis::part& R_;
00047     const ibis::part& S_;
00048     const ibis::column& colR_;
00049     const ibis::column& colS_;
00050     ibis::bitvector maskR_;
00051     ibis::bitvector maskS_;
00052 
00053     mutable array_t<uint32_t> *orderR_;
00054     mutable array_t<uint32_t> *orderS_;
00055     mutable void *valR_;
00056     mutable void *valS_;
00057     mutable int64_t nrows;
00058 
00059     template <typename T>
00060     static table*
00061     fillResult(size_t nrows,
00062                const std::string &desc,
00063                const ibis::array_t<T>& rjcol,
00064                const ibis::table::typeList& rtypes,
00065                const ibis::table::bufferList& rbuff,
00066                const ibis::array_t<T>& sjcol,
00067                const ibis::table::typeList& stypes,
00068                const ibis::table::bufferList& sbuff,
00069                const ibis::table::stringList& cnamet,
00070                const std::vector<uint32_t>& cnpos);
00071     static table*
00072     fillResult(size_t nrows,
00073                const std::string &desc,
00074                const std::vector<std::string>& rjcol,
00075                const ibis::table::typeList& rtypes,
00076                const ibis::table::bufferList& rbuff,
00077                const std::vector<std::string>& sjcol,
00078                const ibis::table::typeList& stypes,
00079                const ibis::table::bufferList& sbuff,
00080                const ibis::table::stringList& cnamet,
00081                const std::vector<uint32_t>& cnpos);
00082 
00083 private:
00084     jNatural(const jNatural&); // no copying
00085     jNatural& operator=(const jNatural&); // no assignment
00086 }; // class ibis::jNatural
00087 #endif

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