|
SMACC2
|
Component that manages mission decision state. More...
#include <cp_decision_manager.hpp>
Public Member Functions | |
| CpDecisionManager ()=default | |
| virtual | ~CpDecisionManager ()=default |
| void | onInitialize () override |
| int | getDecisionCounter () const |
| Get the current decision counter value. | |
| int | nextDecision () |
| Increment the decision counter and return the previous value. | |
| void | resetDecisionCounter () |
| Reset the decision counter to zero. | |
| void | setDecisionCounter (int value) |
| Set the decision counter to a specific value. | |
Public Member Functions inherited from smacc2::ISmaccComponent | |
| ISmaccComponent () | |
| virtual | ~ISmaccComponent () |
| virtual std::string | getName () const |
Private Attributes | |
| std::mutex | mutex_ |
| int | decisionCounter_ = 0 |
Additional Inherited Members | |
Protected Member Functions inherited from smacc2::ISmaccComponent | |
| template<typename TOrthogonal , typename TClient > | |
| void | onComponentInitialization () |
| template<typename EventType > | |
| void | postEvent (const EventType &ev) |
| template<typename EventType > | |
| void | postEvent () |
| template<typename TOrthogonal , typename TSourceObject > | |
| void | onStateOrthogonalAllocation () |
| template<typename TComponent > | |
| void | requiresComponent (TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| template<typename TComponent > | |
| void | requiresComponent (std::string name, TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| template<typename TClient > | |
| void | requiresClient (TClient *&requiredClientStorage) |
| template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
| SmaccComponentType * | createSiblingComponent (TArgs... targs) |
| template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
| SmaccComponentType * | createSiblingNamedComponent (std::string name, TArgs... targs) |
| rclcpp::Node::SharedPtr | getNode () |
| rclcpp::Logger | getLogger () const |
| ISmaccStateMachine * | getStateMachine () |
Protected Attributes inherited from smacc2::ISmaccComponent | |
| ISmaccStateMachine * | stateMachine_ |
| ISmaccClient * | owner_ |
Component that manages mission decision state.
This component tracks the decision counter for mission sequencing. It provides thread-safe access to decision state, separating mission logic from the client orchestrator.
Definition at line 36 of file cp_decision_manager.hpp.
|
default |
|
virtualdefault |
|
inline |
Get the current decision counter value.
Definition at line 49 of file cp_decision_manager.hpp.
References decisionCounter_, and mutex_.
|
inline |
Increment the decision counter and return the previous value.
Definition at line 59 of file cp_decision_manager.hpp.
References decisionCounter_, smacc2::ISmaccComponent::getLogger(), and mutex_.
Referenced by cl_mission_tracker::CbBatteryDecission::onOrthogonalAllocation().
|
inlineoverridevirtual |
Reimplemented from smacc2::ISmaccComponent.
Definition at line 43 of file cp_decision_manager.hpp.
References smacc2::ISmaccComponent::getLogger().
|
inline |
Reset the decision counter to zero.
Definition at line 72 of file cp_decision_manager.hpp.
References decisionCounter_, smacc2::ISmaccComponent::getLogger(), and mutex_.
|
inline |
Set the decision counter to a specific value.
| value | New counter value |
Definition at line 83 of file cp_decision_manager.hpp.
References decisionCounter_, smacc2::ISmaccComponent::getLogger(), and mutex_.
|
private |
Definition at line 92 of file cp_decision_manager.hpp.
Referenced by getDecisionCounter(), nextDecision(), resetDecisionCounter(), and setDecisionCounter().
|
mutableprivate |
Definition at line 91 of file cp_decision_manager.hpp.
Referenced by getDecisionCounter(), nextDecision(), resetDecisionCounter(), and setDecisionCounter().