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 /* PointerMFieldIterator<PtrTypeT> */
43 /*-------------------------------------------------------------------------*/
45 /*-------------------------------------------------------------------------*/
48 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
49 PointerMFieldIterator<PtrTypeT,
51 NamespaceI >::PointerMFieldIterator(void) :
57 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
58 PointerMFieldIterator<PtrTypeT,
60 NamespaceI >::PointerMFieldIterator(
63 _pField (source._pField)
67 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
68 PointerMFieldIterator<PtrTypeT,
70 NamespaceI >::PointerMFieldIterator(
71 const PtrStoreItType &storeIter,
78 /*-------------------------------------------------------------------------*/
81 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
82 PointerMFieldIterator<PtrTypeT,
84 NamespaceI >::~PointerMFieldIterator(void)
88 /*-------------------------------------------------------------------------*/
91 #ifndef OSG_CLEAN_FCFIELDS
92 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
93 typename PointerMFieldIterator<PtrTypeT,
95 NamespaceI >::reference
96 PointerMFieldIterator<PtrTypeT,
98 NamespaceI >::operator *(void) const
100 return reference(*this, _pField);
104 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
105 typename PointerMFieldIterator<PtrTypeT,
107 NamespaceI >::reference
108 PointerMFieldIterator<PtrTypeT,
110 NamespaceI>::operator [](
111 const difference_type offset) const
113 return reference(*this + offset, _pField);
116 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
117 typename PointerMFieldIterator<PtrTypeT,
119 NamespaceI >::const_value
120 PointerMFieldIterator<PtrTypeT,
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,
132 NamespaceI >::const_value
133 PointerMFieldIterator<PtrTypeT,
135 NamespaceI>::operator [](
136 const difference_type offset) const
138 return *(*this + offset);
142 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
143 typename PointerMFieldIterator<PtrTypeT,
146 PointerMFieldIterator<PtrTypeT,
148 NamespaceI>::operator ++(void)
150 this->Inherited::operator++();
155 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
156 typename PointerMFieldIterator<PtrTypeT,
159 PointerMFieldIterator<PtrTypeT,
161 NamespaceI >::operator ++(int)
165 this->Inherited::operator++();
170 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
171 typename PointerMFieldIterator<PtrTypeT,
174 PointerMFieldIterator<PtrTypeT,
176 NamespaceI >::operator --(void)
178 this->Inherited::operator--();
183 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
184 typename PointerMFieldIterator<PtrTypeT,
187 PointerMFieldIterator<PtrTypeT,
189 NamespaceI >::operator --(int)
193 this->Inherited::operator--();
198 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
199 typename PointerMFieldIterator<PtrTypeT,
202 PointerMFieldIterator<PtrTypeT,
204 NamespaceI >::operator +=(
205 const difference_type offset)
207 this->Inherited::operator+=(offset);
212 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
213 typename PointerMFieldIterator<PtrTypeT,
216 PointerMFieldIterator<PtrTypeT,
218 NamespaceI >::operator +(
219 const difference_type offset) const
223 return retVal += offset;
226 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
227 typename PointerMFieldIterator<PtrTypeT,
230 PointerMFieldIterator<PtrTypeT,
232 NamespaceI >::operator -=(
233 const difference_type offset)
235 this->Inherited::operator-=(offset);
240 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
241 typename PointerMFieldIterator<PtrTypeT,
244 PointerMFieldIterator<PtrTypeT,
246 NamespaceI >::operator - (
247 const difference_type offset) const
251 return retVal -= offset;
254 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
255 bool PointerMFieldIterator<PtrTypeT,
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,
265 NamespaceI >::operator !=(const Self &rhs) const
267 return ! (*this == rhs);
270 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
271 bool PointerMFieldIterator<PtrTypeT,
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,
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,
292 PointerMFieldIterator<PtrTypeT,
294 NamespaceI >::operator =(const Self &rhs)
296 Inherited::operator =(rhs);
298 _pField = rhs._pField;
303 /*-------------------------------------------------------------------------*/
306 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
307 const typename PointerMFieldIterator<PtrTypeT,
309 NamespaceI >::PtrStoreItType &
310 PointerMFieldIterator<PtrTypeT,
312 NamespaceI >::base(void) const
317 /*-------------------------------------------------------------------------*/
320 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
321 typename PointerMFieldIterator<PtrTypeT,
323 NamespaceI >::difference_type
324 operator-(PointerMFieldIterator<PtrTypeT,
326 NamespaceI > const &lhs,
327 PointerMFieldIterator<PtrTypeT,
329 NamespaceI > const &rhs )
331 return (lhs.base() - rhs.base());
334 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
335 PointerMFieldIterator<PtrTypeT,
338 operator+(typename PointerMFieldIterator<PtrTypeT,
340 NamespaceI >::differece_type const offset,
341 PointerMFieldIterator<PtrTypeT,
343 NamespaceI > const &rhs )
345 return PointerMFieldIterator<PtrTypeT,
347 NamespaceI >(rhs) += offset;
351 /*-------------------------------------------------------------------------*/
352 /* PointerMFieldConstIterator<PtrTypeT> */
353 /*-------------------------------------------------------------------------*/
355 /*-------------------------------------------------------------------------*/
358 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
359 PointerMFieldConstIterator<PtrTypeT,
361 NamespaceI >::PointerMFieldConstIterator(void) :
366 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
367 PointerMFieldConstIterator<PtrTypeT,
369 NamespaceI >::PointerMFieldConstIterator(
370 const Self &source) :
375 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
376 PointerMFieldConstIterator<PtrTypeT,
378 NamespaceI >::PointerMFieldConstIterator(
379 const iterator &fieldIter) :
380 Inherited(fieldIter.base())
384 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
385 PointerMFieldConstIterator<PtrTypeT,
387 NamespaceI >::PointerMFieldConstIterator(
388 const PtrStoreConstItType &storeIter) :
393 /*-------------------------------------------------------------------------*/
396 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
397 PointerMFieldConstIterator<PtrTypeT,
399 NamespaceI >::~PointerMFieldConstIterator(void)
403 /*-------------------------------------------------------------------------*/
406 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
407 typename PointerMFieldConstIterator<PtrTypeT,
409 NamespaceI >::const_value
410 PointerMFieldConstIterator<PtrTypeT,
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,
422 NamespaceI >::const_value
423 PointerMFieldConstIterator<PtrTypeT,
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,
435 PointerMFieldConstIterator<PtrTypeT,
437 NamespaceI >::operator ++(void)
439 this->Inherited::operator++();
444 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
445 typename PointerMFieldConstIterator<PtrTypeT,
448 PointerMFieldConstIterator<PtrTypeT,
450 NamespaceI >::operator ++(int)
454 this->Inherited::operator++();
459 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
460 typename PointerMFieldConstIterator<PtrTypeT,
463 PointerMFieldConstIterator<PtrTypeT,
465 NamespaceI >::operator --(void)
467 this->Inherited::operator--();
472 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
473 typename PointerMFieldConstIterator<PtrTypeT,
476 PointerMFieldConstIterator<PtrTypeT,
478 NamespaceI >::operator --(int)
482 this->Inherited::oprator--();
487 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
488 typename PointerMFieldConstIterator<PtrTypeT,
491 PointerMFieldConstIterator<PtrTypeT,
493 NamespaceI >::operator +=(
494 const difference_type offset)
496 this->Inherited::operator+=(offset);
501 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
502 typename PointerMFieldConstIterator<PtrTypeT,
505 PointerMFieldConstIterator<PtrTypeT,
507 NamespaceI >::operator +(
508 const difference_type offset) const
512 return retVal += offset;
515 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
516 typename PointerMFieldConstIterator<PtrTypeT,
519 PointerMFieldConstIterator<PtrTypeT,
521 NamespaceI >::operator -=(
522 const difference_type offset)
524 this->Inherited::operator-=(offset);
529 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
530 typename PointerMFieldConstIterator<PtrTypeT,
533 PointerMFieldConstIterator<PtrTypeT,
535 NamespaceI >::operator -(
536 const difference_type offset) const
540 return retVal -= offset;
543 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
544 bool PointerMFieldConstIterator<PtrTypeT,
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,
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,
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,
573 NamespaceI >::operator !=(
574 const iterator &rhs) const
576 return ! (*this == rhs);
579 /*-------------------------------------------------------------------------*/
582 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
583 const typename PointerMFieldConstIterator<PtrTypeT,
585 NamespaceI >::PtrStoreConstItType &
586 PointerMFieldConstIterator<PtrTypeT,
588 NamespaceI >::base(void) const
594 /*-------------------------------------------------------------------------*/
597 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
598 typename PointerMFieldConstIterator<PtrTypeT,
600 NamespaceI >::difference_type
601 operator-(PointerMFieldConstIterator<PtrTypeT,
603 NamespaceI > const &lhs,
604 PointerMFieldConstIterator<PtrTypeT,
606 NamespaceI > const &rhs )
608 return (lhs.base() - rhs.base());
611 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
612 typename PointerMFieldConstIterator<PtrTypeT,
614 NamespaceI >::difference_type
615 operator-(PointerMFieldIterator <PtrTypeT,
617 NamespaceI > const &lhs,
618 PointerMFieldConstIterator<PtrTypeT,
620 NamespaceI > const &rhs )
622 return (lhs.base() - rhs.base());
625 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
626 typename PointerMFieldConstIterator<PtrTypeT,
628 NamespaceI >::difference_type
629 operator-(PointerMFieldConstIterator<PtrTypeT,
631 NamespaceI > const &lhs,
632 PointerMFieldIterator <PtrTypeT,
634 NamespaceI > const &rhs )
636 return (lhs.base() - rhs.base());
639 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
640 PointerMFieldConstIterator<PtrTypeT,
643 operator+(typename PointerMFieldConstIterator<PtrTypeT,
645 NamespaceI >::difference_type const offset,
646 PointerMFieldConstIterator <PtrTypeT,
648 NamespaceI > const &rhs )
650 return PointerMFieldConstIterator<PtrTypeT,
652 NamespaceI >(rhs) += offset;
656 /*-------------------------------------------------------------------------*/
657 /* PointerMFieldReferenceProxy<PtrTypeT> */
658 /*-------------------------------------------------------------------------*/
660 #ifndef OSG_CLEAN_FCFIELDS
661 /*-------------------------------------------------------------------------*/
664 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
665 PointerMFieldReferenceProxy<PtrTypeT,
667 NamespaceI >::PointerMFieldReferenceProxy(
668 const PtrStoreItType &storeIter,
669 MFieldType *pField ) :
670 _storeIter(storeIter),
675 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
676 PointerMFieldReferenceProxy<PtrTypeT,
678 NamespaceI >::PointerMFieldReferenceProxy(
679 const Self &source) :
680 _storeIter(source._storeIter),
681 _pField (source._pField )
685 /*-------------------------------------------------------------------------*/
688 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
689 PointerMFieldReferenceProxy<PtrTypeT,
691 NamespaceI >::~PointerMFieldReferenceProxy(void)
695 /*-------------------------------------------------------------------------*/
698 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
699 PointerMFieldReferenceProxy<PtrTypeT,
701 NamespaceI >::operator
702 #if defined(_MSC_VER) && _MSC_VER < 1400
703 typename PointerMFieldReferenceProxy<PtrTypeT,
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,
715 NamespaceI >::value_type
716 PointerMFieldReferenceProxy<PtrTypeT,
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,
726 NamespaceI >::operator=(value_type newValue)
728 AccessHandler::onReplace(_pField, *_storeIter, newValue);
730 *_storeIter = newValue;
735 /*-------------------------------------------------------------------------*/
736 /* PointerPointerMField<PtrTypeT, */
738 /*-------------------------------------------------------------------------*/
740 /*-------------------------------------------------------------------------*/
743 /*-------------------------------------------------------------------------*/
746 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
747 PointerMField<PtrTypeT,
749 NamespaceI >::PointerMField(void) :
754 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
755 PointerMField<PtrTypeT,
757 NamespaceI >::PointerMField(Self const &other) :
762 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
763 PointerMField<PtrTypeT,
765 NamespaceI >::PointerMField(UInt32 const initSize) :
770 /*-------------------------------------------------------------------------*/
773 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
774 PointerMField<PtrTypeT,
776 NamespaceI >::~PointerMField(void)
780 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
781 void PointerMField<PtrTypeT,
783 NamespaceI >::copyFromBin(BinaryDataHandler &pMem)
785 Inherited::copyFromBin(pMem);
790 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
791 typename PointerMField<PtrTypeT,
793 NamespaceI >::iterator
794 PointerMField<PtrTypeT,
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,
804 NamespaceI >::iterator
805 PointerMField<PtrTypeT,
807 NamespaceI >::end_nc(void)
809 return iterator(this->_ptrStore.end(), this);
812 #ifndef OSG_CLEAN_FCFIELDS
814 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
815 typename PointerMField<PtrTypeT,
817 NamespaceI >::reference
818 PointerMField<PtrTypeT,
820 NamespaceI >::front_nc(void)
824 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
825 typename PointerMField<PtrTypeT,
827 NamespaceI >::reference back_nc (void );
831 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
832 typename PointerMField<PtrTypeT,
834 NamespaceI >::iterator
835 PointerMField<PtrTypeT,
837 NamespaceI >::find_nc(const_value value)
839 return iterator(this->ptrStoreFind(value),
843 /*-------------------------------------------------------------------------*/
844 /* Std Library Interface */
846 #ifndef OSG_CLEAN_FCFIELDS
847 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
848 typename PointerMField<PtrTypeT,
850 NamespaceI >::iterator
851 PointerMField<PtrTypeT,
853 NamespaceI >::begin(void)
855 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
856 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
859 return iterator(this->_ptrStore.begin(), this);
862 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
863 typename PointerMField<PtrTypeT,
865 NamespaceI >::iterator
866 PointerMField<PtrTypeT,
868 NamespaceI >::end(void)
870 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
871 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
874 return iterator(this->_ptrStore.end(), this);
877 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
878 typename PointerMField<PtrTypeT,
880 NamespaceI >::reverse_iterator
881 PointerMField<PtrTypeT,
883 NamespaceI >::rbegin(void)
885 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
886 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
889 return reverse_iterator(this->end());
892 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
893 typename PointerMField<PtrTypeT,
895 NamespaceI >::reverse_iterator
896 PointerMField<PtrTypeT,
898 NamespaceI >::rend(void)
900 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
901 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
904 return reverse_iterator(this->begin());
908 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
909 typename PointerMField<PtrTypeT,
911 NamespaceI >::const_iterator
912 PointerMField<PtrTypeT,
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,
922 NamespaceI >::const_iterator
923 PointerMField<PtrTypeT,
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,
933 NamespaceI >::const_reverse_iterator
934 PointerMField<PtrTypeT,
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,
944 NamespaceI >::const_reverse_iterator
945 PointerMField<PtrTypeT,
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,
956 NamespaceI >::reference
957 PointerMField<PtrTypeT,
959 NamespaceI >::front(void)
961 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
962 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
965 return reference(this->_ptrStore.begin(), this);
969 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
970 typename PointerMField<PtrTypeT,
972 NamespaceI >::const_value
973 PointerMField<PtrTypeT,
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,
984 NamespaceI >::reference
985 PointerMField<PtrTypeT,
987 NamespaceI >::back(void)
989 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
990 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
993 return reference(this->_ptrStore.end() - 1, this);
997 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
998 typename PointerMField<PtrTypeT,
1000 NamespaceI >::const_value
1001 PointerMField<PtrTypeT,
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,
1013 NamespaceI >::iterator
1014 PointerMField<PtrTypeT,
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,
1024 NamespaceI >::insert(iterator pos,
1028 this->ptrStoreInsert(pos, n, value);
1031 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1032 template <class InputIteratorT > inline
1033 void PointerMField<PtrTypeT,
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,
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,
1054 NamespaceI >::iterator
1055 PointerMField<PtrTypeT,
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,
1065 NamespaceI >::iterator
1066 PointerMField<PtrTypeT,
1068 NamespaceI >::erase(iterator first, iterator last)
1070 return iterator(this->ptrStoreErase(first.base(), last.base()), this);
1074 #ifndef OSG_CLEAN_FCFIELDS
1075 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1076 typename PointerMField<PtrTypeT,
1078 NamespaceI >::iterator
1079 PointerMField<PtrTypeT,
1081 NamespaceI >::find(const_value value)
1083 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
1084 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
1087 return iterator(this->ptrStoreFind(value),
1092 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1093 typename PointerMField<PtrTypeT,
1095 NamespaceI >::const_iterator
1096 PointerMField<PtrTypeT,
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,
1106 NamespaceI >::push_back(const_value value)
1108 this->ptrStoreAppend(value);
1111 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1112 void PointerMField<PtrTypeT,
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,
1122 NamespaceI >::reserve(size_type newSize)
1124 this->_ptrStore.reserve(newSize);
1127 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1128 void PointerMField<PtrTypeT,
1130 NamespaceI >::clear(void)
1132 this->ptrStoreClear();
1136 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1137 void PointerMField<PtrTypeT,
1139 NamespaceI >::addValue(const_value value)
1141 this->push_back(value);
1145 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1146 void PointerMField<PtrTypeT,
1148 NamespaceI >::assign(size_type newSize,
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,
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,
1170 NamespaceI >::replace(UInt32 uiIdx,
1173 this->ptrStoreReplace(uiIdx, value);
1176 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1177 void PointerMField<PtrTypeT,
1179 NamespaceI >::replace(iterator pos,
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,
1192 NamespaceI >::reference
1193 PointerMField<PtrTypeT,
1195 NamespaceI >::operator [](const size_type index)
1197 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
1198 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
1201 return reference(this->_ptrStore.begin() + index, this);
1205 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1206 typename PointerMField<PtrTypeT,
1208 NamespaceI >::const_value
1209 PointerMField<PtrTypeT,
1211 NamespaceI >::operator [](const size_type index) const
1213 return static_cast<const_value>(this->ptrStoreGet(index));
1216 /*-------------------------------------------------------------------------*/
1219 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1220 typename PointerMField<PtrTypeT,
1222 NamespaceI >::Self &
1223 PointerMField<PtrTypeT,
1225 NamespaceI >::operator=(const Self &source)
1227 // this->setValues(source);
1235 #ifdef OSG_MT_CPTR_ASPECT
1236 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1237 void PointerMField<PtrTypeT,
1239 NamespaceI >::syncWith(Self &source,
1240 ConstFieldMaskArg syncMode,
1242 AspectOffsetStore &oOffsets )
1244 Inherited::syncWith(source,
1251 template <class PtrTypeT,
1252 typename RefCountPolicy,
1253 Int32 NamespaceI > inline
1254 FieldDescriptionBase *
1255 PointerMField<PtrTypeT,
1257 NamespaceI >::createFieldDescription (
1258 const Char8 *szFieldname,
1259 UInt32 uiFieldFlags,
1260 FieldEditMethod fEditMethod,
1261 FieldGetMethod fGetMethod )
1263 if(szFieldname == NULL)
1265 FWARNING(("createFieldDescription no fieldname given"));
1270 if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
1272 uiFieldFlags = (Field::MFDefaultFlags | Field::FStdAccess);
1275 FieldDescriptionBase *returnValue = new typename Self::Description(
1289 template <class PtrTypeT,
1290 typename RefCountPolicy,
1291 Int32 NamespaceI > inline
1292 FieldDescriptionBase *
1293 PointerMField<PtrTypeT,
1295 NamespaceI >::createIdxFieldDescription(
1296 const Char8 *szFieldname,
1297 UInt32 uiFieldFlags,
1298 FieldIndexEditMethod fEditMethod,
1299 FieldIndexGetMethod fGetMethod )
1301 if(szFieldname == NULL)
1303 FWARNING(("createFieldDescriptionIdx no fieldname given"));
1308 if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
1310 uiFieldFlags = (Field::MFDefaultFlags | Field::FStdAccess);
1313 FieldDescriptionBase *returnValue = new typename Self::Description(