C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Private Member Functions | List of all members
exprtk::details::node_collection_destructor< Node > Class Template Reference

Public Types

typedef node_collector_interface< Nodenci_t
 
typedef nci_t::node_ptr_t node_ptr_t
 
typedef nci_t::node_pp_t node_pp_t
 
typedef nci_t::noderef_list_t noderef_list_t
 

Static Public Member Functions

static void delete_nodes (node_ptr_t &root)
 

Static Private Member Functions

static void collect_nodes (node_ptr_t &root, noderef_list_t &node_delete_list)
 

Detailed Description

template<typename Node>
class exprtk::details::node_collection_destructor< Node >

Definition at line 6059 of file exprtk.hpp.

Member Typedef Documentation

◆ nci_t

Definition at line 6063 of file exprtk.hpp.

◆ node_pp_t

Definition at line 6066 of file exprtk.hpp.

◆ node_ptr_t

Definition at line 6065 of file exprtk.hpp.

◆ noderef_list_t

Definition at line 6067 of file exprtk.hpp.

Member Function Documentation

◆ collect_nodes()

template<typename Node >
static void exprtk::details::node_collection_destructor< Node >::collect_nodes ( node_ptr_t root,
noderef_list_t node_delete_list 
)
inlinestaticprivate

Definition at line 6087 of file exprtk.hpp.

6088 {
6089 std::deque<node_ptr_t> node_list;
6090 node_list.push_back(root);
6091 node_delete_list.push_back(&root);
6092
6094 child_node_delete_list.reserve(1000);
6095
6096 while (!node_list.empty())
6097 {
6098 node_list.front()->collect_nodes(child_node_delete_list);
6099
6100 if (!child_node_delete_list.empty())
6101 {
6102 for (std::size_t i = 0; i < child_node_delete_list.size(); ++i)
6103 {
6105
6106 if (0 == (*node))
6107 {
6108 exprtk_debug(("ncd::collect_nodes() - null node encountered.\n"));
6109 }
6110
6111 node_list.push_back(*node);
6112 }
6113
6114 node_delete_list.insert(
6115 node_delete_list.end(),
6117
6118 child_node_delete_list.clear();
6119 }
6120
6121 node_list.pop_front();
6122 }
6123
6124 std::reverse(node_delete_list.begin(), node_delete_list.end());
6125 }
#define exprtk_debug(params)
Definition exprtk.hpp:64
bool match_impl(const Iterator pattern_begin, const Iterator pattern_end, const Iterator data_begin, const Iterator data_end, const typename std::iterator_traits< Iterator >::value_type &zero_or_more, const typename std::iterator_traits< Iterator >::value_type &exactly_one)
Definition exprtk.hpp:605

References exprtk_debug, and exprtk::details::match_impl().

Referenced by exprtk::details::node_collection_destructor< Node >::delete_nodes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ delete_nodes()

template<typename Node >
static void exprtk::details::node_collection_destructor< Node >::delete_nodes ( node_ptr_t root)
inlinestatic

Definition at line 6069 of file exprtk.hpp.

6070 {
6071 std::vector<node_pp_t> node_delete_list;
6072 node_delete_list.reserve(1000);
6073
6075
6076 for (std::size_t i = 0; i < node_delete_list.size(); ++i)
6077 {
6079 exprtk_debug(("ncd::delete_nodes() - deleting: %p\n", reinterpret_cast<void*>(node)));
6080 delete node;
6081 node = reinterpret_cast<node_ptr_t>(0);
6082 }
6083 }
static void collect_nodes(node_ptr_t &root, noderef_list_t &node_delete_list)
Definition exprtk.hpp:6087

References exprtk::details::node_collection_destructor< Node >::collect_nodes(), exprtk_debug, and exprtk::details::match_impl().

Here is the call graph for this function:

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