Changeset 224
- Timestamp:
- Feb 28, 2006, 9:52:16 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/core/RpLibrary.h
r205 r224 22 22 #include <time.h> 23 23 24 #include <list> 25 24 26 /* indentation size (in whitespaces) */ 25 27 #define INDENT_SIZE 4 26 28 #define CREATE_PATH 1 27 29 #define NO_CREATE_PATH 0 30 #define E_QUEUE_SIZE 100 28 31 29 32 #ifndef _RpLIBRARY_H … … 38 41 RpLibrary* element (std::string path = ""); 39 42 RpLibrary* parent (std::string path = ""); 43 44 std::list<std::string> entities (std::string path = ""); 45 std::list<std::string> value (std::string path = ""); 46 std::list<std::string> diff ( RpLibrary* otherLib, 47 std::string path); 48 40 49 41 50 // should return RpObject& but for simplicity right now it doesnt … … 78 87 std::string nodeComp(); 79 88 std::string nodePath(); 80 81 int isvalid();82 89 83 90 void result(); -
trunk/src/core/RpLibrary.cc
r205 r224 501 501 502 502 /**********************************************************************/ 503 // METHOD: entities() 504 /// Search the path of a xml tree and return its next entity. 505 /** 506 * It is the user's responsibility to delete the object when 507 * they are finished using it?, else i need to make this static 508 */ 509 510 std::list<std::string> 511 RpLibrary::entities (std::string path) 512 { 513 std::list<std::string> queue; 514 std::list<std::string>::iterator iter; 515 std::list<std::string> retList; 516 std::list<std::string> childList; 517 std::list<std::string>::iterator childIter; 518 519 RpLibrary* ele = NULL; 520 521 RpLibrary* child = NULL; 522 std::string childType = ""; 523 std::string childPath = ""; 524 std::string paramsPath = ""; 525 526 RpLibrary* cchild = NULL; 527 std::string cchildType = ""; 528 std::string cchildPath = ""; 529 530 queue.push_back(path); 531 iter = queue.begin(); 532 533 while( iter != queue.end() ) { 534 ele = this->element(*iter); 535 child = NULL; 536 537 while ( (child = ele->children("",child)) != NULL ) { 538 childList.push_back(child->nodeComp()); 539 } 540 541 childIter = childList.begin(); 542 543 while (childIter != childList.end()) { 544 child = ele->element(*childIter); 545 546 childType = child->nodeType(); 547 childPath = child->nodePath(); 548 if ( (childType == "group") || (childType == "phase") ) { 549 // add this path to the queue for paths to search 550 queue.push_back(childPath); 551 } 552 else if (childType == "structure") { 553 // add this path to the return list 554 retList.push_back(child->nodeComp()); 555 556 // check to see if there is a ".current.parameters" node 557 // if so, add them to the queue list for paths to search 558 paramsPath = childPath + ".current.parameters"; 559 if (child->element(paramsPath) != NULL) { 560 queue.push_back(paramsPath); 561 } 562 } 563 else { 564 // add this path to the return list 565 retList.push_back(child->nodeComp()); 566 567 // look for embedded groups and phases 568 // add them to the queue list for paths to search 569 cchild = NULL; 570 while ( (cchild = child->children("",cchild)) != NULL ) { 571 cchildType = cchild->nodeType(); 572 cchildPath = cchild->nodePath(); 573 if ( (cchildType == "group") || (cchildType == "phase") ) { 574 // add this path to the queue for paths to search 575 queue.push_back(cchildPath); 576 } 577 } 578 } 579 580 childList.erase(childIter); 581 childIter = childList.begin(); 582 } 583 584 queue.erase(iter); 585 iter = queue.begin(); 586 } 587 588 return retList; 589 } 590 591 /**********************************************************************/ 592 // METHOD: diff() 593 /// find the differences between two xml trees. 594 /** 595 */ 596 597 std::list<std::string> 598 RpLibrary::diff (RpLibrary* otherLib, std::string path) 599 { 600 601 std::list<std::string> thisVal; // two node list of specific entity's value 602 std::list<std::string> otherVal; // two node list of specific entity's value 603 604 std::list<std::string> thisv; // list of this library's entities 605 std::list<std::string>::iterator thisIter; 606 607 std::list<std::string> otherv; // list of other library's entities 608 std::list<std::string>::iterator otherIter; 609 610 std::list<std::string> retList; 611 612 std::string entry = ""; 613 std::string thisSpath = ""; // temp string 614 std::string otherSpath = ""; // temp string 615 616 if ( (!this->root) || (!otherLib->root) ) { 617 // library doesn't exist, do nothing; 618 return retList; 619 } 620 621 thisv = this->entities(path); 622 otherv = otherLib->entities(path); 623 624 thisIter = thisv.begin(); 625 626 while (thisIter != thisv.end() ) { 627 // reset otherIter for a new search. 628 otherIter = otherv.begin(); 629 while ( (otherIter != otherv.end()) && (*otherIter != *thisIter) ) { 630 otherIter++; 631 } 632 633 thisSpath = path + "." + *thisIter; 634 635 if (otherIter == otherv.end()) { 636 // we've reached the end of the search 637 // and did not find anything, mark this as a '-' 638 thisVal = this->value(thisSpath); 639 retList.push_back("-"); 640 retList.push_back(thisSpath); 641 retList.push_back(thisVal.front()); 642 retList.push_back(""); 643 } 644 else { 645 646 otherSpath = path + "." + *otherIter; 647 648 thisVal = this->value(thisSpath); 649 otherVal = otherLib->value(otherSpath); 650 if (thisVal.back() != otherVal.back()) { 651 // add the difference to the return list 652 retList.push_back("c"); 653 retList.push_back(otherSpath); 654 retList.push_back(thisVal.front()); 655 retList.push_back(otherVal.front()); 656 } 657 658 // remove the last processed value from otherv 659 otherv.erase(otherIter); 660 } 661 662 // increment thisv's iterator. 663 thisIter++; 664 } 665 666 // add any left over values in otherv to the return list 667 otherIter = otherv.begin(); 668 while ( otherIter != otherv.end() ) { 669 670 otherSpath = path + "." + *otherIter; 671 672 otherVal = otherLib->value(otherSpath); 673 674 retList.push_back("+"); 675 retList.push_back(otherSpath); 676 retList.push_back(otherVal.front()); 677 retList.push_back(""); 678 679 otherv.erase(otherIter); 680 otherIter = otherv.begin(); 681 } 682 683 return retList; 684 } 685 686 /**********************************************************************/ 687 // METHOD: value(path) 688 /// find the differences between two xml trees. 689 /** 690 */ 691 692 std::list<std::string> 693 RpLibrary::value (std::string path) 694 { 695 std::list<std::string> retArr; 696 697 std::string raw = ""; 698 std::string val = ""; 699 700 RpLibrary* ele = NULL; 701 RpLibrary* tele = NULL; 702 703 int childCount = 0; 704 std::stringstream valStr; 705 706 ele = this->element(path); 707 708 if (ele != NULL ) { 709 710 if (ele->nodeType() == "structure") { 711 raw = path; 712 // try to find a label to represent the structure 713 val = ele->get("about.label"); 714 715 if (val == "") { 716 val = ele->get("current.about.label"); 717 } 718 719 if (val == "") { 720 tele = ele->element("current"); 721 if ( (tele != NULL) && (tele->nodeComp() != "") ) { 722 tele->children("components",NULL,"",&childCount); 723 valStr << "<structure> with " << childCount << " components"; 724 val = valStr.str(); 725 } 726 } 727 728 } 729 /* 730 else if (ele->nodeType() == "number") { 731 retArr[0] = ""; 732 retArr[1] = ""; 733 if ( (tele = ele->element("current")) != NULL) { 734 retArr[0] = tele->get(); 735 retArr[1] = retArr[0]; 736 } 737 else if ( (tele = ele->element("default")) != NULL) { 738 retArr[0] = tele->get(); 739 retArr[1] = retArr[0]; 740 } 741 } 742 */ 743 else { 744 raw = ""; 745 if ( (tele = ele->element("current")) != NULL) { 746 raw = tele->get(); 747 } 748 else if ( (tele = ele->element("default")) != NULL) { 749 raw = tele->get(); 750 } 751 val = raw; 752 } 753 } 754 755 retArr.push_back(raw); 756 retArr.push_back(val); 757 758 return retArr; 759 } 760 761 /**********************************************************************/ 503 762 // METHOD: parent() 504 763 /// Search the path of a xml tree and return its parent. … … 885 1144 if (ele) { 886 1145 scew_element_free(ele); 887 if (setNULL ) {1146 if (setNULL != 0) { 888 1147 // this is the case where user specified an empty path. 889 1148 // the object is useless, and will be deleted. 890 1149 this->root = NULL; 891 delete this;892 1150 retLib = NULL; 893 1151 } … … 988 1246 989 1247 return _node2path(root); 990 }991 992 /**********************************************************************/993 // METHOD: isvalid()994 /// Returns true if the library is a valid Rappture Object with a document root995 /**996 */997 998 int999 RpLibrary::isvalid ()1000 {1001 if (!this->root) {1002 // library doesn't exist, return false;1003 return 0;1004 }1005 1006 return 1;1007 1248 } 1008 1249 -
trunk/src/tcl/README
r207 r224 4 4 5 5 within tclsh 6 package require Rappture Library6 package require Rappture -
trunk/src/tcl/src/RpLibraryTclInterface.cc
r207 r224 3 3 * Rappture::library 4 4 * 5 * This is an interface to the system getrlimit() and setrlimit() 6 * routines. It allows you to get/set resource limits for child 7 * executables. We use this in Rappture::exec, for example, to make 8 * sure that jobs don't run forever or fill up the disk. 5 * This is an interface to the rappture library module. 6 * It allows you to create rappture library objects. 9 7 * ====================================================================== 10 8 * AUTHOR: Derrick Kearney, Purdue University … … 19 17 // #include <typeinfo.h> 20 18 #include "core/RpLibrary.h" 19 #include <sstream> 21 20 22 21 #ifdef __cplusplus … … 38 37 static int RpTclLibCopy _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp, 39 38 int argc, const char *argv[] )); 39 static int RpTclLibDiff _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp, 40 int argc, const char *argv[] )); 40 41 static int RpTclLibElem _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp, 41 42 int argc, const char *argv[] )); 42 43 static int RpTclLibGet _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp, 44 int argc, const char *argv[] )); 45 static int RpTclLibIsa _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp, 43 46 int argc, const char *argv[] )); 44 47 static int RpTclLibParent _ANSI_ARGS_(( ClientData cdata, Tcl_Interp *interp, … … 65 68 {"copy", 2, (Blt_Op)RpTclLibCopy, 5, 6, 66 69 "<path> from ?<xmlobj>? <path>",}, 70 {"diff", 1, (Blt_Op)RpTclLibDiff, 3, 3, "<xmlobj>",}, 67 71 {"element", 1, (Blt_Op)RpTclLibElem, 2, 5, "?-as <fval>? ?<path>?",}, 68 72 {"get", 1, (Blt_Op)RpTclLibGet, 2, 3, "?<path>?",}, 73 {"isa", 1, (Blt_Op)RpTclLibIsa, 3, 3, "<objType>",}, 69 74 {"parent", 2, (Blt_Op)RpTclLibParent, 2, 5, "?-as <fval>? ?<path>?",}, 70 75 {"put", 2, (Blt_Op)RpTclLibPut, 2, 8, … … 76 81 77 82 static int nRpLibOps = sizeof(rpLibOps) / sizeof(Blt_OpSpec); 83 84 #define RAPPTURE_OBJ_TYPE "::Rappture::LibraryObj" 78 85 79 86 #ifdef __cplusplus … … 115 122 { 116 123 RpLibrary *rpptr = NULL; 117 RpLibrary *testObj = NULL;118 124 std::string libName = ""; 119 125 int noerr = 0; 120 Tcl_CmdInfo* infoPtr = NULL; // pointer to the command info 126 std::stringstream result; 127 Tcl_CmdInfo info; // pointer to the command info 128 121 129 122 130 if ( (argc > 2) && (strncmp(argv[1],"isvalid",7) == 0) ) { 131 result.str("0"); 123 132 if (argc != 3) { 124 std::cout << "wrong # args: should be \"" << argv[0] 125 << " isvalid object\"" << std::endl; 133 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], 134 "\": isvalid object", 135 (char*)NULL); 126 136 return TCL_ERROR; 127 137 } 128 138 129 libName = std::string(argv[2]); 130 std::cout << "argv[2] = " << argv[2] << std::endl; 131 std::cout << "interp = " << interp << std::endl; 132 noerr = Tcl_GetCommandInfo(interp, libName.c_str(), infoPtr); 133 std::cout << "interp = " << interp << std::endl; 134 if (noerr && infoPtr) { 135 testObj = (RpLibrary*) (infoPtr->clientData); 136 // if ( (testObj) && (typeid(RpLibrary) == typeid(testObj)) ) { 137 if (testObj) { 138 // return testObj->isvalid(); 139 // need a way to try this and catch any errors 140 try { 141 testObj->isvalid(); 142 return 1; // return true 143 } 144 catch (const std::exception& e) { 145 return 0; // return false 146 } 147 } 148 else { 149 return 0; // return false 150 } 151 } 152 else { 153 return 0; // return false 154 } 139 noerr = Tcl_GetCommandInfo(interp, argv[2], &info); 140 if (noerr == 1) { 141 if (info.proc == &RpLibCallCmd) { 142 result.clear(); 143 result.str("1"); 144 } 145 } 146 147 Tcl_ResetResult(interp); 148 Tcl_AppendResult(interp, result.str().c_str(), (char*)NULL); 149 return TCL_OK; 155 150 } 156 151 157 152 if (argc != 2) { 158 std::cout << "usage: " << argv[0] << " <xmlfile>" << std::endl;153 Tcl_AppendResult(interp, "usage: ", argv[0], " <xmlfile>",(char*)NULL); 159 154 return TCL_ERROR; 160 155 } … … 165 160 libName = rpLib2command(interp,rpptr); 166 161 167 Tcl_ResetResult(interp);168 162 Tcl_AppendResult(interp, libName.c_str(), (char*)NULL); 169 170 163 return TCL_OK; 171 164 } … … 194 187 195 188 if (argc < 2) { 196 std::cout <<"usage: "<< argv[0] <<" <command> <arg-list>"<< std::endl; 189 Tcl_AppendResult(interp, "usage: \"", argv[0], 190 "\": <command> <arg-list>", 191 (char*)NULL); 197 192 return TCL_ERROR; 198 193 } … … 325 320 int argsLeft = 0; // temp variable for calculation 326 321 int noerr = 0; // err flag for Tcl_GetCommandInfo 327 Tcl_CmdInfo * infoPtr = NULL; // pointer to the command info322 Tcl_CmdInfo info; // pointer to the command info 328 323 329 324 toPath = std::string(argv[nextarg++]); … … 333 328 if (argsLeft == 2) { 334 329 fromObjStr = std::string(argv[nextarg++]); 335 noerr = Tcl_GetCommandInfo(interp, fromObjStr.c_str(), infoPtr); 336 if (noerr && infoPtr) { 337 fromObj = (RpLibrary*) (infoPtr->clientData); 338 } 339 fromObj = NULL; // gotta figure out how to get the actual lib here 330 noerr = Tcl_GetCommandInfo(interp, fromObjStr.c_str(), &info); 331 if (noerr == 1) { 332 if (info.proc == RpLibCallCmd) { 333 fromObj = (RpLibrary*) (info.clientData); 334 } 335 else { 336 Tcl_ResetResult(interp); 337 Tcl_AppendResult(interp, 338 "wrong arg type: xmlobj should be a Rappture Library\"", 339 (char*)NULL); 340 return TCL_ERROR; 341 } 342 } 340 343 fromPath = std::string(argv[nextarg++]); 341 344 } … … 344 347 } 345 348 else { 349 Tcl_ResetResult(interp); 346 350 Tcl_AppendResult(interp, 347 351 "wrong # args: should be \"copy path from ?xmlobj? path\"", … … 351 355 352 356 if (from != "from") { 357 Tcl_ResetResult(interp); 353 358 Tcl_AppendResult(interp, 354 359 "bad syntax: should be \"copy path from ?xmlobj? path\"", … … 365 370 Tcl_AppendResult(interp, "", (char*)NULL); 366 371 372 return TCL_OK; 373 } 374 375 int 376 RpTclLibDiff ( ClientData cdata, 377 Tcl_Interp *interp, 378 int argc, 379 const char *argv[] ) 380 { 381 382 Tcl_CmdInfo info; // pointer to the command info 383 std::string otherLibStr = ""; 384 RpLibrary* otherLib = NULL; 385 int nextarg = 2; // start parsing using the '2'th argument 386 int argsLeft = 0; // temp variable for calculation 387 int noerr = 0; // err flag for Tcl_GetCommandInfo 388 389 std::list<std::string> diffList; // list to store the return value 390 // from diff command 391 std::list<std::string>::iterator diffListIter; 392 393 // parse input arguments 394 argsLeft = (argc-nextarg); 395 if (argsLeft == 1) { 396 otherLibStr = std::string(argv[nextarg++]); 397 noerr = Tcl_GetCommandInfo(interp, otherLibStr.c_str(), &info); 398 if (noerr == 1) { 399 if (info.proc == RpLibCallCmd) { 400 otherLib = (RpLibrary*) (info.clientData); 401 } 402 else { 403 Tcl_ResetResult(interp); 404 Tcl_AppendResult(interp, 405 "wrong arg type: xmlobj should be a Rappture Library\"", 406 (char*)NULL); 407 return TCL_ERROR; 408 } 409 } 410 } 411 else { 412 Tcl_ResetResult(interp); 413 Tcl_AppendResult(interp, 414 "wrong # args: should be \"diff <xmlobj>\"", 415 (char*)NULL); 416 return TCL_ERROR; 417 } 418 419 // perform the diff command 420 diffList = ((RpLibrary*) (cdata))->diff(otherLib,"input"); 421 diffListIter = diffList.begin(); 422 423 Tcl_ResetResult(interp); 424 425 // parse through the output of the diff command 426 // put it into the return result 427 while (diffListIter != diffList.end()) { 428 Tcl_AppendElement(interp,(*diffListIter).c_str()); 429 430 // increment the iterator 431 diffListIter++; 432 } 433 434 435 // Tcl_AppendResult(interp, retStr.c_str(), (char*)NULL); 367 436 return TCL_OK; 368 437 } … … 473 542 std::string path = ""; 474 543 475 if (argc > 2) {544 if (argc == 3) { 476 545 path = std::string(argv[2]); 546 } 547 else if (argc != 2) { 548 Tcl_ResetResult(interp); 549 Tcl_AppendResult(interp, 550 "wrong # args: should be \"get ?path?\"", 551 "\":", (char*)NULL); 552 return TCL_ERROR; 477 553 } 478 554 479 555 // call the Rappture Library Get Function 480 556 retStr = ((RpLibrary*) cdata)->getString(path); 557 558 // clear any previous result in the interpreter 559 // store the new result in the interpreter 560 Tcl_ResetResult(interp); 561 Tcl_AppendResult(interp, retStr.c_str(), (char*)NULL); 562 563 return TCL_OK; 564 } 565 566 int 567 RpTclLibIsa ( ClientData cdata, 568 Tcl_Interp *interp, 569 int argc, 570 const char *argv[] ) 571 { 572 573 std::string compVal = ""; // string value of object being compared to 574 std::string retStr = ""; // return value of rappture get fxn 575 576 if (argc == 3) { 577 compVal = std::string(argv[2]); 578 } 579 else { 580 Tcl_ResetResult(interp); 581 Tcl_AppendResult(interp, 582 "wrong # args: should be \"get ?path?\"", 583 "\":", (char*)NULL); 584 return TCL_ERROR; 585 } 586 587 if (compVal == RAPPTURE_OBJ_TYPE) { 588 retStr = "1"; 589 } 590 else { 591 retStr = "0"; 592 } 481 593 482 594 // clear any previous result in the interpreter … … 653 765 { 654 766 655 std::string path = std::string(""); // path of where to copydata from767 std::string path = std::string(""); // path of where to remove data from 656 768 int nextarg = 2; 657 769 … … 664 776 } 665 777 else { 666 Tcl_AppendResult(interp, 778 Tcl_AppendResult(interp, 667 779 "wrong # args: should be \"remove ?path?\"", 668 780 (char*)NULL); -
trunk/src/tcl/tcl_test.tcl
r207 r224 77 77 78 78 puts "COPYING BETWEEN LIBS" 79 $libObj1 copy "input.test" from libObj2 "input.(max)"79 $libObj1 copy "input.test" from $libObj2 "input.(max)" 80 80 puts [$libObj1 xml] 81 82 puts "COPYING BETWEEN LIBS - this should fail" 83 set err [$libObj1 copy "input.test" from put "input.(max)"] 84 puts $err 81 85 82 86 #puts [$libObj xml] 83 87 puts "isvalid test1: " 84 #puts [Rappture::library isvalid $libObj1]88 puts [Rappture::library isvalid $libObj1] 85 89 puts "isvalid test2: " 86 # puts [Rappture::library isvalid library0] 90 puts [Rappture::library isvalid library0] 91 puts "isvalid test3: " 92 puts [Rappture::library isvalid puts] 93 puts "testing lib0's xml" 94 puts [library0 xml] 95 96 puts "TEST ISA" 97 puts "$libObj1 isa ::Rappture::LibraryObj : " 98 puts [$libObj1 isa ::Rappture::LibraryObj] 99 puts "$libObj1 isa ::Rappture::Table : " 100 puts [$libObj1 isa ::Rappture::Table] 101 #puts "$libObj1 isa ::Rappture::LibraryObj ::Rappture::LibraryObj: " 102 #puts [$libObj1 isa ::Rappture::LibraryObj ::Rappture::LibraryObj] 103 104 puts "TEST DIFF" 105 puts "changing the value of input.number(min) to 4" 106 $libObj1 put input.number(min).current "4" 107 $libObj2 put input.number(jdjd).current "4" 108 puts "$libObj1 diff $libObj2" 109 puts [$libObj1 diff $libObj2] 110 #foreach {op vpath oldval newval} [$libObj1 diff $libObj2] { 111 # puts "op 112 -
trunk/test/src/RpLibrary_test.cc
r200 r224 13 13 14 14 #include "RpLibrary.h" 15 #include <list> 15 16 16 17 int test_element (RpLibrary* lib, std::string path ); … … 198 199 } 199 200 201 int test_entities (RpLibrary* lib) 202 { 203 std::list<std::string>::iterator iter; 204 std::list<std::string> elist = lib->entities(); 205 206 iter = elist.begin(); 207 208 std::cout << "TESTING ENTITIES BEGIN" << std::endl; 209 std::cout << "path = "<< lib->nodePath() << std::endl; 210 211 while (iter != elist.end() ) { 212 std::cout << *iter << std::endl; 213 iter++; 214 } 215 216 std::cout << "TESTING ENTITIES END" << std::endl; 217 218 return 0; 219 } 220 221 int test_diff (RpLibrary* lib1, RpLibrary* lib2) 222 { 223 std::list<std::string>::iterator iter; 224 std::list<std::string> elist; 225 226 elist = lib1->diff(lib2,"input"); 227 228 iter = elist.begin(); 229 230 std::cout << "TESTING DIFF BEGIN" << std::endl; 231 232 int count = 0; 233 while (iter != elist.end() ) { 234 std::cout << *iter << " "; 235 iter++; 236 count++; 237 if (count == 4) { 238 std::cout << std::endl; 239 count = 0; 240 } 241 242 } 243 244 std::cout << "TESTING DIFF END" << std::endl; 245 246 return 0; 247 } 200 248 201 249 /* … … 315 363 std::cout << lib->xml() << std::endl; 316 364 365 RpLibrary* libInput = lib->element("input"); 366 test_entities(lib); 367 test_entities(libInput); 368 369 /* 370 std::list<std::string> l1 = lib->value("input.number(min)"); 371 std::list<std::string> l2 = lib->value("input.number(max)"); 372 std::cout << "l1 = " << l1.front() << " " << l1.back() << std::endl; 373 std::cout << "l2 = " << l2.front() << " " << l2.back() << std::endl; 374 */ 375 376 RpLibrary* dlib1 = new RpLibrary(std::string(argv[1])); 377 RpLibrary* dlib2 = new RpLibrary(std::string(argv[1])); 378 test_diff(dlib1,dlib2); 379 std::cout << "dlib1-------------------------------------" << std::endl; 380 std::cout << dlib1->xml() << std::endl; 381 std::cout << "dlib2-------------------------------------" << std::endl; 382 std::cout << dlib1->xml() << std::endl; 383 dlib1 = lib; 384 test_diff(dlib1,dlib2); 385 std::cout << "dlib1-------------------------------------" << std::endl; 386 std::cout << dlib1->xml() << std::endl; 387 std::cout << "dlib2-------------------------------------" << std::endl; 388 std::cout << dlib1->xml() << std::endl; 389 390 391 317 392 // test copy assignment operator 318 393 lib2 = *lib; … … 345 420 346 421 lib2.result(); 422 347 423 348 424 return 0;
Note: See TracChangeset
for help on using the changeset viewer.