g4tools  5.4.0
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
tools::columns::tree Class Reference
Collaboration diagram for tools::columns::tree:
Collaboration graph
[legend]

Public Member Functions

 tree (tree *a_parent, const std::string &a_dcl)
 
virtual ~tree ()
 
void clear ()
 
void dump_tree (std::ostream &a_out, const std::string &a_margin)
 

Public Attributes

treem_parent
 
std::string m_dcl
 
std::vector< tree * > m_sub
 

Protected Member Functions

 tree (const tree &)
 
treeoperator= (const tree &)
 

Detailed Description

Definition at line 21 of file columns.

Constructor & Destructor Documentation

◆ tree() [1/2]

tools::columns::tree::tree ( tree a_parent,
const std::string &  a_dcl 
)
inline

Definition at line 26 of file columns.

26  :m_parent(a_parent),m_dcl(a_dcl){
27 #ifdef TOOLS_MEM
28  mem::increment(s_class().c_str());
29 #endif
30  if(a_parent) a_parent->m_sub.push_back(this);
31  }

◆ ~tree()

virtual tools::columns::tree::~tree ( )
inlinevirtual

Definition at line 32 of file columns.

32  {
33  clear();
34 #ifdef TOOLS_MEM
35  mem::decrement(s_class().c_str());
36 #endif
37  }

◆ tree() [2/2]

tools::columns::tree::tree ( const tree )
inlineprotected

Definition at line 39 of file columns.

39 {}

Member Function Documentation

◆ clear()

void tools::columns::tree::clear ( )
inline

Definition at line 42 of file columns.

42  {
43  m_dcl.clear();
45  }

◆ dump_tree()

void tools::columns::tree::dump_tree ( std::ostream &  a_out,
const std::string &  a_margin 
)
inline

Definition at line 46 of file columns.

46  {
47  if(m_dcl.size()) a_out << a_margin << m_dcl << std::endl;
48  {tools_vforit(tree*,m_sub,it) {
49  (*it)->dump_tree(a_out,a_margin+" ");
50  }}
51  }

◆ operator=()

tree& tools::columns::tree::operator= ( const tree )
inlineprotected

Definition at line 40 of file columns.

40 {return *this;}

Member Data Documentation

◆ m_dcl

std::string tools::columns::tree::m_dcl

Definition at line 54 of file columns.

◆ m_parent

tree* tools::columns::tree::m_parent

Definition at line 53 of file columns.

◆ m_sub

std::vector<tree*> tools::columns::tree::m_sub

Definition at line 55 of file columns.


The documentation for this class was generated from the following file:
tools::columns::tree::m_parent
tree * m_parent
Definition: columns:53
tools::columns::tree::clear
void clear()
Definition: columns:42
tools::safe_reverse_clear
void safe_reverse_clear(std::vector< T * > &a_vec)
Definition: vmanip:29
tools::columns::tree::m_sub
std::vector< tree * > m_sub
Definition: columns:55
tools::columns::tree::m_dcl
std::string m_dcl
Definition: columns:54
tools_vforit
#define tools_vforit(a__T, a__v, a__it)
Definition: forit:13
tools::columns::tree::tree
tree(tree *a_parent, const std::string &a_dcl)
Definition: columns:26