PythonMonkey   v1.0.1 (dev)
Loading...
Searching...
No Matches
JSArrayProxyMethodDefinitions Struct Reference

This struct is a bundle of methods used by the JSArrayProxy type. More...

#include <JSArrayProxy.hh>

Static Public Member Functions

static void JSArrayProxy_dealloc (JSArrayProxy *self)
 Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing the JSArrayProxy.
 
static Py_ssize_t JSArrayProxy_length (JSArrayProxy *self)
 Length method (.mp_length and .sq_length), returns the number of keys in the JSObject, used by the python len() method.
 
static PyObject * JSArrayProxy_get (JSArrayProxy *self, PyObject *key)
 returns a value from the JSArrayProxy given a key, or dispatches to the given key method if such method is found
 
static PyObject * JSArrayProxy_get_subscript (JSArrayProxy *self, PyObject *key)
 Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key which can be a slice, used by several built-in python methods as well as the [] and operator.
 
static int JSArrayProxy_assign_key (JSArrayProxy *self, PyObject *key, PyObject *value)
 Assign method (.mp_ass_subscript), assigns a key-value pair if value is non-NULL, or deletes a key-value pair if value is NULL.
 
static PyObject * JSArrayProxy_richcompare (JSArrayProxy *self, PyObject *other, int op)
 Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyObject.
 
static PyObject * JSArrayProxy_iter (JSArrayProxy *self)
 Return an iterator object to make JSArrayProxy iterable.
 
static PyObject * JSArrayProxy_iter_reverse (JSArrayProxy *self)
 Return a reverse iterator object to make JSArrayProxy backwards iterable.
 
static PyObject * JSArrayProxy_repr (JSArrayProxy *self)
 Compute a string representation of the JSArrayProxy.
 
static PyObject * JSArrayProxy_concat (JSArrayProxy *self, PyObject *value)
 concat method (.sq_concat), concatenates
 
static PyObject * JSArrayProxy_repeat (JSArrayProxy *self, Py_ssize_t n)
 repeat method (.sq_repeat), repeat self n number of time
 
static int JSArrayProxy_contains (JSArrayProxy *self, PyObject *element)
 Test contains method (.sq_contains)
 
static PyObject * JSArrayProxy_inplace_concat (JSArrayProxy *self, PyObject *value)
 inplace_concat method (.sq_inplace_concat), concatenates in_place
 
static PyObject * JSArrayProxy_inplace_repeat (JSArrayProxy *self, Py_ssize_t n)
 inplace_repeat method (.sq_inplace_repeat), repeats in_place
 
static PyObject * JSArrayProxy_clear_method (JSArrayProxy *self)
 clear method, empties the array
 
static PyObject * JSArrayProxy_copy (JSArrayProxy *self)
 copy method
 
static PyObject * JSArrayProxy_append (JSArrayProxy *self, PyObject *value)
 append method
 
static PyObject * JSArrayProxy_insert (JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
 insert method
 
static PyObject * JSArrayProxy_extend (JSArrayProxy *self, PyObject *iterable)
 extend method
 
static PyObject * JSArrayProxy_pop (JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
 pop method
 
static PyObject * JSArrayProxy_remove (JSArrayProxy *self, PyObject *value)
 remove method Remove first occurrence of value
 
static PyObject * JSArrayProxy_index (JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
 index method
 
static PyObject * JSArrayProxy_count (JSArrayProxy *self, PyObject *value)
 count method
 
static PyObject * JSArrayProxy_reverse (JSArrayProxy *self)
 reverse method Reverse list in place
 
static PyObject * JSArrayProxy_sort (JSArrayProxy *self, PyObject *args, PyObject *kwargs)
 sort method sort in place
 
static int JSArrayProxy_traverse (JSArrayProxy *self, visitproc visit, void *arg)
 tp_traverse
 
static int JSArrayProxy_clear (JSArrayProxy *self)
 tp_clear
 

Detailed Description

This struct is a bundle of methods used by the JSArrayProxy type.

Member Function Documentation

◆ JSArrayProxy_append()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_append ( JSArrayProxy self,
PyObject *  value 
)
static

append method

Parameters
self- The JSArrayProxy
value- The value to be appended
Returns
PyObject* NULL on exception, None otherwise

◆ JSArrayProxy_assign_key()

int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key ( JSArrayProxy self,
PyObject *  key,
PyObject *  value 
)
static

Assign method (.mp_ass_subscript), assigns a key-value pair if value is non-NULL, or deletes a key-value pair if value is NULL.

Parameters
self- The JSArrayProxy
key- The key to be set or deleted
valueIf NULL, the key-value pair is deleted, if not NULL then a key-value pair is assigned
Returns
int -1 on exception, any other value otherwise

◆ JSArrayProxy_clear()

int JSArrayProxyMethodDefinitions::JSArrayProxy_clear ( JSArrayProxy self)
static

tp_clear

Parameters
self- The JSArrayProxy
Returns
0 on success

◆ JSArrayProxy_clear_method()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_clear_method ( JSArrayProxy self)
static

clear method, empties the array

Parameters
self- The JSArrayProxy
Returns
None

◆ JSArrayProxy_concat()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_concat ( JSArrayProxy self,
PyObject *  value 
)
static

concat method (.sq_concat), concatenates

Parameters
self- The JSArrayProxy
value- The value to be concatenated
Returns
PyObject* NULL on exception, the corresponding new value otherwise

◆ JSArrayProxy_contains()

int JSArrayProxyMethodDefinitions::JSArrayProxy_contains ( JSArrayProxy self,
PyObject *  element 
)
static

Test contains method (.sq_contains)

Parameters
self- The JSObjectProxy
element- The element in the JSArrayProxy
Returns
int 1 if element is in List, 0 if not, and -1 on error

◆ JSArrayProxy_copy()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_copy ( JSArrayProxy self)
static

copy method

Parameters
self- The JSArrayProxy
Returns
a shallow copy of the list

◆ JSArrayProxy_count()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_count ( JSArrayProxy self,
PyObject *  value 
)
static

count method

Parameters
self- The JSArrayProxy
value- The value to be appended
Returns
PyObject* NULL on exception, the corresponding count of the found value as PyLong otherwise

◆ JSArrayProxy_dealloc()

void JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc ( JSArrayProxy self)
static

Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing the JSArrayProxy.

Parameters
self- The JSArrayProxy to be free'd

◆ JSArrayProxy_extend()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_extend ( JSArrayProxy self,
PyObject *  iterable 
)
static

extend method

Parameters
self- The JSArrayProxy
iterable- The value to be appended
Returns
PyObject* NULL on exception, None otherwise

◆ JSArrayProxy_get()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_get ( JSArrayProxy self,
PyObject *  key 
)
static

returns a value from the JSArrayProxy given a key, or dispatches to the given key method if such method is found

Parameters
self- The JSArrayProxy
key- The key for the value in the JSArrayProxy
Returns
PyObject* NULL on exception, the corresponding value otherwise

◆ JSArrayProxy_get_subscript()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript ( JSArrayProxy self,
PyObject *  key 
)
static

Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key which can be a slice, used by several built-in python methods as well as the [] and operator.

Parameters
self- The JSArrayProxy
key- The key for the value in the JSArrayProxy
Returns
PyObject* NULL on exception, the corresponding value otherwise

◆ JSArrayProxy_index()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_index ( JSArrayProxy self,
PyObject *const args,
Py_ssize_t  nargs 
)
static

index method

Parameters
self- The JSArrayProxy
args- arguments to the index method
nargs- number of arguments to the index method
Returns
PyObject* NULL on exception, the corresponding index of the found value as PyLong otherwise

◆ JSArrayProxy_inplace_concat()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat ( JSArrayProxy self,
PyObject *  value 
)
static

inplace_concat method (.sq_inplace_concat), concatenates in_place

Parameters
self- The JSArrayProxy
value- The value to be concatenated
Returns
PyObject* self

◆ JSArrayProxy_inplace_repeat()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat ( JSArrayProxy self,
Py_ssize_t  n 
)
static

inplace_repeat method (.sq_inplace_repeat), repeats in_place

Parameters
self- The JSArrayProxy
nThe number of times to repeat
Returns
PyObject* self

◆ JSArrayProxy_insert()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_insert ( JSArrayProxy self,
PyObject *const args,
Py_ssize_t  nargs 
)
static

insert method

Parameters
self- The JSArrayProxy
args- arguments to the insert method
nargs- number of arguments to the insert method
Returns
PyObject* NULL on exception, None otherwise

◆ JSArrayProxy_iter()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_iter ( JSArrayProxy self)
static

Return an iterator object to make JSArrayProxy iterable.

Parameters
self- The JSArrayProxy
Returns
PyObject* - iterator object

◆ JSArrayProxy_iter_reverse()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_iter_reverse ( JSArrayProxy self)
static

Return a reverse iterator object to make JSArrayProxy backwards iterable.

Parameters
self- The JSArrayProxy
Returns
PyObject* - iterator object

◆ JSArrayProxy_length()

Py_ssize_t JSArrayProxyMethodDefinitions::JSArrayProxy_length ( JSArrayProxy self)
static

Length method (.mp_length and .sq_length), returns the number of keys in the JSObject, used by the python len() method.

Parameters
self- The JSArrayProxy
Returns
Py_ssize_t The length of the JSArrayProxy

◆ JSArrayProxy_pop()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_pop ( JSArrayProxy self,
PyObject *const args,
Py_ssize_t  nargs 
)
static

pop method

Parameters
self- The JSArrayProxy
args- arguments to the pop method
nargs- number of arguments to the pop method
Returns
PyObject* NULL on exception, the corresponding value otherwise

◆ JSArrayProxy_remove()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_remove ( JSArrayProxy self,
PyObject *  value 
)
static

remove method Remove first occurrence of value

Parameters
self- The JSArrayProxy
value- The value to be appended
Returns
PyObject* NULL on exception, None otherwise

◆ JSArrayProxy_repeat()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_repeat ( JSArrayProxy self,
Py_ssize_t  n 
)
static

repeat method (.sq_repeat), repeat self n number of time

Parameters
self- The JSArrayProxy
nThe number of times to repeat
Returns
PyObject* NULL on exception, the corresponding new value otherwise

◆ JSArrayProxy_repr()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_repr ( JSArrayProxy self)
static

Compute a string representation of the JSArrayProxy.

Parameters
self- The JSArrayProxy
Returns
the string representation (a PyUnicodeObject) on success, NULL on failure

◆ JSArrayProxy_reverse()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_reverse ( JSArrayProxy self)
static

reverse method Reverse list in place

Parameters
self- The JSArrayProxy
Returns
PyObject* NULL on exception, None otherwise

◆ JSArrayProxy_richcompare()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare ( JSArrayProxy self,
PyObject *  other,
int  op 
)
static

Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyObject.

Parameters
self- The JSArrayProxy
other- Any other PyObject
op- Which boolean operator is being performed (Py_EQ for equality, Py_NE for inequality, all other operators are not implemented)
Returns
PyObject* - True or false depending on result of comparison

◆ JSArrayProxy_sort()

PyObject * JSArrayProxyMethodDefinitions::JSArrayProxy_sort ( JSArrayProxy self,
PyObject *  args,
PyObject *  kwargs 
)
static

sort method sort in place

Parameters
self- The JSArrayProxy
args- arguments to the sort method (not used)
kwargs- keyword arguments to the sort method (reverse=True|False, key=keyfunction)
Returns
PyObject* NULL on exception, None otherwise

◆ JSArrayProxy_traverse()

int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse ( JSArrayProxy self,
visitproc  visit,
void *  arg 
)
static

tp_traverse

Parameters
self- The JSArrayProxy
visit- The function to be applied on each element of the list
arg- The argument to the visit function
Returns
0 on success

The documentation for this struct was generated from the following files: