Public Member Functions
ibis::qUIntHod Class Reference

This query expression has similar meaning as ibis::qDiscreteRange, however, it stores the values as unsigned 64-bit integers. More...

#include <qExpr.h>

Inheritance diagram for ibis::qUIntHod:
ibis::qRange ibis::qExpr

List of all members.

Public Member Functions

const char * colName () const
 Name of the column involved.
virtual qUIntHoddup () const
 Duplicate thy self.
virtual bool empty () const
 Is the current range empty?
const ibis::array_t< uint64_t > & getValues () const
 Reference to the values.
ibis::array_t< uint64_t > & getValues ()
 Reference to the values.
virtual bool inRange (double val) const
 Is the argument val one of the values stored ? Return true or false.
virtual bool inRange (uint64_t val) const
 Is the argument val one of the values stored ? Return true or false.
virtual double leftBound () const
 The lower bound of the range.
virtual uint32_t nItems () const
 Count the number of items in the query expression.
virtual void print (std::ostream &) const
 Print a short version of the expression.
virtual void printFull (std::ostream &) const
 Print a long version of the expression.
 qUIntHod ()
 Default constructor.
 qUIntHod (const char *col, uint64_t v1)
 Constructor. Take a single number.
 qUIntHod (const char *col, uint64_t v1, uint64_t v2)
 Constructor. Take two numbers.
 qUIntHod (const char *col, const char *nums)
 Constructor.
template<typename T >
 qUIntHod (const char *col, const std::vector< T > &nums)
 Constructor.
template<typename T >
 qUIntHod (const char *col, const ibis::array_t< T > &nums)
 Constructor.
 qUIntHod (const qUIntHod &ih)
 Copy constructor.
virtual void restrictRange (double, double)
 Reduce the range to be no more than [left, right].
virtual double rightBound () const
 The upper bound of the range.
virtual ~qUIntHod ()
 Destructor.

Detailed Description

This query expression has similar meaning as ibis::qDiscreteRange, however, it stores the values as unsigned 64-bit integers.

This is primarily useful for matching 64-bit integers.

Note:
About the name: hod is a portable trough for carrying mortar, bricks, and so on. We use it here as a short-hand for container. Since this class is not meant for user by others, this is a suitable obscure name for it.

Constructor & Destructor Documentation

ibis::qUIntHod::qUIntHod ( const char *  col,
const char *  nums 
)

Constructor.

This Constructor takes a list of values in a string. The values are extracted using the function ibis::util::readUInt.

References ibis::array_t< T >::deduplicate(), ibis::util::delimiters, ibis::gVerbose, ibis::array_t< T >::push_back(), and ibis::util::readUInt().

template<typename T >
ibis::qUIntHod::qUIntHod ( const char *  col,
const std::vector< T > &  nums 
)

Constructor.

It converts all incoming values into 64-bit unsigned integers. This conversion process may fail for certain data types.

Warning:
During the coversion process, fractional values will be dropped and large floating-point values will be translated into undefined integers.

References ibis::util::copy(), and ibis::array_t< T >::deduplicate().

template<typename T >
ibis::qUIntHod::qUIntHod ( const char *  col,
const ibis::array_t< T > &  nums 
)

Constructor.

It converts all incoming values into 64-bit signed integers, which may fail for certain data types.

Warning:
During the coversion process, fractional values will be dropped and large floating-point values will be translated into undefined integers. Unsigned 64-bit integers could be treated as negative numbers if they are large.

References ibis::util::copy(), and ibis::array_t< T >::deduplicate().


Member Function Documentation

bool ibis::qUIntHod::inRange ( double  val) const [inline, virtual]

Is the argument val one of the values stored ? Return true or false.

It uses a binary search if there are more than 32 elements and uses linear search otherwise.

Implements ibis::qRange.

Referenced by ibis::part::doCompare(), and ibis::part::doCount().

bool ibis::qUIntHod::inRange ( uint64_t  val) const [inline, virtual]

Is the argument val one of the values stored ? Return true or false.

It uses a binary search if there are more than 32 elements and uses linear search otherwise.

void ibis::qUIntHod::printFull ( std::ostream &  out) const [virtual]

Print a long version of the expression.

This function appends 'ULL' to each number so that they are guaranteed to be translated to the same type query expression is the output is sent back to the parser again.

Reimplemented from ibis::qExpr.


The documentation for this class was generated from the following files:

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