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 /* MemObjPointerMFieldIterator<PtrTypeT> */
43 /*-------------------------------------------------------------------------*/
45 /*-------------------------------------------------------------------------*/
48 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
49 MemObjPointerMFieldIterator<PtrTypeT,
51 NamespaceI >::MemObjPointerMFieldIterator(void) :
57 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
58 MemObjPointerMFieldIterator<PtrTypeT,
60 NamespaceI >::MemObjPointerMFieldIterator(
63 _pField (source._pField)
67 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
68 MemObjPointerMFieldIterator<PtrTypeT,
70 NamespaceI >::MemObjPointerMFieldIterator(
71 const PtrStoreItType &storeIter,
78 /*-------------------------------------------------------------------------*/
81 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
82 MemObjPointerMFieldIterator<PtrTypeT,
84 NamespaceI >::~MemObjPointerMFieldIterator(void)
88 /*-------------------------------------------------------------------------*/
91 #ifndef OSG_CLEAN_FCFIELDS
92 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
93 typename MemObjPointerMFieldIterator<PtrTypeT,
95 NamespaceI >::reference
96 MemObjPointerMFieldIterator<PtrTypeT,
98 NamespaceI >::operator *(void) const
100 return reference(*this, _pField);
104 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
105 typename MemObjPointerMFieldIterator<PtrTypeT,
107 NamespaceI >::reference
108 MemObjPointerMFieldIterator<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 MemObjPointerMFieldIterator<PtrTypeT,
119 NamespaceI >::const_value
120 MemObjPointerMFieldIterator<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 MemObjPointerMFieldIterator<PtrTypeT,
132 NamespaceI >::const_value
133 MemObjPointerMFieldIterator<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 MemObjPointerMFieldIterator<PtrTypeT,
146 MemObjPointerMFieldIterator<PtrTypeT,
148 NamespaceI >::operator ++(void)
150 this->Inherited::operator++();
155 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
156 typename MemObjPointerMFieldIterator<PtrTypeT,
159 MemObjPointerMFieldIterator<PtrTypeT,
161 NamespaceI >::operator ++(int)
165 this->Inherited::operator++();
170 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
171 typename MemObjPointerMFieldIterator<PtrTypeT,
174 MemObjPointerMFieldIterator<PtrTypeT,
176 NamespaceI >::operator --(void)
178 this->Inherited::operator--();
183 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
184 typename MemObjPointerMFieldIterator<PtrTypeT,
187 MemObjPointerMFieldIterator<PtrTypeT,
189 NamespaceI >::operator --(int)
193 this->Inherited::operator--();
198 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
199 typename MemObjPointerMFieldIterator<PtrTypeT,
202 MemObjPointerMFieldIterator<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 MemObjPointerMFieldIterator<PtrTypeT,
216 MemObjPointerMFieldIterator<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 MemObjPointerMFieldIterator<PtrTypeT,
230 MemObjPointerMFieldIterator<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 MemObjPointerMFieldIterator<PtrTypeT,
244 MemObjPointerMFieldIterator<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 MemObjPointerMFieldIterator<PtrTypeT,
257 NamespaceI >::operator ==(
258 const Self &rhs) const
260 return *(static_cast<const Inherited *>(this)) == rhs;
263 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
264 bool MemObjPointerMFieldIterator<PtrTypeT,
266 NamespaceI >::operator !=(
267 const Self &rhs) const
269 return ! (*this == rhs);
272 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
273 bool MemObjPointerMFieldIterator<PtrTypeT,
275 NamespaceI >::operator ==(
276 const const_iterator &rhs) const
278 return *(static_cast<const Inherited *>(this)) == rhs;
281 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
282 bool MemObjPointerMFieldIterator<PtrTypeT,
284 NamespaceI >::operator !=(
285 const const_iterator &rhs) const
287 return ! (*this == rhs);
290 /*-------------------------------------------------------------------------*/
293 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
294 const typename MemObjPointerMFieldIterator<PtrTypeT,
296 NamespaceI >::PtrStoreItType &
297 MemObjPointerMFieldIterator<PtrTypeT,
299 NamespaceI >::base(void) const
304 /*-------------------------------------------------------------------------*/
307 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
308 typename MemObjPointerMFieldIterator<PtrTypeT,
310 NamespaceI >::difference_type
311 operator-(MemObjPointerMFieldIterator<PtrTypeT,
313 NamespaceI > const &lhs,
314 MemObjPointerMFieldIterator<PtrTypeT,
316 NamespaceI > const &rhs )
318 return (lhs.base() - rhs.base());
321 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
322 MemObjPointerMFieldIterator<PtrTypeT,
325 operator+(typename MemObjPointerMFieldIterator<PtrTypeT,
327 NamespaceI >::differece_type const offset,
328 MemObjPointerMFieldIterator<PtrTypeT,
330 NamespaceI > const &rhs )
332 return MemObjPointerMFieldIterator<PtrTypeT,
334 NamespaceI >(rhs) += offset;
338 /*-------------------------------------------------------------------------*/
339 /* MemObjPointerMFieldConstIterator<PtrTypeT> */
340 /*-------------------------------------------------------------------------*/
342 /*-------------------------------------------------------------------------*/
345 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
346 MemObjPointerMFieldConstIterator<
349 NamespaceI >::MemObjPointerMFieldConstIterator(void) :
355 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
356 MemObjPointerMFieldConstIterator<
359 NamespaceI >::MemObjPointerMFieldConstIterator(
360 const Self &source) :
366 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
367 MemObjPointerMFieldConstIterator<
370 NamespaceI >::MemObjPointerMFieldConstIterator(
371 const iterator &fieldIter) :
373 Inherited(fieldIter.base())
377 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
378 MemObjPointerMFieldConstIterator<
381 NamespaceI >::MemObjPointerMFieldConstIterator(
382 const PtrStoreConstItType &storeIter) :
388 /*-------------------------------------------------------------------------*/
391 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
392 MemObjPointerMFieldConstIterator<
395 NamespaceI >::~MemObjPointerMFieldConstIterator(void)
399 /*-------------------------------------------------------------------------*/
402 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
403 typename MemObjPointerMFieldConstIterator<PtrTypeT,
405 NamespaceI >::const_value
406 MemObjPointerMFieldConstIterator<PtrTypeT,
408 NamespaceI >::operator *(void) const
410 return static_cast<const_value>(
411 AccessHandler::validate(this->Inherited::operator*()));
415 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
416 typename MemObjPointerMFieldConstIterator<PtrTypeT,
418 NamespaceI >::const_value
419 MemObjPointerMFieldConstIterator<PtrTypeT,
421 NamespaceI >::operator [](
422 const difference_type offset) const
424 return *(*this + offset);
427 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
428 typename MemObjPointerMFieldConstIterator<PtrTypeT,
431 MemObjPointerMFieldConstIterator<PtrTypeT,
433 NamespaceI >::operator ++(void)
435 this->Inherited::operator++();
440 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
441 typename MemObjPointerMFieldConstIterator<PtrTypeT,
444 MemObjPointerMFieldConstIterator<PtrTypeT,
446 NamespaceI >::operator ++(int)
450 this->Inherited::operator++();
455 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
456 typename MemObjPointerMFieldConstIterator<PtrTypeT,
459 MemObjPointerMFieldConstIterator<PtrTypeT,
461 NamespaceI >::operator --(void)
463 this->Inherited::operator--();
468 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
469 typename MemObjPointerMFieldConstIterator<PtrTypeT,
472 MemObjPointerMFieldConstIterator<PtrTypeT,
474 NamespaceI >::operator --(int)
478 this->Inherited::oprator--();
483 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
484 typename MemObjPointerMFieldConstIterator<PtrTypeT,
487 MemObjPointerMFieldConstIterator<PtrTypeT,
489 NamespaceI >::operator +=(
490 const difference_type offset)
492 this->Inherited::operator+=(offset);
497 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
498 typename MemObjPointerMFieldConstIterator<PtrTypeT,
501 MemObjPointerMFieldConstIterator<PtrTypeT,
503 NamespaceI >::operator +(
504 const difference_type offset) const
508 return retVal += offset;
511 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
512 typename MemObjPointerMFieldConstIterator<PtrTypeT,
515 MemObjPointerMFieldConstIterator<PtrTypeT,
517 NamespaceI >::operator -=(
518 const difference_type offset)
520 this->Inherited::operator-=(offset);
525 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
526 typename MemObjPointerMFieldConstIterator<PtrTypeT,
529 MemObjPointerMFieldConstIterator<PtrTypeT,
531 NamespaceI >::operator -(
532 const difference_type offset) const
536 return retVal -= offset;
539 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
540 bool MemObjPointerMFieldConstIterator<PtrTypeT,
542 NamespaceI >::operator ==(
543 const Self &rhs) const
545 return *(static_cast<const Inherited *>(this)) == rhs;
548 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
549 bool MemObjPointerMFieldConstIterator<PtrTypeT,
551 NamespaceI >::operator !=(
552 const Self &rhs) const
554 return ! (*this == rhs);
557 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
558 bool MemObjPointerMFieldConstIterator<PtrTypeT,
560 NamespaceI >::operator ==(
561 const iterator &rhs) const
563 return *(static_cast<const Inherited *>(this)) == rhs;
566 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
567 bool MemObjPointerMFieldConstIterator<PtrTypeT,
569 NamespaceI >::operator !=(
570 const iterator &rhs) const
572 return ! (*this == rhs);
575 /*-------------------------------------------------------------------------*/
578 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
579 const typename MemObjPointerMFieldConstIterator<
582 NamespaceI >::PtrStoreConstItType &
584 MemObjPointerMFieldConstIterator<PtrTypeT,
586 NamespaceI >::base(void) const
592 /*-------------------------------------------------------------------------*/
595 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
596 typename MemObjPointerMFieldConstIterator<PtrTypeT,
598 NamespaceI >::difference_type
599 operator-(MemObjPointerMFieldConstIterator<PtrTypeT,
601 NamespaceI > const &lhs,
602 MemObjPointerMFieldConstIterator<PtrTypeT,
604 NamespaceI > const &rhs )
606 return (lhs.base() - rhs.base());
609 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
610 typename MemObjPointerMFieldConstIterator<PtrTypeT,
612 NamespaceI >::difference_type
613 operator-(MemObjPointerMFieldIterator <PtrTypeT,
615 NamespaceI > const &lhs,
616 MemObjPointerMFieldConstIterator<PtrTypeT,
618 NamespaceI > const &rhs )
620 return (lhs.base() - rhs.base());
623 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
624 typename MemObjPointerMFieldConstIterator<PtrTypeT,
626 NamespaceI >::difference_type
627 operator-(MemObjPointerMFieldConstIterator<PtrTypeT,
629 NamespaceI > const &lhs,
630 MemObjPointerMFieldIterator <PtrTypeT,
632 NamespaceI > const &rhs )
634 return (lhs.base() - rhs.base());
637 template <class PtrTypeT, typename RefCountPolicyT, Int32 NamespaceI>
638 MemObjPointerMFieldConstIterator<PtrTypeT,
641 operator+(typename MemObjPointerMFieldConstIterator<PtrTypeT,
643 NamespaceI >::difference_type const offset,
644 MemObjPointerMFieldConstIterator <PtrTypeT,
646 NamespaceI > const &rhs )
648 return MemObjPointerMFieldConstIterator<PtrTypeT,
650 NamespaceI >(rhs) += offset;
654 /*-------------------------------------------------------------------------*/
655 /* MemObjPointerMFieldReferenceProxy<PtrTypeT> */
656 /*-------------------------------------------------------------------------*/
658 #ifndef OSG_CLEAN_FCFIELDS
659 /*-------------------------------------------------------------------------*/
662 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
663 MemObjPointerMFieldReferenceProxy<
666 NamespaceI >::MemObjPointerMFieldReferenceProxy(
667 const PtrStoreItType &storeIter,
668 MFieldType *pField ) :
670 _storeIter(storeIter),
675 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
676 MemObjPointerMFieldReferenceProxy<
679 NamespaceI >::MemObjPointerMFieldReferenceProxy(
680 const Self &source) :
682 _storeIter(source._storeIter),
683 _pField (source._pField )
687 /*-------------------------------------------------------------------------*/
690 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
691 MemObjPointerMFieldReferenceProxy<
694 NamespaceI >::~MemObjPointerMFieldReferenceProxy(void)
698 /*-------------------------------------------------------------------------*/
701 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
702 MemObjPointerMFieldReferenceProxy<PtrTypeT,
704 NamespaceI >::operator
705 #if defined(_MSC_VER) && _MSC_VER < 1400
706 typename MemObjPointerMFieldReferenceProxy<PtrTypeT,
710 value_type(void) const
712 return static_cast<value_type>(AccessHandler::validate(*_storeIter));
715 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
716 typename MemObjPointerMFieldReferenceProxy<PtrTypeT,
718 NamespaceI >::value_type
719 MemObjPointerMFieldReferenceProxy<PtrTypeT,
721 NamespaceI >::operator->(void) const
723 return static_cast<value_type>(AccessHandler::validate(*_storeIter));
726 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
727 void MemObjPointerMFieldReferenceProxy<PtrTypeT,
729 NamespaceI >::operator=(
732 AccessHandler::onReplace(_pField, *_storeIter, newValue);
734 *_storeIter = newValue;
739 /*-------------------------------------------------------------------------*/
740 /* MemObjPointerPointerMField<PtrTypeT, */
742 /*-------------------------------------------------------------------------*/
744 /*-------------------------------------------------------------------------*/
747 /*-------------------------------------------------------------------------*/
750 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
751 MemObjPointerMField<PtrTypeT,
753 NamespaceI >::MemObjPointerMField(void) :
758 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
759 MemObjPointerMField<PtrTypeT,
761 NamespaceI >::MemObjPointerMField(Self const &other) :
766 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
767 MemObjPointerMField<PtrTypeT,
769 NamespaceI >::MemObjPointerMField(UInt32 const size) :
774 /*-------------------------------------------------------------------------*/
777 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
778 MemObjPointerMField<PtrTypeT,
780 NamespaceI >::~MemObjPointerMField(void)
784 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
785 void MemObjPointerMField<PtrTypeT,
787 NamespaceI >::copyFromBin(BinaryDataHandler &pMem)
789 Inherited::copyFromBin(pMem);
794 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
795 typename MemObjPointerMField<PtrTypeT,
797 NamespaceI >::iterator
798 MemObjPointerMField<PtrTypeT,
800 NamespaceI >::begin_nc(void)
802 return iterator(this->_ptrStore.begin(), this);
805 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
806 typename MemObjPointerMField<PtrTypeT,
808 NamespaceI >::iterator
809 MemObjPointerMField<PtrTypeT,
811 NamespaceI >::end_nc(void)
813 return iterator(this->_ptrStore.end(), this);
816 #ifndef OSG_CLEAN_FCFIELDS
818 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
819 typename MemObjPointerMField<PtrTypeT,
821 NamespaceI >::reference
822 MemObjPointerMField<PtrTypeT,
824 NamespaceI >::front_nc(void)
828 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
829 typename MemObjPointerMField<PtrTypeT,
831 NamespaceI >::reference back_nc (void);
835 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
836 typename MemObjPointerMField<PtrTypeT,
838 NamespaceI >::iterator
839 MemObjPointerMField<PtrTypeT,
841 NamespaceI >::find_nc(const_value value)
843 return iterator(this->ptrStoreFind(value),
847 /*-------------------------------------------------------------------------*/
848 /* Std Library Interface */
850 #ifndef OSG_CLEAN_FCFIELDS
851 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
852 typename MemObjPointerMField<PtrTypeT,
854 NamespaceI >::iterator
855 MemObjPointerMField<PtrTypeT,
857 NamespaceI >::begin(void)
859 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
860 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
863 return iterator(this->_ptrStore.begin(), this);
866 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
867 typename MemObjPointerMField<PtrTypeT,
869 NamespaceI >::iterator
870 MemObjPointerMField<PtrTypeT,
872 NamespaceI >::end(void)
874 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
875 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
878 return iterator(this->_ptrStore.end(), this);
881 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
882 typename MemObjPointerMField<PtrTypeT,
884 NamespaceI >::reverse_iterator
885 MemObjPointerMField<PtrTypeT,
887 NamespaceI >::rbegin(void)
889 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
890 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
893 return reverse_iterator(this->end());
896 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
897 typename MemObjPointerMField<PtrTypeT,
899 NamespaceI >::reverse_iterator
900 MemObjPointerMField<PtrTypeT,
902 NamespaceI >::rend(void)
904 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
905 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
908 return reverse_iterator(this->begin());
912 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
913 typename MemObjPointerMField<PtrTypeT,
915 NamespaceI >::const_iterator
916 MemObjPointerMField<PtrTypeT,
918 NamespaceI >::begin(void) const
920 return const_iterator(this->_ptrStore.begin());
923 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
924 typename MemObjPointerMField<PtrTypeT,
926 NamespaceI >::const_iterator
927 MemObjPointerMField<PtrTypeT,
929 NamespaceI >::end(void) const
931 return const_iterator(this->_ptrStore.end());
934 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
935 typename MemObjPointerMField<PtrTypeT,
937 NamespaceI >::const_reverse_iterator
938 MemObjPointerMField<PtrTypeT,
940 NamespaceI >::rbegin(void) const
942 return const_reverse_iterator(this->end());
945 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
946 typename MemObjPointerMField<PtrTypeT,
948 NamespaceI >::const_reverse_iterator
949 MemObjPointerMField<PtrTypeT,
951 NamespaceI >::rend(void) const
953 return const_reverse_iterator(this->begin());
956 #ifndef OSG_CLEAN_FCFIELDS
957 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
958 typename MemObjPointerMField<PtrTypeT,
960 NamespaceI >::reference
961 MemObjPointerMField<PtrTypeT,
963 NamespaceI >::front(void)
965 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
966 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
969 return reference(this->_ptrStore.begin(), this);
973 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
974 typename MemObjPointerMField<PtrTypeT,
976 NamespaceI >::const_value
977 MemObjPointerMField<PtrTypeT,
979 NamespaceI >::front(void) const
981 return static_cast<const_value>(this->ptrStoreGet(this->_ptrStore.begin()));
984 #ifndef OSG_CLEAN_FCFIELDS
985 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
986 typename MemObjPointerMField<PtrTypeT,
988 NamespaceI >::reference
989 MemObjPointerMField<PtrTypeT,
991 NamespaceI >::back(void)
993 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
994 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
997 return reference(this->_ptrStore.end() - 1, this);
1001 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1002 typename MemObjPointerMField<PtrTypeT,
1004 NamespaceI >::const_value
1005 MemObjPointerMField<PtrTypeT,
1007 NamespaceI >::back(void) const
1009 return static_cast<const_value>(
1010 this->ptrStoreGet(this->_ptrStore.end() - 1));
1014 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1015 typename MemObjPointerMField<PtrTypeT,
1017 NamespaceI >::iterator
1018 MemObjPointerMField<PtrTypeT,
1020 NamespaceI >::insert(iterator pos, const_value value)
1022 return iterator(this->ptrStoreInsert(pos.base(), value), this);
1025 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1026 void MemObjPointerMField<PtrTypeT,
1028 NamespaceI >::insert(iterator pos,
1032 this->ptrStoreInsert(pos, n, value);
1035 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1036 template <class InputIteratorT > inline
1037 void MemObjPointerMField<PtrTypeT,
1039 NamespaceI >::insert(iterator pos,
1040 InputIteratorT first,
1041 InputIteratorT last)
1043 this->ptrStoreInsert(pos, first, last);
1046 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1047 void MemObjPointerMField<PtrTypeT,
1049 NamespaceI >::erase(size_type index)
1051 return this->ptrStoreErase(index);
1054 #ifndef OSG_CLEAN_FCFIELDS
1055 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1056 typename MemObjPointerMField<PtrTypeT,
1058 NamespaceI >::iterator
1059 MemObjPointerMField<PtrTypeT,
1061 NamespaceI >::erase(iterator pos)
1063 return iterator(this->ptrStoreErase(pos.base()), this);
1066 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1067 typename MemObjPointerMField<PtrTypeT,
1069 NamespaceI >::iterator
1070 MemObjPointerMField<PtrTypeT,
1072 NamespaceI >::erase(iterator first, iterator last)
1074 return iterator(this->ptrStoreErase(first.base(), last.base()), this);
1078 #ifndef OSG_CLEAN_FCFIELDS
1079 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1080 typename MemObjPointerMField<PtrTypeT,
1082 NamespaceI >::iterator
1083 MemObjPointerMField<PtrTypeT,
1085 NamespaceI >::find(const_value value)
1087 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
1088 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
1091 return iterator(this->ptrStoreFind(value),
1096 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1097 typename MemObjPointerMField<PtrTypeT,
1099 NamespaceI >::const_iterator
1100 MemObjPointerMField<PtrTypeT,
1102 NamespaceI >::find(const_value value) const
1104 return const_iterator(this->ptrStoreFind(value),
1108 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1109 void MemObjPointerMField<PtrTypeT,
1111 NamespaceI >::push_back(const_value value)
1113 this->ptrStoreAppend(value);
1116 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1117 void MemObjPointerMField<PtrTypeT,
1119 NamespaceI >::resize(size_t newSize,
1122 this->ptrStoreResize(newSize, value);
1125 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1126 void MemObjPointerMField<PtrTypeT,
1128 NamespaceI >::reserve(size_type size)
1130 this->_ptrStore.reserve(size);
1133 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1134 void MemObjPointerMField<PtrTypeT,
1136 NamespaceI >::clear(void)
1138 this->ptrStoreClear();
1142 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1143 void MemObjPointerMField<PtrTypeT,
1145 NamespaceI >::addValue(const_value value)
1147 this->push_back(value);
1151 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1152 void MemObjPointerMField<PtrTypeT,
1154 NamespaceI >::assign(size_type newSize,
1157 this->ptrStoreClear();
1159 for(size_type i = 0; i < newSize; ++i)
1160 this->ptrStoreAppend(value);
1163 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI>
1164 template <class InputIteratorT > inline
1165 void MemObjPointerMField<PtrTypeT,
1167 NamespaceI >::assign(InputIteratorT first,
1168 InputIteratorT last)
1170 this->ptrStoreAssign(first, last);
1173 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1174 void MemObjPointerMField<PtrTypeT,
1176 NamespaceI >::replace(UInt32 uiIdx,
1179 this->ptrStoreReplace(uiIdx, value);
1182 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1183 void MemObjPointerMField<PtrTypeT,
1185 NamespaceI >::replace(iterator pos,
1188 this->ptrStoreReplace(pos.base(), value);
1191 /*-------------------------------------------------------------------------*/
1192 /* Index Operator */
1194 #ifndef OSG_CLEAN_FCFIELDS
1195 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1196 typename MemObjPointerMField<PtrTypeT,
1198 NamespaceI >::reference
1199 MemObjPointerMField<PtrTypeT,
1201 NamespaceI >::operator [](const UInt32 index)
1203 #ifdef OSG_CHECK_CONST_CORRECT_FIELD_USAGE
1204 BOOST_STATIC_ASSERT(sizeof(PtrTypeT) == 0);
1207 return reference(this->_ptrStore.begin() + index, this);
1211 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1212 typename MemObjPointerMField<PtrTypeT,
1214 NamespaceI >::const_value
1215 MemObjPointerMField<PtrTypeT,
1217 NamespaceI >::operator [](const UInt32 index) const
1219 return static_cast<const_value>(this->ptrStoreGet(index));
1222 /*-------------------------------------------------------------------------*/
1225 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1226 typename MemObjPointerMField<PtrTypeT,
1228 NamespaceI >::Self &
1229 MemObjPointerMField<PtrTypeT,
1231 NamespaceI >::operator=(const Self &source)
1233 // this->setValues(source);
1241 #ifdef OSG_MT_CPTR_ASPECT
1242 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1243 void MemObjPointerMField<PtrTypeT,
1245 NamespaceI >::syncWith(
1247 ConstFieldMaskArg syncMode,
1249 AspectOffsetStore &oOffsets )
1251 Inherited::syncWith(source,
1258 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1259 FieldDescriptionBase *
1260 MemObjPointerMField<PtrTypeT,
1262 NamespaceI >::createFieldDescription (
1263 const Char8 *szFieldname,
1264 UInt32 uiFieldFlags,
1265 FieldEditMethod fEditMethod,
1266 FieldGetMethod fGetMethod )
1271 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
1272 FieldDescriptionBase *
1273 MemObjPointerMField<PtrTypeT,
1275 NamespaceI >::createIdxFieldDescription(
1276 const Char8 *szFieldname,
1277 UInt32 uiFieldFlags,
1278 FieldIndexEditMethod fEditMethod,
1279 FieldIndexGetMethod fGetMethod )