diff --git a/include/loki/details/parser.hpp b/include/loki/details/parser.hpp index 86e3b244..a214774f 100644 --- a/include/loki/details/parser.hpp +++ b/include/loki/details/parser.hpp @@ -46,6 +46,10 @@ class DomainParser public: DomainParser(const fs::path& file_path, bool strict = false, bool quiet = true); + DomainParser(const DomainParser& other) = delete; + DomainParser& operator=(const DomainParser& other) = delete; + DomainParser(DomainParser&& other) = default; + DomainParser& operator=(DomainParser&& other) = default; /// @brief Get factories to create additional PDDL objects. PDDLFactories& get_factories(); @@ -73,7 +77,11 @@ class ProblemParser Problem m_problem; public: - explicit ProblemParser(const fs::path& file_path, DomainParser& domain_parser, bool strict = false, bool quiet = true); + ProblemParser(const fs::path& file_path, DomainParser& domain_parser, bool strict = false, bool quiet = true); + ProblemParser(const ProblemParser& other) = delete; + ProblemParser& operator=(const ProblemParser& other) = delete; + ProblemParser(ProblemParser&& other) = default; + ProblemParser& operator=(ProblemParser&& other) = default; /// @brief Get position caches to be able to reference back to the input PDDL file. const PDDLPositionCache& get_position_cache() const; diff --git a/include/loki/details/pddl/factories.hpp b/include/loki/details/pddl/factories.hpp index 0c274fa8..edf80abd 100644 --- a/include/loki/details/pddl/factories.hpp +++ b/include/loki/details/pddl/factories.hpp @@ -141,12 +141,10 @@ class PDDLFactories problems(ProblemFactory(10)) { } - - // delete copy and move to avoid dangling references. PDDLFactories(const PDDLFactories& other) = delete; PDDLFactories& operator=(const PDDLFactories& other) = delete; - PDDLFactories(PDDLFactories&& other) = delete; - PDDLFactories& operator=(PDDLFactories&& other) = delete; + PDDLFactories(PDDLFactories&& other) = default; + PDDLFactories& operator=(PDDLFactories&& other) = default; Requirements get_or_create_requirements(RequirementEnumSet requirement_set) { diff --git a/include/loki/details/pddl/factory.hpp b/include/loki/details/pddl/factory.hpp index cb3b25dd..e6d9bcdd 100644 --- a/include/loki/details/pddl/factory.hpp +++ b/include/loki/details/pddl/factory.hpp @@ -50,6 +50,10 @@ class PDDLFactory public: explicit PDDLFactory(size_t elements_per_segment) : m_persistent_vector(SegmentedVector(elements_per_segment)) {} + PDDLFactory(const PDDLFactory& other) = delete; + PDDLFactory& operator=(const PDDLFactory& other) = delete; + PDDLFactory(PDDLFactory&& other) = default; + PDDLFactory& operator=(PDDLFactory&& other) = default; /// @brief Returns a pointer to an existing object /// or creates it before if it does not exist.