File: a00157.html

package info (click to toggle)
omnievents 1%3A2.6.2-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 9,004 kB
  • ctags: 14,867
  • sloc: cpp: 7,676; python: 3,138; sh: 2,575; xml: 2,057; java: 1,409; makefile: 317; ansic: 9
file content (151 lines) | stat: -rw-r--r-- 16,662 bytes parent folder | download | duplicates (6)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>OmniEvents: EventChannel.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.3-20050530 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">src</a></div>
<h1>EventChannel.h</h1><a href="a00094.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//                            Package   : omniEvents</span>
<a name="l00002"></a>00002 <span class="comment">// EventsChannel.h            Created   : 2003/12/04</span>
<a name="l00003"></a>00003 <span class="comment">//                            Author    : Alex Tingle</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">//    Copyright (C) 2003-2005 Alex Tingle.</span>
<a name="l00006"></a>00006 <span class="comment">//</span>
<a name="l00007"></a>00007 <span class="comment">//    This file is part of the omniEvents application.</span>
<a name="l00008"></a>00008 <span class="comment">//</span>
<a name="l00009"></a>00009 <span class="comment">//    omniEvents is free software; you can redistribute it and/or</span>
<a name="l00010"></a>00010 <span class="comment">//    modify it under the terms of the GNU Lesser General Public</span>
<a name="l00011"></a>00011 <span class="comment">//    License as published by the Free Software Foundation; either</span>
<a name="l00012"></a>00012 <span class="comment">//    version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment">//</span>
<a name="l00014"></a>00014 <span class="comment">//    omniEvents is distributed in the hope that it will be useful,</span>
<a name="l00015"></a>00015 <span class="comment">//    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00016"></a>00016 <span class="comment">//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00017"></a>00017 <span class="comment">//    Lesser General Public License for more details.</span>
<a name="l00018"></a>00018 <span class="comment">//</span>
<a name="l00019"></a>00019 <span class="comment">//    You should have received a copy of the GNU Lesser General Public</span>
<a name="l00020"></a>00020 <span class="comment">//    License along with this library; if not, write to the Free Software</span>
<a name="l00021"></a>00021 <span class="comment">//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
<a name="l00022"></a>00022 <span class="comment">//</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef OMNIEVENTS__EVENTCHANNEL_H</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define OMNIEVENTS__EVENTCHANNEL_H</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#  include "<a class="code" href="a00083.html">config.h</a>"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#ifdef HAVE_IOSTREAM</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#  include &lt;iostream&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#else</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#  include &lt;iostream.h&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#endif</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span>
<a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="a00136.html">Servant.h</a>"</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include "<a class="code" href="a00118.html">PersistNode.h</a>"</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include "omniEvents.hh"</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include "<a class="code" href="a00108.html">Mapper.h</a>"</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include "<a class="code" href="a00091.html">defaults.h</a>"</span>
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;set&gt;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="preprocessor">#ifdef HAVE_STD_IOSTREAM</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="keyword">using</span> <span class="keyword">namespace </span>std;
<a name="l00048"></a>00048 <span class="preprocessor">#endif</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span>
<a name="l00050"></a>00050 <span class="keyword">namespace </span>OmniEvents {
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="keyword">class </span>SupplierAdmin_i;
<a name="l00053"></a>00053 <span class="keyword">class </span>ConsumerAdmin_i;
<a name="l00054"></a>00054 <span class="keyword">class </span>EventChannelStore;
<a name="l00055"></a>00055 
<a name="l00111"></a><a class="code" href="a00046.html">00111</a> <span class="keyword">class </span><a class="code" href="a00046.html">EventChannel_i</a>
<a name="l00112"></a>00112 : <span class="keyword">public</span> POA_omniEvents::EventChannel,
<a name="l00113"></a>00113   <span class="keyword">public</span> <a class="code" href="a00073.html">Servant</a>,
<a name="l00114"></a>00114   <span class="keyword">public</span> omni_thread
<a name="l00115"></a>00115 {
<a name="l00116"></a>00116 <span class="keyword">public</span>: <span class="comment">// CORBA interface methods</span>
<a name="l00117"></a>00117   CosEventChannelAdmin::ConsumerAdmin_ptr <a class="code" href="a00046.html#a0">for_consumers</a>();
<a name="l00118"></a>00118   CosEventChannelAdmin::SupplierAdmin_ptr <a class="code" href="a00046.html#a1">for_suppliers</a>();
<a name="l00119"></a>00119   <span class="keywordtype">void</span> <a class="code" href="a00046.html#a2">destroy</a>();
<a name="l00121"></a><a class="code" href="a00046.html#a3">00121</a>   CORBA::Boolean <a class="code" href="a00046.html#a3">is_alive</a>() { <span class="keywordflow">return</span> 1; }
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="keyword">public</span>:
<a name="l00124"></a>00124   <a class="code" href="a00046.html#a4">EventChannel_i</a>(<a class="code" href="a00048.html">EventChannelStore</a>* store=NULL);
<a name="l00125"></a>00125 
<a name="l00127"></a>00127   <a class="code" href="a00046.html#a5">~EventChannel_i</a>();
<a name="l00128"></a>00128 
<a name="l00132"></a>00132   <span class="keywordtype">void</span> <a class="code" href="a00046.html#a6">activate</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* channelName, <span class="keyword">const</span> <a class="code" href="a00060.html">PersistNode</a>* node =NULL);
<a name="l00133"></a>00133 
<a name="l00135"></a><a class="code" href="a00046.html#a7">00135</a>   <span class="keywordtype">void</span> <a class="code" href="a00046.html#a7">start</a>(){<a class="code" href="a00116.html#a2">DB</a>(0,<span class="stringliteral">"It is no longer necessary to call EventChannel::start()."</span>)}
<a name="l00136"></a>00136 
<a name="l00141"></a>00141   <span class="keywordtype">void</span>* <a class="code" href="a00046.html#a8">run_undetached</a>(<span class="keywordtype">void</span>*);
<a name="l00142"></a>00142 
<a name="l00159"></a>00159   <span class="keywordtype">void</span> <a class="code" href="a00046.html#a9">mainLoop</a>();
<a name="l00160"></a>00160 
<a name="l00161"></a>00161   <span class="keywordtype">void</span> <a class="code" href="a00046.html#a10">_add_ref</a>();
<a name="l00162"></a>00162   <span class="keywordtype">void</span> <a class="code" href="a00046.html#a11">_remove_ref</a>(); 
<a name="l00163"></a>00163   
<a name="l00164"></a>00164   <span class="keywordtype">void</span> <a class="code" href="a00046.html#a12">output</a>(ostream&amp; os);
<a name="l00165"></a>00165 
<a name="l00166"></a>00166   <span class="comment">//</span>
<a name="l00167"></a>00167   <span class="comment">// Accessors</span>
<a name="l00168"></a><a class="code" href="a00046.html#a13">00168</a>   <a class="code" href="a00043.html">ConsumerAdmin_i</a>&amp; <a class="code" href="a00046.html#a13">consumerAdmin</a>()<span class="keyword"> const</span>
<a name="l00169"></a>00169 <span class="keyword">    </span>{assert(<a class="code" href="a00046.html#r2">_consumerAdmin</a>!=NULL);<span class="keywordflow">return</span> *<a class="code" href="a00046.html#r2">_consumerAdmin</a>;}
<a name="l00170"></a><a class="code" href="a00046.html#a14">00170</a>   <span class="keyword">const</span> <a class="code" href="a00060.html">PersistNode</a>&amp; <a class="code" href="a00046.html#a14">properties</a>()<span class="keyword"> const</span>
<a name="l00171"></a>00171 <span class="keyword">    </span>{<span class="keywordflow">return</span> <a class="code" href="a00046.html#r5">_properties</a>;}
<a name="l00172"></a>00172 
<a name="l00173"></a>00173   <span class="comment">//</span>
<a name="l00174"></a>00174   <span class="comment">// Values stored in _properties member.</span>
<a name="l00175"></a><a class="code" href="a00046.html#a15">00175</a>   CORBA::ULong  <a class="code" href="a00046.html#a15">pullRetryPeriod_ms</a>()<span class="keyword"> const</span>
<a name="l00176"></a>00176 <span class="keyword">    </span>{<span class="keywordflow">return</span> <a class="code" href="a00046.html#r5">_properties</a>.<a class="code" href="a00060.html#a12">attrLong</a>(<span class="stringliteral">"PullRetryPeriod_ms"</span>,<a class="code" href="a00091.html#a0">PULL_RETRY_PERIOD_MS</a>);}
<a name="l00177"></a><a class="code" href="a00046.html#a16">00177</a>   CORBA::ULong  <a class="code" href="a00046.html#a16">maxQueueLength</a>()<span class="keyword"> const</span>
<a name="l00178"></a>00178 <span class="keyword">    </span>{<span class="keywordflow">return</span> <a class="code" href="a00046.html#r5">_properties</a>.<a class="code" href="a00060.html#a12">attrLong</a>(<span class="stringliteral">"MaxQueueLength"</span>,<a class="code" href="a00091.html#a1">MAX_QUEUE_LENGTH</a>);}
<a name="l00179"></a><a class="code" href="a00046.html#a17">00179</a>   CORBA::ULong  <a class="code" href="a00046.html#a17">maxNumProxies</a>()<span class="keyword"> const</span>
<a name="l00180"></a>00180 <span class="keyword">    </span>{<span class="keywordflow">return</span> <a class="code" href="a00046.html#r5">_properties</a>.<a class="code" href="a00060.html#a12">attrLong</a>(<span class="stringliteral">"MaxNumProxies"</span>,<a class="code" href="a00091.html#a2">MAX_NUM_PROXIES</a>);}
<a name="l00181"></a><a class="code" href="a00046.html#a18">00181</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="a00046.html#a18">cyclePeriod_ns</a>()<span class="keyword"> const</span>
<a name="l00182"></a>00182 <span class="keyword">    </span>{<span class="keywordflow">return</span> <a class="code" href="a00046.html#r5">_properties</a>.<a class="code" href="a00060.html#a12">attrLong</a>(<span class="stringliteral">"CyclePeriod_ns"</span>,<a class="code" href="a00091.html#a3">CYCLE_PERIOD_NS</a>);}
<a name="l00183"></a>00183   
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 <span class="keyword">private</span>:
<a name="l00187"></a>00187   <span class="keywordtype">void</span> <a class="code" href="a00046.html#d0">setInsName</a>(<span class="keyword">const</span> string v);
<a name="l00188"></a>00188 
<a name="l00193"></a>00193   <span class="keywordtype">void</span> <a class="code" href="a00046.html#d1">createPoa</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* channelName);
<a name="l00194"></a>00194   
<a name="l00195"></a>00195 <span class="keyword">private</span>:
<a name="l00196"></a><a class="code" href="a00046.html#r0">00196</a>   <a class="code" href="a00048.html">EventChannelStore</a>*             <a class="code" href="a00046.html#r0">_eventChannelStore</a>;
<a name="l00197"></a><a class="code" href="a00046.html#r1">00197</a>   <a class="code" href="a00076.html">SupplierAdmin_i</a>*               <a class="code" href="a00046.html#r1">_supplierAdmin</a>;
<a name="l00198"></a><a class="code" href="a00046.html#r2">00198</a>   <a class="code" href="a00043.html">ConsumerAdmin_i</a>*               <a class="code" href="a00046.html#r2">_consumerAdmin</a>;
<a name="l00199"></a><a class="code" href="a00046.html#r3">00199</a>   PortableServer::POAManager_var <a class="code" href="a00046.html#r3">_poaManager</a>;
<a name="l00200"></a><a class="code" href="a00046.html#r4">00200</a>   <span class="keywordtype">bool</span>                           <a class="code" href="a00046.html#r4">_shutdownRequested</a>;
<a name="l00201"></a><a class="code" href="a00046.html#r5">00201</a>   <a class="code" href="a00060.html">PersistNode</a>                    <a class="code" href="a00046.html#r5">_properties</a>;
<a name="l00202"></a><a class="code" href="a00046.html#r6">00202</a>   <a class="code" href="a00054.html">Mapper</a>*                        <a class="code" href="a00046.html#r6">_mapper</a>;
<a name="l00203"></a><a class="code" href="a00046.html#r7">00203</a>   omni_mutex                     <a class="code" href="a00046.html#r7">_lock</a>; <span class="comment">//&lt; Protects _refCount</span>
<a name="l00204"></a><a class="code" href="a00046.html#r8">00204</a>   <span class="keywordtype">int</span>                            <a class="code" href="a00046.html#r8">_refCount</a>;
<a name="l00205"></a>00205 };
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 
<a name="l00209"></a><a class="code" href="a00048.html">00209</a> <span class="keyword">class </span><a class="code" href="a00048.html">EventChannelStore</a>
<a name="l00210"></a>00210 {
<a name="l00211"></a>00211 <span class="keyword">public</span>:
<a name="l00212"></a>00212   <a class="code" href="a00048.html#a0">EventChannelStore</a>();
<a name="l00213"></a>00213   <a class="code" href="a00048.html#a1">~EventChannelStore</a>();
<a name="l00214"></a>00214   <span class="keywordtype">void</span> <a class="code" href="a00048.html#a2">insert</a>(<a class="code" href="a00046.html">EventChannel_i</a>* channel);
<a name="l00215"></a>00215   <span class="keywordtype">void</span> <a class="code" href="a00048.html#a3">erase</a>(<a class="code" href="a00046.html">EventChannel_i</a>* channel);
<a name="l00216"></a>00216   <span class="keywordtype">void</span> <a class="code" href="a00048.html#a4">output</a>(ostream &amp;os);
<a name="l00217"></a>00217 <span class="keyword">private</span>:
<a name="l00218"></a><a class="code" href="a00048.html#r0">00218</a>   set&lt;EventChannel_i*&gt; <a class="code" href="a00048.html#r0">_channels</a>;
<a name="l00219"></a><a class="code" href="a00048.html#r1">00219</a>   omni_mutex           <a class="code" href="a00048.html#r1">_lock</a>;
<a name="l00220"></a>00220 };
<a name="l00221"></a>00221 
<a name="l00222"></a>00222 }; <span class="comment">// end namespace OmniEvents</span>
<a name="l00223"></a>00223 
<a name="l00224"></a>00224 <span class="preprocessor">#endif // OMNIEVENTS__EVENTCHANNEL_H</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Aug 26 20:56:14 2005 for OmniEvents by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.3-20050530 </small></address>
</body>
</html>