eccLib 1.3.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions | Variables
GtfDictViews.c File Reference
#include "GtfDictViews.h"
#include <stdint.h>
#include "../../formats/gtf.h"
#include "../../modules/eccLib.h"
#include "GtfDict.h"
Include dependency graph for GtfDictViews.c:

Data Structures

struct  view_logic_state
 Context for view_iterate_op. More...
 
struct  iterate_keys_context
 

Typedefs

typedef int(* op_func) (PyObject *restrict set, PyObject *restrict val, PyObject *restrict other)
 Function pointer type for set operation functions.
 
typedef PyObject *(* core_item_func) (uint8_t i, GtfDict_view *restrict self)
 Function pointer type for core field getters.
 
typedef PyObject *(* map_item_func) (struct map_tuple *restrict tuple)
 Function pointer type for map field getters.
 

Functions

static void GtfDict_View_dealloc (GtfDict_view *self)
 Deallocates a GtfDict_view object.
 
static Py_ssize_t GtfDict_view_length (GtfDict_view *self)
 Returns the length of a GtfDict_view object.
 
static int GtfDict_view_init (GtfDict_view *self, PyObject *args, PyObject *kwargs)
 Initializes a GtfDict_view object.
 
static int view_iterate_op (void *const context, void *const value)
 Generic iteration logic, using generic set operations.
 
static PyObject * GtfDict_view_set_op (GtfDict_view *restrict self, PyObject *restrict other, op_func op, core_item_func core_item, map_item_func map_item, bool set_init)
 Performs a set operation on the GtfDict_view object.
 
static int contains_op (PyObject *restrict set, PyObject *restrict val, PyObject *restrict other)
 Checks if a value is contained in a set.
 
static PyObject * GtfDict_View_richcompare (GtfDict_view *restrict self, PyObject *restrict other, const int op, core_item_func core_item, map_item_func map_item)
 Performs a rich comparison between two GtfDict_view objects.
 
static int base_and (PyObject *restrict set, PyObject *restrict val, PyObject *restrict other)
 The logic operation function for the AND view.
 
static int base_or (PyObject *restrict set, PyObject *restrict val, PyObject *restrict other)
 The logic operation function for the OR view.
 
static int base_subtract (PyObject *restrict set, PyObject *restrict val, PyObject *restrict other)
 The logic operation function for the SUBTRACT view.
 
static int base_xor (PyObject *restrict set, PyObject *restrict val, PyObject *restrict other)
 The logic operation function for the XOR view.
 
static PyObject * GtfDict_View_isdisjoint (GtfDict_view *restrict self, PyObject *restrict other, core_item_func core_item, map_item_func map_item)
 The isdisjoint method for the view.
 
static int iterate_keys (void *const context, void *const e)
 
static PyObject * GtfDict_KeyView_iter (GtfDict_view *self)
 Collects the keys of a GtfDict_view object into a tuple, and returns the iterator.
 
static int iterate_check_key (void *const context, void *const value)
 
static int GtfDict_KeyView_contains (GtfDict_view *self, PyObject *key)
 Checks if a key is contained in a GtfDict_view object.
 
static PyObject * KeyView_core_item_func (uint8_t i, GtfDict_view *restrict self)
 
static PyObject * KeyView_map_item_func (struct map_tuple *restrict tuple)
 
static PyObject * GtfDict_KeyView_richcompare (GtfDict_view *restrict self, PyObject *restrict other, const int op)
 Compares a GtfDict_KeyView object with another object using the specified operator.
 
static PyObject * GtfDict_KeyView_and (GtfDict_view *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_KeyView_or (GtfDict_view *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_KeyView_subtract (GtfDict_view *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_KeyView_xor (GtfDict_view *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_KeyView_isdisjoint (GtfDict_view *self, PyObject *other)
 
static int iterate_values (void *const context, void *const e)
 
static PyObject * GtfDict_ValueView_iter (GtfDict_view *self)
 Iterates over the values of a GtfDict_view object, and returns the iterator.
 
static int iterate_check_value (void *const context, void *const value)
 
static int GtfDict_ValueView_contains (GtfDict_view *self, PyObject *value)
 Checks if a value is contained in a GtfDict_ValueView object.
 
static PyObject * ValueView_core_item_func (uint8_t i, GtfDict_view *restrict self)
 
static PyObject * ValueView_map_item_func (struct map_tuple *restrict tuple)
 
static PyObject * GtfDict_ValueView_richcompare (GtfDict_view *restrict self, PyObject *restrict other, const int op)
 Compares a GtfDict_ValueView object with another object using the specified operator.
 
static int iterate_items (void *const context, void *const e)
 
static PyObject * GtfDict_ItemView_iter (GtfDict_view *self)
 Iterates over the items of a GtfDict_ItemView object, and returns the iterator.
 
static int iterate_check_item (void *const context, void *const value)
 
static int GtfDict_ItemView_contains (GtfDict_view *self, PyObject *value)
 Checks if a value is contained in a GtfDict_ItemView object.
 
static PyObject * ItemView_core_item_func (uint8_t i, GtfDict_view *restrict self)
 
static PyObject * ItemView_map_item_func (struct map_tuple *restrict tuple)
 
static PyObject * GtfDict_ItemView_richcompare (GtfDict_view *restrict self, PyObject *restrict other, const int op)
 Compares a GtfDict_ItemView object with another object using the specified operator.
 
static PyObject * GtfDict_ItemView_and (GtfDict_view *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_ItemView_or (GtfDict_view *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_ItemViewsubtract (GtfDict_view *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_ItemView_xor (GtfDict_view *restrict self, PyObject *restrict other)
 
static PyObject * GtfDict_ItemView_isdisjoint (GtfDict_view *self, PyObject *other)
 

Variables

static PyMethodDef GtfDict_KeyView_methods []
 
static PyNumberMethods GtfDict_KeyViewNum
 
static PySequenceMethods GtfDict_KeyViewSeq
 
PyTypeObject GtfDict_KeyViewType
 
static PySequenceMethods GtfDict_ValueViewSeq
 
PyTypeObject GtfDict_ValueViewType
 
static PyMethodDef GtfDict_ItemView_methods []
 
static PyNumberMethods GtfDict_ItemViewNum
 
PySequenceMethods GtfDict_ItemViewSeq
 
PyTypeObject GtfDict_ItemViewType
 

Function Documentation

◆ GtfDict_ItemView_and()

static PyObject * GtfDict_ItemView_and ( GtfDict_view *restrict  self,
PyObject *restrict  other 
)
static
Here is the call graph for this function:

◆ GtfDict_ItemView_contains()

static int GtfDict_ItemView_contains ( GtfDict_view self,
PyObject *  value 
)
static

Checks if a value is contained in a GtfDict_ItemView object.

Parameters
selfThe GtfDict_ItemView object to check.
valueThe value to check for.
Returns
1 if the value is contained in the GtfDict_ItemView object, 0 otherwise.
Here is the call graph for this function:

◆ GtfDict_ItemView_isdisjoint()

static PyObject * GtfDict_ItemView_isdisjoint ( GtfDict_view self,
PyObject *  other 
)
static
Here is the call graph for this function:

◆ GtfDict_ItemView_iter()

static PyObject * GtfDict_ItemView_iter ( GtfDict_view self)
static

Iterates over the items of a GtfDict_ItemView object, and returns the iterator.

Parameters
selfThe GtfDict_ItemView object to iterate over.
Returns
The iterator over the items of the GtfDict_ItemView object, or NULL on failure.
Here is the call graph for this function:

◆ GtfDict_ItemView_or()

static PyObject * GtfDict_ItemView_or ( GtfDict_view *restrict  self,
PyObject *restrict  other 
)
static
Here is the call graph for this function:

◆ GtfDict_ItemView_richcompare()

static PyObject * GtfDict_ItemView_richcompare ( GtfDict_view *restrict  self,
PyObject *restrict  other,
const int  op 
)
static

Compares a GtfDict_ItemView object with another object using the specified operator.

Parameters
selfThe GtfDict_ItemView object to compare.
otherThe object to compare with.
opThe operator to use for comparison.
Returns
The result of the comparison, or NULL on failure.
Here is the call graph for this function:

◆ GtfDict_ItemView_xor()

static PyObject * GtfDict_ItemView_xor ( GtfDict_view *restrict  self,
PyObject *restrict  other 
)
static
Here is the call graph for this function:

◆ GtfDict_ItemViewsubtract()

static PyObject * GtfDict_ItemViewsubtract ( GtfDict_view *restrict  self,
PyObject *restrict  other 
)
static
Here is the call graph for this function:

◆ GtfDict_KeyView_and()

static PyObject * GtfDict_KeyView_and ( GtfDict_view *restrict  self,
PyObject *restrict  other 
)
static
Here is the call graph for this function:

◆ GtfDict_KeyView_contains()

static int GtfDict_KeyView_contains ( GtfDict_view self,
PyObject *  key 
)
static

Checks if a key is contained in a GtfDict_view object.

Parameters
selfThe GtfDict_view object to check.
keyThe key to check for.
Returns
1 if the key is contained in the GtfDict_view object, 0 otherwise.
Here is the call graph for this function:

◆ GtfDict_KeyView_isdisjoint()

static PyObject * GtfDict_KeyView_isdisjoint ( GtfDict_view self,
PyObject *  other 
)
static
Here is the call graph for this function:

◆ GtfDict_KeyView_iter()

static PyObject * GtfDict_KeyView_iter ( GtfDict_view self)
static

Collects the keys of a GtfDict_view object into a tuple, and returns the iterator.

Parameters
selfThe GtfDict_view object to collect the keys from.
Returns
The iterator over the keys of the GtfDict_view object, or NULL on failure.
Here is the call graph for this function:

◆ GtfDict_KeyView_or()

static PyObject * GtfDict_KeyView_or ( GtfDict_view *restrict  self,
PyObject *restrict  other 
)
static
Here is the call graph for this function:

◆ GtfDict_KeyView_richcompare()

static PyObject * GtfDict_KeyView_richcompare ( GtfDict_view *restrict  self,
PyObject *restrict  other,
const int  op 
)
static

Compares a GtfDict_KeyView object with another object using the specified operator.

Parameters
selfThe GtfDict_KeyView object to compare.
otherThe object to compare with.
opThe operator to use for comparison.
Returns
The result of the comparison, or NULL on failure.
Here is the call graph for this function:

◆ GtfDict_KeyView_subtract()

static PyObject * GtfDict_KeyView_subtract ( GtfDict_view *restrict  self,
PyObject *restrict  other 
)
static
Here is the call graph for this function:

◆ GtfDict_KeyView_xor()

static PyObject * GtfDict_KeyView_xor ( GtfDict_view *restrict  self,
PyObject *restrict  other 
)
static
Here is the call graph for this function:

◆ GtfDict_ValueView_contains()

static int GtfDict_ValueView_contains ( GtfDict_view self,
PyObject *  value 
)
static

Checks if a value is contained in a GtfDict_ValueView object.

Parameters
selfThe GtfDict_ValueView object to check.
valueThe value to check for.
Returns
1 if the value is contained in the GtfDict_ValueView object, 0 otherwise.
Here is the call graph for this function:

◆ GtfDict_ValueView_iter()

static PyObject * GtfDict_ValueView_iter ( GtfDict_view self)
static

Iterates over the values of a GtfDict_view object, and returns the iterator.

Parameters
selfThe GtfDict_view object to iterate over.
Returns
The iterator over the values of the GtfDict_view object, or NULL on failure.
Here is the call graph for this function:

◆ GtfDict_ValueView_richcompare()

static PyObject * GtfDict_ValueView_richcompare ( GtfDict_view *restrict  self,
PyObject *restrict  other,
const int  op 
)
static

Compares a GtfDict_ValueView object with another object using the specified operator.

Parameters
selfThe GtfDict_ValueView object to compare.
otherThe object to compare with.
opThe operator to use for comparison.
Returns
The result of the comparison, or NULL on failure.
Here is the call graph for this function:

◆ ItemView_core_item_func()

static PyObject * ItemView_core_item_func ( uint8_t  i,
GtfDict_view *restrict  self 
)
static
Here is the caller graph for this function:

◆ ItemView_map_item_func()

static PyObject * ItemView_map_item_func ( struct map_tuple *restrict  tuple)
static
Here is the caller graph for this function:

◆ iterate_check_item()

static int iterate_check_item ( void *const  context,
void *const  value 
)
static
Here is the caller graph for this function:

◆ iterate_check_key()

static int iterate_check_key ( void *const  context,
void *const  value 
)
static
Here is the caller graph for this function:

◆ iterate_check_value()

static int iterate_check_value ( void *const  context,
void *const  value 
)
static
Here is the caller graph for this function:

◆ iterate_items()

static int iterate_items ( void *const  context,
void *const  e 
)
static
Here is the caller graph for this function:

◆ iterate_keys()

static int iterate_keys ( void *const  context,
void *const  e 
)
static
Here is the caller graph for this function:

◆ iterate_values()

static int iterate_values ( void *const  context,
void *const  e 
)
static
Here is the caller graph for this function:

◆ KeyView_core_item_func()

static PyObject * KeyView_core_item_func ( uint8_t  i,
GtfDict_view *restrict  self 
)
static
Here is the caller graph for this function:

◆ KeyView_map_item_func()

static PyObject * KeyView_map_item_func ( struct map_tuple *restrict  tuple)
static
Here is the caller graph for this function:

◆ ValueView_core_item_func()

static PyObject * ValueView_core_item_func ( uint8_t  i,
GtfDict_view *restrict  self 
)
static
Here is the caller graph for this function:

◆ ValueView_map_item_func()

static PyObject * ValueView_map_item_func ( struct map_tuple *restrict  tuple)
static
Here is the caller graph for this function:

Variable Documentation

◆ GtfDict_ItemView_methods

PyMethodDef GtfDict_ItemView_methods[]
static
Initial value:
= {
{"isdisjoint", (PyCFunction)GtfDict_ItemView_isdisjoint, METH_O,
"Returns true if the provided GtfDict_KeyView is disjoint from this "
"GtfDict_KeyView"},
{NULL, NULL, 0, NULL}
}
static PyObject * GtfDict_ItemView_isdisjoint(GtfDict_view *self, PyObject *other)
Definition GtfDictViews.c:778

◆ GtfDict_ItemViewNum

PyNumberMethods GtfDict_ItemViewNum
static
Initial value:
= {
.nb_and = (binaryfunc)GtfDict_ItemView_and,
.nb_or = (binaryfunc)GtfDict_ItemView_or,
.nb_subtract = (binaryfunc)GtfDict_ItemViewsubtract,
.nb_xor = (binaryfunc)GtfDict_ItemView_xor,
}
static PyObject * GtfDict_ItemView_or(GtfDict_view *restrict self, PyObject *restrict other)
Definition GtfDictViews.c:759
static PyObject * GtfDict_ItemView_and(GtfDict_view *restrict self, PyObject *restrict other)
Definition GtfDictViews.c:753
static PyObject * GtfDict_ItemView_xor(GtfDict_view *restrict self, PyObject *restrict other)
Definition GtfDictViews.c:772
static PyObject * GtfDict_ItemViewsubtract(GtfDict_view *restrict self, PyObject *restrict other)
Definition GtfDictViews.c:765

◆ GtfDict_ItemViewSeq

PySequenceMethods GtfDict_ItemViewSeq
Initial value:
= {
.sq_contains = (objobjproc)GtfDict_ItemView_contains,
.sq_length = (lenfunc)GtfDict_view_length}
static int GtfDict_ItemView_contains(GtfDict_view *self, PyObject *value)
Checks if a value is contained in a GtfDict_ItemView object.
Definition GtfDictViews.c:706
static Py_ssize_t GtfDict_view_length(GtfDict_view *self)
Returns the length of a GtfDict_view object.
Definition GtfDictViews.c:34

◆ GtfDict_ItemViewType

PyTypeObject GtfDict_ItemViewType
Initial value:
= {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "eccLib.GtfDict_ItemView",
.tp_basicsize = sizeof(GtfDict_view),
.tp_doc = PyDoc_STR("A view of the items in the GtfDict"),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
.tp_init = (initproc)GtfDict_view_init,
.tp_richcompare = (richcmpfunc)GtfDict_ItemView_richcompare,
.tp_iter = (getiterfunc)GtfDict_ItemView_iter,
.tp_dealloc = (destructor)GtfDict_View_dealloc,
.tp_as_sequence = &GtfDict_ItemViewSeq,
.tp_as_number = &GtfDict_ItemViewNum,
.tp_methods = GtfDict_ItemView_methods,
}
PySequenceMethods GtfDict_ItemViewSeq
Definition GtfDictViews.c:798
static PyMethodDef GtfDict_ItemView_methods[]
Definition GtfDictViews.c:784
static PyObject * GtfDict_ItemView_iter(GtfDict_view *self)
Iterates over the items of a GtfDict_ItemView object, and returns the iterator.
Definition GtfDictViews.c:653
static PyNumberMethods GtfDict_ItemViewNum
Definition GtfDictViews.c:791
static PyObject * GtfDict_ItemView_richcompare(GtfDict_view *restrict self, PyObject *restrict other, const int op)
Compares a GtfDict_ItemView object with another object using the specified operator.
Definition GtfDictViews.c:746
static void GtfDict_View_dealloc(GtfDict_view *self)
Deallocates a GtfDict_view object.
Definition GtfDictViews.c:23
static int GtfDict_view_init(GtfDict_view *self, PyObject *args, PyObject *kwargs)
Initializes a GtfDict_view object.
Definition GtfDictViews.c:46
Definition GtfDictViews.h:13

◆ GtfDict_KeyView_methods

PyMethodDef GtfDict_KeyView_methods[]
static
Initial value:
= {
{"isdisjoint", (PyCFunction)GtfDict_KeyView_isdisjoint, METH_O,
"Returns true if the provided GtfDict_KeyView is disjoint from this "
"GtfDict_KeyView"},
{NULL, NULL, 0, NULL}
}
static PyObject * GtfDict_KeyView_isdisjoint(GtfDict_view *self, PyObject *other)
Definition GtfDictViews.c:484

◆ GtfDict_KeyViewNum

PyNumberMethods GtfDict_KeyViewNum
static
Initial value:
= {
.nb_and = (binaryfunc)GtfDict_KeyView_and,
.nb_or = (binaryfunc)GtfDict_KeyView_or,
.nb_subtract = (binaryfunc)GtfDict_KeyView_subtract,
.nb_xor = (binaryfunc)GtfDict_KeyView_xor,
}
static PyObject * GtfDict_KeyView_and(GtfDict_view *restrict self, PyObject *restrict other)
Definition GtfDictViews.c:459
static PyObject * GtfDict_KeyView_subtract(GtfDict_view *restrict self, PyObject *restrict other)
Definition GtfDictViews.c:471
static PyObject * GtfDict_KeyView_or(GtfDict_view *restrict self, PyObject *restrict other)
Definition GtfDictViews.c:465
static PyObject * GtfDict_KeyView_xor(GtfDict_view *restrict self, PyObject *restrict other)
Definition GtfDictViews.c:478

◆ GtfDict_KeyViewSeq

PySequenceMethods GtfDict_KeyViewSeq
static
Initial value:
= {
.sq_contains = (objobjproc)GtfDict_KeyView_contains,
.sq_length = (lenfunc)GtfDict_view_length}
static int GtfDict_KeyView_contains(GtfDict_view *self, PyObject *key)
Checks if a key is contained in a GtfDict_view object.
Definition GtfDictViews.c:417

◆ GtfDict_KeyViewType

PyTypeObject GtfDict_KeyViewType
Initial value:
= {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "eccLib.GtfDict_KeyView",
.tp_basicsize = sizeof(GtfDict_view),
.tp_doc = PyDoc_STR("A view of the keys in the GtfDict"),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
.tp_init = (initproc)GtfDict_view_init,
.tp_richcompare = (richcmpfunc)GtfDict_KeyView_richcompare,
.tp_iter = (getiterfunc)GtfDict_KeyView_iter,
.tp_dealloc = (destructor)GtfDict_View_dealloc,
.tp_as_sequence = &GtfDict_KeyViewSeq,
.tp_as_number = &GtfDict_KeyViewNum,
.tp_methods = GtfDict_KeyView_methods,
}
static PySequenceMethods GtfDict_KeyViewSeq
Definition GtfDictViews.c:504
static PyObject * GtfDict_KeyView_iter(GtfDict_view *self)
Collects the keys of a GtfDict_view object into a tuple, and returns the iterator.
Definition GtfDictViews.c:379
static PyObject * GtfDict_KeyView_richcompare(GtfDict_view *restrict self, PyObject *restrict other, const int op)
Compares a GtfDict_KeyView object with another object using the specified operator.
Definition GtfDictViews.c:452
static PyMethodDef GtfDict_KeyView_methods[]
Definition GtfDictViews.c:490
static PyNumberMethods GtfDict_KeyViewNum
Definition GtfDictViews.c:497

◆ GtfDict_ValueViewSeq

PySequenceMethods GtfDict_ValueViewSeq
static
Initial value:
= {
.sq_contains = (objobjproc)GtfDict_ValueView_contains,
.sq_length = (lenfunc)GtfDict_view_length}
static int GtfDict_ValueView_contains(GtfDict_view *self, PyObject *value)
Checks if a value is contained in a GtfDict_ValueView object.
Definition GtfDictViews.c:580

◆ GtfDict_ValueViewType

PyTypeObject GtfDict_ValueViewType
Initial value:
= {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "eccLib.GtfDict_ValueView",
.tp_basicsize = sizeof(GtfDict_view),
.tp_doc = PyDoc_STR("A view of the values in the GtfDict"),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
.tp_init = (initproc)GtfDict_view_init,
.tp_richcompare = (richcmpfunc)GtfDict_ValueView_richcompare,
.tp_iter = (getiterfunc)GtfDict_ValueView_iter,
.tp_dealloc = (destructor)GtfDict_View_dealloc,
.tp_as_sequence = &GtfDict_ValueViewSeq,
}
static PyObject * GtfDict_ValueView_iter(GtfDict_view *self)
Iterates over the values of a GtfDict_view object, and returns the iterator.
Definition GtfDictViews.c:541
static PySequenceMethods GtfDict_ValueViewSeq
Definition GtfDictViews.c:614
static PyObject * GtfDict_ValueView_richcompare(GtfDict_view *restrict self, PyObject *restrict other, const int op)
Compares a GtfDict_ValueView object with another object using the specified operator.
Definition GtfDictViews.c:607