File: a00153.html

package info (click to toggle)
omnievents 2.6.1-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,228 kB
  • ctags: 2,538
  • sloc: cpp: 7,346; sh: 2,568; python: 2,171; xml: 2,057; java: 1,407; makefile: 304; ansic: 9
file content (144 lines) | stat: -rw-r--r-- 13,055 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>EventChannel.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="main.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>EventChannel.h</h1><a href="a00093.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">//                            Package   : omniEvents</font>
00002 <font class="comment">// EventsChannel.h            Created   : 2003/12/04</font>
00003 <font class="comment">//                            Author    : Alex Tingle</font>
00004 <font class="comment">//</font>
00005 <font class="comment">//    Copyright (C) 2003 Alex Tingle.</font>
00006 <font class="comment">//</font>
00007 <font class="comment">//    This file is part of the omniEvents application.</font>
00008 <font class="comment">//</font>
00009 <font class="comment">//    omniEvents is free software; you can redistribute it and/or</font>
00010 <font class="comment">//    modify it under the terms of the GNU Lesser General Public</font>
00011 <font class="comment">//    License as published by the Free Software Foundation; either</font>
00012 <font class="comment">//    version 2.1 of the License, or (at your option) any later version.</font>
00013 <font class="comment">//</font>
00014 <font class="comment">//    omniEvents is distributed in the hope that it will be useful,</font>
00015 <font class="comment">//    but WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00016 <font class="comment">//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</font>
00017 <font class="comment">//    Lesser General Public License for more details.</font>
00018 <font class="comment">//</font>
00019 <font class="comment">//    You should have received a copy of the GNU Lesser General Public</font>
00020 <font class="comment">//    License along with this library; if not, write to the Free Software</font>
00021 <font class="comment">//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</font>
00022 <font class="comment">//</font>
00023 
00024 <font class="preprocessor">#ifndef OMNIEVENTS__EVENTCHANNEL_H</font>
00025 <font class="preprocessor"></font><font class="preprocessor">#define OMNIEVENTS__EVENTCHANNEL_H</font>
00026 <font class="preprocessor"></font>
00027 <font class="preprocessor">#ifdef HAVE_CONFIG_H</font>
00028 <font class="preprocessor"></font><font class="preprocessor">#  include "<a class="code" href="a00082.html">config.h</a>"</font>
00029 <font class="preprocessor">#endif</font>
00030 <font class="preprocessor"></font>
00031 <font class="preprocessor">#ifdef HAVE_IOSTREAM</font>
00032 <font class="preprocessor"></font><font class="preprocessor">#  include &lt;iostream&gt;</font>
00033 <font class="preprocessor">#else</font>
00034 <font class="preprocessor"></font><font class="preprocessor">#  include &lt;iostream.h&gt;</font>
00035 <font class="preprocessor">#endif</font>
00036 <font class="preprocessor"></font>
00037 <font class="preprocessor">#include "<a class="code" href="a00135.html">Servant.h</a>"</font>
00038 <font class="preprocessor">#include "<a class="code" href="a00117.html">PersistNode.h</a>"</font>
00039 <font class="preprocessor">#include "omniEvents.hh"</font>
00040 <font class="preprocessor">#include "<a class="code" href="a00107.html">Mapper.h</a>"</font>
00041 <font class="preprocessor">#include "<a class="code" href="a00090.html">defaults.h</a>"</font>
00042 
00043 <font class="preprocessor">#include &lt;set&gt;</font>
00044 <font class="preprocessor">#include &lt;assert.h&gt;</font>
00045 
00046 <font class="preprocessor">#ifdef HAVE_STD_IOSTREAM</font>
00047 <font class="preprocessor"></font><font class="keyword">using</font> <font class="keyword">namespace </font>std;
00048 <font class="preprocessor">#endif</font>
00049 <font class="preprocessor"></font>
00050 <font class="keyword">namespace </font>OmniEvents {
00051 
00052 <font class="keyword">class </font>SupplierAdmin_i;
00053 <font class="keyword">class </font>ConsumerAdmin_i;
00054 <font class="keyword">class </font>EventChannelStore;
00055 
<a name="l00107"></a><a class="code" href="a00046.html">00107</a> <font class="keyword">class </font><a class="code" href="a00046.html">EventChannel_i</a>
00108 : <font class="keyword">public</font> POA_omniEvents::EventChannel,
00109   <font class="keyword">public</font> <a class="code" href="a00073.html">Servant</a>,
00110   <font class="keyword">public</font> omni_thread
00111 {
00112 <font class="keyword">public</font>: <font class="comment">// CORBA interface methods</font>
00113   CosEventChannelAdmin::ConsumerAdmin_ptr <a class="code" href="a00046.html#a0">for_consumers</a>();
00114   CosEventChannelAdmin::SupplierAdmin_ptr <a class="code" href="a00046.html#a1">for_suppliers</a>();
00115   <font class="keywordtype">void</font> <a class="code" href="a00046.html#a2">destroy</a>();
<a name="l00117"></a><a class="code" href="a00046.html#a3">00117</a>   CORBA::Boolean <a class="code" href="a00046.html#a3">is_alive</a>() { <font class="keywordflow">return</font> 1; }
00118 
00119 <font class="keyword">public</font>:
00120   <a class="code" href="a00046.html#a4">EventChannel_i</a>(EventChannelStore* store=NULL);
00121 
00123   <a class="code" href="a00046.html#a5">~EventChannel_i</a>();
00124 
00128   <font class="keywordtype">void</font> <a class="code" href="a00046.html#a6">activate</a>(<font class="keyword">const</font> <font class="keywordtype">char</font>* channelName, <font class="keyword">const</font> PersistNode* node =NULL);
00129 
00134   <font class="keywordtype">void</font> <a class="code" href="a00046.html#a7">run</a>(<font class="keywordtype">void</font>* arg);
00135 
00152   <font class="keywordtype">void</font> <a class="code" href="a00046.html#a8">mainLoop</a>();
00153   
00154   <font class="keywordtype">void</font> <a class="code" href="a00046.html#a9">output</a>(ostream&amp; os);
00155 
00156   <font class="comment">//</font>
00157   <font class="comment">// Accessors</font>
<a name="l00158"></a><a class="code" href="a00046.html#a10">00158</a>   <a class="code" href="a00043.html">ConsumerAdmin_i</a>&amp; <a class="code" href="a00046.html#a10">consumerAdmin</a>()<font class="keyword"> const</font>
00159 <font class="keyword">    </font>{assert(<a class="code" href="a00046.html#o2">_consumerAdmin</a>!=NULL);<font class="keywordflow">return</font> *<a class="code" href="a00046.html#o2">_consumerAdmin</a>;}
<a name="l00160"></a><a class="code" href="a00046.html#a11">00160</a>   <font class="keyword">const</font> <a class="code" href="a00060.html">PersistNode</a>&amp; <a class="code" href="a00046.html#a11">properties</a>()<font class="keyword"> const</font>
00161 <font class="keyword">    </font>{<font class="keywordflow">return</font> <a class="code" href="a00046.html#o5">_properties</a>;}
00162 
00163   <font class="comment">//</font>
00164   <font class="comment">// Values stored in _properties member.</font>
<a name="l00165"></a><a class="code" href="a00046.html#a12">00165</a>   CORBA::ULong  <a class="code" href="a00046.html#a12">pullRetryPeriod_ms</a>()<font class="keyword"> const</font>
00166 <font class="keyword">    </font>{<font class="keywordflow">return</font> <a class="code" href="a00046.html#o5">_properties</a>.<a class="code" href="a00060.html#a12">attrLong</a>(<font class="stringliteral">"PullRetryPeriod_ms"</font>,<a class="code" href="a00090.html#a0">PULL_RETRY_PERIOD_MS</a>);}
<a name="l00167"></a><a class="code" href="a00046.html#a13">00167</a>   CORBA::ULong  <a class="code" href="a00046.html#a13">maxQueueLength</a>()<font class="keyword"> const</font>
00168 <font class="keyword">    </font>{<font class="keywordflow">return</font> <a class="code" href="a00046.html#o5">_properties</a>.<a class="code" href="a00060.html#a12">attrLong</a>(<font class="stringliteral">"MaxQueueLength"</font>,<a class="code" href="a00090.html#a1">MAX_QUEUE_LENGTH</a>);}
<a name="l00169"></a><a class="code" href="a00046.html#a14">00169</a>   CORBA::ULong  <a class="code" href="a00046.html#a14">maxNumProxies</a>()<font class="keyword"> const</font>
00170 <font class="keyword">    </font>{<font class="keywordflow">return</font> <a class="code" href="a00046.html#o5">_properties</a>.<a class="code" href="a00060.html#a12">attrLong</a>(<font class="stringliteral">"MaxNumProxies"</font>,<a class="code" href="a00090.html#a2">MAX_NUM_PROXIES</a>);}
<a name="l00171"></a><a class="code" href="a00046.html#a15">00171</a>   <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> <a class="code" href="a00046.html#a15">cyclePeriod_ns</a>()<font class="keyword"> const</font>
00172 <font class="keyword">    </font>{<font class="keywordflow">return</font> <a class="code" href="a00046.html#o5">_properties</a>.<a class="code" href="a00060.html#a12">attrLong</a>(<font class="stringliteral">"CyclePeriod_ns"</font>,<a class="code" href="a00090.html#a3">CYCLE_PERIOD_NS</a>);}
00173   
00174 
00175 <font class="keyword">private</font>:
00177   <font class="keywordtype">void</font> <a class="code" href="a00046.html#c0">setInsName</a>(<font class="keyword">const</font> string v);
00178 
00183   <font class="keywordtype">void</font> <a class="code" href="a00046.html#c1">createPoa</a>(<font class="keyword">const</font> <font class="keywordtype">char</font>* channelName);
00184   
00185 <font class="keyword">private</font>:
<a name="l00186"></a><a class="code" href="a00046.html#o0">00186</a>   <a class="code" href="a00048.html">EventChannelStore</a>*             <a class="code" href="a00046.html#o0">_eventChannelStore</a>;
<a name="l00187"></a><a class="code" href="a00046.html#o1">00187</a>   <a class="code" href="a00076.html">SupplierAdmin_i</a>*               <a class="code" href="a00046.html#o1">_supplierAdmin</a>;
<a name="l00188"></a><a class="code" href="a00046.html#o2">00188</a>   <a class="code" href="a00043.html">ConsumerAdmin_i</a>*               <a class="code" href="a00046.html#o2">_consumerAdmin</a>;
<a name="l00189"></a><a class="code" href="a00046.html#o3">00189</a>   PortableServer::POAManager_var <a class="code" href="a00046.html#o3">_poaManager</a>;
<a name="l00190"></a><a class="code" href="a00046.html#o4">00190</a>   <font class="keywordtype">bool</font>                           <a class="code" href="a00046.html#o4">_shutdownRequested</a>;
<a name="l00191"></a><a class="code" href="a00046.html#o5">00191</a>   <a class="code" href="a00060.html">PersistNode</a>                    <a class="code" href="a00046.html#o5">_properties</a>;
<a name="l00192"></a><a class="code" href="a00046.html#o6">00192</a>   <a class="code" href="a00054.html">Mapper</a>*                        <a class="code" href="a00046.html#o6">_mapper</a>;
00193 };
00194 
00195 
<a name="l00197"></a><a class="code" href="a00048.html">00197</a> <font class="keyword">class </font><a class="code" href="a00048.html">EventChannelStore</a>
00198 {
00199 <font class="keyword">public</font>:
00200   <a class="code" href="a00048.html#a0">EventChannelStore</a>();
00201   <a class="code" href="a00048.html#a1">~EventChannelStore</a>();
00202   <font class="keywordtype">void</font> <a class="code" href="a00048.html#a2">insert</a>(<a class="code" href="a00046.html">EventChannel_i</a>* channel);
00203   <font class="keywordtype">void</font> <a class="code" href="a00048.html#a3">erase</a>(<a class="code" href="a00046.html">EventChannel_i</a>* channel);
00204   <font class="keywordtype">void</font> <a class="code" href="a00048.html#a4">output</a>(ostream &amp;os);
00205 <font class="keyword">private</font>:
<a name="l00206"></a><a class="code" href="a00048.html#o0">00206</a>   set&lt;EventChannel_i*&gt; <a class="code" href="a00048.html#o0">_channels</a>;
<a name="l00207"></a><a class="code" href="a00048.html#o1">00207</a>   omni_mutex           <a class="code" href="a00048.html#o1">_lock</a>;
00208 };
00209 
00210 }; <font class="comment">// end namespace OmniEvents</font>
00211 
00212 <font class="preprocessor">#endif // OMNIEVENTS__EVENTCHANNEL_H</font>
</pre></div><hr><address align="right"><small>Generated on Fri Nov 19 17:42:20 2004 for OmniEvents by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.15 </small></address>
</body>
</html>