00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ___HxCorbaRefCountBase_h__
00016 #define ___HxCorbaRefCountBase_h__
00017
00018 #ifndef OB_INTEGER_VERSION
00019 # error No ORBacus version defined! Is <OB/CORBA.h> included?
00020 #endif
00021
00022 #ifndef OB_NO_VERSION_CHECK
00023 # if (OB_INTEGER_VERSION != 4000500L)
00024 # error ORBacus version mismatch!
00025 # endif
00026 #endif
00027
00028 namespace HxCorba
00029 {
00030
00031 class RefCountBase;
00032 typedef RefCountBase* RefCountBase_ptr;
00033 typedef RefCountBase* RefCountBaseRef;
00034
00035 extern OB::TypeCodeConst _tc_RefCountBase;
00036
00037 }
00038
00039 void OBDuplicate(HxCorba::RefCountBase_ptr);
00040 void OBRelease(HxCorba::RefCountBase_ptr);
00041
00042 void OBMarshal(HxCorba::RefCountBase_ptr, OB::OutputStreamImpl*);
00043 void OBUnmarshal(HxCorba::RefCountBase_ptr&, OB::InputStreamImpl*);
00044
00045 namespace HxCorba
00046 {
00047
00048 typedef OB::ObjVar< RefCountBase > RefCountBase_var;
00049 typedef OB::ObjOut< RefCountBase > RefCountBase_out;
00050
00051 }
00052
00053 namespace OBStubImpl_HxCorba
00054 {
00055
00056 class RefCountBase;
00057 typedef RefCountBase* RefCountBase_ptr;
00058
00059 }
00060
00061 void OBDuplicate(OBStubImpl_HxCorba::RefCountBase_ptr);
00062 void OBRelease(OBStubImpl_HxCorba::RefCountBase_ptr);
00063
00064 namespace OBStubImpl_HxCorba
00065 {
00066
00067 typedef OB::ObjVar< RefCountBase > RefCountBase_var;
00068
00069 }
00070
00071
00072
00073
00074 namespace HxCorba
00075 {
00076
00077
00078
00079
00080 class RefCountBase : virtual public CORBA::Object
00081 {
00082 RefCountBase(const RefCountBase&);
00083 void operator=(const RefCountBase&);
00084
00085 static const char* ids_[];
00086
00087 protected:
00088
00089 virtual OB::MarshalStubImpl_ptr _OB_createMarshalStubImpl();
00090
00091 public:
00092
00093 RefCountBase() { }
00094 virtual ~RefCountBase() { }
00095
00096 typedef RefCountBase_ptr _ptr_type;
00097 typedef RefCountBase_var _var_type;
00098
00099 static inline RefCountBase_ptr
00100 _duplicate(RefCountBase_ptr p)
00101 {
00102 if(p)
00103 p -> _OB_incRef();
00104 return p;
00105 }
00106
00107 static inline RefCountBase_ptr
00108 _nil()
00109 {
00110 return 0;
00111 }
00112
00113 static RefCountBase_ptr _narrow(CORBA::Object_ptr);
00114 static RefCountBase_ptr _narrow(CORBA::AbstractBase_ptr);
00115
00116 virtual const char** _OB_ids() const;
00117 static const char** _OB_staticIds();
00118
00119
00120
00121
00122 void addRef();
00123
00124
00125
00126
00127 void removeRef();
00128 };
00129
00130 }
00131
00132
00133
00134
00135 namespace OBStubImpl_HxCorba
00136 {
00137
00138
00139
00140
00141 class RefCountBase : virtual public OB::StubImplBase
00142 {
00143 RefCountBase(const RefCountBase&);
00144 void operator=(const RefCountBase&);
00145
00146 protected:
00147
00148 RefCountBase() { }
00149
00150 public:
00151
00152 static inline RefCountBase_ptr
00153 _duplicate(RefCountBase_ptr p)
00154 {
00155 if(p)
00156 p -> _OB_incRef();
00157 return p;
00158 }
00159
00160 static inline RefCountBase_ptr
00161 _nil()
00162 {
00163 return 0;
00164 }
00165
00166
00167
00168
00169 virtual void addRef() = 0;
00170
00171
00172
00173
00174 virtual void removeRef() = 0;
00175 };
00176
00177 }
00178
00179
00180
00181
00182 namespace OBMarshalStubImpl_HxCorba
00183 {
00184
00185
00186
00187
00188 class RefCountBase : virtual public OBStubImpl_HxCorba::RefCountBase,
00189 virtual public OB::MarshalStubImpl
00190 {
00191 RefCountBase(const RefCountBase&);
00192 void operator=(const RefCountBase&);
00193
00194 protected:
00195
00196 RefCountBase() { }
00197 friend class HxCorba::RefCountBase;
00198
00199 public:
00200
00201
00202
00203
00204 virtual void addRef();
00205
00206
00207
00208
00209 virtual void removeRef();
00210 };
00211
00212 }
00213
00214
00215
00216
00217 namespace OBV_HxCorba
00218 {
00219
00220 }
00221
00222
00223
00224
00225 namespace CORBA
00226 {
00227
00228 inline void
00229 release(HxCorba::RefCountBase_ptr p)
00230 {
00231 if(p)
00232 p -> _OB_decRef();
00233 }
00234
00235 inline Boolean
00236 is_nil(HxCorba::RefCountBase_ptr p)
00237 {
00238 return p == 0;
00239 }
00240
00241 inline void
00242 release(OBStubImpl_HxCorba::RefCountBase_ptr p)
00243 {
00244 if(p)
00245 p -> _OB_decRef();
00246 }
00247
00248 inline Boolean
00249 is_nil(OBStubImpl_HxCorba::RefCountBase_ptr p)
00250 {
00251 return p == 0;
00252 }
00253
00254 }
00255
00256 void operator<<=(CORBA::Any&, HxCorba::RefCountBase_ptr*);
00257 void operator<<=(CORBA::Any&, HxCorba::RefCountBase_ptr);
00258 CORBA::Boolean operator>>=(const CORBA::Any&, HxCorba::RefCountBase_ptr&);
00259
00260 inline void
00261 operator<<=(CORBA::Any_var& any, HxCorba::RefCountBase_ptr* val)
00262 {
00263 any.inout() <<= val;
00264 }
00265
00266 inline void
00267 operator<<=(CORBA::Any_var& any, HxCorba::RefCountBase_ptr val)
00268 {
00269 any.inout() <<= val;
00270 }
00271
00272 inline CORBA::Boolean
00273 operator>>=(const CORBA::Any_var& any, HxCorba::RefCountBase_ptr& val)
00274 {
00275 return any.in() >>= val;
00276 }
00277
00278 #endif