1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2003 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 \*---------------------------------------------------------------------------*/
46 std::vector<CoreT *> &_vResultStore;
48 CoreCollector(std::vector<CoreT *> &vResultStore);
51 Action::ResultE travEnter(Node * const pRoot);
55 CoreCollector(const CoreCollector &source);
56 void operator =(const CoreCollector &source);
59 template <class CoreT> inline
60 CoreCollector<CoreT>::CoreCollector(std::vector<CoreT *> &vResultStore) :
61 _vResultStore(vResultStore)
65 template <class CoreT> inline
66 CoreCollector<CoreT>::~CoreCollector(void)
70 template <class CoreT> inline
71 Action::ResultE CoreCollector<CoreT>::travEnter(Node * const pRoot)
75 CoreT *pTypedCore = dynamic_cast<CoreT *>(pRoot->getCore());
77 if(pTypedCore != NULL)
79 _vResultStore.push_back(pTypedCore);
83 return Action::Continue;
87 template<class CoreT> inline
88 void collectCoresByType(Node *pRoot,
89 std::vector<CoreT *> &result)
91 CoreCollector<CoreT> oCoreColl(result);
93 traverse(pRoot, boost::bind(&CoreCollector<CoreT>::travEnter,