My Project
Public Member Functions | Private Member Functions
PythonCastStatic< PythonObject::sequence_tag > Class Reference

Template specialization for getting handling sequence. More...

Public Member Functions

 PythonCastStatic (leftv value)
 
- Public Member Functions inherited from PythonObject
 PythonObject ()
 
 PythonObject (ptr_type ptr)
 
ptr_type check_context (ptr_type ptr) const
 
self operator() (int op) const
 Unary operations. More...
 
self operator() (int op, const self &arg) const
 Binary and n-ary operations. More...
 
self operator() (int op, const self &arg1, const self &arg2) const
 Ternary operations. More...
 
self operator[] (const self &idx) const
 Get item. More...
 
self operator[] (long idx) const
 
 operator const ptr_type () const
 Get actual PyObject*. More...
 
char * repr () const
 Get representative as C-style string. More...
 
char * str () const
 Extract C-style string. More...
 
Py_ssize_t size () const
 
BOOLEAN assign_to (leftv result)
 
void import_as (const char *name) const
 
int compare (int op, const self &arg) const
 
self attr (const self &arg) const
 
self del_attr (const self &arg) const
 

Private Member Functions

size_t size (leftv iter, size_t distance=0) const
 
void append_to (leftv iter) const
 

Additional Inherited Members

- Public Types inherited from PythonObject
typedef PyObject * ptr_type
 
- Protected Member Functions inherited from PythonObject
self args2list (const self &args) const
 
BOOLEAN handle_exception () const
 
void append_iter (self iterator)
 
int py_opid (int op) const
 

Detailed Description

Template specialization for getting handling sequence.

Definition at line 390 of file pyobject.cc.

Constructor & Destructor Documentation

◆ PythonCastStatic()

Definition at line 395 of file pyobject.cc.

395 :
396 PythonObject(PyTuple_New(size(value))) { append_to(value); }
Py_ssize_t size() const
Definition: pyobject.cc:187

Member Function Documentation

◆ append_to()

void PythonCastStatic< PythonObject::sequence_tag >::append_to ( leftv  iter) const
inlineprivate

Definition at line 406 of file pyobject.cc.

407 {
408 for(size_t idx = 0; iter != NULL; iter = iter->next)
409 PyTuple_SetItem(*this, idx++, PythonCastDynamic(iter));
410 }
This class does conversion of Singular objects to python objects on runtime.
Definition: pyobject.cc:340
CFFListIterator iter
Definition: facAbsBiFact.cc:53
#define NULL
Definition: omList.c:12

◆ size()

size_t PythonCastStatic< PythonObject::sequence_tag >::size ( leftv  iter,
size_t  distance = 0 
) const
inlineprivate

Definition at line 400 of file pyobject.cc.

401 {
402 if (iter) { do { ++distance; } while((iter = iter->next)); };
403 return distance;
404 }

The documentation for this class was generated from the following file: