this->exchangeMapsData (theOther);
}
- //! Assignment
+ //! Assignment.
+ //! This method does not change the internal allocator.
NCollection_DataMap& Assign (const NCollection_DataMap& theOther)
{
if (this == &theOther)
return *this;
- Clear(theOther.myAllocator);
+ Clear();
ReSize (theOther.Extent()-1);
Iterator anIter(theOther);
for (; anIter.More(); anIter.Next())
this->exchangeMapsData (theOther);
}
- //! Assignment
+ //! Assignment.
+ //! This method does not change the internal allocator.
NCollection_DoubleMap& Assign (const NCollection_DoubleMap& theOther)
{
if (this == &theOther)
return *this;
- Clear(theOther.myAllocator);
+ Clear();
ReSize (theOther.Extent()-1);
Iterator anIter(theOther);
for (; anIter.More(); anIter.Next())
//! Assignment operator
NCollection_DoubleMap& operator= (const NCollection_DoubleMap& theOther)
- {
+ {
return Assign (theOther);
}
this->exchangeMapsData (theOther);
}
- //! Assignment
+ //! Assignment.
+ //! This method does not change the internal allocator.
NCollection_IndexedDataMap& Assign (const NCollection_IndexedDataMap& theOther)
{
if (this == &theOther)
return *this;
- Clear(theOther.myAllocator);
+ Clear();
ReSize (theOther.Extent()-1);
Standard_Integer i;
for (i=1; i<=theOther.Extent(); i++)
//! Assignment operator
NCollection_IndexedDataMap& operator= (const NCollection_IndexedDataMap& theOther)
- {
+ {
return Assign (theOther);
}
this->exchangeMapsData (theOther);
}
- //! Assign
+ //! Assign.
+ //! This method does not change the internal allocator.
NCollection_IndexedMap& Assign (const NCollection_IndexedMap& theOther)
{
if (this == &theOther)
return *this;
- Clear(theOther.myAllocator);
+ Clear();
ReSize (theOther.Extent()-1);
Standard_Integer i, iLength=theOther.Extent();
for (i=1; i<=iLength; i++)
Standard_Integer Size (void) const
{ return Extent(); }
- //! Replace this list by the items of another list (theOther parameter)
- void Assign (const NCollection_List& theOther)
+ //! Replace this list by the items of another list (theOther parameter).
+ //! This method does not change the internal allocator.
+ NCollection_List& Assign (const NCollection_List& theOther)
{
if (this != &theOther) {
- Clear(theOther.myAllocator);
+ Clear();
appendList(theOther.PFirst());
}
+ return *this;
}
//! Replacement operator
NCollection_List& operator= (const NCollection_List& theOther)
{
- Assign (theOther);
- return *this;
+ return Assign (theOther);
}
//! Clear this list
this->exchangeMapsData (theOther);
}
- //! Assign
+ //! Assign.
+ //! This method does not change the internal allocator.
NCollection_Map& Assign (const NCollection_Map& theOther)
{
if (this == &theOther)
return *this;
- Clear(theOther.myAllocator);
+ Clear();
ReSize (theOther.Extent()-1);
Iterator anIter(theOther);
for (; anIter.More(); anIter.Next())
//! Assign operator
NCollection_Map& operator= (const NCollection_Map& theOther)
- {
+ {
return Assign(theOther);
}
this->myAllocator = theAllocator;
}
- //! Replace this sequence by the items of theOther
+ //! Replace this sequence by the items of theOther.
+ //! This method does not change the internal allocator.
NCollection_Sequence& Assign (const NCollection_Sequence& theOther)
{
if (this == &theOther)
return *this;
- Clear (theOther.myAllocator);
+ Clear ();
Node * pCur = (Node *) theOther.myFirstItem;
while (pCur) {
Node* pNew = new (this->myAllocator) Node (pCur->Value());
}
#include <AIS_TypeFilter.hxx>
+//=======================================================================
+//function : OCC25340
+//purpose :
+//=======================================================================
static Standard_Integer OCC25340 (Draw_Interpretor& /*theDI*/,
Standard_Integer /*theArgNb*/,
const char** /*theArgVec*/)
return 0;
}
+//=======================================================================
+//function : OCC25348
+//purpose :
+//=======================================================================
+static Standard_Integer OCC25348 (Draw_Interpretor& theDI,
+ Standard_Integer /*theArgNb*/,
+ const char** /*theArgVec*/)
+{
+ Handle(NCollection_IncAllocator) anAlloc1;
+ NCollection_List<int> aList1(anAlloc1);
+ for (int i=0; i < 10; i++)
+ {
+ Handle(NCollection_IncAllocator) anAlloc2;
+ NCollection_List<int> aList2(anAlloc2);
+ aList2.Append(i);
+ aList1.Assign(aList2);
+ }
+ theDI << "Test complete\n";
+ return 0;
+}
+
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
theCommands.Add ("OCC7570", "OCC7570 shape", __FILE__, OCC7570, group);
theCommands.Add ("OCC25100", "OCC25100 shape", __FILE__, OCC25100, group);
theCommands.Add ("OCC25340", "OCC25340", __FILE__, OCC25340, group);
+ theCommands.Add ("OCC25348", "OCC25348", __FILE__, OCC25348, group);
return;
}
--- /dev/null
+puts "========"
+puts "OCC25348"
+puts "========"
+puts ""
+#######################################################################################
+# Method Assign of NCollection containers must not change own allocator of the target
+#######################################################################################
+
+pload QAcommands
+
+OCC25348