@brief Destroys the existing Node value. This process is recursive if the specified node type is for containers. @param[in] type A Node type to determine the value to be destroyed.
| 12857 | /// containers. |
| 12858 | /// @param[in] type A Node type to determine the value to be destroyed. |
| 12859 | void destroy(detail::node_attr_t value_type_bit) { |
| 12860 | switch (value_type_bit) { |
| 12861 | case detail::node_attr_bits::seq_bit: |
| 12862 | p_seq->clear(); |
| 12863 | detail::destroy_object<sequence_type>(p_seq); |
| 12864 | p_seq = nullptr; |
| 12865 | break; |
| 12866 | case detail::node_attr_bits::map_bit: |
| 12867 | p_map->clear(); |
| 12868 | detail::destroy_object<mapping_type>(p_map); |
| 12869 | p_map = nullptr; |
| 12870 | break; |
| 12871 | case detail::node_attr_bits::string_bit: |
| 12872 | detail::destroy_object<string_type>(p_str); |
| 12873 | p_str = nullptr; |
| 12874 | break; |
| 12875 | default: |
| 12876 | break; |
| 12877 | } |
| 12878 | } |
| 12879 | |
| 12880 | /// A pointer to the value of sequence type. |
| 12881 | sequence_type* p_seq; |
no test coverage detected