improved sync process (HB._encode)
This commit is contained in:
@@ -142,7 +142,7 @@ only one will AddName operation will be executed.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -157,7 +157,7 @@ This result can be sent to other clients.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Insert.html'>Insert</a>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -49,6 +49,18 @@ of the Engine is empty.</p>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#isDeleted-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>isDeleted</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
If isDeleted() is true this operation won't be maintained in the sl
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
@@ -78,21 +90,82 @@ of the Engine is empty.</p>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Insert.html'>Insert</a>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Insert.html#applyDelete-dynamic'>#applyDelete</a>
|
||||
<a href='../class/Insert.html#isDeleted-dynamic'>#isDeleted</a>
|
||||
<a href='../class/Insert.html#getDistanceToOrigin-dynamic'>#getDistanceToOrigin</a>
|
||||
<a href='../class/Insert.html#update_sl-dynamic'>#update_sl</a>
|
||||
<a href='../class/Insert.html#execute-dynamic'>#execute</a>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#execute-dynamic'>#execute</a>
|
||||
<a href='../class/Operation.html#saveOperation-dynamic'>#saveOperation</a>
|
||||
<a href='../class/Operation.html#validateSavedOperations-dynamic'>#validateSavedOperations</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(uid, prev_cl, next_cl, origin)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>prev_cl</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The predecessor of this operation in the complete-list (cl) </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>next_cl</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The successor of this operation in the complete-list (cl) </span>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='HistoryBuffer.getNextOperationIdentifier'>HistoryBuffer.getNextOperationIdentifier</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='isDeleted-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>isDeleted</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>If isDeleted() is true this operation won't be maintained in the sl</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
@@ -118,7 +191,7 @@ of the Engine is empty.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -49,6 +49,30 @@
|
||||
<b>parseOperation</b><span>(json)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Parses an operatio from the json format.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#applyOpsBundle-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOpsBundle</b><span>(ops_json)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Apply a set of operations.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#applyOpsCheckDouble-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOpsCheckDouble</b><span>(ops_json)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
@@ -61,6 +85,7 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Apply a set of operations.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
@@ -72,11 +97,7 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
<p>ops = [] for o in ops_json ops.push @parseOperation o
|
||||
for o in ops @HB.addOperation o
|
||||
for o in ops if not o.execute()
|
||||
@unprocessed_ops.push o
|
||||
@tryUnprocessed()</p>
|
||||
Apply an operation that you received from another peer.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
@@ -88,6 +109,7 @@ for o in ops if not o.execute()
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Call this method when you applied a new operation.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -112,6 +134,36 @@ for o in ops if not o.execute()
|
||||
<b>parseOperation</b><span>(json)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Parses an operatio from the json format. It uses the specified parser in your OperationType module.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='applyOpsBundle-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOpsBundle</b><span>(ops_json)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<div class='note'>
|
||||
<strong>Note:</strong>
|
||||
You must not use this method when you already have ops in your HB!
|
||||
</div>
|
||||
<p>Apply a set of operations. E.g. the operations you received from another users HB.toJson().</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='applyOpsCheckDouble-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOpsCheckDouble</b><span>(ops_json)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
@@ -121,7 +173,17 @@ for o in ops if not o.execute()
|
||||
<b>applyOps</b><span>(ops_json)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>Apply a set of operations. (Helper for using applyOp on Arrays)</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Engine.applyOp'>Engine.applyOp</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='applyOp-dynamic'>
|
||||
@@ -131,12 +193,7 @@ for o in ops if not o.execute()
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>ops = []
|
||||
for o in ops_json ops.push @parseOperation o
|
||||
for o in ops @HB.addOperation o
|
||||
for o in ops if not o.execute()
|
||||
@unprocessed_ops.push o
|
||||
@tryUnprocessed()</p>
|
||||
<p>Apply an operation that you received from another peer.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
@@ -148,12 +205,17 @@ for o in ops if not o.execute()
|
||||
<b>tryUnprocessed</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>Call this method when you applied a new operation.
|
||||
It checks if operations that were previously not executable are now executable.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<a href='#_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
<b>_encode</b><span>(state_vector = {})</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
@@ -206,7 +206,7 @@ This is why everybode must create the same operation with this uid.</p>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
<b>_encode</b><span>(state_vector = {})</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
@@ -256,7 +256,7 @@ other operations (it wont executed)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -50,7 +50,6 @@ For the sake of efficiency we maintain two lists: - The short-list (abbrev. sl)
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class='children'>
|
||||
<a href='../class/ImmutableObject.html'>ImmutableObject</a>
|
||||
<a href='../class/Delimiter.html'>Delimiter</a>
|
||||
</p>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
@@ -256,7 +255,7 @@ TODO (Unused)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -50,17 +50,6 @@
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getRootElement-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getRootElement</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#send-dynamic'>
|
||||
@@ -120,15 +109,6 @@
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getRootElement-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getRootElement</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='send-dynamic'>
|
||||
#
|
||||
@@ -168,7 +148,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -121,7 +121,7 @@ console.log(w.newProperty == "Awesome") # true!</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -250,7 +250,7 @@ JsonYatta was initialized (Depending on the HistoryBuffer implementation).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -208,7 +208,7 @@ Doesn't return left-right delimiter.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -46,6 +46,7 @@ val: in the case that the operation holds a value</p><p>Furthermore an encodable
|
||||
<p class='children'>
|
||||
<a href='../class/Delete.html'>Delete</a>
|
||||
<a href='../class/Insert.html'>Insert</a>
|
||||
<a href='../class/Delimiter.html'>Delimiter</a>
|
||||
</p>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
@@ -284,7 +285,7 @@ an easy way to refer to these operations via an uid or object reference.</p><p>F
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -189,7 +189,7 @@ Each Replaceable holds a value that is now replaceable.</p><p>The Word-type has
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -191,7 +191,7 @@ This result can be send to other clients.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -52,17 +52,6 @@
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getRootElement-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getRootElement</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#send-dynamic'>
|
||||
@@ -152,15 +141,6 @@
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getRootElement-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getRootElement</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='send-dynamic'>
|
||||
@@ -219,7 +199,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -173,7 +173,7 @@ This result can be send to other clients.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -233,7 +233,7 @@ to provide replace functionality.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 07, 14 21:48:38 by
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user