QuerySignal.st
changeset 420 081f7b2bb3b3
child 421 a0807a38319d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QuerySignal.st	Sat Sep 02 18:08:30 1995 +0200
@@ -0,0 +1,71 @@
+"
+ COPYRIGHT (c) 1995 by Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+Signal subclass:#QuerySignal
+	 instanceVariableNames:''
+	 classVariableNames:''
+	 poolDictionaries:''
+	 category:'Kernel-Exceptions'
+!
+
+!QuerySignal class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1995 by Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+!
+
+version
+"
+$Header: /cvs/stx/stx/libbasic/QuerySignal.st,v 1.1 1995-09-02 16:08:30 claus Exp $
+"
+!
+
+documentation
+"
+    QuerySignals are like signals, except that they are not accepted
+    by handlers for ordinary signals.
+    I.e. a signal handler for a normal signal will not handle a query
+    signal. Thus, these bypass any Object-ErrorSignal handler.
+"
+! !
+
+!QuerySignal methodsFor:'queries'!
+
+isQuerySignal
+    ^ true
+!
+
+accepts:aSignal
+    "return true, if the receiver accepts the argument, aSignal.
+     (i.e. the receiver is aSignal or a parent of it). False otherwise."
+
+    |s|
+
+    aSignal isQuery ifFalse:[^ false].
+
+    s := aSignal.
+    [s notNil] whileTrue:[
+	self == s ifTrue:[^ true].
+	s := s parent
+    ].
+    ^ false
+! !