NodeFeature

One feature of a composable node (work-placement §WPK-2, app-composition W8).

In the namespace nodekit. Declared in src/libs/libnodekit/nodekit/NodeFeature.hpp.

Detailed description

A feature makes its services, puts them on a service level, and publishes its facilities, all in `install`. It answers the four questions of app-composition §ACF-2:

- **Needs**: `needs()` names the features it cannot work without. The kit refuses to install it without them. `wants()` names the features it uses when the kit has them; the kit installs those first, and a missing one is not an error. - **Access**: what `install` publishes through `NodeKitScope::publish`, reached by name through `ActivityContext::facility`. - **Lifecycle**: the level that `install` gives each service to. - **Proof**: each feature has a test that needs no `Node` (testNodeKit).

The spec calls the first function `requires()`. It is `needs()` here, because `requires` is a keyword in C++20, which the tree compiles.

Name and type

A feature type has a static `featureName()`, and `name()` returns it. `NodeKitScope::feature<T>()` finds a feature by that name and casts with `static_cast`, the tree's idiom without RTTI (styles/code-cpp.md). The kit refuses two features of one name, so one name is one type in a kit.

In this section