src/types/resourcevector.h

changeset 1191
26b3f1e80a9c
parent 1190
2edf54a5e56a
equal deleted inserted replaced
1190:2edf54a5e56a 1191:26b3f1e80a9c
27 { 27 {
28 public: 28 public:
29 using Filter = std::function<bool(T*, int)>; 29 using Filter = std::function<bool(T*, int)>;
30 using Callback = std::function<void(T*, int)>; 30 using Callback = std::function<void(T*, int)>;
31 31
32 ResourceVector() = default;
33 ResourceVector(const ResourceVector<T>&) = delete;
32 ~ResourceVector(); 34 ~ResourceVector();
33 35
34 void append(T) = delete; 36 void append(T) = delete;
35 template<typename TT = T, typename... Args> 37 template<typename TT = T, typename... Args>
36 TT* append(Args&&... args); 38 TT* append(Args&&... args);
48 int size() const; 50 int size() const;
49 void swap(int position1, int position2); 51 void swap(int position1, int position2);
50 void merge(ResourceVector<T>& other, int position = -1, Filter filter = nullptr, Callback callback = nullptr); 52 void merge(ResourceVector<T>& other, int position = -1, Filter filter = nullptr, Callback callback = nullptr);
51 const QVector<T*>& toQVector() const; 53 const QVector<T*>& toQVector() const;
52 54
55 void operator=(const ResourceVector<T>&) = delete;
56
53 private: 57 private:
54 QVector<T*> _data; 58 QVector<T*> _data;
55 }; 59 };
56 60
57 template<typename T> 61 template<typename T>

mercurial