Skip to content

Commit

Permalink
remove default arg from object
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Feb 17, 2024
1 parent aac5cd0 commit e2357a3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion benchmarks/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loki::pddl::AtomList create_atoms(
auto objects = loki::pddl::ObjectList();
for (size_t i = 1; i <= num_objects; ++i) {
objects.push_back(factories.objects.get_or_create<loki::pddl::ObjectImpl>(
("object_" + std::to_string(i)))
("object_" + std::to_string(i)), pddl::TypeList())
);
}

Expand Down
2 changes: 1 addition & 1 deletion include/loki/domain/pddl/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ObjectImpl : public Base<ObjectImpl> {
std::string m_name;
TypeList m_types;

ObjectImpl(int identifier, std::string name, TypeList types={});
ObjectImpl(int identifier, std::string name, TypeList types);

// Give access to the constructor.
template<typename HolderType, ElementsPerSegment N>
Expand Down
2 changes: 1 addition & 1 deletion src/domain/pddl/parser/constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void insert_context_information(const pddl::Object& constant, const domai
static pddl::Object parse_constant_definition(const domain::ast::Name& node, const pddl::TypeList& type_list, Context& context) {
const auto constant = context.factories.objects.get_or_create<pddl::ObjectImpl>(
parse(node),
pddl::TypeList{type_list});
type_list);
test_multiple_definition(constant, node, context);
insert_context_information(constant, node, context);
return constant;
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/common/pddl/persistent_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ TEST(LokiTests, PersistentFactoryTest) {
EXPECT_EQ(factory.size(), 0);

// Test uniqueness: insert the same element twice
const auto object_0_0 = factory.get_or_create<pddl::ObjectImpl>("object_0");
const auto object_0_0 = factory.get_or_create<pddl::ObjectImpl>("object_0", pddl::TypeList());
EXPECT_EQ(factory.size(), 1);
EXPECT_EQ(object_0_0->get_identifier(), 0);
EXPECT_EQ(object_0_0->get_name(), "object_0");

const auto object_0_1 = factory.get_or_create<pddl::ObjectImpl>("object_0");
const auto object_0_1 = factory.get_or_create<pddl::ObjectImpl>("object_0", pddl::TypeList());
EXPECT_EQ(factory.size(), 1);
EXPECT_EQ(object_0_0, object_0_1);

const auto object_1 = factory.get_or_create<pddl::ObjectImpl>("object_1");
const auto object_1 = factory.get_or_create<pddl::ObjectImpl>("object_1", pddl::TypeList());
EXPECT_EQ(factory.size(), 2);
EXPECT_NE(object_0_0, object_1);
EXPECT_EQ(object_1->get_identifier(), 1);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/common/pddl/reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace loki::domain::tests {

TEST(LokiTests, ReferenceTest) {
PersistentFactory<pddl::ObjectImpl, 2> factory;
const auto object_0 = factory.get_or_create<pddl::ObjectImpl>("object_0");
const auto object_1 = factory.get_or_create<pddl::ObjectImpl>("object_1");
const auto object_0 = factory.get_or_create<pddl::ObjectImpl>("object_0", pddl::TypeList());
const auto object_1 = factory.get_or_create<pddl::ObjectImpl>("object_1", pddl::TypeList());

ReferencedPDDLObjects references;
EXPECT_TRUE(!references.exists(object_0));
Expand Down

0 comments on commit e2357a3

Please sign in to comment.