Skip to content

Commit

Permalink
Remove id from BlSpace, BlTask and BlParallelUniverse
Browse files Browse the repository at this point in the history
Also, remove BlUniqueIdGenerator as it is unreferenced now.

Fixes #639
  • Loading branch information
tinchodias committed Oct 24, 2024
1 parent fb1a3f9 commit fc73324
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 88 deletions.
12 changes: 1 addition & 11 deletions src/Bloc/BlParallelUniverse.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ I am a parallel Universe. There can exist multiple parallel universes
Class {
#name : #BlParallelUniverse,
#superclass : #Object,
#classTraits : 'TBlEventTarget classTrait',
#instVars : [
'id',
'deferredActions',
'postponedActions',
'hostClass',
'spaceManager'
],
#classVars : [
'UniqueIdGenerator',
'Universes',
'UniversesMutex'
],
Expand Down Expand Up @@ -53,9 +50,9 @@ BlParallelUniverse class >> forHost: aHostClass [

{ #category : #'class initialization' }
BlParallelUniverse class >> initialize [

Universes := #().
UniversesMutex := Mutex new.
UniqueIdGenerator := BlUniqueIdGenerator new.

SessionManager default registerGuiClassNamed: self name
]
Expand Down Expand Up @@ -220,18 +217,11 @@ BlParallelUniverse >> hostClass: aHostClass [
hostClass := aHostClass
]

{ #category : #accessing }
BlParallelUniverse >> id [

^ id
]

{ #category : #initialization }
BlParallelUniverse >> initialize [

super initialize.

id := UniqueIdGenerator generateUniqueId.
spaceManager := BlSpaceManager new.
hostClass := BlHeadlessHost.
deferredActions := WaitfreeQueue new.
Expand Down
26 changes: 0 additions & 26 deletions src/Bloc/BlSpace.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Class {
#traits : 'TBlEventTarget + TBlSpaceProperties + TBlDebug',
#classTraits : 'TBlEventTarget classTrait + TBlSpaceProperties classTrait + TBlDebug classTrait',
#instVars : [
'id',
'host',
'hostSpace',
'extent',
Expand Down Expand Up @@ -56,9 +55,6 @@ Class {
'userData',
'previousVisibleStatus'
],
#classVars : [
'UniqueIdGenerator'
],
#category : #'Bloc-Space'
}

Expand All @@ -83,11 +79,6 @@ BlSpace class >> extractRoots: aSetOfElements [
^ roots
]

{ #category : #'class initialization' }
BlSpace class >> initialize [
UniqueIdGenerator := BlUniqueIdGenerator new
]

{ #category : #'debug - simulation' }
BlSpace class >> locationInside: anElement [
"Return a random space location outside of element bounds"
Expand Down Expand Up @@ -511,14 +502,6 @@ BlSpace class >> simulateTextInput: aString on: aBlElement [
on: aBlElement
]

{ #category : #'class initialization' }
BlSpace class >> spaceWithId: aSpaceId do: aBlock [
^ self allSubInstances
detect: [ :eachSpace | eachSpace id = aSpaceId ]
ifFound: aBlock
ifNone: [ nil ]
]

{ #category : #accessing }
BlSpace >> asReference [
<return: #BlSpaceReference>
Expand Down Expand Up @@ -1184,20 +1167,11 @@ BlSpace >> icon: aStencil [
self fireEvent: (BlSpaceIconChangedEvent new iconStencil: aStencil)
]

{ #category : #accessing }
BlSpace >> id [
<return: #Number>

^ id
]

{ #category : #initialization }
BlSpace >> initialize [

super initialize.

id := UniqueIdGenerator generateUniqueId.

host := BlHost pickHost.
pulseRequested := true.
session := Smalltalk session.
Expand Down
31 changes: 7 additions & 24 deletions src/Bloc/BlTask.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,17 @@ Class {
#traits : 'TBlDebug',
#classTraits : 'TBlDebug classTrait',
#instVars : [
'id',
'state'
],
#classVars : [
'UniqueIdGenerator'
],
#category : #'Bloc-Space - Tasks'
}

{ #category : #'class initialization' }
BlTask class >> initialize [
UniqueIdGenerator := BlUniqueIdGenerator new
]

{ #category : #accessing }
BlTask >> id [
"Return a unique id of this task"
<return: #Number>

^ id
]

{ #category : #initialization }
BlTask >> initialize [

super initialize.

id := UniqueIdGenerator generateUniqueId.
state := #new.

state := #new
]

{ #category : #'private - state' }
Expand All @@ -61,7 +44,7 @@ BlTask >> isComplete [
{ #category : #'private - state' }
BlTask >> isExecuting [

^ state = #executing
^ state == #executing
]

{ #category : #'private - state' }
Expand Down Expand Up @@ -122,19 +105,19 @@ BlTask >> setExecuting [
{ #category : #'private - state' }
BlTask >> setNew [

state := #new.
state := #new
]

{ #category : #'private - state' }
BlTask >> setPendingExecution [

state := #pendingExecution.
state := #pendingExecution
]

{ #category : #'private - state' }
BlTask >> setQueued [

state := #queued.
state := #queued
]

{ #category : #'api - running' }
Expand Down
27 changes: 0 additions & 27 deletions src/Bloc/BlUniqueIdGenerator.class.st

This file was deleted.

0 comments on commit fc73324

Please sign in to comment.