31 lines
819 B
C++
31 lines
819 B
C++
|
// @Time : 2023-10-24 19:10:31
|
||
|
// @FileName: test_view.cpp
|
||
|
// @Author : 423A35C7
|
||
|
// @Software: VSCode
|
||
|
|
||
|
#include <bits/stdc++.h>
|
||
|
#include "view.hpp"
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
template <typename T>
|
||
|
class TestModel : public vector<T> {
|
||
|
public:
|
||
|
using vector<T>::vector; // 这样好像可以继承构造函数
|
||
|
int_ get_length() {
|
||
|
return this->size();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
int main() {
|
||
|
TestModel<int> a {1, 2, 3, 4, 5};
|
||
|
auto background_view = BackgroundView(DEFAULT_GATE_X, DEFAULT_GATE_Y);
|
||
|
auto queue_view = SimpleQueueView<int, TestModel<int>>(a, 10, 10);
|
||
|
// queue_view.init();
|
||
|
queue_view.refresh();
|
||
|
TestModel<int> b {10, 20, 30, 40, 50};
|
||
|
auto queue_view2 = SimpleQueueView<int, TestModel<int>>(b, 20, 50);
|
||
|
// queue_view2.init();
|
||
|
queue_view2.refresh();
|
||
|
return 0;
|
||
|
}
|