\doxysection{tk::Event\+Hub$<$ Msg\+Type, Max\+Subscribers $>$ クラステンプレート} \label{classtk_1_1_event_hub}\index{tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}} メッセージ型ごとの超軽量 Pub/\+\+Sub ディスパッチャ {\ttfamily \+\#include $<$actor.\+hpp$>$} \doxysubsubsection*{静的公開メンバ関数} \begin{DoxyCompactItemize} \item static bool \textbf{ subscribe} (void $\ast$actor, bool($\ast$post\+\_\+fn)(void $\ast$, const Msg\+Type \&)) \begin{DoxyCompactList}\small\item\em \doxyref{Actor}{p.}{classtk_1_1_actor} をこのメッセージ型の購読者として登録します \end{DoxyCompactList}\item static bool \textbf{ unsubscribe} (void $\ast$actor) \begin{DoxyCompactList}\small\item\em \doxyref{Actor}{p.}{classtk_1_1_actor} の購読登録を解除します \end{DoxyCompactList}\item static size\+\_\+t \textbf{ publish} (const Msg\+Type \&msg) \begin{DoxyCompactList}\small\item\em このメッセージ型を購読しているすべての \doxyref{Actor}{p.}{classtk_1_1_actor} へ同報配信します \end{DoxyCompactList}\item static size\+\_\+t \textbf{ subscriber\+\_\+count} () \end{DoxyCompactItemize} \doxysubsection{詳解} \subsubsection*{template$<$typename Msg\+Type, size\+\_\+t Max\+Subscribers = 4$>$\newline class tk::\+\+Event\+Hub$<$ Msg\+Type, Max\+Subscribers $>$} メッセージ型ごとの超軽量 Pub/\+\+Sub ディスパッチャ テンプレート引数 {\ttfamily Msg\+Type} ごとにコンパイル時解決される静的レジストリです。 実行時の型検索オーバーヘッドゼロ、動的メモリ確保ゼロで動作します。 \begin{DoxyTemplParams}{テンプレート引数} {\em Msg\+Type} & 配信するメッセージの型 \\ \hline {\em Max\+Subscribers} & 同一メッセージ型を購読できる最大 \doxyref{Actor}{p.}{classtk_1_1_actor} 数 (デフォルト: 4) \\ \hline \end{DoxyTemplParams} \label{classtk_1_1_event_hub_doc-func-members} \doxysubsection{関数詳解} \index{tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}!publish@{publish}} \index{publish@{publish}!tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}} \doxysubsubsection{publish()} {\footnotesize\ttfamily \label{classtk_1_1_event_hub_a3a59a641ad3fe121c0da7e1c81dc300b} template$<$typename Msg\+Type, size\+\_\+t Max\+Subscribers = 4$>$ \\ size\+\_\+t \textbf{ tk::\+\+Event\+Hub}$<$ Msg\+Type, Max\+Subscribers $>$::\+publish (\begin{DoxyParamCaption}\item[{const Msg\+Type \&}]{msg}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}} このメッセージ型を購読しているすべての \doxyref{Actor}{p.}{classtk_1_1_actor} へ同報配信します \begin{DoxyParams}{引数} {\em msg} & 配信するメッセージ実体 (各 \doxyref{Actor}{p.}{classtk_1_1_actor} のキューへ値コピー) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{戻り値} size\+\_\+t 配信に成功した \doxyref{Actor}{p.}{classtk_1_1_actor} の数 \end{DoxyReturn} \index{tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}!subscribe@{subscribe}} \index{subscribe@{subscribe}!tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}} \doxysubsubsection{subscribe()} {\footnotesize\ttfamily \label{classtk_1_1_event_hub_a50ebe29eaa2657604a1c85bf5125d490} template$<$typename Msg\+Type, size\+\_\+t Max\+Subscribers = 4$>$ \\ bool \textbf{ tk::\+\+Event\+Hub}$<$ Msg\+Type, Max\+Subscribers $>$::\+subscribe (\begin{DoxyParamCaption}\item[{void $\ast$}]{actor}{, }\item[{bool($\ast$}]{post\+\_\+fn~}{)(void $\ast$, const Msg\+Type \&)}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}} \doxyref{Actor}{p.}{classtk_1_1_actor} をこのメッセージ型の購読者として登録します \begin{DoxyParams}{引数} {\em actor} & \doxyref{Actor}{p.}{classtk_1_1_actor} インスタンスポインタ \\ \hline {\em post\+\_\+fn} & メッセージ投入関数ポインタ \\ \hline \end{DoxyParams} \begin{DoxyReturn}{戻り値} true 登録成功, false 購読者上限に達した \end{DoxyReturn} \index{tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}!subscriber\_count@{subscriber\_count}} \index{subscriber\_count@{subscriber\_count}!tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}} \doxysubsubsection{subscriber\_count()} {\footnotesize\ttfamily \label{classtk_1_1_event_hub_ac4cd6ce4e37b74385c7f4352a5516930} template$<$typename Msg\+Type, size\+\_\+t Max\+Subscribers = 4$>$ \\ size\+\_\+t \textbf{ tk::\+\+Event\+Hub}$<$ Msg\+Type, Max\+Subscribers $>$::\+subscriber\+\_\+count (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}} 現在の購読者数を取得 \index{tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}!unsubscribe@{unsubscribe}} \index{unsubscribe@{unsubscribe}!tk::EventHub$<$ MsgType, MaxSubscribers $>$@{tk::EventHub$<$ MsgType, MaxSubscribers $>$}} \doxysubsubsection{unsubscribe()} {\footnotesize\ttfamily \label{classtk_1_1_event_hub_a09c779ce8c594ea44c831adfd7e287f8} template$<$typename Msg\+Type, size\+\_\+t Max\+Subscribers = 4$>$ \\ bool \textbf{ tk::\+\+Event\+Hub}$<$ Msg\+Type, Max\+Subscribers $>$::\+unsubscribe (\begin{DoxyParamCaption}\item[{void $\ast$}]{actor}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}} \doxyref{Actor}{p.}{classtk_1_1_actor} の購読登録を解除します \begin{DoxyParams}{引数} {\em actor} & 解除する \doxyref{Actor}{p.}{classtk_1_1_actor} インスタンスポインタ \\ \hline \end{DoxyParams} \begin{DoxyReturn}{戻り値} true 解除成功, false 未登録 \end{DoxyReturn} このクラス詳解は次のファイルから抽出されました:\begin{DoxyCompactItemize} \item C:\+/\+\+Users/\+yoneda/\+\+Documents/\+\+Pico\+\_\+\+Projects/\+tinykernel/\+tinykernel/\+include/\+tinykernel/\textbf{ actor.\+hpp}\end{DoxyCompactItemize}