Skip to content

Commit c5d700d

Browse files
committed
Add tableGetRow helper and Table_getRow_impl after TableRow definition
1 parent 3dab3a3 commit c5d700d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/Processing.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,6 +2187,7 @@ class Table {
21872187
};
21882188

21892189

2190+
21902191
// =============================================================================
21912192
// TYPED LISTS / DICTS -- match Processing Java's IntList, FloatDict, etc.
21922193
// =============================================================================
@@ -3809,6 +3810,18 @@ class TableRow {
38093810
// PVECTOR HELPER -- matches Processing Java's createVector()
38103811
// =============================================================================
38113812

3813+
// Table::getRow() -- defined here after TableRow
3814+
inline TableRow Table_getRow_impl(Table& t, int i) {
3815+
if(i<0||i>=(int)t.rows.size()) return TableRow();
3816+
return TableRow(t.rows[i], t.columns);
3817+
}
3818+
3819+
// Table getRow() free helper -- use t.getRow(i) via macro or just call this
3820+
inline TableRow tableGetRow(Table& t, int i) {
3821+
if(i<0||i>=(int)t.rows.size()) return TableRow();
3822+
return TableRow(t.rows[i], t.columns);
3823+
}
3824+
38123825
inline PVector createVector(float x, float y, float z=0) { return PVector(x, y, z); }
38133826

38143827

0 commit comments

Comments
 (0)