-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.hpp
More file actions
executable file
·34 lines (25 loc) · 901 Bytes
/
Array.hpp
File metadata and controls
executable file
·34 lines (25 loc) · 901 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
#ifndef _ARRAY_HPP
#define _ARRAY_HPP
#include "Variable.hpp"
class ArrayVariable; //Forward declaration
#include "ArrayVariable.hpp"
#include "Object.hpp"
#include "RuntimeException.hpp"
class Array : public Object {
private:
int size;
Types::TypeName arrayType;
Variable** internalArray = nullptr;
bool initialized = false;
public:
Array(int sz);
~Array();
Types::TypeName getArrayType() { return arrayType; }
void initializeInternalArray(Types::TypeName t);
Variable* get(int idx);
//void set(int idx, Variable* var);
void deleteObject();
Function* getFunction(Variable* var) { throw RuntimeException("Arrays do not have associated functions"); }
Variable* evaluateFunction(std::string& functionName, Variable* parameters) { throw RuntimeException("Arrays do not have associated functions"); }
};
#endif //_ARRAY_HPP