File: a00175.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 (146 lines) | stat: -rw-r--r-- 11,852 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
<!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>Orb.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>Orb.h</h1><a href="a00115.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">//                            Package   : omniEvents</font>
00002 <font class="comment">// Orb.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__ORB_H</font>
00025 <font class="preprocessor"></font><font class="preprocessor">#define OMNIEVENTS__ORB_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">#include &lt;list&gt;</font>
00032 
00033 <font class="preprocessor">#ifdef HAVE_OMNIORB3</font>
00034 <font class="preprocessor"></font><font class="preprocessor">#  include &lt;omniORB3/CORBA.h&gt;</font>
00035 <font class="preprocessor">#endif</font>
00036 <font class="preprocessor"></font>
00037 <font class="preprocessor">#ifdef HAVE_OMNIORB4</font>
00038 <font class="preprocessor"></font><font class="preprocessor">#  include &lt;omniORB4/CORBA.h&gt;</font>
00039 <font class="preprocessor">#endif</font>
00040 <font class="preprocessor"></font>
00041 <font class="preprocessor">#ifdef HAVE_OMNIORB4</font>
00042 <font class="preprocessor"></font><font class="preprocessor">#  define IFELSE_OMNIORB4(omniORB4_code,default_code) omniORB4_code</font>
00043 <font class="preprocessor"></font><font class="preprocessor">#  define IF_OMNIORB4(omniORB4_code) omniORB4_code</font>
00044 <font class="preprocessor"></font><font class="preprocessor">#else</font>
<a name="l00045"></a><a class="code" href="a00115.html#a0">00045</a> <font class="preprocessor"></font><font class="preprocessor">#  define IFELSE_OMNIORB4(omniORB4_code,default_code) default_code</font>
<a name="l00046"></a><a class="code" href="a00115.html#a1">00046</a> <font class="preprocessor"></font><font class="preprocessor">#  define IF_OMNIORB4(omniORB4_code)</font>
00047 <font class="preprocessor"></font><font class="preprocessor">#endif</font>
00048 <font class="preprocessor"></font>
<a name="l00049"></a><a class="code" href="a00115.html#a2">00049</a> <font class="preprocessor">#define DB(l,x) \</font>
00050 <font class="preprocessor">  {if(omniORB::trace(l)){omniORB::logger log("omniEvents: ");log&lt;&lt;x&lt;&lt;"\n";}}</font>
00051 <font class="preprocessor"></font>
<a name="l00052"></a><a class="code" href="a00115.html#a3">00052</a> <font class="preprocessor">#define NP_MINORSTRING(systemException) \</font>
00053 <font class="preprocessor">  ((systemException).NP_minorString()?(systemException).NP_minorString():"??")</font>
00054 <font class="preprocessor"></font>
<a name="l00055"></a><a class="code" href="a00115.html#a4">00055</a> <font class="preprocessor">#define AS_STR_2(x) #x</font>
<a name="l00056"></a><a class="code" href="a00115.html#a5">00056</a> <font class="preprocessor"></font><font class="preprocessor">#define AS_STR_1(x) AS_STR_2(x)</font>
00057 <font class="preprocessor"></font>
<a name="l00058"></a><a class="code" href="a00115.html#a6">00058</a> <font class="preprocessor">#define HERE __FILE__ ":" AS_STR_1(__LINE__)</font>
00059 <font class="preprocessor"></font>
00060 <font class="preprocessor">#ifdef HAVE_STD_STL</font>
00061 <font class="preprocessor"></font><font class="keyword">using</font> <font class="keyword">namespace </font>std;
00062 <font class="preprocessor">#endif</font>
00063 <font class="preprocessor"></font>
00064 <font class="keyword">namespace </font>OmniEvents {
00065 
00066 <font class="keyword">class </font>Callback;
00067 
<a name="l00069"></a><a class="code" href="a00059.html">00069</a> <font class="keyword">class </font><a class="code" href="a00059.html">Orb</a>
00070 {
00071 <font class="keyword">private</font>:
00072   <font class="keyword">static</font> <a class="code" href="a00059.html">Orb</a> <a class="code" href="a00059.html#r0">_inst</a>;
<a name="l00073"></a><a class="code" href="a00059.html#u0">00073</a>   <font class="keyword">typedef</font> pair&lt;CORBA::Request_ptr,Callback*&gt; <a class="code" href="a00059.html#u0">RequestCallback_t</a>;
<a name="l00074"></a><a class="code" href="a00059.html#o0">00074</a>   list&lt;RequestCallback_t&gt; <a class="code" href="a00059.html#o0">_deferredRequests</a>;
<a name="l00075"></a><a class="code" href="a00059.html#o1">00075</a>   omni_mutex <a class="code" href="a00059.html#o1">_deferredRequestsLock</a>;
<a name="l00076"></a><a class="code" href="a00059.html#o2">00076</a>   <font class="keywordtype">bool</font> <a class="code" href="a00059.html#o2">_shutdownRequested</a>;
<a name="l00077"></a><a class="code" href="a00059.html#c0">00077</a>   <a class="code" href="a00059.html#c0">Orb</a>():<a class="code" href="a00059.html#o2">_shutdownRequested</a>(false){}
00078   <font class="keyword">friend</font> <font class="keywordtype">void</font> <a class="code" href="a00059.html#a1">OmniEvents_Orb_shutdown</a>(<font class="keywordtype">int</font>);
00079 
00080 <font class="keyword">public</font>:
<a name="l00081"></a><a class="code" href="a00059.html#d0">00081</a>   <font class="keyword">inline</font> <font class="keyword">static</font> <a class="code" href="a00059.html">Orb</a>&amp; <a class="code" href="a00059.html#d0">inst</a>()
00082   {
00083     <font class="keywordflow">return</font> _inst;
00084   }
00086   <a class="code" href="a00059.html#a0">~Orb</a>();
00087 
<a name="l00088"></a><a class="code" href="a00059.html#m0">00088</a>   CORBA::ORB_var               <a class="code" href="a00059.html#m0">_orb</a>;
<a name="l00089"></a><a class="code" href="a00059.html#m1">00089</a>   PortableServer::POA_var      <a class="code" href="a00059.html#m1">_RootPOA</a>;
<a name="l00090"></a><a class="code" href="a00059.html#m2">00090</a>   PortableServer::POA_var      <a class="code" href="a00059.html#m2">_omniINSPOA</a>;
<a name="l00091"></a><a class="code" href="a00059.html#m3">00091</a>   CosNaming::NamingContext_var <a class="code" href="a00059.html#m3">_NameService</a>;
00092 <font class="preprocessor">#ifdef HAVE_OMNIORB4</font>
00093 <font class="preprocessor"></font>  PortableServer::Current_ptr  _POACurrent;
00094 <font class="preprocessor">#endif</font>
00095 <font class="preprocessor"></font>
00097   <font class="keywordtype">void</font> <a class="code" href="a00059.html#a1">resolveInitialReferences</a>();
00098   
00103   <font class="keywordtype">void</font> <a class="code" href="a00059.html#a2">run</a>();
00104   
00109   <font class="keywordtype">void</font> <a class="code" href="a00059.html#a3">deferredRequest</a>(CORBA::Request_ptr req, <a class="code" href="a00041.html">Callback</a>* callback=NULL);
00110 
00112   <font class="keywordtype">void</font> <a class="code" href="a00059.html#a4">cancelCallback</a>(<font class="keyword">const</font> <a class="code" href="a00041.html">Callback</a>* callback);
00113 
00117   <font class="keywordtype">void</font> <a class="code" href="a00059.html#a5">reportObjectFailure</a>(
00118     <font class="keyword">const</font> <font class="keywordtype">char</font>*       here,
00119     CORBA::Object_ptr obj,
00120     CORBA::Exception* ex
00121   );
00122 
<a name="l00126"></a><a class="code" href="a00059.html#a6">00126</a>   <font class="keywordtype">void</font> <a class="code" href="a00059.html#a6">shutdown</a>(<font class="keywordtype">int</font>) { <a class="code" href="a00059.html#o2">_shutdownRequested</a>=<font class="keyword">true</font>; }
00127 }; <font class="comment">// end class Orb</font>
00128 
00129 
00131 <font class="keyword">template</font>&lt;<font class="keyword">class</font> T&gt;
<a name="l00132"></a><a class="code" href="a00138.html#a8">00132</a> <font class="keyword">typename</font> T::_ptr_type <a class="code" href="a00138.html#a8">string_to_</a>(<font class="keyword">const</font> <font class="keywordtype">char</font>* oidStr)
00133 {
00134   CORBA::Object_var obj =Orb::inst()._orb-&gt;string_to_object(oidStr);
00135   <font class="keywordflow">if</font>(CORBA::is_nil(obj.in()))
00136     <font class="keywordflow">throw</font> CORBA::BAD_PARAM();
00137 
00138 <font class="preprocessor">#ifdef HAVE_OMNIORB4</font>
00139 <font class="preprocessor"></font>  <font class="keyword">typename</font> T::_var_type result =T::_unchecked_narrow(obj);
00140 <font class="preprocessor">#else</font>
00141 <font class="preprocessor"></font>  <font class="keyword">typename</font> T::_var_type result =T::_narrow(obj);
00142 <font class="preprocessor">#endif</font>
00143 <font class="preprocessor"></font>  <font class="keywordflow">if</font>(CORBA::is_nil(result.in()))
00144     <font class="keywordflow">throw</font> CORBA::BAD_PARAM();
00145 
00146   <font class="keywordflow">return</font> result._retn();
00147 }
00148 
00149 }; <font class="comment">// end namespace OmniEvents</font>
00150 
00151 <font class="preprocessor">#endif // OMNIEVENTS__ORB_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>