|
From: Frank V. C. <fr...@us...> - 2001-03-01 16:33:05
|
Update of /cvsroot/corelinux/clfw/src/testdrivers/exf1
In directory usw-pr-cvs1:/tmp/cvs-serv19117/src/testdrivers/exf1
Modified Files:
examp1.cpp
Log Message:
233863 SetCollection
Index: examp1.cpp
===================================================================
RCS file: /cvsroot/corelinux/clfw/src/testdrivers/exf1/examp1.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** examp1.cpp 2001/03/01 03:20:16 1.30
--- examp1.cpp 2001/03/01 16:34:28 1.31
***************
*** 337,376 ****
UnsignedInteger ui3( 3 );
UnsignedInteger ui4( 4 );
! UnsignedInteger ui5( 1 );
! Array anArray;
! SetCollection aSet;
! anArray += &ui1;
! anArray += &ui2;
! anArray += &ui3;
! anArray += &ui4;
! anArray += &ui1; // allows duplicates
! anArray += &ui5; // of value as well
!
! aSet += &ui1;
! aSet += &ui2;
! aSet += &ui3;
! aSet += &ui4;
! aSet += &ui1; // won't allow pointer dupes
! aSet += &ui5; // but does values
! Count maxCnt = anArray.getSize();
! cout << endl << "Array display" << endl;
for( Count x = 0; x < maxCnt; ++x )
{
! UnsignedInteger *anInt = UnsignedInteger::castDown( anArray.getElementAt( x ) );
! cout << "Element at [" << x << "] = " << anInt->getValue() << endl;
}
! cout << endl << "Set display" << endl;
! maxCnt = aSet.getSize();
for( Count x = 0; x < maxCnt; ++x )
{
! UnsignedInteger *anInt = UnsignedInteger::castDown( aSet.getElementAt( x ) );
! cout << "Element at [" << x << "] = " << anInt->getValue() << endl;
}
--- 337,403 ----
UnsignedInteger ui3( 3 );
UnsignedInteger ui4( 4 );
! UnsignedInteger ui5( 5 );
! UnsignedInteger ui6( 6 );
! UnsignedInteger ui7( 7 );
!
! SetCollection aSet1;
! SetCollection aSet2;
! Array aRay;
!
! aSet1 += &ui1;
! aSet1 += &ui2;
! aSet1 += &ui3;
!
! aSet2 += &ui4;
! aSet2 += &ui5;
! aSet2 += &ui6;
!
! aRay += &ui1;
! aRay += &ui5;
! aRay += &ui7;
! aRay += &ui7;
! cout << endl << "Sets display" << endl;
! Count maxCnt = aSet1.getSize();
! for( Count x = 0; x < maxCnt; ++x )
! {
! UnsignedInteger *anInt = UnsignedInteger::castDown( aSet1.getElementAt( x ) );
! cout << "Set1:Element at [" << x << "] = " << anInt->getValue() << endl;
! }
!
! maxCnt = aSet2.getSize();
! cout << endl ;
!
for( Count x = 0; x < maxCnt; ++x )
{
! UnsignedInteger *anInt = UnsignedInteger::castDown( aSet2.getElementAt( x ) );
! cout << "Set2:Element at [" << x << "] = " << anInt->getValue() << endl;
}
+
+ aSet1 += aSet2;
+
+ maxCnt = aSet1.getSize();
+
+ cout << endl ;
+
+ for( Count x = 0; x < maxCnt; ++x )
+ {
+ UnsignedInteger *anInt = UnsignedInteger::castDown( aSet1.getElementAt( x ) );
+ cout << "Set1:Element at [" << x << "] = " << anInt->getValue() << endl;
+ }
+
+ aSet1 += aRay;
! maxCnt = aSet1.getSize();
! cout << endl ;
for( Count x = 0; x < maxCnt; ++x )
{
! UnsignedInteger *anInt = UnsignedInteger::castDown( aSet1.getElementAt( x ) );
! cout << "Set1:Element at [" << x << "] = " << anInt->getValue() << endl;
}
|