SNAP Library 4.1, Developer Reference
2018-07-26 16:30:42
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Iterator class for TTable rows. More...
#include <table.h>
Public Member Functions | |
TRowIterator () | |
Default constructor. More... | |
TRowIterator (TInt RowIdx, const TTable *TablePtr) | |
Constructs iterator to row RowIds of TablePtr . More... | |
TRowIterator (const TRowIterator &RowI) | |
Copy constructor. More... | |
TRowIterator & | operator++ (int) |
Increments the iterator. More... | |
TRowIterator & | Next () |
Increments the iterator (For Python compatibility). More... | |
bool | operator< (const TRowIterator &RowI) const |
Checks if this iterator points to a row that is before the one pointed by RowI . More... | |
bool | operator== (const TRowIterator &RowI) const |
Checks if this iterator points to the same row pointed by RowI . More... | |
TInt | GetRowIdx () const |
Gets the id of the row pointed by this iterator. More... | |
TInt | GetIntAttr (TInt ColIdx) const |
Returns value of integer attribute specified by integer column index for current row. More... | |
TFlt | GetFltAttr (TInt ColIdx) const |
Returns value of floating point attribute specified by float column index for current row. More... | |
TStr | GetStrAttr (TInt ColIdx) const |
Returns value of string attribute specified by string column index for current row. More... | |
TInt | GetStrMapById (TInt ColIdx) const |
Returns integer mapping of a string attribute value specified by string column index for current row. More... | |
TInt | GetIntAttr (const TStr &Col) const |
Returns value of integer attribute specified by attribute name for current row. More... | |
TFlt | GetFltAttr (const TStr &Col) const |
Returns value of float attribute specified by attribute name for current row. More... | |
TStr | GetStrAttr (const TStr &Col) const |
Returns value of string attribute specified by attribute name for current row. More... | |
TInt | GetStrMapByName (const TStr &Col) const |
Returns integer mapping of string attribute specified by attribute name for current row. More... | |
TBool | CompareAtomicConst (TInt ColIdx, const TPrimitive &Val, TPredComp Cmp) |
Compares value in column ColIdx with given primitive Val . More... | |
TBool | CompareAtomicConstTStr (TInt ColIdx, const TStr &Val, TPredComp Cmp) |
Compares value in column ColIdx with given TStr Val . More... | |
Private Attributes | |
TInt | CurrRowIdx |
Physical row index of current row pointed by iterator. More... | |
const TTable * | Table |
Reference to table containing this row. More... | |
Iterator class for TTable rows.
An iterator class to iterate over all currently existing rows. Iteration over the rows should be done using only this iterator.
|
inline |
Default constructor.
Definition at line 335 of file table.h.
Constructs iterator to row RowIds
of TablePtr
.
Definition at line 337 of file table.h.
|
inline |
Copy constructor.
Definition at line 339 of file table.h.
TBool TRowIterator::CompareAtomicConst | ( | TInt | ColIdx, |
const TPrimitive & | Val, | ||
TPredComp | Cmp | ||
) |
Compares value in column ColIdx
with given primitive Val
.
Definition at line 190 of file table.cpp.
References atFlt, atInt, atStr, Cmp(), TPredicate::EvalAtom(), TPredicate::EvalStrAtom(), TPrimitive::GetFlt(), GetFltAttr(), TPrimitive::GetInt(), GetIntAttr(), TPrimitive::GetStr(), GetStrAttr(), and TPrimitive::GetType().
Referenced by TTable::SelectAtomicConst().
Compares value in column ColIdx
with given TStr Val
.
Definition at line 208 of file table.cpp.
References TPredicate::EvalStrAtom(), and GetStrAttr().
Referenced by TTable::SelectAtomicConst().
Returns value of floating point attribute specified by float column index for current row.
Definition at line 159 of file table.cpp.
References CurrRowIdx, TTable::FltCols, and Table.
Referenced by TTable::AddRow(), TTable::ColGenericOp(), TTable::ColGenericOpMP(), CompareAtomicConst(), TTable::Join(), and TTable::UpdateFltFromTableMP().
Returns value of float attribute specified by attribute name for current row.
Definition at line 172 of file table.cpp.
References CurrRowIdx, TTable::FltCols, TTable::GetColIdx(), and Table.
Returns value of integer attribute specified by integer column index for current row.
Definition at line 155 of file table.cpp.
References CurrRowIdx, TTable::IntCols, and Table.
Referenced by TTable::AddRow(), TTable::ColGenericOp(), TTable::ColGenericOpMP(), CompareAtomicConst(), TTable::GroupByIntColMP(), TTable::Join(), TSnap::ToGraphMP(), TSnap::ToNetworkMP(), TSnap::ToNetworkMP2(), and TTable::UpdateFltFromTableMP().
Returns value of integer attribute specified by attribute name for current row.
Definition at line 167 of file table.cpp.
References CurrRowIdx, TTable::GetColIdx(), TTable::IntCols, and Table.
TInt TRowIterator::GetRowIdx | ( | ) | const |
Gets the id of the row pointed by this iterator.
Definition at line 151 of file table.cpp.
References CurrRowIdx.
Referenced by TTable::ColConcat(), TTable::ColGenericOp(), TTable::ColGenericOpMP(), TTable::GroupByIntColMP(), TTable::Join(), TTable::SelectAtomicConst(), TTable::SelectFirstNRows(), TTable::SetFltColToConstMP(), TSnap::ToGraphMP(), TSnap::ToNetworkMP(), and TSnap::ToNetworkMP2().
Returns value of string attribute specified by string column index for current row.
Definition at line 163 of file table.cpp.
References CurrRowIdx, TTable::GetStrVal(), and Table.
Referenced by TTable::ColConcat(), CompareAtomicConst(), and CompareAtomicConstTStr().
Returns value of string attribute specified by attribute name for current row.
Definition at line 177 of file table.cpp.
References CurrRowIdx, TTable::GetStrVal(), and Table.
Returns integer mapping of a string attribute value specified by string column index for current row.
Definition at line 186 of file table.cpp.
References CurrRowIdx, TTable::StrColMaps, and Table.
Referenced by TTable::Join(), TSnap::ToGraphMP(), TSnap::ToNetworkMP(), and TSnap::ToNetworkMP2().
Returns integer mapping of string attribute specified by attribute name for current row.
Definition at line 181 of file table.cpp.
References CurrRowIdx, TTable::GetColIdx(), TTable::StrColMaps, and Table.
Referenced by TTable::AddRow().
TRowIterator & TRowIterator::Next | ( | ) |
Increments the iterator (For Python compatibility).
Definition at line 135 of file table.cpp.
References CurrRowIdx, TTable::Next, and Table.
Referenced by operator++().
TRowIterator & TRowIterator::operator++ | ( | int | ) |
Increments the iterator.
Definition at line 131 of file table.cpp.
References Next().
bool TRowIterator::operator< | ( | const TRowIterator & | RowI | ) | const |
Checks if this iterator points to a row that is before the one pointed by RowI
.
Definition at line 141 of file table.cpp.
References CurrRowIdx.
bool TRowIterator::operator== | ( | const TRowIterator & | RowI | ) | const |
Checks if this iterator points to the same row pointed by RowI
.
Definition at line 147 of file table.cpp.
References CurrRowIdx.
|
private |
Physical row index of current row pointed by iterator.
Definition at line 331 of file table.h.
Referenced by GetFltAttr(), GetIntAttr(), GetRowIdx(), GetStrAttr(), GetStrMapById(), GetStrMapByName(), Next(), operator<(), and operator==().
|
private |
Reference to table containing this row.
Definition at line 332 of file table.h.
Referenced by GetFltAttr(), GetIntAttr(), GetStrAttr(), GetStrMapById(), GetStrMapByName(), and Next().