NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
pythonpp::CObject Class Reference

Search Toolkit Book for pythonpp::CObject

#include "pythonpp_object.hpp"
(Private to src/dbapi/lang_bind/python/pythonpp.)

+ Inheritance diagram for pythonpp::CObject:

Public Member Functions

 CObject (void)
 * Generic operations on objects *‍/ More...
 
 CObject (PyObject *obj, EOwnership ownership=eAcquireOwnership)
 
 CObject (const CObject &obj)
 
 ~CObject (void)
 
CObjectoperator= (const CObject &obj)
 
CObjectoperator= (PyObject *obj)
 
 operator PyObject * (void) const
 
PyObject * Get (void) const
 
void Set (PyObject *obj, EOwnership ownership=eAcquireOwnership)
 Not exception-safe this time. More...
 
void Release (void)
 
CObject GetAttr (const std::string &name) const
 
void SetAttr (const std::string &name, const CObject &value)
 
void DelAttr (const std::string &name)
 
bool HasAttr (const std::string &name) const
 
CObject GetItem (const CObject &key) const
 
void DelItem (const CObject &key)
 
long GetHashValue (void) const
 
CType GetType (void) const
 
PyTypeObject * GetObjType (void) const
 
bool operator== (const CObject &obj) const
 
bool operator!= (const CObject &obj) const
 
bool operator>= (const CObject &obj) const
 
bool operator<= (const CObject &obj) const
 
bool operator< (const CObject &obj) const
 
bool operator> (const CObject &obj) const
 

Protected Member Functions

bool IsNumeric (void) const
 
bool IsSequence (void) const
 
bool IsTrue (void) const
 
bool IsObjectType (const CType &t) const
 

Private Attributes

PyObject * m_PyObject
 

Detailed Description

Definition at line 76 of file pythonpp_object.hpp.

Constructor & Destructor Documentation

◆ CObject() [1/3]

pythonpp::CObject::CObject ( void  )
inline

* Generic operations on objects *‍/

* A slot function whose address we need to compare *‍/ Creates a python None object

Definition at line 108 of file pythonpp_object.hpp.

References Get(), and pythonpp::IncRefCount().

Referenced by pythonpp::CCalable::Apply(), GetAttr(), GetItem(), pythonpp::CDict::GetItem(), pythonpp::CList::GetItem(), and pythonpp::CTuple::GetItem().

◆ CObject() [2/3]

pythonpp::CObject::CObject ( PyObject *  obj,
EOwnership  ownership = eAcquireOwnership 
)
inlineexplicit

◆ CObject() [3/3]

pythonpp::CObject::CObject ( const CObject obj)
inline

Definition at line 123 of file pythonpp_object.hpp.

References _ASSERT, Get(), and pythonpp::IncRefCount().

◆ ~CObject()

pythonpp::CObject::~CObject ( void  )
inline

Definition at line 130 of file pythonpp_object.hpp.

References Release().

Member Function Documentation

◆ DelAttr()

void pythonpp::CObject::DelAttr ( const std::string name)
inline

Definition at line 200 of file pythonpp_object.hpp.

References Get().

◆ DelItem()

void pythonpp::CObject::DelItem ( const CObject key)
inline

Definition at line 229 of file pythonpp_object.hpp.

References Get(), and ncbi::grid::netcache::search::fields::key.

◆ Get()

PyObject* pythonpp::CObject::Get ( void  ) const
inline

Definition at line 158 of file pythonpp_object.hpp.

References m_PyObject.

Referenced by pythonpp::CList::Append(), pythonpp::CCalable::Apply(), pythonpp::CString::AsStdSring(), pythonpp::CBinary::AsStdSring(), pythonpp::CList::Clear(), pythonpp::CList::CList(), CObject(), pythonpp::CSequnceHelper< T >::Concat(), python::ConvertCVariant2PCObject(), CPythonDiagHandler::CPythonDiagHandler(), pythonpp::CTuple::CTuple(), DelAttr(), DelItem(), pythonpp::CDict::DelItem(), pythonpp::CDictHelper< T >::DelItem(), GetAttr(), python::CCursor::GetCVariant(), pythonpp::CDate::GetDay(), pythonpp::CModule::GetDict(), pythonpp::CModule::GetFileName(), GetHashValue(), pythonpp::CTime::GetHour(), pythonpp::CDateTime::GetHour(), pythonpp::CComplex::GetImag(), GetItem(), pythonpp::CDictHelper< T >::GetItem(), pythonpp::CDict::GetItem(), pythonpp::CSequnceHelper< T >::GetItem(), pythonpp::CList::GetItem(), pythonpp::CTuple::GetItem(), pythonpp::CList::GetItemFast(), pythonpp::CTuple::GetItemFast(), pythonpp::CDictHelper< T >::GetLength(), pythonpp::CSequnceHelper< T >::GetLength(), pythonpp::CTime::GetMicroSecond(), pythonpp::CDateTime::GetMicroSecond(), pythonpp::CTime::GetMinute(), pythonpp::CDateTime::GetMinute(), pythonpp::CDate::GetMonth(), pythonpp::CModule::GetName(), pythonpp::CComplex::GetReal(), pythonpp::CTime::GetSecond(), pythonpp::CDateTime::GetSecond(), pythonpp::CString::GetSize(), pythonpp::CBinary::GetSize(), pythonpp::CTuple::GetSlice(), pythonpp::CList::GetSlice(), GetType(), pythonpp::CDate::GetYear(), HasAttr(), pythonpp::CDictHelper< T >::HasKey(), pythonpp::CList::Insert(), IsNumeric(), IsObjectType(), IsSequence(), IsTrue(), pythonpp::CDictHelper< T >::Items(), pythonpp::CDict::Items(), pythonpp::CDictHelper< T >::Keys(), pythonpp::CDict::Keys(), pythonpp::CDict::Merge(), pythonpp::CBool::operator bool(), pythonpp::CLong::operator double(), pythonpp::CFloat::operator double(), pythonpp::CComplex::operator double(), pythonpp::CInt::operator long(), pythonpp::CLong::operator long(), pythonpp::CLong::operator long long(), pythonpp::CLong::operator unsigned long(), pythonpp::CLong::operator unsigned long long(), operator!=(), operator<(), operator<=(), pythonpp::CDict::operator=(), pythonpp::CCalable::operator=(), operator=(), pythonpp::CType::operator=(), pythonpp::CBool::operator=(), pythonpp::CInt::operator=(), pythonpp::CLong::operator=(), pythonpp::CFloat::operator=(), pythonpp::CComplex::operator=(), pythonpp::CString::operator=(), pythonpp::CBinary::operator=(), pythonpp::CTuple::operator=(), pythonpp::CList::operator=(), pythonpp::CDictHelper< T >::operator=(), operator==(), pythonpp::operator==(), operator>(), operator>=(), python::ReleaseGlobalLock(), pythonpp::CSequnceHelper< T >::Repeat(), python::ReturnStrsAsUnicode(), pythonpp::CList::Reverse(), pythonpp::CExtObject< CCursor >::ROAttr(), python::s_IsOutputExpected(), SetAttr(), pythonpp::CDictHelper< T >::SetItem(), pythonpp::CDict::SetItem(), pythonpp::CSequnceHelper< T >::SetItem(), pythonpp::CTuple::SetItem(), pythonpp::CList::SetItem(), pythonpp::CTuple::SetItemFast(), pythonpp::CList::SetItemFast(), CPythonDiagHandler::SetLogger(), pythonpp::CList::SetSlice(), pythonpp::CDictHelper< T >::size(), pythonpp::CSequnceHelper< T >::size(), pythonpp::CDict::size(), pythonpp::CTuple::size(), pythonpp::CList::size(), pythonpp::CList::Sort(), pythonpp::CDictHelper< T >::Values(), pythonpp::CDict::Values(), and python::x_GetUTCOffset().

◆ GetAttr()

CObject pythonpp::CObject::GetAttr ( const std::string name) const
inline

◆ GetHashValue()

long pythonpp::CObject::GetHashValue ( void  ) const
inline

Definition at line 237 of file pythonpp_object.hpp.

References Get(), and rapidjson::value.

◆ GetItem()

CObject pythonpp::CObject::GetItem ( const CObject key) const
inline

◆ GetObjType()

PyTypeObject* pythonpp::CObject::GetObjType ( void  ) const
inline

Definition at line 252 of file pythonpp_object.hpp.

References m_PyObject.

Referenced by pythonpp::operator==(), and CPythonDiagHandler::SetLogger().

◆ GetType()

CType CObject::GetType ( void  ) const
inline

Definition at line 527 of file pythonpp_object.hpp.

References pythonpp::eTakeOwnership, and Get().

Referenced by IsObjectType().

◆ HasAttr()

bool pythonpp::CObject::HasAttr ( const std::string name) const
inline

Definition at line 206 of file pythonpp_object.hpp.

References Get().

◆ IsNumeric()

bool pythonpp::CObject::IsNumeric ( void  ) const
inlineprotected

Definition at line 306 of file pythonpp_object.hpp.

References Get().

◆ IsObjectType()

bool CObject::IsObjectType ( const CType t) const
inlineprotected

Definition at line 572 of file pythonpp_object.hpp.

References Get(), GetType(), and t.

◆ IsSequence()

bool pythonpp::CObject::IsSequence ( void  ) const
inlineprotected

Definition at line 310 of file pythonpp_object.hpp.

References Get().

◆ IsTrue()

bool pythonpp::CObject::IsTrue ( void  ) const
inlineprotected

Definition at line 314 of file pythonpp_object.hpp.

References Get().

◆ operator PyObject *()

pythonpp::CObject::operator PyObject * ( void  ) const
inline

Definition at line 154 of file pythonpp_object.hpp.

References m_PyObject.

◆ operator!=()

bool pythonpp::CObject::operator!= ( const CObject obj) const
inline

◆ operator<()

bool pythonpp::CObject::operator< ( const CObject obj) const
inline

◆ operator<=()

bool pythonpp::CObject::operator<= ( const CObject obj) const
inline

◆ operator=() [1/2]

CObject& pythonpp::CObject::operator= ( const CObject obj)
inline

Definition at line 135 of file pythonpp_object.hpp.

References Set().

◆ operator=() [2/2]

CObject& pythonpp::CObject::operator= ( PyObject *  obj)
inline

Definition at line 144 of file pythonpp_object.hpp.

References Get(), and Set().

◆ operator==()

bool pythonpp::CObject::operator== ( const CObject obj) const
inline

◆ operator>()

bool pythonpp::CObject::operator> ( const CObject obj) const
inline

◆ operator>=()

bool pythonpp::CObject::operator>= ( const CObject obj) const
inline

◆ Release()

void pythonpp::CObject::Release ( void  )
inline

Definition at line 174 of file pythonpp_object.hpp.

References pythonpp::g_CleaningUp, m_PyObject, and NULL.

Referenced by Set(), and ~CObject().

◆ Set()

void pythonpp::CObject::Set ( PyObject *  obj,
EOwnership  ownership = eAcquireOwnership 
)
inline

◆ SetAttr()

void pythonpp::CObject::SetAttr ( const std::string name,
const CObject value 
)
inline

Definition at line 194 of file pythonpp_object.hpp.

References Get(), and rapidjson::value.

Member Data Documentation

◆ m_PyObject

PyObject* pythonpp::CObject::m_PyObject
private

Definition at line 321 of file pythonpp_object.hpp.

Referenced by Get(), GetObjType(), operator PyObject *(), Release(), and Set().


The documentation for this class was generated from the following file:
Modified on Mon May 20 05:05:38 2024 by modify_doxy.py rev. 669887