oagnodes library


A Closure takes a Function argument that returns a Status. The function is executed by a call to the update() method of the Closure.
Abstract base class for a node composed of multiple nodes. The update() method uses the composite Node instances.
Abstract base class for all DataNode types. It stores data of type argument T. Concrete instances can be shared across multiple DataNode instances by reference in order to compose operations that read/write from the same data.
A DataSubject is a Subject whose notifier is a DataNode. It provides access to the DataNode data through a getter. A DataSubject observer can therefore receive data through a notification.
Abstract base class that decorates the behavior of a Node instance.
Monitors whether the decorated node has returned the specified parameter Status since the DurationMonitor instance was updated.
An Evaluator instance updates its children nodes as an unordered sequence. Composite child nodes will be updated until they return Status.success, then they are ignored in any future calls update() method of the Evaluator until all other children nodes have returned Status.success.
A FutureSubject takes a Function returning a Future of argument type T. The FutureSubject will call the argument future and use the result to build a DataNode using the argument builder Function. The built DataNode is then used as the notifier of the FutureSubject.
An Identity exists solely to return the specified argument Status from its update() method. An Identity compares equal to another Identity if they are both constructed with the same Status.
Abstract base class for all Node types. The reset() method is defined as no-op and does not require implementation.
The Not decorator returns the opposite Status of its decorated Node instance.
Observer<T extends Subject>
The Observer class can subscribe to one or more Subject instances. It uses its argument handler Function in its receive(subject) method in order to handle any notifications.
The Print node forwards its String argument to a call to the Dart print() function when the Print instance calls its update() method.
A Selector evaluates its composite nodes sequentially expecting one of them to return Status.success, in which case the Selector returns Status.success.
A Sequence evaluates its composite nodes sequentially expecting all of them to return Status.success, in which case the Selector returns Status.success.
A StateMachine handles the update of a state and transitions between a state and other defined states.
Status code returned by the update() method of all Node types.
The Subject class has notifier Node and a notifications List. The notifier is updated and if its Status is part of notifications, the Subject notifies any subscribed Observer.


Determines the execution order of the transition condition.


makeClosure(void action(), {Status returning = Status.success}) Closure
Creates a Closure instance for the specified Function argument returning a predetermined Status value. The default predetermined Status is Status.success.


ObserverHandler<T> = void Function(T)

Exceptions / Errors

Error thrown when a Status contains an invalid value.