Loading...
Searching...
No Matches
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.
self | operator() (int op, const self &arg) const
| Binary and n-ary operations.
self | operator() (int op, const self &arg1, const self &arg2) const
| Ternary operations.
self | operator[] (const self &idx) const
| Get item.
self | operator[] (long idx) const
| operator const ptr_type () const
| Get actual PyObject*.
char * | repr () const
| Get representative as C-style string.
char * | str () const
| Extract C-style string.
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 Types

typedef PythonCastStatic | self

## Private Member Functions

size_t | size (leftv iter, size_t distance=0) const
void | append_to (leftv iter) const
ptr_type | get (ptr_type value)

## 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.

## Member Typedef Documentation

## self

typedef PythonCastStatic PythonCastStatic< PythonObject::sequence_tag >::self

private

Definition at line 305 of file pyobject.cc.

## Constructor & Destructor Documentation

## PythonCastStatic()

PythonCastStatic< PythonObject::sequence_tag >::PythonCastStatic | ( | leftv | value | ) |

inline

Definition at line 395 of file pyobject.cc.

:
PythonObject(PyTuple_New(size(value))) { append_to(value); }
PythonCastStatic< PythonObject::sequence_tag >::append_to
void append_to(leftv iter) const
Definition pyobject.cc:406
PythonCastStatic
This template class does conversion of Singular objects to python objects on compile-time.
Definition pyobject.cc:304
PythonObject::size
Py_ssize_t size() const
Definition pyobject.cc:187
PythonObject::PythonObject
PythonObject()
Definition pyobject.cc:115

## Member Function Documentation

## append_to()

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

inline private

Definition at line 406 of file pyobject.cc.

{
for(size_t idx = 0; iter != NULL; iter = iter->next)
PyTuple_SetItem(*this, idx++, PythonCastDynamic(iter));
}

## get()

ptr_type PythonCastStatic< PythonObject::sequence_tag >::get | ( | ptr_type | value | ) |

inline private

Definition at line 315 of file pyobject.cc.

{ return value; }

## size()

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

inline private

Definition at line 400 of file pyobject.cc.

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

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

- Singular/dyn_modules/pyobject/pyobject.cc