12345678910111213141516171819202122232425262728293031323334 |
- Smalltalk createPackage: 'Trapped-Counter'!
- (Smalltalk packageAt: 'Trapped-Counter') imports: {'trapped/Trapped-Processors'}!
- Object subclass: #TrappedCounter
- instanceVariableNames: 'value'
- package: 'Trapped-Counter'!
- !TrappedCounter methodsFor: 'accessing'!
- value
- ^value
- !
- value: aNumber
- value := aNumber
- ! !
- !TrappedCounter methodsFor: 'action'!
- decrement
- value := value - 1
- !
- increment
- value := value + 1
- ! !
- !TrappedCounter methodsFor: 'initialization'!
- initialize
- super initialize.
- SimpleAxon new registerIn: self.
- value := 0
- ! !
|