A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/pythonpp__ext_8hpp_source.html below:

NCBI C++ ToolKit: src/dbapi/lang_bind/python/pythonpp/pythonpp_ext.hpp Source File

35 #ifndef PYTHONPP_EXT_H 36 #define PYTHONPP_EXT_H 44 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_TYPE) 46

{ ob->ob_type =

type

; }

47 #define Py_SET_TYPE(ob, type) _Py_SET_TYPE((PyObject*)(ob), type) 50 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_SIZE) 52

{ ob->ob_size =

size

; }

53 #define Py_SET_SIZE(ob, size) _Py_SET_SIZE((PyVarObject*)(ob), size) 56 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_REFCNT) 58

{ ob->ob_refcnt = refcnt; }

59 #define Py_SET_REFCNT(ob, refcnt) _Py_SET_REFCNT((PyObject*)(ob), refcnt) 67 #if PY_MAJOR_VERSION >= 3 69

PyObject* Py_FindMethod(PyMethodDef

table

[], PyObject *ob,

char

*name)

71  for

(

size_t i

= 0;

table

[

i

].ml_name !=

NULL

; ++

i

) {

73  return

PyCFunction_New(

table

+

i

, ob);

76

CAttributeError

error

(name);

83  typedef

PyObject* (*TMethodVarArgsHandler)( PyObject*

self

, PyObject* args );

84  typedef

PyObject* (*TMethodKeywordHandler)( PyObject*

self

, PyObject* args, PyObject* dict );

101

ml_name =

const_cast<char

*

>

( name );

104

ml_doc =

const_cast<char

*

>

( doc );

106  SMethodDef

(

const char

* name, PyCFunctionWithKeywords func,

107  int flags

= METH_VARARGS | METH_KEYWORDS,

108  const char

* doc =

nullptr

)

110

ml_name =

const_cast<char

*

>

(name);

111

ml_meth =

reinterpret_cast<

PyCFunction

>

(func);

113

ml_doc =

const_cast<char

*

>

(doc);

117

ml_name = other.ml_name;

118

ml_meth = other.ml_meth;

119

ml_flags = other.ml_flags;

120

ml_doc = other.ml_doc;

125  if

(

this

!= &other) {

126

ml_name = other.ml_name;

127

ml_meth = other.ml_meth;

128

ml_flags = other.ml_flags;

129

ml_doc = other.ml_doc;

147 class

CExtObjectBase;

156

PyTypeObject* base = &PyBaseObject_Type)

161

tp_basicsize = basic_size;

164

tp_flags = Py_TPFLAGS_DEFAULT;

188

tp_name =

const_cast<char

*

>

( name );

192

tp_doc =

const_cast<char

*

>

( descr );

223 #if PY_MAJOR_VERSION < 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 8) 226

tp_vectorcall_offset = 0;

232 #if PY_MAJOR_VERSION < 3 234 #elif PY_MINOR_VERSION >= 5 242

tp_as_number =

NULL

;

243

tp_as_sequence =

NULL

;

244

tp_as_mapping =

NULL

;

255

tp_as_buffer =

NULL

;

273

tp_weaklistoffset = 0L;

286

tp_descr_get =

NULL

;

287

tp_descr_set =

NULL

;

298 #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 4 302

tp_subclasses =

NULL

;

306

tp_version_tag = 0

U

;

309 # if PY_MAJOR_VERSION >= 3 325  return l

.GetObjType() ==

r

.GetObjType();

331  return l

.GetObjType() ==

r

.GetObjType();

356  virtual

PyObject*

Get

(

void

)

const

= 0;

387  virtual

PyObject*

Get

(

void

)

const 389  return

PyLong_FromLong( *

m_Value

);

395  long

tmp_value = PyLong_AsLong(

value

);

417  virtual

PyObject*

Get

(

void

)

const 419 #if PY_MAJOR_VERSION >= 3 420  return

PyUnicode_FromStringAndSize(

m_Value

->data(),

m_Value

->size());

422  return

PyString_FromStringAndSize(

m_Value

->data(),

m_Value

->size() );

429 #if PY_VERSION_HEX >= 0x03030000 431  auto utf

= PyUnicode_AsUTF8AndSize(

Get

(), &

size

);

432  string

tmp_value(

utf

,

size

);

433 #elif PY_MAJOR_VERSION >= 3 436  static_cast<size_t>

(PyUnicode_GetSize(

Get

())));

438  string

tmp_value =

string

( PyString_AsString(

value

),

static_cast<size_t>

( PyString_Size(

value

) ) );

468  virtual

PyObject*

Get

(

void

)

const 492 void resize

(vector<SMethodDef>& container)

494  if

(container.size() <

N

) {

495

container.resize(

N

);

524  const CDict

& kwargs);

552  template

<

size_t

N = 0>

568

resize<N>(hndl_list);

574  return

CClass<N + 1>();

578  const char

* doc =

nullptr

)

582

resize<N>(hndl_list);

585

METH_VARARGS | METH_KEYWORDS, doc);

588  return

CClass<N + 1>();

594  T

* obj =

static_cast<T

*

>

(

self

);

597  const CTuple

args_tuple( args );

623  T

* obj =

static_cast<T

*

>

(

self

);

626  const CTuple

args_tuple(args);

628  if

(kwargs !=

nullptr

) {

629

kwargs_dict = kwargs;

632  return IncRefCount

((obj->*func)(args_tuple, kwargs_dict));

633

}

catch

(

const CError

&) {

638

(

"Unknown error during execution of a method"

);

648 #ifndef NCBI_COMPILER_ICC 651  template

<

size_t

N>

friend class CClass

;

656  const char

* descr = 0,

657

PyTypeObject* base = &PyBaseObject_Type

667  type

.SetDescription(descr);

678  const char

* descr = 0,

679

PyTypeObject* base = &PyBaseObject_Type

684  Declare

(safe_name->c_str(), descr, base);

689  return

CClass<0>().Def(name, func, doc);

692  const char

* doc =

nullptr

)

694  return

CClass<0>().Def(name, func, doc);

717  delete static_cast<T

*

>

( obj );

724

PyObject_Init(

self

,

GetType

().GetObjType() );

778  return

citer->second->Get();

793

citer->second->Set(

value

);

797

+

"'object has no attribute '"

+ name +

"'"

);

824  const_cast<char

*

>

(name),

826  const_cast<char

*

>

(descr),

856  template

<

size_t

N = 0>

880  T

* obj =

static_cast<T

*

>

(

self

);

883  const CTuple

args_tuple( args );

919  delete static_cast<T

*

>

( obj );

963  static void Declare

(

const string

& name, PyMethodDef* methods,

964

inquiry cleanup_hook =

NULL

);

976  static void AddConst

(

const string

& name,

const string

&

value

);

982 #if PY_MAJOR_VERSION >= 3 983  static struct

PyModuleDef m_ModuleDef;

990 #if PY_MAJOR_VERSION >= 3 991 struct

PyModuleDef

CModuleExt

::m_ModuleDef = {

992

PyModuleDef_HEAD_INIT,

1006

inquiry cleanup_hook)

1011 #if PY_MAJOR_VERSION >= 3 1012

m_ModuleDef.m_name =

strdup

(name.c_str());

1013

m_ModuleDef.m_methods = methods;

1014

m_ModuleDef.m_clear = cleanup_hook;

1015  m_Module

= PyModule_Create(&m_ModuleDef);

1017  m_Module

= Py_InitModule(

const_cast<char

*

>

( name.c_str() ), methods );

1026  if

( PyModule_AddObject(

m_Module

,

const_cast<char

*

>

(name.c_str()),

value

) == -1 ) {

1027  throw CSystemError

(

"Failed to add a constant value to a module"

);

1034 #if PY_MAJOR_VERSION >= 3 1036

= PyUnicode_FromStringAndSize(

value

.data(),

value

.size());

1039

= PyString_FromStringAndSize(

value

.data(),

value

.size() );

1048

PyObject* py_value = PyLong_FromLong(

value

);

1057 template

<

class

T,

class

B = CStandardError>

1071

:

B

(

msg

, err_type)

1081  m_Exception

= PyErr_NewException(

const_cast<char

*

>

(full_name.c_str()), B::GetPyException(),

NULL

);

1084  throw CSystemError

(

"Unable to add an object to a module"

);

1092  m_Exception

= PyErr_NewException(

const_cast<char

*

>

(full_name.c_str()), B::GetPyException(), dict);

1095  throw CSystemError

(

"Unable to add an object to a module"

);

1131 #ifdef PYTHONPP_DEFINE_GLOBALS

container_type::const_iterator const_iterator

const_iterator end() const

const_iterator find(const key_type &key) const

static void SetString(const string &msg)

static PyObject * HandleMethodVarArgs(PyObject *self, PyObject *args)

CClass< N+1 > Def(const char *name, TMethodVarArgsFunc func, const char *doc=0)

static TMethodHndlList sm_MethodHndlList

CExtModule(const char *name, const char *descr=0)

static TMethodList sm_MethodList

CObject(T::* TMethodVarArgsFunc)(const CTuple &args)

vector< SMethodDef > TMethodHndlList

static PyObject * GetAttrImpl(PyObject *self, char *name)

static void deallocator(PyObject *obj)

static CClass< 1 > Def(const char *name, TMethodVarArgsFunc func, const char *doc=0)

vector< SFunct > TMethodList

static TMethodList & GetMethodList(void)

static TMethodHndlList & GetMethodHndlList(void)

static CExtType & GetType(void)

CClass< N+1 > Def(const char *name, TMethodVarArgsFunc func, const char *doc=0)

static PyObject * HandleMethodKWArgs(PyObject *self, PyObject *args, PyObject *kwargs)

CClass< N+1 > Def(const char *name, TMethodKWArgsFunc func, const char *doc=nullptr)

static PyObject * HandleMethodVarArgs(PyObject *self, PyObject *args)

static CClass< 1 > Def(const char *name, TMethodKWArgsFunc func, const char *doc=nullptr)

vector< SFunct > TMethodList

static TMethodHndlList sm_MethodHndlList

static void Declare(const string &name, const char *descr=0, PyTypeObject *base=&PyBaseObject_Type)

void ROAttr(const string &name, CObject &value)

static TMethodHndlList & GetMethodHndlList(void)

void RWAttr(const string &name, long &value)

CObject(T::* TMethodKWArgsFunc)(const CTuple &args, const CDict &kwargs)

void RWAttr(const string &name, string &value)

map< string, AutoPtr< bind::CBase > > TAttrList

static int SetAttrImpl(PyObject *self, char *name, PyObject *value)

vector< SMethodDef > TMethodHndlList

static PyTypeObject * sm_Base

static PyObject * GetAttrImpl(PyObject *self, char *name)

static void Declare(const char *name, const char *descr=0, PyTypeObject *base=&PyBaseObject_Type)

static TMethodList sm_MethodList

void ROAttr(const string &name, long &value)

static TMethodList & GetMethodList(void)

static CExtType & GetType(void)

static void PrepareForPython(CExtObject< T > *self)

static CClass< 1 > Def(const char *name, TMethodVarArgsFunc func, const char *doc=0)

static void deallocator(PyObject *obj)

void RWAttr(const string &name, CObject &value)

static CObject & GetTypeObject(void)

CObject(T::* TMethodVarArgsFunc)(const CTuple &args)

void ROAttr(const string &name, string &value)

void SetDescription(const char *descr)

void SupportSetAttr(setattrfunc func)

void SetName(const char *name)

void SupportGetAttr(getattrfunc func)

CExtType(size_t basic_size, destructor dr=standard_dealloc, PyTypeObject *base=&PyBaseObject_Type)

PyTypeObject * GetObjType(void)

const PyTypeObject * GetObjType(void) const

static const string & GetName(void)

static void AddConst(const string &name, const string &value)

static void AddConstValue(const string &name, PyObject *value)

static PyObject * m_Module

static void Declare(const string &name, PyMethodDef *methods, inquiry cleanup_hook=NULL)

static PyObject * GetPyModule(void)

void Set(PyObject *obj, EOwnership ownership)

Not exception-safe this time.

PyObject * Get(void) const

CThreadingGuard – "Anti-guard" for Python's global interpreter lock, which it temporarily releases to...

static void SetMayRelease(bool may_release)

static bool sm_MayRelease

static void Declare(const string &name)

static void Declare(const string &name, const pythonpp::CDict &dict)

static PyObject * m_Exception

static PyObject * GetPyException(void)

CUserError(const string &msg, PyObject *err_type)

CUserError(const string &msg)

bool IsReadOnly(void) const

CBase(EBindType type=eReadOnly)

virtual PyObject * Get(void) const =0

virtual void SetInternal(PyObject *value) const

void Set(PyObject *value) const

CLong(long &value, EBindType type=eReadOnly)

virtual PyObject * Get(void) const

virtual void SetInternal(PyObject *value) const

virtual PyObject * Get(void) const

CObject(T &obj, TGetFunc get, TSetFunc set=NULL)

void(T::* TSetFunc)(PyObject *value)

PyObject *(T::* TGetFunc)(void) const

virtual void SetInternal(PyObject *value) const

virtual void SetInternal(PyObject *value) const

CString(string &value, EBindType type=eReadOnly)

virtual PyObject * Get(void) const

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)

Convert into UTF8 from a C/C++ string.

<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table

constexpr auto front(list< Head, As... >, T=T()) noexcept -> Head

const struct ncbi::grid::netcache::search::fields::SIZE size

void resize(vector< SMethodDef > &container)

PyObject * IncRefCount(PyObject *obj)

bool operator==(const CObject &l, const CExtType &r)

void standard_dealloc(PyObject *obj)

void DoNotDeallocate(void *)

void resize< 0 >(vector< SMethodDef > &)

const GenericPointer< typename T::ValueType > T2 value

int strcmp(const char *str1, const char *str2)

Static variables safety - create on demand, destroy on application termination.

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

#define Py_SET_TYPE(ob, type)

static void _Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt)

static void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size)

#define Py_SET_REFCNT(ob, refcnt)

#define Py_SET_SIZE(ob, size)

static void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type)

static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

SFunct(const TMethodVarArgsFunc &funct)

TMethodVarArgsFunc m_Funct

SFunct(const TMethodVarArgsFunc &funct)

TMethodVarArgsFunc m_Funct

SFunct(const TMethodKWArgsFunc &funct)

Introduces constructor methods for a python PyMethodDef structure ...

SMethodDef & operator=(const SMethodDef &other)

SMethodDef(const char *name, PyCFunctionWithKeywords func, int flags=METH_VARARGS|METH_KEYWORDS, const char *doc=nullptr)

SMethodDef(const char *name, PyCFunction func, int flags=1, const char *doc=NULL)

SMethodDef(const SMethodDef &other)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4