Changeset 70:7882bccb87a0 in xplra for src/client/c/hu
- Timestamp:
- 04/13/13 12:54:56 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/client/c/hu/varadiistvan/xplra
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/client/c/hu/varadiistvan/xplra/xplra.cc
r58 r70 1373 1373 if (connection==0) return -1; 1374 1374 1375 connection->disconnect(); 1376 1377 return 0; 1378 } 1379 1380 //------------------------------------------------------------------------------ 1381 //------------------------------------------------------------------------------ 1382 1383 extern "C" int xplra_reconnect(int connectionID) 1384 { 1385 Connection* connection = ConnectionSlot::getValue(connectionID); 1386 if (connection==0) return -1; 1387 1388 try { 1389 connection->connect(); 1390 return 0; 1391 } catch(...) { 1392 return -1; 1393 } 1394 } 1395 1396 //------------------------------------------------------------------------------ 1397 //------------------------------------------------------------------------------ 1398 1399 extern "C" int xplra_destroy(int connectionID) 1400 { 1401 Connection* connection = ConnectionSlot::getValue(connectionID); 1402 if (connection==0) return -1; 1403 1375 1404 ConnectionSlot::clearValue(connectionID); 1376 connection->disconnect();1377 1405 delete connection; 1378 1406 -
src/client/c/hu/varadiistvan/xplra/xplra.h
r58 r70 32 32 /*----------------------------------------------------------------------------*/ 33 33 34 /** @file */ 35 36 /*----------------------------------------------------------------------------*/ 37 34 38 #include <stdlib.h> 35 39 #include <inttypes.h> … … 107 111 /*----------------------------------------------------------------------------*/ 108 112 113 /** 114 * This ID is returned by multi-dataref buffer functions when the 115 * buffer is not found, this the dataref cannot be assigned an ID 116 */ 109 117 #define INVALID_DATAREF_ID ((size_t)-1) 110 118 … … 193 201 * @param length the length of the destination buffer 194 202 * @param offset the offset from which to query the array 203 * @param connectionID the ID of the connection to use 204 * @param name the name of the dataref 195 205 * 196 206 * @return the actual number of elements returned in case of success, … … 209 219 * less than or equal to the input value. 210 220 * @param offset the offset from which to query the array 221 * @param connectionID the ID of the connection to use 222 * @param name the name of the dataref 211 223 * 212 224 * @return the new array on success, 0 on error … … 223 235 * @param length the length of the destination buffer 224 236 * @param offset the offset from which to query the array 237 * @param connectionID the ID of the connection to use 238 * @param name the name of the dataref 225 239 * 226 240 * @return the actual number of elements returned in case of success, … … 239 253 * less than or equal to the input value. 240 254 * @param offset the offset from which to query the array 255 * @param connectionID the ID of the connection to use 256 * @param name the name of the dataref 241 257 * 242 258 * @return the new array on success, 0 on error … … 253 269 * @param length the length of the destination buffer 254 270 * @param offset the offset from which to query the array 271 * @param connectionID the ID of the connection to use 272 * @param name the name of the dataref 255 273 * 256 274 * @return the actual number of elements returned in case of success, … … 269 287 * less than or equal to the input value. 270 288 * @param offset the offset from which to query the array 289 * @param connectionID the ID of the connection to use 290 * @param name the name of the dataref 271 291 * 272 292 * @return the new array on success, 0 on error … … 497 517 * 498 518 * @param dest pointer to the variable that will receive the value 519 * @param bufferID the ID of the buffer to use 520 * @param datarefID the ID of the dataref whose value is to be retrieved 499 521 * 500 522 * @return 0 on success, -1 on error. … … 535 557 * 536 558 * @param dest pointer to the variable that will receive the value 559 * @param bufferID the ID of the buffer to use 560 * @param datarefID the ID of the dataref whose value is to be retrieved 537 561 * 538 562 * @return 0 on success, -1 on error. … … 573 597 * 574 598 * @param dest pointer to the variable that will receive the value 599 * @param bufferID the ID of the buffer to use 600 * @param datarefID the ID of the dataref whose value is to be retrieved 575 601 * 576 602 * @return 0 on success, -1 on error. … … 601 627 * Set the contents of the float array dataref with the given ID. 602 628 * 629 * @param bufferID the ID of the buffer to use 630 * @param datarefID the ID of the dataref whose value is to be set 631 * @param value the array to set 603 632 * @param length the amount of data. If 0, it is assumed to be the 604 633 * length of the data in the buffer minus the offset. … … 616 645 * Get the contents of the float array with the given ID. 617 646 * 647 * @param value the destination buffer 618 648 * @param length the amount of data. If 0, it is assumed to be the 619 649 * length of the data in the buffer minus the offset. 620 650 * @param offset the offset within the buffer to get the data from 651 * @param bufferID the ID of the buffer to use 652 * @param datarefID the ID of the dataref whose value is to be retrieved 621 653 * 622 654 * @return the number of data items retrieved, or -1 on error. … … 631 663 * Get a pointer to the float array with the given ID. 632 664 * 665 * @param bufferID the ID of the buffer to use 666 * @param datarefID the ID of the dataref whose value is to be retrieved 633 667 * @param offset the offset within the buffer. 634 668 * … … 643 677 * Set the contents of the integer array dataref with the given ID. 644 678 * 679 * @param bufferID the ID of the buffer to use 680 * @param datarefID the ID of the dataref whose value is to be set 681 * @param value the array to set 645 682 * @param length the amount of data. If 0, it is assumed to be the 646 683 * length of the data in the buffer minus the offset. … … 658 695 * Get the contents of the integer array with the given ID. 659 696 * 697 * @param value the destination buffer 660 698 * @param length the amount of data. If 0, it is assumed to be the 661 699 * length of the data in the buffer minus the offset. 662 700 * @param offset the offset within the buffer to get the data from 701 * @param bufferID the ID of the buffer to use 702 * @param datarefID the ID of the dataref whose value is to be retrieved 663 703 * 664 704 * @return the number of data items retrieved, or -1 on error. … … 673 713 * Get a pointer to the integer array with the given ID. 674 714 * 715 * @param bufferID the ID of the buffer to use 716 * @param datarefID the ID of the dataref whose value is to be retrieved 675 717 * @param offset the offset within the buffer. 676 718 * … … 685 727 * Set the contents of the byte array dataref with the given ID. 686 728 * 729 * @param bufferID the ID of the buffer to use 730 * @param datarefID the ID of the dataref whose value is to be set 731 * @param value the array to set 687 732 * @param length the amount of data. If 0, it is assumed to be the 688 733 * length of the data in the buffer minus the offset. … … 700 745 * Get the contents of the byte array with the given ID. 701 746 * 747 * @param value the destination buffer 702 748 * @param length the amount of data. If 0, it is assumed to be the 703 749 * length of the data in the buffer minus the offset. 704 750 * @param offset the offset within the buffer to get the data from 751 * @param bufferID the ID of the buffer to use 752 * @param datarefID the ID of the dataref whose value is to be retrieved 705 753 * 706 754 * @return the number of data items retrieved, or -1 on error. … … 715 763 * Get a pointer to the byte array with the given ID. 716 764 * 765 * @param bufferID the ID of the buffer to use 766 * @param datarefID the ID of the dataref whose value is to be retrieved 717 767 * @param offset the offset within the buffer. 718 768 * … … 752 802 * @param connectionID the ID of the connection for which the buffer 753 803 * has been created. 804 * @param bufferID the ID of the buffer to destroy 754 805 * 755 806 * @return 0 on success, -1 on error. … … 793 844 794 845 /** 846 * Disconnect the connection with the given ID. 847 * 848 * @return 0 on success, -1 on error. 849 */ 850 int xplra_disconnect(int connectionID); 851 852 /*----------------------------------------------------------------------------*/ 853 854 /** 855 * Reconnect the connection with the given ID. If it is already 856 * connected, nothing happens. 857 * 858 * @return 0 on success, -1 on error. 859 */ 860 int xplra_reconnect(int connectionID); 861 862 /*----------------------------------------------------------------------------*/ 863 864 /** 795 865 * Destroy the connection with the given ID. 796 866 * 797 867 * @return 0 on success, -1 on error. 798 868 */ 799 int xplra_d isconnect(int connectionID);869 int xplra_destroy(int connectionID); 800 870 801 871 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.