⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 channels_8cpp-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<a name="l00204"></a>00204         <span class="keywordflow">if</span> (m_blocked)<a name="l00205"></a>00205         {<a name="l00206"></a>00206                 m_blocked = <span class="keyword">false</span>;<a name="l00207"></a>00207                 <span class="keywordflow">goto</span> WasBlocked;<a name="l00208"></a>00208         }<a name="l00209"></a>00209 <a name="l00210"></a>00210         m_it.<a class="code" href="class_channel_route_iterator.html#862708d9e96fb0d6f884fb7e022a5b5a">Reset</a>(channel);<a name="l00211"></a>00211 <a name="l00212"></a>00212         <span class="keywordflow">while</span> (!m_it.<a class="code" href="class_channel_route_iterator.html#14f8502d1e6f319381d411091ec02365">End</a>())<a name="l00213"></a>00213         {<a name="l00214"></a>00214           WasBlocked:<a name="l00215"></a>00215                 <span class="keywordflow">if</span> (m_it.<a class="code" href="class_channel_route_iterator.html#c52ae006ff11d2423aca39b261ca6d67">Destination</a>().<a class="code" href="class_buffered_transformation.html#e0fc63d42d94958f71fc573b17469921">ChannelMessageSeriesEnd</a>(m_it.<a class="code" href="class_channel_route_iterator.html#bb4fc50d81f6658df516bfb714103368">Channel</a>(), propagation))<a name="l00216"></a>00216                 {<a name="l00217"></a>00217                         m_blocked = <span class="keyword">true</span>;<a name="l00218"></a>00218                         <span class="keywordflow">return</span> <span class="keyword">true</span>;<a name="l00219"></a>00219                 }<a name="l00220"></a>00220 <a name="l00221"></a>00221                 m_it.<a class="code" href="class_channel_route_iterator.html#76ebd766280e96f582072e7a2fea3bec">Next</a>();<a name="l00222"></a>00222         }<a name="l00223"></a>00223 <a name="l00224"></a>00224         <span class="keywordflow">return</span> <span class="keyword">false</span>;<a name="l00225"></a>00225 }<a name="l00226"></a>00226 <a name="l00227"></a><a class="code" href="class_channel_switch.html#2d9c7bc18d12303c77f7cd4ad355a6f8">00227</a> byte * <a class="code" href="class_channel_switch.html#2d9c7bc18d12303c77f7cd4ad355a6f8">ChannelSwitch::ChannelCreatePutSpace</a>(<span class="keyword">const</span> std::string &amp;channel, <span class="keywordtype">size_t</span> &amp;size)<a name="l00228"></a>00228 {<a name="l00229"></a>00229         m_it.<a class="code" href="class_channel_route_iterator.html#862708d9e96fb0d6f884fb7e022a5b5a">Reset</a>(channel);<a name="l00230"></a>00230         <span class="keywordflow">if</span> (!m_it.<a class="code" href="class_channel_route_iterator.html#14f8502d1e6f319381d411091ec02365">End</a>())<a name="l00231"></a>00231         {<a name="l00232"></a>00232                 <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;target = m_it.<a class="code" href="class_channel_route_iterator.html#c52ae006ff11d2423aca39b261ca6d67">Destination</a>();<a name="l00233"></a>00233                 <span class="keyword">const</span> std::string &amp;channel = m_it.<a class="code" href="class_channel_route_iterator.html#bb4fc50d81f6658df516bfb714103368">Channel</a>();<a name="l00234"></a>00234                 m_it.<a class="code" href="class_channel_route_iterator.html#76ebd766280e96f582072e7a2fea3bec">Next</a>();<a name="l00235"></a>00235                 <span class="keywordflow">if</span> (m_it.<a class="code" href="class_channel_route_iterator.html#14f8502d1e6f319381d411091ec02365">End</a>()) <span class="comment">// there is only one target channel</span><a name="l00236"></a>00236                         <span class="keywordflow">return</span> target.ChannelCreatePutSpace(channel, size);<a name="l00237"></a>00237         }<a name="l00238"></a>00238         size = 0;<a name="l00239"></a>00239         <span class="keywordflow">return</span> NULL;<a name="l00240"></a>00240 }<a name="l00241"></a>00241 <a name="l00242"></a><a class="code" href="class_channel_switch.html#914398ac6126fb975393a033ba3bd2d9">00242</a> <span class="keywordtype">size_t</span> <a class="code" href="class_channel_switch.html#914398ac6126fb975393a033ba3bd2d9">ChannelSwitch::ChannelPutModifiable2</a>(<span class="keyword">const</span> std::string &amp;channel, byte *inString, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> messageEnd, <span class="keywordtype">bool</span> blocking)<a name="l00243"></a>00243 {<a name="l00244"></a>00244         <a class="code" href="class_channel_route_iterator.html">ChannelRouteIterator</a> it(*<span class="keyword">this</span>);<a name="l00245"></a>00245         it.<a class="code" href="class_channel_route_iterator.html#862708d9e96fb0d6f884fb7e022a5b5a">Reset</a>(channel);<a name="l00246"></a>00246 <a name="l00247"></a>00247         <span class="keywordflow">if</span> (!it.<a class="code" href="class_channel_route_iterator.html#14f8502d1e6f319381d411091ec02365">End</a>())<a name="l00248"></a>00248         {<a name="l00249"></a>00249                 <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;target = it.<a class="code" href="class_channel_route_iterator.html#c52ae006ff11d2423aca39b261ca6d67">Destination</a>();<a name="l00250"></a>00250                 <span class="keyword">const</span> std::string &amp;targetChannel = it.<a class="code" href="class_channel_route_iterator.html#bb4fc50d81f6658df516bfb714103368">Channel</a>();<a name="l00251"></a>00251                 it.<a class="code" href="class_channel_route_iterator.html#76ebd766280e96f582072e7a2fea3bec">Next</a>();<a name="l00252"></a>00252                 <span class="keywordflow">if</span> (it.<a class="code" href="class_channel_route_iterator.html#14f8502d1e6f319381d411091ec02365">End</a>())   <span class="comment">// there is only one target channel</span><a name="l00253"></a>00253                         <span class="keywordflow">return</span> target.ChannelPutModifiable2(targetChannel, inString, length, messageEnd, blocking);<a name="l00254"></a>00254         }<a name="l00255"></a>00255 <a name="l00256"></a>00256         <span class="keywordflow">return</span> <a class="code" href="class_channel_switch.html#19e244d0593c91190858739b3240489c">ChannelPut2</a>(channel, inString, length, messageEnd, blocking);<a name="l00257"></a>00257 }<a name="l00258"></a>00258 <a name="l00259"></a><a class="code" href="class_channel_switch.html#3392fbeb13569f9861564ed31120088d">00259</a> <span class="keywordtype">void</span> <a class="code" href="class_channel_switch.html#3392fbeb13569f9861564ed31120088d">ChannelSwitch::AddDefaultRoute</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;destination)<a name="l00260"></a>00260 {<a name="l00261"></a>00261         m_defaultRoutes.push_back(<a class="code" href="class_channel_switch_typedefs.html#682b7749e2ce307e095e389ab63aa3b7">DefaultRoute</a>(&amp;destination, <a class="code" href="classvalue__ptr.html">value_ptr&lt;std::string&gt;</a>(NULL)));<a name="l00262"></a>00262 }<a name="l00263"></a>00263 <a name="l00264"></a><a class="code" href="class_channel_switch.html#0405fc201e843057cbee150e30eadc4a">00264</a> <span class="keywordtype">void</span> <a class="code" href="class_channel_switch.html#0405fc201e843057cbee150e30eadc4a">ChannelSwitch::RemoveDefaultRoute</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;destination)<a name="l00265"></a>00265 {<a name="l00266"></a>00266         <span class="keywordflow">for</span> (DefaultRouteList::iterator it = m_defaultRoutes.begin(); it != m_defaultRoutes.end(); ++it)<a name="l00267"></a>00267                 <span class="keywordflow">if</span> (it-&gt;first == &amp;destination &amp;&amp; !it-&gt;second.get())<a name="l00268"></a>00268                 {<a name="l00269"></a>00269                         m_defaultRoutes.erase(it);<a name="l00270"></a>00270                         <span class="keywordflow">break</span>;<a name="l00271"></a>00271                 }<a name="l00272"></a>00272 }<a name="l00273"></a>00273 <a name="l00274"></a><a class="code" href="class_channel_switch.html#bd84e65942431ade1f2e579a009bd400">00274</a> <span class="keywordtype">void</span> <a class="code" href="class_channel_switch.html#3392fbeb13569f9861564ed31120088d">ChannelSwitch::AddDefaultRoute</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;destination, <span class="keyword">const</span> std::string &amp;outChannel)<a name="l00275"></a>00275 {<a name="l00276"></a>00276         m_defaultRoutes.push_back(<a class="code" href="class_channel_switch_typedefs.html#682b7749e2ce307e095e389ab63aa3b7">DefaultRoute</a>(&amp;destination, outChannel));<a name="l00277"></a>00277 }<a name="l00278"></a>00278 <a name="l00279"></a><a class="code" href="class_channel_switch.html#5cff9d31ff039901331d85ecff0e325d">00279</a> <span class="keywordtype">void</span> <a class="code" href="class_channel_switch.html#0405fc201e843057cbee150e30eadc4a">ChannelSwitch::RemoveDefaultRoute</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;destination, <span class="keyword">const</span> std::string &amp;outChannel)<a name="l00280"></a>00280 {<a name="l00281"></a>00281         <span class="keywordflow">for</span> (DefaultRouteList::iterator it = m_defaultRoutes.begin(); it != m_defaultRoutes.end(); ++it)<a name="l00282"></a>00282                 <span class="keywordflow">if</span> (it-&gt;first == &amp;destination &amp;&amp; (it-&gt;second.get() &amp;&amp; *it-&gt;second == outChannel))<a name="l00283"></a>00283                 {<a name="l00284"></a>00284                         m_defaultRoutes.erase(it);<a name="l00285"></a>00285                         <span class="keywordflow">break</span>;<a name="l00286"></a>00286                 }<a name="l00287"></a>00287 }<a name="l00288"></a>00288 <a name="l00289"></a><a class="code" href="class_channel_switch.html#adc822b937f15ad9a231ca8a4a66636e">00289</a> <span class="keywordtype">void</span> <a class="code" href="class_channel_switch.html#adc822b937f15ad9a231ca8a4a66636e">ChannelSwitch::AddRoute</a>(<span class="keyword">const</span> std::string &amp;inChannel, <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;destination, <span class="keyword">const</span> std::string &amp;outChannel)<a name="l00290"></a>00290 {<a name="l00291"></a>00291         m_routeMap.insert(RouteMap::value_type(inChannel, <a class="code" href="class_channel_switch_typedefs.html#6c3a9f4fbf9e2a83bdd72d28afda897f">Route</a>(&amp;destination, outChannel)));<a name="l00292"></a>00292 }<a name="l00293"></a>00293 <a name="l00294"></a><a class="code" href="class_channel_switch.html#afbbeaa87847c1a527f1489c6afdcf18">00294</a> <span class="keywordtype">void</span> <a class="code" href="class_channel_switch.html#afbbeaa87847c1a527f1489c6afdcf18">ChannelSwitch::RemoveRoute</a>(<span class="keyword">const</span> std::string &amp;inChannel, <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;destination, <span class="keyword">const</span> std::string &amp;outChannel)<a name="l00295"></a>00295 {<a name="l00296"></a>00296         <span class="keyword">typedef</span> ChannelSwitch::RouteMap::iterator <a class="code" href="class_channel_switch_typedefs.html#5928e683ccad25bc9c340208326db91e">MapIterator</a>;<a name="l00297"></a>00297         pair&lt;MapIterator, MapIterator&gt; range = m_routeMap.equal_range(inChannel);<a name="l00298"></a>00298         <a name="l00299"></a>00299         <span class="keywordflow">for</span> (MapIterator it = range.first; it != range.second; ++it)<a name="l00300"></a>00300                 <span class="keywordflow">if</span> (it-&gt;second.first == &amp;destination &amp;&amp; it-&gt;second.second == outChannel)<a name="l00301"></a>00301                 {<a name="l00302"></a>00302                         m_routeMap.erase(it);<a name="l00303"></a>00303                         <span class="keywordflow">break</span>;<a name="l00304"></a>00304                 }<a name="l00305"></a>00305 }<a name="l00306"></a>00306 <a name="l00307"></a>00307 NAMESPACE_END<a name="l00308"></a>00308 <a name="l00309"></a>00309 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 1 11:11:20 2007 for Crypto++ by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -