senf::console::factory Namespace Reference
[Supported command types]

Console node factories. More...

Detailed Description

Console node factories.

The senf::console::factory namespace (customarily aliased to fty in user code) contains factories used to create new node types:

namespace fty = senf::console::factory;

senf::console::DirectoryNode & dir (node.add("dirname", fty::Directory()));

dir.add("name", fty::Command<void(bool)>(&fn)
            .arg("flag")
            .doc("documentation"));

The node is added by passing the factory instance to senf::console::DirectoryNode::add().

To further customize the node, you may call attributor members on the temporary factory class instance. Since the attributor members always return a self-reference to the factory class instance, attributor calls may be chained arbitrarily.

See also:
Supported command types for details on the command nodes
The node tree for details on the structural nodes (directory, link)
Note:
All factories are documented here as classes when in fact some are functions returning internal classes.
Implementation note:
It is not true, that all attributor members return a self reference. Some attributor members will return a new object of slightly different type. However, the behavior is as documented above.

Classes

class   SimpleCommand
  SimpleCommandNode factory. More...
class   Directory
  DirectoryNode factory. More...
class   Link
  LinkNode factory. More...
class   Command
  OverloadedCommandNode factory. More...
class   Variable
  Variable node factory. More...