diff options
Diffstat (limited to 'p2pvr/lib/objectRowState.h')
-rw-r--r-- | p2pvr/lib/objectRowState.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/p2pvr/lib/objectRowState.h b/p2pvr/lib/objectRowState.h index 142e5cb..3e3fd2f 100644 --- a/p2pvr/lib/objectRowState.h +++ b/p2pvr/lib/objectRowState.h @@ -27,29 +27,22 @@ SelectedColumns CreateColumns(const ColumnCreator & cc) return CreateColumns(Slicer::ModelPartFor(v), cc); } -template <typename T> class ObjectRowState : public RowState { public: - ObjectRowState(const ColumnSpecifier & cs = CreateColumns<T>) : - columns(ColumnCreatorHelper(cs)) - { - fields.resize(columns.size()); - } - const Columns & getColumns() const { return columns; } + ObjectRowState(const ColumnSpecifier & cs); + const Columns & getColumns() const; private: - static Columns ColumnCreatorHelper(const ColumnSpecifier & cs) - { - int index = 0; - Columns columns; - cs([&columns, &index](const std::string & name, bool) { - columns.insert(new Column(index++, name)); - }); - return columns; - } + static Columns ColumnCreatorHelper(const ColumnSpecifier & cs); Columns columns; }; +template <typename T> +class ObjectRowStateTmpl : public ObjectRowState { + public: + ObjectRowStateTmpl(const ColumnSpecifier & cs = CreateColumns<T>) : ObjectRowState(cs) {} +}; + #endif |