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 \*---------------------------------------------------------------------------*/
39 #include "OSGFieldContainerUtils.h"
40 #include "OSGFieldContainerSFields.h"
41 #include "OSGFieldContainerMFields.h"
42 #include "OSGAttachment.h"
43 #include "OSGAttachmentMapSFields.h"
44 #include "OSGNameAttachment.h"
47 #include <boost/bind.hpp>
48 #include <boost/format.hpp>
57 // anonymous namespace for implementation details of the container
60 typedef std::set
<const FieldContainer
*> FCSet
;
62 // forward declarations
63 bool comparePointerFields(
64 GetFieldHandlePtr lhsField
,
65 GetFieldHandlePtr rhsField
,
68 bool ignoreAttachments
,
69 bool compareIdentity
);
71 /*! Implementation of \c compareContainerEqual. The two \c FCSet parameters
72 keep track of visited fields in each hierarchy to avoid looping.
74 bool compareContainerEqualImpl(
75 const FieldContainer
*lhs
,
76 const FieldContainer
*rhs
,
79 bool ignoreAttachments
,
80 bool compareIdentity
)
86 if(lhs
== NULL
|| rhs
== NULL
)
90 if(lhs
->getType() != rhs
->getType())
93 UInt32 lhsFCount
= lhs
->getType().getNumFieldDescs();
94 UInt32 rhsFCount
= rhs
->getType().getNumFieldDescs();
96 // different number of (dynamic) fields ?
97 if(lhsFCount
!= rhsFCount
)
100 lhsVisitedSet
.insert(lhs
);
101 rhsVisitedSet
.insert(rhs
);
103 bool returnValue
= true;
105 for(UInt32 i
= 1; i
<= lhsFCount
&& returnValue
== true; ++i
)
107 GetFieldHandlePtr lhsField
= lhs
->getField(i
);
108 GetFieldHandlePtr rhsField
= rhs
->getField(i
);
111 if(lhsField
== NULL
|| lhsField
->isValid() == false ||
112 rhsField
== NULL
|| rhsField
->isValid() == false )
115 if(lhsField
->getType() != rhsField
->getType())
121 // skip internal and parent fields
122 if(lhsField
->isInternal() == true ||
123 lhsField
->getType ().getClass() == FieldType::ParentPtrField
)
126 SFAttachmentPtrMap::GetHandlePtr lhsAMHandle
=
127 boost::dynamic_pointer_cast
<SFAttachmentPtrMap::GetHandle
>(
130 if(lhsAMHandle
!= NULL
&&
131 lhsAMHandle
->isValid() == true &&
132 ignoreAttachments
== true )
137 if(compareIdentity
== true)
139 if(lhsField
->equal(rhsField
) == false)
144 if(lhsField
->isPointerField() == true)
146 returnValue
= comparePointerFields(
148 lhsVisitedSet
, rhsVisitedSet
,
149 ignoreAttachments
, compareIdentity
);
153 if(lhsField
->equal(rhsField
) == false)
162 /*! Compares two PointerFields \a lhsField and \a rhsField by recursively
163 comparing the pointed-to containers.
164 This function is only used in \c compareContainer below.
166 bool comparePointerFields(
167 GetFieldHandlePtr lhsField
,
168 GetFieldHandlePtr rhsField
,
169 FCSet
&lhsVisitedSet
,
170 FCSet
&rhsVisitedSet
,
171 bool ignoreAttachments
,
172 bool compareIdentity
)
174 bool returnValue
= true;
176 if(lhsField
->getCardinality() == FieldType::SingleField
)
178 FieldContainerPtrSFieldBase::GetHandlePtr lhsSFHandle
=
179 boost::dynamic_pointer_cast
<
180 FieldContainerPtrSFieldBase::GetHandle
>(lhsField
);
181 FieldContainerPtrSFieldBase::GetHandlePtr rhsSFHandle
=
182 boost::dynamic_pointer_cast
<
183 FieldContainerPtrSFieldBase::GetHandle
>(rhsField
);
185 if(lhsSFHandle
!= NULL
&& lhsSFHandle
->isValid() &&
186 rhsSFHandle
!= NULL
&& rhsSFHandle
->isValid() )
188 if(lhsVisitedSet
.count(lhsSFHandle
->get()) == 0 ||
189 rhsVisitedSet
.count(rhsSFHandle
->get()) == 0 )
191 returnValue
= compareContainerEqualImpl(
192 lhsSFHandle
->get(), rhsSFHandle
->get(),
193 lhsVisitedSet
, rhsVisitedSet
,
194 ignoreAttachments
, compareIdentity
);
199 SFAttachmentPtrMap::GetHandlePtr lhsAMHandle
=
200 boost::dynamic_pointer_cast
<SFAttachmentPtrMap::GetHandle
>(
202 SFAttachmentPtrMap::GetHandlePtr rhsAMHandle
=
203 boost::dynamic_pointer_cast
<SFAttachmentPtrMap::GetHandle
>(
206 if(lhsAMHandle
!= NULL
&& lhsAMHandle
->isValid() &&
207 rhsAMHandle
!= NULL
&& rhsAMHandle
->isValid() )
209 const AttachmentMap
&lhsAM
= (*lhsAMHandle
)->getValue();
210 const AttachmentMap
&rhsAM
= (*rhsAMHandle
)->getValue();
212 // skip attachments, if the option is set
213 if(ignoreAttachments
)
217 else if(lhsAM
.size() != rhsAM
.size())
223 AttachmentMap::const_iterator lhsAMIt
= lhsAM
.begin();
224 AttachmentMap::const_iterator lhsAMEnd
= lhsAM
.end ();
226 AttachmentMap::const_iterator rhsAMIt
= rhsAM
.begin();
228 for(; lhsAMIt
!= lhsAMEnd
&& returnValue
== true;
229 ++lhsAMIt
, ++rhsAMIt
)
231 if(lhsVisitedSet
.count(lhsAMIt
->second
) == 0 ||
232 rhsVisitedSet
.count(rhsAMIt
->second
) == 0 )
234 returnValue
= compareContainerEqualImpl(
235 lhsAMIt
->second
, rhsAMIt
->second
,
236 lhsVisitedSet
, rhsVisitedSet
,
237 ignoreAttachments
, compareIdentity
);
246 FieldContainerPtrMFieldBase::GetHandlePtr lhsMFHandle
=
247 boost::dynamic_pointer_cast
<
248 FieldContainerPtrMFieldBase::GetHandle
>(lhsField
);
249 FieldContainerPtrMFieldBase::GetHandlePtr rhsMFHandle
=
250 boost::dynamic_pointer_cast
<
251 FieldContainerPtrMFieldBase::GetHandle
>(rhsField
);
253 if(lhsMFHandle
!= NULL
&& lhsMFHandle
->isValid() &&
254 rhsMFHandle
!= NULL
&& rhsMFHandle
->isValid() )
256 if(lhsMFHandle
->size() != rhsMFHandle
->size())
262 for(UInt32 i
= 0; i
< lhsMFHandle
->size() &&
263 returnValue
== true; ++i
)
265 if(lhsVisitedSet
.count(lhsMFHandle
->get(i
)) == 0 ||
266 rhsVisitedSet
.count(rhsMFHandle
->get(i
)) == 0 )
268 returnValue
= compareContainerEqualImpl(
269 lhsMFHandle
->get(i
), rhsMFHandle
->get(i
),
270 lhsVisitedSet
, rhsVisitedSet
,
271 ignoreAttachments
, compareIdentity
);
285 struct FieldPathEntry
290 FieldPathEntry(void) : szName(), iIndex(0) {}
293 void splitFieldPath( std::vector
<FieldPathEntry
> &vSplitPath
,
294 const Char8
*szFieldPath
)
296 std::string
tmpName(szFieldPath
);
298 std::string::size_type sStart
= 0;
299 std::string::size_type sEnd
= 0;
300 std::string::size_type sLength
= 0;
301 std::string::size_type sLastChar
= 0;
302 FieldPathEntry tmpEntry
;
308 sEnd
= tmpName
.find("/", sStart
);
310 if(sEnd
!= std::string::npos
)
312 sLength
= sEnd
- sStart
;
316 sLength
= tmpName
.length() - sStart
;
319 sLastChar
= sStart
+ sLength
- 1;
321 vSplitPath
.push_back(tmpEntry
);
323 vSplitPath
.back().iIndex
= -1;
325 if(tmpName
[sLastChar
] == ')')
327 std::string::size_type sIdxStart
=
328 tmpName
.rfind('(', sLastChar
); //, sLength);
330 if(sIdxStart
== std::string::npos
)
337 tmpName
[sIdxStart
] = '$';
338 tmpName
[sLastChar
] = '$';
340 sLength
-= sLastChar
- sIdxStart
+ 1;
344 szIdx
.assign(tmpName
,
346 sLastChar
- sIdxStart
);
348 vSplitPath
.back().iIndex
=
349 TypeTraits
<UInt32
>::getFromCString(szIdx
.c_str());
352 vSplitPath
.back().szName
.assign(tmpName
, sStart
, sLength
);
356 while(sEnd
!= std::string::npos
);
359 FieldContainer
*resolveFieldPath(std::vector
<FieldPathEntry
> &vSplitPath
,
360 FieldContainer
*pRoot
)
365 FieldContainer
*returnValue
= pRoot
;
367 OSG::GetFieldHandlePtr fHandle
;
369 for(UInt32 i
= 1; i
< vSplitPath
.size(); ++i
)
371 fHandle
= returnValue
->getField(vSplitPath
[i
].szName
.c_str());
373 if(fHandle
== NULL
|| fHandle
->isValid() == false)
375 FWARNING(("Unknown field '%s'\n",
376 vSplitPath
[i
].szName
.c_str()));
383 OSG::FieldContainerPtrSFieldBase::GetHandlePtr sfFCPtr
=
384 boost::dynamic_pointer_cast
<
385 OSG::FieldContainerPtrSFieldBase::GetHandle
>(fHandle
);
387 OSG::FieldContainerPtrMFieldBase::GetHandlePtr mfFCPtr
=
388 boost::dynamic_pointer_cast
<
389 OSG::FieldContainerPtrMFieldBase::GetHandle
>(fHandle
);
391 if(sfFCPtr
!= NULL
&& sfFCPtr
->isValid() == true)
393 returnValue
= (*sfFCPtr
)->getValue();
395 else if(mfFCPtr
!= NULL
&& mfFCPtr
->isValid() == true)
398 vSplitPath
[i
].iIndex
== -1 ? 0 : vSplitPath
[i
].iIndex
;
400 if(uiIndex
>= mfFCPtr
->size())
402 FWARNING(("Unknown index %d to large for field '%s'\n",
404 vSplitPath
[i
].szName
.c_str()));
411 returnValue
= (**mfFCPtr
)[uiIndex
];
418 FieldContainer
*resolveFieldPathImpl(const Char8
*szNodeName
,
419 ContainerResolver oResolver
)
421 std::vector
<FieldPathEntry
> vSplitPath
;
423 splitFieldPath(vSplitPath
, szNodeName
);
425 if(vSplitPath
.size() == 0)
428 FieldContainer
*returnValue
= oResolver(vSplitPath
[0].szName
.c_str());
430 returnValue
= resolveFieldPath(vSplitPath
, returnValue
);
437 struct ContainerVisitRecord
439 typedef std::vector
<UInt32
>::iterator VisitedIt
;
441 std::vector
<UInt32
> vVisitedIds
;
443 bool visit(UInt32 uiContainerId
);
445 ContainerVisitRecord(void) : vVisitedIds() {}
448 bool ContainerVisitRecord::visit(UInt32 uiContainerId
)
450 VisitedIt vIt
= std::lower_bound(vVisitedIds
.begin(),
454 if(vIt
!= vVisitedIds
.end())
456 if(*vIt
== uiContainerId
)
459 vVisitedIds
.insert(vIt
, uiContainerId
);
463 vVisitedIds
.push_back(uiContainerId
);
469 FieldContainer
*findNamedComponentImpl( ContainerVisitRecord
&oVisited
,
470 FieldContainer
*pCnt
,
471 const Char8
*szName
)
476 const Char8
*szTmpName
= NULL
;
478 const AttachmentContainer
*pAC
=
479 dynamic_cast<const AttachmentContainer
*>(pCnt
);
482 fprintf(stderr
, "findNamedComponent::visit %p type %s\n",
484 pCnt
->getType().getCName());
487 szTmpName
= OSG::getName(pAC
);
489 if(szTmpName
!= NULL
&& osgStringCmp(szTmpName
, szName
) == 0)
494 if(oVisited
.visit(pCnt
->getId()) == false)
499 const Node
*pNode
= dynamic_cast<const Node
*>(pCnt
);
503 if(0x0000 == (pNode
->getTravMask() &
504 TraversalMasks::FindNamedComponentTraversal
))
510 BitVector bvExcludedFields
= TypeTraits
<BitVector
>::BitsSet
;
512 const ControlFindNamedElemInterface
*pCFNInterface
=
513 dynamic_cast<ControlFindNamedElemInterface
*>(pCnt
);
515 if(pCFNInterface
!= NULL
)
517 bvExcludedFields
= pCFNInterface
->excludeFields();
520 const FieldContainerType
&fcType
= pCnt
->getType();
521 UInt32 fCount
= fcType
.getNumFieldDescs();
523 for(UInt32 i
= 1; i
<= fCount
; ++i
)
525 const FieldDescriptionBase
*fDesc
= fcType
.getFieldDesc(i
);
527 if(fDesc
->getFieldType().getClass() == FieldType::ParentPtrField
)
530 if(0x0000 == (bvExcludedFields
& fDesc
->getFieldMask()))
533 GetFieldHandlePtr srcField
= pCnt
->getField(i
);
535 FieldContainerPtrSFieldBase::GetHandlePtr sfFCPtr
=
536 boost::dynamic_pointer_cast
<
537 FieldContainerPtrSFieldBase::GetHandle
>(srcField
);
539 FieldContainerPtrMFieldBase::GetHandlePtr mfFCPtr
=
540 boost::dynamic_pointer_cast
<
541 FieldContainerPtrMFieldBase::GetHandle
>(srcField
);
543 if( sfFCPtr
!= NULL
&&
544 sfFCPtr
->isValid() == true &&
545 (*sfFCPtr
)->getValue() != NULL
)
547 FieldContainer
*rc
= findNamedComponentImpl(oVisited
,
548 (*sfFCPtr
)->getValue(),
553 else if(mfFCPtr
!= NULL
&& mfFCPtr
->isValid() == true)
555 SizeT mfSize
= (*mfFCPtr
)->size();
557 for(SizeT j
= 0; j
< mfSize
; j
++)
559 if((**mfFCPtr
)[j
] != NULL
)
561 FieldContainer
*rc
= findNamedComponentImpl(oVisited
,
575 FieldContainer
*findNamedComponentImpl( FieldContainer
*pCnt
,
578 ContainerVisitRecord oVisited
;
580 return findNamedComponentImpl(oVisited
, pCnt
, szName
);
585 /*! Compares two FieldContainer \a lhs and \a rhs for equivalence. The meaning
586 of this comparison can be tweaked with the additional arguments.
587 If \a ignoreAttachments is \c true, Attachments are excluded from the
589 If \a compareIdentity is \c true, pointers are compared by
590 address otherwise the pointed-to objects are compared for equivalence.
592 bool compareContainerEqual(
593 const FieldContainer
*lhs
,
594 const FieldContainer
*rhs
,
595 bool ignoreAttachments
,
596 bool compareIdentity
)
601 return compareContainerEqualImpl(
602 lhs
, rhs
, lhsVisitedSet
, rhsVisitedSet
,
603 ignoreAttachments
, compareIdentity
);
606 //---------------------------------------------------------------------------
608 //---------------------------------------------------------------------------
610 void MemoryConsumption::scan(void)
612 FieldContainerFactory::the()->lockStore();
614 FieldContainerFactoryBase::ContainerStoreConstIt sIt
=
615 FieldContainerFactory::the()->beginStore();
616 FieldContainerFactoryBase::ContainerStoreConstIt sEnd
=
617 FieldContainerFactory::the()->endStore();
619 for(; sIt
!= sEnd
; ++sIt
)
621 FieldContainer
*pFC
= (*sIt
).second
->getPtr();
626 TypeMemMapIt tmIt
= _memMap
.find(pFC
->getType().getId());
627 SizeT binSize
= pFC
->getBinSize(TypeTraits
<BitVector
>::BitsSet
);
629 if(tmIt
!= _memMap
.end())
631 tmIt
->second
.first
+= binSize
;
632 tmIt
->second
.second
+= 1;
636 _memMap
[pFC
->getType().getId()] = MemCountPair(binSize
, 1);
640 FieldContainerFactory::the()->unlockStore();
644 void MemoryConsumption::print(std::ostream
&os
, bool ignoreProto
) const
646 TypeMemMapConstIt tmIt
= _memMap
.begin();
647 TypeMemMapConstIt tmEnd
= _memMap
.end ();
650 UInt32 totalCount
= 0;
651 boost::format
formatter("%|1$-25| [%|2$8|] Byte [%|3$8.0f|] kByte [%|4$4|]\n");
653 for(; tmIt
!= tmEnd
; ++tmIt
)
655 FieldContainerType
*fcType
=
656 FieldContainerFactory::the()->findType(tmIt
->first
);
661 if(ignoreProto
&& tmIt
->second
.second
== 1)
664 os
<< formatter
% fcType
->getCName()
666 % (tmIt
->second
.first
/ 1024.f
)
667 % tmIt
->second
.second
;
669 totalMem
+= tmIt
->second
.first
;
670 totalCount
+= tmIt
->second
.second
;
673 os
<< "--------------------------------------------\n";
674 os
<< formatter
% "Total"
676 % (totalMem
/ 1024.f
)
680 MemoryConsumption::TypeMemMapConstIt
MemoryConsumption::beginMap(void) const
682 return _memMap
.begin();
685 MemoryConsumption::TypeMemMapConstIt
MemoryConsumption::endMap(void) const
687 return _memMap
.end();
690 ControlFindNamedElemInterface::ControlFindNamedElemInterface(void)
694 ControlFindNamedElemInterface::~ControlFindNamedElemInterface(void)
699 FieldContainer
*resolveFieldPath(const Char8
*szNodeName
,
700 ContainerResolver oResolver
)
702 return resolveFieldPathImpl(szNodeName
, oResolver
);
705 FieldContainer
*findNamedComponent( FieldContainer
*pCnt
,
708 return findNamedComponentImpl(pCnt
, szName
);
713 FieldContainer
*getFieldContainer(const std::string
&szTypeName
,
714 const std::string
&szName
)
716 return getFieldContainer(
717 FieldContainerFactory::the()->findType(szTypeName
.c_str()), szName
);
720 FieldContainer
*getFieldContainer(const FieldContainerType
*pType
,
721 const std::string
&szName
)
725 SWARNING
<< "getFieldContainer(): The Field type is not defined."
731 const FieldContainerFactoryBase::ContainerStore
&oFCStore(
732 FieldContainerFactory::the()->getFieldContainerStore());
734 FieldContainerFactoryBase::ContainerStore::const_iterator fcStoreIt
=
737 FieldContainerFactoryBase::ContainerPtr pCont
= NULL
;
739 for(; fcStoreIt
!= oFCStore
.end() ; ++fcStoreIt
)
741 #ifdef OSG_MT_CPTR_ASPECT
742 pCont
= (*fcStoreIt
).second
->getPtr();
744 pCont
= *fcStoreIt
.second
;
747 if(pCont
!= NULL
&& pCont
->getType() == (*pType
))
749 const Char8
*szCntName
=
750 getName(dynamic_cast<AttachmentContainer
*>(pCont
));
752 if(szCntName
!= NULL
&& szName
.compare(szCntName
) == 0)
763 FieldContainer
*getFieldContainer(const std::string
&szName
)
765 const FieldContainerFactoryBase::ContainerStore
&oFCStore
=
766 FieldContainerFactory::the()->getFieldContainerStore();
768 FieldContainerFactoryBase::ContainerStore::const_iterator fcStoreIt
=
771 FieldContainerFactoryBase::ContainerPtr pCont
= NULL
;
773 for(; fcStoreIt
!= oFCStore
.end() ; ++fcStoreIt
)
775 if((*fcStoreIt
).second
== NULL
)
780 #ifdef OSG_MT_CPTR_ASPECT
781 pCont
= (*fcStoreIt
).second
->getPtr();
783 pCont
= *fcStoreIt
.second
;
785 const Char8
*szCntName
=
786 getName(dynamic_cast<AttachmentContainer
*>(pCont
));
788 if(szCntName
!= NULL
&& szName
.compare(szCntName
) == 0)
798 bool isFieldContentDerivedFrom(const FieldType
&oFieldType
,
799 const FieldContainerType
*pFCType
)
801 if(oFieldType
.isPtrField())
803 std::string
szFieldPtrTypeName(oFieldType
.getContentType().getName());
805 switch(oFieldType
.getClass())
807 case FieldType::PtrField
:
808 case FieldType::ParentPtrField
:
809 case FieldType::ChildPtrField
:
810 szFieldPtrTypeName
= szFieldPtrTypeName
.substr(
812 szFieldPtrTypeName
.size() - 3);
815 case FieldType::ValueField
:
820 const FieldContainerType
*pPtrContentType
=
821 FieldContainerFactory::the()->findType(szFieldPtrTypeName
.c_str());
823 return pFCType
->isDerivedFrom(*pPtrContentType
);
833 const FieldContainerType
*getFieldContainerTypeFromPtrType(
834 const DataType
&oType
)
836 std::string szFCPtrTypeName
=
837 oType
.getName().substr(0, oType
.getName().size() - 3);
839 return FieldContainerFactory::the()->findType(szFCPtrTypeName
.c_str());
844 const FieldContainerType
*getClosestAncestor(
845 const FieldContainerType
*pType
,
846 MFUnrecFieldContainerPtr::const_iterator begin
,
847 MFUnrecFieldContainerPtr::const_iterator end
)
854 const FieldContainerType
*pAncestorType
= NULL
;
855 const FieldContainerType
*pFCType
= NULL
;
857 MFUnrecFieldContainerPtr::const_iterator it
= begin
;
859 for(; it
!= end
; ++it
)
861 pFCType
= &((*it
)->getType());
863 if(pType
->isDerivedFrom(*pFCType
) &&
864 (pAncestorType
== NULL
|| pFCType
->isDerivedFrom(*pAncestorType
)))
866 pAncestorType
= pFCType
;
870 return pAncestorType
;
873 std::vector
<FieldContainer
*> getAllContainersByDerivedType(
874 const FieldContainerType
*pType
)
876 std::vector
<FieldContainer
*> vResult
;
878 const FieldContainerFactoryBase::ContainerStore
&oFCStore
=
879 FieldContainerFactory::the()->getFieldContainerStore();
881 FieldContainerFactoryBase::ContainerStore::const_iterator fcStoreIt
=
884 FieldContainerFactoryBase::ContainerPtr pCont
=
887 for(;fcStoreIt
!= oFCStore
.end() ; ++fcStoreIt
)
889 if((*fcStoreIt
).second
!= NULL
)
891 #ifdef OSG_MT_CPTR_ASPECT
892 pCont
= (*fcStoreIt
).second
->getPtr();
894 pCont
= *fcStoreIt
.second
;
901 if(pCont
!= NULL
&& pCont
->getType().isDerivedFrom(*pType
))
903 vResult
.push_back(pCont
);
911 std::vector
<FieldContainerPtr
> getAllContainersByType(const FieldContainerType
*szType
)
913 std::vector
<FieldContainerPtr
> Result
;
915 const std::vector
<FieldContainerPtr
>* FCStore( FieldContainerFactory::the()->getFieldContainerStore () );
917 std::vector
<FieldContainerPtr
>::const_iterator FCStoreIter
;
918 for(FCStoreIter
= FCStore
->begin() ; FCStoreIter
!= FCStore
->end() ; ++FCStoreIter
)
920 if( (*FCStoreIter
) != NullFC
&& (*FCStoreIter
)->getType() == (*szType
) )
922 Result
.push_back(*FCStoreIter
);
930 std::vector
<FieldContainerPtr
> getAllFieldContainers(const std::string
&namestring
)
932 std::vector
<FieldContainerPtr
> Result
;
933 std::vector
<FieldContainerPtr
>::const_iterator FCStoreIter
;
935 const std::vector
<FieldContainerPtr
>* FCStore( FieldContainerFactory::the()->getFieldContainerStore () );
937 for(FCStoreIter
= FCStore
->begin() ; FCStoreIter
!= FCStore
->end() ; ++FCStoreIter
)
939 const Char8
*Name( getName(AttachmentContainerPtr::dcast(*FCStoreIter
)) );
940 if(Name
!= NULL
&& namestring
.compare(Name
) == 0)
942 //Result.push_back(*FCStoreIter);