-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathDictType.hh
36 lines (31 loc) · 870 Bytes
/
DictType.hh
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 DictType.hh
* @author Caleb Aikens (caleb@distributive.network), Giovanni Tedesco (giovanni@distributive.network) and Philippe Laporte (philippe@distributive.network)
* @brief Struct representing python dictionaries
* @date 2022-08-10
*
* @copyright Copyright (c) 2022,2024 Distributive Corp.
*
*/
#ifndef PythonMonkey_DictType_
#define PythonMonkey_DictType_
#include <jsapi.h>
#include <Python.h>
/**
* @brief This struct represents a dictionary in python.
*
* @author Giovanni
*/
struct DictType {
public:
/**
* @brief Construct a new DictType object from a JSObject.
*
* @param cx - pointer to the JSContext
* @param jsObject - pointer to the JSObject to be coerced
*
* @returns PyObject* pointer to the resulting PyObject
*/
static PyObject *getPyObject(JSContext *cx, JS::Handle<JS::Value> jsObject);
};
#endif