Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

SortedCollections.cpp

Go to the documentation of this file.
00001 // SortedCollections.cpp: implementation of the SortedCollections classes.
00002 //
00003 //////////////////////////////////////////////////////////////////////
00004 
00005 #include "SortedCollections.h"
00006 #include "JTime.h"
00007 #include "Message.h"
00008 
00009 namespace cmlabs {
00010 
00011 //////////////////////////////////////////////////////////////////////
00012 // Construction/Destruction
00013 //////////////////////////////////////////////////////////////////////
00014 
00015 SortedCollection::SortedCollection()
00016 {
00017         objectTable.type = "sortedcollection";
00018         objectTable.sorting = SORTBYVALUE;
00019 }
00020 
00021 SortedCollection::SortedCollection(const JString& xml) : Collection(xml) {
00022         objectTable.type = "sortedcollection";
00023         objectTable.sorting = SORTBYVALUE;
00024 }
00025 
00026 SortedCollection::SortedCollection(XMLNode *node) : Collection(node) {
00027         objectTable.type = "sortedcollection";
00028         objectTable.sorting = SORTBYVALUE;
00029 }
00030 
00031 
00032 SortedCollection::~SortedCollection()
00033 {
00034 
00035 }
00036 
00037 int SortedCollection::addAndReturnPosition(const JString& value) {
00038         return objectTable.addAndReturnPosition(NULL, value.clone());
00039 }
00040 
00041 int SortedCollection::removeAllBetween(const JString& str1, const JString& str2) {
00042         return objectTable.removeAllEntriesBetween(&str1, &str2);
00043 }
00044 
00045 SortedCollection SortedCollection::getAllBetween(const JString& str1, const JString& str2) {
00046         SortedCollection scol;
00047         ObjectCollection* col = objectTable.getAllEntriesBetween(&str1, &str2);
00048         if (col != NULL) {
00049                 for (CollectionEntry* entry = (CollectionEntry*) col->getFirst(); entry != NULL; entry = (CollectionEntry*) col->getNext()) {
00050                         scol.add(*(JString*)entry->value);
00051                 }
00052         }
00053         delete(col);
00054         return scol;
00055 }
00056 
00057 JString SortedCollection::getFirstAfter(const JString& str) {
00058         CollectionEntry* entry = objectTable.getFirstEntryAfter(&str);
00059         if (entry == NULL)
00060                 return "";
00061         else
00062                 return *(JString*) entry->value;
00063 }
00064 
00065 JString SortedCollection::getLastBefore(const JString& str) {
00066         CollectionEntry* entry = objectTable.getLastEntryBefore(&str);
00067         if (entry == NULL)
00068                 return "";
00069         else
00070                 return *(JString*) entry->value;
00071 }
00072 
00073 
00074 
00075 
00076 
00077 
00078 bool SortedCollection::unitTest() {
00079 
00080         SortedCollection* oc = new SortedCollection();
00081 
00082         oc->add("Test1");
00083         oc->add("Test4");
00084         oc->add("Test2");
00085         oc->add("Test6");
00086         oc->add("Test3");
00087         oc->add("Test5");
00088 
00089         if (!oc->getFirst().equals("Test1"))
00090                 return false;
00091         if (!oc->getNext().equals("Test2"))
00092                 return false;
00093         if (!oc->getNext().equals("Test3"))
00094                 return false;
00095         if (!oc->getNext().equals("Test4"))
00096                 return false;
00097         if (!oc->getNext().equals("Test5"))
00098                 return false;
00099         if (!oc->getNext().equals("Test6"))
00100                 return false;
00101 
00102         SortedCollection oc2;
00103 
00104         oc2 = *oc;
00105 
00106         if (!oc2.getFirst().equals("Test1"))
00107                 return false;
00108         if (!oc2.getNext().equals("Test2"))
00109                 return false;
00110         if (!oc2.getNext().equals("Test3"))
00111                 return false;
00112         if (!oc2.getNext().equals("Test4"))
00113                 return false;
00114         if (!oc2.getNext().equals("Test5"))
00115                 return false;
00116         if (!oc2.getNext().equals("Test6"))
00117                 return false;
00118 
00119         delete(oc);
00120         return true;
00121 }
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152 SortedObjectCollection::SortedObjectCollection()
00153 {
00154         objectTable.type = "sortedobjectcollection";
00155         objectTable.sorting = SORTBYVALUE;
00156 }
00157 
00158 SortedObjectCollection::SortedObjectCollection(const JString& xml) : ObjectCollection(xml) {
00159         objectTable.type = "sortedobjectcollection";
00160         objectTable.sorting = SORTBYVALUE;
00161 }
00162 
00163 SortedObjectCollection::SortedObjectCollection(XMLNode *node) : ObjectCollection(node) {
00164         objectTable.type = "sortedobjectcollection";
00165         objectTable.sorting = SORTBYVALUE;
00166 }
00167 
00168 
00169 SortedObjectCollection::~SortedObjectCollection()
00170 {
00171 
00172 }
00173 
00174 int SortedObjectCollection::addAndReturnPosition(Object* value) {
00175         return objectTable.addAndReturnPosition(NULL, value);
00176 }
00177 
00178 int SortedObjectCollection::removeAllBetween(const Object* value1, const Object* value2) {
00179         return objectTable.removeAllEntriesBetween(value1, value2);
00180 }
00181 
00182 SortedObjectCollection SortedObjectCollection::getAllBetween(const Object* value1, const Object* value2) {
00183         SortedObjectCollection scol;
00184         scol.noDelete();
00185         ObjectCollection* col = objectTable.getAllEntriesBetween(value1, value2);
00186         if (col != NULL) {
00187                 for (CollectionEntry* entry = (CollectionEntry*) col->getFirst(); entry != NULL; entry = (CollectionEntry*) col->getNext()) {
00188                         scol.add(entry->value);
00189                 }
00190         }
00191         delete(col);
00192         return scol;
00193 }
00194 
00195 JString SortedObjectCollection::getFirstAfter(const Object* value) {
00196         CollectionEntry* entry = objectTable.getFirstEntryAfter(value);
00197         if (entry == NULL)
00198                 return "";
00199         else
00200                 return entry->value;
00201 }
00202 
00203 JString SortedObjectCollection::getLastBefore(const Object* value) {
00204         CollectionEntry* entry = objectTable.getLastEntryBefore(value);
00205         if (entry == NULL)
00206                 return "";
00207         else
00208                 return entry->value;
00209 }
00210 
00211 
00212 
00213 
00214 
00215 
00216 bool SortedObjectCollection::unitTest() {
00217 
00218         SortedObjectCollection* oc = new SortedObjectCollection();
00219 
00220         oc->add(new JString("Test1"));
00221         oc->add(new JString("Test4"));
00222         oc->add(new JString("Test2"));
00223         oc->add(new JString("Test6"));
00224         oc->add(new JString("Test3"));
00225         oc->add(new JString("Test5"));
00226 
00227         Object* obj;
00228         if ( (obj = oc->getFirst()) == NULL)
00229                 return false;
00230         if (!((JString*)obj)->equals("Test1") )
00231                 return false;
00232         if ( (obj = oc->getNext()) == NULL)
00233                 return false;
00234         if (!((JString*)obj)->equals("Test2") )
00235                 return false;
00236         if ( (obj = oc->getNext()) == NULL)
00237                 return false;
00238         if (!((JString*)obj)->equals("Test3") )
00239                 return false;
00240         if ( (obj = oc->getNext()) == NULL)
00241                 return false;
00242         if (!((JString*)obj)->equals("Test4") )
00243                 return false;
00244         if ( (obj = oc->getNext()) == NULL)
00245                 return false;
00246         if (!((JString*)obj)->equals("Test5") )
00247                 return false;
00248         if ( (obj = oc->getNext()) == NULL)
00249                 return false;
00250         if (!((JString*)obj)->equals("Test6") )
00251                 return false;
00252 
00253         SortedObjectCollection oc2;
00254 
00255         oc2 = *oc;
00256         oc2.noDelete();
00257 
00258         if ( (obj = oc2.getFirst()) == NULL)
00259                 return false;
00260         if (!((JString*)obj)->equals("Test1") )
00261                 return false;
00262         if ( (obj = oc2.getNext()) == NULL)
00263                 return false;
00264         if (!((JString*)obj)->equals("Test2") )
00265                 return false;
00266         if ( (obj = oc2.getNext()) == NULL)
00267                 return false;
00268         if (!((JString*)obj)->equals("Test3") )
00269                 return false;
00270         if ( (obj = oc2.getNext()) == NULL)
00271                 return false;
00272         if (!((JString*)obj)->equals("Test4") )
00273                 return false;
00274         if ( (obj = oc2.getNext()) == NULL)
00275                 return false;
00276         if (!((JString*)obj)->equals("Test5") )
00277                 return false;
00278         if ( (obj = oc2.getNext()) == NULL)
00279                 return false;
00280         if (!((JString*)obj)->equals("Test6") )
00281                 return false;
00282 
00283         oc->removeAll();
00284         oc2.removeAll();
00285 
00286         if (oc->getCount() != 0)
00287                 return false;
00288         if (oc2.getCount() != 0)
00289                 return false;
00290 
00291         delete(oc);
00292 
00293 
00294 
00295 
00296         oc = new SortedObjectCollection();
00297         oc->objectTable.sorting |= SORTREVERSE;
00298 
00299         oc->add(new JString("Test1"));
00300         oc->add(new JString("Test4"));
00301         oc->add(new JString("Test2"));
00302         oc->add(new JString("Test6"));
00303         oc->add(new JString("Test3"));
00304         oc->add(new JString("Test5"));
00305 
00306         if ( (obj = oc->getFirst()) == NULL)
00307                 return false;
00308         if (!((JString*)obj)->equals("Test6") )
00309                 return false;
00310         if ( (obj = oc->getNext()) == NULL)
00311                 return false;
00312         if (!((JString*)obj)->equals("Test5") )
00313                 return false;
00314         if ( (obj = oc->getNext()) == NULL)
00315                 return false;
00316         if (!((JString*)obj)->equals("Test4") )
00317                 return false;
00318         if ( (obj = oc->getNext()) == NULL)
00319                 return false;
00320         if (!((JString*)obj)->equals("Test3") )
00321                 return false;
00322         if ( (obj = oc->getNext()) == NULL)
00323                 return false;
00324         if (!((JString*)obj)->equals("Test2") )
00325                 return false;
00326         if ( (obj = oc->getNext()) == NULL)
00327                 return false;
00328         if (!((JString*)obj)->equals("Test1") )
00329                 return false;
00330 
00331         delete(oc);
00332 
00333 
00334 
00335 
00336 
00337         oc = new SortedObjectCollection();
00338         oc->objectTable.sorting |= FINDREVERSE;
00339 
00340         oc->add(new JString("Test1"));
00341         oc->add(new JString("Test4"));
00342         oc->add(new JString("Test2"));
00343         oc->add(new JString("Test6"));
00344         oc->add(new JString("Test3"));
00345         oc->add(new JString("Test5"));
00346 
00347         if ( (obj = oc->getFirst()) == NULL)
00348                 return false;
00349         if (!((JString*)obj)->equals("Test1") )
00350                 return false;
00351         if ( (obj = oc->getNext()) == NULL)
00352                 return false;
00353         if (!((JString*)obj)->equals("Test2") )
00354                 return false;
00355         if ( (obj = oc->getNext()) == NULL)
00356                 return false;
00357         if (!((JString*)obj)->equals("Test3") )
00358                 return false;
00359         if ( (obj = oc->getNext()) == NULL)
00360                 return false;
00361         if (!((JString*)obj)->equals("Test4") )
00362                 return false;
00363         if ( (obj = oc->getNext()) == NULL)
00364                 return false;
00365         if (!((JString*)obj)->equals("Test5") )
00366                 return false;
00367         if ( (obj = oc->getNext()) == NULL)
00368                 return false;
00369         if (!((JString*)obj)->equals("Test6") )
00370                 return false;
00371 
00372         delete(oc);
00373 
00374 
00375 
00376         oc = new SortedObjectCollection();
00377         oc->objectTable.sorting |= SORTREVERSE | FINDREVERSE;
00378 
00379         oc->add(new JString("Test1"));
00380         oc->add(new JString("Test4"));
00381         oc->add(new JString("Test2"));
00382         oc->add(new JString("Test6"));
00383         oc->add(new JString("Test3"));
00384         oc->add(new JString("Test5"));
00385 
00386         if ( (obj = oc->getFirst()) == NULL)
00387                 return false;
00388         if (!((JString*)obj)->equals("Test6") )
00389                 return false;
00390         if ( (obj = oc->getNext()) == NULL)
00391                 return false;
00392         if (!((JString*)obj)->equals("Test5") )
00393                 return false;
00394         if ( (obj = oc->getNext()) == NULL)
00395                 return false;
00396         if (!((JString*)obj)->equals("Test4") )
00397                 return false;
00398         if ( (obj = oc->getNext()) == NULL)
00399                 return false;
00400         if (!((JString*)obj)->equals("Test3") )
00401                 return false;
00402         if ( (obj = oc->getNext()) == NULL)
00403                 return false;
00404         if (!((JString*)obj)->equals("Test2") )
00405                 return false;
00406         if ( (obj = oc->getNext()) == NULL)
00407                 return false;
00408         if (!((JString*)obj)->equals("Test1") )
00409                 return false;
00410 
00411         delete(oc);
00412 
00413 
00414         // Timing tests
00415 
00416         oc = new SortedObjectCollection();
00417         oc->objectTable.sorting |= SORTREVERSE;
00418 
00419         int n;
00420         for (n=10; n<5000; n++) 
00421                 oc->add(JString::format("Test%.6d", n).clone());
00422         JTime t1;
00423         oc->add(new JString("Test000001"));
00424         JTime t2;
00425         long l1 = t2.microDifference(t1);
00426 
00427         t1 = JTime();
00428         oc->add(new JString("Test000050"));
00429         t2 = JTime();
00430         long l2 = t2.microDifference(t1);
00431 
00432         t1 = JTime();
00433         oc->add(new JString("Test000500"));
00434         t2 = JTime();
00435         long l3 = t2.microDifference(t1);
00436 
00437         t1 = JTime();
00438         oc->add(new JString("Test005000"));
00439         t2 = JTime();
00440         long l4 = t2.microDifference(t1);
00441 
00442         delete(oc);
00443 
00444         JString text = JString::format("%d\t%d\t%d\t%d\t", l1, l2, l3, l4);
00445 
00446 
00447 
00448         oc = new SortedObjectCollection();
00449         oc->objectTable.sorting |= SORTREVERSE | FINDREVERSE;
00450 
00451         for (n=10; n<5000; n++) 
00452                 oc->add(JString::format("Test%.6d", n).clone());
00453         t1 = JTime();
00454         oc->add(new JString("Test000001"));
00455         t2 = JTime();
00456         l1 = t2.microDifference(t1);
00457 
00458         t1 = JTime();
00459         oc->add(new JString("Test000050"));
00460         t2 = JTime();
00461         l2 = t2.microDifference(t1);
00462 
00463         t1 = JTime();
00464         oc->add(new JString("Test000500"));
00465         t2 = JTime();
00466         l3 = t2.microDifference(t1);
00467 
00468         t1 = JTime();
00469         oc->add(new JString("Test005000"));
00470         t2 = JTime();
00471         l4 = t2.microDifference(t1);
00472 
00473         text = JString::format("%s\n%d\t%d\t%d\t%d", (char*) text, l1, l2, l3, l4);
00474 
00475         delete(oc);
00476 
00477 
00478         oc = new SortedObjectCollection();
00479         oc->objectTable.sorting |= SORTREVERSE | FINDREVERSE;
00480 
00481         for (n=10; n<5000; n++) 
00482                 oc->add(JString::format("Test000500").clone());
00483         t1 = JTime();
00484         oc->add(new JString("Test000001"));
00485         t2 = JTime();
00486         l1 = t2.microDifference(t1);
00487         oc->removeLast();
00488 
00489         t1 = JTime();
00490         oc->add(new JString("Test000050"));
00491         t2 = JTime();
00492         l2 = t2.microDifference(t1);
00493         oc->removeLast();
00494 
00495         t1 = JTime();
00496         oc->add(new JString("Test000500"));
00497         t2 = JTime();
00498         l3 = t2.microDifference(t1);
00499         oc->removeLast();
00500 
00501         t1 = JTime();
00502         oc->add(new JString("Test005000"));
00503         t2 = JTime();
00504         l4 = t2.microDifference(t1);
00505         oc->removeFirst();
00506 
00507         text = JString::format("%s\n%d\t%d\t%d\t%d", (char*) text, l1, l2, l3, l4);
00508 
00509 //      printf("\n\n%s\n\n", (char*) text);
00510 
00511 //      1853    2304    2437    11
00512 //      11      136     268     1643
00513 //      10      7       7       6
00514 
00515         delete(oc);
00516 
00517 
00518 
00519 
00520 
00521 
00522 
00523 
00524 
00525         Message* msg;
00526         JString expected;
00527         oc = new SortedObjectCollection();
00528         //oc->objectTable.sorting |= SORTREVERSE | FINDREVERSE;
00529 
00530         msg = new Message("", "", "1");
00531         oc->add(msg);
00532         msg = new Message("", "", "2");
00533         oc->add(msg);
00534         msg = new Message("", "", "3");
00535         oc->add(msg);
00536         msg = new Message("", "", "4");
00537         oc->add(msg);
00538         msg = new Message("", "", "5");
00539         oc->add(msg);
00540         msg = new Message("", "", "6");
00541         oc->add(msg);
00542 
00543         expected = "1";
00544         msg = (Message*) oc->getFirst();
00545         if (!msg->type.equals(expected)) {
00546                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
00547                 return false;
00548         }
00549         expected = "2";
00550         msg = (Message*) oc->getNext();
00551         if (!msg->type.equals(expected)) {
00552                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
00553                 return false;
00554         }
00555         expected = "3";
00556         msg = (Message*) oc->getNext();
00557         if (!msg->type.equals(expected)) {
00558                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
00559                 return false;
00560         }
00561         expected = "4";
00562         msg = (Message*) oc->getNext();
00563         if (!msg->type.equals(expected)) {
00564                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
00565                 return false;
00566         }
00567         expected = "5";
00568         msg = (Message*) oc->getNext();
00569         if (!msg->type.equals(expected)) {
00570                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
00571                 return false;
00572         }
00573         expected = "6";
00574         msg = (Message*) oc->getNext();
00575         if (!msg->type.equals(expected)) {
00576                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
00577                 return false;
00578         }
00579 
00580         delete(oc);
00581 
00582 
00583 
00584 
00585         oc = new SortedObjectCollection();
00586         oc->objectTable.sorting |= SORTREVERSE;
00587 
00588         msg = new Message("", "", "1");
00589         oc->add(msg);
00590         msg = new Message("", "", "2");
00591         oc->add(msg);
00592         msg = new Message("", "", "3");
00593         oc->add(msg);
00594         msg = new Message("", "", "4");
00595         oc->add(msg);
00596         msg = new Message("", "", "5");
00597         oc->add(msg);
00598         msg = new Message("", "", "6");
00599         oc->add(msg);
00600 
00601         expected = "1";
00602         msg = (Message*) oc->getFirst();
00603         if (!msg->type.equals(expected)) {
00604                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
00605                 return false;
00606         }
00607         expected = "2";
00608         msg = (Message*) oc->getNext();
00609         if (!msg->type.equals(expected)) {
00610                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
00611                 return false;
00612         }
00613         expected = "3";
00614         msg = (Message*) oc->getNext();
00615         if (!msg->type.equals(expected)) {
00616                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
00617                 return false;
00618         }
00619         expected = "4";
00620         msg = (Message*) oc->getNext();
00621         if (!msg->type.equals(expected)) {
00622                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
00623                 return false;
00624         }
00625         expected = "5";
00626         msg = (Message*) oc->getNext();
00627         if (!msg->type.equals(expected)) {
00628                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
00629                 return false;
00630         }
00631         expected = "6";
00632         msg = (Message*) oc->getNext();
00633         if (!msg->type.equals(expected)) {
00634                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
00635                 return false;
00636         }
00637 
00638         delete(oc);
00639 
00640 
00641 
00642 
00643 
00644 
00645 
00646 
00647         oc = new SortedObjectCollection();
00648         //oc->objectTable.sorting |= SORTREVERSE | FINDREVERSE;
00649 
00650         msg = new Message("", "", "1");
00651         msg->priority = 1;
00652         oc->add(msg);
00653         msg = new Message("", "", "2");
00654         msg->priority = 2;
00655         oc->add(msg);
00656         msg = new Message("", "", "3");
00657         msg->priority = 1;
00658         oc->add(msg);
00659         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00660         msg = new Message("", "", "4");
00661         msg->priority = 2;
00662         oc->add(msg);
00663         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00664         msg = new Message("", "", "5");
00665         msg->priority = 1;
00666         oc->add(msg);
00667         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00668         msg = new Message("", "", "6");
00669         msg->priority = 2;
00670         oc->add(msg);
00671         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00672 
00673         expected = "1";
00674         msg = (Message*) oc->getFirst();
00675         if (!msg->type.equals(expected)) {
00676                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)\n%s", (char*) expected));
00677                 return false;
00678         }
00679         expected = "3";
00680         msg = (Message*) oc->getNext();
00681         if (!msg->type.equals(expected)) {
00682                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
00683                 return false;
00684         }
00685         expected = "5";
00686         msg = (Message*) oc->getNext();
00687         if (!msg->type.equals(expected)) {
00688                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
00689                 return false;
00690         }
00691         expected = "2";
00692         msg = (Message*) oc->getNext();
00693         if (!msg->type.equals(expected)) {
00694                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
00695                 return false;
00696         }
00697         expected = "4";
00698         msg = (Message*) oc->getNext();
00699         if (!msg->type.equals(expected)) {
00700                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
00701                 return false;
00702         }
00703         expected = "6";
00704         msg = (Message*) oc->getNext();
00705         if (!msg->type.equals(expected)) {
00706                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
00707                 return false;
00708         }
00709 
00710         delete(oc);
00711 
00712 
00713 
00714 
00715 
00716         oc = new SortedObjectCollection();
00717         oc->objectTable.sorting |= SORTREVERSE;
00718 
00719         msg = new Message("", "", "1");
00720         msg->priority = 1;
00721         oc->add(msg);
00722         msg = new Message("", "", "2");
00723         msg->priority = 2;
00724         oc->add(msg);
00725         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00726         msg = new Message("", "", "4");
00727         msg->priority = 2;
00728         oc->add(msg);
00729         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00730         msg = new Message("", "", "6");
00731         msg->priority = 2;
00732         oc->add(msg);
00733         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00734         msg = new Message("", "", "3");
00735         msg->priority = 1;
00736         oc->add(msg);
00737         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00738         msg = new Message("", "", "5");
00739         msg->priority = 1;
00740         oc->add(msg);
00741         //printf("\n*****%d entries:\n%s\n\n", oc->getCount(), (char*) oc->printListLine("\n"));
00742 
00743         expected = "2";
00744         msg = (Message*) oc->getFirst();
00745         if (!msg->type.equals(expected)) {
00746                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
00747                 return false;
00748         }
00749         expected = "4";
00750         msg = (Message*) oc->getNext();
00751         if (!msg->type.equals(expected)) {
00752                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
00753                 return false;
00754         }
00755         expected = "6";
00756         msg = (Message*) oc->getNext();
00757         if (!msg->type.equals(expected)) {
00758                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
00759                 return false;
00760         }
00761         expected = "1";
00762         msg = (Message*) oc->getNext();
00763         if (!msg->type.equals(expected)) {
00764                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
00765                 return false;
00766         }
00767         expected = "3";
00768         msg = (Message*) oc->getNext();
00769         if (!msg->type.equals(expected)) {
00770                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
00771                 return false;
00772         }
00773         expected = "5";
00774         msg = (Message*) oc->getNext();
00775         if (!msg->type.equals(expected)) {
00776                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
00777                 return false;
00778         }
00779 
00780         delete(oc);
00781 
00782 
00783 
00784 
00785 
00786 
00787 
00788 
00789 
00790 
00791         return true;
00792 }
00793 
00794 
00795 
00796 
00797 
00798 
00799 
00800 
00801 
00802 
00803 
00804 
00805 
00806 
00807 
00808 
00809 
00810 
00811 
00812 //////////////////////////////////////////////////////////////////////
00813 // Construction/Destruction
00814 //////////////////////////////////////////////////////////////////////
00815 
00816 SortedDictionary::SortedDictionary()
00817 {
00818         objectTable.type = "sorteddictionary";
00819         objectTable.sorting = SORTBYVALUE;
00820 }
00821 
00822 SortedDictionary::SortedDictionary(const JString& xml) : Dictionary(xml) {
00823         objectTable.type = "sorteddictionary";
00824         objectTable.sorting = SORTBYVALUE;
00825 }
00826 
00827 SortedDictionary::SortedDictionary(XMLNode *node) : Dictionary(node) {
00828         objectTable.type = "sorteddictionary";
00829         objectTable.sorting = SORTBYVALUE;
00830 }
00831 
00832 
00833 SortedDictionary::~SortedDictionary()
00834 {
00835 
00836 }
00837 
00838 int SortedDictionary::putAndReturnPosition(const JString& key, const JString& value) {
00839         JString* keycopy = new JString(key);
00840         JString* valuecopy = new JString(value);
00841         if (objectTable.addAndReturnPosition(keycopy, valuecopy))
00842                 return true;
00843         else {
00844                 delete(keycopy);
00845                 delete(valuecopy);
00846                 return false;
00847         }
00848 }
00849 
00850 int SortedDictionary::removeAllBetween(const JString& key1, const JString& key2) {
00851         return objectTable.removeAllEntriesBetweenKeys(&key1, &key2);
00852 }
00853 
00854 Dictionary SortedDictionary::getAllBetween(const JString& key1, const JString& key2) {
00855         SortedDictionary scol;
00856         ObjectCollection* col = objectTable.getAllEntriesBetweenKeys(&key1, &key2);
00857         if (col != NULL) {
00858                 for (CollectionEntry* entry = (CollectionEntry*) col->getFirst(); entry != NULL; entry = (CollectionEntry*) col->getNext()) {
00859                         scol.put(*(JString*)entry->key, *(JString*)entry->value);
00860                 }
00861         }
00862         delete(col);
00863         return scol;
00864 }
00865 
00866 JString SortedDictionary::getFirstAfter(const JString& key) {
00867         CollectionEntry* entry = objectTable.getFirstEntryAfterKey(&key);
00868         if (entry == NULL)
00869                 return "";
00870         else
00871                 return *(JString*) entry->value;
00872 }
00873 
00874 JString SortedDictionary::getLastBefore(const JString& key) {
00875         CollectionEntry* entry = objectTable.getLastEntryBeforeKey(&key);
00876         if (entry == NULL)
00877                 return "";
00878         else
00879                 return *(JString*) entry->value;
00880 }
00881 
00882 
00883 
00884 
00885 
00886 
00887 bool SortedDictionary::unitTest() {
00888 
00889         SortedDictionary* oc = new SortedDictionary();
00890 
00891         oc->put("Test1", "Test1");
00892         oc->put("Test4", "Test4");
00893         oc->put("Test2", "Test2");
00894         oc->put("Test6", "Test6");
00895         oc->put("Test3", "Test3");
00896         oc->put("Test5", "Test5");
00897 
00898         if (!oc->getFirst().equals("Test1"))
00899                 return false;
00900         if (!oc->getNext().equals("Test2"))
00901                 return false;
00902         if (!oc->getNext().equals("Test3"))
00903                 return false;
00904         if (!oc->getNext().equals("Test4"))
00905                 return false;
00906         if (!oc->getNext().equals("Test5"))
00907                 return false;
00908         if (!oc->getNext().equals("Test6"))
00909                 return false;
00910 
00911         SortedDictionary oc2;
00912 
00913         oc2 = *oc;
00914 
00915         if (!oc2.getFirst().equals("Test1"))
00916                 return false;
00917         if (!oc2.getNext().equals("Test2"))
00918                 return false;
00919         if (!oc2.getNext().equals("Test3"))
00920                 return false;
00921         if (!oc2.getNext().equals("Test4"))
00922                 return false;
00923         if (!oc2.getNext().equals("Test5"))
00924                 return false;
00925         if (!oc2.getNext().equals("Test6"))
00926                 return false;
00927 
00928         delete(oc);
00929         return true;
00930 }
00931 
00932 
00933 
00934 
00935 
00936 
00937 
00938 
00939 
00940 
00941 
00942 
00943 
00944 
00945 
00946 
00947 
00948 
00949 
00950 
00951 
00952 
00953 
00954 
00955 
00956 
00957 
00958 
00959 
00960 
00961 SortedObjectDictionary::SortedObjectDictionary()
00962 {
00963         objectTable.type = "sortedobjectdictionary";
00964         objectTable.sorting = SORTBYVALUE;
00965 }
00966 
00967 SortedObjectDictionary::SortedObjectDictionary(const JString& xml) : ObjectDictionary(xml) {
00968         objectTable.type = "sortedobjectdictionary";
00969         objectTable.sorting = SORTBYVALUE;
00970 }
00971 
00972 SortedObjectDictionary::SortedObjectDictionary(XMLNode *node) : ObjectDictionary(node) {
00973         objectTable.type = "sortedobjectdictionary";
00974         objectTable.sorting = SORTBYVALUE;
00975 }
00976 
00977 
00978 SortedObjectDictionary::~SortedObjectDictionary()
00979 {
00980 
00981 }
00982 
00983 int SortedObjectDictionary::putAndReturnPosition(const JString& key, Object* value) {
00984         JString* keycopy = new JString(key);
00985         if (objectTable.addAndReturnPosition(keycopy, value))
00986                 return true;
00987         else {
00988                 delete(keycopy);
00989                 return false;
00990         }
00991 }
00992 
00993 int SortedObjectDictionary::removeAllBetween(const JString& key1, const JString& key2) {
00994         return objectTable.removeAllEntriesBetweenKeys(&key1, &key2);
00995 }
00996 
00997 ObjectDictionary SortedObjectDictionary::getAllBetween(const JString& key1, const JString& key2) {
00998         SortedObjectDictionary scol;
00999         scol.noDelete();
01000         ObjectCollection* col = objectTable.getAllEntriesBetweenKeys(&key1, &key2);
01001         if (col != NULL) {
01002                 for (CollectionEntry* entry = (CollectionEntry*) col->getFirst(); entry != NULL; entry = (CollectionEntry*) col->getNext()) {
01003                         scol.put(*(JString*)entry->key, entry->value);
01004                 }
01005         }
01006         delete(col);
01007         return scol;
01008 }
01009 
01010 JString SortedObjectDictionary::getFirstAfter(const JString& key) {
01011         CollectionEntry* entry = objectTable.getFirstEntryAfterKey(&key);
01012         if (entry == NULL)
01013                 return "";
01014         else
01015                 return entry->value;
01016 }
01017 
01018 JString SortedObjectDictionary::getLastBefore(const JString& key) {
01019         CollectionEntry* entry = objectTable.getLastEntryBeforeKey(&key);
01020         if (entry == NULL)
01021                 return "";
01022         else
01023                 return entry->value;
01024 }
01025 
01026 
01027 
01028 
01029 
01030 
01031 bool SortedObjectDictionary::unitTest() {
01032 
01033         SortedObjectDictionary* oc = new SortedObjectDictionary();
01034 
01035         oc->put("Test1", new JString("Test1"));
01036         oc->put("Test4", new JString("Test4"));
01037         oc->put("Test2", new JString("Test2"));
01038         oc->put("Test6", new JString("Test6"));
01039         oc->put("Test3", new JString("Test3"));
01040         oc->put("Test5", new JString("Test5"));
01041 
01042         Object* obj;
01043         if ( (obj = oc->getFirst()) == NULL)
01044                 return false;
01045         if (!((JString*)obj)->equals("Test1") )
01046                 return false;
01047         if ( (obj = oc->getNext()) == NULL)
01048                 return false;
01049         if (!((JString*)obj)->equals("Test2") )
01050                 return false;
01051         if ( (obj = oc->getNext()) == NULL)
01052                 return false;
01053         if (!((JString*)obj)->equals("Test3") )
01054                 return false;
01055         if ( (obj = oc->getNext()) == NULL)
01056                 return false;
01057         if (!((JString*)obj)->equals("Test4") )
01058                 return false;
01059         if ( (obj = oc->getNext()) == NULL)
01060                 return false;
01061         if (!((JString*)obj)->equals("Test5") )
01062                 return false;
01063         if ( (obj = oc->getNext()) == NULL)
01064                 return false;
01065         if (!((JString*)obj)->equals("Test6") )
01066                 return false;
01067 
01068         SortedObjectDictionary oc2;
01069 
01070         oc2 = *oc;
01071         oc2.noDelete();
01072 
01073         if ( (obj = oc2.getFirst()) == NULL)
01074                 return false;
01075         if (!((JString*)obj)->equals("Test1") )
01076                 return false;
01077         if ( (obj = oc2.getNext()) == NULL)
01078                 return false;
01079         if (!((JString*)obj)->equals("Test2") )
01080                 return false;
01081         if ( (obj = oc2.getNext()) == NULL)
01082                 return false;
01083         if (!((JString*)obj)->equals("Test3") )
01084                 return false;
01085         if ( (obj = oc2.getNext()) == NULL)
01086                 return false;
01087         if (!((JString*)obj)->equals("Test4") )
01088                 return false;
01089         if ( (obj = oc2.getNext()) == NULL)
01090                 return false;
01091         if (!((JString*)obj)->equals("Test5") )
01092                 return false;
01093         if ( (obj = oc2.getNext()) == NULL)
01094                 return false;
01095         if (!((JString*)obj)->equals("Test6") )
01096                 return false;
01097 
01098         oc->removeAll();
01099         oc2.removeAll();
01100 
01101         if (oc->getCount() != 0)
01102                 return false;
01103         if (oc2.getCount() != 0)
01104                 return false;
01105 
01106         delete(oc);
01107 
01108 
01109 
01110 
01111 
01112 
01113 
01114 
01115 
01116 
01117         Message* msg;
01118         JString expected;
01119         ObjectTable* ot = new ObjectTable();
01120         ot->sorting |= SORTBYKEY;
01121         //ot->objectTable.sorting |= SORTREVERSE | FINDREVERSE;
01122 
01123         msg = new Message("", "", "1");
01124         ot->add(msg, msg->clone());
01125         msg = new Message("", "", "2");
01126         ot->add(msg, msg->clone());
01127         msg = new Message("", "", "3");
01128         ot->add(msg, msg->clone());
01129         msg = new Message("", "", "4");
01130         ot->add(msg, msg->clone());
01131         msg = new Message("", "", "5");
01132         ot->add(msg, msg->clone());
01133         msg = new Message("", "", "6");
01134         ot->add(msg, msg->clone());
01135 
01136         expected = "1";
01137         msg = (Message*) ot->getFirst();
01138         if (!msg->type.equals(expected)) {
01139                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
01140                 return false;
01141         }
01142         expected = "2";
01143         msg = (Message*) ot->getNext();
01144         if (!msg->type.equals(expected)) {
01145                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
01146                 return false;
01147         }
01148         expected = "3";
01149         msg = (Message*) ot->getNext();
01150         if (!msg->type.equals(expected)) {
01151                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
01152                 return false;
01153         }
01154         expected = "4";
01155         msg = (Message*) ot->getNext();
01156         if (!msg->type.equals(expected)) {
01157                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
01158                 return false;
01159         }
01160         expected = "5";
01161         msg = (Message*) ot->getNext();
01162         if (!msg->type.equals(expected)) {
01163                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
01164                 return false;
01165         }
01166         expected = "6";
01167         msg = (Message*) ot->getNext();
01168         if (!msg->type.equals(expected)) {
01169                 addUnitTestLog(JString::format("Normal sorting failed when using identical entries... (%s)", (char*) expected));
01170                 return false;
01171         }
01172 
01173         delete(ot);
01174 
01175 
01176 
01177 
01178 
01179         ot = new ObjectTable();
01180         ot->sorting |= SORTBYKEY;
01181         ot->sorting |= SORTREVERSE;
01182 
01183         msg = new Message("", "", "1");
01184         ot->add(msg, msg->clone());
01185         msg = new Message("", "", "2");
01186         ot->add(msg, msg->clone());
01187 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01188         msg = new Message("", "", "3");
01189         ot->add(msg, msg->clone());
01190 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01191         msg = new Message("", "", "4");
01192         ot->add(msg, msg->clone());
01193 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01194         msg = new Message("", "", "5");
01195         ot->add(msg, msg->clone());
01196 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01197         msg = new Message("", "", "6");
01198         ot->add(msg, msg->clone());
01199 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01200 
01201         expected = "1";
01202         msg = (Message*) ot->getFirst();
01203         if (!msg->type.equals(expected)) {
01204                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
01205                 return false;
01206         }
01207         expected = "2";
01208         msg = (Message*) ot->getNext();
01209         if (!msg->type.equals(expected)) {
01210                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
01211                 return false;
01212         }
01213         expected = "3";
01214         msg = (Message*) ot->getNext();
01215         if (!msg->type.equals(expected)) {
01216                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
01217                 return false;
01218         }
01219         expected = "4";
01220         msg = (Message*) ot->getNext();
01221         if (!msg->type.equals(expected)) {
01222                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
01223                 return false;
01224         }
01225         expected = "5";
01226         msg = (Message*) ot->getNext();
01227         if (!msg->type.equals(expected)) {
01228                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
01229                 return false;
01230         }
01231         expected = "6";
01232         msg = (Message*) ot->getNext();
01233         if (!msg->type.equals(expected)) {
01234                 addUnitTestLog(JString::format("Reverse sorting failed when using identical entries... (%s)", (char*) expected));
01235                 return false;
01236         }
01237 
01238         delete(ot);
01239 
01240 
01241 
01242 
01243 
01244 
01245 
01246 
01247         ot = new ObjectTable();
01248         ot->sorting |= SORTBYKEY;
01249         //ot->objectTable.sorting |= SORTREVERSE | FINDREVERSE;
01250 
01251         msg = new Message("", "", "1");
01252         msg->priority = 1;
01253         ot->add(msg, msg->clone());
01254         msg = new Message("", "", "2");
01255         msg->priority = 2;
01256         ot->add(msg, msg->clone());
01257         msg = new Message("", "", "3");
01258         msg->priority = 1;
01259         ot->add(msg, msg->clone());
01260 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01261         msg = new Message("", "", "4");
01262         msg->priority = 2;
01263         ot->add(msg, msg->clone());
01264 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01265         msg = new Message("", "", "5");
01266         msg->priority = 1;
01267         ot->add(msg, msg->clone());
01268 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01269         msg = new Message("", "", "6");
01270         msg->priority = 2;
01271         ot->add(msg, msg->clone());
01272 //      printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01273 
01274         expected = "1";
01275         msg = (Message*) ot->getFirst();
01276         if (!msg->type.equals(expected)) {
01277                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)\n%s", (char*) expected));
01278                 return false;
01279         }
01280         expected = "3";
01281         msg = (Message*) ot->getNext();
01282         if (!msg->type.equals(expected)) {
01283                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
01284                 return false;
01285         }
01286         expected = "5";
01287         msg = (Message*) ot->getNext();
01288         if (!msg->type.equals(expected)) {
01289                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
01290                 return false;
01291         }
01292         expected = "2";
01293         msg = (Message*) ot->getNext();
01294         if (!msg->type.equals(expected)) {
01295                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
01296                 return false;
01297         }
01298         expected = "4";
01299         msg = (Message*) ot->getNext();
01300         if (!msg->type.equals(expected)) {
01301                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
01302                 return false;
01303         }
01304         expected = "6";
01305         msg = (Message*) ot->getNext();
01306         if (!msg->type.equals(expected)) {
01307                 addUnitTestLog(JString::format("Normal sorting failed when using non-identical entries... (%s)", (char*) expected));
01308                 return false;
01309         }
01310 
01311         delete(ot);
01312 
01313 
01314 
01315 
01316 
01317         ot = new ObjectTable();
01318         ot->sorting |= SORTBYKEY;
01319         ot->sorting |= SORTREVERSE;
01320 
01321         msg = new Message("", "", "1");
01322         msg->priority = 1;
01323         ot->add(msg, msg->clone());
01324         msg = new Message("", "", "2");
01325         msg->priority = 2;
01326         ot->add(msg, msg->clone());
01327         //printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01328         msg = new Message("", "", "4");
01329         msg->priority = 2;
01330         ot->add(msg, msg->clone());
01331         //printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01332         msg = new Message("", "", "6");
01333         msg->priority = 2;
01334         ot->add(msg, msg->clone());
01335         //printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01336         msg = new Message("", "", "3");
01337         msg->priority = 1;
01338         ot->add(msg, msg->clone());
01339         //printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01340         msg = new Message("", "", "5");
01341         msg->priority = 1;
01342         ot->add(msg, msg->clone());
01343         //printf("\n*****%d entries:\n%s\n\n", ot->getCount(), (char*) ot->printListLine("\n"));
01344 
01345         expected = "2";
01346         msg = (Message*) ot->getFirst();
01347         if (!msg->type.equals(expected)) {
01348                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
01349                 return false;
01350         }
01351         expected = "4";
01352         msg = (Message*) ot->getNext();
01353         if (!msg->type.equals(expected)) {
01354                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
01355                 return false;
01356         }
01357         expected = "6";
01358         msg = (Message*) ot->getNext();
01359         if (!msg->type.equals(expected)) {
01360                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
01361                 return false;
01362         }
01363         expected = "1";
01364         msg = (Message*) ot->getNext();
01365         if (!msg->type.equals(expected)) {
01366                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
01367                 return false;
01368         }
01369         expected = "3";
01370         msg = (Message*) ot->getNext();
01371         if (!msg->type.equals(expected)) {
01372                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
01373                 return false;
01374         }
01375         expected = "5";
01376         msg = (Message*) ot->getNext();
01377         if (!msg->type.equals(expected)) {
01378                 addUnitTestLog(JString::format("Reverse sorting failed when using non-identical entries... (%s)", (char*) expected));
01379                 return false;
01380         }
01381 
01382         delete(ot);
01383 
01384 
01385 
01386 
01387 
01388 
01389 
01390 
01391 
01392 
01393 
01394 
01395 
01396 
01397         return true;
01398 }
01399 
01400 
01401 } // namespace cmlabs

Generated on Mon Oct 22 20:03:20 2007 for CoreLibrary by  doxygen 1.4.4