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
);
284 struct FieldPathEntry
290 void splitFieldPath( std::vector
<FieldPathEntry
> &vSplitPath
,
291 const Char8
*szFieldPath
)
293 std::string
tmpName(szFieldPath
);
295 std::string::size_type sStart
= 0;
296 std::string::size_type sEnd
= 0;
297 std::string::size_type sLength
= 0;
298 std::string::size_type sLastChar
= 0;
299 FieldPathEntry tmpEntry
;
305 sEnd
= tmpName
.find("/", sStart
);
307 if(sEnd
!= std::string::npos
)
309 sLength
= sEnd
- sStart
;
313 sLength
= tmpName
.length() - sStart
;
316 sLastChar
= sStart
+ sLength
- 1;
318 vSplitPath
.push_back(tmpEntry
);
320 vSplitPath
.back().iIndex
= -1;
322 if(tmpName
[sLastChar
] == ')')
324 std::string::size_type sIdxStart
=
325 tmpName
.rfind('(', sLastChar
); //, sLength);
327 if(sIdxStart
== std::string::npos
)
334 tmpName
[sIdxStart
] = '$';
335 tmpName
[sLastChar
] = '$';
337 sLength
-= sLastChar
- sIdxStart
+ 1;
341 szIdx
.assign(tmpName
,
343 sLastChar
- sIdxStart
);
345 vSplitPath
.back().iIndex
=
346 TypeTraits
<UInt32
>::getFromCString(szIdx
.c_str());
349 vSplitPath
.back().szName
.assign(tmpName
, sStart
, sLength
);
353 while(sEnd
!= std::string::npos
);
356 FieldContainer
*resolveFieldPath(std::vector
<FieldPathEntry
> &vSplitPath
,
357 FieldContainer
*pRoot
)
362 FieldContainer
*returnValue
= pRoot
;
364 OSG::GetFieldHandlePtr fHandle
;
366 for(UInt32 i
= 1; i
< vSplitPath
.size(); ++i
)
368 fHandle
= returnValue
->getField(vSplitPath
[i
].szName
.c_str());
370 if(fHandle
== NULL
|| fHandle
->isValid() == false)
372 FWARNING(("Unknown field '%s'\n",
373 vSplitPath
[i
].szName
.c_str()));
380 OSG::FieldContainerPtrSFieldBase::GetHandlePtr sfFCPtr
=
381 boost::dynamic_pointer_cast
<
382 OSG::FieldContainerPtrSFieldBase::GetHandle
>(fHandle
);
384 OSG::FieldContainerPtrMFieldBase::GetHandlePtr mfFCPtr
=
385 boost::dynamic_pointer_cast
<
386 OSG::FieldContainerPtrMFieldBase::GetHandle
>(fHandle
);
388 if(sfFCPtr
!= NULL
&& sfFCPtr
->isValid() == true)
390 returnValue
= (*sfFCPtr
)->getValue();
392 else if(mfFCPtr
!= NULL
&& mfFCPtr
->isValid() == true)
395 vSplitPath
[i
].iIndex
== -1 ? 0 : vSplitPath
[i
].iIndex
;
397 if(uiIndex
>= mfFCPtr
->size())
399 FWARNING(("Unknown index %d to large for field '%s'\n",
401 vSplitPath
[i
].szName
.c_str()));
408 returnValue
= (**mfFCPtr
)[uiIndex
];
415 FieldContainer
*resolveFieldPathImpl(const Char8
*szNodeName
,
416 ContainerResolver oResolver
)
418 std::vector
<FieldPathEntry
> vSplitPath
;
420 splitFieldPath(vSplitPath
, szNodeName
);
422 if(vSplitPath
.size() == 0)
425 FieldContainer
*returnValue
= oResolver(vSplitPath
[0].szName
.c_str());
427 returnValue
= resolveFieldPath(vSplitPath
, returnValue
);
434 struct ContainerVisitRecord
436 typedef std::vector
<UInt32
>::iterator VisitedIt
;
438 std::vector
<UInt32
> vVisitedIds
;
440 bool visit(UInt32 uiContainerId
);
443 bool ContainerVisitRecord::visit(UInt32 uiContainerId
)
445 VisitedIt vIt
= std::lower_bound(vVisitedIds
.begin(),
449 if(vIt
!= vVisitedIds
.end())
451 if(*vIt
== uiContainerId
)
454 vVisitedIds
.insert(vIt
, uiContainerId
);
458 vVisitedIds
.push_back(uiContainerId
);
464 FieldContainer
*findNamedComponentImpl( ContainerVisitRecord
&oVisited
,
465 FieldContainer
*pCnt
,
466 const Char8
*szName
)
471 const Char8
*szTmpName
= NULL
;
473 const AttachmentContainer
*pAC
=
474 dynamic_cast<const AttachmentContainer
*>(pCnt
);
477 fprintf(stderr
, "findNamedComponent::visit %p type %s\n",
479 pCnt
->getType().getCName());
482 szTmpName
= OSG::getName(pAC
);
484 if(szTmpName
!= NULL
&& osgStringCmp(szTmpName
, szName
) == 0)
489 if(oVisited
.visit(pCnt
->getId()) == false)
494 const Node
*pNode
= dynamic_cast<const Node
*>(pCnt
);
498 if(0x0000 == (pNode
->getTravMask() &
499 TraversalMasks::FindNamedComponentTraversal
))
505 BitVector bvExcludedFields
= TypeTraits
<BitVector
>::BitsSet
;
507 const ControlFindNamedElemInterface
*pCFNInterface
=
508 dynamic_cast<ControlFindNamedElemInterface
*>(pCnt
);
510 if(pCFNInterface
!= NULL
)
512 bvExcludedFields
= pCFNInterface
->excludeFields();
515 const FieldContainerType
&fcType
= pCnt
->getType();
516 UInt32 fCount
= fcType
.getNumFieldDescs();
518 for(UInt32 i
= 1; i
<= fCount
; ++i
)
520 const FieldDescriptionBase
*fDesc
= fcType
.getFieldDesc(i
);
522 if(fDesc
->getFieldType().getClass() == FieldType::ParentPtrField
)
525 if(0x0000 == (bvExcludedFields
& fDesc
->getFieldMask()))
528 GetFieldHandlePtr srcField
= pCnt
->getField(i
);
530 FieldContainerPtrSFieldBase::GetHandlePtr sfFCPtr
=
531 boost::dynamic_pointer_cast
<
532 FieldContainerPtrSFieldBase::GetHandle
>(srcField
);
534 FieldContainerPtrMFieldBase::GetHandlePtr mfFCPtr
=
535 boost::dynamic_pointer_cast
<
536 FieldContainerPtrMFieldBase::GetHandle
>(srcField
);
538 if( sfFCPtr
!= NULL
&&
539 sfFCPtr
->isValid() == true &&
540 (*sfFCPtr
)->getValue() != NULL
)
542 FieldContainer
*rc
= findNamedComponentImpl(oVisited
,
543 (*sfFCPtr
)->getValue(),
548 else if(mfFCPtr
!= NULL
&& mfFCPtr
->isValid() == true)
550 SizeT mfSize
= (*mfFCPtr
)->size();
552 for(SizeT i
= 0; i
< mfSize
; i
++)
554 if((**mfFCPtr
)[i
] != NULL
)
556 FieldContainer
*rc
= findNamedComponentImpl(oVisited
,
570 FieldContainer
*findNamedComponentImpl( FieldContainer
*pCnt
,
573 ContainerVisitRecord oVisited
;
575 return findNamedComponentImpl(oVisited
, pCnt
, szName
);
580 /*! Compares two FieldContainer \a lhs and \a rhs for equivalence. The meaning
581 of this comparison can be tweaked with the additional arguments.
582 If \a ignoreAttachments is \c true, Attachments are excluded from the
584 If \a compareIdentity is \c true, pointers are compared by
585 address otherwise the pointed-to objects are compared for equivalence.
587 bool compareContainerEqual(
588 const FieldContainer
*lhs
,
589 const FieldContainer
*rhs
,
590 bool ignoreAttachments
,
591 bool compareIdentity
)
596 return compareContainerEqualImpl(
597 lhs
, rhs
, lhsVisitedSet
, rhsVisitedSet
,
598 ignoreAttachments
, compareIdentity
);
601 //---------------------------------------------------------------------------
603 //---------------------------------------------------------------------------
605 void MemoryConsumption::scan(void)
607 FieldContainerFactory::the()->lockStore();
609 FieldContainerFactoryBase::ContainerStoreConstIt sIt
=
610 FieldContainerFactory::the()->beginStore();
611 FieldContainerFactoryBase::ContainerStoreConstIt sEnd
=
612 FieldContainerFactory::the()->endStore();
614 for(; sIt
!= sEnd
; ++sIt
)
616 FieldContainer
*pFC
= (*sIt
).second
->getPtr();
621 TypeMemMapIt tmIt
= _memMap
.find(pFC
->getType().getId());
622 SizeT binSize
= pFC
->getBinSize(TypeTraits
<BitVector
>::BitsSet
);
624 if(tmIt
!= _memMap
.end())
626 tmIt
->second
.first
+= binSize
;
627 tmIt
->second
.second
+= 1;
631 _memMap
[pFC
->getType().getId()] = MemCountPair(binSize
, 1);
635 FieldContainerFactory::the()->unlockStore();
639 void MemoryConsumption::print(std::ostream
&os
, bool ignoreProto
) const
641 TypeMemMapConstIt tmIt
= _memMap
.begin();
642 TypeMemMapConstIt tmEnd
= _memMap
.end ();
645 UInt32 totalCount
= 0;
646 boost::format
formatter("%|1$-25| [%|2$8|] Byte [%|3$8.0f|] kByte [%|4$4|]\n");
648 for(; tmIt
!= tmEnd
; ++tmIt
)
650 FieldContainerType
*fcType
=
651 FieldContainerFactory::the()->findType(tmIt
->first
);
656 if(ignoreProto
&& tmIt
->second
.second
== 1)
659 os
<< formatter
% fcType
->getCName()
661 % (tmIt
->second
.first
/ 1024.f
)
662 % tmIt
->second
.second
;
664 totalMem
+= tmIt
->second
.first
;
665 totalCount
+= tmIt
->second
.second
;
668 os
<< "--------------------------------------------\n";
669 os
<< formatter
% "Total"
671 % (totalMem
/ 1024.f
)
675 MemoryConsumption::TypeMemMapConstIt
MemoryConsumption::beginMap(void) const
677 return _memMap
.begin();
680 MemoryConsumption::TypeMemMapConstIt
MemoryConsumption::endMap(void) const
682 return _memMap
.end();
685 ControlFindNamedElemInterface::ControlFindNamedElemInterface(void)
689 ControlFindNamedElemInterface::~ControlFindNamedElemInterface(void)
694 FieldContainer
*resolveFieldPath(const Char8
*szNodeName
,
695 ContainerResolver oResolver
)
697 return resolveFieldPathImpl(szNodeName
, oResolver
);
700 FieldContainer
*findNamedComponent( FieldContainer
*pCnt
,
703 return findNamedComponentImpl(pCnt
, szName
);
708 FieldContainer
*getFieldContainer(const std::string
&szTypeName
,
709 const std::string
&szName
)
711 return getFieldContainer(
712 FieldContainerFactory::the()->findType(szTypeName
.c_str()), szName
);
715 FieldContainer
*getFieldContainer(const FieldContainerType
*pType
,
716 const std::string
&szName
)
720 SWARNING
<< "getFieldContainer(): The Field type is not defined."
726 const FieldContainerFactoryBase::ContainerStore
&oFCStore(
727 FieldContainerFactory::the()->getFieldContainerStore());
729 FieldContainerFactoryBase::ContainerStore::const_iterator fcStoreIt
=
732 FieldContainerFactoryBase::ContainerPtr pCont
= NULL
;
734 for(; fcStoreIt
!= oFCStore
.end() ; ++fcStoreIt
)
736 #ifdef OSG_MT_CPTR_ASPECT
737 pCont
= (*fcStoreIt
).second
->getPtr();
739 pCont
= *fcStoreIt
.second
;
742 if(pCont
!= NULL
&& pCont
->getType() == (*pType
))
744 const Char8
*szCntName
=
745 getName(dynamic_cast<AttachmentContainer
*>(pCont
));
747 if(szCntName
!= NULL
&& szName
.compare(szCntName
) == 0)
758 FieldContainer
*getFieldContainer(const std::string
&szName
)
760 const FieldContainerFactoryBase::ContainerStore
&oFCStore
=
761 FieldContainerFactory::the()->getFieldContainerStore();
763 FieldContainerFactoryBase::ContainerStore::const_iterator fcStoreIt
=
766 FieldContainerFactoryBase::ContainerPtr pCont
= NULL
;
768 for(; fcStoreIt
!= oFCStore
.end() ; ++fcStoreIt
)
770 if((*fcStoreIt
).second
== NULL
)
775 #ifdef OSG_MT_CPTR_ASPECT
776 pCont
= (*fcStoreIt
).second
->getPtr();
778 pCont
= *fcStoreIt
.second
;
780 const Char8
*szCntName
=
781 getName(dynamic_cast<AttachmentContainer
*>(pCont
));
783 if(szCntName
!= NULL
&& szName
.compare(szCntName
) == 0)
793 bool isFieldContentDerivedFrom(const FieldType
&oFieldType
,
794 const FieldContainerType
*pFCType
)
796 if(oFieldType
.isPtrField())
798 std::string
szFieldPtrTypeName(oFieldType
.getContentType().getName());
800 switch(oFieldType
.getClass())
802 case FieldType::PtrField
:
803 case FieldType::ParentPtrField
:
804 case FieldType::ChildPtrField
:
805 szFieldPtrTypeName
= szFieldPtrTypeName
.substr(
807 szFieldPtrTypeName
.size() - 3);
810 case FieldType::ValueField
:
815 const FieldContainerType
*pPtrContentType
=
816 FieldContainerFactory::the()->findType(szFieldPtrTypeName
.c_str());
818 return pFCType
->isDerivedFrom(*pPtrContentType
);
828 const FieldContainerType
*getFieldContainerTypeFromPtrType(
829 const DataType
&oType
)
831 std::string szFCPtrTypeName
=
832 oType
.getName().substr(0, oType
.getName().size() - 3);
834 return FieldContainerFactory::the()->findType(szFCPtrTypeName
.c_str());
839 const FieldContainerType
*getClosestAncestor(
840 const FieldContainerType
*pType
,
841 MFUnrecFieldContainerPtr::const_iterator begin
,
842 MFUnrecFieldContainerPtr::const_iterator end
)
849 const FieldContainerType
*pAncestorType
= NULL
;
850 const FieldContainerType
*pFCType
= NULL
;
852 MFUnrecFieldContainerPtr::const_iterator it
= begin
;
854 for(; it
!= end
; ++it
)
856 pFCType
= &((*it
)->getType());
858 if(pType
->isDerivedFrom(*pFCType
) &&
859 (pAncestorType
== NULL
|| pFCType
->isDerivedFrom(*pAncestorType
)))
861 pAncestorType
= pFCType
;
865 return pAncestorType
;
868 std::vector
<FieldContainer
*> getAllContainersByDerivedType(
869 const FieldContainerType
*pType
)
871 std::vector
<FieldContainer
*> vResult
;
873 const FieldContainerFactoryBase::ContainerStore
&oFCStore
=
874 FieldContainerFactory::the()->getFieldContainerStore();
876 FieldContainerFactoryBase::ContainerStore::const_iterator fcStoreIt
=
879 FieldContainerFactoryBase::ContainerPtr pCont
=
882 for(;fcStoreIt
!= oFCStore
.end() ; ++fcStoreIt
)
884 if((*fcStoreIt
).second
!= NULL
)
886 #ifdef OSG_MT_CPTR_ASPECT
887 pCont
= (*fcStoreIt
).second
->getPtr();
889 pCont
= *fcStoreIt
.second
;
896 if(pCont
!= NULL
&& pCont
->getType().isDerivedFrom(*pType
))
898 vResult
.push_back(pCont
);
906 std::vector
<FieldContainerPtr
> getAllContainersByType(const FieldContainerType
*szType
)
908 std::vector
<FieldContainerPtr
> Result
;
910 const std::vector
<FieldContainerPtr
>* FCStore( FieldContainerFactory::the()->getFieldContainerStore () );
912 std::vector
<FieldContainerPtr
>::const_iterator FCStoreIter
;
913 for(FCStoreIter
= FCStore
->begin() ; FCStoreIter
!= FCStore
->end() ; ++FCStoreIter
)
915 if( (*FCStoreIter
) != NullFC
&& (*FCStoreIter
)->getType() == (*szType
) )
917 Result
.push_back(*FCStoreIter
);
925 std::vector
<FieldContainerPtr
> getAllFieldContainers(const std::string
&namestring
)
927 std::vector
<FieldContainerPtr
> Result
;
928 std::vector
<FieldContainerPtr
>::const_iterator FCStoreIter
;
930 const std::vector
<FieldContainerPtr
>* FCStore( FieldContainerFactory::the()->getFieldContainerStore () );
932 for(FCStoreIter
= FCStore
->begin() ; FCStoreIter
!= FCStore
->end() ; ++FCStoreIter
)
934 const Char8
*Name( getName(AttachmentContainerPtr::dcast(*FCStoreIter
)) );
935 if(Name
!= NULL
&& namestring
.compare(Name
) == 0)
937 //Result.push_back(*FCStoreIter);