AEBinaryExprT< BaseNodeT, LOperandT, ROperandT, LOperandPtrT, ROperandPtrT > Class Template Reference

A template class that models an operation that takes two operands. More...

Inherited by AEBinaryValueExpr, AELikePredicate, AEQuantifiedComparison, and AESimpleWhenClause.

List of all members.

Public Member Functions

virtual const AENodeGetChild (simba_size_t in_index) const
 Returns the specified child node.
virtual AENodeGetChild (simba_size_t in_index)
 Returns the specified child node.
virtual simba_size_t GetChildCount () const
 Returns the number of child nodes. In this case, it always returns 2.
const LOperandT * GetLeftOperand () const
 Returns a pointer reference to the left operand.
LOperandT * GetLeftOperand ()
 Returns a pointer reference to the left operand.
const ROperandT * GetRightOperand () const
 Returns a pointer reference to the right operand.
ROperandT * GetRightOperand ()
 Returns a pointer reference to the right operand.
void SetLeftOperand (LOperandPtrT in_leftOperand)
 Grants the ownership of the given object wrapped in an auto pointer to this object as the left operand.
void SetRightOperand (ROperandPtrT in_rightOperand)
 Grants the ownership of the given object wrapped in an auto pointer to this object as the right operand.
LOperandPtrT TakeLeftOperand ()
 Takes the ownership of the left operand away from this object.
ROperandPtrT TakeRightOperand ()
 Takes the ownership of the right operand away from this object.
virtual ~AEBinaryExprT ()
 Destructor.

Protected Member Functions

 AEBinaryExprT (const AEBinaryExprT &in_other)
 Copy constructor.
 AEBinaryExprT (LOperandPtrT in_leftOperand, ROperandPtrT in_rightOperand)
 Constructor.
 AEBinaryExprT ()
 Constructor.

Protected Attributes

LOperandPtrT m_leftOperand
 The operand on the left side of the binary operation. (OWN).
ROperandPtrT m_rightOperand
 The operand on the right side of the binary operation. (OWN).

Detailed Description

template<typename BaseNodeT, typename LOperandT, typename ROperandT = LOperandT, typename LOperandPtrT = AutoPtr<LOperandT>, typename ROperandPtrT = AutoPtr<ROperandT>>
class Simba::SQLEngine::AEBinaryExprT< BaseNodeT, LOperandT, ROperandT, LOperandPtrT, ROperandPtrT >

A template class that models an operation that takes two operands.

Sample binary operations are SET UNION, NUMERIC ADDITION, NUMERIC MULTIPLY, BOOLEAN AND and etc.

For practical purpose, this template class does not enforce that the left and right operands to be the same type. This helps when implementing certain expressions that are not "classic" but "practical" binary operations. One example is the <in predicate>, the first operand is a AEValueExpr and the second operand is a AESubQuery.

Parameters:
BaseNodeT The base class for this binary expression class. Must be AENode or AENode-derived.
LOperandT The left operand type.
ROperandT The right operand type.
LOperandPtrT The pointer type for the left operand. Must either be AutoPtr or SharedPtr.
ROperandPtrT The pointer type for the right operand. Must either be AutoPtr or SharedPtr.

Constructor & Destructor Documentation

virtual ~AEBinaryExprT (  )  [inline, virtual]

Destructor.

AEBinaryExprT (  )  [inline, protected]

Constructor.

AEBinaryExprT ( LOperandPtrT  in_leftOperand,
ROperandPtrT  in_rightOperand 
) [inline, protected]

Constructor.

Parameters:
in_leftOperand The left operand.
in_rightOperand The right operand.
Exceptions:
SEInvalidArgumentException when either of the operands does not own an object
AEBinaryExprT ( const AEBinaryExprT< BaseNodeT, LOperandT, ROperandT, LOperandPtrT, ROperandPtrT > &  in_other  )  [inline, protected]

Copy constructor.

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

Parameters:
in_other The other node to create copy from.

Member Function Documentation

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

Returns the specified child node.

The left operand is considered to be the child 0 and the right operand is considered to be the child 1. The caller of this method does not own the returned child node.

This method is designed to override the method defined in BaseNodeT as seen in AENode.

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 in AEInsert, AEJoin, and AELikePredicate.

virtual AENode* GetChild ( simba_size_t  in_index  )  [inline, virtual]

Returns the specified child node.

The left operand is considered to be the child 0 and the right operand is considered to be the child 1. The caller of this method does not own the returned child node.

This method is designed to override the method defined in BaseNodeT as seen in AENode.

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 in AEInsert, AEJoin, and AELikePredicate.

virtual simba_size_t GetChildCount (  )  const [inline, virtual]

Returns the number of child nodes. In this case, it always returns 2.

This method is designed to override the method defined in BaseNodeT as seen in AENode.

Returns:
the number of child nodes.

Reimplemented in AEInsert, AEJoin, and AELikePredicate.

const LOperandT* GetLeftOperand (  )  const [inline]

Returns a pointer reference to the left operand.

The caller of the method does not own the returned object. If it wishes to take control of the ownership of the left operand object, call TakeLeftOperand() instead.

Returns:
The left operand. (NOT OWN)
LOperandT* GetLeftOperand (  )  [inline]

Returns a pointer reference to the left operand.

The caller of the method does not own the returned object. If it wishes to take control of the ownership of the left operand object, call TakeLeftOperand() instead.

Returns:
The left operand. (NOT OWN)
const ROperandT* GetRightOperand (  )  const [inline]

Returns a pointer reference to the right operand.

The caller of the method does not own the returned object. If it wishes to take control of the ownership of the right operand object, call TakeRightOperand() instead.

Returns:
The right operand. (NOT OWN)
ROperandT* GetRightOperand (  )  [inline]

Returns a pointer reference to the right operand.

The caller of the method does not own the returned object. If it wishes to take control of the ownership of the right operand object, call TakeRightOperand() instead.

Returns:
The right operand. (NOT OWN)
void SetLeftOperand ( LOperandPtrT  in_leftOperand  )  [inline]

Grants the ownership of the given object wrapped in an auto pointer to this object as the left operand.

Make sure this object does not already have the left operand.

Parameters:
in_leftOperand The left operand.
Exceptions:
SEInvalidArgumentException when in_operand does not own an object
SEInvalidOperationException when this object already has the left operand
void SetRightOperand ( ROperandPtrT  in_rightOperand  )  [inline]

Grants the ownership of the given object wrapped in an auto pointer to this object as the right operand.

Make sure this object does not already have the right operand.

Parameters:
in_rightOperand The right operand.
Exceptions:
SEInvalidArgumentException when in_operand does not own an object
SEInvalidOperationException when this object already has the right operand
LOperandPtrT TakeLeftOperand (  )  [inline]

Takes the ownership of the left operand away from this object.

Make sure the left operand is present.

Exceptions:
SEInvalidOperationException when the left operand is not present
Returns:
The left operand, whether the caller owns it depends on the pointer type.
ROperandPtrT TakeRightOperand (  )  [inline]

Takes the ownership of the right operand away from this object.

Make sure the right operand is present.

Exceptions:
SEInvalidOperationException when the right operand is not present
Returns:
The right operand, whether the caller owns it depends on the pointer type.

Member Data Documentation

LOperandPtrT m_leftOperand [protected]

The operand on the left side of the binary operation. (OWN).

ROperandPtrT m_rightOperand [protected]

The operand on the right side of the binary operation. (OWN).


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

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