-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStack.h
More file actions
36 lines (27 loc) · 668 Bytes
/
Stack.h
File metadata and controls
36 lines (27 loc) · 668 Bytes
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
#ifndef STACK_H
#define STACK_H
#include "BoxInfo.h"
#include "Data.h"
#include "OrderedCollection.h"
#include "MemoryHandler.h"
#include "BoxTrace.h"
class Stack : public OrderedCollection <Data>, public MemoryHandler {
public:
void addData(Type, Address);
};
void Stack::addData(Type type, Address value)
{
Data *data;
Size size;
TRACE("STACK", "addData(type %u, value 0x%X)", type, value);
if (type == BOX_STRING)
size = strlen(value);
else
size = DATA_TYPES_SIZE[type];
data = new Data(type);
data->setSize(size);
data->setAddress(this->allocate(size));
data->setVal(value);
add(data);
}
#endif