CallChain.st
author Claus Gittinger <cg@exept.de>
Sat, 19 Aug 2000 13:26:10 +0200
changeset 951 971345596471
parent 261 2fb596a13d0c
child 2282 542fe0c863d9
permissions -rw-r--r--
added #hash
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     1
"
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     3
	      All Rights Reserved
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     4
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     5
 This software is furnished under a license and may be used
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     6
 only in accordance with the terms of that license and with the
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     8
 be provided or otherwise made available to, or used by, any
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
     9
 other person.  No title to or ownership of the software is
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    10
 hereby transferred.
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    11
"
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    12
951
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    14
120
950e4628d657 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 119
diff changeset
    15
Object subclass:#CallChain
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    16
	instanceVariableNames:'receiver selector class isBlock rest'
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    17
	classVariableNames:''
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    18
	poolDictionaries:''
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    19
	category:'System-Debugging-Support'
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
    20
!
2911230f8e8e Initial revision
claus
parents:
diff changeset
    21
23
a85cd774be98 *** empty log message ***
claus
parents: 22
diff changeset
    22
!CallChain class methodsFor:'documentation'!
a85cd774be98 *** empty log message ***
claus
parents: 22
diff changeset
    23
24
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    24
copyright
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    25
"
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    26
 COPYRIGHT (c) 1995 by Claus Gittinger
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    27
	      All Rights Reserved
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    28
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    29
 This software is furnished under a license and may be used
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    30
 only in accordance with the terms of that license and with the
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    32
 be provided or otherwise made available to, or used by, any
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    33
 other person.  No title to or ownership of the software is
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    34
 hereby transferred.
10e1150b1f4b *** empty log message ***
claus
parents: 23
diff changeset
    35
"
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    36
!
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    37
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    38
documentation
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    39
"
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    40
    This is is used as a companion to MessageTally.
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    41
    Instances of it are used to represent a calling chain.
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    42
    They are simply holders for some of the contexts values - no
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    43
    intelligence here.
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    44
    (MessageTally could have used the contexts themself, but these
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    45
     may create more overhead)
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    46
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    47
    [author:]
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    48
        Claus Gittinger
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    49
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    50
    [see also:]
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    51
        MessageTally ProfileTree
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    52
        MessageTracer
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 120
diff changeset
    53
        AbstractTime
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    54
"
23
a85cd774be98 *** empty log message ***
claus
parents: 22
diff changeset
    55
! !
a85cd774be98 *** empty log message ***
claus
parents: 22
diff changeset
    56
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
    57
!CallChain methodsFor:'accessing'!
2911230f8e8e Initial revision
claus
parents:
diff changeset
    58
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    59
isBlock
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    60
    "return true, if this is a callChain for a block-context"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    61
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    62
    ^ isBlock
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
    63
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    64
    "Modified: 18.5.1996 / 18:52:05 / cg"
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
    65
!
2911230f8e8e Initial revision
claus
parents:
diff changeset
    66
2911230f8e8e Initial revision
claus
parents:
diff changeset
    67
methodClass
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    68
    "return the contexts methods class"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    69
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
    70
    ^ class
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    71
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    72
    "Modified: 18.5.1996 / 18:54:04 / cg"
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
    73
!
2911230f8e8e Initial revision
claus
parents:
diff changeset
    74
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    75
receiver
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    76
    "return the contexts receiver"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    77
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    78
    ^ receiver
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    79
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    80
    "Modified: 18.5.1996 / 18:54:12 / cg"
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    81
!
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    82
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
    83
receiver:r selector:s class:cls 
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    84
    "private tally interface - set receiver, selector and class.
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    85
     the block flag is cleared."
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    86
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
    87
    receiver := r.
2911230f8e8e Initial revision
claus
parents:
diff changeset
    88
    selector := s.
2911230f8e8e Initial revision
claus
parents:
diff changeset
    89
    class := cls.
2911230f8e8e Initial revision
claus
parents:
diff changeset
    90
    isBlock := false.
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    91
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    92
    "Modified: 18.5.1996 / 18:54:42 / cg"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    93
!
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    94
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    95
receiver:r selector:s class:cls isBlock:blk
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    96
    "private tally interface - set receiver, selector, class
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    97
     and the block flag."
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    98
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
    99
    receiver := r.
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   100
    selector := s.
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   101
    class := cls.
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   102
    isBlock := blk.
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   103
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   104
    "Created: 18.5.1996 / 18:52:34 / cg"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   105
    "Modified: 18.5.1996 / 18:54:58 / cg"
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
   106
!
2911230f8e8e Initial revision
claus
parents:
diff changeset
   107
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   108
rest
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   109
    "return the chains link"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   110
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   111
    ^ rest
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   112
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   113
    "Modified: 18.5.1996 / 18:55:24 / cg"
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
   114
!
2911230f8e8e Initial revision
claus
parents:
diff changeset
   115
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   116
rest:r
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   117
    "set the chains link"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   118
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   119
    rest := r.
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   120
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   121
    "Modified: 18.5.1996 / 18:55:19 / cg"
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
   122
!
2911230f8e8e Initial revision
claus
parents:
diff changeset
   123
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   124
selector
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   125
    "return the contexts selector"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   126
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   127
    ^ selector
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   128
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   129
    "Modified: 18.5.1996 / 18:55:11 / cg"
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
   130
! !
2911230f8e8e Initial revision
claus
parents:
diff changeset
   131
2911230f8e8e Initial revision
claus
parents:
diff changeset
   132
!CallChain methodsFor:'comparing'!
2911230f8e8e Initial revision
claus
parents:
diff changeset
   133
2911230f8e8e Initial revision
claus
parents:
diff changeset
   134
= someInfo
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   135
    "return true, if the argument chain is for the same method invocation"
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   136
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
   137
    receiver == someInfo receiver ifFalse:[^ false].
2911230f8e8e Initial revision
claus
parents:
diff changeset
   138
    selector == someInfo selector ifFalse:[^ false].
2911230f8e8e Initial revision
claus
parents:
diff changeset
   139
    ^ class == someInfo methodClass
261
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   140
2fb596a13d0c commentary
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   141
    "Modified: 18.5.1996 / 18:55:47 / cg"
951
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   142
!
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   143
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   144
hash
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   145
    "return an integer useful for hashing on the receiver;
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   146
     redefined since = is redefined here."
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   147
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   148
    ^ (receiver hash bitXor:selector hash) bitXor:class hash
22
2911230f8e8e Initial revision
claus
parents:
diff changeset
   149
! !
88
070ba8eb911e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   150
98
123d948aacd1 version at the end
Claus Gittinger <cg@exept.de>
parents: 88
diff changeset
   151
!CallChain class methodsFor:'documentation'!
123d948aacd1 version at the end
Claus Gittinger <cg@exept.de>
parents: 88
diff changeset
   152
123d948aacd1 version at the end
Claus Gittinger <cg@exept.de>
parents: 88
diff changeset
   153
version
951
971345596471 added #hash
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   154
    ^ '$Header: /cvs/stx/stx/libbasic3/CallChain.st,v 1.13 2000-08-19 11:26:10 cg Exp $'
98
123d948aacd1 version at the end
Claus Gittinger <cg@exept.de>
parents: 88
diff changeset
   155
! !