This project has retired. For details please refer to its Attic page.
tmudr: tmudr::OrderInfo Class Reference

tmudr::OrderInfo Class Reference

Ordering of a table by some ascending or descending columns. More...

#include <sqludr.h>

Public Types

enum  OrderTypeCode { NO_ORDER, ASCENDING, DESCENDING }
 

Ascending/descending order of columns.

More...

Public Member Functions

int getNumEntries () const
int getColumnNum (int i) const
OrderTypeCode getOrderType (int i) const
void addEntry (int colNum, OrderTypeCode orderType=ASCENDING)
void addEntryAt (int pos, int colNum, OrderTypeCode orderType=ASCENDING)
void clear ()

Detailed Description

Ordering of a table by some ascending or descending columns.

A list of columns, represented by column numbers, with an ascending/descending indicator for each column.


Member Enumeration Documentation

Ascending/descending order of columns.

For outputs, the ordering of values from the first row out to the last. Note that this ordering applies within a parallel instance of the UDF at runtime, but it does not guarantee a total order. For example, two parallel instances may get these ordered values: instance 0 gets 1,3,5,7 instance 1 gets 2,4,6,8

Enumerator:
NO_ORDER 

Unspecified order.

ASCENDING 

Ascending order.

DESCENDING 

Descending order.


Member Function Documentation

void OrderInfo::addEntry ( int  colNum,
OrderTypeCode  orderType = ASCENDING 
)

Append an entry to the ordering.

Parameters:
colNum Column number to append to the ordering.
orderType Order type (ascending or descending) to use.
void OrderInfo::addEntryAt ( int  pos,
int  colNum,
OrderTypeCode  orderType = ASCENDING 
)

Insert an entry at any position of the ordering.

A quick example to illustrate this: Let's say we have a table with columns (a,b,c). Their column numbers are 0, 1, and 2. We produce an ordering (C ASCENDING):

 OrderInfo myorder;
  
  myorder.addEntryAt(0, 2); 

Next, we want to make this into (B DESCENDING, C ASCENDING):

 myorder.addEntryAt(0, 1, DESCENDING); 
Parameters:
pos Position (0-based) at which we want to insert. The new entry will be position "pos" after the insertion, any existing entries will be moved up.
colNum Number of the column by which we want to order
orderType Order type (ascending or descending) to use
Exceptions:
UDRException 
void OrderInfo::clear (  ) 

Clear the contents of the object

int OrderInfo::getColumnNum ( int  i  )  const

Get the column number of an entry of the ordering.

Parameters:
i the position (0-based) of the ordering, 0 meaning the leading position.
Returns:
The column number of the n-th entry of the ordering (both are 0-based).
Exceptions:
UDRException 
int OrderInfo::getNumEntries (  )  const

Get the number of entries (columns) in the ordering.

Returns:
Number of entries/columns that make up the ordering.
OrderInfo::OrderTypeCode OrderInfo::getOrderType ( int  i  )  const

Get the order type of an entry of the ordering.

Parameters:
i the position (0-based) of the ordering, 0 meaning the leading position.
Returns:
The order type of the n-th entry of the ordering (0-based).
Exceptions:
UDRException 

The documentation for this class was generated from the following files:
 All Data Structures Functions Enumerations Enumerator

Generated on 31 Aug 2016 for tmudr by  doxygen 1.6.1