forked from dolphinsmalltalk/DolphinVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
STLinkedList.h
41 lines (30 loc) · 995 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
41
/******************************************************************************
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)
******************************************************************************/
#ifndef _IST_STLINKEDLIST_H_
#define _IST_STLINKEDLIST_H_
#include "STCollection.h"
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 };
};
#endif // EOF