AEUnaryExprT< BaseNodeT, OperandT, OperandPtrT > Class Template Reference

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

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 return 1.
const OperandT * GetOperand () const
 Retrieves a pointer reference to the only operand that this unary operation operates on.
OperandT * GetOperand ()
 Retrieves a pointer reference to the only operand that this unary operation operates on.
void SetOperand (OperandPtrT in_operand)
 Sets the only operand that this unary operation operates on.
OperandPtrT TakeOperand ()
 Takes the ownership of the operand away from this object.
virtual ~AEUnaryExprT ()
 Destructor.

Protected Member Functions

 AEUnaryExprT (const AEUnaryExprT &in_other)
 Copy constructor.
 AEUnaryExprT (OperandPtrT in_operand)
 Constructor.
 AEUnaryExprT ()
 Default constructor.

Protected Attributes

OperandPtrT m_operand

Detailed Description

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

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

Sample unary operations are NEGATION (Value), SELECTION (Relational), NOT (Boolean), and etc.

Parameters:
BaseNodeT The base class of this unary expression class. Must be AENode or AENode-derived.
OperandT The operand type.
OperandPtrT The pointer type of the operand.

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


Constructor & Destructor Documentation

virtual ~AEUnaryExprT (  )  [inline, virtual]

Destructor.

AEUnaryExprT (  )  [inline, protected]

Default constructor.

AEUnaryExprT ( OperandPtrT  in_operand  )  [inline, protected]

Constructor.

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

Parameters:
in_operand The operand. (OWN or NOT OWN) depends on the actual type of OperandPtrT.
Exceptions:
SEInvalidArgumentException when in_operand does not own an operand object.
AEUnaryExprT ( const AEUnaryExprT< BaseNodeT, OperandT, OperandPtrT > &  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.

Since the only child available is operand 0, a value of 0 is allowed for in_index.

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 node.
Exceptions:
SEInvalidArgumentException when in_index is invalid.
Returns:
The child node indexed by in_index. (NOT OWN)

Reimplemented in AEAggregate, AEProject, AESelect, and AETopNSort.

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

Returns the specified child node.

Since the only child available is operand 0, a value of 0 is allowed for in_index.

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 node.
Exceptions:
SEInvalidArgumentException when in_index is invalid.
Returns:
The child node indexed by in_index. (NOT OWN)

Reimplemented in AEAggregate, AEProject, AESelect, and AETopNSort.

virtual simba_size_t GetChildCount (  )  const [inline, virtual]

Returns the number of child nodes. In this case, it always return 1.

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

Returns:
the number of child nodes.

Reimplemented in AEAggregate, AEProject, AESelect, and AETopNSort.

const OperandT* GetOperand (  )  const [inline]

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

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

Returns:
a pointer reference to the operand. (NOT OWN)
OperandT* GetOperand (  )  [inline]

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

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

Returns:
a pointer reference to the operand. (NOT OWN)
void SetOperand ( OperandPtrT  in_operand  )  [inline]

Sets the only operand that this unary operation operates on.

That is, it grants the ownership of the operand to this object. Make sure this object currently does not have an operand.

Parameters:
in_operand The only operand that this unary operation operates on.
Exceptions:
SEInvalidArgumentException when in_operand does not own an operand object.
SEInvalidOperationException when this object already has an operand.
OperandPtrT TakeOperand (  )  [inline]

Takes the ownership of the operand away from this object.

After this call, this object no longer own or hold a (shared) reference to the operand. That is, it is safe to make a SetOperand() call.

If it only needs to access the operand, call GetOperand()instead.

Exceptions:
SEInvalidOperationException when this object does not have an operand.
Returns:
the operand object encapsulated in a wrap pointer.

Member Data Documentation

OperandPtrT m_operand [protected]

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