DOM: Added dtor that delegate to DOM::Node

This commit is contained in:
Paul Beckingham 2017-04-29 23:56:03 -04:00
parent b34a51710e
commit 2b71434cf8
2 changed files with 14 additions and 5 deletions

View file

@ -483,6 +483,12 @@ bool getDOM (const std::string& name, const Task& task, Variant& value)
//
// This makes the DOM class a reusible object.
////////////////////////////////////////////////////////////////////////////////
DOM::~DOM ()
{
delete _node;
}
////////////////////////////////////////////////////////////////////////////////
void DOM::addSource (
const std::string&,

View file

@ -38,6 +38,7 @@ bool getDOM (const std::string&, const Task&, Variant&);
class DOM
{
public:
~DOM ();
void addSource (const std::string&, bool (*)(const std::string&, Variant&));
bool valid (const std::string&) const;
Variant get (const Task&, const std::string&) const;
@ -47,13 +48,15 @@ public:
std::string dump () const;
private:
std::vector <std::string> decomposeReference (const std::string&) const;
std::string dumpNode (const std::shared_ptr <DOM>, int) const;
class Node
{
public:
~Node ();
};
private:
std::string _name {"Unknown"};
std::shared_ptr <bool (*)(const std::string&, Variant&)> _provider {nullptr};
std::vector <std::shared_ptr <DOM>> _branches {};
DOM::Node* _node {nullptr};
};
#endif
////////////////////////////////////////////////////////////////////////////////