##// END OF EJS Templates
Adds erase() method for ArrayData and DataSeries
Alexandre Leroux -
r628:2be6c7467d6b
parent child
Show More
@@ -296,6 +296,16 public:
296 296 m_Data, m_NbComponents, false)}};
297 297 }
298 298
299 void erase(ArrayDataIterator first, ArrayDataIterator last)
300 {
301 auto firstImpl = dynamic_cast<arraydata_detail::IteratorValue<Dim, false> *>(first->impl());
302 auto lastImpl = dynamic_cast<arraydata_detail::IteratorValue<Dim, false> *>(last->impl());
303
304 if (firstImpl && lastImpl) {
305 m_Data.erase(firstImpl->m_It, lastImpl->m_It);
306 }
307 }
308
299 309 /// Inserts at the end of the array data the values passed as a parameter. This
300 310 /// method is intended to be used in the context of generating a back insert iterator, or only
301 311 /// if it's ensured that the total size of the vector is consistent with the number of
@@ -191,6 +191,18 public:
191 191 std::make_unique<dataseries_detail::IteratorValue<Dim, true> >(*this, false)}};
192 192 }
193 193
194 void erase(DataSeriesIterator first, DataSeriesIterator last)
195 {
196 auto firstImpl
197 = dynamic_cast<dataseries_detail::IteratorValue<Dim, false> *>(first->impl());
198 auto lastImpl = dynamic_cast<dataseries_detail::IteratorValue<Dim, false> *>(last->impl());
199
200 if (firstImpl && lastImpl) {
201 m_XAxisData->erase(firstImpl->m_XIt, lastImpl->m_XIt);
202 m_ValuesData->erase(firstImpl->m_ValuesIt, lastImpl->m_ValuesIt);
203 }
204 }
205
194 206 /// @sa IDataSeries::minXAxisData()
195 207 DataSeriesIterator minXAxisData(double minXAxisData) const override
196 208 {
General Comments 0
You need to be logged in to leave comments. Login now