eccLib 1.3.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
GtfDict views

All generic components of GtfDict views logic. More...

Data Structures

struct  view_logic_state
 Context for view_iterate_op. More...
 

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.
 

Detailed Description

All generic components of GtfDict views logic.

Typedef Documentation

◆ core_item_func

typedef PyObject *(* core_item_func) (uint8_t i, GtfDict_view *restrict self)

Function pointer type for core field getters.

Parameters
iThe index of the item.
selfThe GtfDict_view object.
Returns
The item at the given index, in the core field.
Warning
This should always be a new reference

◆ map_item_func

typedef PyObject *(* map_item_func) (struct map_tuple *restrict tuple)

Function pointer type for map field getters.

Parameters
tupleThe map tuple to operate on.
Returns
The item at the given index.
Warning
This should always be a new reference

◆ op_func

typedef int(* op_func) (PyObject *restrict set, PyObject *restrict val, PyObject *restrict other)

Function pointer type for set operation functions.

Parameters
setThe result set. May be NULL, depending on context.
valThe value to operate on. Never NULL.
otherThe other set to operate on. Never NULL.
Returns
0 on success, -1 on failure, alternatively, may be logical

Function Documentation

◆ base_and()

static int base_and ( PyObject *restrict  set,
PyObject *restrict  val,
PyObject *restrict  other 
)
static

The logic operation function for the AND view.

Parameters
setThe set to add to.
valThe value to add.
otherThe other set to compare against.
Returns
The result of the comparison.
Here is the caller graph for this function:

◆ base_or()

static int base_or ( PyObject *restrict  set,
PyObject *restrict  val,
PyObject *restrict  other 
)
static

The logic operation function for the OR view.

Parameters
setThe set to add to.
valThe value to add.
otherThe other set to compare against.
Returns
The result of the comparison.
Here is the caller graph for this function:

◆ base_subtract()

static int base_subtract ( PyObject *restrict  set,
PyObject *restrict  val,
PyObject *restrict  other 
)
static

The logic operation function for the SUBTRACT view.

Parameters
setThe set to add to.
valThe value to add.
otherThe other set to compare against.
Returns
The result of the comparison.
Here is the caller graph for this function:

◆ base_xor()

static int base_xor ( PyObject *restrict  set,
PyObject *restrict  val,
PyObject *restrict  other 
)
static

The logic operation function for the XOR view.

Parameters
setThe set to add to.
valThe value to add.
otherThe other set to compare against.
Returns
The result of the comparison.
Here is the caller graph for this function:

◆ contains_op()

static int contains_op ( PyObject *restrict  set,
PyObject *restrict  val,
PyObject *restrict  other 
)
static

Checks if a value is contained in a set.

Parameters
setThe set to compare.
valThe value to compare.
otherThe other set to compare against.
Returns
The result of the comparison.
Here is the caller graph for this function:

◆ GtfDict_View_dealloc()

static void GtfDict_View_dealloc ( GtfDict_view self)
static

Deallocates a GtfDict_view object.

Since all views function on the same base object, deallocation is shared

Parameters
selfThe GtfDict_view object to deallocate.

◆ GtfDict_view_init()

static int GtfDict_view_init ( GtfDict_view self,
PyObject *  args,
PyObject *  kwargs 
)
static

Initializes a GtfDict_view object.

Parameters
selfThe GtfDict_view object to initialize.
argsThe arguments to initialize the object with.
kwargsThe keyword arguments to initialize the object with.
Returns
0 on success, -1 on failure.

◆ GtfDict_View_isdisjoint()

static PyObject * GtfDict_View_isdisjoint ( GtfDict_view *restrict  self,
PyObject *restrict  other,
core_item_func  core_item,
map_item_func  map_item 
)
static

The isdisjoint method for the view.

Parameters
selfThe view object.
otherThe other set to compare against.
core_itemThe core item function.
map_itemThe map item function.
Returns
The result of the comparison.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GtfDict_view_length()

static Py_ssize_t GtfDict_view_length ( GtfDict_view self)
static

Returns the length of a GtfDict_view object.

Parameters
selfThe GtfDict_view object to get the length of.
Returns
The length of the GtfDict_view object.
Here is the caller graph for this function:

◆ GtfDict_View_richcompare()

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 
)
inlinestatic

Performs a rich comparison between two GtfDict_view objects.

Parameters
selfThe first GtfDict_view object.
otherThe second GtfDict_view object.
opThe comparison operator.
core_itemThe core item getter function.
map_itemThe map item getter function.
Returns
The result of the comparison.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GtfDict_view_set_op()

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 
)
inlinestatic

Performs a set operation on the GtfDict_view object.

Parameters
selfThe GtfDict_view object.
otherThe other set to operate on.
opThe operation function to perform.
core_itemThe core field getter function to use.
map_itemThe map getter function to use.
set_initWhether to initialize the result set with the other set.
Returns
The result set, or NULL on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ view_iterate_op()

static int view_iterate_op ( void *const  context,
void *const  value 
)
static

Generic iteration logic, using generic set operations.

Parameters
contextThe view_logic_state context.
valueThe map_tuple value.
Returns
The result of the operation.
Here is the caller graph for this function: