/usr/include/omniORB4/CORBA_ValueBase_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 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | // -*- Mode: C++; -*-
// Package : omniORB
// CORBA_ValueBase_vartypes.h Created on: 2003/08/11
// Author : Duncan Grisby
//
// Copyright (C) 2003-2005 Apasphere Ltd.
//
// 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:
// ValueType _var definitions
//
/*
$Log$
Revision 1.1.2.4 2005/11/09 12:16:46 dgrisby
Remove obsolete tcDesc helper classes.
Revision 1.1.2.3 2004/10/13 17:58:18 dgrisby
Abstract interfaces support; values support interfaces; value bug fixes.
Revision 1.1.2.2 2003/11/06 11:56:55 dgrisby
Yet more valuetype. Plain valuetype and abstract valuetype are now working.
Revision 1.1.2.1 2003/09/26 16:12:53 dgrisby
Start of valuetype support.
*/
#ifndef INSIDE_OMNIORB_CORBA_MODULE
# error "Must only be #included by CORBA.h"
#endif
class ValueBase_Member;
class ValueBase_Element;
class ValueBase_INOUT_arg;
class ValueBase_OUT_arg;
//////////////////////////////////////////////////////////////////////
//////////////////////////// ValueBase_var ///////////////////////////
//////////////////////////////////////////////////////////////////////
class ValueBase_var {
public:
typedef ValueBase T;
typedef ValueBase_var T_var;
typedef ValueBase_Member T_member;
typedef ValueBase_Element T_element;
inline ValueBase_var() : _pd_val(0) {}
inline ValueBase_var(T* p) { _pd_val = p; }
inline ValueBase_var(const T_var& p) : _pd_val(p._pd_val) {
add_ref(_pd_val);
}
inline ValueBase_var(const T_member& p);
inline ValueBase_var(const T_element& p);
inline ~ValueBase_var() {
remove_ref(_pd_val);
}
inline T_var& operator= (T* p) {
remove_ref(_pd_val);
_pd_val = p;
return *this;
}
inline T_var& operator= (const T_var& p) {
if( _pd_val != p._pd_val ) {
remove_ref(_pd_val);
_pd_val = p._pd_val;
add_ref(_pd_val);
}
return *this;
}
inline T_var& operator= (const T_member& p);
inline T_var& operator= (const T_element& p);
inline T* operator->() const { return _pd_val; }
inline operator T*() const { return _pd_val; }
inline T* in() const { return _pd_val; }
inline T*& inout() { return _pd_val; }
inline T*& out() {
remove_ref(_pd_val);
_pd_val = 0;
return _pd_val;
}
inline T* _retn() {
T* tmp = _pd_val;
_pd_val = 0;
return tmp;
}
friend class ValueBase_Member;
friend class ValueBase_Element;
friend class ValueBase_INOUT_arg;
friend class ValueBase_OUT_arg;
private:
T* _pd_val;
};
//////////////////////////////////////////////////////////////////////
//////////////////////////// ValueBase_Member ////////////////////////
//////////////////////////////////////////////////////////////////////
class ValueBase_Member {
public:
typedef ValueBase T;
typedef ValueBase_var T_var;
typedef ValueBase_Member T_member;
typedef ValueBase_Element T_element;
inline ValueBase_Member() : _pd_val(0) {}
inline ValueBase_Member(const T_member& p) {
_pd_val = p._pd_val;
add_ref(_pd_val);
}
inline ~ValueBase_Member() {
remove_ref(_pd_val);
}
inline T_member& operator= (T* p) {
remove_ref(_pd_val);
_pd_val = p;
return *this;
}
inline T_member& operator= (const T_member& p) {
if( &p != this ) {
remove_ref(_pd_val);
_pd_val = p._pd_val;
add_ref(_pd_val);
}
return *this;
}
inline T_member& operator= (const T_var& p) {
remove_ref(_pd_val);
_pd_val = p._pd_val;
add_ref(_pd_val);
return *this;
}
inline T_member& operator= (const T_element& p);
inline void operator>>= (cdrStream& s) const {
T::_NP_marshal(_pd_val, s);
}
inline void operator<<= (cdrStream& s) {
ValueBase* _result = T::_NP_unmarshal(s);
remove_ref(_pd_val);
_pd_val = _result;
}
inline ValueBase* operator->() const { return _pd_val; }
inline operator ValueBase* () const { return _pd_val; }
inline ValueBase* in() const { return _pd_val; }
inline ValueBase*& inout() { return _pd_val; }
inline ValueBase*& out() {
remove_ref(_pd_val);
_pd_val = 0;
return _pd_val;
}
inline ValueBase* _retn() {
ValueBase* tmp;
tmp = _pd_val;
_pd_val = 0;
return tmp;
}
ValueBase* _pd_val;
};
//////////////////////////////////////////////////////////////////////
//////////////////////////// ValueBase_Element ///////////////////////
//////////////////////////////////////////////////////////////////////
class ValueBase_Element {
public:
typedef ValueBase T;
typedef ValueBase_var T_var;
typedef ValueBase_Member T_member;
typedef ValueBase_Element T_element;
inline ValueBase_Element(T*& p, _CORBA_Boolean rel)
: pd_rel(rel), _pd_val(p) {}
inline ValueBase_Element(const T_element& p)
: pd_rel(p.pd_rel), _pd_val(p._pd_val) {}
inline ~ValueBase_Element() {
// intentionally does nothing.
}
inline T_element& operator= (T* p) {
if( pd_rel )
if (_pd_val)
_pd_val->_remove_ref();
_pd_val = p;
return *this;
}
inline T_element& operator= (const T_element& p) {
if( pd_rel ) {
if (_pd_val)
_pd_val->_remove_ref();
_pd_val = p._pd_val;
if (_pd_val) _pd_val->_add_ref();
}
else
_pd_val = p._pd_val;
return *this;
}
inline T_element& operator= (const T_member& p) {
if( pd_rel ) {
if (_pd_val)
_pd_val->_remove_ref();
if (p._pd_val) p._pd_val->_add_ref();
}
_pd_val = (T*) p;
return *this;
}
inline T_element& operator= (const T_var& p) {
if( pd_rel ) {
if (_pd_val)
_pd_val->_remove_ref();
if (p._pd_val) p._pd_val->_add_ref();
}
_pd_val = (T*)p;
return *this;
}
inline T* operator->() const { return _pd_val; }
inline operator T* () const { return _pd_val; }
inline T* in() const { return _pd_val; }
inline T*& inout() { return _pd_val; }
inline T*& out() {
if (pd_rel) {
if (_pd_val)
_pd_val->_remove_ref();
}
_pd_val = 0;
return _pd_val;
}
inline T* _retn() {
T* tmp = _pd_val;
if (!pd_rel) {
if (_pd_val)
_pd_val->_add_ref();
}
_pd_val = 0;
return tmp;
}
inline T*& _NP_val() const {return _pd_val;}
inline _CORBA_Boolean _NP_release() const {return pd_rel;}
_CORBA_Boolean pd_rel;
T*& _pd_val;
};
//////////////////////////////////////////////////////////////////////
////////////////////////// ValueBase_INOUT_arg ///////////////////////
//////////////////////////////////////////////////////////////////////
class ValueBase_INOUT_arg {
public:
inline ValueBase_INOUT_arg(ValueBase*& p) : _pd_val(p) {}
inline ValueBase_INOUT_arg(ValueBase_var& p) : _pd_val(p._pd_val) {}
inline ValueBase_INOUT_arg(ValueBase_Member& p) : _pd_val(p._pd_val) {}
inline ValueBase_INOUT_arg(ValueBase_Element& p) : _pd_val(p._NP_val()) {
// If the ValueBase_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 value 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() )
if (p._NP_val())
p._NP_val()->_add_ref();
}
inline ~ValueBase_INOUT_arg() {}
inline operator ValueBase*&() { return _pd_val; }
ValueBase*& _pd_val;
private:
ValueBase_INOUT_arg();
};
//////////////////////////////////////////////////////////////////////
/////////////////////////// ValueBase_OUT_arg ////////////////////////
//////////////////////////////////////////////////////////////////////
class ValueBase_OUT_arg {
public:
typedef ValueBase T;
typedef ValueBase_var T_var;
typedef ValueBase_Member T_member;
typedef ValueBase_Element T_element;
typedef ValueBase_OUT_arg T_out;
inline ValueBase_OUT_arg(T*& p) : _pd_val(p) { _pd_val = 0; }
inline ValueBase_OUT_arg(T_var& p) : _pd_val(p._pd_val) {
p = 0;
}
inline ValueBase_OUT_arg(T_member& p) : _pd_val(p._pd_val) {
p = 0;
}
inline ValueBase_OUT_arg(T_element& p) : _pd_val(p._NP_val()) {
p = 0;
}
inline ValueBase_OUT_arg(const T_out& p) : _pd_val(p._pd_val) {}
inline ~ValueBase_OUT_arg() {}
inline ValueBase_OUT_arg& operator=(const T_out& p) {
_pd_val = p._pd_val;
return *this;
}
inline ValueBase_OUT_arg& operator=(T* p) {
_pd_val = p;
return *this;
}
inline operator T*&() { return _pd_val; }
inline T*& ptr() { return _pd_val; }
inline T* operator->() { return _pd_val; }
T*& _pd_val;
private:
ValueBase_OUT_arg();
T_out& operator=(const T_member& p);
T_out& operator=(const T_element& p);
T_out& operator=(const T_var& p);
};
typedef ValueBase_OUT_arg ValueBase_out;
//////////////////////////////////////////////////////////////////////
///////////////////// ValueFactoryBase_var ///////////////////////////
//////////////////////////////////////////////////////////////////////
class ValueFactoryBase_var {
public:
ValueFactoryBase_var() : _pd_val(0) {}
ValueFactoryBase_var(ValueFactoryBase* p) : _pd_val(p) {}
ValueFactoryBase_var(const ValueFactoryBase_var& b) : _pd_val(b._pd_val) {
if (_pd_val != 0) _pd_val->_add_ref();
}
~ValueFactoryBase_var() {
if (_pd_val)
_pd_val->_remove_ref();
}
ValueFactoryBase_var& operator=(ValueFactoryBase* p) {
if (_pd_val)
_pd_val->_remove_ref();
_pd_val = p;
return *this;
}
ValueFactoryBase_var& operator=(const ValueFactoryBase_var& b) {
if (_pd_val != b._pd_val) {
if (_pd_val)
_pd_val->_remove_ref();
if ((_pd_val = b._pd_val))
_pd_val->_add_ref();
}
return *this;
}
operator ValueFactoryBase*() const {
return _pd_val;
}
ValueFactoryBase* operator->() const {
return _pd_val;
}
ValueFactoryBase* in() const {
return _pd_val;
}
ValueFactoryBase*& inout() {
return _pd_val;
}
ValueFactoryBase*& out() {
if (_pd_val)
_pd_val->_remove_ref();
_pd_val = 0;
return _pd_val;
}
ValueFactoryBase* _retn() {
ValueFactoryBase* retval = _pd_val;
_pd_val = 0;
return retval;
}
private:
ValueFactoryBase* _pd_val;
};
|