Changes between Version 13 and Version 14 of rappture_ccpp_api
- Timestamp:
- Oct 21, 2011 9:50:24 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
rappture_ccpp_api
v13 v14 8 8 9 9 10 ''' RpLibrary''' Class10 '''!RpLibrary''' Class 11 11 12 12 This module provides an interface to Rappture I/O (!RpLibrary) library. … … 15 15 __'''Constructor'''__ [[BR]] 16 16 17 RpLibrary* ''lib'' = '''rpLibrary(''' ''path'' ''')'''; [[BR]]17 !RpLibrary* ''lib'' = '''rpLibrary(''' ''path'' ''')'''; [[BR]] 18 18 19 19 __'''Destructor'''__ [[BR]] 20 20 21 '''rpFreeLibrary(''' '' lib'' ''')'''; [[BR]]21 '''rpFreeLibrary(''' ''&lib'' ''')'''; [[BR]] 22 22 23 23 __'''Methods'''__ [[BR]] … … 35 35 int ''err'' = '''rpElementAsComp(''' ''lib'', ''path'', ''retCStr'' ''')'''; [[BR]] 36 36 int ''err'' = '''rpElementAsId(''' ''lib'', ''path'', ''retCStr'' ''')'''; [[BR]] 37 RpLibrary* ''ele'' = '''rpElement(''' ''lib'', ''path'' ''')'''; [[BR]]38 RpLibrary* ''ele'' = '''rpElementAsObject(''' ''lib'', ''path'' ''')'''; [[BR]]39 40 RpLibrary* ''ele'' = '''rpChildren(''' ''lib'', ''path'', ''childEle'' ''')'''; [[BR]]41 RpLibrary* ''ele'' = '''rpChildrenByType(''' ''lib'', ''path'', ''childEle'', ''type'' ''')'''; [[BR]]37 !RpLibrary* ''ele'' = '''rpElement(''' ''lib'', ''path'' ''')'''; [[BR]] 38 !RpLibrary* ''ele'' = '''rpElementAsObject(''' ''lib'', ''path'' ''')'''; [[BR]] 39 40 !RpLibrary* ''ele'' = '''rpChildren(''' ''lib'', ''path'', ''childEle'' ''')'''; [[BR]] 41 !RpLibrary* ''ele'' = '''rpChildrenByType(''' ''lib'', ''path'', ''childEle'', ''type'' ''')'''; [[BR]] 42 42 43 43 const char* ''retCstr'' = '''rpXml(''' ''lib'' ''')'''; [[BR]] … … 66 66 67 67 68 ''' RpUtils''' Module [[BR]]68 '''!RpUtils''' Module [[BR]] 69 69 70 70 This module provides an interface to the Rappture Utils Module … … 80 80 81 81 82 RpLibrary* '''rpLibrary''' (char* ''path'')83 84 Purpose:[[BR]] 85 Retrieve an object reference to the file pointed to by ''path'' for accessing member functions of Rappture[[BR]]86 87 Input Arguments: [[BR]] 88 1. char* ''path'' - non-null c style string providing the path to an xml file[[BR]]82 !RpLibrary* '''rpLibrary''' (char* ''path'') 83 84 Purpose:[[BR]] 85 Retrieve an object reference to the file pointed to by ''path'' for accessing member functions of Rappture. [[BR]] 86 87 Input Arguments: [[BR]] 88 1) char* ''path'' - non-null c style string providing the path to an xml file.[[BR]] 89 89 90 90 Return Value:[[BR]] 91 Pointer to a Rappture library (RpLibrary) object[[BR]]91 1) Pointer to a Rappture library (!RpLibrary) object.[[BR]] 92 92 93 93 Notes: [[BR]] 94 1. On success the return value will be a non-null RpLibrary pointer [[BR]] 95 2. ''path'' must be a non-null c-style string [[BR]] 94 1) On success the return value will be a non-null !RpLibrary pointer. [[BR]] 95 2) ''path'' must be a non-null c-style string. [[BR]] 96 97 int '''rpFreeLibrary''' (!RpLibrary** ''lib'') 98 99 Purpose:[[BR]] 100 Free the Rappture Library object.[[BR]] 101 102 Input Arguments: [[BR]] 103 1) !RpLibrary** ''lib'' - Pointer to a Rappture library (!RpLibrary) object.[[BR]] 104 105 Return Value:[[BR]] 106 1) Integer error flag, 0 on success, 1 on error.[[BR]] 107 108 Notes: [[BR]] 109 1) On success the !RpLibrary pointer will be deleted and set to NULL. [[BR]] 96 110 97 111 {{{ … … 130 144 printf ("lib = %x\n",(unsigned int)(lib)); 131 145 132 rpFreeLibrary( lib);146 rpFreeLibrary(&lib); 133 147 return 0; 134 148 } … … 146 160 147 161 148 int '''rpGetString''' ( RpLibrary* ''lib'', const char* ''path'', const char** ''retCStr'') [[BR]]162 int '''rpGetString''' (!RpLibrary* ''lib'', const char* ''path'', const char** ''retCStr'') [[BR]] 149 163 Purpose:[[BR]] 150 164 This function retrieves the data held at location ''path'' in the rappture object ''lib''. [[BR]] … … 153 167 by the function. [[BR]] 154 168 If path is an empty string, the root of the node is used. ''lib'' [[BR]] 155 is a pointer representing the instance of the RpLibrary object. [[BR]]156 157 Input Arguments: [[BR]] 158 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]159 2.const char* ''path'' - xml DOM object path. [[BR]]160 3.const char** ''retCStr'' - returned data. [[BR]]169 is a pointer representing the instance of the !RpLibrary object. [[BR]] 170 171 Input Arguments: [[BR]] 172 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 173 2) const char* ''path'' - xml DOM object path. [[BR]] 174 3) const char** ''retCStr'' - returned data. [[BR]] 161 175 162 176 Return Value: [[BR]] 163 1) 0 on success, all other values represent failure. 177 1) 0 on success, all other values represent failure. [[BR]] 164 178 165 179 Notes: [[BR]] 166 180 1) **''retCStr'' points to a temporary string containing the result.[[BR]] 167 181 2) The returned string should not be changed or free'd.[[BR]] 168 3) The value stored at the returned address is only guaranteed until the next call to this function [[BR]]182 3) The value stored at the returned address is only guaranteed until the next call to this function.[[BR]] 169 183 170 184 {{{ … … 204 218 } 205 219 206 rpFreeLibrary( lib);220 rpFreeLibrary(&lib); 207 221 return 0; 208 222 } … … 221 235 222 236 223 int '''rpGetDouble''' ( RpLibrary* ''lib'', const char* ''path'', double* ''retDVal'') [[BR]]224 Purpose:[[BR]] 225 This function retrieves the data held at location ''path'' in the rappture object ''lib''. [[BR]]237 int '''rpGetDouble''' (!RpLibrary* ''lib'', const char* ''path'', double* ''retDVal'') [[BR]] 238 Purpose:[[BR]] 239 This function retrieves the data held at location ''path'' in the Rappture object ''lib''. [[BR]] 226 240 After the function has been invoked, the contents of ''retDVal'' [[BR]] 227 241 will point to the returned value and an integer will be returned [[BR]] 228 242 by the function. [[BR]] 229 243 If path is an empty string, the root of the node is used. ''lib'' [[BR]] 230 is a pointer representing the instance of the RpLibrary object. [[BR]]231 232 Input Arguments: [[BR]] 233 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]234 2.const char* ''path'' - xml DOM object path. [[BR]]235 3.double* ''retDVal'' - returned data. [[BR]]244 is a pointer representing the instance of the !RpLibrary object. [[BR]] 245 246 Input Arguments: [[BR]] 247 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 248 2) const char* ''path'' - xml DOM object path. [[BR]] 249 3) double* ''retDVal'' - returned data. [[BR]] 236 250 237 251 Return Value: [[BR]] 238 1) 0 on success, all other values represent failure. 252 1) 0 on success, all other values represent failure. [[BR]] 239 253 240 254 Notes: [[BR]] … … 277 291 } 278 292 279 rpFreeLibrary( lib);293 rpFreeLibrary(&lib); 280 294 return 0; 281 295 } … … 293 307 294 308 295 int '''rpPutString''' ( RpLibrary* ''lib'', const char* ''path'', const char* ''value'', int ''append'') [[BR]]309 int '''rpPutString''' (!RpLibrary* ''lib'', const char* ''path'', const char* ''value'', int ''append'') [[BR]] 296 310 Purpose:[[BR]] 297 311 This function places the data from ''value'' into the location ''path'' [[BR]] 298 312 in the rappture object ''lib'' and returns an integer representing success. [[BR]] 299 313 If path is an empty string, the root of the node is used. ''lib'' [[BR]] 300 is a pointer representing the instance of the RpLibrary object. If the [[BR]]314 is a pointer representing the instance of the !RpLibrary object. If the [[BR]] 301 315 ''append'' flag is set to 0, then any data existing at ''path'' will be overwritten. [[BR]] 302 316 If the append flag, is set to 1, then data from ''value will be appended to existing [[BR]] … … 304 318 305 319 Input Arguments: [[BR]] 306 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]307 2.const char* ''path'' - xml DOM object path. [[BR]]308 3.const char* ''value'' - returned data. [[BR]]309 4. int ''append'' - tells if data in ''value'' should be appended to existing data at ''path''[[BR]]320 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 321 2) const char* ''path'' - xml DOM object path. [[BR]] 322 3) const char* ''value'' - returned data. [[BR]] 323 4) int ''append'' - tells if data in ''value'' should be appended to existing data at ''path''. [[BR]] 310 324 311 325 Return Value: [[BR]] 312 1) 0 on success, all other values represent failure. 326 1) 0 on success, all other values represent failure. [[BR]] 313 327 314 328 Notes: [[BR]] … … 354 368 } 355 369 356 rpFreeLibrary( lib);370 rpFreeLibrary(&lib); 357 371 return 0; 358 372 } … … 380 394 381 395 382 int '''rpPutDouble''' ( RpLibrary* ''lib'', const char* ''path'', double ''value'', int append) [[BR]]396 int '''rpPutDouble''' (!RpLibrary* ''lib'', const char* ''path'', double ''value'', int append) [[BR]] 383 397 Purpose:[[BR]] 384 398 This function places the data from ''value'' into the location ''path'' [[BR]] 385 in the rappture object ''lib'' and returns an integer representing success. [[BR]]399 in the Rappture object ''lib'' and returns an integer representing success. [[BR]] 386 400 If path is an empty string, the root of the node is used. ''lib'' [[BR]] 387 is a pointer representing the instance of the RpLibrary object. If the [[BR]]401 is a pointer representing the instance of the !RpLibrary object. If the [[BR]] 388 402 ''append'' flag is set to 0, then any data existing at ''path'' will be overwritten. [[BR]] 389 403 If the append flag, is set to 1, then data from ''value will be appended to existing [[BR]] … … 391 405 392 406 Input Arguments: [[BR]] 393 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]394 2.const char* ''path'' - xml DOM object path. [[BR]]395 3.double ''value'' - data to place into xml node. [[BR]]407 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 408 2) const char* ''path'' - xml DOM object path. [[BR]] 409 3) double ''value'' - data to place into xml node. [[BR]] 396 410 397 411 Return Value: [[BR]] 398 1) 0 on success, all other values represent failure. 412 1) 0 on success, all other values represent failure. [[BR]] 399 413 400 414 Notes: [[BR]] … … 441 455 } 442 456 443 rpFreeLibrary( lib);457 rpFreeLibrary(&lib); 444 458 return 0; 445 459 } … … 465 479 466 480 467 int '''rpResult''' ( RpLibrary* ''lib'') [[BR]]468 Purpose:[[BR]] 469 This function writes the xml of the rappture library ''lib'' [[BR]]481 int '''rpResult''' (!RpLibrary* ''lib'') [[BR]] 482 Purpose:[[BR]] 483 This function writes the xml of the Rappture library ''lib'' [[BR]] 470 484 to a unique run.xml file on disk, and a signal is sent to the [[BR]] 471 485 rappture graphical user interface. [[BR]] 472 486 473 487 Input Arguments: [[BR]] 474 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]475 2.const char** ''retCStr'' - xml DOM object path. [[BR]]488 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 489 2) const char** ''retCStr'' - xml DOM object path. [[BR]] 476 490 477 491 Return Value: [[BR]] … … 515 529 } 516 530 517 rpFreeLibrary( lib);531 rpFreeLibrary(&lib); 518 532 return 0; 519 533 } … … 534 548 535 549 536 int '''rpElementAsComp''' ( RpLibrary* ''lib'', const char* ''path'', const char** ''retCStr'') [[BR]]550 int '''rpElementAsComp''' (!RpLibrary* ''lib'', const char* ''path'', const char** ''retCStr'') [[BR]] 537 551 Purpose:[[BR]] 538 552 This method searches the Rappture Library Object ''lib'' for the [[BR]] 539 553 node at the location described by ''path'' and returns its [[BR]] 540 component name, a concat ination of the type, id, and index. [[BR]]554 component name, a concatenation of the type, id, and index. [[BR]] 541 555 After the function has been invoked, the contents of ''retCStr'' [[BR]] 542 556 will point to the returned value and an integer will be returned [[BR]] 543 557 by the function. [[BR]] 544 558 If path is an empty string, the root of the node is used. ''lib'' [[BR]] 545 is a pointer representing the instance of the RpLibrary object. [[BR]]546 547 Input Arguments: [[BR]] 548 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]549 2.const char* ''path'' - xml DOM object path. [[BR]]550 3.const char* ''retCStr'' - node component name. [[BR]]559 is a pointer representing the instance of the !RpLibrary object. [[BR]] 560 561 Input Arguments: [[BR]] 562 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 563 2) const char* ''path'' - xml DOM object path. [[BR]] 564 3) const char* ''retCStr'' - node component name. [[BR]] 551 565 552 566 Return Value: [[BR]] 553 1) 0 on success, all other values represent failure. 567 1) 0 on success, all other values represent failure. [[BR]] 554 568 555 569 Notes: [[BR]] 556 570 1) **''retCStr'' points to a temporary string containing the result.[[BR]] 557 571 2) The returned string should not be changed or free'd.[[BR]] 558 3) The value stored at the returned address is only guaranteed until the next call to this function [[BR]]572 3) The value stored at the returned address is only guaranteed until the next call to this function.[[BR]] 559 573 560 574 {{{ … … 588 602 printf("comp = %s\n",comp); 589 603 590 rpFreeLibrary( lib);604 rpFreeLibrary(&lib); 591 605 return 0; 592 606 } … … 603 617 604 618 605 int '''rpElementAsType''' ( RpLibrary* ''lib'', const char* ''path'', const char** ''retCStr'') [[BR]]619 int '''rpElementAsType''' (!RpLibrary* ''lib'', const char* ''path'', const char** ''retCStr'') [[BR]] 606 620 Purpose:[[BR]] 607 621 This method searches the Rappture Library Object ''lib'' for the [[BR]] … … 611 625 by the function. [[BR]] 612 626 If path is an empty string, the root of the node is used. ''lib'' [[BR]] 613 is a pointer representing the instance of the RpLibrary object. [[BR]]614 615 Input Arguments: [[BR]] 616 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]617 2.const char* ''path'' - xml DOM object path. [[BR]]618 3.const char* ''retCStr'' - node type. [[BR]]627 is a pointer representing the instance of the !RpLibrary object. [[BR]] 628 629 Input Arguments: [[BR]] 630 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 631 2) const char* ''path'' - xml DOM object path. [[BR]] 632 3) const char* ''retCStr'' - node type. [[BR]] 619 633 620 634 Return Value: [[BR]] … … 624 638 1) **''retCStr'' points to a temporary string containing the result.[[BR]] 625 639 2) The returned string should not be changed or free'd.[[BR]] 626 3) The value stored at the returned address is only guaranteed until the next call to this function [[BR]]640 3) The value stored at the returned address is only guaranteed until the next call to this function.[[BR]] 627 641 628 642 {{{ … … 657 671 printf("type = %s\n",typeName); 658 672 659 rpFreeLibrary( lib);673 rpFreeLibrary(&lib); 660 674 return 0; 661 675 } … … 672 686 673 687 674 int '''rpElementAsId''' ( RpLibrary* ''lib'', const char* ''path'', const char** ''retCStr'') [[BR]]688 int '''rpElementAsId''' (!RpLibrary* ''lib'', const char* ''path'', const char** ''retCStr'') [[BR]] 675 689 Purpose:[[BR]] 676 690 This method searches the Rappture Library Object ''lib'' for the [[BR]] … … 680 694 by the function. [[BR]] 681 695 If path is an empty string, the root of the node is used. ''lib'' [[BR]] 682 is a pointer representing the instance of the RpLibrary object. [[BR]]683 684 Input Arguments: [[BR]] 685 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]686 2.const char* ''path'' - xml DOM object path. [[BR]]687 3.const char* ''retCStr'' - node id. [[BR]]696 is a pointer representing the instance of the !RpLibrary object. [[BR]] 697 698 Input Arguments: [[BR]] 699 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 700 2) const char* ''path'' - xml DOM object path. [[BR]] 701 3) const char* ''retCStr'' - node id. [[BR]] 688 702 689 703 Return Value: [[BR]] … … 693 707 1) **''retCStr'' points to a temporary string containing the result.[[BR]] 694 708 2) The returned string should not be changed or free'd.[[BR]] 695 3) The value stored at the returned address is only guaranteed until the next call to this function [[BR]]709 3) The value stored at the returned address is only guaranteed until the next call to this function.[[BR]] 696 710 697 711 {{{ … … 726 740 printf("id = %s\n",id); 727 741 728 rpFreeLibrary( lib);742 rpFreeLibrary(&lib); 729 743 return 0; 730 744 } … … 742 756 743 757 744 int '''rpXml''' ( RpLibrary* ''lib'', const char** ''retCStr'') [[BR]]745 Purpose:[[BR]] 746 This function returns the xml of the provided library i, ''lib'' [[BR]]747 After a successfu nfunction call, **''retCStr'' will point to the [[BR]]758 int '''rpXml''' (!RpLibrary* ''lib'', const char** ''retCStr'') [[BR]] 759 Purpose:[[BR]] 760 This function returns the xml of the provided library, ''lib'' [[BR]] 761 After a successful function call, **''retCStr'' will point to the [[BR]] 748 762 returned data. [[BR]] 749 763 750 764 Input Arguments: [[BR]] 751 1.RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]]752 2.const char** ''retCStr'' - xml DOM object path. [[BR]]765 1) !RpLibrary* ''lib'' - user reference to the Rappture library. [[BR]] 766 2) const char** ''retCStr'' - xml DOM object path. [[BR]] 753 767 754 768 Return Value: [[BR]] … … 792 806 } 793 807 794 rpFreeLibrary( lib);808 rpFreeLibrary(&lib); 795 809 return 0; 796 810 } … … 821 835 822 836 Purpose:[[BR]] 823 Convert the numeric value and units found in the string ''fromVal'' to the units named in ''toUnitsName''. A double precision value is returned. An error code is placed into ''result''. A value of 0 represents success, any other value is failure. [[BR]] 824 825 Input Arguments: [[BR]] 826 1. const char* ''fromVal'' - String representing the numeric value and units you want to convert from. [[BR]] 827 2. const char* ''toUnitsName'' - String representing the name of the units you want to convert to. [[BR]] 828 3. int* ''result'' - Error flag to tell if conversion was successful or not. [[BR]] 837 Convert the numeric value and units found in the string ''fromVal'' [[BR]] 838 to the units named in ''toUnitsName''. A double precision value is returned. [[BR]] 839 An error code is placed into ''result''. A value of 0 represents success, [[BR]] 840 any other value is failure. [[BR]] 841 842 Input Arguments: [[BR]] 843 1) const char* ''fromVal'' - String representing the numeric value and units you want to convert from. [[BR]] 844 2) const char* ''toUnitsName'' - String representing the name of the units you want to convert to. [[BR]] 845 3) int* ''result'' - Error flag to tell if conversion was successful or not. [[BR]] 829 846 830 847 Return Value: [[BR]] 831 The converted value is provided as the return value of the function. An error code is returned via the result variable. An error code of 0 represents success, any other value represents failure. [[BR]] 848 The converted value is provided as the return value of the function. [[BR]] 849 An error code is returned via the result variable. An error code of 0 represents [[BR]] 850 success, any other value represents failure. [[BR]] 832 851 833 852 Notes: [[BR]] 834 For this function, units are not displayed in the resultant converted value returned by the function. [[BR]]853 For this function, units are not displayed in the resultant converted value returned by the function. [[BR]] 835 854 836 855 {{{ … … 880 899 } 881 900 882 rpFreeLibrary( lib);901 rpFreeLibrary(&lib); 883 902 return 0; 884 903 } … … 903 922 904 923 Purpose:[[BR]] 905 Convert the numeric value and units found in the string ''fromVal'' to the units named in ''toUnitsName''. The ''showUnits'' flag tells whether to attach units onto the returned const char* value. An error code is placed into ''result''. A value of 0 represents success, any other value is failure. [[BR]] 906 907 Input Arguments: [[BR]] 908 1. const char* ''fromVal'' - String representing the numeric value and units you want ot convert from. [[BR]] 909 2. const char* ''toUnitsName'' - String representing the name of the units you want to convert to. [[BR]] 910 3. int ''showUnits'' - String representing the name of the units you want to convert to. [[BR]] 911 4. int* ''result'' - Error flag to tell if conversion was successful or not. [[BR]] 924 Convert the numeric value and units found in the string ''fromVal'' [[BR]] 925 to the units named in ''toUnitsName''. The ''showUnits'' flag tells [[BR]] 926 whether to attach units onto the returned const char* value. An error [[BR]] 927 code is placed into ''result''. A value of 0 represents success, any [[BR]] 928 other value is failure. [[BR]] 929 930 Input Arguments: [[BR]] 931 1) const char* ''fromVal'' - String representing the numeric value and units you want ot convert from. [[BR]] 932 2) const char* ''toUnitsName'' - String representing the name of the units you want to convert to. [[BR]] 933 3) int ''showUnits'' - String representing the name of the units you want to convert to. [[BR]] 934 4) int* ''result'' - Error flag to tell if conversion was successful or not. [[BR]] 912 935 913 936 Return Value: [[BR]] 914 A const char* pointer is returned on function exit. The pointer does not belong to the user, it is static and temporary. If the user wants to keep the string, they are responsible for copying the contents of the pointer to their allocated memory. The user should not modify or delete the contents of the returned pointer. [[BR]] 937 A const char* pointer is returned on function exit. The pointer does [[BR]] 938 not belong to the user, it is static and temporary. If the user wants [[BR]] 939 to keep the string, they are responsible for copying the contents of [[BR]] 940 the pointer to their allocated memory. The user should not modify or [[BR]] 941 delete the contents of the returned pointer. [[BR]] 915 942 916 943 Notes: [[BR]] 917 Units are always displayed in the return value ''retText''[[BR]]944 Units are always displayed in the return value ''retText''.[[BR]] 918 945 919 946 {{{ … … 963 990 } 964 991 965 rpFreeLibrary( lib);992 rpFreeLibrary(&lib); 966 993 return 0; 967 994 }