Skip to content

Commit 4cf75c1

Browse files
TestType, TestObj
1 parent be7c219 commit 4cf75c1

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

include/fields/obj.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class Obj : public QueueProvider {
2727
double getFieldValue(FieldDefinition* fd);
2828
double getFieldUpdatedValue(FieldDefinition* fd);
2929
Field** getFields();
30-
Queue* getQueue();
3130

3231
std::string toKeyString();
3332
std::string toString() const;

include/fields/test_object.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class TestObject : public Obj {
2626

2727
// Follow a many-relation
2828
RelatedObjectIterable* followManyRelation(Relation* rel) const override;
29+
30+
Queue* getQueue() const override;
2931
};
3032

3133
#endif // TEST_OBJECT_H

include/fields/test_type.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
#include "fields/type.h"
55
#include "fields/relation.h"
66
#include "fields/type_registry.h"
7-
#include "fields/test_object.h"
87
#include <vector>
98

9+
class TestObject;
10+
1011
class TestType : public Type {
1112
public:
1213
// Static constants

src/fields/obj.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ Field** Obj::getFields() {
6060
return fields;
6161
}
6262

63-
Queue* Obj::getQueue() {
64-
return nullptr; // Implementation for queue handling, for now returning nullptr
65-
}
66-
6763
std::string Obj::toKeyString() {
6864
return ""; // Implementation as needed
6965
}

src/fields/test_object.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
TestObject::TestObject(TestType* type) : Obj(type) {}
55

66
// Follow a single relation
7-
Obj* followSingleRelation(const Relation* rel) {
7+
Obj* TestObject::followSingleRelation(const Relation* rel) {
88
if (rel == &TestType::TEST_RELATION_FROM || rel == &TestType::TEST_RELATION_TO) {
99
return getRelatedTestObject();
1010
} else {
@@ -24,6 +24,10 @@ void TestObject::linkObjects(TestObject* objA, TestObject* objB) {
2424
}
2525

2626
// Follow a many-relation (returns a vector instead of Stream)
27-
RelatedObjectIterable* followManyRelation(Relation* rel) {
28-
return new SingleObjectIterator(relatedTestObject);
27+
RelatedObjectIterable* TestObject::followManyRelation(Relation* rel) const {
28+
return new SingleObjectIterable(relatedTestObject);
29+
}
30+
31+
Queue* TestObject::getQueue() const {
32+
return nullptr;
2933
}

src/fields/test_type.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "fields/test_type.h"
2+
#include "fields/test_object.h"
23

34
// Initialize static members
45
RelationOne TestType::SELF(0, "TEST_SELF");

tests/subtraction-test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ def test_something(self):
88
def testSubtraction(self):
99
registry = aika.TypeRegistry()
1010

11-
typeA = aika.Type(registry, "A")
12-
typeB = aika.Type(registry, "B")
11+
typeA = aika.TestType(registry, "A")
12+
typeB = aika.TestType(registry, "B")
1313

1414
a = typeA.inputField("a")
1515
b = typeB.inputField("b")

0 commit comments

Comments
 (0)