• OctoMY API
  • OctoMY API Reference
  • C++ Classes
  • OctoMY
  • NodeActivityContext
  • NodeActivityContext Class

    libnode-side implementation of octomy::activity::ActivityContext. More...

    Header: #include <NodeActivityContext>
    Inherits: octomy::activity::ActivityContext

    Detailed Description

    The concrete ActivityContext that NodeWindow constructs and hands to the ActivityLoader. Wraps a QSharedPointer<Node> and an ActivityStack pointer; activities reach the rest of the application by calling context()->facility("name") / context()->stack().

    Phase J of the Activity Stack Policy (§AS-A-2) introduces this so activity subclasses can stop holding a typed QSharedPointer<Node> and stop calling configure(node). Once migrated, they take an ActivityContext pointer in their constructor and pull facilities by string key.

    Facility surface

    Each built-in facility forwards to the Node accessor of the same meaning. Without a Node, no built-in facility resolves.

    A new entry is one forwarder line in facility().

    Lifetime

    The context is owned by NodeWindow (std::unique_ptr) and outlives every activity it hands out facilities to. Facilities returned by facility() have application lifetime; activities may cache the returned QSharedPointer<QObject> for as long as they live.

    Custom registration

    Tests and embedded scenarios can register ad-hoc facilities with registerFacility(name, object). A registered facility takes precedence over a built-in one of the same name, so a test can stub a production singleton that is hard to construct without subclassing NodeActivityContext.

    See also Node, ActivityStack, NodeWindow, and octomy::activity::ActivityContext.