# Feature Macros

Several advanced [HFSM2](https://hfsm.dev/) features are disabled by default to improve build times for the average case, and are explicitly enabled using feature macros:

| Macro                                                                                                           | Feature                                 | API                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `HFSM2_ENABLE_ALL`                                                                                              | <p>All <br>Advanced</p><p>Features</p>  | See below                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `HFSM2_ENABLE_UTILITY_THEORY`                                                                                   | <p>Utility<br>Theory<br>Transitions</p> | <p><code>Config::RankT<></code><br><code>Config::UtilityT<></code><br><code>Config::RandomT<></code></p><p><code>void \*Root::utilize()</code></p><p><code>void \*Root::randomize()</code></p><p><code>void FullControl::utilize()</code></p><p><code>void FullControl::randomize()</code></p><p><code>void Plan::utilize()</code></p><p><code>void Plan::randomize()</code></p><p><code>void LoggerInterface::recordUtilityResolution() void LoggerInterface::recordRandomResolution()</code></p>      |
| `HFSM2_ENABLE_PLANS`                                                                                            | Plans                                   | <p><code>struct Plan</code><br><code>struct ConstPlan</code><br><code>void State::planSucceeded()</code><br><code>void State::planFailed()</code><br><code>ConstPlan Control::plan()</code><br><code>Plan PlanControl::plan()</code><br><code>void FullControl::succeed()</code><br><code>void FullControl::fail()</code><br><code>void LoggerInterface::recordTaskStatus()</code><br><code>void LoggerInterface::recordPlanStatus()</code></p>                                                         |
| `HFSM2_ENABLE_SERIALIZATION`                                                                                    | Serialization                           | <p><code>struct SerialBuffer</code></p><p><code>void \*Root::load()</code></p><p><code>void \*Root::load()</code></p>                                                                                                                                                                                                                                                                                                                                                                                   |
| `HFSM2_ENABLE_TRANSITION_HISTORY`                                                                               | <p>Transition</p><p>History</p>         | <p><code>struct Transition</code></p><p><code>struct TransitionHistory</code></p><p><code>TransitionHistory \*Root::transitionHistory()</code></p><p><code>void \*Root::replayTransition()</code></p><p><code>void \*Root::replayTransitions()</code></p>                                                                                                                                                                                                                                               |
| `HFSM2_ENABLE_STRUCTURE_REPORT`                                                                                 | <p>Structure</p><p>Report</p>           | <p><code>struct StructureEntry</code></p><p><code>struct Structure</code></p><p><code>Structure \*Root::structure()</code></p><p><code>struct ActivityHistory</code></p><p><code>ActivityHistory \*Root::activityHistory()</code></p>                                                                                                                                                                                                                                                                   |
| <p><code>HFSM2\_ENABLE\_VERBOSE\_DEBUG\_LOG</code>and / or</p><p><code>HFSM2\_ENABLE\_LOG\_INTERFACE</code></p> | Logging                                 | <p><code>void \*Root::attachLogger()</code><br><code>struct LoggerInterface</code><br><code>void LoggerInterface::recordMethod()</code><br><code>void LoggerInterface::recordTransition()</code><br><code>void LoggerInterface::recordTaskStatus()</code><br><code>void LoggerInterface::recordPlanStatus()</code><br><code>void LoggerInterface::recordCancelledPending()</code></p><p><code>void LoggerInterface::recordUtilityResolution() void LoggerInterface::recordRandomResolution()</code></p> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.hfsm.dev/user-guide/configuration/feature-macros.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
