This file is indexed.

/usr/include/omniORB4/valueTemplatedecls.h is in libomniorb4-dev 4.2.2-0.8.

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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
// -*- Mode: C++; -*-
//                            Package   : omniORB
// valueTemplatedecls.h       Created on: 2003/09/24
//                            Author    : Duncan Grisby
//
//    Copyright (C) 2003-2009 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 Lesser General Public
//    License as published by the Free Software Foundation; either
//    version 2.1 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
//    Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public
//    License along with this library. If not, see http://www.gnu.org/licenses/
//
//
// Description:
//    ValueType templates
//

#ifndef __VALUETEMPLATEDECLS_H__
#define __VALUETEMPLATEDECLS_H__


template <class T, class T_Helper>
class _CORBA_Value_Member;

template <class T, class T_Helper>
class _CORBA_Value_Element;

template <class T, class T_Helper>
class _CORBA_Value_INOUT_arg;

template <class T, class T_Helper>
class _CORBA_Value_OUT_arg;

template <class T, class ElemT, class T_Helper>
class _CORBA_Sequence_Value;

template <class T, class ElemT, class T_Helper>
class _CORBA_Unbounded_Sequence_Value;

template <class T, class ElemT, class T_Helper, int max>
class _CORBA_Bounded_Sequence_Value;


//////////////////////////////////////////////////////////////////////
//////////////////////////// _CORBA_Value_Var ////////////////////////
//////////////////////////////////////////////////////////////////////

template <class T, class T_Helper>
class _CORBA_Value_Var {
public:
  typedef _CORBA_Value_Var<T, T_Helper>     T_var;
  typedef _CORBA_Value_Member<T, T_Helper>  T_member;
  typedef _CORBA_Value_Element<T, T_Helper> T_element;

  inline _CORBA_Value_Var() : _pd_val(0) {}
  inline _CORBA_Value_Var(T* p) { _pd_val = p; }
  inline _CORBA_Value_Var(const T_var& p) : _pd_val(p._pd_val) {
    T_Helper::add_ref(p);
  }
  inline _CORBA_Value_Var(const T_member& p);
  inline _CORBA_Value_Var(const T_element& p);
  inline ~_CORBA_Value_Var() {
    T_Helper::remove_ref(_pd_val);
  }

  inline T_var& operator= (T* p) {
    T_Helper::remove_ref(_pd_val);
    _pd_val = p;
    return *this;
  }
  inline T_var& operator= (const T_var& p) {
    if (_pd_val != p._pd_val) {
      T_Helper::remove_ref(_pd_val);
      _pd_val = p._pd_val;
      T_Helper::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() {
    T_Helper::remove_ref(_pd_val);
    _pd_val = 0;
    return _pd_val;
  }
  inline T* _retn() {
    T* tmp = _pd_val;
    _pd_val = 0;
    return tmp;
  }

  friend class _CORBA_Value_Member   <T,T_Helper>;
  friend class _CORBA_Value_Element  <T,T_Helper>;
  friend class _CORBA_Value_INOUT_arg<T,T_Helper>;
  friend class _CORBA_Value_OUT_arg  <T,T_Helper>;

private:
  T* _pd_val;
};

//////////////////////////////////////////////////////////////////////
//////////////////////////// _CORBA_Value_Memeber ////////////////////
//////////////////////////////////////////////////////////////////////

template <class T, class T_Helper>
class _CORBA_Value_Member {
public:
  typedef _CORBA_Value_Var    <T,T_Helper> T_var;
  typedef _CORBA_Value_Member <T,T_Helper> T_member;
  typedef _CORBA_Value_Element<T,T_Helper> T_element;

  inline _CORBA_Value_Member() : _pd_val(0) {}
  inline _CORBA_Value_Member(const T_member& p) : _pd_val(p._pd_val) {
    T_Helper::add_ref(_pd_val);
  }
  inline ~_CORBA_Value_Member() {
    T_Helper::remove_ref(_pd_val);
  }

  inline T_member& operator= (T* p) {
    T_Helper::remove_ref(_pd_val);
    _pd_val = p;
    return *this;
  }
  inline T_member& operator= (const T_member& p) {
    if (_pd_val != p._pd_val) {
      T_Helper::remove_ref(_pd_val);
      _pd_val = p._pd_val;
      T_Helper::add_ref(_pd_val);
    }
    return *this;
  }

  inline T_member& operator= (const T_var& p) {
    if (_pd_val != p._pd_val) {
      T_Helper::remove_ref(_pd_val);
      _pd_val = p._pd_val;
      T_Helper::add_ref(_pd_val);
    }
    return *this;
  }

  inline T_member& operator= (const T_element& p);

  inline void operator>>= (cdrStream& s) const {
    T_Helper::marshal(_pd_val, s);
  }
  inline void operator<<= (cdrStream& s) {
    T* _result = T_Helper::unmarshal(s);
    T_Helper::remove_ref(_pd_val);
    _pd_val = _result;
  }

  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() {
    T_Helper::remove_ref(_pd_val);
    _pd_val = 0;
    return _pd_val;
  }
  inline T* _retn() {
    T* tmp = _pd_val;
    _pd_val = 0;
    return tmp;
  }

  T* _pd_val;
};

//////////////////////////////////////////////////////////////////////
//////////////////////////// _CORBA_Value_Element ////////////////////
//////////////////////////////////////////////////////////////////////

template <class T, class T_Helper>
class _CORBA_Value_Element {
public:
  typedef _CORBA_Value_Var    <T,T_Helper> T_var;
  typedef _CORBA_Value_Member <T,T_Helper> T_member;
  typedef _CORBA_Value_Element<T,T_Helper> T_element;

  inline _CORBA_Value_Element(T*& p, _CORBA_Boolean rel)
    : pd_rel(rel), _pd_val(p) {}

  inline _CORBA_Value_Element(const T_element& p)
    : pd_rel(p.pd_rel), _pd_val(p._pd_val) {}

  inline ~_CORBA_Value_Element() {
  // intentionally does nothing.
  }

  inline T_element& operator= (T* p) {
    if (pd_rel)
      T_Helper::remove_ref(_pd_val);
    _pd_val = p;
    return *this;
  }

  inline T_element& operator= (const T_element& p) {
    if (p._pd_val != _pd_val) {
      if (pd_rel) {
        T_Helper::remove_ref(_pd_val);
        _pd_val = p._pd_val;
        T_Helper::add_ref(_pd_val);
      }
      else
        _pd_val = p._pd_val;
    }
    return *this;
  }

  inline T_element& operator= (const T_member& p) {
    if (pd_rel) {
      T_Helper::remove_ref(_pd_val);
      T_Helper::add_ref(p._pd_val);
    }
    _pd_val = (T*) p;
    return *this;
  }

  inline T_element& operator= (const T_var& p) {
    if (pd_rel) {
      T_Helper::remove_ref(_pd_val);
      T_Helper::add_ref(p._pd_val);
    }
    _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) {
      T_Helper::remove_ref(_pd_val);
    }
    _pd_val = 0;
    return _pd_val;
  }

  inline T* _retn() {
    T* tmp = _pd_val;
    if (!pd_rel) {
      T_Helper::add_ref(_pd_val);
    }
    _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;
};

//////////////////////////////////////////////////////////////////////
/////////////////////// _CORBA_Value_var          ////////////////////
/////////////////////// _CORBA_Value_member       ////////////////////
/////////////////////// operator= and copy ctors  ////////////////////
//////////////////////////////////////////////////////////////////////

template <class T, class T_Helper>
inline
_CORBA_Value_Var<T,T_Helper>::
_CORBA_Value_Var(const _CORBA_Value_Member<T,T_Helper>& m)
{
  T_Helper::add_ref(m._pd_val);
  _pd_val = m._pd_val;
}

template <class T, class T_Helper>
inline
_CORBA_Value_Var<T,T_Helper>::
_CORBA_Value_Var(const _CORBA_Value_Element<T,T_Helper>& m)
{
  T_Helper::add_ref(m._pd_val);
  _pd_val = m._pd_val;
}


template <class T, class T_Helper>
inline _CORBA_Value_Var<T,T_Helper>&
_CORBA_Value_Var<T,T_Helper>::operator= (const _CORBA_Value_Member<T,T_Helper>& p)
{
  T_Helper::remove_ref(_pd_val);
  T_Helper::add_ref(p._pd_val);
  _pd_val = p._pd_val;
  return *this;
}

template <class T, class T_Helper>
inline _CORBA_Value_Var<T,T_Helper>&
_CORBA_Value_Var<T,T_Helper>::operator= (const _CORBA_Value_Element<T,T_Helper>& p)
{
  T_Helper::remove_ref(_pd_val);
  T_Helper::add_ref(p._pd_val);
  _pd_val = p._pd_val;
  return *this;
}

template <class T, class T_Helper>
inline _CORBA_Value_Member<T,T_Helper>&
_CORBA_Value_Member<T,T_Helper>::operator= (const _CORBA_Value_Element<T,T_Helper>& p)
{
  T_Helper::remove_ref(_pd_val);
  T_Helper::add_ref(p._pd_val);
  _pd_val = p._pd_val;
  return *this;
}


//////////////////////////////////////////////////////////////////////
////////////////////////// Value_INOUT_arg ///////////////////////////
//////////////////////////////////////////////////////////////////////

template <class T, class T_Helper>
class _CORBA_Value_INOUT_arg {
public:
  typedef _CORBA_Value_Var    <T,T_Helper> T_var;
  typedef _CORBA_Value_Member <T,T_Helper> T_member;
  typedef _CORBA_Value_Element<T,T_Helper> T_element;

  inline _CORBA_Value_INOUT_arg(T*& p) :        _pd_val(p) {}
  inline _CORBA_Value_INOUT_arg(T_var& p) :     _pd_val(p._pd_val) {}
  inline _CORBA_Value_INOUT_arg(T_member& p) :  _pd_val(p._pd_val) {}
  inline _CORBA_Value_INOUT_arg(T_element& p) : _pd_val(p._NP_val()) {
    // If the _CORBA_Value_Element has pd_rel == 0,
    // the value 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() )
      T_Helper::add_ref(p._NP_val());
  }
  inline ~_CORBA_Value_INOUT_arg() {}

  inline operator T*&()  { return _pd_val; }

  T*& _pd_val;

private:
  _CORBA_Value_INOUT_arg();
};

//////////////////////////////////////////////////////////////////////
/////////////////////////// Value_OUT_arg ////////////////////////////
//////////////////////////////////////////////////////////////////////

template <class T, class T_Helper>
class _CORBA_Value_OUT_arg {
public:
  typedef _CORBA_Value_Var    <T,T_Helper> T_var;
  typedef _CORBA_Value_Member <T,T_Helper> T_member;
  typedef _CORBA_Value_Element<T,T_Helper> T_element;
  typedef _CORBA_Value_OUT_arg<T,T_Helper> T_out;

  inline _CORBA_Value_OUT_arg(T*& p) : _pd_val(p) { _pd_val = 0; }
  inline _CORBA_Value_OUT_arg(T_var& p) : _pd_val(p._pd_val) {
    p = 0;
  }
  inline _CORBA_Value_OUT_arg(T_member& p) : _pd_val(p._pd_val) {
    p = 0;
  }
  inline _CORBA_Value_OUT_arg(T_element& p) : _pd_val(p._NP_val()) {
    p = 0;
  }
  inline _CORBA_Value_OUT_arg(const T_out& p) : _pd_val(p._pd_val) {}
  inline ~_CORBA_Value_OUT_arg() {}
 
  inline T_out& operator=(const T_out& p) { 
    _pd_val = p._pd_val;
    return *this;
  }
  inline T_out& 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:
  _CORBA_Value_OUT_arg();
  T_out& operator=(const T_member& p);
  T_out& operator=(const T_element& p);
  T_out& operator=(const T_var& p);
};


//////////////////////////////////////////////////////////////////////
//////////////////////////// _CORBA_Sequence_Value ///////////////////
//////////////////////////////////////////////////////////////////////

template <class T, class T_Elem, class T_Helper>
class _CORBA_Sequence_Value {
public:
  typedef _CORBA_Sequence_Value<T,T_Elem,T_Helper> T_seq;

  inline _CORBA_ULong maximum() const { return pd_max; }
  inline _CORBA_ULong length() const  { return pd_len; }

  inline void length(_CORBA_ULong len)
  {
    if (len) {
      if (len > pd_max) {
	if (pd_bounded) {
	  _CORBA_bound_check_error();
	  // Never reach here.
	}
	// Grow exponentially
	_CORBA_ULong newmax = pd_max * 2;
	copybuffer((len > newmax) ? len : newmax);
      }
      else if (!pd_buf) {
	// Allocate initial buffer
	copybuffer(pd_max);
      }
      else {
	// We have shrunk. Clear the entries at the top
	for (_CORBA_ULong i = len; i < pd_len; i++) {
	  T_Helper::remove_ref(pd_buf[i]);
	  pd_buf[i] = 0;
	}
      }
    }
    else {
      // Zero length. Deallocate buffer if it is owned by us.
      if (pd_rel && pd_buf) {
	freebuf(pd_buf);
	pd_buf = 0;
	if (!pd_bounded)
	  pd_max = 0;
      }
    }
    pd_len = len;
  }

  inline T_Elem operator[] (_CORBA_ULong i) {
    if( i >= pd_len )  _CORBA_bound_check_error();
    return T_Elem(pd_buf[i],pd_rel);
  }
  inline T_Elem operator[] (_CORBA_ULong i) const {
    if( i >= pd_len )  _CORBA_bound_check_error();
    return T_Elem(pd_buf[i],pd_rel);
  }

  static inline T** allocbuf(_CORBA_ULong nelems) { 
    if (!nelems) return 0;

    T** b = new T*[nelems+1];

    for (_CORBA_ULong i_ = 1; i_ < nelems+1; i_++) {
      b[i_] = 0;
    }
    b[0] = (T*) (omni_ptr_arith_t) nelems;
    return b+1;
  }

  static inline void freebuf(T** buf) { 
    if (!buf) return;

    T** b = buf-1;

    _CORBA_ULong l = (_CORBA_ULong) (omni_ptr_arith_t) b[0];
    for (_CORBA_ULong i = 0; i < l; i++) {
      if (buf[i]) {
	T_Helper::remove_ref(buf[i]);
      }
    }
    b[0] = (T*) 0;
    delete [] b;
  }

  // CORBA 2.3 additions
  inline _CORBA_Boolean release() const { return pd_rel; }

  inline T** get_buffer(_CORBA_Boolean orphan = 0) {
    if (pd_max && !pd_buf) {
      copybuffer(pd_max);
    }
    if (!orphan) {
      return pd_buf;
    }
    else {
      if (!pd_rel) {
	return 0;
      }
      else {
	T** tmp = pd_buf;
	pd_buf = 0;
	if (!pd_bounded) {
	  pd_max = 0;
	}
	pd_len = 0;
	pd_rel = 1;
	return tmp;
      }
    }
  }

  inline T*const * get_buffer() const { 
    if (pd_max && !pd_buf) {
      T_seq* s = OMNI_CONST_CAST(T_seq*, this);
      s->copybuffer(pd_max);
    }
    return pd_buf; 
  }

  inline ~_CORBA_Sequence_Value() {
    if (pd_rel && pd_buf) freebuf(pd_buf);
    pd_buf = 0;
  }


  // omniORB extensions
  inline void operator>>= (cdrStream &s) const;
  inline void operator<<= (cdrStream &s);

  inline T** NP_data() const  { return pd_buf; }
  inline void NP_norelease()  { pd_rel = 0;     }

protected:
  inline _CORBA_Sequence_Value()
    : pd_max(0), pd_len(0), pd_rel(1), pd_bounded(0), pd_buf(0) {}

  inline _CORBA_Sequence_Value(_CORBA_ULong max,
			       _CORBA_Boolean bounded=0)
    : pd_max(max), pd_len(0), pd_rel(1), pd_bounded(bounded), pd_buf(0) {}

  inline _CORBA_Sequence_Value(_CORBA_ULong max,
			       _CORBA_ULong len,
			       T** value, 
			       _CORBA_Boolean release_ = 0,
			       _CORBA_Boolean bounded = 0)
    : pd_max(max), pd_len(len), pd_rel(release_),
      pd_bounded(bounded), pd_buf(value)
  {
    if (len > max || (len && !value)) {
      _CORBA_bound_check_error();
      // never reach here
    }
  }

  inline _CORBA_Sequence_Value(const T_seq& s)
    : pd_max(s.pd_max), pd_len(0), pd_rel(1),
      pd_bounded(s.pd_bounded), pd_buf(0)
  {
    length(s.pd_len);
    for (_CORBA_ULong i = 0; i < pd_len; i++) {
      pd_buf[i] = s.pd_buf[i];
      if (pd_buf[i])
	T_Helper::add_ref(pd_buf[i]);
    }
  }

  inline T_seq& operator= (const T_seq& s) {
    _CORBA_ULong i;

    if (pd_rel) {
      for (i=0; i < pd_len; i++) {
	T_Helper::remove_ref(pd_buf[i]);
	pd_buf[i] = 0;
      }
      pd_len = 0;
      length(s.pd_len);
      for (i = 0; i < pd_len; i++) {
	pd_buf[i] = s.pd_buf[i];
	if (pd_buf[i])
	  T_Helper::add_ref(pd_buf[i]);
      }
    }
    else {
      pd_len = 0;
      length(s.pd_len);
      for (i = 0; i < pd_len; i++) {
	pd_buf[i] = s.pd_buf[i];
      }
    }
    return *this;
  }

  // CORBA 2.3 additions
  inline void replace(_CORBA_ULong max, _CORBA_ULong len, T** data,
		      _CORBA_Boolean release_ = 0) {
    if (len > max || (len && !data)) {
      _CORBA_bound_check_error();
      // never reach here
    }
    if (pd_rel && pd_buf) {
      freebuf(pd_buf);
    }
    pd_max = max;
    pd_len = len;
    pd_buf = data;
    pd_rel = release_;
  }


protected:

  void copybuffer(_CORBA_ULong newmax) {
    // replace pd_buf with a new buffer of size newmax.
    // Invariant:  pd_len <= newmax
    //
    T** newdata = allocbuf(newmax);
    if (!newdata) {
      _CORBA_new_operator_return_null();
      // never reach here
    }
    if (pd_rel) {
      for (unsigned long i_=0; i_ < pd_len; i_++) {
	newdata[i_] = pd_buf[i_];
	pd_buf[i_]  = 0;
      }
      if (pd_buf) {
	freebuf(pd_buf);
      }
    }
    else {
      for (unsigned long i_=0; i_ < pd_len; i_++) {
	T_Helper::add_ref(pd_buf[i_]);
	newdata[i_] = pd_buf[i_];
      }
      pd_rel = 1;
    }
    pd_buf = newdata;
    pd_max = newmax;
  }

  _CORBA_ULong    pd_max;
  _CORBA_ULong    pd_len;
  _CORBA_Boolean  pd_rel;
  _CORBA_Boolean  pd_bounded;
  T**             pd_buf;
};


//////////////////////////////////////////////////////////////////////
///////////////// _CORBA_Unbounded_Sequence_Value ////////////////////
//////////////////////////////////////////////////////////////////////

template <class T, class T_Elem, class T_Helper>
class _CORBA_Unbounded_Sequence_Value : public _CORBA_Sequence_Value<T,T_Elem,T_Helper> {
public:
  typedef _CORBA_Unbounded_Sequence_Value<T,T_Elem,T_Helper> T_seq;
  typedef _CORBA_Sequence_Value<T,T_Elem,T_Helper>           Base_T_seq;

  inline _CORBA_Unbounded_Sequence_Value() {}
  inline _CORBA_Unbounded_Sequence_Value(_CORBA_ULong max) : 
    Base_T_seq(max) {}

  inline _CORBA_Unbounded_Sequence_Value(_CORBA_ULong    max,
					  _CORBA_ULong   len,
					  T**            value,
					  _CORBA_Boolean rel = 0) : 
    Base_T_seq(max,len,value,rel) {}

  inline _CORBA_Unbounded_Sequence_Value(const T_seq& s) : Base_T_seq(s) {}

  inline ~_CORBA_Unbounded_Sequence_Value() {}

  inline T_seq &operator= (const T_seq& s) {
    Base_T_seq::operator= (s);
    return *this;
  };

  // CORBA 2.3 additions
  inline void replace(_CORBA_ULong max, _CORBA_ULong len, T** data,
		      _CORBA_Boolean release_ = 0) {
    Base_T_seq::replace(max,len,data,release_);
  }
};

//////////////////////////////////////////////////////////////////////
///////////////// _CORBA_Bounded_Sequence_Value //////////////////////
//////////////////////////////////////////////////////////////////////

template<class T, class T_Elem, class T_Helper, int max>
class _CORBA_Bounded_Sequence_Value : public _CORBA_Sequence_Value<T,T_Elem,T_Helper> {
public:
  typedef _CORBA_Bounded_Sequence_Value<T,T_Elem,T_Helper,max> T_seq;
  typedef _CORBA_Sequence_Value<T,T_Elem,T_Helper>             Base_T_seq;

  inline _CORBA_Bounded_Sequence_Value() : Base_T_seq(max,1){}

  inline _CORBA_Bounded_Sequence_Value(_CORBA_ULong    len,
					T**            value,
					_CORBA_Boolean rel = 0) : 
    Base_T_seq(max,len,value,rel,1) {}

  inline _CORBA_Bounded_Sequence_Value(const T_seq& s) : Base_T_seq(s) {}

  inline ~_CORBA_Bounded_Sequence_Value() {}

  inline T_seq& operator= (const T_seq&s) {
    Base_T_seq::operator= (s);
    return *this;
  }

  static inline T** allocbuf(_CORBA_ULong /*nelems*/) {
    return Base_T_seq::allocbuf(max);
  }

  static inline T** allocbuf() { return allocbuf(max); }

  // CORBA 2.3 additions
  inline void replace(_CORBA_ULong len, T** data,
		      _CORBA_Boolean release_ = 0) {
    Base_T_seq::replace(max,len,data,release_);
  }
};




#endif // __VALUETEMPLATEDECLS_H__