Public Member Functions
ibis::qIntHod Class Reference

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

#include <qExpr.h>

Inheritance diagram for ibis::qIntHod:
ibis::qRange ibis::qExpr

List of all members.

Public Member Functions

const char * colName () const
 Name of the column involved.
virtual qIntHoddup () const
 Duplicate thy self.
virtual bool empty () const
 Is the current range empty?
const ibis::array_t< int64_t > & getValues () const
 Reference to the values.
ibis::array_t< int64_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 (int64_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 query expression.
virtual void printFull (std::ostream &) const
 Print the full list of values.
 qIntHod ()
 Default constructor.
 qIntHod (const char *col, int64_t v1)
 Constructor. Take a single number.
 qIntHod (const char *col, const char *nums)
 Constructor.
template<typename T >
 qIntHod (const char *col, const std::vector< T > &nums)
 Constructor.
 qIntHod (const qIntHod &ih)
 Copy constructor.
 qIntHod (const char *col, int64_t v1, int64_t v2)
 Constructor. Take two numbers.
template<typename T >
 qIntHod (const char *col, const ibis::array_t< T > &nums)
 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 ~qIntHod ()
 Destructor.

Detailed Description

This query expression has similar meaning as ibis::qDiscreteRange, however, it stores the values as signed 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::qIntHod::qIntHod ( 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::readInt.

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

template<typename T >
ibis::qIntHod::qIntHod ( const char *  col,
const std::vector< 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.

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

template<typename T >
ibis::qIntHod::qIntHod ( 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::qIntHod::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(), ibis::part::doCount(), and ibis::part::negativeCompare().

bool ibis::qIntHod::inRange ( int64_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::qIntHod::printFull ( std::ostream &  out) const [virtual]

Print the full list of values.

The number are follwed by suffix 'LL' to ensure the resulting string can be parsed back as the same expression.

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