author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 20 Jun 2014 09:26:41 +0100 | |
changeset 20 | 76ac209277a7 |
parent 17 | 10d696c79188 |
child 35 | c17ecf90e446 |
permissions | -rw-r--r-- |
3
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'jv:libgdbs' }" |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
|
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
3 |
Object subclass:#GDBObject |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
4 |
instanceVariableNames:'properties' |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
classVariableNames:'' |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
poolDictionaries:'' |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
category:'GDB-Core' |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
! |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
|
17
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
10 |
!GDBObject class methodsFor:'accessing - GDB value descriptors'! |
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
11 |
|
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
12 |
gdbValueDescriptor |
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
13 |
^ GDBObjectValueDescriptor forClass: self. |
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
14 |
|
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
15 |
"Created: / 18-06-2014 / 23:12:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
16 |
! ! |
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
17 |
|
20
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
18 |
!GDBObject class methodsFor:'utilities - properties'! |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
19 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
20 |
getPropertiesOf: object |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
21 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
22 |
| names index properties | |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
23 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
24 |
names := object class allInstVarNames. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
25 |
index := names indexOf: #properties. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
26 |
index ~~ 0 ifTrue:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
27 |
properties := object instVarAt: index. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
28 |
properties isNil ifTrue:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
29 |
properties := Dictionary new. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
30 |
object instVarAt: index put: properties. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
31 |
^ properties |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
32 |
]. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
33 |
]. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
34 |
^ nil |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
35 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
36 |
"Created: / 20-06-2014 / 09:03:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
37 |
! |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
38 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
39 |
getProperty: nm of: object |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
40 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
41 |
| names index properties | |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
42 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
43 |
index := (names := object class allInstVarNames) indexOf: nm. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
44 |
index ~~ 0 ifTrue:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
45 |
^ object instVarAt: index. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
46 |
]. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
47 |
index := names indexOf: #properties. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
48 |
index ~~ 0 ifTrue:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
49 |
properties := object instVarAt: index. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
50 |
properties notNil ifTrue:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
51 |
^ properties at: nm ifAbsent:[ nil ] |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
52 |
]. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
53 |
]. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
54 |
^ nil |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
55 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
56 |
"Created: / 20-06-2014 / 08:59:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
57 |
! |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
58 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
59 |
setProperty: nm of: object to: value |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
60 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
61 |
| names index properties | |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
62 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
63 |
index := (names := object class allInstVarNames) indexOf: nm. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
64 |
index ~~ 0 ifTrue:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
65 |
object instVarAt: index put: value. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
66 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
67 |
] ifFalse:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
68 |
index := names indexOf: #properties. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
69 |
index ~~ 0 ifTrue:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
70 |
properties := object instVarAt: index. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
71 |
properties isNil ifTrue:[ |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
72 |
properties := Dictionary new. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
73 |
object instVarAt: index put: properties. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
74 |
]. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
75 |
properties at: nm put: value. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
76 |
]. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
77 |
]. |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
78 |
|
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
79 |
"Created: / 20-06-2014 / 09:01:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
80 |
! ! |
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
81 |
|
3
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
82 |
!GDBObject methodsFor:'accessing-properties'! |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
83 |
|
17
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
84 |
properties |
20
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
85 |
^ GDBObject getPropertiesOf: self. |
17
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
86 |
|
20
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
87 |
"Modified: / 20-06-2014 / 09:04:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
88 |
! |
10d696c79188
Value descroptors refactored.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
89 |
|
3
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
90 |
propertyAt: name |
20
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
91 |
^ GDBObject getProperty: name of: self |
3
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
92 |
|
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
93 |
"Created: / 31-05-2014 / 00:00:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
20
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
94 |
"Modified: / 20-06-2014 / 09:05:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
95 |
! |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
96 |
|
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
97 |
propertyAt: name put: value |
20
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
98 |
^ GDBObject setProperty: name of: self to: value |
3
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
99 |
|
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
100 |
"Created: / 31-05-2014 / 00:01:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
20
76ac209277a7
Unified implementation of #propertyAt: & #propertyAt:put:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17
diff
changeset
|
101 |
"Modified: / 20-06-2014 / 09:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
102 |
! ! |
29ea333a1811
More work on events and parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
103 |
|
16
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
104 |
!GDBObject methodsFor:'attributes access'! |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
105 |
|
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
106 |
objectAttributes |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
107 |
^ properties |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
108 |
|
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
109 |
"Created: / 18-06-2014 / 07:56:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
110 |
! |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
111 |
|
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
112 |
objectAttributes: aDictionary |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
113 |
properties := aDictionary |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
114 |
|
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
115 |
"Created: / 18-06-2014 / 07:57:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
116 |
! ! |
a5a8c0454395
Work in progress - object descriptors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
117 |