Commit e2bdbb8c authored by Martin Marinov's avatar Martin Marinov

Add access to the Node next, child and parent. Adjust the tick number maximum if it is exceeded.

parent b377ef2d
......@@ -23,7 +23,7 @@ public:
Node(const char* const _name,
Node* _next = nullptr, Node* _chld = nullptr)
: name(_name), next_(_next), chld_(_chld), prnt_(nullptr), tick_nmbr_(0),
tick_nmbr_max_(1000000000), abrt_(false)
tick_nmbr_max_(1), abrt_(false)
{}
void enter(Node* _prnt)
......@@ -42,6 +42,8 @@ public:
void tick(const char* const _flnm, const char* const _fnct)
{
++tick_nmbr_;
if (tick_nmbr_ > tick_nmbr_max_)
tick_nmbr_max_ *= 2;
if (trck_fnct != nullptr)
(*trck_fnct)(this, _flnm, _fnct);
}
......@@ -57,6 +59,10 @@ public:
// handling
bool aborting() const { return abrt_; }
const Node* next() const { return next_; };
const Node* child() const { return chld_; };
const Node* parent() const { return prnt_; };
protected:
Node* next_; //!< next node on the same level, last if nullptr
Node* chld_; //!< first child node, leaf if nullptr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment