|
@@ -430,10 +430,34 @@ $core.addClass("Axon", $globals.Object, ["factory"], "Axxord");
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
$globals.Axon.comment="I represent a pub-sub based on a key (called 'aspect').\x0aI manage aspect-block subscriptions (called 'interests') as well as run blocks of dirtied interests.\x0aThe interest objects are responsible of decision if the change of an aspect is relevant for them.\x0aInterest object must be subclasses of `AxonInterest`.\x0a\x0aMy subclasses must provide implementation for:\x0a\x0a - add:\x0a - do:\x0a - clean";
|
|
|
//>>excludeEnd("ide");
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "add:",
|
|
|
+protocol: "primitive ops",
|
|
|
+fn: function (anInterest){
|
|
|
+var self=this,$self=this;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+$self._subclassResponsibility();
|
|
|
+return self;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"add:",{anInterest:anInterest},$globals.Axon)});
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+},
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: ["anInterest"],
|
|
|
+source: "add: anInterest\x0a\x09self subclassResponsibility",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+messageSends: ["subclassResponsibility"]
|
|
|
+}),
|
|
|
+$globals.Axon);
|
|
|
+
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "addInterest:",
|
|
|
-protocol: "action",
|
|
|
+protocol: "accessing",
|
|
|
fn: function (anInterest){
|
|
|
var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -461,7 +485,7 @@ $globals.Axon);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "changed:",
|
|
|
-protocol: "action",
|
|
|
+protocol: "change-update",
|
|
|
fn: function (anAspect){
|
|
|
var self=this,$self=this;
|
|
|
var needsToRun;
|
|
@@ -502,7 +526,7 @@ $globals.Axon);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "changedAll",
|
|
|
-protocol: "action",
|
|
|
+protocol: "change-update",
|
|
|
fn: function (){
|
|
|
var self=this,$self=this;
|
|
|
var needsToRun;
|
|
@@ -536,10 +560,34 @@ messageSends: ["do:", "flag", "dirty:"]
|
|
|
}),
|
|
|
$globals.Axon);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "clean",
|
|
|
+protocol: "primitive ops",
|
|
|
+fn: function (){
|
|
|
+var self=this,$self=this;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+$self._subclassResponsibility();
|
|
|
+return self;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"clean",{},$globals.Axon)});
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+},
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: [],
|
|
|
+source: "clean\x0a\x09self subclassResponsibility",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+messageSends: ["subclassResponsibility"]
|
|
|
+}),
|
|
|
+$globals.Axon);
|
|
|
+
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "dirty:",
|
|
|
-protocol: "action",
|
|
|
+protocol: "private",
|
|
|
fn: function (aBoolean){
|
|
|
var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -570,10 +618,34 @@ messageSends: ["ifTrue:", "fork", "run"]
|
|
|
}),
|
|
|
$globals.Axon);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "do:",
|
|
|
+protocol: "primitive ops",
|
|
|
+fn: function (aBlock){
|
|
|
+var self=this,$self=this;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+$self._subclassResponsibility();
|
|
|
+return self;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},$globals.Axon)});
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+},
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: ["aBlock"],
|
|
|
+source: "do: aBlock\x0a\x09self subclassResponsibility",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+messageSends: ["subclassResponsibility"]
|
|
|
+}),
|
|
|
+$globals.Axon);
|
|
|
+
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "run",
|
|
|
-protocol: "action",
|
|
|
+protocol: "private",
|
|
|
fn: function (){
|
|
|
var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -640,7 +712,7 @@ $core.addClass("SimpleAxon", $globals.Axon, ["queue"], "Axxord");
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "add:",
|
|
|
-protocol: "accessing",
|
|
|
+protocol: "primitive ops",
|
|
|
fn: function (aSubscription){
|
|
|
var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -664,7 +736,7 @@ $globals.SimpleAxon);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "clean",
|
|
|
-protocol: "bookkeeping",
|
|
|
+protocol: "primitive ops",
|
|
|
fn: function (){
|
|
|
var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
@@ -696,7 +768,7 @@ $globals.SimpleAxon);
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "do:",
|
|
|
-protocol: "enumeration",
|
|
|
+protocol: "primitive ops",
|
|
|
fn: function (aBlock){
|
|
|
var self=this,$self=this;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|