Skip to content

Commit

Permalink
restructure Hasher and EqualTo
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Aug 13, 2024
1 parent 8795951 commit d0dbdcd
Show file tree
Hide file tree
Showing 49 changed files with 1,109 additions and 1,103 deletions.
12 changes: 0 additions & 12 deletions include/loki/details/pddl/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@ class ActionImpl : public Base<ActionImpl>
const std::optional<Effect>& get_effect() const;
};

template<>
struct ShallowHash<const ActionImpl*>
{
size_t operator()(const ActionImpl* e) const;
};

template<>
struct ShallowEqualTo<const ActionImpl*>
{
bool operator()(const ActionImpl* l, const ActionImpl* r) const;
};

}

#endif
12 changes: 0 additions & 12 deletions include/loki/details/pddl/atom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ class AtomImpl : public Base<AtomImpl>
const TermList& get_terms() const;
};

template<>
struct ShallowHash<const AtomImpl*>
{
size_t operator()(const AtomImpl* e) const;
};

template<>
struct ShallowEqualTo<const AtomImpl*>
{
bool operator()(const AtomImpl* l, const AtomImpl* r) const;
};

}

#endif
12 changes: 0 additions & 12 deletions include/loki/details/pddl/axiom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,6 @@ class AxiomImpl : public Base<AxiomImpl>
size_t get_num_parameters_to_ground_head() const;
};

template<>
struct ShallowHash<const AxiomImpl*>
{
size_t operator()(const AxiomImpl* e) const;
};

template<>
struct ShallowEqualTo<const AxiomImpl*>
{
bool operator()(const AxiomImpl* l, const AxiomImpl* r) const;
};

}

#endif
4 changes: 0 additions & 4 deletions include/loki/details/pddl/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ class Base
Base(Base&& other) = default;
Base& operator=(Base&& other) = default;

bool operator<(const Base& other) const { return m_index < other.m_index; }

bool operator>(const Base& other) const { return m_index > other.m_index; }

/// @brief Overload of the output stream insertion operator (operator<<).
friend std::ostream& operator<<(std::ostream& os, const Base& element)
{
Expand Down
98 changes: 0 additions & 98 deletions include/loki/details/pddl/conditions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ class ConditionLiteralImpl : public Base<ConditionLiteralImpl>
const Literal& get_literal() const;
};

template<>
struct ShallowHash<const ConditionLiteralImpl&>
{
size_t operator()(const ConditionLiteralImpl& e) const;
};

template<>
struct ShallowEqualTo<const ConditionLiteralImpl&>
{
bool operator()(const ConditionLiteralImpl& l, const ConditionLiteralImpl& r) const;
};

/* And */
class ConditionAndImpl : public Base<ConditionAndImpl>
{
Expand All @@ -80,18 +68,6 @@ class ConditionAndImpl : public Base<ConditionAndImpl>
const ConditionList& get_conditions() const;
};

template<>
struct ShallowHash<const ConditionAndImpl&>
{
size_t operator()(const ConditionAndImpl& e) const;
};

template<>
struct ShallowEqualTo<const ConditionAndImpl&>
{
bool operator()(const ConditionAndImpl& l, const ConditionAndImpl& r) const;
};

/* Or */
class ConditionOrImpl : public Base<ConditionOrImpl>
{
Expand All @@ -115,18 +91,6 @@ class ConditionOrImpl : public Base<ConditionOrImpl>
const ConditionList& get_conditions() const;
};

template<>
struct ShallowHash<const ConditionOrImpl&>
{
size_t operator()(const ConditionOrImpl& e) const;
};

template<>
struct ShallowEqualTo<const ConditionOrImpl&>
{
bool operator()(const ConditionOrImpl& l, const ConditionOrImpl& r) const;
};

/* Not */
class ConditionNotImpl : public Base<ConditionNotImpl>
{
Expand All @@ -148,18 +112,6 @@ class ConditionNotImpl : public Base<ConditionNotImpl>
const Condition& get_condition() const;
};

template<>
struct ShallowHash<const ConditionNotImpl&>
{
size_t operator()(const ConditionNotImpl& e) const;
};

template<>
struct ShallowEqualTo<const ConditionNotImpl&>
{
bool operator()(const ConditionNotImpl& l, const ConditionNotImpl& r) const;
};

/* Imply */
class ConditionImplyImpl : public Base<ConditionImplyImpl>
{
Expand All @@ -183,18 +135,6 @@ class ConditionImplyImpl : public Base<ConditionImplyImpl>
const Condition& get_condition_right() const;
};

template<>
struct ShallowHash<const ConditionImplyImpl&>
{
size_t operator()(const ConditionImplyImpl& e) const;
};

template<>
struct ShallowEqualTo<const ConditionImplyImpl&>
{
bool operator()(const ConditionImplyImpl& l, const ConditionImplyImpl& r) const;
};

/* Exists */
class ConditionExistsImpl : public Base<ConditionExistsImpl>
{
Expand All @@ -218,18 +158,6 @@ class ConditionExistsImpl : public Base<ConditionExistsImpl>
const Condition& get_condition() const;
};

template<>
struct ShallowHash<const ConditionExistsImpl&>
{
size_t operator()(const ConditionExistsImpl& e) const;
};

template<>
struct ShallowEqualTo<const ConditionExistsImpl&>
{
bool operator()(const ConditionExistsImpl& l, const ConditionExistsImpl& r) const;
};

/* Forall */
class ConditionForallImpl : public Base<ConditionForallImpl>
{
Expand All @@ -253,32 +181,6 @@ class ConditionForallImpl : public Base<ConditionForallImpl>
const Condition& get_condition() const;
};

template<>
struct ShallowHash<const ConditionForallImpl&>
{
size_t operator()(const ConditionForallImpl& e) const;
};

template<>
struct ShallowEqualTo<const ConditionForallImpl&>
{
bool operator()(const ConditionForallImpl& l, const ConditionForallImpl& r) const;
};

/* ConditionImpl */

template<>
struct ShallowHash<const ConditionImpl*>
{
size_t operator()(const ConditionImpl* e) const;
};

template<>
struct ShallowEqualTo<const ConditionImpl*>
{
bool operator()(const ConditionImpl* l, const ConditionImpl* r) const;
};

}

#endif
4 changes: 2 additions & 2 deletions include/loki/details/pddl/declarations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ using PDDLElement = const T*;
*/

template<typename T>
struct ShallowHash;
struct Hasher;
template<typename T>
struct ShallowEqualTo;
struct EqualTo;

template<typename HolderType, typename Hash, typename EqualTo>
class UniqueFactory;
Expand Down
12 changes: 0 additions & 12 deletions include/loki/details/pddl/domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,6 @@ class DomainImpl : public Base<DomainImpl>
const AxiomList& get_axioms() const;
};

template<>
struct ShallowHash<const DomainImpl*>
{
size_t operator()(const DomainImpl* e) const;
};

template<>
struct ShallowEqualTo<const DomainImpl*>
{
bool operator()(const DomainImpl* l, const DomainImpl* r) const;
};

}

#endif
74 changes: 0 additions & 74 deletions include/loki/details/pddl/effects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ class EffectLiteralImpl : public Base<EffectLiteralImpl>
const Literal& get_literal() const;
};

template<>
struct ShallowHash<const EffectLiteralImpl&>
{
size_t operator()(const EffectLiteralImpl& e) const;
};

template<>
struct ShallowEqualTo<const EffectLiteralImpl&>
{
bool operator()(const EffectLiteralImpl& l, const EffectLiteralImpl& r) const;
};

/* And */
class EffectAndImpl : public Base<EffectAndImpl>
{
Expand All @@ -91,18 +79,6 @@ class EffectAndImpl : public Base<EffectAndImpl>
const EffectList& get_effects() const;
};

template<>
struct ShallowHash<const EffectAndImpl&>
{
size_t operator()(const EffectAndImpl& e) const;
};

template<>
struct ShallowEqualTo<const EffectAndImpl&>
{
bool operator()(const EffectAndImpl& l, const EffectAndImpl& r) const;
};

/* EffectNumeric */
class EffectNumericImpl : public Base<EffectNumericImpl>
{
Expand All @@ -128,18 +104,6 @@ class EffectNumericImpl : public Base<EffectNumericImpl>
const FunctionExpression& get_function_expression() const;
};

template<>
struct ShallowHash<const EffectNumericImpl&>
{
size_t operator()(const EffectNumericImpl& e) const;
};

template<>
struct ShallowEqualTo<const EffectNumericImpl&>
{
bool operator()(const EffectNumericImpl& l, const EffectNumericImpl& r) const;
};

/* ConditionalForall */
class EffectConditionalForallImpl : public Base<EffectConditionalForallImpl>
{
Expand All @@ -163,18 +127,6 @@ class EffectConditionalForallImpl : public Base<EffectConditionalForallImpl>
const Effect& get_effect() const;
};

template<>
struct ShallowHash<const EffectConditionalForallImpl&>
{
size_t operator()(const EffectConditionalForallImpl& e) const;
};

template<>
struct ShallowEqualTo<const EffectConditionalForallImpl&>
{
bool operator()(const EffectConditionalForallImpl& l, const EffectConditionalForallImpl& r) const;
};

/* ConditionalWhen */
class EffectConditionalWhenImpl : public Base<EffectConditionalWhenImpl>
{
Expand All @@ -198,32 +150,6 @@ class EffectConditionalWhenImpl : public Base<EffectConditionalWhenImpl>
const Effect& get_effect() const;
};

template<>
struct ShallowHash<const EffectConditionalWhenImpl&>
{
size_t operator()(const EffectConditionalWhenImpl& e) const;
};

template<>
struct ShallowEqualTo<const EffectConditionalWhenImpl&>
{
bool operator()(const EffectConditionalWhenImpl& l, const EffectConditionalWhenImpl& r) const;
};

/* EffectImpl */

template<>
struct ShallowHash<const EffectImpl*>
{
size_t operator()(const EffectImpl* e) const;
};

template<>
struct ShallowEqualTo<const EffectImpl*>
{
bool operator()(const EffectImpl* l, const EffectImpl* r) const;
};

}

#endif
Loading

0 comments on commit d0dbdcd

Please sign in to comment.