Mercurial > pytave
comparison oct-py-util.h @ 402:c4b78e449c62
maint: indent functions declared in the pytave namespace
* oct-py-eval.cc, oct-py-eval.h, oct-py-types.cc, oct-py-types.h,
oct-py-util.cc, oct-py-util.h: Indent functions declared in the pytave
namespace, adjust line wrap where necessary.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Fri, 28 Apr 2017 14:07:57 -0700 |
parents | 1470ed26917a |
children | b9b8790d1082 |
comparison
equal
deleted
inserted
replaced
401:3a64a336d214 | 402:c4b78e449c62 |
---|---|
19 <http://www.gnu.org/licenses/>. | 19 <http://www.gnu.org/licenses/>. |
20 | 20 |
21 */ | 21 */ |
22 | 22 |
23 #if ! defined (pytave_oct_py_util_h) | 23 #if ! defined (pytave_oct_py_util_h) |
24 #define pytave_oct_py_util_h | 24 #define pytave_oct_py_util_h 1 |
25 | 25 |
26 #include <Python.h> | 26 #include <Python.h> |
27 #include <stdint.h> | 27 #include <stdint.h> |
28 #include <string> | 28 #include <string> |
29 | 29 |
30 class octave_value; | 30 class octave_value; |
31 | 31 |
32 namespace pytave | 32 namespace pytave |
33 { | 33 { |
34 | 34 |
35 //! Return a reference to the builtins module. | 35 //! Return a reference to the builtins module. |
36 //! | 36 //! |
37 //! @return reference to the builtins module | 37 //! @return reference to the builtins module |
38 PyObject * | 38 PyObject * |
39 py_builtins_module (); | 39 py_builtins_module (); |
40 | 40 |
41 //! Return a reference to the named function in the given module. | 41 //! Return a reference to the named function in the given module. |
42 //! | 42 //! |
43 //! @param module module to find the function in | 43 //! @param module module to find the function in |
44 //! @param name name of the function | 44 //! @param name name of the function |
45 //! @return a reference to the function, or a null pointer | 45 //! @return a reference to the function, or a null pointer |
46 PyObject * | 46 PyObject * |
47 py_find_function (PyObject *module, const std::string& name); | 47 py_find_function (PyObject *module, const std::string& name); |
48 | 48 |
49 //! Return a reference to the named function in the given module. | 49 //! Return a reference to the named function in the given module. |
50 //! | 50 //! |
51 //! @param module name of the module to find the function in | 51 //! @param module name of the module to find the function in |
52 //! @param name name of the function | 52 //! @param name name of the function |
53 //! @return a reference to the function, or a null pointer | 53 //! @return a reference to the function, or a null pointer |
54 PyObject * | 54 PyObject * |
55 py_find_function (const std::string& module, const std::string& name); | 55 py_find_function (const std::string& module, const std::string& name); |
56 | 56 |
57 //! Return a reference to the fully-qualified function name. | 57 //! Return a reference to the fully-qualified function name. |
58 //! | 58 //! |
59 //! @param name fully-qualified name of the function | 59 //! @param name fully-qualified name of the function |
60 //! @return a reference to the function, or a null pointer | 60 //! @return a reference to the function, or a null pointer |
61 PyObject * | 61 PyObject * |
62 py_find_function (const std::string& name); | 62 py_find_function (const std::string& name); |
63 | 63 |
64 //! Return a reference to the fully-qualified type name. | 64 //! Return a reference to the fully-qualified type name. |
65 //! | 65 //! |
66 //! @param name fully-qualified name of the type | 66 //! @param name fully-qualified name of the type |
67 //! @return a reference to the type, or a null pointer | 67 //! @return a reference to the type, or a null pointer |
68 PyObject * | 68 PyObject * |
69 py_find_type (const std::string& name); | 69 py_find_type (const std::string& name); |
70 | 70 |
71 //! Return a reference to the named module. | 71 //! Return a reference to the named module. |
72 //! | 72 //! |
73 //! @param name fully-qualified name of the module | 73 //! @param name fully-qualified name of the module |
74 //! @return a reference to the module, or a null pointer | 74 //! @return a reference to the module, or a null pointer |
75 PyObject * | 75 PyObject * |
76 py_import_module (const std::string& name); | 76 py_import_module (const std::string& name); |
77 | 77 |
78 //! Check whether an object is an instance of a type. | 78 //! Check whether an object is an instance of a type. |
79 //! | 79 //! |
80 //! @param obj Python object | 80 //! @param obj Python object |
81 //! @param type Python type | 81 //! @param type Python type |
82 //! @return @c true if @a obj is an instance of @a type, @c false otherwise | 82 //! @return @c true if @a obj is an instance of @a type, @c false otherwise |
83 bool | 83 bool |
84 py_isinstance (PyObject *obj, PyObject *type); | 84 py_isinstance (PyObject *obj, PyObject *type); |
85 | 85 |
86 std::string | 86 std::string |
87 py_object_class_name (PyObject *obj); | 87 py_object_class_name (PyObject *obj); |
88 | 88 |
89 void | 89 void |
90 py_objstore_del (uint64_t key); | 90 py_objstore_del (uint64_t key); |
91 | 91 |
92 PyObject * | 92 PyObject * |
93 py_objstore_get (uint64_t key); | 93 py_objstore_get (uint64_t key); |
94 | 94 |
95 uint64_t | 95 uint64_t |
96 py_objstore_put (PyObject *obj); | 96 py_objstore_put (PyObject *obj); |
97 | 97 |
98 octave_value | 98 octave_value |
99 pyobject_wrap_object (PyObject *obj); | 99 pyobject_wrap_object (PyObject *obj); |
100 | 100 |
101 PyObject * | 101 PyObject * |
102 pyobject_unwrap_object (const octave_value& value); | 102 pyobject_unwrap_object (const octave_value& value); |
103 | 103 |
104 bool | 104 bool |
105 is_py_kwargs_argument (PyObject *obj); | 105 is_py_kwargs_argument (PyObject *obj); |
106 | 106 |
107 PyObject * | 107 PyObject * |
108 update_py_dict (PyObject *dict_orig, PyObject *dict_new); | 108 update_py_dict (PyObject *dict_orig, PyObject *dict_new); |
109 | 109 |
110 } | 110 } |
111 | 111 |
112 #endif | 112 #endif |