EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CFilterRowSet Class Reference

Python object "dbutil.CFilterRowset". More...

#include "PyDatabase.h"

Inheritance diagram for CFilterRowSet:
Collaboration diagram for CFilterRowSet:

Public Member Functions

 CFilterRowSet (DBRowDescriptor **rowDesc)
 
size_t GetKeyCount () const
 
CRowSet * GetRowset (PyRep *key) const
 
PyPackedRow * GetRow (PyRep *key, uint32 index) const
 
CRowSet * NewRowset (PyRep *key)
 
- Public Member Functions inherited from PyObjectEx_Type2
 PyObjectEx_Type2 (PyTuple *args, PyDict *keywords, bool enclosed=false)
 
 PyObjectEx_Type2 (PyToken *args, PyDict *keywords, bool enclosed=false)
 
PyTuple * GetArgs () const
 
PyDict * GetKeywords () const
 
PyRep * FindKeyword (const char *keyword) const
 
- Public Member Functions inherited from PyObjectEx
 PyObjectEx (bool is_type_2, PyRep *header)
 
 PyObjectEx (const PyObjectEx &oth)
 
 PyObjectEx (PyObjectEx &&oth)=delete
 
PyObjectEx & operator= (const PyObjectEx &oth)
 
PyObjectEx & operator= (PyObjectEx &&oth)=delete
 
PyRep * Clone () const
 Clones object. More...
 
bool visit (PyVisitor &v) const
 Visits object. More...
 
PyRep * header () const
 
bool isType2 () const
 
list_type & list ()
 
const list_type & list () const
 
dict_type & dict ()
 
const dict_type & dict () const
 
- Public Member Functions inherited from PyRep
PyType GetType () const
 
bool IsInt () const
 
bool IsLong () const
 
bool IsFloat () const
 
bool IsBool () const
 
bool IsBuffer () const
 
bool IsString () const
 
bool IsWString () const
 
bool IsToken () const
 
bool IsTuple () const
 
bool IsList () const
 
bool IsDict () const
 
bool IsNone () const
 
bool IsSubStruct () const
 
bool IsSubStream () const
 
bool IsChecksumedStream () const
 
bool IsObject () const
 
bool IsObjectEx () const
 
bool IsPackedRow () const
 
const char * TypeString () const
 
PyInt * AsInt ()
 
const PyInt * AsInt () const
 
PyLong * AsLong ()
 
const PyLong * AsLong () const
 
PyFloat * AsFloat ()
 
const PyFloat * AsFloat () const
 
PyBool * AsBool ()
 
const PyBool * AsBool () const
 
PyBuffer * AsBuffer ()
 
const PyBuffer * AsBuffer () const
 
PyString * AsString ()
 
const PyString * AsString () const
 
PyWString * AsWString ()
 
const PyWString * AsWString () const
 
PyToken * AsToken ()
 
const PyToken * AsToken () const
 
PyTuple * AsTuple ()
 
const PyTuple * AsTuple () const
 
PyList * AsList ()
 
const PyList * AsList () const
 
PyDict * AsDict ()
 
const PyDict * AsDict () const
 
PyNone * AsNone ()
 
const PyNone * AsNone () const
 
PySubStruct * AsSubStruct ()
 
const PySubStruct * AsSubStruct () const
 
PySubStream * AsSubStream ()
 
const PySubStream * AsSubStream () const
 
PyChecksumedStream * AsChecksumedStream ()
 
const PyChecksumedStream * AsChecksumedStream () const
 
PyObject * AsObject ()
 
const PyObject * AsObject () const
 
PyObjectEx * AsObjectEx ()
 
const PyObjectEx * AsObjectEx () const
 
PyPackedRow * AsPackedRow ()
 
const PyPackedRow * AsPackedRow () const
 
void Dump (FILE *into, const char *pfx) const
 Dumps object to file. More...
 
void Dump (LogType type, const char *pfx) const
 Dumps object to console. More...
 
virtual int32 hash () const
 virtual function to generate a hash value of a object. More...
 
- Public Member Functions inherited from RefObject
 RefObject (size_t initRefCount)
 Initializes reference count. More...
 
virtual ~RefObject ()
 Destructor; must be virtual. More...
 
size_t GetCount ()
 

Protected Member Functions

virtual ~CFilterRowSet ()
 
DBRowDescriptor * _GetRowDesc () const
 
- Protected Member Functions inherited from PyObjectEx_Type2
virtual ~PyObjectEx_Type2 ()
 
- Protected Member Functions inherited from PyObjectEx
virtual ~PyObjectEx ()
 
- Protected Member Functions inherited from PyRep
 PyRep (PyType t)
 
 PyRep (const PyRep &oth)
 
 PyRep (PyRep &&oth)=delete
 
PyRep & operator= (const PyRep &oth)=default
 
PyRep & operator= (PyRep &&oth)=default
 
virtual ~PyRep ()
 
- Protected Member Functions inherited from RefObject
void IncRef () const
 Increments reference count of object by one. More...
 
void DecRef () const
 Decrements reference count of object by one. More...
 

Static Protected Member Functions

static PyTuple * _CreateArgs ()
 
static PyDict * _CreateKeywords (DBRowDescriptor *rowDesc)
 
- Static Protected Member Functions inherited from PyObjectEx_Type2
static PyTuple * _CreateHeader (PyTuple *args, PyDict *keywords, bool enclosed=false)
 
static PyTuple * _CreateHeader (PyToken *args, PyDict *keywords, bool enclosed=false)
 

Additional Inherited Members

- Public Types inherited from PyObjectEx
typedef PyList list_type
 
typedef list_type::iterator list_iterator
 
typedef list_type::const_iterator const_list_iterator
 
typedef PyDict dict_type
 
typedef dict_type::iterator dict_iterator
 
typedef dict_type::const_iterator const_dict_iterator
 
- Public Types inherited from PyRep
enum  PyType {
  PyTypeMin = 0, PyTypeInt = 1, PyTypeLong = 2, PyTypeFloat = 3,
  PyTypeBool = 4, PyTypeBuffer = 5, PyTypeString = 6, PyTypeWString = 7,
  PyTypeToken = 8, PyTypeTuple = 9, PyTypeList = 10, PyTypeDict = 11,
  PyTypeNone = 12, PyTypeSubStruct = 13, PyTypeSubStream = 14, PyTypeChecksumedStream = 15,
  PyTypeObject = 16, PyTypeObjectEx = 17, PyTypePackedRow = 18, PyTypeError = 19
}
 Python wire object types. More...
 
- Static Public Member Functions inherited from PyRep
static std::string StringContent (PyRep *pRep)
 
static int64 IntegerValue (PyRep *pRep)
 
static uint32 IntegerValueU32 (PyRep *pRep)
 
- Protected Attributes inherited from PyObjectEx
PyRep *const mHeader
 
const bool mIsType2
 
list_type *const mList
 
dict_type *const mDict
 
- Protected Attributes inherited from PyRep
const PyType mType
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Detailed Description

Python object "dbutil.CFilterRowset".

This object contains DBRowDescriptor header and dict of key->CRowset(PyPackedRows).

Author
positron96

Definition at line 216 of file PyDatabase.h.

Constructor & Destructor Documentation

CFilterRowSet::CFilterRowSet ( DBRowDescriptor **  rowDesc)
Parameters
[in]rowDescDBRowDescriptor header to be used.

Definition at line 230 of file PyDatabase.cpp.

231 : PyObjectEx_Type2( _CreateArgs(), _CreateKeywords( *rowDesc ) )
232 {
233 
234 }
PyObjectEx_Type2(PyTuple *args, PyDict *keywords, bool enclosed=false)
Definition: PyRep.cpp:942
static PyTuple * _CreateArgs()
Definition: PyDatabase.cpp:253
static PyDict * _CreateKeywords(DBRowDescriptor *rowDesc)
Definition: PyDatabase.cpp:260
virtual CFilterRowSet::~CFilterRowSet ( )
inlineprotectedvirtual

Definition at line 246 of file PyDatabase.h.

246 { /* do we need to do anything here? */ }

Member Function Documentation

PyTuple * CFilterRowSet::_CreateArgs ( )
staticprotected

Definition at line 253 of file PyDatabase.cpp.

References args, and PyTuple::SetItem().

254 {
255  PyTuple* args = new PyTuple( 1 );
256  args->SetItem( 0, new PyToken( "dbutil.CFilterRowset" ) );
257  return args;
258 }
Python tuple.
Definition: PyRep.h:567
* args
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python token (eg. class name).
Definition: PyRep.h:522

Here is the call graph for this function:

PyDict * CFilterRowSet::_CreateKeywords ( DBRowDescriptor *  rowDesc)
staticprotected

Definition at line 260 of file PyDatabase.cpp.

References DBRowDescriptor::GetColumnName(), and PyDict::SetItemString().

261 {
262  assert( rowDesc );
263 
264  PyDict* keywords = new PyDict();
265  keywords->SetItemString( "header", rowDesc );
266  keywords->SetItemString( "columnName", rowDesc->GetColumnName(0) );
267 
268  return keywords;
269 }
Python's dictionary.
Definition: PyRep.h:719
PyString * GetColumnName(uint32 index) const
Definition: PyDatabase.cpp:65
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812

Here is the call graph for this function:

DBRowDescriptor * CFilterRowSet::_GetRowDesc ( ) const
protected

Definition at line 245 of file PyDatabase.cpp.

References PyRep::AsObjectEx(), and PyObjectEx_Type2::FindKeyword().

Referenced by NewRowset().

246 {
247  PyRep* r(FindKeyword( "header" ));
248  if (r != nullptr)
249  return (DBRowDescriptor*)r->AsObjectEx();
250  return nullptr;
251 }
Base Python wire object.
Definition: PyRep.h:66
PyRep * FindKeyword(const char *keyword) const
Definition: PyRep.cpp:959
Python object "blue.DBRowDescriptor".
Definition: PyDatabase.h:41

Here is the call graph for this function:

Here is the caller graph for this function:

size_t CFilterRowSet::GetKeyCount ( ) const
inline
Returns
Row count.

Definition at line 228 of file PyDatabase.h.

References PyObjectEx::dict(), and PyDict::size().

228 { return dict().size(); }
size_t size() const
Definition: PyRep.h:769
dict_type & dict()
Definition: PyRep.h:892

Here is the call graph for this function:

PyPackedRow* CFilterRowSet::GetRow ( PyRep *  key,
uint32  index 
) const
inline
Parameters
[in]Indexof row to be returned.
Returns
Row with given index.

Definition at line 237 of file PyDatabase.h.

References PyRep::AsPackedRow(), CRowSet::GetRow(), and GetRowset().

238  { return GetRowset(key)->GetRow( index )->AsPackedRow(); }
PyPackedRow * AsPackedRow()
Definition: PyRep.h:156
PyPackedRow * GetRow(uint32 index) const
Definition: PyDatabase.h:143
CRowSet * GetRowset(PyRep *key) const
Definition: PyDatabase.h:230

Here is the call graph for this function:

CRowSet* CFilterRowSet::GetRowset ( PyRep *  key) const
inline

Definition at line 230 of file PyDatabase.h.

References PyObjectEx::dict(), and PyDict::GetItem().

Referenced by GetRow().

230 { return (CRowSet*)(dict().GetItem( key )); }
PyRep * GetItem(PyRep *key) const
Obtains a database entry based on given key object.
Definition: PyRep.cpp:691
Python object "dbutil.CRowset".
Definition: PyDatabase.h:124
dict_type & dict()
Definition: PyRep.h:892

Here is the call graph for this function:

Here is the caller graph for this function:

CRowSet * CFilterRowSet::NewRowset ( PyRep *  key)
Returns
New rowset which user may fill.

Definition at line 236 of file PyDatabase.cpp.

References _GetRowDesc(), PyObjectEx::dict(), and PyDict::SetItem().

237 {
238  DBRowDescriptor* rowDesc = _GetRowDesc();
239  CRowSet* row = new CRowSet( &rowDesc );
240 
241  dict().SetItem( key , row );
242  return row;
243 }
DBRowDescriptor * _GetRowDesc() const
Definition: PyDatabase.cpp:245
Python object "blue.DBRowDescriptor".
Definition: PyDatabase.h:41
Python object "dbutil.CRowset".
Definition: PyDatabase.h:124
dict_type & dict()
Definition: PyRep.h:892
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713

Here is the call graph for this function:


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