1 /*----------------------------------------------------------------------------
  2 Name:      CompatibleCorba.h
  3 Project:   xmlBlaster.org
  4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
  5 Comment:   Helper header to encapsulate all corba-implementor specific stuff
  6 Author:    <Michele Laghi> laghi@swissinfo.org
  7 ----------------------------------------------------------------------------*/
  8 
  9 #ifndef _COMPATIBLECORBA_H
 10 #define _COMPATIBLECORBA_H
 11 
 12 #include <string>
 13 
 14 /*
 15  * Implementor specific macros (for includes etc.)
 16  * The invocation of this header is done maximum one time per compilation unit. Since the server side 
 17  * will include different files than the client side (see SERVER_HEADER and CLIENT_HEADER) this might cause
 18  * problems in units acting as a server and a client. In such cases invoke it first as a server.
 19  */
 20 
 21 /******************************************************************
 22  *                      OMNIORB (Nils.Nilson@in-gmbh.de)
 23  ******************************************************************/
 24 #if defined(XMLBLASTER_OMNIORB)
 25 #define ORB_IS_THREAD_SAFE        true
 26 #ifdef SERVER_HEADER
 27 #  include <generated/xmlBlaster.h>
 28 #else
 29 #  include <generated/xmlBlaster.h> // client side include header
 30 #endif
 31 #define CORBA_HEADER              <omniORB4/CORBA.h>
 32 //#define CORBA_HEADER              <omniORB3/CORBA.h>
 33 #define COSCONTAINEMENT           <not_implemented.h>
 34 #define COSOBJECTIDENTITY         <not_implemented.h>
 35 #define COSREFERENCE              <not_implemented.h>
 36 #define COSEVENTCHANNELADMIN      <not_implemented.h>
 37 #define COSEVENTCOMM              <not_implemented.h>
 38 #define COSRELATIONSHIPS          <not_implemented.h>
 39 #define COSGRAPHS                 <not_implemented.h>
 40 #define COSTIME                   <not_implemented.h>
 41 #define COSGRAPHEXTENTSION        <not_implemented.h>
 42 #define COSTRADING                <not_implemented.h>
 43 #define COSNAMING                 <omniORB4/Naming.hh>
 44 //#define COSNAMING                 <omniORB3/Naming.hh>
 45 #define COSPROPERTY               <not_implemented.h>
 46 #define COSTRADINGREPOS           <not_implemented.h>
 47 #define COSTYPEDEVENTCHANNELADMIN <not_implemented.h>
 48 #define COSTYPEDEVENT             <not_implemented.h>
 49 #define UPDATE_THROW_SPECIFIER    
 50 #define PING_THROW_SPECIFIER      
 51 
 52 /******************************************************************
 53  *                      ORBACUS (OB-4.03) and (OB-4.1.0)
 54  ******************************************************************/
 55 #elif defined(XMLBLASTER_ORBACUS)
 56 #define ORB_IS_THREAD_SAFE        true
 57 #define CORBA_HEADER              <OB/CORBA.h>
 58 #define COSCONTAINEMENT           <not_implemented.h>
 59 #define COSOBJECTIDENTITY         <not_implemented.h>
 60 #define COSREFERENCE              <not_implemented.h>
 61 #define COSEVENTCHANNELADMIN      <OB/CosEventChannelAdmin.h>
 62 #define COSEVENTCOMM              <OB/CosEventComm.h>
 63 #define COSRELATIONSHIPS          <not_implemented.h>
 64 #define COSGRAPHS                 <not_implemented.h>
 65 #define COSTIME                   <not_implemented.h>
 66 #define COSGRAPHEXTENTSION        <not_implemented.h>
 67 #define COSTRADING                <not_implemented.h>
 68 #define COSNAMING                 <OB/CosNaming.h>
 69 #define COSPROPERTY               <OB/CosProperty.h>
 70 #define COSTRADINGREPOS           <not_implemented.h>
 71 #define COSTYPEDEVENTCHANNELADMIN <OB/CosTypedEventChannelAdmin.h>
 72 #define COSTYPEDEVENT             <OB/CosTypedEventComm.h>
 73 #define UPDATE_THROW_SPECIFIER    
 74 #define PING_THROW_SPECIFIER      
 75 
 76 # include CORBA_HEADER
 77 #ifdef SERVER_HEADER
 78 #  include <generated/xmlBlaster_skel.h>
 79 #else
 80 #  include <generated/xmlBlaster.h> // client side include header
 81 #endif
 82 
 83 /*****************************************************************
 84  *                     MICO (ver. 2.3.1)
 85  *****************************************************************/
 86 #elif defined(XMLBLASTER_MICO)
 87 # include <mico/version.h>
 88 # if MICO_BIN_VERSION < 0x02030b  // mico older MICO_VERSION 2.3.11
 89 #   define ORB_IS_THREAD_SAFE   false
 90 #   define MICO_INCLUDE_PREAFIX mico
 91 # else
 92 #   define ORB_IS_THREAD_SAFE   true
 93 #   define MICO_INCLUDE_PREAFIX coss
 94 # endif
 95 #ifdef SERVER_HEADER
 96 #  include <generated/xmlBlaster.h>
 97 #else
 98 #  include <generated/xmlBlaster.h> // client side include header
 99 #endif
100 #define CORBA_HEADER              <CORBA.h>
101 #define COSCONTAINEMENT           <MICO_INCLUDE_PREAFIX/CosContainment.h>
102 #define COSOBJECTIDENTITY         <MICO_INCLUDE_PREAFIX/CosObjectIdentity.h>
103 #define COSREFERENCE              <MICO_INCLUDE_PREAFIX/CosReference.h>
104 #define COSEVENTCHANNELADMIN      <MICO_INCLUDE_PREAFIX/CosEventChannelAdmin.h>
105 #define COSEVENTCOMM              <MICO_INCLUDE_PREAFIX/CosEventComm.h>
106 #define COSRELATIONSHIPS          <MICO_INCLUDE_PREAFIX/CosRelationships.h>
107 #define COSGRAPHS                 <MICO_INCLUDE_PREAFIX/CosGraphs.h>
108 #define COSTIME                   <MICO_INCLUDE_PREAFIX/CosTime.h>
109 #define COSGRAPHSEXTENSION        <MICO_INCLUDE_PREAFIX/CosGraphsExtension.h>
110 #define COSTRADING                <MICO_INCLUDE_PREAFIX/CosTrading.h>
111 #define COSNAMING                 <MICO_INCLUDE_PREAFIX/CosNaming.h>
112 #define COSPROPERTY               <not_implemented.h>
113 #define COSTRADINGREPOS           <MICO_INCLUDE_PREAFIX/CosTradingRepos.h>
114 #define COSTYPEDEVENTCHANNELADMIN <not_implemented.h>
115 #define COSTYPEDEVENT             <not_implemented.h>
116 #define UPDATE_THROW_SPECIFIER    
117 #define PING_THROW_SPECIFIER      
118 
119 /*****************************************************************
120  *                     TAO (ver. 2.3.1)
121  *****************************************************************/
122 #elif defined(XMLBLASTER_TAO)
123 #define ORB_IS_THREAD_SAFE        true
124 #ifdef SERVER_HEADER
125 #  include <generated/xmlBlasterS.h>
126 #else
127 #  include <generated/xmlBlasterC.h> // client side include header
128 #endif
129 #define CORBA_HEADER              <tao/corba.h>
130 #define COSCONTAINEMENT           <not_implemented.h> // what is this ??
131 #define COSOBJECTIDENTITY         <not_implemented.h>
132 #define COSREFERENCE              <not_implemented.h>
133 #define COSEVENTCHANNELADMIN      <orbsvcs/CosEventChannelAdminC.h>
134 #define COSEVENTCOMM              <not_implemented.h>
135 #define COSRELATIONSHIPS          <not_implemented.h>
136 #define COSGRAPHS                 <not_implemented.h>
137 #define COSTIME                   <orbsvcs/CosTimeC.h>
138 #define COSGRAPHSEXTENSION        <not_implemented.h>
139 #define COSTRADING                <not_implemented.h>
140 #define COSNAMING                 <orbsvcs/CosNamingC.h>
141 #define COSPROPERTY               <orbsvcs/CosPropertyServiceC.h>
142 #define COSTRADINGREPOS           <not_implemented.h>
143 #define COSTYPEDEVENTCHANNELADMIN <not_implemented.h>
144 #define COSTYPEDEVENT             <not_implemented.h>
145 #define UPDATE_THROW_SPECIFIER    ACE_THROW_SPEC (( CORBA::SystemException, serverIdl::XmlBlasterException ))
146 #define PING_THROW_SPECIFIER      ACE_THROW_SPEC (( CORBA::SystemException ))
147 
148 
149 /*****************************************************************
150  *                     ORBIX 2000 (ver. 2.0 )
151  *****************************************************************/
152 #elif defined(XMLBLASTER_ORBIX)
153 #define ORB_IS_THREAD_SAFE        true
154 #ifdef SERVER_HEADER
155 #  include <generated/xmlBlasterS.h>
156 #  include <generated/xmlBlaster.h> // client side include header
157 #else
158 #  include <generated/xmlBlaster.h> // client side include header
159 #endif
160 #define CORBA_HEADER              <omg/orb.hh> 
161 #define COSCONTAINEMENT           <not_implemented.h>
162 #define COSOBJECTIDENTITY         <not_implemented.h>
163 #define COSREFERENCE              <not_implemented.h>
164 #define COSEVENTCHANNELADMIN      <omg/CosEventChannelAdmin.hh>
165 #define COSEVENTCOMM              <omg/CosEventComm.hh>
166 #define COSRELATIONSHIPS          <not_implemented.h>
167 #define COSGRAPHS                 <not_implemented.h>
168 #define COSTIME                   <not_implemented.h>
169 #define COSGRAPHSEXTENSION        <not_implemented.h>
170 #define COSTRADING                <omg/CosTrading.hh>
171 #define COSNAMING                 <omg/CosNaming.hh>
172 #define COSPROPERTY               <not_implemented.h>
173 #define COSTRADINGREPOS           <omg/CosTradingRepos.hh>
174 #define COSTYPEDEVENTCHANNELADMIN <not_implemented.h>
175 #define COSTYPEDEVENT             <omg/CosTypedEventComm.hh>
176 #define UPDATE_THROW_SPECIFIER    IT_THROW_DECL ((CORBA::SystemException))
177 #define PING_THROW_SPECIFIER      IT_THROW_DECL ((CORBA::SystemException))
178 
179 #else
180 #  error "You must #define XMLBLASTER_OMNIORB, XMLBLASTER_ORBACUS, XMLBLASTER_MICO, XMLBLASTER_TAO or XMLBLASTER_ORBIX in xmlBlaster/src/c++/client/protocol/corba/CompatibleCorba.h"
181 #endif
182 
183 /**************************************************************
184  *         GENERAL STUFF COMMON TO ALL IMPLEMENTORS 
185  **************************************************************/
186 #include CORBA_HEADER
187 #undef   CORBA_HEADER
188 
189 #endif // _COMPATIBLECORBA_H
190 
191 std::string to_string(const CORBA::Exception &ex);
192 
193 
194 # ifdef XBL_IDL_WITH_WSTRING
195    // Note: This is switched off as the mico C++ client was loosing its ConnectQos wstring during send
196    //       Marcel 2006/04
197    // CORBA::WChar is equivalent to wchar_t
198    void string2wstring(std::wstring &dest,const std::string &src);
199    void wstring2string(std::string &dest,const std::wstring &src);
200    std::wstring toWstring(const std::string &src);
201    std::string toString(const std::wstring &src);
202    // If changing in xmlBlaster.idl 
203    //    'string' to 'wstring'  (typedef wstring XmlType;)
204    //    This will lead to CORBA::WString_var
205    std::string corbaWStringToString(const CORBA::WString_var &src);
206    CORBA::WString_var toCorbaWString(const std::string &src);
207 #else
208    std::string corbaWStringToString(const char *src);
209    const char* toCorbaWString(const std::string &src);
210 # endif


syntax highlighted by Code2HTML, v. 0.9.1