\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}
