.. _program_listing_file__tmp_ws_src_ros2_planning_system_plansys2_tests_include_plansys2_tests_execution_logger.hpp: Program Listing for File execution_logger.hpp ============================================= |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/ros2_planning_system/plansys2_tests/include/plansys2_tests/execution_logger.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // Copyright 2021 Intelligent Robotics Lab // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef PLANSYS2_TESTS__EXECUTION_LOGGER_HPP_ #define PLANSYS2_TESTS__EXECUTION_LOGGER_HPP_ #include #include #include #include "plansys2_msgs/msg/action_execution_info.hpp" #include "plansys2_msgs/msg/action_execution.hpp" #include "rclcpp/rclcpp.hpp" namespace plansys2_tests { class ExecutionLogger : public rclcpp::Node { public: using Ptr = std::shared_ptr; static Ptr make_shared() { return std::make_shared(); } ExecutionLogger(); const std::list & get_action_execution_log() { return action_execution_log_; } const std::list & get_action_execution_info_log() { return action_execution_info_log_; } bool finished_before(const std::string & op1, const std::string & op2); bool started_before(const std::string & op1, const std::string & op2); bool before(const std::string & op1, const std::string & op2); bool sorted(const std::list & actions); bool is_executed(const std::string & action_full_name); private: rclcpp::Subscription::SharedPtr action_execution_sub_; rclcpp::Subscription::SharedPtr action_execution_info_sub_; std::list action_execution_log_; std::list action_execution_info_log_; }; } // namespace plansys2_tests #endif // PLANSYS2_TESTS__EXECUTION_LOGGER_HPP_