rasdaman complete source
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
QtNode Class Referenceabstract

#include <qtnode.hh>

Inheritance diagram for QtNode:
QtExecute QtONCStream QtOperation QtCommand QtDelete QtInsert QtUpdate QtIterator QtMDDAccess QtBinaryOperation QtConst QtMddCfgOp QtNaryOperation QtUnaryOperation QtVariable

Classes

struct  QtTrimElement
 struct containing dimension and triming information More...
 

Public Types

enum  QtNodeType {
  QT_UNDEFINED_NODE, QT_MDD_ACCESS, QT_OPERATION_ITERATOR, QT_SELECTION_ITERATOR,
  QT_JOIN_ITERATOR, QT_UPDATE, QT_INSERT, QT_DELETE,
  QT_COMMAND, QT_PLUS, QT_MINUS, QT_MULT,
  QT_DIV, QT_OR, QT_AND, QT_XOR,
  QT_IS, QT_EQUAL, QT_NOT_EQUAL, QT_LESS,
  QT_LESS_EQUAL, QT_NOT, QT_SQRT, QT_EXECUTE,
  QT_ONC_STREAM, QT_ITERATOR, QT_OPERATION, QT_BINARY_OPERATION,
  QT_BINARY_INDUCE, QT_GROUP_ITERATOR, QT_IDENT, QT_NARY_OPERATION,
  QT_UNARY_OPERATION, QT_CONDENSE, QT_UNARY_INDUCE, QT_ABS,
  QT_EXP, QT_LOG, QT_LN, QT_SIN,
  QT_COS, QT_TAN, QT_SINH, QT_COSH,
  QT_TANH, QT_ARCSIN, QT_ARCCOS, QT_ARCTAN,
  QT_REALPART, QT_IMAGINARPART, QT_CAST, QT_CSE_ROOT,
  QT_DOMAIN_OPERATION, QT_ALL, QT_SOME, QT_COUNTCELLS,
  QT_ADDCELLS, QT_AVGCELLS, QT_MINCELLS, QT_MAXCELLS,
  QT_MDD_VAR, QT_MDD_STREAM, QT_CONST, QT_DOT,
  QT_CONVERSION, QT_OID, QT_INTERVALOP, QT_MINTERVALOP,
  QT_POINTOP, QT_LO, QT_HI, QT_SDOM,
  QT_SHIFT, QT_EXTEND, QT_MARRAYOP, QT_CONDENSEOP,
  QT_SCALE, QT_OVERLAY, QT_BIT, QT_PYRAMID,
  QT_ENCODE, QT_CONCAT, QT_CASEOP, QT_INFO,
  QT_LAST_NODE_TYPE
}
 
enum  QtAreaType { QT_AREA_MDD, QT_AREA_SCALAR }
 
enum  QtChildType { QT_DIRECT_CHILDS, QT_LEAF_NODES, QT_ALL_NODES }
 
typedef std::vector< QtData * > QtDataList
 list of QtData pointers More...
 
typedef std::vector
< QtTrimElement * > 
QtTrimList
 list of QtTrimData structures More...
 
typedef std::list< QtNode * > QtNodeList
 list of QtNode pointers More...
 
typedef std::vector
< QtOperation * > 
QtOperationList
 list of QtOperation pointers More...
 

Public Member Functions

 QtNode ()
 default constructor More...
 
 QtNode (QtNode *node)
 constructor getting a pointer to the parent More...
 
virtual ~QtNode ()
 destructor More...
 
bool subtype (enum QtNodeType a, enum QtNodeType b)
 returns weather class b is a subtype of class a More...
 
virtual QtNodeListgetChilds (QtChildType flag)
 return childs of the node More...
 
QtNodeListgetChild (const QtNodeType node, QtChildType flag=QT_DIRECT_CHILDS)
 return childs of a certain class More...
 
virtual bool equalMeaning (QtNode *node)
 test if the two nodes have an equal meaning in a subtree More...
 
virtual std::string getSpelling ()
 creates a unique name for a common subexpression More...
 
virtual QtAreaType getAreaType ()
 test if the edge to the parent node is of type mdd or atomic More...
 
virtual void simplify ()
 simplifies the tree More...
 
virtual void printTree (int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)=0
 prints the tree More...
 
virtual void printAlgebraicExpression (std::ostream &s=std::cout)=0
 prints the algebraic expression More...
 
virtual const QtNodeType getNodeType () const
 methods for identification of nodes More...
 
enum QtNodeType getQtNodeTypeParent (enum QtNodeType)
 method for pre optimizations (basically load optimization) More...
 
virtual void setInput (QtOperation *inputOld, QtOperation *inputNew)
 
QtNodegetParent () const
 
void setParent (QtNode *node)
 
const ParseInfogetParseInfo ()
 
void setParseInfo (const ParseInfo &info)
 

Static Public Attributes

static const int QtNodes
 number of QtNodeTypes More...
 
static const QtNodeType QtRoot
 the root of the inheritance tree More...
 
static const QtNodeType QtInheritance [][2]
 the inheritance relations list More...
 

Protected Member Functions

void startTimer (const char *name)
 start node timer (called at evaluation time) More...
 
void stopTimer ()
 stop timer (at end of evaluation) More...
 
void pauseTimer ()
 pause More...
 
void resumeTimer ()
 resume More...
 
std::string getEvaluationTime ()
 get elapsed time if timer was started, returns a string e.g. "15 usecs" More...
 

Protected Attributes

ParseInfo parseInfo
 attribute for parser info More...
 

Friends

bool operator< (const QtNodePair a, const QtNodePair b)
 operator overload for QtNodePair struct More...
 

Detailed Description

The class QtNode is the common super class of all node classes of the query tree. It provides a reference to its parent node in the tree. The parent of root is null.

Member Typedef Documentation

typedef std::vector<QtData*> QtNode::QtDataList

list of QtData pointers

typedef std::list<QtNode*> QtNode::QtNodeList

list of QtNode pointers

typedef std::vector<QtOperation*> QtNode::QtOperationList

list of QtOperation pointers

typedef std::vector<QtTrimElement*> QtNode::QtTrimList

list of QtTrimData structures

Member Enumeration Documentation

Enumerator
QT_AREA_MDD 
QT_AREA_SCALAR 
Enumerator
QT_DIRECT_CHILDS 
QT_LEAF_NODES 
QT_ALL_NODES 
Enumerator
QT_UNDEFINED_NODE 
QT_MDD_ACCESS 
QT_OPERATION_ITERATOR 
QT_SELECTION_ITERATOR 
QT_JOIN_ITERATOR 
QT_UPDATE 
QT_INSERT 
QT_DELETE 
QT_COMMAND 
QT_PLUS 
QT_MINUS 
QT_MULT 
QT_DIV 
QT_OR 
QT_AND 
QT_XOR 
QT_IS 
QT_EQUAL 
QT_NOT_EQUAL 
QT_LESS 
QT_LESS_EQUAL 
QT_NOT 
QT_SQRT 
QT_EXECUTE 
QT_ONC_STREAM 
QT_ITERATOR 
QT_OPERATION 
QT_BINARY_OPERATION 
QT_BINARY_INDUCE 
QT_GROUP_ITERATOR 
QT_IDENT 
QT_NARY_OPERATION 
QT_UNARY_OPERATION 
QT_CONDENSE 
QT_UNARY_INDUCE 
QT_ABS 
QT_EXP 
QT_LOG 
QT_LN 
QT_SIN 
QT_COS 
QT_TAN 
QT_SINH 
QT_COSH 
QT_TANH 
QT_ARCSIN 
QT_ARCCOS 
QT_ARCTAN 
QT_REALPART 
QT_IMAGINARPART 
QT_CAST 
QT_CSE_ROOT 
QT_DOMAIN_OPERATION 
QT_ALL 
QT_SOME 
QT_COUNTCELLS 
QT_ADDCELLS 
QT_AVGCELLS 
QT_MINCELLS 
QT_MAXCELLS 
QT_MDD_VAR 
QT_MDD_STREAM 
QT_CONST 
QT_DOT 
QT_CONVERSION 
QT_OID 
QT_INTERVALOP 
QT_MINTERVALOP 
QT_POINTOP 
QT_LO 
QT_HI 
QT_SDOM 
QT_SHIFT 
QT_EXTEND 
QT_MARRAYOP 
QT_CONDENSEOP 
QT_SCALE 
QT_OVERLAY 
QT_BIT 
QT_PYRAMID 
QT_ENCODE 
QT_CONCAT 
QT_CASEOP 
QT_INFO 
QT_LAST_NODE_TYPE 

Constructor & Destructor Documentation

QtNode::QtNode ( )

default constructor

QtNode::QtNode ( QtNode node)

constructor getting a pointer to the parent

virtual QtNode::~QtNode ( )
virtual

destructor

Member Function Documentation

virtual bool QtNode::equalMeaning ( QtNode node)
virtual

test if the two nodes have an equal meaning in a subtree

The method allows to specify the class of childs to be considered according to method { getChilds}. By default, just direct childs are considered

Reimplemented in QtDot, QtConversion, QtUnaryOperation, QtBinaryOperation, QtNaryOperation, QtDomainOperation, QtCondenseOp, QtVariable, QtConst, and QtConcat.

virtual QtAreaType QtNode::getAreaType ( )
virtual

test if the edge to the parent node is of type mdd or atomic

The method creates a unique name for common subexpressions by concatenating operators and variables in the subtree of the common subexpression.

Reimplemented in QtNaryOperation, QtBinaryOperation, QtEncode, QtUnaryOperation, QtVariable, QtConst, QtConcat, and QtCondense.

QtNodeList* QtNode::getChild ( const QtNodeType  node,
QtChildType  flag = QT_DIRECT_CHILDS 
)

return childs of a certain class

The method allows different retrieval of the subtree nodes. Dependent on the content of { flag} one of the following semantics is used: { DIRECT_CHILDS} - A list of all direct child nodes of the current node is returned. { LEAF_NODES } - A list of all leaf nodes of the subtree with the current node as root is returned. { ALL_NODES } - A list of all nodes of the subtree with the current node as root is returned. The nodes in the result list have a special order. Every node comes before its parent node in the result list.

virtual QtNodeList* QtNode::getChilds ( QtChildType  flag)
virtual
std::string QtNode::getEvaluationTime ( )
protected

get elapsed time if timer was started, returns a string e.g. "15 usecs"

virtual const QtNodeType QtNode::getNodeType ( ) const
inlinevirtual
QtNode* QtNode::getParent ( ) const
inline
const ParseInfo& QtNode::getParseInfo ( )
inline
enum QtNodeType QtNode::getQtNodeTypeParent ( enum  QtNodeType)

method for pre optimizations (basically load optimization)

The method allows you to differ between the different node types. {Load Optimization} The method is invoked through the whole query tree. The information of every triming and projection node is collected and stored in a { QtTrimList} structure which is passed down. While collecting the information consistency of the data is checked. At the leafs, which are load operations, the structure is converted to a minterval object and stored in the leaf node. The list is dynamically created in the node which is on top of an operation subtree and deleted where the information is stored or dropped.

Defined empty to do nothing in case it is not defined for a subclass.returns the QtNodeType parent of the argument (do not use for the root)

virtual std::string QtNode::getSpelling ( )
virtual

creates a unique name for a common subexpression

The method checks, if the two nodes have an equal meaning in a subtree. { equalMeaning()} depends on the type of the node and the information in the node. For unary and binary operators the method { equalMeaning()} is invoked on the input nodes.

Reimplemented in QtDot, QtBinaryOperation, QtNaryOperation, QtDomainOperation, QtCondenseOp, QtVariable, QtConst, QtUnaryOperation, and QtConcat.

void QtNode::pauseTimer ( )
protected

pause

virtual void QtNode::printAlgebraicExpression ( std::ostream &  s = std::cout)
pure virtual
virtual void QtNode::printTree ( int  tab,
std::ostream &  s = std::cout,
QtChildType  mode = QT_ALL_NODES 
)
pure virtual
void QtNode::resumeTimer ( )
protected

resume

virtual void QtNode::setInput ( QtOperation inputOld,
QtOperation inputNew 
)
inlinevirtual
void QtNode::setParent ( QtNode node)
inline
void QtNode::setParseInfo ( const ParseInfo info)
inline
virtual void QtNode::simplify ( )
virtual

simplifies the tree

The method tests if the edge to the parent node belongs to a multidimensional or atomic area.

Reimplemented in QtCondenseOp, QtBinaryOperation, QtNaryOperation, QtUnaryOperation, and QtConcat.

void QtNode::startTimer ( const char *  name)
protected

start node timer (called at evaluation time)

void QtNode::stopTimer ( )
protected

stop timer (at end of evaluation)

bool QtNode::subtype ( enum QtNodeType  a,
enum QtNodeType  b 
)

returns weather class b is a subtype of class a

Friends And Related Function Documentation

bool operator< ( const QtNodePair  a,
const QtNodePair  b 
)
friend

operator overload for QtNodePair struct

Member Data Documentation

ParseInfo QtNode::parseInfo
protected

attribute for parser info

const QtNodeType QtNode::QtInheritance[][2]
static

the inheritance relations list

const int QtNode::QtNodes
static

number of QtNodeTypes

const QtNodeType QtNode::QtRoot
static

the root of the inheritance tree


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