forked from Distributive-Network/PythonMonkey
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyType.hh
More file actions
40 lines (34 loc) · 833 Bytes
/
PyType.hh
File metadata and controls
40 lines (34 loc) · 833 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
37
38
39
40
/**
* @file PyType.hh
* @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network)
* @brief Struct representing python types
* @version 0.1
* @date 2022-07-27
*
* @copyright Copyright (c) 2022
*
*/
#ifndef PythonMonkey_PyType_
#define PythonMonkey_PyType_
#include "TypeEnum.hh"
#include <Python.h>
#include <iostream>
/**
* @brief Abstract struct that serves as a base for the different type relations in C++/Python
*/
struct PyType {
public:
PyType();
PyType(PyObject *object);
friend std::ostream &operator <<(std::ostream &str, const PyType &data) {
data.print(str);
return str;
}
const TYPE returnType = TYPE::DEFAULT;
PyObject *getPyObject();
~PyType();
protected:
virtual void print(std::ostream &os) const = 0;
PyObject *pyObject;
};
#endif