summaryrefslogtreecommitdiff
path: root/docs/df/dcb/_event_broadcaster_8h_source.html
blob: dad32cdfacc2c81e4ec6c21dd6d9d98446ee44c7 (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tgbot-cpp: include/tgbot/EventBroadcaster.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tgbot-cpp
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('df/dcb/_event_broadcaster_8h_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">EventBroadcaster.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="../../df/dcb/_event_broadcaster_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2015 Oleg Morozenkov</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * of this software and associated documentation files (the &quot;Software&quot;), to deal</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * in the Software without restriction, including without limitation the rights</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * copies of the Software, and to permit persons to whom the Software is</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in all</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * copies or substantial portions of the Software.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * SOFTWARE.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef TGBOT_EVENTBROADCASTER_H</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define TGBOT_EVENTBROADCASTER_H</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;functional&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="../../db/db6/_message_8h.html">tgbot/types/Message.h</a>&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="../../d8/d6e/_inline_query_8h.html">tgbot/types/InlineQuery.h</a>&quot;</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="../../d7/d8b/_chosen_inline_result_8h.html">tgbot/types/ChosenInlineResult.h</a>&quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="../../d6/df3/_callback_query_8h.html">tgbot/types/CallbackQuery.h</a>&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">namespace </span><a class="code" href="../../d8/d9d/namespace_tg_bot.html">TgBot</a> {</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">class </span>EventHandler;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html">   44</a></span>&#160;<span class="keyword">class </span><a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html">EventBroadcaster</a> {</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">friend</span> <a class="code" href="../../d2/df5/class_tg_bot_1_1_event_handler.html">EventHandler</a>;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a9fda4ac3089dc101be4fd3a2a104185c">   49</a></span>&#160;    <span class="keyword">typedef</span> std::function&lt;void (const Message::Ptr&amp;)&gt; <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a9fda4ac3089dc101be4fd3a2a104185c">MessageListener</a>;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a437f0af514141d0a5d4fb684a56fe199">   50</a></span>&#160;    <span class="keyword">typedef</span> std::function&lt;void (const InlineQuery::Ptr&amp;)&gt; <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a437f0af514141d0a5d4fb684a56fe199">InlineQueryListener</a>;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#af9b674f16ddd707748f7ca8bf7f3ef91">   51</a></span>&#160;    <span class="keyword">typedef</span> std::function&lt;void (const ChosenInlineResult::Ptr&amp;)&gt; <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#af9b674f16ddd707748f7ca8bf7f3ef91">ChosenInlineResultListener</a>;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a1b5bf368b89d78d9c1582a1523a66b4e">   52</a></span>&#160;    <span class="keyword">typedef</span> std::function&lt;void (const CallbackQuery::Ptr&amp;)&gt; <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a1b5bf368b89d78d9c1582a1523a66b4e">CallbackQueryListener</a>;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a21adc85e9ed2a08a186423a5231342a9">   58</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a21adc85e9ed2a08a186423a5231342a9">onAnyMessage</a>(<span class="keyword">const</span> MessageListener&amp; listener) {</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        _onAnyMessageListeners.push_back(listener);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    }</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a13e4a906203fe43a950f1420b68c7583">   67</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a13e4a906203fe43a950f1420b68c7583">onCommand</a>(<span class="keyword">const</span> std::string&amp; commandName, <span class="keyword">const</span> MessageListener&amp; listener) {</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        _onCommandListeners[commandName] = listener;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    }</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a5bed996221f047ec0469ae19e7bd00eb">   75</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a5bed996221f047ec0469ae19e7bd00eb">onUnknownCommand</a>(<span class="keyword">const</span> MessageListener&amp; listener) {</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        _onUnknownCommandListeners.push_back(listener);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    }</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a22e70b8493ea455e70734a36968f3d55">   83</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a22e70b8493ea455e70734a36968f3d55">onNonCommandMessage</a>(<span class="keyword">const</span> MessageListener&amp; listener) {</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        _onNonCommandMessageListeners.push_back(listener);</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    }</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a9d3f31225ea84af8cb47ab2a53186ef0">   91</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a9d3f31225ea84af8cb47ab2a53186ef0">onInlineQuery</a>(<span class="keyword">const</span> InlineQueryListener&amp; listener) {</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        _onInlineQueryListeners.push_back(listener);</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    }</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a7397520ff294c863b306142e29030482">   99</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a7397520ff294c863b306142e29030482">onChosenInlineResult</a>(<span class="keyword">const</span> ChosenInlineResultListener&amp; listener){</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        _onChosenInlineResultListeners.push_back(listener);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    }</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a3ec551ffdcf5be1b9b39ed081ea078d4">  103</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a3ec551ffdcf5be1b9b39ed081ea078d4">onCallbackQuery</a>(<span class="keyword">const</span> CallbackQueryListener&amp; listener){</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        _onCallbackQueryListeners.push_back(listener);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    }</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> ListenerType, <span class="keyword">typename</span> ObjectType&gt;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcast(<span class="keyword">const</span> std::vector&lt;ListenerType&gt;&amp; listeners, <span class="keyword">const</span> ObjectType&amp; <span class="keywordtype">object</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        <span class="keywordflow">if</span> (!<span class="keywordtype">object</span>)</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            <span class="keywordflow">return</span>;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        </div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        <span class="keywordflow">for</span> (<span class="keyword">const</span> ListenerType&amp; item : listeners) {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;            item(<span class="keywordtype">object</span>);</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        }</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    }</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcastAnyMessage(<span class="keyword">const</span> <a class="code" href="../../d6/dce/class_tg_bot_1_1_message.html#a3805a5dc013c6ab23ac5efc91282c11d">Message::Ptr</a>&amp; message)<span class="keyword"> const </span>{</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        broadcast&lt;MessageListener, Message::Ptr&gt;(_onAnyMessageListeners, message);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    }</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">bool</span> broadcastCommand(<span class="keyword">const</span> std::string command, <span class="keyword">const</span> <a class="code" href="../../d6/dce/class_tg_bot_1_1_message.html#a3805a5dc013c6ab23ac5efc91282c11d">Message::Ptr</a>&amp; message)<span class="keyword"> const </span>{</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        std::map&lt;std::string, MessageListener&gt;::const_iterator iter = _onCommandListeners.find(command);</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        <span class="keywordflow">if</span> (iter == _onCommandListeners.end()) {</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        }</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        iter-&gt;second(message);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    }</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcastUnknownCommand(<span class="keyword">const</span> <a class="code" href="../../d6/dce/class_tg_bot_1_1_message.html#a3805a5dc013c6ab23ac5efc91282c11d">Message::Ptr</a>&amp; message)<span class="keyword"> const </span>{</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        broadcast&lt;MessageListener, Message::Ptr&gt;(_onUnknownCommandListeners, message);</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    }</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcastNonCommandMessage(<span class="keyword">const</span> <a class="code" href="../../d6/dce/class_tg_bot_1_1_message.html#a3805a5dc013c6ab23ac5efc91282c11d">Message::Ptr</a>&amp; message)<span class="keyword"> const </span>{</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        broadcast&lt;MessageListener, Message::Ptr&gt;(_onNonCommandMessageListeners, message);</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    }</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcastInlineQuery(<span class="keyword">const</span> <a class="code" href="../../d2/d62/class_tg_bot_1_1_inline_query.html#a82b36b38b3587e6a721b6fa579759b0c">InlineQuery::Ptr</a>&amp; query)<span class="keyword"> const </span>{</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        broadcast&lt;InlineQueryListener, InlineQuery::Ptr&gt;(_onInlineQueryListeners, query);</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    }</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcastChosenInlineResult(<span class="keyword">const</span> <a class="code" href="../../d4/dbc/class_tg_bot_1_1_chosen_inline_result.html#ad4b7edd30fd0d876fa99493fe19b3247">ChosenInlineResult::Ptr</a>&amp; result)<span class="keyword"> const </span>{</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        broadcast&lt;ChosenInlineResultListener, ChosenInlineResult::Ptr&gt;(_onChosenInlineResultListeners, result);</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    }</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcastCallbackQuery(<span class="keyword">const</span> <a class="code" href="../../d3/df8/class_tg_bot_1_1_callback_query.html#a5a5e4f8368bd95ba214e68cde5d1c7c0">CallbackQuery::Ptr</a>&amp; result)<span class="keyword"> const </span>{</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        broadcast&lt;CallbackQueryListener, CallbackQuery::Ptr&gt;(_onCallbackQueryListeners, result);</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    }</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    std::vector&lt;MessageListener&gt; _onAnyMessageListeners;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    std::map&lt;std::string, MessageListener&gt; _onCommandListeners;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    std::vector&lt;MessageListener&gt; _onUnknownCommandListeners;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    std::vector&lt;MessageListener&gt; _onNonCommandMessageListeners;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    std::vector&lt;InlineQueryListener&gt; _onInlineQueryListeners;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    std::vector&lt;ChosenInlineResultListener&gt; _onChosenInlineResultListeners;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    std::vector&lt;CallbackQueryListener&gt; _onCallbackQueryListeners;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;};</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;}</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="preprocessor">#endif //TGBOT_EVENTBROADCASTER_H</span></div><div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a21adc85e9ed2a08a186423a5231342a9"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a21adc85e9ed2a08a186423a5231342a9">TgBot::EventBroadcaster::onAnyMessage</a></div><div class="ttdeci">void onAnyMessage(const MessageListener &amp;listener)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00058">EventBroadcaster.h:58</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html">TgBot::EventBroadcaster</a></div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00044">EventBroadcaster.h:44</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a9fda4ac3089dc101be4fd3a2a104185c"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a9fda4ac3089dc101be4fd3a2a104185c">TgBot::EventBroadcaster::MessageListener</a></div><div class="ttdeci">std::function&lt; void(const Message::Ptr &amp;)&gt; MessageListener</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00049">EventBroadcaster.h:49</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_callback_query_html_a5a5e4f8368bd95ba214e68cde5d1c7c0"><div class="ttname"><a href="../../d3/df8/class_tg_bot_1_1_callback_query.html#a5a5e4f8368bd95ba214e68cde5d1c7c0">TgBot::CallbackQuery::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; CallbackQuery &gt; Ptr</div><div class="ttdef"><b>Definition:</b> <a href="../../d6/df3/_callback_query_8h_source.html#l00022">CallbackQuery.h:22</a></div></div>
<div class="ttc" id="namespace_tg_bot_html"><div class="ttname"><a href="../../d8/d9d/namespace_tg_bot.html">TgBot</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d4/ddd/_api_8h_source.html#l00044">Api.h:44</a></div></div>
<div class="ttc" id="_callback_query_8h_html"><div class="ttname"><a href="../../d6/df3/_callback_query_8h.html">CallbackQuery.h</a></div></div>
<div class="ttc" id="_inline_query_8h_html"><div class="ttname"><a href="../../d8/d6e/_inline_query_8h.html">InlineQuery.h</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_message_html_a3805a5dc013c6ab23ac5efc91282c11d"><div class="ttname"><a href="../../d6/dce/class_tg_bot_1_1_message.html#a3805a5dc013c6ab23ac5efc91282c11d">TgBot::Message::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; Message &gt; Ptr</div><div class="ttdef"><b>Definition:</b> <a href="../../db/db6/_message_8h_source.html#l00052">Message.h:52</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a1b5bf368b89d78d9c1582a1523a66b4e"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a1b5bf368b89d78d9c1582a1523a66b4e">TgBot::EventBroadcaster::CallbackQueryListener</a></div><div class="ttdeci">std::function&lt; void(const CallbackQuery::Ptr &amp;)&gt; CallbackQueryListener</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00052">EventBroadcaster.h:52</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_handler_html"><div class="ttname"><a href="../../d2/df5/class_tg_bot_1_1_event_handler.html">TgBot::EventHandler</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d4/d84/_event_handler_8h_source.html#l00032">EventHandler.h:32</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_chosen_inline_result_html_ad4b7edd30fd0d876fa99493fe19b3247"><div class="ttname"><a href="../../d4/dbc/class_tg_bot_1_1_chosen_inline_result.html#ad4b7edd30fd0d876fa99493fe19b3247">TgBot::ChosenInlineResult::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; ChosenInlineResult &gt; Ptr</div><div class="ttdef"><b>Definition:</b> <a href="../../d7/d8b/_chosen_inline_result_8h_source.html#l00022">ChosenInlineResult.h:22</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a9d3f31225ea84af8cb47ab2a53186ef0"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a9d3f31225ea84af8cb47ab2a53186ef0">TgBot::EventBroadcaster::onInlineQuery</a></div><div class="ttdeci">void onInlineQuery(const InlineQueryListener &amp;listener)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00091">EventBroadcaster.h:91</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_af9b674f16ddd707748f7ca8bf7f3ef91"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#af9b674f16ddd707748f7ca8bf7f3ef91">TgBot::EventBroadcaster::ChosenInlineResultListener</a></div><div class="ttdeci">std::function&lt; void(const ChosenInlineResult::Ptr &amp;)&gt; ChosenInlineResultListener</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00051">EventBroadcaster.h:51</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a3ec551ffdcf5be1b9b39ed081ea078d4"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a3ec551ffdcf5be1b9b39ed081ea078d4">TgBot::EventBroadcaster::onCallbackQuery</a></div><div class="ttdeci">void onCallbackQuery(const CallbackQueryListener &amp;listener)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00103">EventBroadcaster.h:103</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a5bed996221f047ec0469ae19e7bd00eb"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a5bed996221f047ec0469ae19e7bd00eb">TgBot::EventBroadcaster::onUnknownCommand</a></div><div class="ttdeci">void onUnknownCommand(const MessageListener &amp;listener)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00075">EventBroadcaster.h:75</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a437f0af514141d0a5d4fb684a56fe199"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a437f0af514141d0a5d4fb684a56fe199">TgBot::EventBroadcaster::InlineQueryListener</a></div><div class="ttdeci">std::function&lt; void(const InlineQuery::Ptr &amp;)&gt; InlineQueryListener</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00050">EventBroadcaster.h:50</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a13e4a906203fe43a950f1420b68c7583"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a13e4a906203fe43a950f1420b68c7583">TgBot::EventBroadcaster::onCommand</a></div><div class="ttdeci">void onCommand(const std::string &amp;commandName, const MessageListener &amp;listener)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00067">EventBroadcaster.h:67</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a22e70b8493ea455e70734a36968f3d55"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a22e70b8493ea455e70734a36968f3d55">TgBot::EventBroadcaster::onNonCommandMessage</a></div><div class="ttdeci">void onNonCommandMessage(const MessageListener &amp;listener)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00083">EventBroadcaster.h:83</a></div></div>
<div class="ttc" id="_chosen_inline_result_8h_html"><div class="ttname"><a href="../../d7/d8b/_chosen_inline_result_8h.html">ChosenInlineResult.h</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_event_broadcaster_html_a7397520ff294c863b306142e29030482"><div class="ttname"><a href="../../dc/db7/class_tg_bot_1_1_event_broadcaster.html#a7397520ff294c863b306142e29030482">TgBot::EventBroadcaster::onChosenInlineResult</a></div><div class="ttdeci">void onChosenInlineResult(const ChosenInlineResultListener &amp;listener)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dcb/_event_broadcaster_8h_source.html#l00099">EventBroadcaster.h:99</a></div></div>
<div class="ttc" id="class_tg_bot_1_1_inline_query_html_a82b36b38b3587e6a721b6fa579759b0c"><div class="ttname"><a href="../../d2/d62/class_tg_bot_1_1_inline_query.html#a82b36b38b3587e6a721b6fa579759b0c">TgBot::InlineQuery::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; InlineQuery &gt; Ptr</div><div class="ttdef"><b>Definition:</b> <a href="../../d8/d6e/_inline_query_8h_source.html#l00022">InlineQuery.h:22</a></div></div>
<div class="ttc" id="_message_8h_html"><div class="ttname"><a href="../../db/db6/_message_8h.html">Message.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_25b26b9fa3b0bd1537052b03f43dd617.html">tgbot</a></li><li class="navelem"><a class="el" href="../../df/dcb/_event_broadcaster_8h.html">EventBroadcaster.h</a></li>
    <li class="footer">Generated on Sun Jan 15 2017 02:33:16 for tgbot-cpp by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>