File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
model-client/src/commonMain/kotlin/org/modelix/model Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,20 @@ object ModelFacade {
55
55
return loadCurrentVersion(client, branch)?.getTree()
56
56
}
57
57
58
+ /* *
59
+ * The default thread-safe implementation of IBranch that enforces transactions.
60
+ */
61
+ fun newBranch (tree : ITree ): IBranch = PBranch (tree, IdGenerator .getInstance(1 ))
62
+
63
+ /* *
64
+ * A performance optimized branch that isn't thread-safe and doesn't enforce transactions.
65
+ * Should only be used for short living instances that are guaranteed to be used by a single thread.
66
+ * Not suitable for unit tests, because of the lack of enforcing transactions.
67
+ * Unless performance isn't critical .newBranch should be used instead.
68
+ */
69
+ fun newUnsafeBranch (tree : ITree ): IBranch = TreePointer (tree, IdGenerator .getInstance(1 ))
70
+
71
+ @Deprecated(" Use .toUnsafeBranch or .newBranch" )
58
72
fun toLocalBranch (tree : ITree ): IBranch = TreePointer (tree, IdGenerator .getInstance(1 ))
59
73
60
74
fun toNode (tree : ITree ): INode {
You can’t perform that action at this time.
0 commit comments