aboutsummaryrefslogtreecommitdiffstats
path: root/Messages.st
blob: e4240fa28868cb2a39f0bdca3e4734a950989ea0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"General IE based message handling"
Object subclass: IEMessage [
    <category: 'osmo-messages'>
    | ies type |

    IEMessage class >> initWith: type [
        <category: 'creation'>
        ^ (self new)
            type: type;
            yourself
    ]

    type: aType [
        <category: 'creation'>
        type := aType.
    ]

    addIe: aIe [
        <category: 'creation'>
        self ies add: aIe.
    ]

    ies [
        <category: 'access'>
        ies isNil ifTrue: [
            ies := OrderedCollection new.
        ].

        ^ ies
    ]

    storeOn: aMsg [
        <category: 'creation'>
        aMsg putByte: type.

        self ies do: [:each | each storeOn: aMsg ]
    ]
]