AETopNSort Class Reference

A class that models a TOP N Sort operation. More...

Inherits Simba::SQLEngine::AESort.

List of all members.

Public Member Functions

virtual void AcceptVisitor (AENodeVisitor &in_visitor)
 Calls the correct method on the visitor.
 AETopNSort (const AETopNSort &in_other)
 Copy constructor.
 AETopNSort (AutoPtr< AERelationalExpr > in_operand, SharedPtr< AEValueExpr > in_skipValueExpr, SharedPtr< AEValueExpr > in_topValueExpr, AutoPtr< SESortSpecs > in_sortSpecs, simba_uint16 in_restrictedColCount=0)
 Constructor.
 AETopNSort (AutoPtr< AERelationalExpr > in_operand, SharedPtr< AEValueExpr > in_valueExpr, bool in_isPercent, AutoPtr< SESortSpecs > in_sortSpecs, simba_uint16 in_restrictedColCount=0)
 Constructor.
virtual AETopNSortClone () const
 Creates a clone of this node object.
virtual const AETopNSortGetAsTopNSort () const
 Get the object as an AETopNSort object.
virtual AETopNSortGetAsTopNSort ()
 Get the object as an AETopNSort object.
virtual const AENodeGetChild (simba_size_t in_index) const
 Get a pointer reference to the specified child node.
virtual AENodeGetChild (simba_size_t in_index)
 Get a pointer reference to the specified child node.
virtual simba_size_t GetChildCount () const
 Get the number of child nodes that this node has.
virtual simba_wstring GetLogString () const
 Returns a string name for this node for the purpose of logging.
virtual AENodeType GetNodeType () const
 Returns an integer that uniquely identifies the node class. See the definition of AENodeType for values defined.
AEValueExprGetSkipValueExpr ()
 Get a reference to the value expression for the skip count.
SharedPtr< AEValueExprGetSkipValueExprSharedPtr ()
 Get the shared pointer of the value expression for the skip count.
AEValueExprGetTopValueExpr ()
 Get a reference to the value expression for the top count.
SharedPtr< AEValueExprGetTopValueExprSharedPtr ()
 Get the shared pointer of the value expression for the top count.
bool IsPercent () const
 Returns true if this is a TOP n PERCENT.
virtual ~AETopNSort ()
 Destructor.

Detailed Description

A class that models a TOP N Sort operation.

An AETopNSort operator is built when there is a TOP LEVEL SELECT STATEMENT (i.e. a select statement with an ORDER BY clause) with a SelectLimit specified.

For example: Select TOP 5 C1 from T1 order by 1

AETopNSort is an AEQueryOperation. An AEQueryOperation has an AERelationalExpr as its operand. This relationship holds true in ONE direction only. That is, an AERelationalExpr _MUST NOT_ have an AEQueryOperation as a child.

NOTE: This differs from AETop, which is an AERelationalExpr. If we have a SELECT STATEMENT with a SelectLimit, AEBuilder guarantees that there will be NO AEQueryOperation built above the AETop.

For example: Select TOP 5 C1 from T1 will yield this AETree:

AEQuery AETop AEProject -- C1 AETable -- T1

A TOP LEVEL SELECT STATEMENT is not permitted as a subquery. Only SELECT STATEMENTS (i.e. a select statement with NO ORDER BY clause) is permitted as a subquery.

See also:
AETop.

Will always have two or three children (GetChildCount() returns 2 or 3):


Constructor & Destructor Documentation

AETopNSort ( AutoPtr< AERelationalExpr in_operand,
SharedPtr< AEValueExpr in_valueExpr,
bool  in_isPercent,
AutoPtr< SESortSpecs in_sortSpecs,
simba_uint16  in_restrictedColCount = 0 
)

Constructor.

Parameters:
in_operand The operand that this operator operates on.
in_valueExpr The value expression representing the row limit.
in_isPercent Boolean indicating if in_valueExpr represents a percentage. [0.0-100.0]
in_sortSpecs The list of sort specifications.
in_restrictedColCount The number of columns to restrict access to. 0 for no restriction.
AETopNSort ( AutoPtr< AERelationalExpr in_operand,
SharedPtr< AEValueExpr in_skipValueExpr,
SharedPtr< AEValueExpr in_topValueExpr,
AutoPtr< SESortSpecs in_sortSpecs,
simba_uint16  in_restrictedColCount = 0 
)

Constructor.

Parameters:
in_operand The operand that this operator operates on.
in_skipValueExpr The value expression representing the skip count
in_topValueExpr The value expression representing the row limit.
in_sortSpecs The list of sort specifications.
in_restrictedColCount The number of columns to restrict access to. 0 for no restriction.
AETopNSort ( const AETopNSort in_other  ) 

Copy constructor.

To support "cloning". See Clone() method.

Parameters:
in_other The other node to create copy from.
virtual ~AETopNSort (  )  [virtual]

Destructor.


Member Function Documentation

virtual void AcceptVisitor ( AENodeVisitor in_visitor  )  [virtual]

Calls the correct method on the visitor.

Parameters:
in_visitor The visiting object.

Reimplemented from AESort.

virtual AETopNSort* Clone (  )  const [virtual]

Creates a clone of this node object.

Returns:
A clone of this node object. (OWN)

Reimplemented from AESort.

virtual const AETopNSort* GetAsTopNSort (  )  const [inline, virtual]

Get the object as an AETopNSort object.

Returns:
This object as an AETopNSort object. (NOT OWN)

Reimplemented from AEQueryOperation.

virtual AETopNSort* GetAsTopNSort (  )  [inline, virtual]

Get the object as an AETopNSort object.

Returns:
This object as an AETopNSort object. (NOT OWN)

Reimplemented from AEQueryOperation.

virtual const AENode* GetChild ( simba_size_t  in_index  )  const [virtual]

Get a pointer reference to the specified child node.

Parameters:
in_index The zero-based index for the child.
Exceptions:
SEInvalidArgumentException when in_index is invalid
Returns:
A pointer reference to the requested child node. (NOT OWN)

Reimplemented from AEUnaryExprT< AERelationalExpr, AERelationalExpr >.

virtual AENode* GetChild ( simba_size_t  in_index  )  [virtual]

Get a pointer reference to the specified child node.

Parameters:
in_index The zero-based index for the child.
Exceptions:
SEInvalidArgumentException when in_index is invalid
Returns:
A pointer reference to the requested child node. (NOT OWN)

Reimplemented from AEUnaryExprT< AERelationalExpr, AERelationalExpr >.

virtual simba_size_t GetChildCount (  )  const [virtual]

Get the number of child nodes that this node has.

Returns:
The number of child nodes.

Reimplemented from AEUnaryExprT< AERelationalExpr, AERelationalExpr >.

virtual simba_wstring GetLogString (  )  const [virtual]

Returns a string name for this node for the purpose of logging.

Returns:
A string representation of this node for logging purposes.

Reimplemented from AESort.

virtual AENodeType GetNodeType (  )  const [virtual]

Returns an integer that uniquely identifies the node class. See the definition of AENodeType for values defined.

Returns:
The ID that uniquely identifies this type of nodes.

Reimplemented from AESort.

AEValueExpr* GetSkipValueExpr (  ) 

Get a reference to the value expression for the skip count.

Returns:
A pointer reference to the value expression. (NOT OWN)
SharedPtr<AEValueExpr> GetSkipValueExprSharedPtr (  ) 

Get the shared pointer of the value expression for the skip count.

Returns:
The shared pointer of the value expression.
AEValueExpr* GetTopValueExpr (  ) 

Get a reference to the value expression for the top count.

Returns:
A pointer reference to the value expression. (NOT OWN)
SharedPtr<AEValueExpr> GetTopValueExprSharedPtr (  ) 

Get the shared pointer of the value expression for the top count.

Returns:
The shared pointer of the value expression.
bool IsPercent (  )  const

Returns true if this is a TOP n PERCENT.

Returns:
true if this is a TOP n PERCENT.

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

Generated on Wed May 17 14:21:17 2017 for SimbaEngine 10.1.3.1011 by simba