aboutsummaryrefslogtreecommitdiffstats
path: root/doc/latex/classmeow_1_1ObjSelector.tex
blob: 117250f5fb4cd229a9bf9ddff957c1f2137ab4f7 (plain) (blame)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
\hypertarget{classmeow_1_1ObjSelector}{\section{meow\-:\-:Obj\-Selector$<$ id $>$ Class Template Reference}
\label{classmeow_1_1ObjSelector}\index{meow\-::\-Obj\-Selector$<$ id $>$@{meow\-::\-Obj\-Selector$<$ id $>$}}
}


利用register的概念, 達到runtime用string選擇要new的class  




{\ttfamily \#include \char`\"{}Obj\-Selector.\-h\char`\"{}}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classmeow_1_1ObjSelector_afefd56114a54ec164f0264d83394fc21}{Obj\-Selector} (std\-::string \hyperlink{classmeow_1_1ObjSelector_a43786b9b4869a3bb115c852d09e474cb}{name}, \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$obj, bool auto\-Delete)
\begin{DoxyCompactList}\small\item\em 宣告一個\-Obj\-Selector實體, 並且註冊一個 \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1ObjSelector_a7f798e7243aa2e93d2458dfc7f6d3308}{Obj\-Selector} (\hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$obj, bool auto\-Delete)
\begin{DoxyCompactList}\small\item\em 宣告一個\-Obj\-Selector實體, 並且註冊一個 \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1ObjSelector_aa5d9c625910c4ece0cba7944885d39c2}{$\sim$\-Obj\-Selector} ()
\begin{DoxyCompactList}\small\item\em 解構子 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{classmeow_1_1ObjSelector_a0401a1941829c1b82ebce545d00a996d}{add} (std\-::string \hyperlink{classmeow_1_1ObjSelector_a43786b9b4869a3bb115c852d09e474cb}{name}, \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$obj, bool auto\-Delete)
\begin{DoxyCompactList}\small\item\em 新增(註冊) 一個\-Class (必須要繼承自 {\ttfamily \hyperlink{classmeow_1_1ObjBase}{Obj\-Base}}) 並且給定其\-Name \end{DoxyCompactList}\item 
static void \hyperlink{classmeow_1_1ObjSelector_af1479fc3260f2600d76bc018a9a36019}{add} (\hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$obj, bool auto\-Delete)
\begin{DoxyCompactList}\small\item\em 新增(註冊) 一個\-Class (必須要繼承自 {\ttfamily \hyperlink{classmeow_1_1ObjBase}{Obj\-Base}}) 並且默認type為name \end{DoxyCompactList}\item 
static void \hyperlink{classmeow_1_1ObjSelector_a94ae819ddd031927466845c86ce35621}{del} (std\-::string \hyperlink{classmeow_1_1ObjSelector_a43786b9b4869a3bb115c852d09e474cb}{name})
\begin{DoxyCompactList}\small\item\em 依照name刪除之前註冊過得\-Class \end{DoxyCompactList}\item 
static \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} const $\ast$ \hyperlink{classmeow_1_1ObjSelector_a948d5e709bdeacb8648e8c7c243b0ff3}{get} (std\-::string \hyperlink{classmeow_1_1ObjSelector_a43786b9b4869a3bb115c852d09e474cb}{name})
\begin{DoxyCompactList}\small\item\em 取得之前註冊過得\-Class \end{DoxyCompactList}\item 
static \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$ \hyperlink{classmeow_1_1ObjSelector_a498c46995c8f9050b3b069b95d10c5cb}{create} (std\-::string \hyperlink{classmeow_1_1ObjSelector_a43786b9b4869a3bb115c852d09e474cb}{name})
\begin{DoxyCompactList}\small\item\em 回傳一個之前註冊過得\-Class new出來的實體 \end{DoxyCompactList}\item 
static bool \hyperlink{classmeow_1_1ObjSelector_a8febbd488ce1cf37b075c0e42278d3d0}{exist} (\hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$obj)
\begin{DoxyCompactList}\small\item\em 利用type檢查是否有註冊過同種類的\-Class \end{DoxyCompactList}\item 
static std\-::string \hyperlink{classmeow_1_1ObjSelector_a43786b9b4869a3bb115c852d09e474cb}{name} (\hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$obj)
\begin{DoxyCompactList}\small\item\em 利用type尋找name \end{DoxyCompactList}\item 
static std\-::vector$<$ std\-::string $>$ \hyperlink{classmeow_1_1ObjSelector_a12a464df440ff51da3f51a5c6731f958}{names} ()
\begin{DoxyCompactList}\small\item\em 回傳所有註冊過的name \end{DoxyCompactList}\item 
static bool \hyperlink{classmeow_1_1ObjSelector_a85ff03287a5344d02b5cd67f89265ed8}{write} (F\-I\-L\-E $\ast$f, bool binary, \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$obj, unsigned \hyperlink{classint}{int} fg)
\begin{DoxyCompactList}\small\item\em 將一個物件寫到檔案裡(該物件必須要有註冊過) \end{DoxyCompactList}\item 
static \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} $\ast$ \hyperlink{classmeow_1_1ObjSelector_a757b4c75d87f958b64bb5cacbeb71dcb}{read} (F\-I\-L\-E $\ast$f, bool binary)
\begin{DoxyCompactList}\small\item\em 從檔案中讀取一個物件(該物件必須要有註冊過) \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{classmeow_1_1ObjSelector_af0a264c27d0d08af4b617d2e4675fda7}{Info}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$size\-\_\-t id$>$class meow\-::\-Obj\-Selector$<$ id $>$}

利用register的概念, 達到runtime用string選擇要new的class 

\begin{DoxyAuthor}{Author}
cathook$<$ 讓程式可以有不只一個 {\ttfamily \hyperlink{classmeow_1_1ObjSelector}{Obj\-Selector}} 
\end{DoxyAuthor}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{classmeow_1_1ObjSelector_afefd56114a54ec164f0264d83394fc21}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!Obj\-Selector@{Obj\-Selector}}
\index{Obj\-Selector@{Obj\-Selector}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{Obj\-Selector}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::{\bf Obj\-Selector} (
\begin{DoxyParamCaption}
\item[{std\-::string}]{name, }
\item[{{\bf Obj\-Base} $\ast$}]{obj, }
\item[{bool}]{auto\-Delete}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1ObjSelector_afefd56114a54ec164f0264d83394fc21}


宣告一個\-Obj\-Selector實體, 並且註冊一個 \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} 

\hypertarget{classmeow_1_1ObjSelector_a7f798e7243aa2e93d2458dfc7f6d3308}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!Obj\-Selector@{Obj\-Selector}}
\index{Obj\-Selector@{Obj\-Selector}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{Obj\-Selector}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::{\bf Obj\-Selector} (
\begin{DoxyParamCaption}
\item[{{\bf Obj\-Base} $\ast$}]{obj, }
\item[{bool}]{auto\-Delete}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1ObjSelector_a7f798e7243aa2e93d2458dfc7f6d3308}


宣告一個\-Obj\-Selector實體, 並且註冊一個 \hyperlink{classmeow_1_1ObjBase}{Obj\-Base} 

\hypertarget{classmeow_1_1ObjSelector_aa5d9c625910c4ece0cba7944885d39c2}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!$\sim$\-Obj\-Selector@{$\sim$\-Obj\-Selector}}
\index{$\sim$\-Obj\-Selector@{$\sim$\-Obj\-Selector}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{$\sim$\-Obj\-Selector}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::$\sim${\bf Obj\-Selector} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1ObjSelector_aa5d9c625910c4ece0cba7944885d39c2}


解構子 



\subsection{Member Function Documentation}
\hypertarget{classmeow_1_1ObjSelector_a0401a1941829c1b82ebce545d00a996d}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!add@{add}}
\index{add@{add}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{add}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static void {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::add (
\begin{DoxyParamCaption}
\item[{std\-::string}]{name, }
\item[{{\bf Obj\-Base} $\ast$}]{obj, }
\item[{bool}]{auto\-Delete}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a0401a1941829c1b82ebce545d00a996d}


新增(註冊) 一個\-Class (必須要繼承自 {\ttfamily \hyperlink{classmeow_1_1ObjBase}{Obj\-Base}}) 並且給定其\-Name 

\hypertarget{classmeow_1_1ObjSelector_af1479fc3260f2600d76bc018a9a36019}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!add@{add}}
\index{add@{add}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{add}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static void {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::add (
\begin{DoxyParamCaption}
\item[{{\bf Obj\-Base} $\ast$}]{obj, }
\item[{bool}]{auto\-Delete}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_af1479fc3260f2600d76bc018a9a36019}


新增(註冊) 一個\-Class (必須要繼承自 {\ttfamily \hyperlink{classmeow_1_1ObjBase}{Obj\-Base}}) 並且默認type為name 

\hypertarget{classmeow_1_1ObjSelector_a498c46995c8f9050b3b069b95d10c5cb}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!create@{create}}
\index{create@{create}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{create}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static {\bf Obj\-Base}$\ast$ {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::create (
\begin{DoxyParamCaption}
\item[{std\-::string}]{name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a498c46995c8f9050b3b069b95d10c5cb}


回傳一個之前註冊過得\-Class new出來的實體 

\hypertarget{classmeow_1_1ObjSelector_a94ae819ddd031927466845c86ce35621}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!del@{del}}
\index{del@{del}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{del}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static void {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::del (
\begin{DoxyParamCaption}
\item[{std\-::string}]{name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a94ae819ddd031927466845c86ce35621}


依照name刪除之前註冊過得\-Class 

\hypertarget{classmeow_1_1ObjSelector_a8febbd488ce1cf37b075c0e42278d3d0}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!exist@{exist}}
\index{exist@{exist}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{exist}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static bool {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::exist (
\begin{DoxyParamCaption}
\item[{{\bf Obj\-Base} $\ast$}]{obj}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a8febbd488ce1cf37b075c0e42278d3d0}


利用type檢查是否有註冊過同種類的\-Class 

\hypertarget{classmeow_1_1ObjSelector_a948d5e709bdeacb8648e8c7c243b0ff3}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!get@{get}}
\index{get@{get}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{get}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static {\bf Obj\-Base} const$\ast$ {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::get (
\begin{DoxyParamCaption}
\item[{std\-::string}]{name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a948d5e709bdeacb8648e8c7c243b0ff3}


取得之前註冊過得\-Class 

\hypertarget{classmeow_1_1ObjSelector_a43786b9b4869a3bb115c852d09e474cb}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!name@{name}}
\index{name@{name}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{name}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static std\-::string {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::name (
\begin{DoxyParamCaption}
\item[{{\bf Obj\-Base} $\ast$}]{obj}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a43786b9b4869a3bb115c852d09e474cb}


利用type尋找name 

\hypertarget{classmeow_1_1ObjSelector_a12a464df440ff51da3f51a5c6731f958}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!names@{names}}
\index{names@{names}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{names}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static std\-::vector$<$std\-::string$>$ {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::names (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a12a464df440ff51da3f51a5c6731f958}


回傳所有註冊過的name 

\hypertarget{classmeow_1_1ObjSelector_a757b4c75d87f958b64bb5cacbeb71dcb}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!read@{read}}
\index{read@{read}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{read}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static {\bf Obj\-Base}$\ast$ {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::read (
\begin{DoxyParamCaption}
\item[{F\-I\-L\-E $\ast$}]{f, }
\item[{bool}]{binary}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a757b4c75d87f958b64bb5cacbeb71dcb}


從檔案中讀取一個物件(該物件必須要有註冊過) 

\hypertarget{classmeow_1_1ObjSelector_a85ff03287a5344d02b5cd67f89265ed8}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!write@{write}}
\index{write@{write}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{write}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ static bool {\bf meow\-::\-Obj\-Selector}$<$ id $>$\-::write (
\begin{DoxyParamCaption}
\item[{F\-I\-L\-E $\ast$}]{f, }
\item[{bool}]{binary, }
\item[{{\bf Obj\-Base} $\ast$}]{obj, }
\item[{unsigned {\bf int}}]{fg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classmeow_1_1ObjSelector_a85ff03287a5344d02b5cd67f89265ed8}


將一個物件寫到檔案裡(該物件必須要有註冊過) 



\subsection{Friends And Related Function Documentation}
\hypertarget{classmeow_1_1ObjSelector_af0a264c27d0d08af4b617d2e4675fda7}{\index{meow\-::\-Obj\-Selector@{meow\-::\-Obj\-Selector}!Info@{Info}}
\index{Info@{Info}!meow::ObjSelector@{meow\-::\-Obj\-Selector}}
\subsubsection[{Info}]{\setlength{\rightskip}{0pt plus 5cm}template$<$size\-\_\-t id$>$ friend struct Info\hspace{0.3cm}{\ttfamily [friend]}}}\label{classmeow_1_1ObjSelector_af0a264c27d0d08af4b617d2e4675fda7}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
meowpp/oo/\hyperlink{ObjSelector_8h}{Obj\-Selector.\-h}\end{DoxyCompactItemize}