-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathSTLinkedList.h
40 lines (31 loc) · 973 Bytes
/
STLinkedList.h
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
/******************************************************************************
File: STCollection.h
Description:
VM representation of Smalltalk LinkedList class, and its links (LinkedList
uses intrusive linking).
N.B. The classes here defined are well known to the VM, and must not
be modified in the image. Note also that these classes may also have
a representation in the assembler modules (so see istasm.inc)
******************************************************************************/
#pragma once
#include "STCollection.h"
namespace ST
{
class LinkedList : public SequenceableCollection
{
public:
OTE* m_firstLink;
OTE* m_lastLink;
enum { FirstLinkIndex = SequenceableCollection::FixedSize, LastLinkIndex, FixedSize };
bool isEmpty();
void addLast(OTE* aLink);
OTE* removeFirst();
OTE* remove(OTE* aLink);
};
class Link : public Object
{
public:
OTE* m_nextLink;
enum { NextLinkIndex = ObjectFixedSize, FixedSize };
};
}