ITK  5.1.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
itk::TreeNode< TValue > Class Template Reference

#include <itkTreeNode.h>

+ Inheritance diagram for itk::TreeNode< TValue >:
+ Collaboration diagram for itk::TreeNode< TValue >:

Public Types

using ChildIdentifier = ::itk::OffsetValueType
 
using ChildrenListType = std::vector< Pointer >
 
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = TreeNode< TValue >
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

virtual void AddChild (ChildIdentifier number, Self *node)
 
void AddChild (Self *node)
 
ChildIdentifier ChildPosition (const Self *node) const
 
ChildIdentifier ChildPosition (TValue node) const
 
ChildIdentifier CountChildren () const
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
const TValue & Get () const
 
SelfGetChild (ChildIdentifier number) const
 
virtual ChildrenListTypeGetChildren (unsigned int depth=0, char *name=nullptr) const
 
virtual ChildrenListTypeGetChildrenList ()
 
virtual const char * GetNameOfClass () const
 
ChildIdentifier GetNumberOfChildren (unsigned int depth=0, char *name=nullptr) const
 
SelfGetParent () const
 
bool HasChildren () const
 
bool HasParent () const
 
bool Remove (Self *n)
 
bool ReplaceChild (Self *oldChild, Self *newChild)
 
TValue Set (const TValue data)
 
void SetParent (Self *n)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 TreeNode ()=default
 
 ~TreeNode () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Protected Attributes

ChildrenListType m_Children
 
TValue m_Data
 
Selfm_Parent { nullptr }
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

template<typename TValue>
class itk::TreeNode< TValue >

Represents a node in a tree.

This class derives from the Object class.

The class is templated over the type of the elements.

Template Parameters
TValue= Element type stored in the node

Definition at line 43 of file itkTreeNode.h.

Member Typedef Documentation

◆ ChildIdentifier

template<typename TValue>
using itk::TreeNode< TValue >::ChildIdentifier = ::itk::OffsetValueType

Definition at line 54 of file itkTreeNode.h.

◆ ChildrenListType

template<typename TValue>
using itk::TreeNode< TValue >::ChildrenListType = std::vector<Pointer>

Definition at line 53 of file itkTreeNode.h.

◆ ConstPointer

template<typename TValue>
using itk::TreeNode< TValue >::ConstPointer = SmartPointer<const Self>

Definition at line 52 of file itkTreeNode.h.

◆ Pointer

template<typename TValue>
using itk::TreeNode< TValue >::Pointer = SmartPointer<Self>

Definition at line 51 of file itkTreeNode.h.

◆ Self

template<typename TValue>
using itk::TreeNode< TValue >::Self = TreeNode<TValue>

Definition at line 50 of file itkTreeNode.h.

◆ Superclass

template<typename TValue>
using itk::TreeNode< TValue >::Superclass = Object

Standard type alias

Definition at line 49 of file itkTreeNode.h.

Constructor & Destructor Documentation

◆ TreeNode()

template<typename TValue>
itk::TreeNode< TValue >::TreeNode ( )
protecteddefault

Set the data of the node

◆ ~TreeNode()

template<typename TValue>
itk::TreeNode< TValue >::~TreeNode ( )
overrideprotected

Member Function Documentation

◆ AddChild() [1/2]

template<typename TValue>
virtual void itk::TreeNode< TValue >::AddChild ( ChildIdentifier  number,
Self node 
)
virtual

Add a child to the node and specify the number in the children list

◆ AddChild() [2/2]

template<typename TValue>
void itk::TreeNode< TValue >::AddChild ( Self node)

Add a child to the node

◆ ChildPosition() [1/2]

template<typename TValue>
ChildIdentifier itk::TreeNode< TValue >::ChildPosition ( const Self node) const

Return the child position given a node

◆ ChildPosition() [2/2]

template<typename TValue>
ChildIdentifier itk::TreeNode< TValue >::ChildPosition ( TValue  node) const

Return the child position given a value

◆ CountChildren()

template<typename TValue>
ChildIdentifier itk::TreeNode< TValue >::CountChildren ( ) const

Return the number of children

◆ CreateAnother()

template<typename TValue>
virtual::itk::LightObject::Pointer itk::TreeNode< TValue >::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

◆ Get()

template<typename TValue>
const TValue& itk::TreeNode< TValue >::Get ( ) const

Get the value of the node

◆ GetChild()

template<typename TValue>
Self* itk::TreeNode< TValue >::GetChild ( ChildIdentifier  number) const

Get the child node

◆ GetChildren()

template<typename TValue>
virtual ChildrenListType* itk::TreeNode< TValue >::GetChildren ( unsigned int  depth = 0,
char *  name = nullptr 
) const
virtual

Get the children list

◆ GetChildrenList()

template<typename TValue>
virtual ChildrenListType& itk::TreeNode< TValue >::GetChildrenList ( )
inlinevirtual

Get the internal list of children

Definition at line 132 of file itkTreeNode.h.

◆ GetNameOfClass()

template<typename TValue>
virtual const char* itk::TreeNode< TValue >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::Object.

◆ GetNumberOfChildren()

template<typename TValue>
ChildIdentifier itk::TreeNode< TValue >::GetNumberOfChildren ( unsigned int  depth = 0,
char *  name = nullptr 
) const

Get the number of children given a name and depth

◆ GetParent()

template<typename TValue>
Self* itk::TreeNode< TValue >::GetParent ( ) const

Get the parent node

◆ HasChildren()

template<typename TValue>
bool itk::TreeNode< TValue >::HasChildren ( ) const

Return true if the node has children

◆ HasParent()

template<typename TValue>
bool itk::TreeNode< TValue >::HasParent ( ) const

Return true if the node has a parent

◆ New()

template<typename TValue>
static Pointer itk::TreeNode< TValue >::New ( )
static

Method for creation through the object factory.

◆ Remove()

template<typename TValue>
bool itk::TreeNode< TValue >::Remove ( Self n)

Remove a node from the node

◆ ReplaceChild()

template<typename TValue>
bool itk::TreeNode< TValue >::ReplaceChild ( Self oldChild,
Self newChild 
)

Replace a given child by a new one

◆ Set()

template<typename TValue>
TValue itk::TreeNode< TValue >::Set ( const TValue  data)

Set the current value of the node

◆ SetParent()

template<typename TValue>
void itk::TreeNode< TValue >::SetParent ( Self n)

Set the parent of the node

Member Data Documentation

◆ m_Children

template<typename TValue>
ChildrenListType itk::TreeNode< TValue >::m_Children
protected

Definition at line 148 of file itkTreeNode.h.

◆ m_Data

template<typename TValue>
TValue itk::TreeNode< TValue >::m_Data
protected

Definition at line 145 of file itkTreeNode.h.

◆ m_Parent

template<typename TValue>
Self* itk::TreeNode< TValue >::m_Parent { nullptr }
protected

Definition at line 146 of file itkTreeNode.h.


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