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 5914 of file exprtk.hpp.

Member Typedef Documentation

◆ nci_t

Definition at line 5918 of file exprtk.hpp.

◆ node_pp_t

Definition at line 5921 of file exprtk.hpp.

◆ node_ptr_t

Definition at line 5920 of file exprtk.hpp.

◆ noderef_list_t

Definition at line 5922 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 5942 of file exprtk.hpp.

5943 {
5944 std::deque<node_ptr_t> node_list;
5945 node_list.push_back(root);
5946 node_delete_list.push_back(&root);
5947
5949 child_node_delete_list.reserve(1000);
5950
5951 while (!node_list.empty())
5952 {
5953 node_list.front()->collect_nodes(child_node_delete_list);
5954
5955 if (!child_node_delete_list.empty())
5956 {
5957 for (std::size_t i = 0; i < child_node_delete_list.size(); ++i)
5958 {
5960
5961 if (0 == (*node))
5962 {
5963 exprtk_debug(("ncd::collect_nodes() - null node encountered.\n"));
5964 }
5965
5966 node_list.push_back(*node);
5967 }
5968
5969 node_delete_list.insert(
5970 node_delete_list.end(),
5972
5973 child_node_delete_list.clear();
5974 }
5975
5976 node_list.pop_front();
5977 }
5978
5979 std::reverse(node_delete_list.begin(), node_delete_list.end());
5980 }
#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:598

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 5924 of file exprtk.hpp.

5925 {
5926 std::vector<node_pp_t> node_delete_list;
5927 node_delete_list.reserve(1000);
5928
5930
5931 for (std::size_t i = 0; i < node_delete_list.size(); ++i)
5932 {
5934 exprtk_debug(("ncd::delete_nodes() - deleting: %p\n", reinterpret_cast<void*>(node)));
5935 delete node;
5936 node = reinterpret_cast<node_ptr_t>(0);
5937 }
5938 }
static void collect_nodes(node_ptr_t &root, noderef_list_t &node_delete_list)
Definition exprtk.hpp:5942

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: