-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cpp
93 lines (87 loc) · 1.95 KB
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include <iostream>
#include <conio.h>
#include "point.h"
#include "GUI.h"
#include "Shape.h"
#include "Window.h"
#include "STC.h"
#include <process.h>
using std::cout;
using std::endl;
using std::cin;
using std::ostream;
using std::ios_base;
using namespace::Grafix;
using namespace::_Xception;
_CRT_DEPRECATE_TEXT("yo");_declspec(deprecated("yo"));
_CRT_OBSOLETE(_TEST)inline void test(void *) throw()
{
cout<<"\nIn Thread";
_sleep(2000);
cout<<endl<<__LINE__<<' '<<__FILE__<<' '<<__FUNCSIG__<<" "<<__FUNCDNAME__<<" "<<__FUNCTION__<<"\nThread Function ends";
_endthread();
}
//class C
//{
//public:
// static _ui32 i;
//public:
// static auto n_instances() -> unsigned int { return i; }
//
// C(){ ++i; }
// ~C() { --i; }
// C( C const& ) { ++i; }
//};
//_ui32 C::i; // definition
class C
{
private:
static auto n() //static _i32r n()
-> int&
{
static int the_count;
return the_count;
}
public:
static auto n_instances() -> int { return n(); }
~C() { --n(); }
C(){ ++n(); }
C( C const& ) { ++n(); }
};
void main()
{
window w[5] ={
window(),
window(10, 10, 20, 30, " ", __REGULAR),
// window(10, 10, 40, 20, "window3", " ", __BOLD),
// window(20, 20, 30, 50, " ", __REGULAR),
// window(0, 5, 10, 60, " ", __REGULAR),
window(0, 5, 8, 30, " ", __BOLD),
// window()
};
// GUI g(vector<window>(w, &w[2]));
// _declspec(thread) static int t=1;
cout<<"Booting...\n\n";
GUI g(w, 4);
g.Draw();
STC<GUI> Yo(&g);
GUI *gp;
gp = Yo.get();
Yo->Draw();
Yo->Draw();
// gp = new GUI(w, 2);
// cout<<w[1].get_name();
// w[0].Draw();
/*cout<<"\nStarting Thread"
<<_beginthread(test, 0, 0);
cout<<"\nMain Ends";
cout<<endl<<__TIME__;*/
//_sleep(2000);
//test(" ");
//_endthread();
/*C c[3];
cout<<C::n_instances()<<endl;
C c_;
cout<<C::n_instances()<<endl;*/
_getch();
}