Skip to content
ErrWare edited this page Aug 8, 2018 · 3 revisions

Node is the interface that lies at the heart of this framework.

Provided functions - all take TaskTree as parameter

int execute: execute some code and return an int. Generally int simply gets passed up to be similarly returned by the caller. Optionally may be used to return some data to the calling parent. This introduces coupling, however, and is thusly recommended against.

bool validate: determines whether the node is valid for entrance at this time. If it is then the validating LooperNode will add it to the trace of the calling TaskTree. Also provides a place to perform some operations between determination of validation and first execution.

bool invalidate: determines whether the node is valid for exit at this time. If it is then the invalidating subtree will pop it for its stack trace. Also provides a place to perform some operations between determination of invalidation and the removal from trace.

Discussions: Initially I made Node a class, with everything else being a subclass of it. Now I consider making it an interface - it has no specific functionality of its own other than requiring certain functions be provided - which is the primary purpose of an interface.

Clone this wiki locally