AENodeListT< BaseNodeT, ItemNodeT > Class Template Reference

A template class that holds a list of nodes of type ItemNodeT managed by a shared pointer. More...

List of all members.

Public Member Functions

simba_size_t AddNode (SharedItemNodeT in_node)
 Appends the given node to the end of the list.
 AENodeListT (const AENodeListT &in_other)
 Copy constructor.
 AENodeListT ()
 Default constructor.
bool FindNode (const ItemNodeT *in_node, simba_size_t in_startPos, simba_size_t in_endPos, simba_size_t &out_pos) const
 Finds the index of the matching node.
bool FindNode (const ItemNodeT *in_node, simba_size_t &out_pos) const
 Finds the index of the matching node.
bool FindNodeInList (const ItemNodeT *in_node, simba_size_t &out_pos)
 Return true if select list contains contains the expression If column has an alias, both alias and column are checked.
virtual const ItemNodeT * GetChild (simba_size_t in_index) const
 Gets the node indexed by the given node number.
virtual ItemNodeT * GetChild (simba_size_t in_index)
 Gets the node indexed by the given node number.
virtual simba_size_t GetChildCount () const
 Gets the number of child nodes.
SharedItemNodeT ReplaceNode (simba_size_t in_index, SharedItemNodeT in_node)
 Replaces the node at the given index with the given node.
virtual ~AENodeListT ()
 Destructor.

Detailed Description

template<typename BaseNodeT, typename ItemNodeT>
class Simba::SQLEngine::AENodeListT< BaseNodeT, ItemNodeT >

A template class that holds a list of nodes of type ItemNodeT managed by a shared pointer.

This class is useful when one wants to represent a list of objects as an AENode. Otherwise, other classes such as std::vector should serve the purpose.

Parameters:
BaseNodeT The base class for this ternary expression class. Must be AENode or AENode-derived.
ItemNodeT The item node type.

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


Constructor & Destructor Documentation

AENodeListT (  )  [inline]

Default constructor.

AENodeListT ( const AENodeListT< BaseNodeT, ItemNodeT > &  in_other  )  [inline]

Copy constructor.

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

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

Destructor.


Member Function Documentation

simba_size_t AddNode ( SharedItemNodeT  in_node  )  [inline]

Appends the given node to the end of the list.

Parameters:
in_node The node to append to the list.
Exceptions:
SEInvalidArgumentException if in_node does not own an node object.
bool FindNode ( const ItemNodeT *  in_node,
simba_size_t  in_startPos,
simba_size_t  in_endPos,
simba_size_t &  out_pos 
) const [inline]

Finds the index of the matching node.

Parameters:
in_node Node to find. (NOT OWN)
in_startPos The start position to search for.
in_endPos The end position (not include this position) to search for.
out_pos Index of the searching node if found, untouched otherwise.
Returns:
true if matching found, false otherwise.
bool FindNode ( const ItemNodeT *  in_node,
simba_size_t &  out_pos 
) const [inline]

Finds the index of the matching node.

Parameters:
in_node Node to find. (NOT OWN)
out_pos Index of the searching node if found, untouched otherwise.
Returns:
true if matching found, false otherwise.
bool FindNodeInList ( const ItemNodeT *  in_node,
simba_size_t &  out_pos 
) [inline]

Return true if select list contains contains the expression If column has an alias, both alias and column are checked.

Parameters:
in_node The expression for the sort spec.
out_pos The index of the matching column in the select list
Returns:
true if matching found, false otherwise.
virtual const ItemNodeT* GetChild ( simba_size_t  in_index  )  const [inline, virtual]

Gets the node indexed by the given node number.

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 out of bound
Returns:
the node at the given node index. (NOT OWN)
virtual ItemNodeT* GetChild ( simba_size_t  in_index  )  [inline, virtual]

Gets the node indexed by the given node number.

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 out of bound
Returns:
the node at the given node index. (NOT OWN)
virtual simba_size_t GetChildCount (  )  const [inline, virtual]

Gets the number of child nodes.

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

Returns:
the number of child nodes.
SharedItemNodeT ReplaceNode ( simba_size_t  in_index,
SharedItemNodeT  in_node 
) [inline]

Replaces the node at the given index with the given node.

Parameters:
in_index The index of the node to replace.
in_node The node to replace the node at the given index with.
Returns:
The node which was replaced.
Exceptions:
SEInvalidArgumentException if in_node does not own an node object or in_index is out of bound.

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