forked from Distributive-Network/PythonMonkey
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntType.hh
More file actions
36 lines (29 loc) · 773 Bytes
/
Copy pathIntType.hh
File metadata and controls
36 lines (29 loc) · 773 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
/**
* @file IntType.hh
* @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network)
* @brief Struct for representing python ints
* @version 0.1
* @date 2022-07-27
*
* @copyright Copyright (c) 2022
*
*/
#ifndef PythonMonkey_IntType_
#define PythonMonkey_IntType_
#include "PyType.hh"
#include "TypeEnum.hh"
#include <Python.h>
#include <iostream>
/**
* @brief This struct represents the 'int' type in Python, which is represented as a 'long' in C++. It inherits from the PyType struct
*/
struct IntType : public PyType {
public:
IntType(PyObject *object);
IntType(long n);
const TYPE returnType = TYPE::INT;
long getValue() const;
protected:
virtual void print(std::ostream &os) const override;
};
#endif