BehaviorTree
Core Library to create and execute Behavior Trees
Loading...
Searching...
No Matches
updated_action.h
1/* Copyright (C) 2024-2025 Davide Faconti - All Rights Reserved
2*
3* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
4* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
5* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7*
8* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
10* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11*/
12
13#pragma once
14
15#include "behaviortree_cpp/action_node.h"
16
17namespace BT
18{
19/**
20 * @brief The EntryUpdatedAction checks the Timestamp in an entry
21 * to determine if the value was updated since the last time.
22 *
23 * SUCCESS if it was updated, since the last time it was checked,
24 * FAILURE if it doesn't exist or was not updated.
25 */
27{
28public:
29 EntryUpdatedAction(const std::string& name, const NodeConfig& config);
30
31 ~EntryUpdatedAction() override = default;
32
33 EntryUpdatedAction(const EntryUpdatedAction&) = delete;
34 EntryUpdatedAction& operator=(const EntryUpdatedAction&) = delete;
35 EntryUpdatedAction(EntryUpdatedAction&&) = delete;
36 EntryUpdatedAction& operator=(EntryUpdatedAction&&) = delete;
37
38 static PortsList providedPorts()
39 {
40 return { InputPort<BT::Any>("entry", "Entry to check") };
41 }
42
43private:
44 uint64_t sequence_id_ = 0;
45 std::string entry_key_;
46
47 NodeStatus tick() override;
48};
49
50} // namespace BT
Definition: safe_any.hpp:50
The EntryUpdatedAction checks the Timestamp in an entry to determine if the value was updated since t...
Definition: updated_action.h:27
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
Definition: action_node.h:57
Definition: action_node.h:24
NodeStatus
Definition: basic_types.h:34
Definition: tree_node.h:105