1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
7 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
9 \*---------------------------------------------------------------------------*/
10 /*---------------------------------------------------------------------------*\
13 * This library is free software; you can redistribute it and/or modify it *
14 * under the terms of the GNU Library General Public License as published *
15 * by the Free Software Foundation, version 2. *
17 * This library is distributed in the hope that it will be useful, but *
18 * WITHOUT ANY WARRANTY; without even the implied warranty of *
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
20 * Library General Public License for more details. *
22 * You should have received a copy of the GNU Library General Public *
23 * License along with this library; if not, write to the Free Software *
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
26 \*---------------------------------------------------------------------------*/
27 /*---------------------------------------------------------------------------*\
35 \*---------------------------------------------------------------------------*/
37 //---------------------------------------------------------------------------
39 //---------------------------------------------------------------------------
44 UInt32 MultiCore::getNCores(void) const
46 return _mfCores.size32();
50 Int32 MultiCore::findCore(NodeCore * const pCore) const
52 return _mfCores.findIndex(pCore);
56 void MultiCore::insertCore(UInt32 coreIdx,
57 NodeCore * const coreP )
59 MultiCore *pMCore = dynamic_cast<MultiCore *>(coreP);
63 FWARNING(("Can not insert multi-core into multi-core, ignored\n"));
67 editMField(CoresFieldMask, _mfCores);
69 MFCoresType::iterator cIt = _mfCores.begin_nc();
73 _mfCores.insert(cIt, coreP);
77 const MFUnrecChildNodeCorePtr *MultiCore::getMFCores(void) const
79 return Inherited::getMFCores();
83 NodeCore *MultiCore::getCores(const UInt32 index) const
85 return Inherited::getCores(index);
89 void MultiCore::addCore(NodeCore * const value)
91 MultiCore *pMCore = dynamic_cast<MultiCore *>(value);
95 FWARNING(("Can not insert multi-core into multi-core, ignored\n"));
99 Inherited::addCore(value);
103 void MultiCore::assignCoresFrom(const MFUnrecChildNodeCorePtr &value)
105 MFUnrecChildNodeCorePtr::const_iterator vIt = value.begin();
106 MFUnrecChildNodeCorePtr::const_iterator vEnd = value.end ();
108 for(; vIt != vEnd; ++vIt)
110 MultiCore *pMCore = dynamic_cast<MultiCore *>(*vIt);
114 FWARNING(("Can not insert multi-core into multi-core, ignored\n"));
119 Inherited::assignCoresFrom(value);
123 void MultiCore::subCore(UInt32 uiIndex)
125 Inherited::subCore(uiIndex);
129 void MultiCore::subCoreByObj(NodeCore * const value)
131 Inherited::subCoreByObj(value);
135 void MultiCore::clearCores(void)
137 Inherited::clearCores();
140 template <class ObjectT> inline
141 void addCoreToNode(Node *pNode,
142 TransitPtr<ObjectT> pCore)
144 addCoreToNode(pCore.get(), pNode);