changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Fields / PointerFields / OSGPointerMField.inl
blob9617def79eea528318fbceec991aa6f2edb389a3
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *                 Copyright (C) 2008 by the OpenSG Forum                    *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
10  *                                                                           *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13  *                                License                                    *
14  *                                                                           *
15  * This library is free software; you can redistribute it and/or modify it   *
16  * under the terms of the GNU Library General Public License as published    *
17  * by the Free Software Foundation, version 2.                               *
18  *                                                                           *
19  * This library is distributed in the hope that it will be useful, but       *
20  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
22  * Library General Public License for more details.                          *
23  *                                                                           *
24  * You should have received a copy of the GNU Library General Public         *
25  * License along with this library; if not, write to the Free Software       *
26  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
27  *                                                                           *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30  *                                Changes                                    *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35  *                                                                           *
36  *                                                                           *
37 \*---------------------------------------------------------------------------*/
39 OSG_BEGIN_NAMESPACE
41 /*-------------------------------------------------------------------------*/
42 /* PointerMFieldIterator<PtrTypeT>                                      */
43 /*-------------------------------------------------------------------------*/
45 /*-------------------------------------------------------------------------*/
46 /* Constructors                                                            */
48 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
49 PointerMFieldIterator<PtrTypeT,
50                       RefCountPolicy,
51                       NamespaceI    >::PointerMFieldIterator(void) :
52      Inherited(    ),
53     _pField   (NULL)
57 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
58 PointerMFieldIterator<PtrTypeT,
59                       RefCountPolicy,
60                       NamespaceI    >::PointerMFieldIterator(
61                           const Self &source) :
62      Inherited(source        ),
63     _pField   (source._pField)
67 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
68 PointerMFieldIterator<PtrTypeT,
69                       RefCountPolicy,
70                       NamespaceI    >::PointerMFieldIterator(
71                           const PtrStoreItType &storeIter,
72                                 MFieldType     *pField) :
73      Inherited(storeIter),
74     _pField   (pField   )
78 /*-------------------------------------------------------------------------*/
79 /* Destructor                                                              */
81 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
82 PointerMFieldIterator<PtrTypeT,
83                       RefCountPolicy,
84                       NamespaceI    >::~PointerMFieldIterator(void)
88 /*-------------------------------------------------------------------------*/
89 /* Operators                                                               */
91 #ifndef OSG_CLEAN_FCFIELDS
92 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
93 typename PointerMFieldIterator<PtrTypeT,
94                                RefCountPolicy,
95                                NamespaceI    >::reference
96     PointerMFieldIterator<PtrTypeT,
97                           RefCountPolicy,
98                           NamespaceI    >::operator *(void) const
100     return reference(*this, _pField);
104 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
105 typename PointerMFieldIterator<PtrTypeT,
106                                RefCountPolicy,
107                                NamespaceI    >::reference
108     PointerMFieldIterator<PtrTypeT,
109                           RefCountPolicy,
110                           NamespaceI>::operator [](
111                               const difference_type offset) const
113     return reference(*this + offset, _pField);
115 #else
116 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
117 typename PointerMFieldIterator<PtrTypeT,
118                                RefCountPolicy,
119                                NamespaceI    >::const_value
120     PointerMFieldIterator<PtrTypeT,
121                           RefCountPolicy,
122                           NamespaceI    >::operator *(void) const
124     return static_cast<const_value>(
125         AccessHandler::validate(this->Inherited::operator*()));
129 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
130 typename PointerMFieldIterator<PtrTypeT,
131                                RefCountPolicy,
132                                NamespaceI    >::const_value
133     PointerMFieldIterator<PtrTypeT,
134                           RefCountPolicy,
135                           NamespaceI>::operator [](
136                               const difference_type offset) const
138     return *(*this + offset);
140 #endif
142 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
143 typename PointerMFieldIterator<PtrTypeT,
144                                RefCountPolicy,
145                                NamespaceI    >::Self &
146     PointerMFieldIterator<PtrTypeT,
147                           RefCountPolicy,
148                           NamespaceI>::operator ++(void)
150     this->Inherited::operator++();
152     return *this;
155 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
156 typename PointerMFieldIterator<PtrTypeT,
157                                RefCountPolicy,
158                                NamespaceI    >::Self
159     PointerMFieldIterator<PtrTypeT,
160                           RefCountPolicy,
161                           NamespaceI    >::operator ++(int)
163     Self retVal = *this;
165     this->Inherited::operator++();
167     return retVal;
170 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
171 typename PointerMFieldIterator<PtrTypeT,
172                                RefCountPolicy,
173                                NamespaceI    >::Self &
174     PointerMFieldIterator<PtrTypeT,
175                           RefCountPolicy,
176                           NamespaceI    >::operator --(void)
178     this->Inherited::operator--();
180     return *this;
183 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
184 typename PointerMFieldIterator<PtrTypeT,
185                                RefCountPolicy,
186                                NamespaceI    >::Self
187     PointerMFieldIterator<PtrTypeT,
188                           RefCountPolicy,
189                           NamespaceI    >::operator --(int)
191     Self retVal = *this;
193     this->Inherited::operator--();
195     return retVal;
198 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
199 typename PointerMFieldIterator<PtrTypeT,
200                                RefCountPolicy,
201                                NamespaceI    >::Self &
202     PointerMFieldIterator<PtrTypeT,
203                           RefCountPolicy,
204                           NamespaceI    >::operator +=(
205                               const difference_type offset)
207     this->Inherited::operator+=(offset);
209     return *this;
212 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
213 typename PointerMFieldIterator<PtrTypeT,
214                                RefCountPolicy,
215                                NamespaceI    >::Self
216     PointerMFieldIterator<PtrTypeT,
217                           RefCountPolicy,
218                           NamespaceI    >::operator +(
219                               const difference_type offset) const
221     Self retVal = *this;
223     return retVal += offset;
226 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
227 typename PointerMFieldIterator<PtrTypeT,
228                                RefCountPolicy,
229                                NamespaceI    >::Self &
230     PointerMFieldIterator<PtrTypeT,
231                           RefCountPolicy,
232                           NamespaceI    >::operator -=(
233                               const difference_type offset)
235     this->Inherited::operator-=(offset);
237     return *this;
240 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
241 typename PointerMFieldIterator<PtrTypeT,
242                                RefCountPolicy,
243                                NamespaceI    >::Self
244     PointerMFieldIterator<PtrTypeT,
245                           RefCountPolicy,
246                           NamespaceI    >::operator - (
247                               const difference_type offset) const
249     Self retVal = *this;
251     return retVal -= offset;
254 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
255 bool PointerMFieldIterator<PtrTypeT,
256                            RefCountPolicy,
257                            NamespaceI    >::operator ==(const Self &rhs) const
259     return *(static_cast<const Inherited *>(this)) == rhs;
262 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
263 bool PointerMFieldIterator<PtrTypeT,
264                            RefCountPolicy,
265                            NamespaceI    >::operator !=(const Self &rhs) const
267     return ! (*this == rhs);
270 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
271 bool PointerMFieldIterator<PtrTypeT,
272                            RefCountPolicy,
273                            NamespaceI    >::operator ==(
274                                const const_iterator &rhs) const
276     return *(static_cast<const Inherited *>(this)) == rhs;
279 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
280 bool PointerMFieldIterator<PtrTypeT,
281                            RefCountPolicy,
282                            NamespaceI    >::operator !=(
283                                const const_iterator &rhs) const
285     return ! (*this == rhs);
288 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
289 const typename PointerMFieldIterator<PtrTypeT,
290                                      RefCountPolicy,
291                                      NamespaceI    >::Self & 
292     PointerMFieldIterator<PtrTypeT,
293                           RefCountPolicy,
294                           NamespaceI    >::operator =(const Self &rhs) 
296     Inherited::operator =(rhs);
298     _pField = rhs._pField;
300     return *this;
303 /*-------------------------------------------------------------------------*/
304 /* Base                                                                    */
306 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
307 const typename PointerMFieldIterator<PtrTypeT,
308                                      RefCountPolicy,
309                                      NamespaceI    >::PtrStoreItType &
310     PointerMFieldIterator<PtrTypeT,
311                           RefCountPolicy,
312                           NamespaceI    >::base(void) const
314     return *this;
317 /*-------------------------------------------------------------------------*/
318 /* Free Functions                                                          */
320 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
321 typename PointerMFieldIterator<PtrTypeT,
322                                RefCountPolicyT,
323                                NamespaceI      >::difference_type
324     operator-(PointerMFieldIterator<PtrTypeT,
325                                     RefCountPolicyT,
326                                     NamespaceI      > const &lhs,
327               PointerMFieldIterator<PtrTypeT,
328                                     RefCountPolicyT,
329                                     NamespaceI      > const &rhs )
331     return (lhs.base() - rhs.base());
334 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
335 PointerMFieldIterator<PtrTypeT,
336                       RefCountPolicyT,
337                       NamespaceI      >
338     operator+(typename PointerMFieldIterator<PtrTypeT,
339                                              RefCountPolicyT,
340                                              NamespaceI      >::differece_type const offset,
341               PointerMFieldIterator<PtrTypeT,
342                                     RefCountPolicyT,
343                                     NamespaceI      >                          const &rhs   )
345     return PointerMFieldIterator<PtrTypeT,
346                                  RefCountPolicyT,
347                                  NamespaceI      >(rhs) += offset;
351 /*-------------------------------------------------------------------------*/
352 /* PointerMFieldConstIterator<PtrTypeT>                                 */
353 /*-------------------------------------------------------------------------*/
355 /*-------------------------------------------------------------------------*/
356 /* Constructors                                                            */
358 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
359 PointerMFieldConstIterator<PtrTypeT,
360                            RefCountPolicy,
361                            NamespaceI    >::PointerMFieldConstIterator(void) :
362     Inherited()
366 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
367 PointerMFieldConstIterator<PtrTypeT,
368                            RefCountPolicy,
369                            NamespaceI    >::PointerMFieldConstIterator(
370                             const Self &source) :
371     Inherited(source)
375 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
376 PointerMFieldConstIterator<PtrTypeT,
377                            RefCountPolicy,
378                            NamespaceI    >::PointerMFieldConstIterator(
379                             const iterator &fieldIter) :
380     Inherited(fieldIter.base())
384 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
385 PointerMFieldConstIterator<PtrTypeT,
386                            RefCountPolicy,
387                            NamespaceI    >::PointerMFieldConstIterator(
388                             const PtrStoreConstItType &storeIter) :
389     Inherited(storeIter)
393 /*-------------------------------------------------------------------------*/
394 /* Destructor                                                              */
396 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
397 PointerMFieldConstIterator<PtrTypeT,
398                            RefCountPolicy,
399                            NamespaceI    >::~PointerMFieldConstIterator(void)
403 /*-------------------------------------------------------------------------*/
404 /* Operators                                                               */
406 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
407 typename PointerMFieldConstIterator<PtrTypeT,
408                                     RefCountPolicy,
409                                     NamespaceI    >::const_value
410     PointerMFieldConstIterator<PtrTypeT,
411                                RefCountPolicy,
412                                NamespaceI    >::operator *(void) const
414     return static_cast<const_value>(
415         AccessHandler::validate(this->Inherited::operator*()));
419 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
420 typename PointerMFieldConstIterator<PtrTypeT,
421                                     RefCountPolicy,
422                                     NamespaceI   >::const_value
423     PointerMFieldConstIterator<PtrTypeT,
424                                RefCountPolicy,
425                                NamespaceI    >::operator [](
426         const difference_type offset) const
428     return *(*this + offset);
431 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
432 typename PointerMFieldConstIterator<PtrTypeT,
433                                     RefCountPolicy,
434                                     NamespaceI    >::Self &
435     PointerMFieldConstIterator<PtrTypeT,
436                                RefCountPolicy,
437                                NamespaceI    >::operator ++(void)
439     this->Inherited::operator++();
441     return *this;
444 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
445 typename PointerMFieldConstIterator<PtrTypeT,
446                                     RefCountPolicy,
447                                     NamespaceI    >::Self
448     PointerMFieldConstIterator<PtrTypeT,
449                                RefCountPolicy,
450                                NamespaceI    >::operator ++(int)
452     Self retVal = *this;
454     this->Inherited::operator++();
456     return retVal;
459 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
460 typename PointerMFieldConstIterator<PtrTypeT,
461                                     RefCountPolicy,
462                                     NamespaceI    >::Self &
463     PointerMFieldConstIterator<PtrTypeT,
464                                RefCountPolicy,
465                                NamespaceI    >::operator --(void)
467     this->Inherited::operator--();
469     return *this;
472 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
473 typename PointerMFieldConstIterator<PtrTypeT,
474                                     RefCountPolicy,
475                                     NamespaceI    >::Self
476     PointerMFieldConstIterator<PtrTypeT,
477                                RefCountPolicy,
478                                NamespaceI    >::operator --(int)
480     Self retVal = *this;
482     this->Inherited::oprator--();
484     return retVal;
487 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
488 typename PointerMFieldConstIterator<PtrTypeT,
489                                     RefCountPolicy,
490                                     NamespaceI    >::Self &
491     PointerMFieldConstIterator<PtrTypeT,
492                                RefCountPolicy,
493                                NamespaceI    >::operator +=(
494                                    const difference_type offset)
496     this->Inherited::operator+=(offset);
498     return *this;
501 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
502 typename PointerMFieldConstIterator<PtrTypeT,
503                                     RefCountPolicy,
504                                     NamespaceI    >::Self
505     PointerMFieldConstIterator<PtrTypeT,
506                                RefCountPolicy,
507                                NamespaceI    >::operator +(
508                                    const difference_type offset) const
510     Self retVal = *this;
512     return retVal += offset;
515 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
516 typename PointerMFieldConstIterator<PtrTypeT,
517                                     RefCountPolicy,
518                                     NamespaceI    >::Self &
519     PointerMFieldConstIterator<PtrTypeT,
520                                RefCountPolicy,
521                                NamespaceI    >::operator -=(
522                                    const difference_type offset)
524     this->Inherited::operator-=(offset);
526     return *this;
529 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
530 typename PointerMFieldConstIterator<PtrTypeT,
531                                     RefCountPolicy,
532                                     NamespaceI    >::Self
533     PointerMFieldConstIterator<PtrTypeT,
534                                RefCountPolicy,
535                                NamespaceI    >::operator -(
536                                    const difference_type offset) const
538     Self retVal = *this;
540     return retVal -= offset;
543 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
544 bool PointerMFieldConstIterator<PtrTypeT,
545                                 RefCountPolicy,
546                                 NamespaceI    >::operator ==(
547                                    const Self &rhs) const
549     return *(static_cast<const Inherited *>(this)) == rhs;
552 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
553 bool PointerMFieldConstIterator<PtrTypeT,
554                                 RefCountPolicy,
555                                 NamespaceI    >::operator !=(
556                                    const Self &rhs) const
558     return ! (*this == rhs);
561 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
562 bool PointerMFieldConstIterator<PtrTypeT,
563                                 RefCountPolicy,
564                                 NamespaceI    >::operator ==(
565                                     const iterator &rhs) const
567     return *(static_cast<const Inherited *>(this)) == rhs;
570 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
571 bool PointerMFieldConstIterator<PtrTypeT,
572                                 RefCountPolicy,
573                                 NamespaceI    >::operator !=(
574                                     const iterator &rhs) const
576     return ! (*this == rhs);
579 /*-------------------------------------------------------------------------*/
580 /* Base                                                                    */
582 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
583 const typename PointerMFieldConstIterator<PtrTypeT,
584                                           RefCountPolicy,
585                                           NamespaceI    >::PtrStoreConstItType &
586     PointerMFieldConstIterator<PtrTypeT,
587                                RefCountPolicy,
588                                NamespaceI    >::base(void) const
590     return *this;
594 /*-------------------------------------------------------------------------*/
595 /* Free Functions                                                          */
597 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
598 typename PointerMFieldConstIterator<PtrTypeT,
599                                     RefCountPolicyT,
600                                     NamespaceI      >::difference_type
601     operator-(PointerMFieldConstIterator<PtrTypeT,
602                                          RefCountPolicyT,
603                                          NamespaceI      > const &lhs,
604               PointerMFieldConstIterator<PtrTypeT,
605                                          RefCountPolicyT,
606                                          NamespaceI      > const &rhs )
608     return (lhs.base() - rhs.base());
611 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
612 typename PointerMFieldConstIterator<PtrTypeT,
613                                     RefCountPolicyT,
614                                     NamespaceI      >::difference_type
615     operator-(PointerMFieldIterator     <PtrTypeT,
616                                          RefCountPolicyT,
617                                          NamespaceI      > const &lhs,
618               PointerMFieldConstIterator<PtrTypeT,
619                                          RefCountPolicyT,
620                                          NamespaceI      > const &rhs )
622     return (lhs.base() - rhs.base());
625 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
626 typename PointerMFieldConstIterator<PtrTypeT,
627                                     RefCountPolicyT,
628                                     NamespaceI      >::difference_type
629     operator-(PointerMFieldConstIterator<PtrTypeT,
630                                          RefCountPolicyT,
631                                          NamespaceI      > const &lhs,
632               PointerMFieldIterator     <PtrTypeT,
633                                          RefCountPolicyT,
634                                          NamespaceI      > const &rhs )
636     return (lhs.base() - rhs.base());
639 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
640 PointerMFieldConstIterator<PtrTypeT,
641                            RefCountPolicyT,
642                            NamespaceI      >
643     operator+(typename PointerMFieldConstIterator<PtrTypeT,
644                                                   RefCountPolicyT,
645                                                   NamespaceI       >::difference_type const offset,
646               PointerMFieldConstIterator         <PtrTypeT,
647                                                   RefCountPolicyT,
648                                                   NamespaceI       >                  const &rhs   )
650     return PointerMFieldConstIterator<PtrTypeT,
651                                       RefCountPolicyT,
652                                       NamespaceI      >(rhs) += offset;
656 /*-------------------------------------------------------------------------*/
657 /* PointerMFieldReferenceProxy<PtrTypeT>                                */
658 /*-------------------------------------------------------------------------*/
660 #ifndef OSG_CLEAN_FCFIELDS
661 /*-------------------------------------------------------------------------*/
662 /* Constructors                                                            */
664 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
665 PointerMFieldReferenceProxy<PtrTypeT,
666                             RefCountPolicy,
667                             NamespaceI    >::PointerMFieldReferenceProxy(
668                                 const PtrStoreItType &storeIter,
669                                       MFieldType     *pField   ) :
670     _storeIter(storeIter),
671     _pField   (pField   )
675 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
676 PointerMFieldReferenceProxy<PtrTypeT,
677                             RefCountPolicy,
678                             NamespaceI    >::PointerMFieldReferenceProxy(
679                                 const Self &source) :
680     _storeIter(source._storeIter),
681     _pField   (source._pField   )
685 /*-------------------------------------------------------------------------*/
686 /* Destructor                                                              */
688 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
689 PointerMFieldReferenceProxy<PtrTypeT,
690                             RefCountPolicy,
691                             NamespaceI    >::~PointerMFieldReferenceProxy(void)
695 /*-------------------------------------------------------------------------*/
696 /* Operators                                                               */
698 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
699 PointerMFieldReferenceProxy<PtrTypeT,
700                             RefCountPolicy,
701                             NamespaceI    >::operator
702 #if defined(_MSC_VER) && _MSC_VER < 1400
703 typename PointerMFieldReferenceProxy<PtrTypeT,
704                                      RefCountPolicy,
705                                      NamespaceI    >::
706 #endif
707                                                       value_type(void) const
709     return static_cast<value_type>(AccessHandler::validate(*_storeIter));
712 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
713 typename PointerMFieldReferenceProxy<PtrTypeT,
714                                      RefCountPolicy,
715                                      NamespaceI    >::value_type
716      PointerMFieldReferenceProxy<PtrTypeT,
717                                  RefCountPolicy,
718                                  NamespaceI    >::operator->(void) const
720     return static_cast<value_type>(AccessHandler::validate(*_storeIter));
723 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
724 void PointerMFieldReferenceProxy<PtrTypeT,
725                                  RefCountPolicy,
726                                  NamespaceI    >::operator=(value_type newValue)
728     AccessHandler::onReplace(_pField, *_storeIter, newValue);
730     *_storeIter = newValue;
733 #endif
735 /*-------------------------------------------------------------------------*/
736 /* PointerPointerMField<PtrTypeT,                                          */
737 /*                   NamespaceI  >                                         */
738 /*-------------------------------------------------------------------------*/
740 /*-------------------------------------------------------------------------*/
741 /* Class Type                                                              */
743 /*-------------------------------------------------------------------------*/
744 /* Constructors                                                            */
746 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
747 PointerMField<PtrTypeT,
748               RefCountPolicy,
749               NamespaceI    >::PointerMField(void) :
750     Inherited()
754 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
755 PointerMField<PtrTypeT,
756               RefCountPolicy,
757               NamespaceI    >::PointerMField(Self const &other) :
758     Inherited(other)
762 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
763 PointerMField<PtrTypeT,
764               RefCountPolicy,
765               NamespaceI    >::PointerMField(UInt32 const initSize) :
766     Inherited(initSize)
770 /*-------------------------------------------------------------------------*/
771 /* Destructor                                                              */
773 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
774 PointerMField<PtrTypeT,
775               RefCountPolicy,
776               NamespaceI    >::~PointerMField(void)
780 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
781 void PointerMField<PtrTypeT,
782                    RefCountPolicy,
783                    NamespaceI    >::copyFromBin(BinaryDataHandler &pMem)
785     Inherited::copyFromBin(pMem);
790 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
791 typename PointerMField<PtrTypeT,
792                        RefCountPolicy,
793                        NamespaceI    >::iterator
794     PointerMField<PtrTypeT,
795                   RefCountPolicy,
796                   NamespaceI    >::begin_nc(void)
798     return iterator(this->_ptrStore.begin(), this);
801 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
802 typename PointerMField<PtrTypeT,
803                        RefCountPolicy,
804                        NamespaceI    >::iterator
805     PointerMField<PtrTypeT,
806                   RefCountPolicy,
807                   NamespaceI    >::end_nc(void)
809     return iterator(this->_ptrStore.end(), this);
812 #ifndef OSG_CLEAN_FCFIELDS
813 #if 0
814 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
815 typename PointerMField<PtrTypeT,
816                        RefCountPolicy,
817                        NamespaceI    >::reference
818     PointerMField<PtrTypeT,
819                   RefCountPolicy,
820                   NamespaceI    >::front_nc(void)
824 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
825 typename PointerMField<PtrTypeT,
826                        RefCountPolicy,
827                        NamespaceI    >::reference back_nc (void              );
828 #endif
829 #endif
831 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
832 typename PointerMField<PtrTypeT,
833                        RefCountPolicy,
834                        NamespaceI    >::iterator
835     PointerMField<PtrTypeT,
836                        RefCountPolicy,
837                        NamespaceI    >::find_nc(const_value value)
839     return iterator(this->ptrStoreFind(value),
840                     this                     );
843 /*-------------------------------------------------------------------------*/
844 /* Std Library Interface                                                   */
846 #ifndef OSG_CLEAN_FCFIELDS
847 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
848 typename PointerMField<PtrTypeT,
849                        RefCountPolicy,
850                        NamespaceI    >::iterator
851     PointerMField<PtrTypeT,
852                   RefCountPolicy,
853                   NamespaceI    >::begin(void)
855 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
856     BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
857 #endif
859     return iterator(this->_ptrStore.begin(), this);
862 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
863 typename PointerMField<PtrTypeT,
864                        RefCountPolicy,
865                        NamespaceI    >::iterator
866     PointerMField<PtrTypeT,
867                   RefCountPolicy,
868                   NamespaceI    >::end(void)
870 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
871     BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
872 #endif
874     return iterator(this->_ptrStore.end(), this);
877 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
878 typename PointerMField<PtrTypeT,
879                        RefCountPolicy,
880                        NamespaceI    >::reverse_iterator
881     PointerMField<PtrTypeT,
882                   RefCountPolicy,
883                   NamespaceI    >::rbegin(void)
885 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
886     BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
887 #endif
889     return reverse_iterator(this->end());
892 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
893 typename PointerMField<PtrTypeT,
894                        RefCountPolicy,
895                        NamespaceI    >::reverse_iterator
896     PointerMField<PtrTypeT,
897                   RefCountPolicy,
898                   NamespaceI    >::rend(void)
900 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
901     BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
902 #endif
904     return reverse_iterator(this->begin());
906 #endif
908 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
909 typename PointerMField<PtrTypeT,
910                        RefCountPolicy,
911                        NamespaceI    >::const_iterator
912     PointerMField<PtrTypeT,
913                   RefCountPolicy,
914                   NamespaceI    >::begin(void) const
916     return const_iterator(this->_ptrStore.begin());
919 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
920 typename PointerMField<PtrTypeT,
921                        RefCountPolicy,
922                        NamespaceI    >::const_iterator
923     PointerMField<PtrTypeT,
924                   RefCountPolicy,
925                   NamespaceI    >::end(void) const
927     return const_iterator(this->_ptrStore.end());
930 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
931 typename PointerMField<PtrTypeT,
932                        RefCountPolicy,
933                        NamespaceI    >::const_reverse_iterator
934     PointerMField<PtrTypeT,
935                   RefCountPolicy,
936                   NamespaceI    >::rbegin(void) const
938     return const_reverse_iterator(this->end());
941 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
942 typename PointerMField<PtrTypeT,
943                        RefCountPolicy,
944                        NamespaceI    >::const_reverse_iterator
945     PointerMField<PtrTypeT,
946                   RefCountPolicy,
947                   NamespaceI    >::rend(void) const
949     return const_reverse_iterator(this->begin());
952 #ifndef OSG_CLEAN_FCFIELDS
953 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
954 typename PointerMField<PtrTypeT,
955                        RefCountPolicy,
956                        NamespaceI    >::reference
957     PointerMField<PtrTypeT,
958                   RefCountPolicy,
959                   NamespaceI    >::front(void)
961 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
962     BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
963 #endif
965     return reference(this->_ptrStore.begin(), this);
967 #endif
969 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
970 typename PointerMField<PtrTypeT,
971                        RefCountPolicy,
972                        NamespaceI    >::const_value
973     PointerMField<PtrTypeT,
974                   RefCountPolicy,
975                   NamespaceI    >::front(void) const
977     return static_cast<const_value>(this->ptrStoreGet(this->_ptrStore.begin()));
980 #ifndef OSG_CLEAN_FCFIELDS
981 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
982 typename PointerMField<PtrTypeT,
983                        RefCountPolicy,
984                        NamespaceI    >::reference
985     PointerMField<PtrTypeT,
986                   RefCountPolicy,
987                   NamespaceI    >::back(void)
989 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
990     BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
991 #endif
993     return reference(this->_ptrStore.end() - 1, this);
995 #endif
997 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
998 typename PointerMField<PtrTypeT,
999                        RefCountPolicy,
1000                        NamespaceI    >::const_value
1001     PointerMField<PtrTypeT,
1002                   RefCountPolicy,
1003                   NamespaceI    >::back(void) const
1005     return static_cast<const_value>(
1006         this->ptrStoreGet(this->_ptrStore.end() - 1));
1010 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1011 typename PointerMField<PtrTypeT,
1012                        RefCountPolicy,
1013                        NamespaceI    >::iterator
1014     PointerMField<PtrTypeT,
1015                   RefCountPolicy,
1016                   NamespaceI  >::insert(iterator pos, const_value value)
1018     return iterator(this->ptrStoreInsert(pos.base(), value), this);
1021 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1022 void PointerMField<PtrTypeT,
1023                    RefCountPolicy,
1024                    NamespaceI     >::insert(iterator    pos,
1025                                             size_type   n,
1026                                             const_value value)
1028     this->ptrStoreInsert(pos, n, value);
1031 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1032 template <class InputIteratorT                                        > inline
1033 void PointerMField<PtrTypeT,
1034                    RefCountPolicy,
1035                    NamespaceI    >::insert(iterator       pos,
1036                                            InputIteratorT first,
1037                                            InputIteratorT last)
1039     this->ptrStoreInsert(pos, first, last);
1042 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1043 void PointerMField<PtrTypeT,
1044                    RefCountPolicy,
1045                    NamespaceI    >::erase(size_type index)
1047     return this->ptrStoreErase(index);
1050 #ifndef OSG_CLEAN_FCFIELDS
1051 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1052 typename PointerMField<PtrTypeT,
1053                        RefCountPolicy,
1054                        NamespaceI    >::iterator
1055     PointerMField<PtrTypeT,
1056                   RefCountPolicy,
1057                   NamespaceI    >::erase(iterator pos)
1059     return iterator(this->ptrStoreErase(pos.base()), this);
1062 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1063 typename PointerMField<PtrTypeT,
1064                        RefCountPolicy,
1065                        NamespaceI    >::iterator
1066     PointerMField<PtrTypeT,
1067                   RefCountPolicy,
1068                   NamespaceI    >::erase(iterator first, iterator last)
1070     return iterator(this->ptrStoreErase(first.base(), last.base()), this);
1072 #endif
1074 #ifndef OSG_CLEAN_FCFIELDS
1075 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1076 typename PointerMField<PtrTypeT,
1077                        RefCountPolicy,
1078                        NamespaceI    >::iterator
1079     PointerMField<PtrTypeT,
1080                   RefCountPolicy,
1081                   NamespaceI    >::find(const_value value)
1083 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
1084     BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
1085 #endif
1087     return iterator(this->ptrStoreFind(value),
1088                     this                     );
1090 #endif
1092 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1093 typename PointerMField<PtrTypeT,
1094                        RefCountPolicy,
1095                        NamespaceI    >::const_iterator
1096     PointerMField<PtrTypeT,
1097                   RefCountPolicy,
1098                   NamespaceI    >::find(const_value value) const
1100     return const_iterator(this->ptrStoreFind(value));
1103 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1104 void PointerMField<PtrTypeT,
1105                    RefCountPolicy,
1106                    NamespaceI    >::push_back(const_value value)
1108     this->ptrStoreAppend(value);
1111 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1112 void PointerMField<PtrTypeT,
1113                    RefCountPolicy,
1114                    NamespaceI    >::resize(size_t newSize, const_value value)
1116     this->ptrStoreResize(newSize, value);
1119 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1120 void PointerMField<PtrTypeT,
1121                    RefCountPolicy,
1122                    NamespaceI    >::reserve(size_type newSize)
1124     this->_ptrStore.reserve(newSize);
1127 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1128 void PointerMField<PtrTypeT,
1129                    RefCountPolicy,
1130                    NamespaceI    >::clear(void)
1132     this->ptrStoreClear();
1135 #ifdef OSG_1_COMPAT
1136 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1137 void PointerMField<PtrTypeT,
1138                    RefCountPolicy,
1139                    NamespaceI    >::addValue(const_value value)
1141     this->push_back(value);
1143 #endif
1145 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1146 void PointerMField<PtrTypeT,
1147                    RefCountPolicy,
1148                    NamespaceI    >::assign(size_type newSize,
1149                                            const_value value)
1151     this->ptrStoreClear();
1153     for(size_type i = 0; i < newSize; ++i)
1154         this->ptrStoreAppend(value);
1157 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1158 template <class InputIteratorT                                        > inline
1159 void PointerMField<PtrTypeT,
1160                    RefCountPolicy,
1161                    NamespaceI    >::assign(InputIteratorT first,
1162                                            InputIteratorT last)
1164     this->ptrStoreAssign(first, last);
1167 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1168 void PointerMField<PtrTypeT,
1169                    RefCountPolicy,
1170                    NamespaceI    >::replace(UInt32      uiIdx,
1171                                             const_value value)
1173     this->ptrStoreReplace(uiIdx, value);
1176 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1177 void PointerMField<PtrTypeT,
1178                    RefCountPolicy,
1179                    NamespaceI    >::replace(iterator    pos,
1180                                             const_value value)
1182     this->ptrStoreReplace(pos.base(), value);
1185 /*-------------------------------------------------------------------------*/
1186 /* Index Operator                                                          */
1188 #ifndef OSG_CLEAN_FCFIELDS
1189 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1190 typename PointerMField<PtrTypeT,
1191                        RefCountPolicy,
1192                        NamespaceI    >::reference
1193     PointerMField<PtrTypeT,
1194                   RefCountPolicy,
1195                   NamespaceI    >::operator [](const size_type index)
1197 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
1198     BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
1199 #endif
1201     return reference(this->_ptrStore.begin() + index, this);
1203 #endif
1205 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1206 typename PointerMField<PtrTypeT,
1207                        RefCountPolicy,
1208                        NamespaceI    >::const_value
1209     PointerMField<PtrTypeT,
1210                   RefCountPolicy,
1211                   NamespaceI    >::operator [](const size_type index) const
1213     return static_cast<const_value>(this->ptrStoreGet(index));
1216 /*-------------------------------------------------------------------------*/
1217 /* Assignment                                                              */
1219 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1220 typename PointerMField<PtrTypeT,
1221                        RefCountPolicy,
1222                        NamespaceI    >::Self &
1223     PointerMField<PtrTypeT,
1224                   RefCountPolicy,
1225                   NamespaceI    >::operator=(const Self &source)
1227 //    this->setValues(source);
1229     OSG_ASSERT(false);
1231     return *this;
1235 #ifdef OSG_MT_CPTR_ASPECT
1236 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1237 void PointerMField<PtrTypeT,
1238                    RefCountPolicy,
1239                    NamespaceI    >::syncWith(Self               &source,
1240                                              ConstFieldMaskArg   syncMode,
1241                                              UInt32              uiSyncInfo,
1242                                              AspectOffsetStore  &oOffsets    )
1244     Inherited::syncWith(source,
1245                         syncMode,
1246                         uiSyncInfo,
1247                         oOffsets  );
1249 #endif
1251 template <class    PtrTypeT, 
1252           typename RefCountPolicy,
1253           Int32    NamespaceI    > inline 
1254 FieldDescriptionBase *
1255     PointerMField<PtrTypeT,
1256                    RefCountPolicy,
1257                    NamespaceI    >::createFieldDescription   (
1258                        const Char8                *szFieldname,
1259                              UInt32                uiFieldFlags,
1260                              FieldEditMethod       fEditMethod,
1261                              FieldGetMethod        fGetMethod  )
1263     if(szFieldname == NULL)
1264     {
1265         FWARNING(("createFieldDescription no fieldname given"));
1267         return NULL;
1268     }
1270     if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
1271     {
1272         uiFieldFlags = (Field::MFDefaultFlags | Field::FStdAccess);
1273     }
1275     FieldDescriptionBase *returnValue = new typename Self::Description(
1276         _fieldType, 
1277         szFieldname,
1278         "",
1279         0,
1280         0,
1281         false,
1282         uiFieldFlags,
1283         fEditMethod,
1284         fGetMethod);
1286     return returnValue;
1289 template <class    PtrTypeT, 
1290           typename RefCountPolicy,
1291           Int32    NamespaceI    > inline 
1292 FieldDescriptionBase *
1293     PointerMField<PtrTypeT,
1294                    RefCountPolicy,
1295                    NamespaceI    >::createIdxFieldDescription(
1296                        const Char8                *szFieldname,
1297                              UInt32                uiFieldFlags,
1298                              FieldIndexEditMethod  fEditMethod,
1299                              FieldIndexGetMethod   fGetMethod  )
1301     if(szFieldname == NULL)
1302     {
1303         FWARNING(("createFieldDescriptionIdx no fieldname given"));
1305         return NULL;
1306     }
1308     if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
1309     {
1310         uiFieldFlags = (Field::MFDefaultFlags | Field::FStdAccess);
1311     }
1313     FieldDescriptionBase *returnValue = new typename Self::Description(
1314         _fieldType, 
1315         szFieldname,
1316         "",
1317         0,
1318         0,
1319         false,
1320         uiFieldFlags,
1321         fEditMethod,
1322         fGetMethod);
1324     return returnValue;
1327 OSG_END_NAMESPACE