ETUnaryExprT< BaseNodeT, OperandT, OperandPtrT > Class Template Reference

A template class that models an operation that has only one operand. More...

List of all members.

Public Member Functions

virtual ETNodeGetChild (simba_size_t in_index)
 Get the specified child node.
virtual simba_size_t GetChildCount () const
 Get the number of child nodes. In this case, it always returns 1.
OperandT * GetOperand ()
 Get a pointer reference to the only operand that this unary operation operates on.
virtual ~ETUnaryExprT ()
 Destructor.

Protected Member Functions

 ETUnaryExprT (OperandPtrT in_operand)
 Constructor.

Protected Attributes

OperandPtrT m_operand
 The only operand that this unary operation takes.

Detailed Description

template<typename BaseNodeT, typename OperandT, typename OperandPtrT = AutoPtr<OperandT>>
class Simba::SQLEngine::ETUnaryExprT< BaseNodeT, OperandT, OperandPtrT >

A template class that models an operation that has only one operand.

Sample unary operations are ETSelect, ETNot and ETUnaryValueExpr.

Parameters:
BaseNodeT The base class for this unary expression. Must be ETNode or an ETNode-derived class.
OperandT The operand type.
OperandPtrT The pointer type of the operand. Must either be AutoPtr or SharedPtr.

This design not only helps avoid the use of multiple inheritance but also allows better code reuse.


Constructor & Destructor Documentation

virtual ~ETUnaryExprT (  )  [inline, virtual]

Destructor.

ETUnaryExprT ( OperandPtrT  in_operand  )  [inline, explicit, protected]

Constructor.

The ownership of the operand object passed in through the constructor is transferred to this object.

Parameters:
in_operand The operand.
Exceptions:
SEInvalidArgumentException when in_operand does not own an operand object.

Member Function Documentation

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

Get the specified child node.

Since the only child available is operand 0, a value of 0 (zero) is the only valid value for in_index. 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 ETNode.

Parameters:
in_index A zero-based index.
Exceptions:
SEInvalidArgumentException when in_index is invalid.
Returns:
A pointer reference to the child node indexed by in_index. (NOT OWN)
virtual simba_size_t GetChildCount (  )  const [inline, virtual]

Get the number of child nodes. In this case, it always returns 1.

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

Returns:
number of child nodes.
OperandT* GetOperand (  )  [inline]

Get a pointer reference to the only operand that this unary operation operates on.

The caller of this method does not own the returned object.

Returns:
A pointer reference to the operand. (NOT OWN)

Member Data Documentation

OperandPtrT m_operand [protected]

The only operand that this unary operation takes.


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

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