Skip to content

Commit

Permalink
made some classes moveable
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed May 29, 2024
1 parent c1b7e88 commit ebfba30
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 9 additions & 1 deletion include/loki/details/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions include/loki/details/pddl/factories.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 4 additions & 0 deletions include/loki/details/pddl/factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class PDDLFactory

public:
explicit PDDLFactory(size_t elements_per_segment) : m_persistent_vector(SegmentedVector<HolderType>(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.
Expand Down

0 comments on commit ebfba30

Please sign in to comment.