Skip to content

Commit 75a5afb

Browse files
committed
chore(model-datastructure): removed unused IOperation.toCode()
1 parent f659204 commit 75a5afb

File tree

7 files changed

+0
-30
lines changed

7 files changed

+0
-30
lines changed

model-datastructure/src/commonMain/kotlin/org/modelix/model/operations/AbstractOperation.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ abstract class AbstractOperation : IOperation {
2929

3030
override fun getReferencedEntries(): List<KVEntryReference<IKVValue>> = listOf()
3131

32-
override fun toCode(): String {
33-
return ""
34-
}
35-
3632
protected fun getNodePosition(tree: ITree, nodeId: Long): PositionInRole {
3733
val parent = tree.getParent(nodeId)
3834
val role = tree.getRole(nodeId)

model-datastructure/src/commonMain/kotlin/org/modelix/model/operations/AddNewChildOp.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ class AddNewChildOp(position: PositionInRole, childId: Long, concept: IConceptRe
3636
override fun toString(): String {
3737
return "AddNewChildOp ${SerializationUtil.longToHex(childId)}, $position, $concept"
3838
}
39-
40-
override fun toCode(): String {
41-
return """t.addNewChild(0x${position.nodeId.toString(16)}, "${position.role}", ${position.index}, 0x${childId.toString(16)}, null)"""
42-
}
4339
}
4440

4541
open class AddNewChildrenOp(val position: PositionInRole, val childIds: LongArray, val concepts: Array<IConceptReference?>) : AbstractOperation() {
@@ -57,11 +53,6 @@ open class AddNewChildrenOp(val position: PositionInRole, val childIds: LongArra
5753
return "AddNewChildrenOp ${childIds.map { SerializationUtil.longToHex(it) }}, $position, $concepts"
5854
}
5955

60-
override fun toCode(): String {
61-
return "// TODO addNewChildren"
62-
// return """t.addNewChildren(0x${position.nodeId.toString(16)}, "${position.role}", ${position.index}, 0x${childId.toString(16)}, null)"""
63-
}
64-
6556
inner class Applied : AbstractOperation.Applied(), IAppliedOperation {
6657
override fun getOriginalOp() = this@AddNewChildrenOp
6758

model-datastructure/src/commonMain/kotlin/org/modelix/model/operations/AddNewChildSubtreeOp.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ class AddNewChildSubtreeOp(val resultTreeHash: KVEntryReference<CPTree>, val pos
7373
return "AddNewChildSubtreeOp ${resultTreeHash.getHash()}, ${SerializationUtil.longToHex(childId)}, $position, $concept"
7474
}
7575

76-
override fun toCode(): String {
77-
return """t.addNewChildSubtree(${resultTreeHash.getHash()}, 0x${position.nodeId.toString(16)}, "${position.role}", ${position.index}, 0x${childId.toString(16)}, null)"""
78-
}
79-
8076
inner class Applied(val store: IDeserializingKeyValueStore) : AbstractOperation.Applied(), IAppliedOperation {
8177
override fun getOriginalOp() = this@AddNewChildSubtreeOp
8278

model-datastructure/src/commonMain/kotlin/org/modelix/model/operations/BulkUpdateOp.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ class BulkUpdateOp(
5050
return "BulkUpdateOp ${resultTreeHash.getHash()}, ${SerializationUtil.longToHex(subtreeRootId)}"
5151
}
5252

53-
override fun toCode(): String {
54-
return """// TODO BulkUpdateOp"""
55-
}
56-
5753
inner class Applied(val baseTree: CLTree) : AbstractOperation.Applied(), IAppliedOperation {
5854
override fun getOriginalOp() = this@BulkUpdateOp
5955

model-datastructure/src/commonMain/kotlin/org/modelix/model/operations/DeleteNodeOp.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ class DeleteNodeOp(val childId: Long) : AbstractOperation(), IOperationIntend {
4141
return "DeleteNodeOp ${SerializationUtil.longToHex(childId)}"
4242
}
4343

44-
override fun toCode(): String {
45-
return """t.deleteNode(0x${childId.toString(16)})"""
46-
}
47-
4844
override fun restoreIntend(tree: ITree): List<IOperation> {
4945
if (!tree.containsNode(childId)) return listOf(NoOp())
5046
val allChildren = tree.getAllChildren(childId).toList()

model-datastructure/src/commonMain/kotlin/org/modelix/model/operations/IOperation.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ import org.modelix.model.persistent.IKVValue
2424
interface IOperation {
2525
fun apply(transaction: IWriteTransaction, store: IDeserializingKeyValueStore): IAppliedOperation
2626
fun captureIntend(tree: ITree, store: IDeserializingKeyValueStore): IOperationIntend
27-
fun toCode(): String
2827
fun getReferencedEntries(): List<KVEntryReference<IKVValue>>
2928
}

model-datastructure/src/commonMain/kotlin/org/modelix/model/operations/MoveNodeOp.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ class MoveNodeOp(val childId: Long, val targetPosition: PositionInRole) : Abstra
3838
return "MoveNodeOp ${childId.toString(16)}->$targetPosition"
3939
}
4040

41-
override fun toCode(): String {
42-
return """t.moveChild(0x${targetPosition.nodeId.toString(16)}, "${targetPosition.role}", ${targetPosition.index}, 0x${childId.toString(16)})"""
43-
}
44-
4541
inner class Applied(val sourcePosition: PositionInRole) : AbstractOperation.Applied(), IAppliedOperation {
4642
override fun getOriginalOp() = this@MoveNodeOp
4743

0 commit comments

Comments
 (0)