Public Member Functions | List of all members
ibis::colStrings Class Reference

A class to store string values. More...

#include <colValues.h>

Inheritance diagram for ibis::colStrings:
ibis::colValues

Public Member Functions

virtual void bottomk (uint32_t k, array_t< uint32_t > &ind) const
 Find positions of the k smallest strings.
 
 colStrings (const ibis::column *c, const ibis::bitvector &hits)
 
 colStrings (const ibis::column *c)
 Construct ibis::colStrings from an existing list of strings.
 
 colStrings (size_t n, const std::string &v)
 
virtual uint32_t elementSize () const
 
virtual bool empty () const
 
virtual void erase (uint32_t i, uint32_t j)
 
virtual void * getArray () const
 Return the pointer to the pointer to underlying array_t<T> object.
 
virtual double getDouble (uint32_t) const
 Return the ith value as double. NOT implemented.
 
virtual float getFloat (uint32_t) const
 Return the ith value as float. NOT implemented.
 
virtual int32_t getInt (uint32_t) const
 Return the ith value as int. NOT implemented.
 
virtual int64_t getLong (uint32_t) const
 Return the ith value as long. NOT implemented.
 
virtual double getMax () const
 Compute the maximum. NOT implemented.
 
virtual double getMin () const
 Compute the minimum. NOT implemented.
 
virtual double getSum () const
 Compute the sum. NOT implemented.
 
virtual ibis::TYPE_T getType () const
 Return the type of the data stored.
 
virtual uint32_t getUInt (uint32_t) const
 Return the ith value as unsigned int. NOT implemented.
 
virtual uint64_t getULong (uint32_t) const
 Return the ith value as unsigned long. NOT implemented.
 
virtual void nosharing ()
 Make sure the content of the underlying storage is not shared.
 
virtual void reduce (const array_t< uint32_t > &starts)
 remove the duplicate elements according to the array starts
 
virtual void reduce (const array_t< uint32_t > &starts, ibis::selectClause::AGREGADO func)
 
virtual void reorder (const array_t< uint32_t > &ind)
 Reorder the values according to the specified indices. More...
 
virtual array_t< uint32_t > * segment (const array_t< uint32_t > *old=0) const
 Produce an array of the starting positions of values that are the same. More...
 
virtual uint32_t size () const
 
virtual void sort (uint32_t i, uint32_t j, bundle *bdl)
 Sort rows in the range [i, j).
 
virtual void sort (uint32_t i, uint32_t j, bundle *bdl, colList::iterator head, colList::iterator tail)
 Sort rows in the range [i, j). More...
 
virtual void sort (uint32_t i, uint32_t j, array_t< uint32_t > &neworder) const
 Sort rows in the range [i, j). More...
 
virtual void swap (uint32_t i, uint32_t j)
 
void swap (colStrings &rhs)
 
virtual void topk (uint32_t k, array_t< uint32_t > &ind) const
 Fill the array ind with positions of the k largest elements. More...
 
virtual long truncate (uint32_t keep)
 Truncate the number element to no more than keep.
 
virtual long truncate (uint32_t keep, uint32_t start)
 Truncate the number element to no more than keep.
 
virtual long write (FILE *fptr) const
 Write out whole array as binary. More...
 
virtual void write (std::ostream &out, uint32_t i) const
 Write ith element as text. More...
 
- Public Member Functions inherited from ibis::colValues
bool canSort () const
 
const ibis::columncolumnPointer () const
 
const char * name () const
 Name.
 
const ibis::columnoperator-> () const
 Provide a pointer to the column containing the selected values.
 
void setTimeFormat (const char *, const char *=0)
 Add a custom format for the column to be interpretted as unix time stamps.
 
void swap (colValues &rhs)
 

Additional Inherited Members

- Static Public Member Functions inherited from ibis::colValues
static colValuescreate (const ibis::column *c)
 Implementation of the colValues class hierarchy. More...
 
static colValuescreate (const ibis::column *c, const ibis::bitvector &hits)
 Construct from a hit vector.
 
static colValuescreate (const ibis::column *c, ibis::fileManager::storage *store, const uint32_t start, const uint32_t end)
 Construct from content of the file (pointed by store). More...
 
- Protected Member Functions inherited from ibis::colValues
 colValues (const ibis::column *c)
 
- Protected Attributes inherited from ibis::colValues
const ibis::columncol
 
ibis::column::unixTimeScribeutform
 !< The column where the value is from.
 

Detailed Description

A class to store string values.

Member Function Documentation

void ibis::colStrings::reorder ( const array_t< uint32_t > &  ind)
virtual

Reorder the values according to the specified indices.

New[i] = Old[ind[i]].

Implements ibis::colValues.

References ibis::array_t< T >::size().

ibis::array_t< uint32_t > * ibis::colStrings::segment ( const array_t< uint32_t > *  old = 0) const
virtual

Produce an array of the starting positions of values that are the same.

Implements ibis::colValues.

References ibis::array_t< T >::push_back(), and ibis::array_t< T >::size().

virtual void ibis::colStrings::sort ( uint32_t  i,
uint32_t  j,
bundle bdl,
colList::iterator  head,
colList::iterator  tail 
)
virtual

Sort rows in the range [i, j).

Also sort the columns between [head, tail).

Implements ibis::colValues.

void ibis::colStrings::sort ( uint32_t  i,
uint32_t  j,
array_t< uint32_t > &  neworder 
) const
virtual

Sort rows in the range [i, j).

Output the new order in array neworder.

Implements ibis::colValues.

References ibis::array_t< T >::clear(), ibis::array_t< T >::push_back(), and ibis::array_t< T >::reserve().

void ibis::colStrings::topk ( uint32_t  k,
array_t< uint32_t > &  ind 
) const
virtual

Fill the array ind with positions of the k largest elements.

The array may contain more than k elements, if the kth largest element is not unique. The array may contain less than k elements if this object contains less than k elements. The array ind contains the largest element in ascending order with the index to the largest string at the end.

Implements ibis::colValues.

References ibis::array_t< T >::clear(), and ibis::array_t< T >::resize().

long ibis::colStrings::write ( FILE *  fptr) const
virtual

Write out whole array as binary.

All bytes including the null terminators are written to the file.

Implements ibis::colValues.

void ibis::colStrings::write ( std::ostream &  out,
uint32_t  i 
) const
virtual

Write ith element as text.

All valid strings (i.e., nonzero char*) are printed with double quotes. An empty string is printed with two double quotes right next to each other as "". Nothing will be printed if the arguments are invalid or out of range, and if this object itself is ill-formed.

Implements ibis::colValues.


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