Changeset 11695 for trunk/FACT++/dim/src
- Timestamp:
- 07/29/11 09:54:56 (13 years ago)
- Location:
- trunk/FACT++/dim/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/src/diccpp.cxx
r11071 r11695 1111 1111 1112 1112 DimCore::inCallback = 2; 1113 DimClient::itsCltError->errorHandler(severity, code, msg); 1113 if(DimClient::itsCltError != 0) 1114 DimClient::itsCltError->errorHandler(severity, code, msg); 1114 1115 DimCore::inCallback = 0; 1115 1116 } … … 1118 1119 void DimClient::addErrorHandler(DimErrorHandler *handler) 1119 1120 { 1120 DimClient::itsCltError = handler; 1121 dic_add_error_handler(clt_error_user_routine); 1121 if(handler == 0) 1122 { 1123 dic_add_error_handler(0); 1124 DimClient::itsCltError = 0; 1125 } 1126 else 1127 { 1128 DimClient::itsCltError = handler; 1129 dic_add_error_handler(clt_error_user_routine); 1130 } 1122 1131 } 1123 1132 … … 1207 1216 return list; 1208 1217 } 1218 1219 int DimClient::inCallback() 1220 { 1221 if(DimCore::inCallback) 1222 return 1; 1223 return 0; 1224 } -
trunk/FACT++/dim/src/discpp.cxx
r11071 r11695 612 612 void DimServer::addClientExitHandler(DimClientExitHandler *handler) 613 613 { 614 DimServer::itsClientExit = handler; 615 dis_add_client_exit_handler(client_exit_user_routine); 614 if(handler == 0) 615 { 616 dis_add_client_exit_handler(0); 617 DimServer::itsClientExit = 0; 618 } 619 else 620 { 621 DimServer::itsClientExit = handler; 622 dis_add_client_exit_handler(client_exit_user_routine); 623 } 616 624 } 617 625 … … 624 632 void DimServer::addExitHandler(DimExitHandler *handler) 625 633 { 626 DimServer::itsExit = handler; 627 dis_add_exit_handler(exit_user_routine); 634 if(handler == 0) 635 { 636 dis_add_exit_handler(0); 637 DimServer::itsExit = 0; 638 } 639 else 640 { 641 DimServer::itsExit = handler; 642 dis_add_exit_handler(exit_user_routine); 643 } 628 644 } 629 645 630 646 void DimServer::addErrorHandler(DimErrorHandler *handler) 631 647 { 632 DimServer::itsSrvError = handler; 633 dis_add_error_handler(srv_error_user_routine); 648 if(handler == 0) 649 { 650 dis_add_error_handler(0); 651 DimServer::itsSrvError = 0; 652 } 653 else 654 { 655 DimServer::itsSrvError = handler; 656 dis_add_error_handler(srv_error_user_routine); 657 } 634 658 } 635 659 … … 686 710 } 687 711 712 int DimServer::inCallback() 713 { 714 if(DimCore::inCallback) 715 return 1; 716 return 0; 717 } 718 688 719 extern "C" { 689 720 static void client_exit_user_routine(int *idp) … … 711 742 712 743 DimCore::inCallback = 2; 713 DimServer::itsSrvError->errorHandler(severity, code, msg); 744 if(DimServer::itsSrvError != 0) 745 DimServer::itsSrvError->errorHandler(severity, code, msg); 714 746 DimCore::inCallback = 0; 715 747 } -
trunk/FACT++/dim/src/examples/test_client.cxx
r11071 r11695 39 39 index++; 40 40 } 41 int inCallback = DimClient::inCallback(); 42 cout << "infoHandler: In callback "<< inCallback << endl; 41 43 } 42 44 public : … … 83 85 cout << "Current INTVAL : " << servint.getInt() << endl; 84 86 DimClient::sendCommand("TEST/CMND","UPDATE_STRVAL"); 87 int inCallback = DimClient::inCallback(); 88 cout << "main: In callback "<< inCallback << endl; 89 90 DimClient::addErrorHandler(0); 85 91 } 86 92 return 0; -
trunk/FACT++/dim/src/examples/test_server.cxx
r11071 r11695 183 183 } 184 184 */ 185 186 185 while(1) 187 186 { 188 187 sleep(5); 188 189 189 /* 190 190 while(cmdsvr.hasNext()) … … 200 200 boolval = 0; 201 201 ival++; 202 203 int inCallback = DimServer::inCallback(); 204 cout << "main: In callback "<< inCallback << endl; 202 205 servint.updateService(); 203 206 if(extraDns)
Note:
See TracChangeset
for help on using the changeset viewer.