File: a00187.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 (157 lines) | stat: -rw-r--r-- 11,904 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
145
146
147
148
149
150
151
152
153
154
155
156
157
<!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>ProxyPushSupplier.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>ProxyPushSupplier.h</h1><a href="a00127.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">//                            Package   : omniEvents</font>
00002 <font class="comment">// ProxyPushSupplier.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__PROXYPUSHSUPPLIER_H</font>
00025 <font class="preprocessor"></font><font class="preprocessor">#define OMNIEVENTS__PROXYPUSHSUPPLIER_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="a00081.html">Callback.h</a>"</font>
00038 <font class="preprocessor">#include "<a class="code" href="a00098.html">EventQueue.h</a>"</font>
00039 <font class="preprocessor">#include "<a class="code" href="a00119.html">ProxyManager.h</a>"</font>
00040 
00041 <font class="preprocessor">#include "CosEventChannelAdmin.hh"</font>
00042 
00043 <font class="preprocessor">#ifdef HAVE_STD_IOSTREAM</font>
00044 <font class="preprocessor"></font><font class="keyword">using</font> <font class="keyword">namespace </font>std;
00045 <font class="preprocessor">#endif</font>
00046 <font class="preprocessor"></font>
00047 <font class="keyword">namespace </font>OmniEvents {
00048 
<a name="l00049"></a><a class="code" href="a00070.html">00049</a> <font class="keyword">class </font><a class="code" href="a00070.html">ProxyPushSupplierManager</a>
00050 : <font class="keyword">public</font> <a class="code" href="a00062.html">ProxyManager</a>,
00051   <font class="keyword">public</font> omni_thread
00052 {
00053 <font class="keyword">public</font>: <font class="comment">// CORBA interface methods</font>
00054   PortableServer::Servant <a class="code" href="a00070.html#a0">incarnate</a>(
00055     <font class="keyword">const</font> PortableServer::ObjectId&amp; oid,
00056     PortableServer::POA_ptr         poa
00057   );
00059   <font class="keywordtype">void</font> <a class="code" href="a00070.html#a1">etherealize</a>(
00060     <font class="keyword">const</font> PortableServer::ObjectId&amp; oid,
00061     PortableServer::POA_ptr         adapter,
00062     PortableServer::Servant         serv,
00063     CORBA::Boolean                  cleanup_in_progress,
00064     CORBA::Boolean                  remaining_activations
00065   );
00066 <font class="keyword">public</font>:
00067   <a class="code" href="a00070.html#a2">ProxyPushSupplierManager</a>(PortableServer::POA_ptr parentPoa,<a class="code" href="a00049.html">EventQueue</a>&amp; q);
00068   <a class="code" href="a00070.html#a3">~ProxyPushSupplierManager</a>();
00069   CosEventChannelAdmin::ProxyPushSupplier_ptr <a class="code" href="a00070.html#a4">createObject</a>();
00070 
00072   <font class="keywordtype">void</font> <a class="code" href="a00070.html#a5">disconnect</a>();
00073 
00074   <font class="keywordtype">void</font> <a class="code" href="a00070.html#a6">run</a>(<font class="keywordtype">void</font>*);
00075   <font class="keywordtype">void</font> <a class="code" href="a00070.html#a7">_add_ref</a>();
00076   <font class="keywordtype">void</font> <a class="code" href="a00070.html#a8">_remove_ref</a>(); 
00077 
<a name="l00078"></a><a class="code" href="a00070.html#m0">00078</a>   omni_mutex     <a class="code" href="a00070.html#m0">_lock</a>;
<a name="l00079"></a><a class="code" href="a00070.html#m1">00079</a>   omni_condition <a class="code" href="a00070.html#m1">_condition</a>;
00080 
<a name="l00085"></a><a class="code" href="a00071.html">00085</a>   <font class="keyword">class </font><a class="code" href="a00071.html">PauseThenWake</a>
00086   {
<a name="l00087"></a><a class="code" href="a00071.html#o0">00087</a>     <a class="code" href="a00070.html">ProxyPushSupplierManager</a>* <a class="code" href="a00071.html#o0">_p</a>;
00088     <a class="code" href="a00071.html#c1">PauseThenWake</a>(<font class="keyword">const</font> <a class="code" href="a00071.html">PauseThenWake</a>&amp;); 
00089     <a class="code" href="a00071.html#c1">PauseThenWake</a>(); 
00090   <font class="keyword">public</font>:
00091     <font class="keyword">inline</font> <a class="code" href="a00071.html#c1">PauseThenWake</a>(<a class="code" href="a00070.html">ProxyPushSupplierManager</a>* p);
00092     <font class="keyword">inline</font> <a class="code" href="a00071.html#a1">~PauseThenWake</a>();
00093   };
00094 
00095 <font class="keyword">private</font>:
<a name="l00096"></a><a class="code" href="a00070.html#o0">00096</a>   <a class="code" href="a00049.html">EventQueue</a>&amp;    <a class="code" href="a00070.html#o0">_queue</a>;
<a name="l00097"></a><a class="code" href="a00070.html#o1">00097</a>   <font class="keywordtype">int</font>            <a class="code" href="a00070.html#o1">_refCount</a>;
00098 };
00099 
00100 
<a name="l00101"></a><a class="code" href="a00069.html">00101</a> <font class="keyword">class </font><a class="code" href="a00069.html">ProxyPushSupplier_i</a>
00102 : <font class="keyword">public</font> <font class="keyword">virtual</font> POA_CosEventChannelAdmin::ProxyPushSupplier,
00103   <font class="keyword">public</font> <a class="code" href="a00061.html">Proxy</a>,
00104   <font class="keyword">public</font> <a class="code" href="a00049.html">EventQueue</a>::Reader,
00105   <font class="keyword">public</font> <a class="code" href="a00041.html">Callback</a>
00106 {
00107 <font class="keyword">public</font>: <font class="comment">// CORBA interface methods</font>
00108   <font class="keywordtype">void</font> <a class="code" href="a00069.html#a0">connect_push_consumer</a>(CosEventComm::PushConsumer_ptr pushConsumer);
00109   <font class="keywordtype">void</font> <a class="code" href="a00069.html#a1">disconnect_push_supplier</a>();
00110 <font class="keyword">public</font>:
00111   <a class="code" href="a00069.html#a2">ProxyPushSupplier_i</a>(PortableServer::POA_ptr poa, <a class="code" href="a00049.html">EventQueue</a>&amp; q);
00112   <a class="code" href="a00069.html#a3">~ProxyPushSupplier_i</a>();
00113 
00117   <font class="keyword">inline</font> <font class="keywordtype">void</font> <a class="code" href="a00069.html#a4">trigger</a>(<font class="keywordtype">bool</font>&amp; busy, <font class="keywordtype">bool</font>&amp; waiting);
00118 
00120   <font class="keywordtype">void</font> <a class="code" href="a00069.html#a5">callback</a>(CORBA::Request_ptr req);
00121   <font class="keywordtype">void</font> <a class="code" href="a00069.html#a6">reincarnate</a>(<font class="keyword">const</font> string&amp; oid, <font class="keyword">const</font> <a class="code" href="a00060.html">PersistNode</a>&amp; node);
00122   <font class="keywordtype">void</font> <a class="code" href="a00069.html#a7">output</a>(ostream &amp;os);
00123 <font class="keyword">private</font>:
<a name="l00124"></a><a class="code" href="a00069.html#o0">00124</a>   CosEventComm::PushConsumer::_var_type <a class="code" href="a00069.html#o0">_target</a>;
<a name="l00125"></a><a class="code" href="a00069.html#o1">00125</a>   <font class="keywordtype">bool</font> <a class="code" href="a00069.html#o1">_targetIsProxy</a>; 
00126 };
00127 
00128 
00129 <font class="comment">//</font>
00130 <font class="comment">// Inline Implementations.</font>
00131 <font class="comment">//</font>
00132 
<a name="l00133"></a><a class="code" href="a00071.html#a0">00133</a> <font class="keyword">inline</font> ProxyPushSupplierManager::PauseThenWake::PauseThenWake(
00134   <a class="code" href="a00070.html">ProxyPushSupplierManager</a>* p
00135 ):_p(p)
00136 {
00137   <font class="keywordflow">if</font>(_p)
00138      <a class="code" href="a00071.html#o0">_p</a>-&gt;<a class="code" href="a00070.html#m0">_lock</a>.lock();
00139 }
00140 
<a name="l00141"></a><a class="code" href="a00071.html#a1">00141</a> <font class="keyword">inline</font> ProxyPushSupplierManager::PauseThenWake::~PauseThenWake()
00142 {
00143   <font class="keywordflow">if</font>(_p)
00144   {
00145     <a class="code" href="a00071.html#o0">_p</a>-&gt;<a class="code" href="a00070.html#m0">_lock</a>.unlock();
00146     <a class="code" href="a00071.html#o0">_p</a>-&gt;<a class="code" href="a00070.html#m1">_condition</a>.signal(); <font class="comment">// Wake up the thread if it's asleep.</font>
00147   }
00148 }
00149 
00150 
00151 }; <font class="comment">// end namespace OmniEvents</font>
00152 
00153 <font class="preprocessor">#endif // OMNIEVENTS__PROXYPUSHSUPPLIER_H</font>
</pre></div><hr><address align="right"><small>Generated on Fri Nov 19 17:42:21 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>