Skip to content

Commit

Permalink
removed base class since it became useless
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Aug 14, 2024
1 parent c36c767 commit 420bd84
Show file tree
Hide file tree
Showing 46 changed files with 512 additions and 182 deletions.
11 changes: 9 additions & 2 deletions include/loki/details/pddl/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
#ifndef LOKI_INCLUDE_LOKI_PDDL_ACTION_HPP_
#define LOKI_INCLUDE_LOKI_PDDL_ACTION_HPP_

#include "loki/details/pddl/base.hpp"
#include "loki/details/pddl/declarations.hpp"

#include <optional>
#include <string>

namespace loki
{
class ActionImpl : public Base<ActionImpl>
class ActionImpl
{
private:
size_t m_index;
std::string m_name;
// Indicate the original subseteq of variables before adding parameters during translations
size_t m_original_arity;
Expand All @@ -48,6 +48,13 @@ class ActionImpl : public Base<ActionImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
ActionImpl(const ActionImpl& other) = delete;
ActionImpl& operator=(const ActionImpl& other) = delete;
ActionImpl(ActionImpl&& other) = default;
ActionImpl& operator=(ActionImpl&& other) = default;

size_t get_index() const;
const std::string& get_name() const;
size_t get_original_arity() const;
const ParameterList& get_parameters() const;
Expand Down
11 changes: 9 additions & 2 deletions include/loki/details/pddl/atom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
#ifndef LOKI_INCLUDE_LOKI_PDDL_ATOM_HPP_
#define LOKI_INCLUDE_LOKI_PDDL_ATOM_HPP_

#include "loki/details/pddl/base.hpp"
#include "loki/details/pddl/declarations.hpp"

#include <string>

namespace loki
{
class AtomImpl : public Base<AtomImpl>
class AtomImpl
{
private:
size_t m_index;
Predicate m_predicate;
TermList m_terms;

Expand All @@ -38,6 +38,13 @@ class AtomImpl : public Base<AtomImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
AtomImpl(const AtomImpl& other) = delete;
AtomImpl& operator=(const AtomImpl& other) = delete;
AtomImpl(AtomImpl&& other) = default;
AtomImpl& operator=(AtomImpl&& other) = default;

size_t get_index() const;
const Predicate& get_predicate() const;
const TermList& get_terms() const;
};
Expand Down
11 changes: 9 additions & 2 deletions include/loki/details/pddl/axiom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
#ifndef LOKI_INCLUDE_LOKI_PDDL_DERIVED_PREDICATE_HPP_
#define LOKI_INCLUDE_LOKI_PDDL_DERIVED_PREDICATE_HPP_

#include "loki/details/pddl/base.hpp"
#include "loki/details/pddl/declarations.hpp"

#include <string>

namespace loki
{
class AxiomImpl : public Base<AxiomImpl>
class AxiomImpl
{
private:
size_t m_index;
std::string m_derived_predicate_name;
ParameterList m_parameters;
Condition m_condition;
Expand All @@ -40,6 +40,13 @@ class AxiomImpl : public Base<AxiomImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
AxiomImpl(const AxiomImpl& other) = delete;
AxiomImpl& operator=(const AxiomImpl& other) = delete;
AxiomImpl(AxiomImpl&& other) = default;
AxiomImpl& operator=(AxiomImpl&& other) = default;

size_t get_index() const;
const std::string& get_derived_predicate_name() const;
const ParameterList& get_parameters() const;
const Condition& get_condition() const;
Expand Down
52 changes: 0 additions & 52 deletions include/loki/details/pddl/base.hpp

This file was deleted.

71 changes: 63 additions & 8 deletions include/loki/details/pddl/conditions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#ifndef LOKI_INCLUDE_LOKI_PDDL_CONDITIONS_HPP_
#define LOKI_INCLUDE_LOKI_PDDL_CONDITIONS_HPP_

#include "loki/details/pddl/base.hpp"
#include "loki/details/pddl/declarations.hpp"

#include <string>
Expand All @@ -27,9 +26,10 @@ namespace loki
{

/* Literal */
class ConditionLiteralImpl : public Base<ConditionLiteralImpl>
class ConditionLiteralImpl
{
private:
size_t m_index;
Literal m_literal;

ConditionLiteralImpl(size_t index, Literal literal);
Expand All @@ -39,13 +39,21 @@ class ConditionLiteralImpl : public Base<ConditionLiteralImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
ConditionLiteralImpl(const ConditionLiteralImpl& other) = delete;
ConditionLiteralImpl& operator=(const ConditionLiteralImpl& other) = delete;
ConditionLiteralImpl(ConditionLiteralImpl&& other) = default;
ConditionLiteralImpl& operator=(ConditionLiteralImpl&& other) = default;

size_t get_index() const;
const Literal& get_literal() const;
};

/* And */
class ConditionAndImpl : public Base<ConditionAndImpl>
class ConditionAndImpl
{
private:
size_t m_index;
ConditionList m_conditions;

ConditionAndImpl(size_t index, ConditionList conditions);
Expand All @@ -55,13 +63,21 @@ class ConditionAndImpl : public Base<ConditionAndImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
ConditionAndImpl(const ConditionAndImpl& other) = delete;
ConditionAndImpl& operator=(const ConditionAndImpl& other) = delete;
ConditionAndImpl(ConditionAndImpl&& other) = default;
ConditionAndImpl& operator=(ConditionAndImpl&& other) = default;

size_t get_index() const;
const ConditionList& get_conditions() const;
};

/* Or */
class ConditionOrImpl : public Base<ConditionOrImpl>
class ConditionOrImpl
{
private:
size_t m_index;
ConditionList m_conditions;

ConditionOrImpl(size_t index, ConditionList conditions);
Expand All @@ -71,13 +87,21 @@ class ConditionOrImpl : public Base<ConditionOrImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
ConditionOrImpl(const ConditionOrImpl& other) = delete;
ConditionOrImpl& operator=(const ConditionOrImpl& other) = delete;
ConditionOrImpl(ConditionOrImpl&& other) = default;
ConditionOrImpl& operator=(ConditionOrImpl&& other) = default;

size_t get_index() const;
const ConditionList& get_conditions() const;
};

/* Not */
class ConditionNotImpl : public Base<ConditionNotImpl>
class ConditionNotImpl
{
private:
size_t m_index;
Condition m_condition;

ConditionNotImpl(size_t index, Condition condition);
Expand All @@ -87,13 +111,21 @@ class ConditionNotImpl : public Base<ConditionNotImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
ConditionNotImpl(const ConditionNotImpl& other) = delete;
ConditionNotImpl& operator=(const ConditionNotImpl& other) = delete;
ConditionNotImpl(ConditionNotImpl&& other) = default;
ConditionNotImpl& operator=(ConditionNotImpl&& other) = default;

size_t get_index() const;
const Condition& get_condition() const;
};

/* Imply */
class ConditionImplyImpl : public Base<ConditionImplyImpl>
class ConditionImplyImpl
{
private:
size_t m_index;
Condition m_condition_left;
Condition m_condition_right;

Expand All @@ -104,14 +136,22 @@ class ConditionImplyImpl : public Base<ConditionImplyImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
ConditionImplyImpl(const ConditionImplyImpl& other) = delete;
ConditionImplyImpl& operator=(const ConditionImplyImpl& other) = delete;
ConditionImplyImpl(ConditionImplyImpl&& other) = default;
ConditionImplyImpl& operator=(ConditionImplyImpl&& other) = default;

size_t get_index() const;
const Condition& get_condition_left() const;
const Condition& get_condition_right() const;
};

/* Exists */
class ConditionExistsImpl : public Base<ConditionExistsImpl>
class ConditionExistsImpl
{
private:
size_t m_index;
ParameterList m_parameters;
Condition m_condition;

Expand All @@ -122,14 +162,22 @@ class ConditionExistsImpl : public Base<ConditionExistsImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
ConditionExistsImpl(const ConditionExistsImpl& other) = delete;
ConditionExistsImpl& operator=(const ConditionExistsImpl& other) = delete;
ConditionExistsImpl(ConditionExistsImpl&& other) = default;
ConditionExistsImpl& operator=(ConditionExistsImpl&& other) = default;

size_t get_index() const;
const ParameterList& get_parameters() const;
const Condition& get_condition() const;
};

/* Forall */
class ConditionForallImpl : public Base<ConditionForallImpl>
class ConditionForallImpl
{
private:
size_t m_index;
ParameterList m_parameters;
Condition m_condition;

Expand All @@ -140,6 +188,13 @@ class ConditionForallImpl : public Base<ConditionForallImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
ConditionForallImpl(const ConditionForallImpl& other) = delete;
ConditionForallImpl& operator=(const ConditionForallImpl& other) = delete;
ConditionForallImpl(ConditionForallImpl&& other) = default;
ConditionForallImpl& operator=(ConditionForallImpl&& other) = default;

size_t get_index() const;
const ParameterList& get_parameters() const;
const Condition& get_condition() const;
};
Expand Down
11 changes: 9 additions & 2 deletions include/loki/details/pddl/domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#ifndef LOKI_INCLUDE_LOKI_PDDL_DOMAIN_HPP_
#define LOKI_INCLUDE_LOKI_PDDL_DOMAIN_HPP_

#include "loki/details/pddl/base.hpp"
#include "loki/details/pddl/declarations.hpp"
#include "loki/details/utils/filesystem.hpp"

Expand All @@ -28,9 +27,10 @@
namespace loki
{

class DomainImpl : public Base<DomainImpl>
class DomainImpl
{
private:
size_t m_index;
std::optional<fs::path> m_filepath;
std::string m_name;
Requirements m_requirements;
Expand All @@ -57,6 +57,13 @@ class DomainImpl : public Base<DomainImpl>
friend class UniqueFactory;

public:
// moveable but not copyable
DomainImpl(const DomainImpl& other) = delete;
DomainImpl& operator=(const DomainImpl& other) = delete;
DomainImpl(DomainImpl&& other) = default;
DomainImpl& operator=(DomainImpl&& other) = default;

size_t get_index() const;
const std::optional<fs::path>& get_filepath() const;
const std::string& get_name() const;
const Requirements& get_requirements() const;
Expand Down
Loading

0 comments on commit 420bd84

Please sign in to comment.