/usr/include/omniORB4/CORBA_Object_vartypes.h is in libomniorb4-dev 4.1.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | // -*- Mode: C++; -*-
// Package : omniORB
// CORBA_Object_vartypes.h Created on: 2001/08/15
// Author : Duncan Grisby <dpg1>
//
// Copyright (C) 2004-2005 Apasphere Ltd
// Copyright (C) 2001 AT&T Laboratories Cambridge
//
// This file is part of the omniORB library
//
// The omniORB library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA
//
//
// Description:
//
/*
$Log$
Revision 1.1.4.3 2005/11/09 12:16:46 dgrisby
Remove obsolete tcDesc helper classes.
Revision 1.1.4.2 2004/02/16 10:10:28 dgrisby
More valuetype, including value boxes. C++ mapping updates.
Revision 1.1.4.1 2003/03/23 21:04:23 dgrisby
Start of omniORB 4.1.x development branch.
Revision 1.1.2.1 2001/08/17 13:39:47 dpg1
Split CORBA.h into separate bits.
*/
#ifndef INSIDE_OMNIORB_CORBA_MODULE
# error "Must only be #included by CORBA.h"
#endif
//////////////////////////////////////////////////////////////////////
///////////////////////////// Object_var /////////////////////////////
//////////////////////////////////////////////////////////////////////
class Object_Member;
class Object_Element;
class Object_INOUT_arg;
class Object_OUT_arg;
class Object_var {
public:
typedef Object T;
typedef Object_ptr T_ptr;
typedef Object_var T_var;
typedef Object_Member T_member;
typedef Object_Element T_element;
inline Object_var() : pd_ref(T::_nil()) {}
inline Object_var(T_ptr p) { pd_ref = p; }
inline Object_var(const T_var& p) : pd_ref(T::_duplicate(p.pd_ref)) {}
inline Object_var(const T_member& p);
inline Object_var(const T_element& p);
inline ~Object_var() { release(pd_ref); }
inline T_var& operator= (T_ptr p) {
release(pd_ref);
pd_ref = p;
return *this;
}
inline T_var& operator= (const T_var& p) {
if( pd_ref != p.pd_ref ) {
release(pd_ref);
pd_ref = T::_duplicate(p.pd_ref);
}
return *this;
}
inline T_var& operator= (const T_member& p);
inline T_var& operator= (const T_element& p);
inline T_ptr operator->() const { return pd_ref; }
inline operator T_ptr() const { return pd_ref; }
inline T_ptr in() const { return pd_ref; }
inline T_ptr& inout() { return pd_ref; }
inline T_ptr& out() {
if( !is_nil(pd_ref) ) {
release(pd_ref);
pd_ref = T::_nil();
}
return pd_ref;
}
inline T_ptr _retn() {
T_ptr tmp = pd_ref;
pd_ref = T::_nil();
return tmp;
}
friend class Object_Member;
friend class Object_INOUT_arg;
friend class Object_OUT_arg;
private:
T_ptr pd_ref;
// Not implemented
Object_var(const _CORBA_ObjRef_Var_base&);
T_var& operator= (const _CORBA_ObjRef_Var_base&);
};
//////////////////////////////////////////////////////////////////////
//////////////////////////// Object_Member ///////////////////////////
//////////////////////////////////////////////////////////////////////
class Object_Member {
public:
typedef Object T;
typedef Object_ptr T_ptr;
typedef Object_var T_var;
typedef Object_Member T_member;
typedef Object_Element T_element;
inline Object_Member() : _ptr(T::_nil()) {}
inline Object_Member(const T_member& p) {
_ptr = T::_duplicate(p._ptr);
}
inline ~Object_Member() {
CORBA::release(_ptr);
}
inline T_member& operator= (T_ptr p) {
CORBA::release(_ptr);
_ptr = p;
return *this;
}
inline T_member& operator= (const T_member& p) {
if( &p != this ) {
CORBA::release(_ptr);
_ptr = T::_duplicate(p._ptr);
}
return *this;
}
inline T_member& operator= (const T_var& p) {
CORBA::release(_ptr);
_ptr = T::_duplicate(p);
return *this;
}
inline T_member& operator= (const T_element& p);
inline void operator>>= (cdrStream& s) const {
CORBA::Object::_marshalObjRef(_ptr,s);
}
inline void operator<<= (cdrStream& s) {
Object_ptr _result = CORBA::Object::_unmarshalObjRef(s);
CORBA::release(_ptr);
_ptr = _result;
}
inline Object_ptr operator->() const { return _ptr; }
inline operator Object_ptr () const { return _ptr; }
inline Object_ptr in() const { return _ptr; }
inline Object_ptr& inout() { return _ptr; }
inline Object_ptr& out() {
CORBA::release(_ptr);
_ptr = CORBA::Object::_nil();
return _ptr;
}
inline Object_ptr _retn() {
Object_ptr tmp;
tmp = _ptr;
_ptr = CORBA::Object::_nil();
return tmp;
}
Object_ptr _ptr;
private:
// Not implemented
Object_Member(const _CORBA_ObjRef_Var_base&);
T_member& operator= (const _CORBA_ObjRef_Var_base&);
};
//////////////////////////////////////////////////////////////////////
//////////////////////////// Object_Element //////////////////////////
//////////////////////////////////////////////////////////////////////
class Object_Element {
public:
typedef Object T;
typedef Object_ptr T_ptr;
typedef Object_var T_var;
typedef Object_Member T_member;
typedef Object_Element T_element;
inline Object_Element(T_ptr& p, _CORBA_Boolean rel)
: pd_rel(rel), pd_data(p) {}
inline Object_Element(const T_element& p)
: pd_rel(p.pd_rel), pd_data(p.pd_data) {}
inline ~Object_Element() {
// intentionally does nothing.
}
inline T_element& operator= (T_ptr p) {
if( pd_rel ) CORBA::release(pd_data);
pd_data = p;
return *this;
}
inline T_element& operator= (const T_element& p) {
if (p.pd_data != pd_data) {
if( pd_rel ) {
CORBA::release(pd_data);
T::_duplicate(p.pd_data);
pd_data = p.pd_data;
}
else
pd_data = p.pd_data;
}
return *this;
}
inline T_element& operator= (const T_member& p) {
if( pd_rel ) {
CORBA::release(pd_data);
T::_duplicate(p);
}
pd_data = (T_ptr) p;
return *this;
}
inline T_element& operator= (const T_var& p) {
if( pd_rel ) {
CORBA::release(pd_data);
T::_duplicate(p);
}
pd_data = (T_ptr)p;
return *this;
}
inline T_ptr operator->() const { return pd_data; }
inline operator T_ptr () const { return pd_data; }
inline T_ptr in() const { return pd_data; }
inline T_ptr& inout() { return pd_data; }
inline T_ptr& out() {
if (pd_rel) {
CORBA::release(pd_data);
}
pd_data = T::_nil();
return pd_data;
}
inline T_ptr _retn() {
T_ptr tmp = pd_data;
if (!pd_rel) { T::_duplicate(pd_data); }
pd_data = T::_nil();
return tmp;
}
inline T_ptr& _NP_ref() const {return pd_data;}
inline _CORBA_Boolean _NP_release() const {return pd_rel;}
_CORBA_Boolean pd_rel;
T_ptr& pd_data;
private:
// Not implemented
Object_Element(const _CORBA_ObjRef_Var_base&);
T_element& operator= (const _CORBA_ObjRef_Var_base&);
};
//////////////////////////////////////////////////////////////////////
////////////////////////// Object_INOUT_arg //////////////////////////
//////////////////////////////////////////////////////////////////////
class Object_INOUT_arg {
public:
inline Object_INOUT_arg(Object_ptr& p) : _data(p) {}
inline Object_INOUT_arg(Object_var& p) : _data(p.pd_ref) {}
inline Object_INOUT_arg(Object_Member& p) : _data(p._ptr) {}
inline Object_INOUT_arg(Object_Element& p) : _data(p._NP_ref()) {
// If the Object_Element has pd_rel == 0,
// the ObjRef is not owned by the sequence and should not
// be freed. Since this is an inout argument and the callee may call
// release, we duplicate the ObjRef and pass it to the callee. This will
// result in a memory leak! This only occurs when there is a programming
// error and cannot be trapped by the compiler.
if( !p._NP_release() )
Object::_duplicate(p._NP_ref());
}
inline ~Object_INOUT_arg() {}
inline operator Object_ptr&() { return _data; }
Object_ptr& _data;
private:
Object_INOUT_arg();
};
//////////////////////////////////////////////////////////////////////
/////////////////////////// Object_OUT_arg ///////////////////////////
//////////////////////////////////////////////////////////////////////
class Object_OUT_arg {
public:
typedef Object T;
typedef Object_ptr T_ptr;
typedef Object_var T_var;
typedef Object_Member T_member;
typedef Object_Element T_element;
typedef Object_OUT_arg T_out;
inline Object_OUT_arg(T_ptr& p) : _data(p) { _data = T::_nil(); }
inline Object_OUT_arg(T_var& p) : _data(p.pd_ref) {
p = T::_nil();
}
inline Object_OUT_arg(T_member& p) : _data(p._ptr) {
p = T::_nil();
}
inline Object_OUT_arg(T_element& p) : _data(p._NP_ref()) {
p = T::_nil();
}
inline Object_OUT_arg(const T_out& p) : _data(p._data) {}
inline ~Object_OUT_arg() {}
inline Object_OUT_arg& operator=(const T_out& p) {
_data = p._data; return *this; }
inline Object_OUT_arg& operator=(T_ptr p) { _data = p; return *this; }
inline operator T_ptr&() { return _data; }
inline T_ptr& ptr() { return _data; }
inline T_ptr operator->() { return _data; }
T_ptr& _data;
private:
Object_OUT_arg();
T_out& operator=(const T_member& p);
T_out& operator=(const T_element& p);
T_out& operator=(const T_var& p);
// CORBA 2.3 p23-26 says that T_var assignment should be disallowed.
};
typedef Object_OUT_arg Object_out;
|