InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EntryNode< T > Class Template Reference

#include <EntryNode.h>

Public Member Functions

 EntryNode ()
 
 EntryNode (const T &data)
 
 EntryNode (const T &data, int32 level, EntryNode< T > *child, EntryNode< T > *sibling, EntryNode< T > *previous, bool16 isParent)
 
virtual ~EntryNode ()
 
virtual const T & GetData ()
 
virtual void SetData (const T &data)
 
virtual int32 GetNodeLevel ()
 
virtual void SetNodeLevel (int32 level)
 
virtual EntryNode< T > * GetChild ()
 
virtual void SetChild (EntryNode< T > *child)
 
virtual EntryNode< T > * GetSibling ()
 
virtual void SetSibling (EntryNode< T > *sibling)
 
virtual EntryNode< T > * GetPrevious ()
 
virtual void SetPrevious (EntryNode< T > *previous)
 
virtual bool16 IsPreviousParent ()
 
virtual void SetPreviousIsParent (bool16 isParent)
 

Detailed Description

template<class T>
class EntryNode< T >

Templatized helper class allowing an arbitrary number of children in the tree. This is using a linked list data structure representing a binary tree. All the nodes in each linked list are on the same level. Each child node starts a new level. Each node in the tree could have a parent, a child, a next sibling and a previous sibling. The first child of a node may not have a previous sibling. This structure is used to support multi level sorting for table of content.

Constructor & Destructor Documentation

template<class T>
EntryNode< T >::EntryNode()
inline

Default contructor.

template<class T>
EntryNode< T >::EntryNode(const T & data)
inline

Copy constructor with given data information.

Parameters
dataIN object copy from.
template<class T>
EntryNode< T >::EntryNode(const T & data,
int32 level,
EntryNode< T > * child,
EntryNode< T > * sibling,
EntryNode< T > * previous,
bool16 isParent 
)
inline

Copy constructor with given data and its corresponding information.

Parameters
dataIN data copy from.
levelIN level where the node will be
childIN node's child
siblingIN node's sibling
previousIN node's previous sibling
isParentIN node's is a parent or not
template<class T>
virtual EntryNode< T >::~EntryNode()
inlinevirtual

Default destructor.

Member Function Documentation

template<class T>
virtual EntryNode<T>* EntryNode< T >::GetChild ()
inlinevirtual

Get the child node of this node.

Parameters
none
Returns
EntryNode<T>* the child node.
template<class T>
virtual const T& EntryNode< T >::GetData ()
inlinevirtual

Get the data of the node.

Parameters
none
Returns
T& the data.
template<class T>
virtual int32 EntryNode< T >::GetNodeLevel ()
inlinevirtual

Get the level of the node.

Parameters
none
Returns
int32 the level of the node.
template<class T>
virtual EntryNode<T>* EntryNode< T >::GetPrevious ()
inlinevirtual

Get the previous node of this node.

Parameters
none
Returns
EntryNode<T>* the previous node to be set for this node.
template<class T>
virtual EntryNode<T>* EntryNode< T >::GetSibling ()
inlinevirtual

Get the next sibling node of this node.

Parameters
none
Returns
EntryNode<T>* the next sibling node.
template<class T>
virtual bool16 EntryNode< T >::IsPreviousParent ()
inlinevirtual

Get the flag about if the node is parent or not. A node is a parent if it has child node.

Parameters
none
Returns
bool16 kTrue means the node is a parent, otherwise, return kFalse.
template<class T>
virtual void EntryNode< T >::SetChild (EntryNode< T > * child)
inlinevirtual

Set the child node of this node.

Parameters
childIN the child node to be set for this node.
template<class T>
virtual void EntryNode< T >::SetData (const T & data)
inlinevirtual

Set the data of the node

Parameters
datathe data to be set in the node.
template<class T>
virtual void EntryNode< T >::SetNodeLevel (int32 level)
inlinevirtual

Set the level of the node.

Parameters
levelIN the level to be set for the node.
template<class T>
virtual void EntryNode< T >::SetPrevious (EntryNode< T > * previous)
inlinevirtual

Set the previous node of this node.

Parameters
previousIN the previous node to be set for this node.
template<class T>
virtual void EntryNode< T >::SetPreviousIsParent (bool16 isParent)
inlinevirtual

Set the flag about it is a parent node or not.

Parameters
isParentIN the flag indicates it is a parent node or not.
template<class T>
virtual void EntryNode< T >::SetSibling (EntryNode< T > * sibling)
inlinevirtual

Set the next sibling node of this node.

Parameters
siblingIN the next sibling node to be set for this node.