Template Class VectorModel¶
Defined in File sixtyfps.h
Inheritance Relationships¶
Base Type¶
public sixtyfps::Model< ModelData >
(Template Class Model)
Class Documentation¶
-
template<typename ModelData>
class sixtyfps::VectorModel : public sixtyfps::Model<ModelData>¶ A Model backed by a SharedVector.
Public Functions
-
VectorModel() = default¶
Constructs a new empty VectorModel.
-
inline VectorModel(std::vector<ModelData> array)¶
Constructs a new VectorModel from array.
-
inline virtual int row_count() const override¶
The amount of row in the model.
-
inline virtual ModelData row_data(int i) const override¶
Returns the data for a particular row. This function should be called with
row < row_count()
.
-
inline virtual void set_row_data(int i, const ModelData &value) override¶
Sets the data for a particular row.
This function should only be called with
row < row_count()
.If the model cannot support data changes, then it is ok to do nothing. The default implementation will print a warning to stderr.
If the model can update the data, it should also call
row_changed
-
inline void erase(int index)¶
Remove the row at the given index from the model.
-
VectorModel() = default¶