.. _program_listing_file__tmp_ws_src_rmf_task_rmf_task_include_rmf_task_Event.hpp: Program Listing for File Event.hpp ================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/rmf_task/rmf_task/include/rmf_task/Event.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright (C) 2021 Open Source Robotics Foundation * * 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 RMF_TASK__EVENT_HPP #define RMF_TASK__EVENT_HPP #include #include #include #include #include #include #include namespace rmf_task { //============================================================================== class Event { public: enum class Status : uint32_t { Uninitialized = 0, Blocked, Error, Failed, Standby, Underway, Delayed, Skipped, Canceled, Killed, Completed, }; static Status sequence_status(Status earlier, Status later); class State; using ConstStatePtr = std::shared_ptr; class Snapshot; using ConstSnapshotPtr = std::shared_ptr; class AssignID; using AssignIDPtr = std::shared_ptr; }; //============================================================================== class Event::State { public: using Status = Event::Status; using ConstStatePtr = Event::ConstStatePtr; virtual uint64_t id() const = 0; virtual Status status() const = 0; bool finished() const; virtual VersionedString::View name() const = 0; virtual VersionedString::View detail() const = 0; virtual Log::View log() const = 0; virtual std::vector dependencies() const = 0; // Virtual destructor virtual ~State() = default; }; //============================================================================== class Event::Snapshot : public Event::State { public: static ConstSnapshotPtr make(const State& other); // Documentation inherited uint64_t id() const final; // Documentation inherited Status status() const final; // Documentation inherited VersionedString::View name() const final; // Documentation inherited VersionedString::View detail() const final; // Documentation inherited Log::View log() const final; // Documentation inherited std::vector dependencies() const final; class Implementation; private: Snapshot(); rmf_utils::impl_ptr _pimpl; }; //============================================================================== class Event::AssignID { public: static AssignIDPtr make(); AssignID(); uint64_t assign() const; class Implementation; private: rmf_utils::unique_impl_ptr _pimpl; }; } // namespace rmf_task #endif // RMF_TASK__EVENT_HPP