1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2008 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
41 /*-------------------------------------------------------------------------*/
42 /* ChildMFieldIterator<PtrTypeT> */
43 /*-------------------------------------------------------------------------*/
45 /*-------------------------------------------------------------------------*/
48 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
49 ChildMFieldIterator<PtrTypeT,
51 iNamespace >::ChildMFieldIterator(void) :
57 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
58 ChildMFieldIterator<PtrTypeT,
60 iNamespace >::ChildMFieldIterator(const Self &source) :
62 _pField (source._pField)
66 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
67 ChildMFieldIterator<PtrTypeT,
69 iNamespace >::ChildMFieldIterator(
70 const PtrStoreItType &storeIter,
71 MFieldType *pField ) :
78 /*-------------------------------------------------------------------------*/
81 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
82 ChildMFieldIterator<PtrTypeT,
84 iNamespace >::~ChildMFieldIterator(void)
88 /*-------------------------------------------------------------------------*/
91 #ifndef OSG_CLEAN_FCFIELDS
92 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
93 typename ChildMFieldIterator<PtrTypeT,
95 iNamespace >::reference
96 ChildMFieldIterator<PtrTypeT,
98 iNamespace >::operator * (void) const
100 return reference(*this, _pField);
104 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
105 typename ChildMFieldIterator<PtrTypeT,
107 iNamespace >::reference
108 ChildMFieldIterator<PtrTypeT,
110 iNamespace >::operator [](
111 const difference_type offset) const
113 return reference(*this + offset, _pField);
116 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
117 typename ChildMFieldIterator<PtrTypeT,
119 iNamespace >::const_value
120 ChildMFieldIterator<PtrTypeT,
122 iNamespace >::operator * (void) const
124 return static_cast<const_value>(
125 AccessHandler::validate(this->Inherited::operator*()));
129 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
130 typename ChildMFieldIterator<PtrTypeT,
132 iNamespace >::const_value
133 ChildMFieldIterator<PtrTypeT,
135 iNamespace >::operator [](
136 const difference_type offset) const
138 return reference(*this + offset, _pField);
143 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
144 typename ChildMFieldIterator<PtrTypeT,
147 ChildMFieldIterator<PtrTypeT,
149 iNamespace >::operator ++(void)
151 this->Inherited::operator++();
156 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
157 typename ChildMFieldIterator<PtrTypeT, RefCountPolicy, iNamespace>::Self
158 ChildMFieldIterator<PtrTypeT,
160 iNamespace >::operator ++(int)
164 this->Inherited::operator++();
169 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
170 typename ChildMFieldIterator<PtrTypeT,
173 ChildMFieldIterator<PtrTypeT,
175 iNamespace >::operator --(void)
177 this->Inherited::operator--();
182 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
183 typename ChildMFieldIterator<PtrTypeT, RefCountPolicy, iNamespace>::Self
184 ChildMFieldIterator<PtrTypeT,
186 iNamespace >::operator --(int)
190 this->Inherited::operator--();
195 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
196 typename ChildMFieldIterator<PtrTypeT,
199 ChildMFieldIterator<PtrTypeT,
201 iNamespace>::operator +=(const difference_type offset)
203 this->Inherited::operator+=(offset);
208 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
209 typename ChildMFieldIterator<PtrTypeT, RefCountPolicy, iNamespace>::Self
210 ChildMFieldIterator<PtrTypeT,
212 iNamespace >::operator +(
213 const difference_type offset) const
217 return retVal += offset;
220 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
221 typename ChildMFieldIterator<PtrTypeT, RefCountPolicy, iNamespace>::Self &
222 ChildMFieldIterator<PtrTypeT,
224 iNamespace >::operator -=(
225 const difference_type offset)
227 this->Inherited::operator-=(offset);
232 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
233 typename ChildMFieldIterator<PtrTypeT, RefCountPolicy, iNamespace>::Self
234 ChildMFieldIterator<PtrTypeT,
236 iNamespace >::operator -(
237 const difference_type offset) const
241 return retVal -= offset;
245 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
246 bool ChildMFieldIterator<PtrTypeT,
248 iNamespace >::operator == (const Self &rhs) const
250 return *(static_cast<const Inherited *>(this)) == rhs;
253 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
254 bool ChildMFieldIterator<PtrTypeT,
256 iNamespace >::operator != (const Self &rhs) const
258 return ! (*this == rhs);
261 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
262 bool ChildMFieldIterator<PtrTypeT,
264 iNamespace >::operator == (
265 const const_iterator &rhs) const
267 return *(static_cast<const Inherited *>(this)) == rhs;
270 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
271 bool ChildMFieldIterator<PtrTypeT,
273 iNamespace >::operator != (
274 const const_iterator &rhs) const
276 return ! (*this == rhs);
280 /*-------------------------------------------------------------------------*/
283 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
284 const typename ChildMFieldIterator<PtrTypeT,
286 iNamespace >::PtrStoreItType &
287 ChildMFieldIterator<PtrTypeT,
289 iNamespace >::base(void) const
295 /*-------------------------------------------------------------------------*/
298 template <class PtrTypeT, class RefCountPolicyT, Int32 iNamespace>
299 typename ChildMFieldIterator<PtrTypeT,
301 iNamespace >::difference_type
302 operator-(ChildMFieldIterator<PtrTypeT,
304 iNamespace > const &lhs,
305 ChildMFieldIterator<PtrTypeT,
307 iNamespace > const &rhs )
309 return (lhs.base() - rhs.base());
312 template <class PtrTypeT, class RefCountPolicyT, Int32 iNamespace>
313 ChildMFieldIterator<PtrTypeT, RefCountPolicyT, iNamespace>
315 typename ChildMFieldIterator<PtrTypeT,
317 iNamespace >::differece_type const offset,
318 ChildMFieldIterator<PtrTypeT,
320 iNamespace > const &rhs )
322 return ChildMFieldIterator<PtrTypeT,
324 iNamespace >(rhs) += offset;
328 /*-------------------------------------------------------------------------*/
329 /* ChildMFieldConstIterator<PtrTypeT> */
330 /*-------------------------------------------------------------------------*/
332 /*-------------------------------------------------------------------------*/
335 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
336 ChildMFieldConstIterator<PtrTypeT,
338 iNamespace >::ChildMFieldConstIterator(void) :
343 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
344 ChildMFieldConstIterator<PtrTypeT,
346 iNamespace >::ChildMFieldConstIterator(
347 const Self &source) :
352 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
353 ChildMFieldConstIterator<PtrTypeT,
355 iNamespace >::ChildMFieldConstIterator(
356 const iterator &fieldIter) :
357 Inherited(fieldIter.base())
361 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
362 ChildMFieldConstIterator<PtrTypeT,
364 iNamespace >::ChildMFieldConstIterator(
365 const PtrStoreConstItType &storeIter) :
370 /*-------------------------------------------------------------------------*/
373 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
374 ChildMFieldConstIterator<PtrTypeT,
376 iNamespace >::~ChildMFieldConstIterator(void)
381 /*-------------------------------------------------------------------------*/
384 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
385 typename ChildMFieldConstIterator<PtrTypeT,
387 iNamespace >::const_value
388 ChildMFieldConstIterator<PtrTypeT,
390 iNamespace >::operator *(void) const
392 return static_cast<const_value>(
393 AccessHandler::validate(this->Inherited::operator*()));
397 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
398 typename ChildMFieldConstIterator<PtrTypeT,
400 iNamespace >::const_value
401 ChildMFieldConstIterator<PtrTypeT,
403 iNamespace >::operator [](
404 const difference_type offset) const
406 return *(*this + offset);
410 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
411 typename ChildMFieldConstIterator<PtrTypeT,
414 ChildMFieldConstIterator<PtrTypeT,
416 iNamespace >::operator ++(void)
418 this->Inherited::operator++();
423 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
424 typename ChildMFieldConstIterator<PtrTypeT,
427 ChildMFieldConstIterator<PtrTypeT,
429 iNamespace >::operator ++(int)
433 this->Inherited::operator++();
438 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
439 typename ChildMFieldConstIterator<PtrTypeT,
442 ChildMFieldConstIterator<PtrTypeT,
444 iNamespace >::operator --(void)
446 this->Inherited::operator--();
451 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
452 typename ChildMFieldConstIterator<PtrTypeT,
455 ChildMFieldConstIterator<PtrTypeT,
457 iNamespace >::operator --(int)
461 this->Inherited::oprator--();
466 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
467 typename ChildMFieldConstIterator<PtrTypeT,
470 ChildMFieldConstIterator<PtrTypeT,
472 iNamespace >::operator +=(
473 const difference_type offset)
475 this->Inherited::operator+=(offset);
480 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
481 typename ChildMFieldConstIterator<PtrTypeT,
484 ChildMFieldConstIterator<PtrTypeT,
486 iNamespace >::operator +(
487 const difference_type offset) const
491 return retVal += offset;
494 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
495 typename ChildMFieldConstIterator<PtrTypeT,
498 ChildMFieldConstIterator<PtrTypeT,
500 iNamespace >::operator -=(
501 const difference_type offset)
503 this->Inherited::operator-=(offset);
508 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
509 typename ChildMFieldConstIterator<PtrTypeT,
512 ChildMFieldConstIterator<PtrTypeT,
514 iNamespace >::operator -(
515 const difference_type offset) const
519 return retVal -= offset;
522 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
523 bool ChildMFieldConstIterator<PtrTypeT,
525 iNamespace >::operator == (
526 const Self &rhs) const
528 return *(static_cast<const Inherited *>(this)) == rhs;
531 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
532 bool ChildMFieldConstIterator<PtrTypeT,
534 iNamespace >::operator != (
535 const Self &rhs) const
537 return ! (*this == rhs);
540 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
541 bool ChildMFieldConstIterator<PtrTypeT,
543 iNamespace >::operator == (
544 const iterator &rhs) const
546 return *(static_cast<const Inherited *>(this)) == rhs;
549 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
550 bool ChildMFieldConstIterator<PtrTypeT,
552 iNamespace >::operator != (
553 const iterator &rhs) const
555 return ! (*this == rhs);
559 /*-------------------------------------------------------------------------*/
562 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
563 const typename ChildMFieldConstIterator<PtrTypeT,
565 iNamespace >::PtrStoreConstItType &
566 ChildMFieldConstIterator<PtrTypeT,
568 iNamespace >::base(void) const
574 /*-------------------------------------------------------------------------*/
577 template <class PtrTypeT, class RefCountPolicyT, Int32 iNamespace>
578 typename ChildMFieldConstIterator<PtrTypeT,
580 iNamespace >::difference_type
581 operator-(ChildMFieldConstIterator<PtrTypeT,
583 iNamespace > const &lhs,
584 ChildMFieldConstIterator<PtrTypeT,
586 iNamespace > const &rhs )
588 return (lhs.base() - rhs.base());
591 template <class PtrTypeT, class RefCountPolicyT, Int32 iNamespace>
592 typename ChildMFieldConstIterator<PtrTypeT,
594 iNamespace >::difference_type
595 operator-(ChildMFieldIterator <PtrTypeT,
597 iNamespace > const &lhs,
598 ChildMFieldConstIterator<PtrTypeT,
600 iNamespace > const &rhs )
602 return (lhs.base() - rhs.base());
605 template <class PtrTypeT, class RefCountPolicyT, Int32 iNamespace>
606 typename ChildMFieldConstIterator<PtrTypeT,
608 iNamespace >::difference_type
609 operator-(ChildMFieldConstIterator<PtrTypeT,
611 iNamespace > const &lhs,
612 ChildMFieldIterator <PtrTypeT,
614 iNamespace > const &rhs )
616 return (lhs.base() - rhs.base());
619 template <class PtrTypeT, class RefCountPolicyT, Int32 iNamespace>
620 ChildMFieldConstIterator<PtrTypeT, RefCountPolicyT, iNamespace>
622 typename ChildMFieldConstIterator<PtrTypeT,
624 iNamespace >::difference_type const offset,
625 ChildMFieldConstIterator<PtrTypeT,
627 iNamespace > const &rhs )
629 return ChildMFieldConstIterator<PtrTypeT,
631 iNamespace >(rhs) += offset;
635 /*-------------------------------------------------------------------------*/
636 /* ChildMFieldReferenceProxy<PtrTypeT> */
637 /*-------------------------------------------------------------------------*/
639 /*-------------------------------------------------------------------------*/
642 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
643 ChildMFieldReferenceProxy<PtrTypeT,
645 iNamespace >::ChildMFieldReferenceProxy(
646 const PtrStoreItType &storeIter,
647 MFieldType *pField ) :
648 _storeIter(storeIter),
653 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
654 ChildMFieldReferenceProxy<PtrTypeT,
656 iNamespace >::ChildMFieldReferenceProxy(
657 const Self &source) :
658 _storeIter(source._storeIter),
659 _pField (source._pField )
663 /*-------------------------------------------------------------------------*/
666 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
667 ChildMFieldReferenceProxy<PtrTypeT,
669 iNamespace >::~ChildMFieldReferenceProxy(void)
673 /*-------------------------------------------------------------------------*/
676 #ifndef OSG_DOXYGEN_IGNORE_RECOG_PROBS
677 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
678 ChildMFieldReferenceProxy<PtrTypeT,
680 iNamespace >::operator
681 typename ChildMFieldReferenceProxy<PtrTypeT,
683 iNamespace >::const_value(void) const
685 return static_cast<const_value>(AccessHandler::validate(*_storeIter));
689 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
690 typename ChildMFieldReferenceProxy<PtrTypeT,
692 iNamespace >::const_value
693 ChildMFieldReferenceProxy<PtrTypeT,
695 iNamespace >::operator->(void) const
697 return static_cast<const_value>(AccessHandler::validate(*_storeIter));
700 template <class PtrTypeT, typename RefCountPolicy, Int32 iNamespace> inline
701 const typename ChildMFieldReferenceProxy<PtrTypeT,
704 ChildMFieldReferenceProxy<PtrTypeT,
706 iNamespace >::operator =(const_value newValue)
708 AccessHandler::onReplace(_pField, *_storeIter, newValue);
710 *_storeIter = newValue;
716 /*-------------------------------------------------------------------------*/
717 /* ChildPointerMField<PtrTypeT, */
719 /*-------------------------------------------------------------------------*/
721 /*-------------------------------------------------------------------------*/
724 /*-------------------------------------------------------------------------*/
727 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
728 ChildPointerMField<PtrTypeT,
730 NamespaceI >::ChildPointerMField(
731 FieldContainer * const pParent,
732 UInt16 usChildFieldId,
733 UInt16 usParentFieldId) :
734 Inherited(pParent, usChildFieldId, usParentFieldId)
738 /*-------------------------------------------------------------------------*/
741 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
742 ChildPointerMField<PtrTypeT,
744 NamespaceI >::~ChildPointerMField(void)
749 /*-------------------------------------------------------------------------*/
750 /* Std Library Interface */
752 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
753 void ChildPointerMField<PtrTypeT,
755 NamespaceI >::copyFromBin(BinaryDataHandler &pMem)
757 Inherited::copyFromBin(pMem);
761 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
762 typename ChildPointerMField<PtrTypeT,
764 NamespaceI >::iterator
765 ChildPointerMField<PtrTypeT,
767 NamespaceI >::begin_nc(void)
769 return iterator(this->_ptrStore.begin(), this);
772 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
773 typename ChildPointerMField<PtrTypeT,
775 NamespaceI >::iterator
776 ChildPointerMField<PtrTypeT,
778 NamespaceI >::end_nc(void)
780 return iterator(this->_ptrStore.end(), this);
783 #ifndef OSG_CLEAN_FCFIELDS
785 reference front_nc(void );
786 reference back_nc (void );
790 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
791 typename ChildPointerMField<PtrTypeT,
793 NamespaceI >::iterator
794 ChildPointerMField<PtrTypeT,
796 NamespaceI >::find_nc(const_value value)
798 return iterator(this->ptrStoreFind(value), this);
801 #ifndef OSG_CLEAN_FCFIELDS
802 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
803 typename ChildPointerMField<PtrTypeT,
805 NamespaceI >::iterator
806 ChildPointerMField<PtrTypeT,
808 NamespaceI >::begin(void)
810 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
811 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
814 return iterator(this->_ptrStore.begin(), this);
817 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
818 typename ChildPointerMField<PtrTypeT,
820 NamespaceI >::iterator
821 ChildPointerMField<PtrTypeT,
823 NamespaceI >::end(void)
825 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
826 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
829 return iterator(this->_ptrStore.end(), this);
832 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
833 typename ChildPointerMField<PtrTypeT,
835 NamespaceI >::reverse_iterator
836 ChildPointerMField<PtrTypeT,
838 NamespaceI >::rbegin(void)
840 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
841 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
844 return reverse_iterator(this->end());
847 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
848 typename ChildPointerMField<PtrTypeT,
850 NamespaceI >::reverse_iterator
851 ChildPointerMField<PtrTypeT,
853 NamespaceI >::rend(void)
855 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
856 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
859 return reverse_iterator(this->begin());
863 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
864 typename ChildPointerMField<PtrTypeT,
866 NamespaceI >::const_iterator
867 ChildPointerMField<PtrTypeT,
869 NamespaceI >::begin(void) const
871 return const_iterator(this->_ptrStore.begin());
874 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
875 typename ChildPointerMField<PtrTypeT,
877 NamespaceI >::const_iterator
878 ChildPointerMField<PtrTypeT,
880 NamespaceI >::end(void) const
882 return const_iterator(this->_ptrStore.end());
885 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
886 typename ChildPointerMField<PtrTypeT,
888 NamespaceI >::const_reverse_iterator
889 ChildPointerMField<PtrTypeT,
891 NamespaceI >::rbegin(void) const
893 return const_reverse_iterator(this->end());
896 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
897 typename ChildPointerMField<PtrTypeT,
899 NamespaceI >::const_reverse_iterator
900 ChildPointerMField<PtrTypeT,
902 NamespaceI >::rend(void) const
904 return const_reverse_iterator(this->begin());
908 #ifndef OSG_CLEAN_FCFIELDS
909 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
910 typename ChildPointerMField<PtrTypeT,
912 NamespaceI >::reference
913 ChildPointerMField<PtrTypeT,
915 NamespaceI >::front(void)
917 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
918 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
921 return reference(this->_ptrStore.begin(), this);
924 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
925 typename ChildPointerMField<PtrTypeT,
927 NamespaceI >::reference
928 ChildPointerMField<PtrTypeT,
930 NamespaceI >::back(void)
932 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
933 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
936 return reference(this->editRawStore().end() - 1, this);
940 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
941 typename ChildPointerMField<PtrTypeT,
943 NamespaceI >::const_value
944 ChildPointerMField<PtrTypeT,
946 NamespaceI >::front(void) const
948 return static_cast<const_value>(this->ptrStoreGet(this->_ptrStore.begin()));
952 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
953 typename ChildPointerMField<PtrTypeT,
955 NamespaceI >::const_value
956 ChildPointerMField<PtrTypeT,
958 NamespaceI >::back(void) const
960 return static_cast<const_value>(
961 this->ptrStoreGet(this->_ptrStore.end() - 1));
967 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
968 typename ChildPointerMField<PtrTypeT,
970 NamespaceI >::iterator
971 ChildPointerMField<PtrTypeT,
973 NamespaceI >::insert(iterator pos,
976 return iterator(this->ptrStoreInsert(pos.base(), value), this);
979 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
980 void ChildPointerMField<PtrTypeT,
982 NamespaceI >::insert(iterator pos,
986 this->ptrStoreInsert(pos, n, value);
989 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
990 template <class InputIteratorT > inline
991 void ChildPointerMField<PtrTypeT,
993 NamespaceI >::insert(iterator pos,
994 InputIteratorT first,
997 this->ptrStoreInsert(pos, first, last);
1000 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1001 void ChildPointerMField<PtrTypeT,
1003 NamespaceI >::erase(size_type index)
1005 return this->ptrStoreErase(index);
1008 #ifndef OSG_CLEAN_FCFIELDS
1009 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1010 typename ChildPointerMField<PtrTypeT,
1012 NamespaceI >::iterator
1013 ChildPointerMField<PtrTypeT,
1015 NamespaceI >::erase(iterator pos)
1017 return iterator(this->ptrStoreErase(pos.base()), this);
1020 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1021 typename ChildPointerMField<PtrTypeT,
1023 NamespaceI >::iterator
1024 ChildPointerMField<PtrTypeT,
1026 NamespaceI >::erase(
1027 iterator first, iterator last)
1029 return iterator(this->ptrStoreErase(first.base(), last.base()), this);
1033 #ifndef OSG_CLEAN_FCFIELDS
1034 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1035 typename ChildPointerMField<PtrTypeT,
1037 NamespaceI >::iterator
1038 ChildPointerMField<PtrTypeT,
1040 NamespaceI >::find(const_value value)
1042 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
1043 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
1046 return iterator(this->ptrStoreFind(value), this);
1050 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1051 typename ChildPointerMField<PtrTypeT,
1053 NamespaceI >::const_iterator
1054 ChildPointerMField<PtrTypeT,
1056 NamespaceI >::find(const_value value) const
1058 return const_iterator(this->ptrStoreFind(value),
1063 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1064 void ChildPointerMField<PtrTypeT,
1066 NamespaceI >::push_back(const_value value)
1068 this->ptrStoreAppend(value);
1071 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1072 void ChildPointerMField<PtrTypeT,
1074 NamespaceI >::resize(size_t newSize,
1077 this->ptrStoreResize(newSize, value);
1080 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1081 void ChildPointerMField<PtrTypeT,
1083 NamespaceI >::reserve(size_type newSize)
1085 this->_ptrStore.reserve(newSize);
1088 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1089 void ChildPointerMField<PtrTypeT,
1091 NamespaceI >::clear(void)
1093 this->ptrStoreClear();
1098 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1099 void ChildPointerMField<PtrTypeT,
1101 NamespaceI >::addValue(const_value value)
1103 this->ptrStoreAppend(value);
1108 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1109 void ChildPointerMField<PtrTypeT,
1111 NamespaceI >::assign(size_type newSize,
1114 this->ptrStoreClear();
1116 for(size_type i = 0; i < newSize; ++i)
1117 this->ptrStoreAppend(value);
1120 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1121 template <class InputIteratorT > inline
1122 void ChildPointerMField<PtrTypeT,
1124 NamespaceI >::assign(InputIteratorT first,
1125 InputIteratorT last)
1127 this->ptrStoreAssign(first, last);
1131 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1132 void ChildPointerMField<PtrTypeT,
1134 NamespaceI >::replace(size_type uiIdx,
1137 this->ptrStoreReplace(uiIdx, value);
1140 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1141 void ChildPointerMField<PtrTypeT,
1143 NamespaceI >::replace(iterator pos,
1146 this->ptrStoreReplace(pos.base(), value);
1150 /*-------------------------------------------------------------------------*/
1151 /* Index Operator */
1153 #ifndef OSG_CLEAN_FCFIELDS
1154 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1155 typename ChildPointerMField<PtrTypeT,
1157 NamespaceI >::reference
1158 ChildPointerMField<PtrTypeT,
1160 NamespaceI >::operator [](const size_type index)
1162 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
1163 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
1166 return reference(this->_ptrStore.begin() + index, this);
1170 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1171 typename ChildPointerMField<PtrTypeT,
1173 NamespaceI >::const_value
1174 ChildPointerMField<PtrTypeT,
1176 NamespaceI >::operator [](const size_type index) const
1178 return static_cast<const_value>(this->ptrStoreGet(index));
1182 #ifdef OSG_MT_CPTR_ASPECT
1183 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1184 void ChildPointerMField<PtrTypeT,
1186 NamespaceI >::syncWith(Self &source,
1187 ConstFieldMaskArg syncMode,
1189 AspectOffsetStore &oOffsets )
1191 Inherited::syncWith(source, syncMode, uiSyncInfo, oOffsets);
1195 /*-------------------------------------------------------------------------*/
1200 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1202 ChildPointerMField<PtrTypeT,
1204 NamespaceI >::setValues(Self const &source)
1206 this->assign(source.begin(), source.end());
1209 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1210 inline typename ChildPointerMField<PtrTypeT,
1212 NamespaceI >::Self &
1213 ChildPointerMField<PtrTypeT,
1215 NamespaceI >::operator=(Self const &source)
1217 this->setValues(source);
1222 /*-------------------------------------------------------------------------*/
1225 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1226 inline typename ChildPointerMField<PtrTypeT,
1228 NamespaceI >::ValueStoreType const &
1229 ChildPointerMField<PtrTypeT,
1231 NamespaceI >::getValues(void) const
1233 return this->template getStore<ValueType>();