SpatiumLib
Public Member Functions | Protected Attributes | List of all members
spatium::idx::StringTreeNode Class Reference

A node in a string tree. More...

#include <StringTree.h>

Inheritance diagram for spatium::idx::StringTreeNode:
Inheritance graph
[legend]
Collaboration diagram for spatium::idx::StringTreeNode:
Collaboration graph
[legend]

Public Member Functions

 StringTreeNode (const std::string &str, const std::weak_ptr< StringTreeNode > &parent=std::weak_ptr< StringTreeNode >())
 Constructor. More...
 
std::shared_ptr< StringTreeNodeaddChild (const std::shared_ptr< StringTreeNode > &parentSharedPtr, const std::string &str)
 Add child node. More...
 
void setString (const std::string &str)
 Set the string value. More...
 
std::string str () const
 Get the string value. More...
 
- Public Member Functions inherited from spatium::idx::TreeNode< std::string >
 TreeNode (std::weak_ptr< TreeNode< std::string >> parent=std::weak_ptr< TreeNode< std::string >>(), size_t estimatedChildCount=0)
 Constructor. More...
 
 TreeNode (const std::string &object, std::weak_ptr< TreeNode< std::string >> parent=std::weak_ptr< TreeNode< std::string >>(), size_t estimatedChildCount=0)
 Constructor. More...
 
bool hasChildren ()
 
size_t childCount () const
 Get child count. More...
 
std::shared_ptr< TreeNode< std::string > > child (size_t index) const
 Get a child. More...
 
std::shared_ptr< TreeNode< std::string > > addChild (const std::shared_ptr< TreeNode< std::string >> &parentSharedPtr, const std::string &object)
 Add child node. More...
 
std::string & object ()
 Set the object. More...
 
void setObject (const std::string &object)
 Get the object. More...
 

Protected Attributes

std::string m_str
 
- Protected Attributes inherited from spatium::idx::TreeNode< std::string >
std::weak_ptr< TreeNode< std::string > > m_parent
 
std::vector< std::shared_ptr< TreeNode< std::string > > > m_children
 
std::string m_object
 

Detailed Description

A node in a string tree.

Constructor & Destructor Documentation

◆ StringTreeNode()

spatium::idx::StringTreeNode::StringTreeNode ( const std::string &  str,
const std::weak_ptr< StringTreeNode > &  parent = std::weak_ptr<StringTreeNode>() 
)
inline

Constructor.

Parameters
[in]Parentnode (unset for root node)

Member Function Documentation

◆ addChild()

std::shared_ptr<StringTreeNode> spatium::idx::StringTreeNode::addChild ( const std::shared_ptr< StringTreeNode > &  parentSharedPtr,
const std::string &  str 
)
inline

Add child node.

Parameters
[in]parentSharedPtrParent node (this object) as shared pointer.
[in]strString value
Returns
Created child node

◆ setString()

void spatium::idx::StringTreeNode::setString ( const std::string &  str)
inline

Set the string value.

◆ str()

std::string spatium::idx::StringTreeNode::str ( ) const
inline

Get the string value.

Member Data Documentation

◆ m_str

std::string spatium::idx::StringTreeNode::m_str
protected

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