用于存放学校的作业便于复习。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
819 B

  1. // @Time : 2023-10-24 19:10:31
  2. // @FileName: test_view.cpp
  3. // @Author : 423A35C7
  4. // @Software: VSCode
  5. #include <bits/stdc++.h>
  6. #include "view.hpp"
  7. using namespace std;
  8. template <typename T>
  9. class TestModel : public vector<T> {
  10. public:
  11. using vector<T>::vector; // 这样好像可以继承构造函数
  12. int_ get_length() {
  13. return this->size();
  14. }
  15. };
  16. int main() {
  17. TestModel<int> a {1, 2, 3, 4, 5};
  18. auto background_view = BackgroundView(DEFAULT_GATE_X, DEFAULT_GATE_Y);
  19. auto queue_view = SimpleQueueView<int, TestModel<int>>(a, 10, 10);
  20. // queue_view.init();
  21. queue_view.refresh();
  22. TestModel<int> b {10, 20, 30, 40, 50};
  23. auto queue_view2 = SimpleQueueView<int, TestModel<int>>(b, 20, 50);
  24. // queue_view2.init();
  25. queue_view2.refresh();
  26. return 0;
  27. }