|
From: Frank V. C. <fr...@us...> - 2001-03-01 03:18:55
|
Update of /cvsroot/corelinux/clfw/src/testdrivers/exf1
In directory usw-pr-cvs1:/tmp/cvs-serv10107/src/testdrivers/exf1
Modified Files:
examp1.cpp
Log Message:
233863 SetCollection added, almost
Index: examp1.cpp
===================================================================
RCS file: /cvsroot/corelinux/clfw/src/testdrivers/exf1/examp1.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** examp1.cpp 2001/02/27 13:51:11 1.29
--- examp1.cpp 2001/03/01 03:20:16 1.30
***************
*** 63,66 ****
--- 63,70 ----
#endif
+ #if !defined(__SETCOLLECTION_HPP)
+ #include <clfw/SetCollection.hpp>
+ #endif
+
#if !defined(__ARRAY_HPP)
#include <clfw/Array.hpp>
***************
*** 329,332 ****
--- 333,377 ----
dumpTypeInformation( aType );
+ UnsignedInteger ui1( 1 );
+ UnsignedInteger ui2( 2 );
+ 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;
+ }
//
|