From c42fa01aca083b229e2f6390d1b86f1ec3c1c309 Mon Sep 17 00:00:00 2001 From: nobody Date: Sat, 29 Apr 2000 03:52:40 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'pos_local_policies'. --- ACE-INSTALL.html | 2086 -- ACE-configuration.txt | 181 - ACE-install.sh | 356 - ASNMP/COPYRIGHT | 68 - ASNMP/ChangeLog | 350 - ASNMP/Makefile | 34 - ASNMP/README | 177 - ASNMP/TO-DO | 3 - ASNMP/agent/Makefile | 28 - ASNMP/agent/agent_impl.cpp | 157 - ASNMP/agent/agent_impl.h | 52 - ASNMP/agent/main.cpp | 26 - ASNMP/agent/snmp_agent.cpp | 96 - ASNMP/agent/snmp_agent.h | 48 - ASNMP/asnmp-overview.html | 133 - ASNMP/asnmp/ChangeLog | 161 - ASNMP/asnmp/Makefile | 802 - ASNMP/asnmp/TODO | 25 - ASNMP/asnmp/address.cpp | 2686 -- ASNMP/asnmp/address.h | 812 - ASNMP/asnmp/asn1.cpp | 1728 - ASNMP/asnmp/asn1.h | 342 - ASNMP/asnmp/counter.cpp | 106 - ASNMP/asnmp/counter.h | 79 - ASNMP/asnmp/ctr64.cpp | 211 - ASNMP/asnmp/ctr64.h | 110 - ASNMP/asnmp/enttraps.h | 118 - ASNMP/asnmp/gauge.cpp | 113 - ASNMP/asnmp/gauge.h | 80 - ASNMP/asnmp/integer.cpp | 227 - ASNMP/asnmp/integer.h | 140 - ASNMP/asnmp/octet.cpp | 594 - ASNMP/asnmp/octet.h | 150 - ASNMP/asnmp/oid.cpp | 800 - ASNMP/asnmp/oid.h | 170 - ASNMP/asnmp/oid_def.h | 87 - ASNMP/asnmp/pdu.cpp | 496 - ASNMP/asnmp/pdu.h | 213 - ASNMP/asnmp/sagent.cpp | 97 - ASNMP/asnmp/sagent.h | 83 - ASNMP/asnmp/smi.h | 153 - ASNMP/asnmp/smival.h | 104 - ASNMP/asnmp/snmp.cpp | 283 - ASNMP/asnmp/snmp.h | 134 - ASNMP/asnmp/snmperrs.h | 214 - ASNMP/asnmp/target.cpp | 324 - ASNMP/asnmp/target.h | 252 - ASNMP/asnmp/timetick.cpp | 142 - ASNMP/asnmp/timetick.h | 85 - ASNMP/asnmp/transaction.cpp | 202 - ASNMP/asnmp/transaction.h | 80 - ASNMP/asnmp/transaction_result.h | 29 - ASNMP/asnmp/vb.cpp | 396 - ASNMP/asnmp/vb.h | 204 - ASNMP/asnmp/wpdu.cpp | 520 - ASNMP/asnmp/wpdu.h | 85 - ASNMP/examples/Makefile | 28 - ASNMP/examples/get/Makefile | 44 - ASNMP/examples/get/get.cpp | 195 - ASNMP/examples/get/get_async.cpp | 204 - ASNMP/examples/next/Makefile | 45 - ASNMP/examples/next/next.cpp | 193 - ASNMP/examples/set/Makefile | 45 - ASNMP/examples/set/set.cpp | 263 - ASNMP/examples/trap/Makefile | 45 - ASNMP/examples/trap/purify4.1.txt | 117 - ASNMP/examples/trap/trap.cpp | 182 - ASNMP/examples/walk/Makefile | 45 - ASNMP/examples/walk/walk.cpp | 260 - ASNMP/mibs/RFC1213-MIB.my | 2618 -- ASNMP/tests/Address_Test.cpp | 549 - ASNMP/tests/Counter64_Test.cpp | 154 - ASNMP/tests/Counter_Test.cpp | 136 - ASNMP/tests/Gauge_Test.cpp | 128 - ASNMP/tests/Integer_Test.cpp | 194 - ASNMP/tests/Makefile | 242 - ASNMP/tests/Octet_Test.cpp | 156 - ASNMP/tests/Oid_Test.cpp | 181 - ASNMP/tests/Target_Test.cpp | 147 - ASNMP/tests/Varbind_Test.cpp | 195 - ASNMP/tests/run_tests.bat | 44 - ASNMP/tests/run_tests.sh | 60 - ASNMP/tests/test_config.h | 195 - AUTHORS | 7 - BIBLIOGRAPHY | 752 - COPYING | 90 - ChangeLog | 5197 --- ChangeLog-93 | 52 - ChangeLog-94 | 1027 - ChangeLog-95 | 4179 --- ChangeLog-96a | 3889 -- ChangeLog-96b | 5878 --- ChangeLog-97a | 9203 ----- ChangeLog-97b | 9182 ----- ChangeLog-98a | 6588 ---- ChangeLog-98b | 12943 ------- ChangeLog-99a | 13412 ------- ChangeLog-99b | 7290 ---- ChangeLogs/ChangeLog-02a | 5197 --- ChangeLogs/ChangeLog-03a | 5197 --- FAQ | 1863 - Makefile | 249 - Makefile.am | 119 - Makefile.bor | 26 - PROBLEM-REPORT-FORM | 70 - README | 225 - STL/ACE_Changes | 53 - STL/readme2.stl | 272 - Static_Performance.dsw | 193 - TAO/orbsvcs/orbsvcs/AVStreams_Full.idl | 252 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp | 394 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h | 95 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.i | 2 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp | 538 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.h | 181 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.i | 14 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp | 576 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h | 200 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Export.h | 36 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp | 169 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h | 70 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp | 134 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h | 109 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.i | 14 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp | 505 - TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h | 204 - THANKS | 987 - TODO | 269 - VERSION | 11 - WindozeCE/ACEApp.cpp | 17 - WindozeCE/ACEApp.h | 14 - WindozeCE/README | 35 - WindozeCE/StdAfx.cpp | 7 - WindozeCE/StdAfx.h | 26 - WindozeCE/WindozeCE.aps | Bin 34768 -> 0 bytes WindozeCE/WindozeCE.clw | 41 - WindozeCE/WindozeCE.cpp | 70 - WindozeCE/WindozeCE.dsp | 377 - WindozeCE/WindozeCE.h | 53 - WindozeCE/WindozeCE.plg | 18 - WindozeCE/WindozeCE.rc | 176 - WindozeCE/WindozeCEDlg.cpp | 155 - WindozeCE/WindozeCEDlg.h | 54 - WindozeCE/res/WindozeCE.ico | Bin 1078 -> 0 bytes WindozeCE/res/WindozeCE.rc2 | 13 - WindozeCE/resource.h | 21 - acconfig.h | 1487 - ace-config.1.in | 57 - ace-config.in | 215 - ace/ACE.cpp | 4522 --- ace/ACE.h | 792 - ace/ACE.i | 346 - ace/ACE_export.h | 36 - ace/ARGV.cpp | 334 - ace/ARGV.h | 156 - ace/ARGV.i | 68 - ace/ATM_Acceptor.cpp | 217 - ace/ATM_Acceptor.h | 107 - ace/ATM_Acceptor.i | 27 - ace/ATM_Addr.cpp | 589 - ace/ATM_Addr.h | 159 - ace/ATM_Addr.i | 45 - ace/ATM_Connector.cpp | 93 - ace/ATM_Connector.h | 144 - ace/ATM_Connector.i | 111 - ace/ATM_Params.cpp | 22 - ace/ATM_Params.h | 171 - ace/ATM_Params.i | 224 - ace/ATM_QoS.cpp | 565 - ace/ATM_QoS.h | 98 - ace/ATM_QoS.i | 23 - ace/ATM_Stream.cpp | 231 - ace/ATM_Stream.h | 97 - ace/ATM_Stream.i | 124 - ace/Acceptor.cpp | 1172 - ace/Acceptor.h | 532 - ace/Acceptor.i | 4 - ace/Activation_Queue.cpp | 85 - ace/Activation_Queue.h | 98 - ace/Activation_Queue.i | 22 - ace/Active_Map_Manager.cpp | 10 - ace/Active_Map_Manager.h | 105 - ace/Active_Map_Manager.i | 87 - ace/Active_Map_Manager_T.cpp | 20 - ace/Active_Map_Manager_T.h | 196 - ace/Active_Map_Manager_T.i | 302 - ace/Addr.cpp | 64 - ace/Addr.h | 109 - ace/Addr.i | 69 - ace/Arg_Shifter.cpp | 183 - ace/Arg_Shifter.h | 167 - ace/Array.h | 32 - ace/Asynch_Acceptor.cpp | 480 - ace/Asynch_Acceptor.h | 187 - ace/Asynch_Acceptor.i | 5 - ace/Asynch_IO.cpp | 1030 - ace/Asynch_IO.h | 1117 - ace/Asynch_IO.i | 2 - ace/Asynch_IO_Impl.cpp | 69 - ace/Asynch_IO_Impl.h | 505 - ace/Asynch_IO_Impl.i | 87 - ace/Atomic_Op.i | 200 - ace/Auto_IncDec_T.cpp | 30 - ace/Auto_IncDec_T.h | 85 - ace/Auto_IncDec_T.i | 21 - ace/Auto_Ptr.cpp | 31 - ace/Auto_Ptr.h | 161 - ace/Auto_Ptr.i | 171 - ace/Based_Pointer_Repository.cpp | 123 - ace/Based_Pointer_Repository.h | 68 - ace/Based_Pointer_T.cpp | 113 - ace/Based_Pointer_T.h | 189 - ace/Based_Pointer_T.i | 136 - ace/Basic_Types.cpp | 24 - ace/Basic_Types.h | 540 - ace/Basic_Types.i | 476 - ace/CDR_Stream.cpp | 1062 - ace/CDR_Stream.h | 1150 - ace/CDR_Stream.i | 1528 - ace/CLASSIX/CLASSIX_Addr.cpp | 13 - ace/CLASSIX/CLASSIX_Addr.h | 99 - ace/CLASSIX/CLASSIX_Addr.i | 56 - ace/CLASSIX/CLASSIX_CLD_Connector.cpp | 116 - ace/CLASSIX/CLASSIX_CLD_Connector.h | 134 - ace/CLASSIX/CLASSIX_CLD_Connector.i | 24 - ace/CLASSIX/CLASSIX_CO_Acceptor.cpp | 199 - ace/CLASSIX/CLASSIX_CO_Acceptor.h | 146 - ace/CLASSIX/CLASSIX_CO_Acceptor.i | 31 - ace/CLASSIX/CLASSIX_CO_Connector.cpp | 118 - ace/CLASSIX/CLASSIX_CO_Connector.h | 118 - ace/CLASSIX/CLASSIX_CO_Connector.i | 36 - ace/CLASSIX/CLASSIX_Dgram_Mcast.cpp | 83 - ace/CLASSIX/CLASSIX_Dgram_Mcast.h | 94 - ace/CLASSIX/CLASSIX_Dgram_Mcast.i | 21 - ace/CLASSIX/CLASSIX_Group.cpp | 89 - ace/CLASSIX/CLASSIX_Group.h | 118 - ace/CLASSIX/CLASSIX_Group.i | 89 - ace/CLASSIX/CLASSIX_Group_Dynamic.cpp | 22 - ace/CLASSIX/CLASSIX_Group_Dynamic.h | 63 - ace/CLASSIX/CLASSIX_Group_Dynamic.i | 16 - ace/CLASSIX/CLASSIX_Group_Stamp.cpp | 52 - ace/CLASSIX/CLASSIX_Group_Stamp.h | 90 - ace/CLASSIX/CLASSIX_Group_Stamp.i | 32 - ace/CLASSIX/CLASSIX_OS.cpp | 117 - ace/CLASSIX/CLASSIX_OS.h | 134 - ace/CLASSIX/CLASSIX_OS.i | 56 - ace/CLASSIX/CLASSIX_Peer_SAP.cpp | 77 - ace/CLASSIX/CLASSIX_Peer_SAP.h | 108 - ace/CLASSIX/CLASSIX_Peer_SAP.i | 99 - ace/CLASSIX/CLASSIX_Port.cpp | 129 - ace/CLASSIX/CLASSIX_Port.h | 162 - ace/CLASSIX/CLASSIX_Port.i | 112 - ace/CLASSIX/CLASSIX_Port_Core.cpp | 70 - ace/CLASSIX/CLASSIX_Port_Core.h | 103 - ace/CLASSIX/CLASSIX_Port_Core.i | 38 - ace/CLASSIX/CLASSIX_Port_Default.cpp | 26 - ace/CLASSIX/CLASSIX_Port_Default.h | 80 - ace/CLASSIX/CLASSIX_Port_Default.i | 28 - ace/CLASSIX/CLASSIX_SAP.cpp | 153 - ace/CLASSIX/CLASSIX_SAP.h | 145 - ace/CLASSIX/CLASSIX_SAP.i | 58 - ace/CLASSIX/CLASSIX_Select_Reactor.cpp | 337 - ace/CLASSIX/CLASSIX_Select_Reactor.h | 209 - ace/CLASSIX/CLASSIX_Select_Reactor.i | 63 - ace/CLASSIX/CLASSIX_Stream.cpp | 362 - ace/CLASSIX/CLASSIX_Stream.h | 272 - ace/CLASSIX/CLASSIX_Stream.i | 182 - ace/CLASSIX/Makefile | 544 - ace/CORBA_Handler.cpp | 593 - ace/CORBA_Handler.h | 256 - ace/CORBA_Handler.i | 40 - ace/CORBA_Ref.cpp | 88 - ace/CORBA_Ref.h | 87 - ace/CORBA_Ref.i | 4 - ace/CORBA_macros.h | 413 - ace/Cache_Map_Manager_T.cpp | 420 - ace/Cache_Map_Manager_T.h | 399 - ace/Cache_Map_Manager_T.i | 273 - ace/Cached_Connect_Strategy_T.cpp | 546 - ace/Cached_Connect_Strategy_T.h | 194 - ace/Cached_Connect_Strategy_T.i | 3 - ace/Caching_Strategies_T.cpp | 56 - ace/Caching_Strategies_T.h | 529 - ace/Caching_Strategies_T.i | 448 - ace/Caching_Utility_T.cpp | 487 - ace/Caching_Utility_T.h | 313 - ace/Caching_Utility_T.i | 2 - ace/Capabilities.cpp | 365 - ace/Capabilities.h | 172 - ace/Capabilities.i | 47 - ace/Cleanup_Strategies_T.cpp | 93 - ace/Cleanup_Strategies_T.h | 145 - ace/Cleanup_Strategies_T.i | 2 - ace/Codeset_IBM1047.cpp | 284 - ace/Codeset_IBM1047.h | 115 - ace/Configuration.cpp | 1832 - ace/Configuration.h | 679 - ace/Configuration.i | 4 - ace/Connector.cpp | 934 - ace/Connector.h | 490 - ace/Connector.i | 4 - ace/Containers.cpp | 23 - ace/Containers.h | 73 - ace/Containers.i | 25 - ace/Containers_T.cpp | 2685 -- ace/Containers_T.h | 1845 - ace/Containers_T.i | 585 - ace/DEV.cpp | 37 - ace/DEV.h | 72 - ace/DEV.i | 15 - ace/DEV_Addr.cpp | 80 - ace/DEV_Addr.h | 84 - ace/DEV_Addr.i | 64 - ace/DEV_Connector.cpp | 43 - ace/DEV_Connector.h | 100 - ace/DEV_Connector.i | 32 - ace/DEV_IO.cpp | 125 - ace/DEV_IO.h | 129 - ace/DEV_IO.i | 101 - ace/DLL.cpp | 163 - ace/DLL.h | 108 - ace/Date_Time.cpp | 10 - ace/Date_Time.h | 99 - ace/Date_Time.i | 140 - ace/Dirent.cpp | 11 - ace/Dirent.h | 109 - ace/Dirent.i | 93 - ace/Dump.cpp | 135 - ace/Dump.h | 158 - ace/Dump_T.cpp | 41 - ace/Dump_T.h | 79 - ace/Dynamic.cpp | 30 - ace/Dynamic.h | 71 - ace/Dynamic.i | 32 - ace/Dynamic_Service.cpp | 51 - ace/Dynamic_Service.h | 50 - ace/Dynamic_Service.i | 4 - ace/Env_Value_T.cpp | 14 - ace/Env_Value_T.h | 158 - ace/Env_Value_T.i | 51 - ace/Event_Handler.cpp | 237 - ace/Event_Handler.h | 198 - ace/Event_Handler.i | 10 - ace/Event_Handler_T.cpp | 63 - ace/Event_Handler_T.h | 191 - ace/Event_Handler_T.i | 185 - ace/FIFO.cpp | 75 - ace/FIFO.h | 79 - ace/FIFO.i | 20 - ace/FIFO_Recv.cpp | 83 - ace/FIFO_Recv.h | 76 - ace/FIFO_Recv.i | 18 - ace/FIFO_Recv_Msg.cpp | 62 - ace/FIFO_Recv_Msg.h | 81 - ace/FIFO_Recv_Msg.i | 67 - ace/FIFO_Send.cpp | 54 - ace/FIFO_Send.h | 66 - ace/FIFO_Send.i | 18 - ace/FIFO_Send_Msg.cpp | 68 - ace/FIFO_Send_Msg.h | 80 - ace/FIFO_Send_Msg.i | 41 - ace/FILE.cpp | 151 - ace/FILE.h | 134 - ace/FILE.i | 16 - ace/FILE_Addr.cpp | 108 - ace/FILE_Addr.h | 85 - ace/FILE_Addr.i | 43 - ace/FILE_Connector.cpp | 58 - ace/FILE_Connector.h | 99 - ace/FILE_Connector.i | 33 - ace/FILE_IO.cpp | 132 - ace/FILE_IO.h | 142 - ace/FILE_IO.i | 133 - ace/Filecache.cpp | 773 - ace/Filecache.h | 353 - ace/FlReactor.cpp | 331 - ace/FlReactor.h | 115 - ace/FlReactor.i | 2 - ace/Free_List.cpp | 90 - ace/Free_List.h | 147 - ace/Free_List.i | 76 - ace/Functor.cpp | 48 - ace/Functor.h | 248 - ace/Functor.i | 152 - ace/Functor_T.cpp | 49 - ace/Functor_T.h | 145 - ace/Functor_T.i | 28 - ace/Future.cpp | 425 - ace/Future.h | 328 - ace/Future_Set.cpp | 137 - ace/Future_Set.h | 120 - ace/Get_Opt.cpp | 162 - ace/Get_Opt.h | 137 - ace/Get_Opt.i | 9 - ace/Handle_Gobbler.h | 65 - ace/Handle_Gobbler.i | 81 - ace/Handle_Set.cpp | 460 - ace/Handle_Set.h | 216 - ace/Handle_Set.i | 174 - ace/Hash_Cache_Map_Manager_T.cpp | 230 - ace/Hash_Cache_Map_Manager_T.h | 199 - ace/Hash_Cache_Map_Manager_T.i | 68 - ace/Hash_Map_Manager.cpp | 23 - ace/Hash_Map_Manager.h | 36 - ace/Hash_Map_Manager.i | 2 - ace/Hash_Map_Manager_T.cpp | 443 - ace/Hash_Map_Manager_T.h | 721 - ace/Hash_Map_Manager_T.i | 777 - ace/Hash_Map_With_Allocator_T.cpp | 32 - ace/Hash_Map_With_Allocator_T.h | 105 - ace/Hash_Map_With_Allocator_T.i | 73 - ace/High_Res_Timer.cpp | 476 - ace/High_Res_Timer.h | 231 - ace/High_Res_Timer.i | 111 - ace/INET_Addr.cpp | 528 - ace/INET_Addr.h | 206 - ace/INET_Addr.i | 53 - ace/IOStream.cpp | 658 - ace/IOStream.h | 499 - ace/IOStream_T.cpp | 210 - ace/IOStream_T.h | 281 - ace/IOStream_T.i | 160 - ace/IO_Cntl_Msg.cpp | 38 - ace/IO_Cntl_Msg.h | 87 - ace/IO_Cntl_Msg.i | 4 - ace/IO_SAP.cpp | 141 - ace/IO_SAP.h | 85 - ace/IO_SAP.i | 39 - ace/IPC_SAP.cpp | 181 - ace/IPC_SAP.h | 81 - ace/IPC_SAP.i | 37 - ace/LOCK_SOCK_Acceptor.cpp | 33 - ace/LOCK_SOCK_Acceptor.h | 63 - ace/LSOCK.cpp | 168 - ace/LSOCK.h | 77 - ace/LSOCK.i | 39 - ace/LSOCK_Acceptor.cpp | 138 - ace/LSOCK_Acceptor.h | 94 - ace/LSOCK_Acceptor.i | 4 - ace/LSOCK_CODgram.cpp | 55 - ace/LSOCK_CODgram.h | 73 - ace/LSOCK_CODgram.i | 27 - ace/LSOCK_Connector.cpp | 57 - ace/LSOCK_Connector.h | 105 - ace/LSOCK_Connector.i | 29 - ace/LSOCK_Dgram.cpp | 64 - ace/LSOCK_Dgram.h | 70 - ace/LSOCK_Dgram.i | 20 - ace/LSOCK_Stream.cpp | 131 - ace/LSOCK_Stream.h | 77 - ace/LSOCK_Stream.i | 25 - ace/Local_Name_Space.cpp | 215 - ace/Local_Name_Space.h | 122 - ace/Local_Name_Space_T.cpp | 912 - ace/Local_Name_Space_T.h | 254 - ace/Local_Tokens.cpp | 1439 - ace/Local_Tokens.h | 1041 - ace/Local_Tokens.i | 433 - ace/Log_Msg.cpp | 1750 - ace/Log_Msg.h | 541 - ace/Log_Msg.i | 6 - ace/Log_Priority.h | 79 - ace/Log_Record.cpp | 259 - ace/Log_Record.h | 194 - ace/Log_Record.i | 96 - ace/MEM_Acceptor.cpp | 203 - ace/MEM_Acceptor.h | 158 - ace/MEM_Acceptor.i | 70 - ace/MEM_Addr.cpp | 142 - ace/MEM_Addr.h | 145 - ace/MEM_Addr.i | 117 - ace/MEM_Connector.cpp | 104 - ace/MEM_Connector.h | 111 - ace/MEM_Connector.i | 12 - ace/MEM_IO.cpp | 202 - ace/MEM_IO.h | 163 - ace/MEM_IO.i | 168 - ace/MEM_SAP.cpp | 79 - ace/MEM_SAP.h | 101 - ace/MEM_SAP.i | 91 - ace/MEM_Stream.cpp | 34 - ace/MEM_Stream.h | 128 - ace/MEM_Stream.i | 176 - ace/Makefile | 11228 ------ ace/Makefile.am | 926 - ace/Makefile.bor | 194 - ace/Malloc.cpp | 458 - ace/Malloc.h | 505 - ace/Malloc.i | 268 - ace/Malloc_Base.h | 136 - ace/Malloc_T.cpp | 898 - ace/Malloc_T.h | 618 - ace/Malloc_T.i | 252 - ace/Managed_Object.cpp | 23 - ace/Managed_Object.h | 160 - ace/Managed_Object.i | 18 - ace/Map.cpp | 23 - ace/Map.h | 35 - ace/Map.i | 2 - ace/Map_Manager.cpp | 614 - ace/Map_Manager.h | 553 - ace/Map_Manager.i | 532 - ace/Map_T.cpp | 18 - ace/Map_T.h | 1439 - ace/Map_T.i | 1601 - ace/Mem_Map.cpp | 322 - ace/Mem_Map.h | 209 - ace/Mem_Map.i | 251 - ace/Memory_Pool.cpp | 1308 - ace/Memory_Pool.h | 675 - ace/Memory_Pool.i | 242 - ace/Message_Block.cpp | 1183 - ace/Message_Block.h | 843 - ace/Message_Block.i | 607 - ace/Message_Block_T.cpp | 47 - ace/Message_Block_T.h | 83 - ace/Message_Block_T.i | 29 - ace/Message_Queue.cpp | 442 - ace/Message_Queue.h | 476 - ace/Message_Queue.i | 204 - ace/Message_Queue_T.cpp | 1663 - ace/Message_Queue_T.h | 709 - ace/Message_Queue_T.i | 163 - ace/Method_Object.h | 37 - ace/Method_Request.cpp | 27 - ace/Method_Request.h | 63 - ace/Min_Max.h | 77 - ace/Module.cpp | 266 - ace/Module.h | 195 - ace/Module.i | 62 - ace/Msg_WFMO_Reactor.cpp | 90 - ace/Msg_WFMO_Reactor.h | 109 - ace/Msg_WFMO_Reactor.i | 30 - ace/Multiplexor.cpp | 14 - ace/Multiplexor.h | 83 - ace/Multiplexor.i | 88 - ace/NT_Service.cpp | 502 - ace/NT_Service.h | 377 - ace/NT_Service.i | 79 - ace/Name_Proxy.cpp | 200 - ace/Name_Proxy.h | 90 - ace/Name_Request_Reply.cpp | 555 - ace/Name_Request_Reply.h | 255 - ace/Name_Space.cpp | 62 - ace/Name_Space.h | 151 - ace/Naming_Context.cpp | 685 - ace/Naming_Context.h | 335 - ace/OS.cpp | 7129 ---- ace/OS.h | 8035 ---- ace/OS.i | 12532 ------- ace/Object_Manager.cpp | 870 - ace/Object_Manager.h | 436 - ace/Object_Manager.i | 35 - ace/Obstack.cpp | 136 - ace/Obstack.h | 112 - ace/Obstack.i | 9 - ace/POSIX_Asynch_IO.cpp | 3381 -- ace/POSIX_Asynch_IO.h | 1655 - ace/POSIX_Asynch_IO.i | 2 - ace/POSIX_Proactor.cpp | 1264 - ace/POSIX_Proactor.h | 433 - ace/POSIX_Proactor.i | 2 - ace/Pair.cpp | 23 - ace/Pair.h | 35 - ace/Pair.i | 2 - ace/Pair_T.cpp | 18 - ace/Pair_T.h | 110 - ace/Pair_T.i | 72 - ace/Parse_Node.cpp | 710 - ace/Parse_Node.h | 301 - ace/Parse_Node.i | 19 - ace/Pipe.cpp | 212 - ace/Pipe.h | 83 - ace/Pipe.i | 25 - ace/Priority_Reactor.cpp | 175 - ace/Priority_Reactor.h | 95 - ace/Priority_Reactor.i | 2 - ace/Proactor.cpp | 1041 - ace/Proactor.h | 475 - ace/Proactor.i | 2 - ace/Proactor_Impl.h | 200 - ace/Process.cpp | 712 - ace/Process.h | 440 - ace/Process.i | 359 - ace/Process_Manager.cpp | 955 - ace/Process_Manager.h | 390 - ace/Process_Manager.i | 8 - ace/Profile_Timer.cpp | 409 - ace/Profile_Timer.h | 132 - ace/Profile_Timer.i | 104 - ace/QoS_Manager.cpp | 46 - ace/QoS_Manager.h | 69 - ace/QoS_Session.h | 135 - ace/QoS_Session_Factory.cpp | 96 - ace/QoS_Session_Factory.h | 90 - ace/QoS_Session_Impl.cpp | 543 - ace/QoS_Session_Impl.h | 206 - ace/QoS_Session_Impl.i | 149 - ace/QtReactor.cpp | 430 - ace/QtReactor.h | 152 - ace/RB_Tree.cpp | 932 - ace/RB_Tree.h | 710 - ace/RB_Tree.i | 1153 - ace/README | 1502 - ace/Reactor.cpp | 258 - ace/Reactor.h | 563 - ace/Reactor.i | 634 - ace/Reactor_Impl.h | 465 - ace/Read_Buffer.cpp | 163 - ace/Read_Buffer.h | 113 - ace/Read_Buffer.i | 28 - ace/Registry.cpp | 1126 - ace/Registry.h | 524 - ace/Registry_Name_Space.cpp | 254 - ace/Registry_Name_Space.h | 127 - ace/Remote_Name_Space.cpp | 332 - ace/Remote_Name_Space.h | 130 - ace/Remote_Tokens.cpp | 435 - ace/Remote_Tokens.h | 293 - ace/Remote_Tokens.i | 96 - ace/SOCK.cpp | 179 - ace/SOCK.h | 125 - ace/SOCK.i | 34 - ace/SOCK_Acceptor.cpp | 343 - ace/SOCK_Acceptor.h | 160 - ace/SOCK_Acceptor.i | 12 - ace/SOCK_CODgram.cpp | 105 - ace/SOCK_CODgram.h | 69 - ace/SOCK_CODgram.i | 18 - ace/SOCK_Connector.cpp | 315 - ace/SOCK_Connector.h | 210 - ace/SOCK_Connector.i | 36 - ace/SOCK_Dgram.cpp | 450 - ace/SOCK_Dgram.h | 201 - ace/SOCK_Dgram.i | 158 - ace/SOCK_Dgram_Bcast.cpp | 323 - ace/SOCK_Dgram_Bcast.h | 127 - ace/SOCK_Dgram_Bcast.i | 34 - ace/SOCK_Dgram_Mcast.cpp | 400 - ace/SOCK_Dgram_Mcast.h | 186 - ace/SOCK_Dgram_Mcast.i | 78 - ace/SOCK_Dgram_Mcast_QoS.cpp | 280 - ace/SOCK_Dgram_Mcast_QoS.h | 131 - ace/SOCK_Dgram_Mcast_QoS.i | 47 - ace/SOCK_IO.cpp | 157 - ace/SOCK_IO.h | 147 - ace/SOCK_IO.i | 149 - ace/SOCK_Stream.cpp | 35 - ace/SOCK_Stream.h | 142 - ace/SOCK_Stream.i | 159 - ace/SPIPE.cpp | 63 - ace/SPIPE.h | 69 - ace/SPIPE.i | 16 - ace/SPIPE_Acceptor.cpp | 261 - ace/SPIPE_Acceptor.h | 90 - ace/SPIPE_Acceptor.i | 4 - ace/SPIPE_Addr.cpp | 142 - ace/SPIPE_Addr.h | 115 - ace/SPIPE_Addr.i | 74 - ace/SPIPE_Connector.cpp | 75 - ace/SPIPE_Connector.h | 102 - ace/SPIPE_Connector.i | 13 - ace/SPIPE_Stream.cpp | 98 - ace/SPIPE_Stream.h | 143 - ace/SPIPE_Stream.i | 198 - ace/SSL/ACE_SSL.dsp | 166 - ace/SSL/SSL_Context.cpp | 342 - ace/SSL/SSL_Context.h | 221 - ace/SSL/SSL_Context.i | 87 - ace/SSL/SSL_Context.inl | 87 - ace/SSL/SSL_Export.h | 36 - ace/SSL/SSL_SOCK.cpp | 72 - ace/SSL/SSL_SOCK.h | 92 - ace/SSL/SSL_SOCK.i | 64 - ace/SSL/SSL_SOCK_Acceptor.cpp | 226 - ace/SSL/SSL_SOCK_Acceptor.h | 136 - ace/SSL/SSL_SOCK_Acceptor.i | 82 - ace/SSL/SSL_SOCK_Connector.cpp | 300 - ace/SSL/SSL_SOCK_Connector.h | 203 - ace/SSL/SSL_SOCK_Connector.i | 34 - ace/SSL/SSL_SOCK_Stream.cpp | 482 - ace/SSL/SSL_SOCK_Stream.h | 252 - ace/SSL/SSL_SOCK_Stream.i | 272 - ace/SSL/sslconf.h | 37 - ace/SString.cpp | 984 - ace/SString.h | 659 - ace/SString.i | 757 - ace/SV_Message.cpp | 19 - ace/SV_Message.h | 56 - ace/SV_Message.i | 31 - ace/SV_Message_Queue.cpp | 38 - ace/SV_Message_Queue.h | 96 - ace/SV_Message_Queue.i | 78 - ace/SV_Semaphore_Complex.cpp | 253 - ace/SV_Semaphore_Complex.h | 157 - ace/SV_Semaphore_Complex.i | 83 - ace/SV_Semaphore_Simple.cpp | 203 - ace/SV_Semaphore_Simple.h | 153 - ace/SV_Semaphore_Simple.i | 106 - ace/SV_Shared_Memory.cpp | 82 - ace/SV_Shared_Memory.h | 113 - ace/SV_Shared_Memory.i | 114 - ace/Sched_Params.cpp | 277 - ace/Sched_Params.h | 220 - ace/Sched_Params.i | 136 - ace/Select_Reactor.cpp | 44 - ace/Select_Reactor.h | 73 - ace/Select_Reactor.i | 2 - ace/Select_Reactor_Base.cpp | 944 - ace/Select_Reactor_Base.h | 444 - ace/Select_Reactor_Base.i | 83 - ace/Select_Reactor_T.cpp | 1365 - ace/Select_Reactor_T.h | 671 - ace/Select_Reactor_T.i | 239 - ace/Service_Config.cpp | 894 - ace/Service_Config.h | 452 - ace/Service_Config.i | 93 - ace/Service_Manager.cpp | 315 - ace/Service_Manager.h | 108 - ace/Service_Manager.i | 10 - ace/Service_Object.cpp | 98 - ace/Service_Object.h | 161 - ace/Service_Object.i | 87 - ace/Service_Repository.cpp | 413 - ace/Service_Repository.h | 199 - ace/Service_Repository.i | 31 - ace/Service_Types.cpp | 453 - ace/Service_Types.h | 189 - ace/Service_Types.i | 64 - ace/Shared_Memory.cpp | 9 - ace/Shared_Memory.h | 51 - ace/Shared_Memory_MM.cpp | 52 - ace/Shared_Memory_MM.h | 117 - ace/Shared_Memory_MM.i | 89 - ace/Shared_Memory_SV.cpp | 30 - ace/Shared_Memory_SV.h | 98 - ace/Shared_Memory_SV.i | 73 - ace/Shared_Object.cpp | 46 - ace/Shared_Object.h | 53 - ace/Shared_Object.i | 9 - ace/Signal.cpp | 862 - ace/Signal.h | 458 - ace/Signal.i | 302 - ace/Singleton.cpp | 384 - ace/Singleton.h | 248 - ace/Singleton.i | 27 - ace/Stats.cpp | 660 - ace/Stats.h | 246 - ace/Stats.i | 95 - ace/Strategies.cpp | 88 - ace/Strategies.h | 195 - ace/Strategies.i | 95 - ace/Strategies_T.cpp | 1206 - ace/Strategies_T.h | 914 - ace/Strategies_T.i | 447 - ace/Stream.cpp | 512 - ace/Stream.h | 213 - ace/Stream.i | 49 - ace/Stream_Modules.cpp | 373 - ace/Stream_Modules.h | 142 - ace/Stream_Modules.i | 4 - ace/Svc_Conf.h | 112 - ace/Svc_Conf.l | 114 - ace/Svc_Conf.y | 458 - ace/Svc_Conf_Tokens.h | 29 - ace/Svc_Conf_l.cpp | 1839 - ace/Svc_Conf_y.cpp | 1041 - ace/Svc_Handler.cpp | 533 - ace/Svc_Handler.h | 285 - ace/Svc_Handler.i | 5 - ace/Synch.cpp | 1049 - ace/Synch.h | 1703 - ace/Synch.i | 1109 - ace/Synch_Options.cpp | 105 - ace/Synch_Options.h | 149 - ace/Synch_Options.i | 9 - ace/Synch_T.cpp | 960 - ace/Synch_T.h | 968 - ace/Synch_T.i | 414 - ace/System_Time.cpp | 141 - ace/System_Time.h | 84 - ace/TLI.cpp | 189 - ace/TLI.h | 105 - ace/TLI.i | 41 - ace/TLI_Acceptor.cpp | 522 - ace/TLI_Acceptor.h | 120 - ace/TLI_Acceptor.i | 5 - ace/TLI_Connector.cpp | 232 - ace/TLI_Connector.h | 117 - ace/TLI_Connector.i | 44 - ace/TLI_Stream.cpp | 100 - ace/TLI_Stream.h | 127 - ace/TLI_Stream.i | 139 - ace/TP_Reactor.cpp | 278 - ace/TP_Reactor.h | 206 - ace/TP_Reactor.i | 39 - ace/TTY_IO.cpp | 286 - ace/TTY_IO.h | 75 - ace/Task.cpp | 227 - ace/Task.h | 245 - ace/Task.i | 114 - ace/Task_T.cpp | 105 - ace/Task_T.h | 167 - ace/Task_T.i | 103 - ace/Template_Instantiations.cpp | 365 - ace/Thread.cpp | 90 - ace/Thread.h | 228 - ace/Thread.i | 272 - ace/Thread_Manager.cpp | 2415 -- ace/Thread_Manager.h | 911 - ace/Thread_Manager.i | 370 - ace/Time_Request_Reply.cpp | 187 - ace/Time_Request_Reply.h | 125 - ace/Time_Value.h | 31 - ace/Timeprobe.cpp | 44 - ace/Timeprobe.h | 182 - ace/Timeprobe.i | 8 - ace/Timeprobe_T.cpp | 300 - ace/Timeprobe_T.h | 175 - ace/Timer_Hash.cpp | 123 - ace/Timer_Hash.h | 74 - ace/Timer_Hash_T.cpp | 609 - ace/Timer_Hash_T.h | 264 - ace/Timer_Heap.cpp | 43 - ace/Timer_Heap.h | 41 - ace/Timer_Heap_T.cpp | 732 - ace/Timer_Heap_T.h | 285 - ace/Timer_List.cpp | 44 - ace/Timer_List.h | 41 - ace/Timer_List_T.cpp | 341 - ace/Timer_List_T.h | 205 - ace/Timer_Queue.cpp | 58 - ace/Timer_Queue.h | 46 - ace/Timer_Queue.i | 22 - ace/Timer_Queue_Adapters.cpp | 309 - ace/Timer_Queue_Adapters.h | 216 - ace/Timer_Queue_Adapters.i | 37 - ace/Timer_Queue_T.cpp | 320 - ace/Timer_Queue_T.h | 393 - ace/Timer_Queue_T.i | 171 - ace/Timer_Wheel.cpp | 23 - ace/Timer_Wheel.h | 42 - ace/Timer_Wheel_T.cpp | 668 - ace/Timer_Wheel_T.h | 229 - ace/TkReactor.cpp | 435 - ace/TkReactor.h | 127 - ace/Token.cpp | 571 - ace/Token.h | 293 - ace/Token.i | 116 - ace/Token_Collection.cpp | 302 - ace/Token_Collection.h | 220 - ace/Token_Collection.i | 10 - ace/Token_Invariants.cpp | 369 - ace/Token_Invariants.h | 225 - ace/Token_Invariants.i | 4 - ace/Token_Manager.cpp | 277 - ace/Token_Manager.h | 127 - ace/Token_Manager.i | 19 - ace/Token_Request_Reply.cpp | 175 - ace/Token_Request_Reply.h | 235 - ace/Token_Request_Reply.i | 195 - ace/Trace.cpp | 121 - ace/Trace.h | 86 - ace/Trace.i | 7 - ace/Typed_SV_Message.cpp | 26 - ace/Typed_SV_Message.h | 94 - ace/Typed_SV_Message.i | 91 - ace/Typed_SV_Message_Queue.cpp | 52 - ace/Typed_SV_Message_Queue.h | 85 - ace/Typed_SV_Message_Queue.i | 71 - ace/UNIX_Addr.cpp | 114 - ace/UNIX_Addr.h | 97 - ace/UNIX_Addr.i | 67 - ace/UPIPE_Acceptor.cpp | 122 - ace/UPIPE_Acceptor.h | 91 - ace/UPIPE_Acceptor.i | 11 - ace/UPIPE_Addr.h | 46 - ace/UPIPE_Connector.cpp | 91 - ace/UPIPE_Connector.h | 108 - ace/UPIPE_Connector.i | 33 - ace/UPIPE_Stream.cpp | 227 - ace/UPIPE_Stream.h | 136 - ace/UPIPE_Stream.i | 12 - ace/Version.h | 7 - ace/WFMO_Reactor.cpp | 2247 -- ace/WFMO_Reactor.h | 1169 - ace/WFMO_Reactor.i | 1126 - ace/WIN32_Asynch_IO.cpp | 1699 - ace/WIN32_Asynch_IO.h | 1214 - ace/WIN32_Asynch_IO.i | 2 - ace/WIN32_Proactor.cpp | 607 - ace/WIN32_Proactor.h | 268 - ace/WIN32_Proactor.i | 2 - ace/XTI_ATM_Mcast.cpp | 66 - ace/XTI_ATM_Mcast.h | 123 - ace/XTI_ATM_Mcast.i | 62 - ace/XtReactor.cpp | 450 - ace/XtReactor.h | 133 - ace/ace-dll.icc | 466 - ace/ace-lib.icc | 272 - ace/ace.dsw | 41 - ace/ace.icc | 183 - ace/ace.rc | 30 - ace/ace_ce.dsw | 29 - ace/ace_ce_dll.cfg | 1 - ace/ace_dll.dsp | 6737 ---- ace/ace_dll_ce.dsp | 36422 ------------------- ace/ace_lib.dsp | 5560 --- ace/ace_wchar.h | 281 - ace/config-WinCE.h | 200 - ace/config-aix-3.2.5.h | 48 - ace/config-aix-4.1.x.h | 11 - ace/config-aix-4.2.x.h | 11 - ace/config-aix-4.3.x.h | 11 - ace/config-aix-4.x.h | 271 - ace/config-all.h | 295 - ace/config-chorus.h | 146 - ace/config-cray.h | 242 - ace/config-cxx-common.h | 82 - ace/config-cygwin32-common.h | 175 - ace/config-cygwin32.h | 16 - ace/config-dgux-4.11-epc.h | 195 - ace/config-dgux-4.x-ghs.h | 214 - ace/config-freebsd-pthread.h | 207 - ace/config-freebsd.h | 197 - ace/config-fsu-pthread.h | 59 - ace/config-g++-common.h | 100 - ace/config-ghs-common.h | 44 - ace/config-hpux-10.x-g++.h | 28 - ace/config-hpux-10.x-hpc++.h | 124 - ace/config-hpux-10.x.h | 252 - ace/config-hpux-11.00.h | 399 - ace/config-hpux-11.x-hpc++.h | 7 - ace/config-hpux-9.x-orbix.h | 106 - ace/config-hpux-9.x.h | 105 - ace/config-hpux11.h | 257 - ace/config-irix5.2.h | 69 - ace/config-irix5.3-g++.h | 120 - ace/config-irix5.3-sgic++.h | 123 - ace/config-irix6.x-common.h | 168 - ace/config-irix6.x-g++.h | 54 - ace/config-irix6.x-kcc.h | 59 - ace/config-irix6.x-sgic++-nothreads.h | 96 - ace/config-irix6.x-sgic++.h | 54 - ace/config-kcc-common.h | 75 - ace/config-linux-common.h | 239 - ace/config-linux-lxpthreads.h | 74 - ace/config-linux-pthread.h | 33 - ace/config-linux.h | 17 - ace/config-lynxos.h | 174 - ace/config-m88k.h | 227 - ace/config-minimal.h | 39 - ace/config-mit-pthread.h | 53 - ace/config-mklinux.h | 20 - ace/config-mvs.h | 118 - ace/config-netbsd.h | 179 - ace/config-osf1-3.2.h | 188 - ace/config-osf1-4.0.h | 184 - ace/config-pharlap.h | 62 - ace/config-psos-diab-mips.h | 246 - ace/config-psos-diab-ppc.h | 277 - ace/config-psos-diab.h | 237 - ace/config-psos-tm.h | 210 - ace/config-psosim-g++.h | 246 - ace/config-qnx-neutrino.h | 148 - ace/config-sco-4.2-nothread.h | 116 - ace/config-sco-5.0.0-fsu-pthread.h | 15 - ace/config-sco-5.0.0-mit-pthread.h | 178 - ace/config-sco-5.0.0-nothread.h | 14 - ace/config-sco-5.0.0.h | 110 - ace/config-sunos4-g++.h | 115 - ace/config-sunos4-lucid3.2.h | 105 - ace/config-sunos4-sun3.x.h | 97 - ace/config-sunos4-sun4.1.4.h | 109 - ace/config-sunos4-sun4.x-orbix.h | 108 - ace/config-sunos4-sun4.x.h | 106 - ace/config-sunos5.4-centerline-2.x.h | 175 - ace/config-sunos5.4-g++.h | 191 - ace/config-sunos5.4-sunc++-4.x-orbix.h | 199 - ace/config-sunos5.4-sunc++-4.x.h | 204 - ace/config-sunos5.5.h | 363 - ace/config-sunos5.6.h | 38 - ace/config-sunos5.7.h | 76 - ace/config-sunos5.x-sunc++-4.x-orbix.h | 32 - ace/config-tandem.h | 453 - ace/config-tru64.h | 25 - ace/config-unixware-2.01-g++.h | 113 - ace/config-unixware-2.1.2-g++.h | 102 - ace/config-visualage.h | 20 - ace/config-vxworks5.x.h | 184 - ace/config-win32-borland.h | 77 - ace/config-win32-common.h | 471 - ace/config-win32-msvc.h | 208 - ace/config-win32-visualage.h | 82 - ace/config-win32.h | 27 - ace/gethrtime.cpp | 58 - ace/iosfwd.h | 78 - ace/makefile-light | 883 - ace/post.h | 27 - ace/pre.h | 29 - ace/streams.h | 135 - ace/svc_export.h | 40 - ace/ws2tcpip.h | 90 - aceConf.sh.in | 8 - .../Gateway/Concrete_Connection_Handlers.cpp | 718 - .../Gateway/Gateway/Concrete_Connection_Handlers.h | 127 - apps/Gateway/Gateway/Concurrency_Strategies.h | 74 - apps/Gateway/Gateway/Config_Files.cpp | 222 - apps/Gateway/Gateway/Config_Files.h | 98 - apps/Gateway/Gateway/Connection_Handler.cpp | 289 - apps/Gateway/Gateway/Connection_Handler.h | 157 - .../Gateway/Connection_Handler_Acceptor.cpp | 62 - apps/Gateway/Gateway/Connection_Handler_Acceptor.h | 65 - .../Gateway/Connection_Handler_Connector.cpp | 76 - .../Gateway/Gateway/Connection_Handler_Connector.h | 44 - apps/Gateway/Gateway/Consumer_Dispatch_Set.h | 32 - apps/Gateway/Gateway/Event.h | 223 - apps/Gateway/Gateway/Event_Channel.cpp | 548 - apps/Gateway/Gateway/Event_Channel.h | 129 - .../Gateway/Event_Forwarding_Discriminator.cpp | 61 - .../Gateway/Event_Forwarding_Discriminator.h | 65 - apps/Gateway/Gateway/File_Parser.cpp | 164 - apps/Gateway/Gateway/File_Parser.h | 93 - apps/Gateway/Gateway/Gateway.cpp | 342 - apps/Gateway/Gateway/Gateway.dsp | 96 - apps/Gateway/Gateway/Gateway.dsw | 44 - apps/Gateway/Gateway/Gateway.h | 33 - apps/Gateway/Gateway/Makefile | 1224 - apps/Gateway/Gateway/Makefile.bor | 15 - apps/Gateway/Gateway/Options.cpp | 260 - apps/Gateway/Gateway/Options.h | 193 - apps/Gateway/Gateway/Peer_Message.h | 89 - apps/Gateway/Gateway/connection_config | 55 - apps/Gateway/Gateway/consumer_config | 35 - apps/Gateway/Gateway/gatewayd.cpp | 63 - apps/Gateway/Gateway/gatewayd.dsp | 57 - apps/Gateway/Gateway/svc.conf | 3 - apps/Gateway/Makefile | 26 - apps/Gateway/Makefile.bor | 3 - apps/Gateway/Peer/Makefile | 236 - apps/Gateway/Peer/Makefile.bor | 8 - apps/Gateway/Peer/Options.cpp | 192 - apps/Gateway/Peer/Options.h | 133 - apps/Gateway/Peer/Peer.cpp | 866 - apps/Gateway/Peer/Peer.dsp | 64 - apps/Gateway/Peer/Peer.dsw | 44 - apps/Gateway/Peer/Peer.h | 238 - apps/Gateway/Peer/peerd.cpp | 62 - apps/Gateway/Peer/peerd.dsp | 57 - apps/Gateway/Peer/svc.conf | 2 - apps/Gateway/README | 140 - apps/JAWS/ChangeLog | 773 - apps/JAWS/Makefile | 25 - apps/JAWS/Makefile.bor | 3 - apps/JAWS/README | 15 - apps/JAWS/clients/Blobby/Blob.cpp | 94 - apps/JAWS/clients/Blobby/Blob.h | 87 - apps/JAWS/clients/Blobby/Blob_Handler.cpp | 343 - apps/JAWS/clients/Blobby/Blob_Handler.h | 115 - apps/JAWS/clients/Blobby/Makefile | 512 - apps/JAWS/clients/Blobby/Makefile.bor | 10 - apps/JAWS/clients/Blobby/Options.cpp | 81 - apps/JAWS/clients/Blobby/Options.h | 71 - apps/JAWS/clients/Blobby/README | 33 - apps/JAWS/clients/Blobby/blobby.cpp | 98 - apps/JAWS/clients/Caching/Caching.dsp | 111 - apps/JAWS/clients/Caching/Caching.dsw | 29 - apps/JAWS/clients/Caching/ID_Generator.cpp | 61 - apps/JAWS/clients/Caching/ID_Generator.h | 62 - apps/JAWS/clients/Caching/Local_Locator.cpp | 257 - apps/JAWS/clients/Caching/Local_Locator.h | 118 - apps/JAWS/clients/Caching/Local_Locator.i | 44 - .../JAWS/clients/Caching/Locator_Request_Reply.cpp | 459 - apps/JAWS/clients/Caching/Locator_Request_Reply.h | 220 - apps/JAWS/clients/Caching/Locator_Request_Reply.i | 138 - apps/JAWS/clients/Caching/Makefile | 209 - apps/JAWS/clients/Caching/Makefile.bor | 6 - apps/JAWS/clients/Caching/README | 83 - apps/JAWS/clients/Caching/URL_Array_Helper.cpp | 43 - apps/JAWS/clients/Caching/URL_Array_Helper.h | 40 - apps/JAWS/clients/Caching/URL_Locator.cpp | 56 - apps/JAWS/clients/Caching/URL_Locator.h | 116 - apps/JAWS/clients/Caching/URL_Locator.i | 4 - apps/JAWS/clients/Caching/URL_Properties.cpp | 163 - apps/JAWS/clients/Caching/URL_Properties.h | 201 - apps/JAWS/clients/Caching/URL_Properties.i | 203 - apps/JAWS/clients/Caching/http_client.cpp | 70 - apps/JAWS/clients/Caching/http_handler.cpp | 255 - apps/JAWS/clients/Caching/http_handler.h | 81 - apps/JAWS/clients/Caching/test_URL.cpp | 35 - apps/JAWS/clients/Caching/testing.dsp | 121 - apps/JAWS/clients/Makefile | 26 - apps/JAWS/clients/Makefile.bor | 3 - apps/JAWS/clients/README | 13 - apps/JAWS/clients/WebSTONE/COPYING | 348 - apps/JAWS/clients/WebSTONE/README | 245 - apps/JAWS/clients/WebSTONE/README.DynamicWorkload | 37 - apps/JAWS/clients/WebSTONE/README.FIRST | 21 - apps/JAWS/clients/WebSTONE/WEBSTONE-VERSION-2.0 | 0 apps/JAWS/clients/WebSTONE/bin/WebStone-common.pl | 61 - apps/JAWS/clients/WebSTONE/bin/WebStone-manage.pl | 31 - apps/JAWS/clients/WebSTONE/bin/WebStone-run.pl | 37 - apps/JAWS/clients/WebSTONE/bin/WebStone-setup.pl | 95 - apps/JAWS/clients/WebSTONE/bin/checkfilelist | 35 - apps/JAWS/clients/WebSTONE/bin/genfiles | 41 - .../clients/WebSTONE/bin/genfiles-from-filelist.sh | 41 - apps/JAWS/clients/WebSTONE/bin/gui-configure | 174 - apps/JAWS/clients/WebSTONE/bin/killbench | 13 - apps/JAWS/clients/WebSTONE/bin/killbench.pl | 15 - apps/JAWS/clients/WebSTONE/bin/mine-logs.pl | 88 - apps/JAWS/clients/WebSTONE/bin/move-filelist.pl | 26 - apps/JAWS/clients/WebSTONE/bin/move-runs.pl | 24 - apps/JAWS/clients/WebSTONE/bin/rebootall | 9 - apps/JAWS/clients/WebSTONE/bin/runbench | 193 - apps/JAWS/clients/WebSTONE/bin/runbench.pl | 36 - apps/JAWS/clients/WebSTONE/bin/tabs2html | 13 - apps/JAWS/clients/WebSTONE/bin/view-results.pl | 53 - apps/JAWS/clients/WebSTONE/bin/webstone-gui.pl | 316 - apps/JAWS/clients/WebSTONE/bin/write-testbed.pl | 47 - apps/JAWS/clients/WebSTONE/bin/wscollect.pl | 139 - apps/JAWS/clients/WebSTONE/conf/filelist | 6 - apps/JAWS/clients/WebSTONE/conf/filelist.cgi-heavy | 6 - .../clients/WebSTONE/conf/filelist.dynamic-heavy | 6 - .../clients/WebSTONE/conf/filelist.dynamic-light | 6 - .../clients/WebSTONE/conf/filelist.dynamic-medium | 6 - apps/JAWS/clients/WebSTONE/conf/filelist.homepage | 2 - apps/JAWS/clients/WebSTONE/conf/filelist.sample | 6 - apps/JAWS/clients/WebSTONE/conf/filelist.standard | 6 - apps/JAWS/clients/WebSTONE/conf/fileset | 32 - apps/JAWS/clients/WebSTONE/conf/paths.pl | 2 - apps/JAWS/clients/WebSTONE/conf/paths.sh | 0 apps/JAWS/clients/WebSTONE/conf/testbed | 33 - apps/JAWS/clients/WebSTONE/doc/COPYING | 348 - apps/JAWS/clients/WebSTONE/doc/FAQ-webstone.html | 402 - apps/JAWS/clients/WebSTONE/doc/LICENSE.html | 16 - apps/JAWS/clients/WebSTONE/doc/WebStone.html | 24 - apps/JAWS/clients/WebSTONE/doc/testbed.help | 21 - .../clients/WebSTONE/doc/webstone-white-paper.ps | 8974 ----- apps/JAWS/clients/WebSTONE/doc/webstone.gif | Bin 14656 -> 0 bytes apps/JAWS/clients/WebSTONE/doc/webstone2.html | 72 - apps/JAWS/clients/WebSTONE/src/Makefile | 112 - apps/JAWS/clients/WebSTONE/src/README | 232 - apps/JAWS/clients/WebSTONE/src/acconfig.h | 15 - apps/JAWS/clients/WebSTONE/src/bench.c | 632 - apps/JAWS/clients/WebSTONE/src/bench.h | 273 - apps/JAWS/clients/WebSTONE/src/cgi-send | Bin 15452 -> 0 bytes apps/JAWS/clients/WebSTONE/src/cgi-send.c | 45 - .../JAWS/clients/WebSTONE/src/client/webclient.mak | 479 - apps/JAWS/clients/WebSTONE/src/config.cache | 47 - apps/JAWS/clients/WebSTONE/src/config.guess | 565 - apps/JAWS/clients/WebSTONE/src/config.h | 90 - apps/JAWS/clients/WebSTONE/src/config.h.in | 89 - apps/JAWS/clients/WebSTONE/src/config.log | 4 - apps/JAWS/clients/WebSTONE/src/config.status | 288 - apps/JAWS/clients/WebSTONE/src/config.sub | 867 - apps/JAWS/clients/WebSTONE/src/configure | 2132 -- apps/JAWS/clients/WebSTONE/src/configure.in | 99 - apps/JAWS/clients/WebSTONE/src/debug.h | 17 - apps/JAWS/clients/WebSTONE/src/errexit.c | 105 - apps/JAWS/clients/WebSTONE/src/gendata/genrand.mak | 227 - apps/JAWS/clients/WebSTONE/src/genrand.c | 59 - apps/JAWS/clients/WebSTONE/src/get.c | 317 - apps/JAWS/clients/WebSTONE/src/get.h | 16 - apps/JAWS/clients/WebSTONE/src/getopt.c | 66 - apps/JAWS/clients/WebSTONE/src/gettimeofday.c | 56 - apps/JAWS/clients/WebSTONE/src/install-sh | 238 - apps/JAWS/clients/WebSTONE/src/logfile27859 | 9 - .../JAWS/clients/WebSTONE/src/master/webmaster.mak | 476 - .../WebSTONE/src/nsapi-includes/base/buffer.h | 218 - .../WebSTONE/src/nsapi-includes/base/cinfo.h | 144 - .../WebSTONE/src/nsapi-includes/base/crit.h | 125 - .../WebSTONE/src/nsapi-includes/base/daemon.h | 118 - .../clients/WebSTONE/src/nsapi-includes/base/dll.h | 122 - .../WebSTONE/src/nsapi-includes/base/ereport.h | 119 - .../WebSTONE/src/nsapi-includes/base/eventlog.h | 58 - .../WebSTONE/src/nsapi-includes/base/file.h | 215 - .../WebSTONE/src/nsapi-includes/base/minissl.h | 25 - .../clients/WebSTONE/src/nsapi-includes/base/net.h | 178 - .../WebSTONE/src/nsapi-includes/base/nodelock.h | 45 - .../WebSTONE/src/nsapi-includes/base/nterrors.h | 736 - .../WebSTONE/src/nsapi-includes/base/objndx.h | 27 - .../WebSTONE/src/nsapi-includes/base/pblock.h | 191 - .../clients/WebSTONE/src/nsapi-includes/base/sem.h | 68 - .../WebSTONE/src/nsapi-includes/base/session.h | 83 - .../WebSTONE/src/nsapi-includes/base/shexp.h | 95 - .../WebSTONE/src/nsapi-includes/base/shmem.h | 82 - .../WebSTONE/src/nsapi-includes/base/systems.h | 220 - .../WebSTONE/src/nsapi-includes/base/systhr.h | 128 - .../WebSTONE/src/nsapi-includes/base/util.h | 203 - .../WebSTONE/src/nsapi-includes/frame/conf.h | 153 - .../WebSTONE/src/nsapi-includes/frame/dnfilter.h | 42 - .../WebSTONE/src/nsapi-includes/frame/func.h | 109 - .../WebSTONE/src/nsapi-includes/frame/http.h | 168 - .../WebSTONE/src/nsapi-includes/frame/httpact.h | 118 - .../WebSTONE/src/nsapi-includes/frame/ipfilter.h | 46 - .../WebSTONE/src/nsapi-includes/frame/log.h | 49 - .../WebSTONE/src/nsapi-includes/frame/object.h | 165 - .../WebSTONE/src/nsapi-includes/frame/objset.h | 156 - .../WebSTONE/src/nsapi-includes/frame/protocol.h | 25 - .../WebSTONE/src/nsapi-includes/frame/req.h | 214 - .../WebSTONE/src/nsapi-includes/frame/servact.h | 24 - .../clients/WebSTONE/src/nsapi-includes/netsite.h | 65 - apps/JAWS/clients/WebSTONE/src/nsapi-send.c | 90 - apps/JAWS/clients/WebSTONE/src/parse_file_list.c | 289 - apps/JAWS/clients/WebSTONE/src/parse_file_list.h | 19 - apps/JAWS/clients/WebSTONE/src/rexec.c | 372 - apps/JAWS/clients/WebSTONE/src/statistics.c | 47 - apps/JAWS/clients/WebSTONE/src/statistics.h | 11 - apps/JAWS/clients/WebSTONE/src/sysdep.c | 50 - apps/JAWS/clients/WebSTONE/src/sysdep.h | 130 - apps/JAWS/clients/WebSTONE/src/timefunc.c | 169 - apps/JAWS/clients/WebSTONE/src/timefunc.h | 30 - apps/JAWS/clients/WebSTONE/src/webclient.c | 1295 - apps/JAWS/clients/WebSTONE/src/webmaster.c | 1417 - apps/JAWS/clients/WebSTONE/webstone | 75 - apps/JAWS/remora/app/Makefile | 21 - apps/JAWS/remora/app/Remora_Export.cc | 93 - apps/JAWS/remora/app/Remora_Export.h | 85 - apps/JAWS/remora/app/Remora_Export.i | 146 - apps/JAWS/remora/app/Remora_Import.cc | 109 - apps/JAWS/remora/app/Remora_Import.h | 69 - apps/JAWS/remora/app/Remora_Import.i | 85 - apps/JAWS/remora/app/remora.idl | 100 - apps/JAWS/remora/app/stdmk | 40 - apps/JAWS/remora/app/test.cc | 76 - apps/JAWS/server/HTTP_Config.cpp | 140 - apps/JAWS/server/HTTP_Config.h | 95 - apps/JAWS/server/HTTP_Handler.cpp | 289 - apps/JAWS/server/HTTP_Handler.h | 196 - apps/JAWS/server/HTTP_Helpers.cpp | 431 - apps/JAWS/server/HTTP_Helpers.h | 108 - apps/JAWS/server/HTTP_Request.cpp | 661 - apps/JAWS/server/HTTP_Request.h | 200 - apps/JAWS/server/HTTP_Response.cpp | 366 - apps/JAWS/server/HTTP_Response.h | 80 - apps/JAWS/server/HTTP_Server.cpp | 395 - apps/JAWS/server/HTTP_Server.h | 141 - apps/JAWS/server/IO.cpp | 413 - apps/JAWS/server/IO.h | 223 - apps/JAWS/server/JAWS_Concurrency.cpp | 82 - apps/JAWS/server/JAWS_Concurrency.h | 101 - apps/JAWS/server/JAWS_Pipeline.cpp | 29 - apps/JAWS/server/JAWS_Pipeline.h | 36 - apps/JAWS/server/JAWS_Pipeline_Handler.cpp | 26 - apps/JAWS/server/JAWS_Pipeline_Handler.h | 29 - apps/JAWS/server/Makefile | 1061 - apps/JAWS/server/Makefile.bor | 17 - apps/JAWS/server/Parse_Headers.cpp | 356 - apps/JAWS/server/Parse_Headers.h | 121 - apps/JAWS/server/README | 201 - apps/JAWS/server/jaws.auth | 2 - apps/JAWS/server/jaws.dsp | 176 - apps/JAWS/server/jaws.dsw | 29 - apps/JAWS/server/main.cpp | 55 - apps/JAWS/server/svc.conf | 44 - apps/JAWS/server/test.cgi | 9 - apps/JAWS/stress_testing/Makefile | 460 - apps/JAWS/stress_testing/README | 54 - apps/JAWS/stress_testing/benchd.cpp | 240 - apps/JAWS/stress_testing/client.h | 8 - apps/JAWS/stress_testing/config | 3 - apps/JAWS/stress_testing/connection.cpp | 98 - apps/JAWS/stress_testing/connection.h | 22 - apps/JAWS/stress_testing/cp.cpp | 11 - apps/JAWS/stress_testing/cp.h | 14 - apps/JAWS/stress_testing/global.h | 31 - apps/JAWS/stress_testing/http.h | 16 - apps/JAWS/stress_testing/http_tester.cpp | 172 - apps/JAWS/stress_testing/out | 2 - apps/JAWS/stress_testing/stats.cpp | 88 - apps/JAWS/stress_testing/stats.h | 31 - apps/JAWS/stress_testing/util.cpp | 60 - apps/JAWS/stress_testing/util.h | 34 - apps/JAWS2/1000K.html | 20001 ---------- apps/JAWS2/100K.html | 2001 - apps/JAWS2/500K.html | 10001 ----- apps/JAWS2/50K.html | 1001 - apps/JAWS2/5K.html | 101 - apps/JAWS2/HTTPU/HTTPU.DSP | 169 - apps/JAWS2/HTTPU/HTTPU.DSW | 29 - apps/JAWS2/HTTPU/Makefile | 519 - apps/JAWS2/HTTPU/http_base.cpp | 323 - apps/JAWS2/HTTPU/http_base.h | 87 - apps/JAWS2/HTTPU/http_base.i | 53 - apps/JAWS2/HTTPU/http_export.h | 38 - apps/JAWS2/HTTPU/http_headers.cpp | 161 - apps/JAWS2/HTTPU/http_headers.h | 165 - apps/JAWS2/HTTPU/http_headers.i | 48 - apps/JAWS2/HTTPU/http_request.cpp | 86 - apps/JAWS2/HTTPU/http_request.h | 59 - apps/JAWS2/HTTPU/http_request.i | 41 - apps/JAWS2/HTTPU/http_response.cpp | 49 - apps/JAWS2/HTTPU/http_response.h | 51 - apps/JAWS2/HTTPU/http_response.i | 23 - apps/JAWS2/HTTPU/http_status.cpp | 87 - apps/JAWS2/HTTPU/http_status.h | 109 - apps/JAWS2/HTTPU/http_status.i | 19 - apps/JAWS2/HTTPU/parse_http_request.cpp | 116 - apps/JAWS2/HTTPU/parse_http_request.h | 59 - apps/JAWS2/HTTPU/parse_http_request.i | 49 - apps/JAWS2/HTTPU/parse_http_response.cpp | 72 - apps/JAWS2/HTTPU/parse_http_response.h | 56 - apps/JAWS2/HTTPU/parse_http_response.i | 43 - apps/JAWS2/HTTPU/parse_url.cpp | 320 - apps/JAWS2/HTTPU/parse_url.h | 63 - apps/JAWS2/HTTP_10.cpp | 32 - apps/JAWS2/HTTP_10.h | 68 - apps/JAWS2/HTTP_10_Parse.cpp | 82 - apps/JAWS2/HTTP_10_Read.cpp | 64 - apps/JAWS2/HTTP_10_Request.cpp | 119 - apps/JAWS2/HTTP_10_Request.h | 31 - apps/JAWS2/HTTP_10_Write.cpp | 160 - apps/JAWS2/HTTP_Policy.cpp | 17 - apps/JAWS2/HTTP_Policy.h | 22 - apps/JAWS2/JAWS/Assoc_Array.cpp | 274 - apps/JAWS2/JAWS/Assoc_Array.h | 102 - apps/JAWS2/JAWS/Cache_Hash_T.cpp | 237 - apps/JAWS2/JAWS/Cache_Hash_T.h | 61 - apps/JAWS2/JAWS/Cache_Heap_T.cpp | 282 - apps/JAWS2/JAWS/Cache_Heap_T.h | 103 - apps/JAWS2/JAWS/Cache_List_T.cpp | 222 - apps/JAWS2/JAWS/Cache_List_T.h | 111 - apps/JAWS2/JAWS/Cache_Manager.cpp | 189 - apps/JAWS2/JAWS/Cache_Manager.h | 66 - apps/JAWS2/JAWS/Cache_Manager_T.cpp | 577 - apps/JAWS2/JAWS/Cache_Manager_T.h | 185 - apps/JAWS2/JAWS/Cache_Object.cpp | 302 - apps/JAWS2/JAWS/Cache_Object.h | 149 - apps/JAWS2/JAWS/Concurrency.cpp | 349 - apps/JAWS2/JAWS/Concurrency.h | 132 - apps/JAWS2/JAWS/Data_Block.cpp | 76 - apps/JAWS2/JAWS/Data_Block.h | 50 - apps/JAWS2/JAWS/Export.h | 38 - apps/JAWS2/JAWS/FILE.cpp | 69 - apps/JAWS2/JAWS/FILE.h | 45 - apps/JAWS2/JAWS/Filecache.cpp | 136 - apps/JAWS2/JAWS/Filecache.h | 73 - apps/JAWS2/JAWS/Hash_Bucket_T.cpp | 462 - apps/JAWS2/JAWS/Hash_Bucket_T.h | 206 - apps/JAWS2/JAWS/Headers.cpp | 165 - apps/JAWS2/JAWS/Headers.h | 78 - apps/JAWS2/JAWS/IO.cpp | 603 - apps/JAWS2/JAWS/IO.h | 252 - apps/JAWS2/JAWS/IO_Acceptor.cpp | 210 - apps/JAWS2/JAWS/IO_Acceptor.h | 139 - apps/JAWS2/JAWS/IO_Handler.cpp | 509 - apps/JAWS2/JAWS/IO_Handler.h | 313 - apps/JAWS2/JAWS/JAWS.h | 14 - apps/JAWS2/JAWS/Makefile | 2481 -- apps/JAWS2/JAWS/Makefile.bor | 31 - apps/JAWS2/JAWS/Parse_Headers.cpp | 441 - apps/JAWS2/JAWS/Parse_Headers.h | 122 - apps/JAWS2/JAWS/Pipeline.cpp | 27 - apps/JAWS2/JAWS/Pipeline.h | 39 - apps/JAWS2/JAWS/Pipeline_Handler_T.cpp | 31 - apps/JAWS2/JAWS/Pipeline_Handler_T.h | 32 - apps/JAWS2/JAWS/Pipeline_Tasks.cpp | 213 - apps/JAWS2/JAWS/Pipeline_Tasks.h | 56 - apps/JAWS2/JAWS/Policy.cpp | 89 - apps/JAWS2/JAWS/Policy.h | 65 - apps/JAWS2/JAWS/Reaper.cpp | 45 - apps/JAWS2/JAWS/Reaper.h | 48 - apps/JAWS2/JAWS/Server.cpp | 190 - apps/JAWS2/JAWS/Server.h | 39 - apps/JAWS2/JAWS/Waiter.cpp | 73 - apps/JAWS2/JAWS/Waiter.h | 48 - apps/JAWS2/JAWS/jaws.dsp | 224 - apps/JAWS2/JAWS/jaws.dsw | 29 - apps/JAWS2/Makefile | 709 - apps/JAWS2/Makefile.bor | 18 - apps/JAWS2/README | 32 - apps/JAWS2/main.cpp | 47 - apps/JAWS2/server.dsp | 118 - apps/JAWS2/server.dsw | 29 - apps/Makefile | 32 - apps/Makefile.am | 33 - apps/Makefile.bor | 3 - .../Event_Comm/Consumer/Input_Handler.cpp | 147 - .../Event_Comm/Consumer/Input_Handler.h | 73 - apps/Orbix-Examples/Event_Comm/Consumer/Makefile | 163 - .../Consumer/Notification_Receiver_Handler.cpp | 127 - .../Consumer/Notification_Receiver_Handler.h | 66 - .../Event_Comm/Consumer/consumer.cpp | 124 - apps/Orbix-Examples/Event_Comm/Makefile | 26 - apps/Orbix-Examples/Event_Comm/README | 109 - .../Event_Comm/Supplier/Input_Handler.cpp | 140 - .../Event_Comm/Supplier/Input_Handler.h | 75 - apps/Orbix-Examples/Event_Comm/Supplier/Makefile | 162 - .../Event_Comm/Supplier/Notifier_Handler.cpp | 73 - .../Event_Comm/Supplier/Notifier_Handler.h | 55 - .../Event_Comm/Supplier/supplier.cpp | 132 - .../Event_Comm/include/Event_Comm.hh | 887 - .../Event_Comm/include/Event_Comm_i.h | 37 - .../Event_Comm/include/Notification_Receiver_i.h | 48 - .../Orbix-Examples/Event_Comm/include/Notifier_i.h | 87 - .../Orbix-Examples/Event_Comm/libsrc/Event_Comm.hh | 887 - .../Event_Comm/libsrc/Event_Comm.idl | 88 - .../Event_Comm/libsrc/Event_CommC.cpp | 351 - .../Event_Comm/libsrc/Event_CommS.cpp | 166 - .../Event_Comm/libsrc/Event_Comm_i.h | 36 - apps/Orbix-Examples/Event_Comm/libsrc/Makefile | 113 - .../Event_Comm/libsrc/Notification.idl | 41 - .../Event_Comm/libsrc/Notification_Receiver.idl | 40 - .../Event_Comm/libsrc/Notification_Receiver_i.cpp | 44 - .../Event_Comm/libsrc/Notification_Receiver_i.h | 49 - apps/Orbix-Examples/Event_Comm/libsrc/Notifier.idl | 47 - .../Event_Comm/libsrc/Notifier_i.cpp | 344 - apps/Orbix-Examples/Event_Comm/libsrc/Notifier_i.h | 89 - apps/Orbix-Examples/Logger/Logger.cpp | 134 - apps/Orbix-Examples/Logger/Logger.h | 61 - apps/Orbix-Examples/Logger/Makefile | 63 - apps/Orbix-Examples/Logger/Orbix.hostgroups | 1 - apps/Orbix-Examples/Logger/Orbix.hosts | 3 - apps/Orbix-Examples/Logger/README | 35 - apps/Orbix-Examples/Logger/a1.tex | 232 - apps/Orbix-Examples/Logger/client.cpp | 143 - apps/Orbix-Examples/Logger/logger.hh | 434 - apps/Orbix-Examples/Logger/logger.idl | 58 - apps/Orbix-Examples/Logger/loggerS.cpp | 141 - apps/Orbix-Examples/Logger/logger_i.cpp | 122 - apps/Orbix-Examples/Logger/logger_i.h | 80 - apps/Orbix-Examples/Logger/server.cpp | 40 - apps/Orbix-Examples/Makefile | 25 - apps/README | 27 - apps/build.bor | 15 - apps/drwho/BS_Client.cpp | 88 - apps/drwho/BS_Client.h | 46 - apps/drwho/BS_Server.cpp | 116 - apps/drwho/BS_Server.h | 47 - apps/drwho/Binary_Search.cpp | 79 - apps/drwho/Binary_Search.h | 71 - apps/drwho/CM_Client.cpp | 136 - apps/drwho/CM_Client.h | 51 - apps/drwho/CM_Server.cpp | 105 - apps/drwho/CM_Server.h | 39 - apps/drwho/ChangeLog | 278 - apps/drwho/Comm_Manager.h | 39 - apps/drwho/Drwho_Node.cpp | 101 - apps/drwho/Drwho_Node.h | 52 - apps/drwho/File_Manager.cpp | 182 - apps/drwho/File_Manager.h | 57 - apps/drwho/HT_Client.cpp | 34 - apps/drwho/HT_Client.h | 31 - apps/drwho/HT_Server.cpp | 37 - apps/drwho/HT_Server.h | 32 - apps/drwho/Hash_Table.cpp | 72 - apps/drwho/Hash_Table.h | 45 - apps/drwho/Makefile | 952 - apps/drwho/Multicast_Manager.cpp | 177 - apps/drwho/Multicast_Manager.h | 56 - apps/drwho/Options.cpp | 154 - apps/drwho/Options.h | 66 - apps/drwho/PMC_All.cpp | 97 - apps/drwho/PMC_All.h | 37 - apps/drwho/PMC_Flo.cpp | 121 - apps/drwho/PMC_Flo.h | 37 - apps/drwho/PMC_Ruser.cpp | 173 - apps/drwho/PMC_Ruser.h | 40 - apps/drwho/PMC_Usr.cpp | 113 - apps/drwho/PMC_Usr.h | 38 - apps/drwho/PMS_All.cpp | 94 - apps/drwho/PMS_All.h | 35 - apps/drwho/PMS_Flo.cpp | 72 - apps/drwho/PMS_Flo.h | 35 - apps/drwho/PMS_Ruser.cpp | 128 - apps/drwho/PMS_Ruser.h | 37 - apps/drwho/PMS_Usr.cpp | 79 - apps/drwho/PMS_Usr.h | 35 - apps/drwho/PM_Client.cpp | 137 - apps/drwho/PM_Client.h | 45 - apps/drwho/PM_Server.cpp | 82 - apps/drwho/PM_Server.h | 41 - apps/drwho/Protocol_Manager.cpp | 83 - apps/drwho/Protocol_Manager.h | 58 - apps/drwho/Protocol_Record.cpp | 96 - apps/drwho/Protocol_Record.h | 49 - apps/drwho/README | 308 - apps/drwho/Rwho_DB_Manager.cpp | 122 - apps/drwho/Rwho_DB_Manager.h | 52 - apps/drwho/SL_Client.cpp | 15 - apps/drwho/SL_Client.h | 33 - apps/drwho/SL_Server.cpp | 25 - apps/drwho/SL_Server.h | 34 - apps/drwho/SML_Client.cpp | 36 - apps/drwho/SML_Client.h | 36 - apps/drwho/SML_Server.cpp | 11 - apps/drwho/SML_Server.h | 29 - apps/drwho/SMR_Client.cpp | 21 - apps/drwho/SMR_Client.h | 29 - apps/drwho/SMR_Server.cpp | 17 - apps/drwho/SMR_Server.h | 29 - apps/drwho/SM_Client.cpp | 73 - apps/drwho/SM_Client.h | 38 - apps/drwho/SM_Server.cpp | 67 - apps/drwho/SM_Server.h | 36 - apps/drwho/Search_Struct.cpp | 22 - apps/drwho/Search_Struct.h | 41 - apps/drwho/Select_Manager.h | 30 - apps/drwho/Single_Lookup.cpp | 30 - apps/drwho/Single_Lookup.h | 39 - apps/drwho/client.cpp | 63 - apps/drwho/global.h | 52 - apps/drwho/server.cpp | 112 - apps/gperf/COPYING | 340 - apps/gperf/ChangeLog | 1886 - apps/gperf/Makefile | 28 - apps/gperf/Makefile.am | 26 - apps/gperf/Makefile.bor | 3 - apps/gperf/README | 29 - apps/gperf/gperf.1 | 23 - apps/gperf/gperf.info | 1130 - apps/gperf/gperf.texi | 1188 - apps/gperf/mdate-sh | 92 - apps/gperf/src/Bool_Array.cpp | 105 - apps/gperf/src/Bool_Array.h | 76 - apps/gperf/src/Gen_Perf.cpp | 454 - apps/gperf/src/Gen_Perf.h | 81 - apps/gperf/src/Hash_Table.cpp | 114 - apps/gperf/src/Hash_Table.h | 66 - apps/gperf/src/Iterator.cpp | 97 - apps/gperf/src/Iterator.h | 80 - apps/gperf/src/Key_List.cpp | 1931 - apps/gperf/src/Key_List.h | 173 - apps/gperf/src/List_Node.cpp | 129 - apps/gperf/src/List_Node.h | 80 - apps/gperf/src/Makefile | 266 - apps/gperf/src/Makefile.am | 40 - apps/gperf/src/Makefile.bor | 23 - apps/gperf/src/Options.cpp | 864 - apps/gperf/src/Options.h | 190 - apps/gperf/src/Vectors.cpp | 36 - apps/gperf/src/Vectors.h | 49 - apps/gperf/src/Version.cpp | 30 - apps/gperf/src/gperf.cpp | 83 - apps/gperf/src/gperf.dsp | 290 - apps/gperf/src/gperf.dsw | 44 - apps/gperf/src/gperf_lib.dsp | 795 - apps/gperf/tests/Makefile | 260 - apps/gperf/tests/Makefile.am | 115 - apps/gperf/tests/ada-pred.exp | 54 - apps/gperf/tests/ada-res.exp | 63 - apps/gperf/tests/ada.gperf | 63 - apps/gperf/tests/adadefs.gperf | 54 - apps/gperf/tests/c++-res.exp | 73 - apps/gperf/tests/c++.gperf | 73 - apps/gperf/tests/c-parse.gperf | 56 - apps/gperf/tests/c.exp | 32 - apps/gperf/tests/c.gperf | 32 - apps/gperf/tests/corba.exp | 36 - apps/gperf/tests/corba.gperf | 36 - apps/gperf/tests/gpc.gperf | 48 - apps/gperf/tests/gplus.gperf | 76 - apps/gperf/tests/idl.exp | 9 - apps/gperf/tests/idl.gperf | 9 - apps/gperf/tests/irc.gperf | 63 - apps/gperf/tests/makeinfo.gperf | 116 - apps/gperf/tests/modula.exp | 106 - apps/gperf/tests/modula2.gperf | 40 - apps/gperf/tests/modula3.gperf | 106 - apps/gperf/tests/pascal.exp | 36 - apps/gperf/tests/pascal.gperf | 36 - apps/gperf/tests/test-1.exp | 164 - apps/gperf/tests/test-2.exp | 213 - apps/gperf/tests/test-3.exp | 195 - apps/gperf/tests/test-4.exp | 169 - apps/gperf/tests/test-5.exp | 138 - apps/gperf/tests/test-6.exp | 90 - apps/gperf/tests/test-7.exp | 32 - apps/gperf/tests/test.cpp | 34 - apps/gperf/texinfo.tex | 4977 --- apps/gperf/version.texi | 3 - bin/ACEutils.pm | 81 - bin/ADDIDL.DSM | 150 - bin/Array.pl | 31 - bin/Array_Helper | 16 - bin/Hash_Map_Manager.pl | 146 - bin/Hash_Map_Manager_Helper | 76 - bin/Makefile | 111 - bin/Process.pm | 18 - bin/Process_Unix.pm | 73 - bin/Process_Win32.pm | 56 - bin/README.html | 171 - bin/Service_Config.perl | 31 - bin/Uniqueid.pm | 28 - bin/ace_components | 80 - bin/ace_ld | 185 - bin/am_edit | 1368 - bin/auto_compile | 466 - bin/auto_compile_win32.pl | 734 - bin/auto_compile_wrapper | 56 - bin/auto_ptr.perl | 16 - bin/bootstrap | 188 - bin/check_build_logs | 172 - bin/class2hxxcxx | 80 - bin/class2hxxcxxsingle | 80 - bin/class2info | 197 - bin/class2info.awk | 1594 - bin/class2man | 78 - bin/class2mml | 79 - bin/class2src | 79 - bin/classinfo.ps | 868 - bin/clone.1 | 297 - bin/clone.cpp | 978 - bin/clone.csh | 26 - bin/corba-boolean.perl | 19 - bin/count_lines | 224 - bin/create_ace_build | 183 - bin/cvslog | 169 - bin/dsp2dsp.pl | 29 - bin/envinfo.cpp | 29 - bin/g++dep | 111 - bin/generate_export_file.pl | 50 - bin/generate_html_windex | 86 - bin/generate_man_pages | 40 - bin/hiding.fmt | 20 - bin/html-windex | 44 - bin/indent_macros.perl | 59 - bin/info2doc.awk | 2182 -- bin/info2doc.fmt | 23 - bin/info2head | 166 - bin/info2head.fmt | 23 - bin/info2headsrc | 326 - bin/info2man | 169 - bin/info2mml | 166 - bin/info2src | 133 - bin/info2src.awk | 630 - bin/libsize.pl | 192 - bin/make_release | 721 - bin/man2html | 89 - bin/man2html1.awk | 139 - bin/man2html2.awk | 18 - bin/msvc_auto_compile.pl | 284 - bin/rename-ace.pl | 184 - bin/run_all.pl | 224 - bin/run_all_list.pm | 270 - bin/run_all_win32.pl | 180 - bin/tao_env.pl | 17 - bin/tao_svcconf.pl | 15 - bin/update-ace+tao.sh | 39 - bin/vc_filter.pl | 147 - bin/vendor.fmt | 101 - config.guess | 1171 - config.sub | 1253 - configure.in | 7535 ---- docs/ACE-FMM.html | 282 - docs/ACE-SSL.html | 61 - docs/ACE-bug-process.html | 101 - docs/ACE-categories.html | 766 - docs/ACE-development-process.html | 124 - docs/ACE-guidelines.html | 1112 - docs/ACE-inheritance.pdf.gz | Bin 19666 -> 0 bytes docs/ACE-inheritance.ps.gz | Bin 18416 -> 0 bytes docs/ACE-lessons.html | 268 - docs/ACE-porting.html | 186 - docs/ACE-subsets.html | 843 - docs/ACE-tutorials.html | 56 - docs/CE-status.txt | 904 - docs/exceptions.html | 536 - docs/tutorials/001/001.dsp | 108 - docs/tutorials/001/00SetEnv | 2 - docs/tutorials/001/Makefile | 76 - docs/tutorials/001/acceptor.h | 128 - docs/tutorials/001/combine.shar | 574 - docs/tutorials/001/logger.h | 178 - docs/tutorials/001/page01.html | 104 - docs/tutorials/001/page02.html | 174 - docs/tutorials/001/page03.html | 197 - docs/tutorials/001/page04.html | 213 - docs/tutorials/001/page05.html | 56 - docs/tutorials/001/server.cpp | 79 - docs/tutorials/001/simple.fig | 57 - docs/tutorials/001/simple.gif | Bin 6040 -> 0 bytes docs/tutorials/002/002.dsp | 104 - docs/tutorials/002/00SetEnv | 2 - docs/tutorials/002/Makefile | 55 - docs/tutorials/002/combine.shar | 328 - docs/tutorials/002/handler.h | 167 - docs/tutorials/002/page01.html | 54 - docs/tutorials/002/page02.html | 159 - docs/tutorials/002/page03.html | 195 - docs/tutorials/002/page04.html | 40 - docs/tutorials/002/server.cpp | 90 - docs/tutorials/003/003.dsp | 100 - docs/tutorials/003/00SetEnv | 2 - docs/tutorials/003/Makefile | 51 - docs/tutorials/003/client.cpp | 98 - docs/tutorials/003/combine.shar | 217 - docs/tutorials/003/page01.html | 160 - docs/tutorials/004/004.dsp | 100 - docs/tutorials/004/00SetEnv | 2 - docs/tutorials/004/Makefile | 47 - docs/tutorials/004/client.cpp | 215 - docs/tutorials/004/combine.shar | 216 - docs/tutorials/004/page01.html | 276 - docs/tutorials/005/005.dsp | 112 - docs/tutorials/005/00SetEnv | 2 - docs/tutorials/005/Makefile | 118 - docs/tutorials/005/client_acceptor.h | 36 - docs/tutorials/005/client_handler.cpp | 225 - docs/tutorials/005/client_handler.h | 100 - docs/tutorials/005/combine.shar | 423 - docs/tutorials/005/page01.html | 35 - docs/tutorials/005/page02.html | 153 - docs/tutorials/005/page03.html | 73 - docs/tutorials/005/page04.html | 135 - docs/tutorials/005/page05.html | 255 - docs/tutorials/005/page06.html | 146 - docs/tutorials/005/page07.html | 97 - docs/tutorials/005/page08.html | 49 - docs/tutorials/005/server.brk | 154 - docs/tutorials/005/server.cpp | 114 - docs/tutorials/006/006.dsp | 112 - docs/tutorials/006/Makefile | 114 - docs/tutorials/006/client_acceptor.h | 74 - docs/tutorials/006/client_handler.cpp | 293 - docs/tutorials/006/client_handler.h | 118 - docs/tutorials/006/combine.shar | 508 - docs/tutorials/006/page01.html | 63 - docs/tutorials/006/page02.html | 149 - docs/tutorials/006/page03.html | 113 - docs/tutorials/006/page04.html | 154 - docs/tutorials/006/page05.html | 351 - docs/tutorials/006/page06.html | 47 - docs/tutorials/006/server.cpp | 115 - docs/tutorials/007/007.dsp | 124 - docs/tutorials/007/Makefile | 116 - docs/tutorials/007/client_acceptor.cpp | 56 - docs/tutorials/007/client_acceptor.h | 125 - docs/tutorials/007/client_handler.cpp | 233 - docs/tutorials/007/client_handler.h | 156 - docs/tutorials/007/combine.shar | 685 - docs/tutorials/007/page01.html | 84 - docs/tutorials/007/page02.html | 142 - docs/tutorials/007/page03.html | 155 - docs/tutorials/007/page04.html | 87 - docs/tutorials/007/page05.html | 188 - docs/tutorials/007/page06.html | 266 - docs/tutorials/007/page07.html | 121 - docs/tutorials/007/page08.html | 282 - docs/tutorials/007/page09.html | 79 - docs/tutorials/007/server.cpp | 113 - docs/tutorials/007/thread_pool.cpp | 252 - docs/tutorials/007/thread_pool.h | 89 - docs/tutorials/008/008-broadcast.dsp | 102 - docs/tutorials/008/008-direct.dsp | 102 - docs/tutorials/008/008-server.dsp | 102 - docs/tutorials/008/Makefile | 74 - docs/tutorials/008/broadcast_client.cpp | 83 - docs/tutorials/008/combine.shar | 465 - docs/tutorials/008/directed_client.cpp | 107 - docs/tutorials/008/page01.html | 75 - docs/tutorials/008/page02.html | 162 - docs/tutorials/008/page03.html | 147 - docs/tutorials/008/page04.html | 138 - docs/tutorials/008/page05.html | 41 - docs/tutorials/008/server.cpp | 115 - docs/tutorials/009/009-broadcast.dsp | 102 - docs/tutorials/009/009-directed.dsp | 102 - docs/tutorials/009/009-server.dsp | 102 - docs/tutorials/009/Makefile | 74 - docs/tutorials/009/broadcast_client.cpp | 46 - docs/tutorials/009/combine.shar | 394 - docs/tutorials/009/directed_client.cpp | 68 - docs/tutorials/009/page01.html | 62 - docs/tutorials/009/page02.html | 112 - docs/tutorials/009/page03.html | 102 - docs/tutorials/009/page04.html | 76 - docs/tutorials/009/page05.html | 48 - docs/tutorials/009/server.cpp | 80 - docs/tutorials/010/010.dsp | 112 - docs/tutorials/010/Makefile | 73 - docs/tutorials/010/block.h | 42 - docs/tutorials/010/combine.shar | 550 - docs/tutorials/010/message_queue.cpp | 88 - docs/tutorials/010/page01.html | 62 - docs/tutorials/010/page02.html | 127 - docs/tutorials/010/page03.html | 75 - docs/tutorials/010/page04.html | 78 - docs/tutorials/010/page05.html | 171 - docs/tutorials/010/page06.html | 58 - docs/tutorials/010/page07.html | 32 - docs/tutorials/010/task.cpp | 123 - docs/tutorials/010/task.h | 45 - docs/tutorials/011/011.dsp | 116 - docs/tutorials/011/Makefile | 73 - docs/tutorials/011/block.h | 38 - docs/tutorials/011/combine.shar | 489 - docs/tutorials/011/data.h | 73 - docs/tutorials/011/message_queue.cpp | 86 - docs/tutorials/011/page01.html | 37 - docs/tutorials/011/page02.html | 119 - docs/tutorials/011/page03.html | 189 - docs/tutorials/011/page04.html | 105 - docs/tutorials/011/page05.html | 94 - docs/tutorials/011/page06.html | 37 - docs/tutorials/011/task.cpp | 115 - docs/tutorials/011/task.h | 33 - docs/tutorials/012/012.dsp | 112 - docs/tutorials/012/Makefile | 73 - docs/tutorials/012/block.h | 65 - docs/tutorials/012/combine.shar | 466 - docs/tutorials/012/message_queue.cpp | 97 - docs/tutorials/012/page01.html | 45 - docs/tutorials/012/page02.html | 113 - docs/tutorials/012/page03.html | 107 - docs/tutorials/012/page04.html | 128 - docs/tutorials/012/page05.html | 234 - docs/tutorials/012/page06.html | 32 - docs/tutorials/012/task.cpp | 145 - docs/tutorials/012/task.h | 47 - docs/tutorials/012/work.h | 76 - docs/tutorials/013/013.dsp | 132 - docs/tutorials/013/Makefile | 74 - docs/tutorials/013/block.cpp | 81 - docs/tutorials/013/block.h | 84 - docs/tutorials/013/combine.shar | 661 - docs/tutorials/013/message_queue.cpp | 88 - docs/tutorials/013/mld.cpp | 23 - docs/tutorials/013/mld.h | 49 - docs/tutorials/013/page01.html | 65 - docs/tutorials/013/page02.html | 124 - docs/tutorials/013/page03.html | 126 - docs/tutorials/013/page04.html | 141 - docs/tutorials/013/page05.html | 109 - docs/tutorials/013/page06.html | 304 - docs/tutorials/013/page07.html | 258 - docs/tutorials/013/page08.html | 43 - docs/tutorials/013/task.cpp | 193 - docs/tutorials/013/task.h | 57 - docs/tutorials/013/work.cpp | 125 - docs/tutorials/013/work.h | 72 - docs/tutorials/014/014.dsp | 112 - docs/tutorials/014/EndTask.h | 89 - docs/tutorials/014/Makefile | 77 - docs/tutorials/014/Task.cpp | 206 - docs/tutorials/014/Task.h | 59 - docs/tutorials/014/combine.shar | 357 - docs/tutorials/014/page01.html | 74 - docs/tutorials/014/page02.html | 85 - docs/tutorials/014/page03.html | 241 - docs/tutorials/014/page04.html | 120 - docs/tutorials/014/page05.html | 210 - docs/tutorials/014/stream.cpp | 168 - docs/tutorials/015/015-client.dsp | 138 - docs/tutorials/015/015-server.dsp | 166 - docs/tutorials/015/Client_i.cpp | 60 - docs/tutorials/015/Client_i.h | 73 - docs/tutorials/015/Compressor.cpp | 101 - docs/tutorials/015/Compressor.h | 35 - docs/tutorials/015/Crypt.cpp | 83 - docs/tutorials/015/Crypt.h | 32 - docs/tutorials/015/Handler.cpp | 179 - docs/tutorials/015/Handler.h | 61 - docs/tutorials/015/Makefile | 33 - docs/tutorials/015/Makefile.client | 79 - docs/tutorials/015/Makefile.server | 81 - docs/tutorials/015/Protocol_Stream.cpp | 195 - docs/tutorials/015/Protocol_Stream.h | 86 - docs/tutorials/015/Protocol_Task.cpp | 79 - docs/tutorials/015/Protocol_Task.h | 60 - docs/tutorials/015/Recv.cpp | 93 - docs/tutorials/015/Recv.h | 58 - docs/tutorials/015/Server_i.cpp | 75 - docs/tutorials/015/Server_i.h | 50 - docs/tutorials/015/Xmit.cpp | 84 - docs/tutorials/015/Xmit.h | 46 - docs/tutorials/015/client.cpp | 70 - docs/tutorials/015/combine.shar | 1063 - docs/tutorials/015/page01.html | 106 - docs/tutorials/015/page02.html | 95 - docs/tutorials/015/page03.html | 99 - docs/tutorials/015/page04.html | 98 - docs/tutorials/015/page05.html | 95 - docs/tutorials/015/page06.html | 79 - docs/tutorials/015/page07.html | 102 - docs/tutorials/015/page08.html | 91 - docs/tutorials/015/page09.html | 227 - docs/tutorials/015/page10.html | 128 - docs/tutorials/015/page11.html | 221 - docs/tutorials/015/page12.html | 82 - docs/tutorials/015/page13.html | 105 - docs/tutorials/015/page14.html | 76 - docs/tutorials/015/page15.html | 120 - docs/tutorials/015/page16.html | 91 - docs/tutorials/015/page17.html | 118 - docs/tutorials/015/page18.html | 62 - docs/tutorials/015/page19.html | 126 - docs/tutorials/015/page20.html | 60 - docs/tutorials/015/page21.html | 107 - docs/tutorials/015/page22.html | 84 - docs/tutorials/015/server.cpp | 68 - docs/tutorials/015/stream.gif | Bin 3422 -> 0 bytes docs/tutorials/016/016.dsp | 108 - docs/tutorials/016/Condition_i.cpp | 201 - docs/tutorials/016/Condition_i.h | 154 - docs/tutorials/016/Makefile | 77 - docs/tutorials/016/combine.shar | 385 - docs/tutorials/016/condition.cpp | 252 - docs/tutorials/016/page01.html | 86 - docs/tutorials/016/page02.html | 219 - docs/tutorials/016/page03.html | 226 - docs/tutorials/016/page04.html | 278 - docs/tutorials/016/page05.html | 33 - docs/tutorials/017/017.dsp | 108 - docs/tutorials/017/Barrier_i.cpp | 160 - docs/tutorials/017/Barrier_i.h | 66 - docs/tutorials/017/Makefile | 77 - docs/tutorials/017/barrier.cpp | 166 - docs/tutorials/017/barrier2.cpp | 178 - docs/tutorials/017/combine.shar | 380 - docs/tutorials/017/page01.html | 52 - docs/tutorials/017/page02.html | 195 - docs/tutorials/017/page03.html | 99 - docs/tutorials/017/page04.html | 188 - docs/tutorials/017/page05.html | 32 - docs/tutorials/017/page06.html | 206 - docs/tutorials/018/018.dsp | 116 - docs/tutorials/018/Makefile | 77 - docs/tutorials/018/Mutex_i.h | 17 - docs/tutorials/018/Test_T.cpp | 196 - docs/tutorials/018/Test_T.h | 80 - docs/tutorials/018/Token_i.h | 20 - docs/tutorials/018/combine.shar | 440 - docs/tutorials/018/output | 33 - docs/tutorials/018/page01.html | 70 - docs/tutorials/018/page02.html | 61 - docs/tutorials/018/page03.html | 125 - docs/tutorials/018/page04.html | 229 - docs/tutorials/018/page05.html | 66 - docs/tutorials/018/page06.html | 81 - docs/tutorials/018/page07.html | 32 - docs/tutorials/018/token.cpp | 32 - docs/tutorials/019/019-client.dsp | 105 - docs/tutorials/019/019-client2.dsp | 105 - docs/tutorials/019/019-server.dsp | 105 - docs/tutorials/019/019-server2.dsp | 105 - docs/tutorials/019/Makefile | 79 - docs/tutorials/019/client.cpp | 74 - docs/tutorials/019/client2.cpp | 47 - docs/tutorials/019/combine.shar | 358 - docs/tutorials/019/page01.html | 62 - docs/tutorials/019/page02.html | 156 - docs/tutorials/019/page03.html | 98 - docs/tutorials/019/page04.html | 152 - docs/tutorials/019/page05.html | 125 - docs/tutorials/019/page06.html | 29 - docs/tutorials/019/server.cpp | 126 - docs/tutorials/019/server2.cpp | 66 - docs/tutorials/019/shmem.cpp | 52 - docs/tutorials/019/shmem.h | 45 - docs/tutorials/020/020-client.dsp | 105 - docs/tutorials/020/020-client2.dsp | 105 - docs/tutorials/020/020-server.dsp | 105 - docs/tutorials/020/020-server2.dsp | 105 - docs/tutorials/020/Makefile | 79 - docs/tutorials/020/client.cpp | 31 - docs/tutorials/020/client2.cpp | 25 - docs/tutorials/020/combine.shar | 364 - docs/tutorials/020/mmap.cpp | 34 - docs/tutorials/020/mmap.h | 38 - docs/tutorials/020/mmapfile | 8 - docs/tutorials/020/page01.html | 49 - docs/tutorials/020/page02.html | 75 - docs/tutorials/020/page03.html | 54 - docs/tutorials/020/page04.html | 89 - docs/tutorials/020/page05.html | 99 - docs/tutorials/020/page06.html | 29 - docs/tutorials/020/server.cpp | 41 - docs/tutorials/020/server2.cpp | 31 - docs/tutorials/021/021-client.dsp | 105 - docs/tutorials/021/021-server.dsp | 105 - docs/tutorials/021/Makefile | 79 - docs/tutorials/021/client.cpp | 123 - docs/tutorials/021/combine.shar | 398 - docs/tutorials/021/mpool.cpp | 66 - docs/tutorials/021/mpool.h | 67 - docs/tutorials/021/page01.html | 66 - docs/tutorials/021/page02.html | 186 - docs/tutorials/021/page03.html | 150 - docs/tutorials/021/page04.html | 111 - docs/tutorials/021/page05.html | 88 - docs/tutorials/021/page06.html | 34 - docs/tutorials/021/server.cpp | 158 - docs/tutorials/Chap_2/Chap_2.zip | Bin 6712 -> 0 bytes docs/tutorials/Chap_2/ex01.html | 106 - docs/tutorials/Chap_2/ex02.html | 95 - docs/tutorials/Chap_2/ex03.html | 81 - docs/tutorials/Chap_2/ex04.html | 87 - docs/tutorials/Chap_2/ex05.htm | 87 - docs/tutorials/Chap_2/ex05.html | 87 - docs/tutorials/Chap_2/ex06.html | 76 - docs/tutorials/Chap_3/Chap_3.zip | Bin 3004 -> 0 bytes docs/tutorials/Chap_3/Makefile | 29 - docs/tutorials/Chap_3/README | 14 - docs/tutorials/Chap_3/ex01.html | 107 - docs/tutorials/Chap_3/ex02.html | 135 - docs/tutorials/Chap_3/ex03.html | 115 - docs/tutorials/Chap_3/mm.cpp | 113 - docs/tutorials/Chap_4/Chap_4.zip | Bin 8317 -> 0 bytes docs/tutorials/Chap_4/ex01.html | 74 - docs/tutorials/Chap_4/ex02.html | 67 - docs/tutorials/Chap_4/ex03.html | 78 - docs/tutorials/Chap_4/ex04.html | 69 - docs/tutorials/Chap_4/ex05.html | 69 - docs/tutorials/Chap_4/ex06.html | 95 - docs/tutorials/Chap_4/ex07.html | 84 - docs/tutorials/Chap_4/ex08.html | 72 - docs/tutorials/Chap_5/Chap_5.zip | Bin 5843 -> 0 bytes docs/tutorials/Chap_5/ex01.html | 75 - docs/tutorials/Chap_5/ex02.html | 148 - docs/tutorials/Chap_5/ex03.html | 86 - docs/tutorials/Chap_5/ex04.html | 84 - docs/tutorials/Chap_5/ex05.html | 87 - docs/tutorials/Chap_6/Chap_6.zip | Bin 14305 -> 0 bytes docs/tutorials/Chap_6/ex01.html | 81 - docs/tutorials/Chap_6/ex02.html | 94 - docs/tutorials/Chap_6/ex03.html | 50 - docs/tutorials/Chap_6/ex04.html | 44 - docs/tutorials/Chap_6/ex05.html | 129 - docs/tutorials/Chap_6/ex06.html | 134 - docs/tutorials/Chap_6/ex07.html | 173 - docs/tutorials/Chap_6/ex08.html | 96 - docs/tutorials/Chap_6/ex09.html | 211 - docs/tutorials/Chap_6/ex10.html | 110 - docs/tutorials/Chap_7/Chap_7.zip | Bin 4520 -> 0 bytes docs/tutorials/Chap_7/ex01.html | 90 - docs/tutorials/Chap_7/ex02.html | 165 - docs/tutorials/Chap_7/ex03.html | 158 - docs/tutorials/Makefile | 9 - docs/tutorials/colorize | 20 - docs/tutorials/combine | 171 - docs/tutorials/fix.Makefile | 68 - docs/tutorials/guide-tutorials.html | 46 - docs/tutorials/linify | 54 - docs/tutorials/new-tutorials.html | 77 - docs/tutorials/online-tutorials.html | 143 - docs/tutorials/templates.html | 189 - docs/tutorials/tutorials.dsw | 412 - docs/usage-bugzilla.html | 99 - etc/DOC-way.html | 64 - etc/README | 32 - etc/Svc_Conf_l.cpp.diff | 213 - etc/Svc_Conf_y.cpp.diff | 83 - etc/create-jace-release | 9 - etc/enforce_ace_try.diff | 271 - etc/purify.solaris2 | 161 - etc/xlc_dummy.cpp | 6 - examples/ASX/CCM_App/CCM_App.cpp | 115 - examples/ASX/CCM_App/Makefile | 184 - examples/ASX/CCM_App/SC_Client.cpp | 13 - examples/ASX/CCM_App/SC_Server.cpp | 84 - examples/ASX/CCM_App/svc.conf | 21 - .../Event_Server/Event_Server/Consumer_Router.cpp | 149 - .../Event_Server/Event_Server/Consumer_Router.h | 70 - .../Event_Server/Event_Server/Event_Analyzer.cpp | 79 - .../ASX/Event_Server/Event_Server/Event_Analyzer.h | 45 - .../ASX/Event_Server/Event_Server/Event_Server.dsp | 114 - .../ASX/Event_Server/Event_Server/Event_Server.dsw | 29 - examples/ASX/Event_Server/Event_Server/Makefile | 736 - examples/ASX/Event_Server/Event_Server/Options.cpp | 194 - examples/ASX/Event_Server/Event_Server/Options.h | 124 - examples/ASX/Event_Server/Event_Server/Options.i | 137 - .../ASX/Event_Server/Event_Server/Peer_Router.cpp | 451 - .../ASX/Event_Server/Event_Server/Peer_Router.h | 156 - .../Event_Server/Event_Server/Supplier_Router.cpp | 156 - .../Event_Server/Event_Server/Supplier_Router.h | 72 - .../ASX/Event_Server/Event_Server/event_server.cpp | 252 - examples/ASX/Event_Server/Makefile | 23 - examples/ASX/Event_Server/README | 79 - examples/ASX/Event_Server/Transceiver/Makefile | 204 - .../ASX/Event_Server/Transceiver/transceiver.cpp | 254 - .../ASX/Event_Server/Transceiver/transceiver.dsp | 70 - .../ASX/Event_Server/Transceiver/transceiver.dsw | 29 - .../ASX/Event_Server/Transceiver/transceiver.h | 61 - examples/ASX/Makefile | 25 - examples/ASX/Message_Queue/Bounded_Buffer.dsp | 91 - examples/ASX/Message_Queue/Buffer_Stream.dsp | 91 - examples/ASX/Message_Queue/Makefile | 415 - .../ASX/Message_Queue/Message_Queue_Example.dsw | 53 - examples/ASX/Message_Queue/Priority_Buffer.dsp | 91 - examples/ASX/Message_Queue/bounded_buffer.cpp | 138 - examples/ASX/Message_Queue/buffer_stream.cpp | 308 - examples/ASX/Message_Queue/priority_buffer.cpp | 143 - .../ASX/UPIPE_Event_Server/Consumer_Router.cpp | 150 - examples/ASX/UPIPE_Event_Server/Consumer_Router.h | 53 - examples/ASX/UPIPE_Event_Server/Event_Analyzer.cpp | 72 - examples/ASX/UPIPE_Event_Server/Event_Analyzer.h | 38 - examples/ASX/UPIPE_Event_Server/Makefile | 734 - examples/ASX/UPIPE_Event_Server/Options.cpp | 193 - examples/ASX/UPIPE_Event_Server/Options.h | 88 - examples/ASX/UPIPE_Event_Server/Options.i | 161 - examples/ASX/UPIPE_Event_Server/Peer_Router.cpp | 274 - examples/ASX/UPIPE_Event_Server/Peer_Router.h | 126 - .../ASX/UPIPE_Event_Server/Supplier_Router.cpp | 160 - examples/ASX/UPIPE_Event_Server/Supplier_Router.h | 57 - .../ASX/UPIPE_Event_Server/UPIPE_Event_Server.dsp | 115 - .../ASX/UPIPE_Event_Server/UPIPE_Event_Server.dsw | 29 - examples/ASX/UPIPE_Event_Server/event_server.cpp | 254 - examples/Bounded_Packet_Relay/BPR_Drivers.cpp | 531 - examples/Bounded_Packet_Relay/BPR_Drivers.h | 287 - examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp | 320 - examples/Bounded_Packet_Relay/BPR_Drivers_T.h | 178 - .../Bounded_Packet_Relay/Bounded_Packet_Relay.dsp | 114 - .../Bounded_Packet_Relay/Bounded_Packet_Relay.dsw | 29 - examples/Bounded_Packet_Relay/Makefile | 459 - examples/Bounded_Packet_Relay/README | 194 - .../Thread_Bounded_Packet_Relay.cpp | 805 - .../Thread_Bounded_Packet_Relay.h | 402 - examples/Bounded_Packet_Relay/bpr_thread.cpp | 119 - examples/CORBA/Makefile | 65 - examples/CORBA/Test.idl | 8 - examples/CORBA/Test_i.cpp | 12 - examples/CORBA/Test_i.h | 19 - examples/CORBA/client.cpp | 27 - examples/CORBA/server.cpp | 39 - examples/Configuration/Configuration.dsw | 29 - examples/Configuration/Makefile | 42 - examples/Configuration/Test.dsp | 102 - examples/Configuration/config_test.cpp | 334 - examples/Connection/Makefile | 25 - examples/Connection/blocking/README | 36 - examples/Connection/blocking/SPIPE-acceptor.cpp | 205 - examples/Connection/blocking/SPIPE-acceptor.h | 70 - examples/Connection/blocking/SPIPE-connector.cpp | 242 - examples/Connection/blocking/SPIPE-connector.h | 80 - examples/Connection/blocking/SPIPE.dsp | 77 - examples/Connection/blocking/SPIPE.dsw | 41 - examples/Connection/blocking/acceptor.dsp | 77 - .../Connection/blocking/test_spipe_acceptor.cpp | 22 - .../Connection/blocking/test_spipe_connector.cpp | 21 - examples/Connection/misc/Connection_Handler.cpp | 245 - examples/Connection/misc/Connection_Handler.h | 45 - examples/Connection/misc/Makefile | 371 - examples/Connection/misc/test_upipe.cpp | 156 - examples/Connection/misc/test_upipe.h | 75 - examples/Connection/non_blocking/CPP-acceptor.cpp | 249 - examples/Connection/non_blocking/CPP-acceptor.h | 92 - examples/Connection/non_blocking/CPP-connector.cpp | 301 - examples/Connection/non_blocking/CPP-connector.h | 94 - examples/Connection/non_blocking/Makefile | 1598 - examples/Connection/non_blocking/README | 28 - examples/Connection/non_blocking/non_blocking.dsp | 73 - examples/Connection/non_blocking/non_blocking.dsw | 41 - examples/Connection/non_blocking/server.dsp | 73 - .../non_blocking/test_lsock_acceptor.cpp | 59 - .../non_blocking/test_lsock_connector.cpp | 69 - .../Connection/non_blocking/test_sock_acceptor.cpp | 45 - .../non_blocking/test_sock_connector.cpp | 72 - .../non_blocking/test_spipe_acceptor.cpp | 55 - .../non_blocking/test_spipe_connector.cpp | 64 - .../Connection/non_blocking/test_tli_acceptor.cpp | 53 - .../Connection/non_blocking/test_tli_connector.cpp | 64 - examples/DLL/Dll.dsw | 53 - examples/DLL/Magazine.h | 42 - examples/DLL/Main.dsp | 92 - examples/DLL/Makefile | 43 - examples/DLL/Makefile.Newsweek | 43 - examples/DLL/Makefile.Today | 47 - examples/DLL/Newsweek.cpp | 29 - examples/DLL/Newsweek.dsp | 107 - examples/DLL/Newsweek.h | 45 - examples/DLL/README | 47 - examples/DLL/Today.cpp | 29 - examples/DLL/Today.dsp | 109 - examples/DLL/Today.h | 46 - examples/DLL/test_dll.cpp | 78 - examples/IOStream/Makefile | 25 - examples/IOStream/README | 22 - examples/IOStream/client/Makefile | 83 - examples/IOStream/client/iostream_client.cpp | 75 - examples/IOStream/server/Makefile | 201 - examples/IOStream/server/iostream_server.cpp | 150 - examples/IOStream/server/iostream_server.h | 50 - examples/IPC_SAP/ATM_SAP/ATM_SAP.dsw | 41 - examples/IPC_SAP/ATM_SAP/CPP-client.cpp | 200 - examples/IPC_SAP/ATM_SAP/CPP-server.cpp | 154 - examples/IPC_SAP/ATM_SAP/CPP_client.dsp | 106 - examples/IPC_SAP/ATM_SAP/CPP_server.dsp | 106 - examples/IPC_SAP/ATM_SAP/Makefile | 45 - examples/IPC_SAP/DEV_SAP/Makefile | 22 - examples/IPC_SAP/DEV_SAP/README | 23 - examples/IPC_SAP/DEV_SAP/reader/Makefile | 82 - examples/IPC_SAP/DEV_SAP/reader/reader.cpp | 65 - examples/IPC_SAP/DEV_SAP/writer/Makefile | 82 - examples/IPC_SAP/DEV_SAP/writer/writer.cpp | 71 - examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp | 38 - examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp | 43 - examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp | 25 - examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp | 26 - examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp | 114 - examples/IPC_SAP/FIFO_SAP/Makefile | 177 - examples/IPC_SAP/FILE_SAP/File_sap.dsw | 29 - examples/IPC_SAP/FILE_SAP/Makefile | 75 - examples/IPC_SAP/FILE_SAP/client.cpp | 87 - examples/IPC_SAP/FILE_SAP/client.dsp | 57 - examples/IPC_SAP/FILE_SAP/testfile | 1 - examples/IPC_SAP/Makefile | 27 - examples/IPC_SAP/SOCK_SAP/C-inclient.cpp | 77 - examples/IPC_SAP/SOCK_SAP/C-inserver.cpp | 109 - examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp | 409 - examples/IPC_SAP/SOCK_SAP/CPP-inclient.h | 108 - examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp | 584 - examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.h | 43 - examples/IPC_SAP/SOCK_SAP/CPP-inserver-poll.cpp | 203 - examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp | 388 - examples/IPC_SAP/SOCK_SAP/CPP-memclient.cpp | 56 - examples/IPC_SAP/SOCK_SAP/CPP-memserver.cpp | 70 - examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp | 68 - examples/IPC_SAP/SOCK_SAP/CPP-unserver.cpp | 157 - examples/IPC_SAP/SOCK_SAP/CPP_inclient.dsp | 70 - examples/IPC_SAP/SOCK_SAP/CPP_inserver.dsp | 70 - examples/IPC_SAP/SOCK_SAP/CPP_memclient.dsp | 73 - examples/IPC_SAP/SOCK_SAP/CPP_memserver.dsp | 69 - examples/IPC_SAP/SOCK_SAP/C_inserver.dsp | 70 - examples/IPC_SAP/SOCK_SAP/FD-unclient.cpp | 56 - examples/IPC_SAP/SOCK_SAP/FD-unserver.cpp | 94 - examples/IPC_SAP/SOCK_SAP/Makefile | 684 - examples/IPC_SAP/SOCK_SAP/README | 46 - examples/IPC_SAP/SOCK_SAP/SOCK_SAP.dsp | 70 - examples/IPC_SAP/SOCK_SAP/SOCK_SAP.dsw | 89 - examples/IPC_SAP/SOCK_SAP/local_data | 1 - examples/IPC_SAP/SOCK_SAP/run_test | 36 - examples/IPC_SAP/SOCK_SAP/summarize | 45 - examples/IPC_SAP/SPIPE_SAP/Makefile | 316 - examples/IPC_SAP/SPIPE_SAP/NPClient.cpp | 58 - examples/IPC_SAP/SPIPE_SAP/NPServer.cpp | 66 - examples/IPC_SAP/SPIPE_SAP/client.cpp | 44 - examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp | 54 - examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp | 51 - examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp | 59 - examples/IPC_SAP/SPIPE_SAP/producer_read.cpp | 50 - examples/IPC_SAP/SPIPE_SAP/server.cpp | 120 - examples/IPC_SAP/SPIPE_SAP/shared.h | 10 - examples/IPC_SAP/SSL_SAP/Makefile | 651 - examples/IPC_SAP/SSL_SAP/README | 17 - examples/IPC_SAP/SSL_SAP/SSL-client-simple.cpp | 376 - examples/IPC_SAP/SSL_SAP/SSL-client-simple.h | 98 - examples/IPC_SAP/SSL_SAP/SSL-client.cpp | 422 - examples/IPC_SAP/SSL_SAP/SSL-client.dsp | 70 - examples/IPC_SAP/SSL_SAP/SSL-client.h | 110 - examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp | 585 - examples/IPC_SAP/SSL_SAP/SSL-server-fancy.h | 44 - examples/IPC_SAP/SSL_SAP/SSL-server-poll.cpp | 202 - examples/IPC_SAP/SSL_SAP/SSL-server-simple.cpp | 365 - examples/IPC_SAP/SSL_SAP/SSL-server.cpp | 395 - examples/IPC_SAP/SSL_SAP/SSL-server.dsp | 63 - examples/IPC_SAP/SSL_SAP/SSL_SOCK_SAP.dsw | 41 - examples/IPC_SAP/SSL_SAP/dummy.pem | 19 - examples/IPC_SAP/SSL_SAP/key.pem | 9 - examples/IPC_SAP/SSL_SAP/local_data | 1 - examples/IPC_SAP/SSL_SAP/summarize | 45 - examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp | 161 - examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp | 113 - examples/IPC_SAP/TLI_SAP/CPP-client.cpp | 92 - examples/IPC_SAP/TLI_SAP/CPP-server.cpp | 86 - examples/IPC_SAP/TLI_SAP/Makefile | 380 - examples/IPC_SAP/TLI_SAP/db-client.cpp | 57 - examples/IPC_SAP/TLI_SAP/db-server.cpp | 120 - examples/IPC_SAP/TLI_SAP/ftp-client.cpp | 46 - examples/IPC_SAP/TLI_SAP/ftp-server.cpp | 82 - examples/IPC_SAP/UPIPE_SAP/Makefile | 505 - examples/IPC_SAP/UPIPE_SAP/ex1.cpp | 181 - examples/IPC_SAP/UPIPE_SAP/ex2.cpp | 177 - examples/IPC_SAP/UPIPE_SAP/ex3.cpp | 157 - examples/Log_Msg/Callback.dsp | 61 - examples/Log_Msg/Log_Msg.dsp | 61 - examples/Log_Msg/Makefile | 95 - examples/Log_Msg/Ostream.dsp | 61 - examples/Log_Msg/README | 65 - examples/Log_Msg/test_callback.cpp | 159 - examples/Log_Msg/test_log_msg.cpp | 190 - examples/Log_Msg/test_ostream.cpp | 71 - examples/Logger/Acceptor-server/Makefile | 200 - examples/Logger/Acceptor-server/server_loggerd.cpp | 230 - examples/Logger/Acceptor-server/server_loggerd.dsp | 70 - examples/Logger/Acceptor-server/server_loggerd.dsw | 29 - examples/Logger/Acceptor-server/server_loggerd.h | 55 - examples/Logger/Makefile | 27 - examples/Logger/README | 32 - examples/Logger/client/Makefile | 77 - examples/Logger/client/client.dsp | 69 - examples/Logger/client/client.dsw | 29 - examples/Logger/client/logging_app.cpp | 54 - examples/Logger/simple-server/Logging_Acceptor.cpp | 84 - examples/Logger/simple-server/Logging_Acceptor.h | 59 - examples/Logger/simple-server/Logging_Handler.cpp | 158 - examples/Logger/simple-server/Logging_Handler.h | 70 - examples/Logger/simple-server/Makefile | 269 - examples/Logger/simple-server/Reactor_Singleton.h | 32 - examples/Logger/simple-server/server_loggerd.cpp | 85 - examples/Logger/simple-server/server_loggerd.dsp | 90 - examples/Logger/simple-server/server_loggerd.dsw | 29 - examples/Makefile | 44 - examples/Map_Manager/Makefile | 133 - examples/Map_Manager/test_hash_map_manager.cpp | 106 - examples/Mem_Map/IO-tests/IO_Test.cpp | 231 - examples/Mem_Map/IO-tests/IO_Test.h | 96 - examples/Mem_Map/IO-tests/Makefile | 71 - examples/Mem_Map/IO-tests/test_io.cpp | 203 - examples/Mem_Map/Makefile | 22 - examples/Mem_Map/file-reverse/Makefile | 67 - examples/Mem_Map/file-reverse/file-reverse.cpp | 57 - examples/Mem_Map/file-reverse/file_reverse.dsp | 90 - examples/Mem_Map/file-reverse/file_reverse.dsw | 29 - examples/Misc/Makefile | 486 - examples/Misc/test_XtReactor1.cpp | 175 - examples/Misc/test_XtReactor2.cpp | 104 - examples/Misc/test_dump.cpp | 42 - examples/Misc/test_dump.h | 50 - examples/Misc/test_get_opt.cpp | 52 - examples/Misc/test_profile_timer.cpp | 34 - examples/Misc/test_read_buffer.cpp | 26 - examples/Misc/test_set.cpp | 16 - examples/Misc/test_sstring.cpp | 24 - examples/Misc/test_trace.cpp | 113 - examples/NT_Service/NT_Service.dsp | 100 - examples/NT_Service/NT_Service.dsw | 29 - examples/NT_Service/README | 45 - examples/NT_Service/main.cpp | 206 - examples/NT_Service/ntsvc.cpp | 103 - examples/NT_Service/ntsvc.h | 63 - examples/Naming/Makefile | 364 - examples/Naming/Naming.dsp | 69 - examples/Naming/Naming.dsw | 53 - examples/Naming/multiple_contexts.dsp | 70 - examples/Naming/non_existent.dsp | 70 - examples/Naming/test_multiple_contexts.cpp | 81 - examples/Naming/test_non_existent.cpp | 51 - examples/Naming/test_open.cpp | 77 - examples/Naming/test_writers.cpp | 70 - examples/OS/Makefile | 21 - examples/OS/Process/Makefile | 46 - examples/OS/Process/Process.dsp | 102 - examples/OS/Process/Process.dsw | 41 - examples/OS/Process/README | 55 - examples/OS/Process/imore.cpp | 263 - examples/OS/Process/imore.dsp | 102 - examples/OS/Process/process.cpp | 551 - examples/QOS/Makefile | 56 - examples/QOS/QOS.dsw | 41 - examples/QOS/QosEvent.h | 186 - examples/QOS/README | 63 - examples/QOS/Receiver_QOS_Event_Handler.cpp | 134 - examples/QOS/Receiver_QOS_Event_Handler.h | 59 - examples/QOS/Sender_QOS_Event_Handler.cpp | 128 - examples/QOS/Sender_QOS_Event_Handler.h | 57 - examples/QOS/client.cpp | 829 - examples/QOS/client.dsp | 114 - examples/QOS/server.cpp | 866 - examples/QOS/server.dsp | 114 - examples/README | 83 - examples/Reactor/Dgram/CODgram.cpp | 250 - examples/Reactor/Dgram/CODgram.dsp | 89 - examples/Reactor/Dgram/Dgram.cpp | 254 - examples/Reactor/Dgram/Dgram.dsp | 89 - examples/Reactor/Dgram/Dgram.dsw | 41 - examples/Reactor/Dgram/Makefile | 225 - examples/Reactor/FIFO/Makefile | 161 - examples/Reactor/FIFO/client.cpp | 21 - examples/Reactor/FIFO/server.cpp | 84 - examples/Reactor/Makefile | 25 - examples/Reactor/Misc/Makefile | 826 - examples/Reactor/Misc/Misc.dsp | 70 - examples/Reactor/Misc/Misc.dsw | 101 - examples/Reactor/Misc/demuxing.dsp | 70 - examples/Reactor/Misc/early_timeouts.dsp | 57 - examples/Reactor/Misc/notification.cpp | 382 - examples/Reactor/Misc/notification.dsp | 70 - examples/Reactor/Misc/pingpong.cpp | 292 - examples/Reactor/Misc/reactors.dsp | 57 - examples/Reactor/Misc/signal_tester.cpp | 221 - examples/Reactor/Misc/signals_1.dsp | 57 - examples/Reactor/Misc/signals_2.dsp | 57 - examples/Reactor/Misc/test_demuxing.cpp | 380 - examples/Reactor/Misc/test_early_timeouts.cpp | 110 - examples/Reactor/Misc/test_event_handler_t.cpp | 54 - examples/Reactor/Misc/test_reactors.cpp | 200 - examples/Reactor/Misc/test_signals.cpp | 226 - examples/Reactor/Misc/test_signals_1.cpp | 111 - examples/Reactor/Misc/test_signals_2.cpp | 289 - examples/Reactor/Misc/test_time_value.cpp | 72 - examples/Reactor/Misc/test_timer_queue.cpp | 94 - examples/Reactor/Multicast/Log_Wrapper.cpp | 72 - examples/Reactor/Multicast/Log_Wrapper.h | 68 - examples/Reactor/Multicast/Makefile | 129 - examples/Reactor/Multicast/Multicast.dsw | 41 - examples/Reactor/Multicast/README | 15 - examples/Reactor/Multicast/client.cpp | 120 - examples/Reactor/Multicast/client.dsp | 94 - examples/Reactor/Multicast/server.cpp | 214 - examples/Reactor/Multicast/server.dsp | 94 - examples/Reactor/Ntalker/Makefile | 145 - examples/Reactor/Ntalker/README | 17 - examples/Reactor/Ntalker/ntalker.cpp | 227 - examples/Reactor/Ntalker/ntalker.dsp | 65 - examples/Reactor/Ntalker/ntalker.dsw | 29 - examples/Reactor/Proactor/Aio_Platform_Test_C.cpp | 137 - examples/Reactor/Proactor/Makefile | 37 - examples/Reactor/Proactor/README | 77 - examples/Reactor/Proactor/post_completions.cpp | 291 - examples/Reactor/Proactor/post_completions.dsp | 64 - examples/Reactor/Proactor/simple_test_proactor.cpp | 260 - examples/Reactor/Proactor/test_aiocb.cpp | 230 - examples/Reactor/Proactor/test_aiocb_ace.cpp | 255 - examples/Reactor/Proactor/test_aiosig.cpp | 294 - examples/Reactor/Proactor/test_aiosig_ace.cpp | 312 - examples/Reactor/Proactor/test_cancel.cpp | 274 - examples/Reactor/Proactor/test_cancel.dsp | 61 - examples/Reactor/Proactor/test_end_event_loop.cpp | 170 - examples/Reactor/Proactor/test_end_event_loop.dsp | 60 - examples/Reactor/Proactor/test_multiple_loops.cpp | 134 - examples/Reactor/Proactor/test_multiple_loops.dsp | 71 - examples/Reactor/Proactor/test_proactor.cpp | 687 - examples/Reactor/Proactor/test_proactor.dsp | 66 - examples/Reactor/Proactor/test_proactor.dsw | 89 - examples/Reactor/Proactor/test_timeout.cpp | 133 - examples/Reactor/Proactor/test_timeout.dsp | 70 - examples/Reactor/Proactor/test_timeout_st.cpp | 98 - examples/Reactor/README | 20 - examples/Reactor/WFMO_Reactor/APC.DSP | 58 - examples/Reactor/WFMO_Reactor/Abondoned.dsp | 58 - examples/Reactor/WFMO_Reactor/Console_Input.dsp | 59 - .../Reactor/WFMO_Reactor/Directory_Changes.dsp | 59 - examples/Reactor/WFMO_Reactor/Exceptions.dsp | 59 - examples/Reactor/WFMO_Reactor/Handle_Close.dsp | 58 - examples/Reactor/WFMO_Reactor/Multithreading.dsp | 59 - examples/Reactor/WFMO_Reactor/Network_Events.dsp | 59 - .../Reactor/WFMO_Reactor/Prerun_State_Changes.dsp | 60 - examples/Reactor/WFMO_Reactor/Registration.dsp | 59 - examples/Reactor/WFMO_Reactor/Registry_Changes.dsp | 59 - examples/Reactor/WFMO_Reactor/Removals.dsp | 58 - examples/Reactor/WFMO_Reactor/Talker.dsp | 58 - examples/Reactor/WFMO_Reactor/Timeouts.dsp | 58 - examples/Reactor/WFMO_Reactor/WFMO_Reactor.dsw | 197 - examples/Reactor/WFMO_Reactor/Window_Messages.dsp | 59 - examples/Reactor/WFMO_Reactor/test_abandoned.cpp | 122 - examples/Reactor/WFMO_Reactor/test_apc.cpp | 103 - .../Reactor/WFMO_Reactor/test_console_input.cpp | 84 - .../WFMO_Reactor/test_directory_changes.cpp | 115 - examples/Reactor/WFMO_Reactor/test_exceptions.cpp | 98 - .../Reactor/WFMO_Reactor/test_handle_close.cpp | 300 - .../Reactor/WFMO_Reactor/test_multithreading.cpp | 246 - .../Reactor/WFMO_Reactor/test_network_events.cpp | 191 - .../WFMO_Reactor/test_prerun_state_changes.cpp | 61 - .../Reactor/WFMO_Reactor/test_registration.cpp | 151 - .../Reactor/WFMO_Reactor/test_registry_changes.cpp | 133 - examples/Reactor/WFMO_Reactor/test_removals.cpp | 103 - examples/Reactor/WFMO_Reactor/test_talker.cpp | 558 - examples/Reactor/WFMO_Reactor/test_timeouts.cpp | 80 - .../Reactor/WFMO_Reactor/test_window_messages.cpp | 85 - examples/Registry/Registry.dsp | 69 - examples/Registry/Registry.dsw | 41 - examples/Registry/test_registry_iterator.cpp | 133 - examples/Registry/test_registry_update.cpp | 149 - examples/Registry/update.dsp | 69 - examples/Service_Configurator/IPC-tests/Makefile | 24 - examples/Service_Configurator/IPC-tests/README | 118 - .../Service_Configurator/IPC-tests/client/Makefile | 435 - .../IPC-tests/client/broadcast_client_test.cpp | 57 - .../IPC-tests/client/local_data | 22 - .../IPC-tests/client/local_dgram_client_test.cpp | 122 - .../IPC-tests/client/local_fifo_client_test.cpp | 96 - .../IPC-tests/client/local_pipe_client_test.cpp | 145 - .../IPC-tests/client/local_spipe_client_test.cpp | 103 - .../IPC-tests/client/local_stream_client_test.cpp | 109 - .../IPC-tests/client/remote_data | 22 - .../IPC-tests/client/remote_data1 | 22 - .../IPC-tests/client/remote_data2 | 22 - .../IPC-tests/client/remote_data3 | 22 - .../IPC-tests/client/remote_data4 | 22 - .../IPC-tests/client/remote_dgram_client_test.cpp | 89 - .../client/remote_service_directory_test.cpp | 83 - .../IPC-tests/client/remote_stream_client_test.cpp | 129 - .../client/remote_thr_stream_client_test.cpp | 119 - .../IPC-tests/server/Handle_Broadcast.cpp | 38 - .../IPC-tests/server/Handle_Broadcast.h | 46 - .../IPC-tests/server/Handle_Broadcast.i | 109 - .../IPC-tests/server/Handle_L_CODgram.cpp | 18 - .../IPC-tests/server/Handle_L_CODgram.h | 49 - .../IPC-tests/server/Handle_L_CODgram.i | 119 - .../IPC-tests/server/Handle_L_Dgram.cpp | 17 - .../IPC-tests/server/Handle_L_Dgram.h | 49 - .../IPC-tests/server/Handle_L_Dgram.i | 108 - .../IPC-tests/server/Handle_L_FIFO.cpp | 38 - .../IPC-tests/server/Handle_L_FIFO.h | 47 - .../IPC-tests/server/Handle_L_FIFO.i | 97 - .../IPC-tests/server/Handle_L_Pipe.cpp | 64 - .../IPC-tests/server/Handle_L_Pipe.h | 54 - .../IPC-tests/server/Handle_L_Pipe.i | 92 - .../IPC-tests/server/Handle_L_SPIPE.cpp | 18 - .../IPC-tests/server/Handle_L_SPIPE.h | 50 - .../IPC-tests/server/Handle_L_SPIPE.i | 119 - .../IPC-tests/server/Handle_L_Stream.cpp | 21 - .../IPC-tests/server/Handle_L_Stream.h | 53 - .../IPC-tests/server/Handle_L_Stream.i | 146 - .../IPC-tests/server/Handle_R_Dgram.cpp | 38 - .../IPC-tests/server/Handle_R_Dgram.h | 45 - .../IPC-tests/server/Handle_R_Dgram.i | 105 - .../IPC-tests/server/Handle_R_Stream.cpp | 41 - .../IPC-tests/server/Handle_R_Stream.h | 51 - .../IPC-tests/server/Handle_R_Stream.i | 147 - .../IPC-tests/server/Handle_Thr_Stream.cpp | 221 - .../IPC-tests/server/Handle_Thr_Stream.h | 79 - .../IPC-tests/server/Handle_Thr_Stream.i | 1 - .../IPC-tests/server/Handle_Timeout.cpp | 36 - .../IPC-tests/server/Handle_Timeout.h | 41 - .../IPC-tests/server/Handle_Timeout.i | 84 - .../Service_Configurator/IPC-tests/server/Makefile | 1354 - .../IPC-tests/server/server_test.cpp | 42 - .../Service_Configurator/IPC-tests/server/svc.conf | 19 - examples/Service_Configurator/Makefile | 22 - examples/Service_Configurator/Misc/Makefile | 219 - examples/Service_Configurator/Misc/Misc.dsw | 44 - examples/Service_Configurator/Misc/README | 23 - examples/Service_Configurator/Misc/Timer.dsp | 107 - .../Service_Configurator/Misc/Timer_Service.cpp | 128 - examples/Service_Configurator/Misc/Timer_Service.h | 65 - examples/Service_Configurator/Misc/main.cpp | 78 - examples/Service_Configurator/Misc/main.dsp | 94 - examples/Service_Configurator/Misc/svc.conf1 | 8 - examples/Service_Configurator/Misc/svc.conf2 | 8 - examples/Shared_Malloc/Makefile | 498 - examples/Shared_Malloc/Malloc.cpp | 123 - examples/Shared_Malloc/Malloc.h | 29 - examples/Shared_Malloc/Options.cpp | 192 - examples/Shared_Malloc/Options.h | 85 - examples/Shared_Malloc/Shared_Malloc.dsw | 64 - examples/Shared_Malloc/malloc.dsp | 117 - examples/Shared_Malloc/multiple_mallocs.dsp | 103 - examples/Shared_Malloc/persistence.dsp | 103 - .../Shared_Malloc/position_independent_malloc.dsp | 117 - examples/Shared_Malloc/test_malloc.cpp | 221 - examples/Shared_Malloc/test_multiple_mallocs.cpp | 134 - examples/Shared_Malloc/test_persistence.cpp | 347 - .../test_position_independent_malloc.cpp | 209 - .../test_position_independent_malloc.h | 26 - examples/Shared_Memory/Makefile | 96 - examples/Shared_Memory/test_MM.cpp | 65 - examples/Shared_Memory/test_SV.cpp | 62 - examples/System_V_IPC/Makefile | 32 - examples/System_V_IPC/README | 13 - .../System_V_IPC/SV_Message_Queues/MQ_Client.cpp | 35 - .../System_V_IPC/SV_Message_Queues/MQ_Server.cpp | 61 - examples/System_V_IPC/SV_Message_Queues/Makefile | 247 - .../System_V_IPC/SV_Message_Queues/TMQ_Client.cpp | 49 - .../System_V_IPC/SV_Message_Queues/TMQ_Server.cpp | 66 - examples/System_V_IPC/SV_Message_Queues/test.h | 58 - examples/System_V_IPC/SV_Semaphores/Makefile | 175 - .../SV_Semaphores/Semaphore_Client.cpp | 31 - .../SV_Semaphores/Semaphore_Server.cpp | 42 - .../System_V_IPC/SV_Semaphores/Semaphore_Test.h | 11 - examples/System_V_IPC/SV_Semaphores/Semaphores.cpp | 94 - .../System_V_IPC/SV_Semaphores/Semaphores_1.cpp | 104 - .../System_V_IPC/SV_Semaphores/Semaphores_2.cpp | 125 - examples/System_V_IPC/SV_Shared_Memory/Makefile | 68 - .../SV_Shared_Memory/SV_Shared_Memory_Test.cpp | 62 - .../SV_Shared_Memory/SV_Shared_Memory_Test.h | 12 - examples/Threads/Makefile | 2366 -- examples/Threads/TSS_Data.h | 38 - examples/Threads/TSS_Obj.h | 38 - examples/Threads/TSS_Task.h | 42 - examples/Threads/auto_event.cpp | 120 - examples/Threads/barrier1.cpp | 82 - examples/Threads/barrier1.dsp | 69 - examples/Threads/barrier2.cpp | 317 - examples/Threads/barrier2.dsp | 69 - examples/Threads/cancel.cpp | 74 - examples/Threads/cancel.dsp | 69 - examples/Threads/future1.cpp | 430 - examples/Threads/future1.dsp | 69 - examples/Threads/future2.cpp | 552 - examples/Threads/future2.dsp | 69 - examples/Threads/manual_event.cpp | 116 - examples/Threads/manual_event.dsp | 70 - examples/Threads/process_manager.cpp | 294 - examples/Threads/process_mutex.cpp | 71 - examples/Threads/process_mutex.dsp | 70 - examples/Threads/process_semaphore.cpp | 60 - examples/Threads/process_semaphore.dsp | 70 - examples/Threads/reader_writer.cpp | 197 - examples/Threads/reader_writer.dsp | 70 - examples/Threads/recursive_mutex.cpp | 110 - examples/Threads/recursive_mutex.dsp | 70 - examples/Threads/task_five.cpp | 175 - examples/Threads/task_five.dsp | 56 - examples/Threads/task_four.cpp | 305 - examples/Threads/task_four.dsp | 69 - examples/Threads/task_one.cpp | 100 - examples/Threads/task_one.dsp | 69 - examples/Threads/task_three.cpp | 251 - examples/Threads/task_three.dsp | 70 - examples/Threads/task_two.cpp | 153 - examples/Threads/task_two.dsp | 69 - examples/Threads/test.dsp | 70 - examples/Threads/test.dsw | 281 - examples/Threads/test_auto_event.cpp | 113 - examples/Threads/test_barrier1.cpp | 84 - examples/Threads/test_barrier2.cpp | 269 - examples/Threads/test_cancel.cpp | 72 - examples/Threads/test_future1.cpp | 420 - examples/Threads/test_future2.cpp | 524 - examples/Threads/test_manual_event.cpp | 108 - examples/Threads/test_process_mutex.cpp | 68 - examples/Threads/test_process_semaphore.cpp | 56 - examples/Threads/test_reader_writer.cpp | 187 - examples/Threads/test_recursive_mutex.cpp | 108 - examples/Threads/test_task.cpp | 104 - examples/Threads/test_task_four.cpp | 248 - examples/Threads/test_task_one.cpp | 104 - examples/Threads/test_task_three.cpp | 230 - examples/Threads/test_task_two.cpp | 156 - examples/Threads/test_thread_manager.cpp | 104 - examples/Threads/test_thread_pool.cpp | 214 - examples/Threads/test_thread_specific.cpp | 219 - examples/Threads/test_token.cpp | 76 - examples/Threads/test_tss.cpp | 235 - examples/Threads/test_tss1.cpp | 164 - examples/Threads/test_tss2.cpp | 252 - examples/Threads/thread_manager.cpp | 105 - examples/Threads/thread_manager.dsp | 70 - examples/Threads/thread_pool.cpp | 266 - examples/Threads/thread_pool.dsp | 70 - examples/Threads/thread_specific.cpp | 225 - examples/Threads/thread_specific.dsp | 70 - examples/Threads/thread_specific.h | 50 - examples/Threads/token.cpp | 76 - examples/Threads/token.dsp | 69 - examples/Threads/tss1.cpp | 162 - examples/Threads/tss1.dsp | 69 - examples/Threads/tss2.cpp | 199 - examples/Threads/tss2.dsp | 69 - examples/Threads/wfmo.cpp | 123 - examples/Timer_Queue/Async_Timer_Queue_Test.cpp | 308 - examples/Timer_Queue/Async_Timer_Queue_Test.dsp | 100 - examples/Timer_Queue/Async_Timer_Queue_Test.h | 118 - examples/Timer_Queue/Driver.cpp | 155 - examples/Timer_Queue/Driver.h | 135 - examples/Timer_Queue/Makefile | 1049 - examples/Timer_Queue/README | 26 - examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp | 230 - examples/Timer_Queue/Reactor_Timer_Queue_Test.dsp | 93 - examples/Timer_Queue/Reactor_Timer_Queue_Test.h | 148 - examples/Timer_Queue/Thread_Timer_Queue_Test.cpp | 312 - examples/Timer_Queue/Thread_Timer_Queue_Test.dsp | 94 - examples/Timer_Queue/Thread_Timer_Queue_Test.h | 155 - examples/Timer_Queue/Timer_Queue.dsw | 53 - examples/Timer_Queue/main_async.cpp | 53 - examples/Timer_Queue/main_reactor.cpp | 57 - examples/Timer_Queue/main_thread.cpp | 52 - examples/Web_Crawler/Command_Processor.cpp | 137 - examples/Web_Crawler/Command_Processor.h | 98 - examples/Web_Crawler/HTTP_URL.cpp | 84 - examples/Web_Crawler/HTTP_URL.h | 64 - examples/Web_Crawler/Iterators.cpp | 162 - examples/Web_Crawler/Iterators.h | 117 - examples/Web_Crawler/Makefile | 56 - examples/Web_Crawler/Mem_Map_Stream.cpp | 244 - examples/Web_Crawler/Mem_Map_Stream.h | 188 - examples/Web_Crawler/Options.cpp | 175 - examples/Web_Crawler/Options.h | 123 - examples/Web_Crawler/README | 25 - examples/Web_Crawler/URL.cpp | 39 - examples/Web_Crawler/URL.h | 78 - examples/Web_Crawler/URL_Addr.cpp | 229 - examples/Web_Crawler/URL_Addr.h | 108 - examples/Web_Crawler/URL_Status.cpp | 40 - examples/Web_Crawler/URL_Status.h | 61 - examples/Web_Crawler/URL_Visitor.cpp | 725 - examples/Web_Crawler/URL_Visitor.h | 437 - examples/Web_Crawler/URL_Visitor_Factory.cpp | 46 - examples/Web_Crawler/URL_Visitor_Factory.h | 70 - examples/Web_Crawler/Web_Crawler.cpp | 95 - examples/Web_Crawler/Web_Crawler.dsp | 216 - examples/Web_Crawler/Web_Crawler.dsw | 29 - examples/Web_Crawler/Web_Crawler.h | 62 - examples/Web_Crawler/main.cpp | 49 - include/makeinclude/ace_flags.bor | 49 - include/makeinclude/build_core_exe.bor | 9 - include/makeinclude/build_core_library.bor | 9 - include/makeinclude/build_dll.bor | 63 - include/makeinclude/build_example.bor | 12 - include/makeinclude/build_exe.bor | 65 - include/makeinclude/build_lib.bor | 47 - include/makeinclude/build_library.bor | 10 - include/makeinclude/compiler.bor | 143 - include/makeinclude/decorator.bor | 48 - include/makeinclude/macros.GNU | 22 - include/makeinclude/make_flags.bor | 21 - include/makeinclude/outputdir.bor | 70 - include/makeinclude/platform_aix.GNU | 3 - include/makeinclude/platform_aix4.2.GNU | 3 - include/makeinclude/platform_aix4_cset++.GNU | 99 - include/makeinclude/platform_aix4_g++.GNU | 63 - include/makeinclude/platform_aix_g++.GNU | 31 - include/makeinclude/platform_aix_vacpp.GNU | 35 - include/makeinclude/platform_chorus.GNU | 116 - include/makeinclude/platform_chorus4.x_g++.GNU | 57 - include/makeinclude/platform_chorus_ghs.GNU | 77 - include/makeinclude/platform_cray.GNU | 50 - include/makeinclude/platform_dgux4_epc.GNU | 23 - include/makeinclude/platform_dgux4_ghs.GNU | 27 - include/makeinclude/platform_freebsd.GNU | 33 - include/makeinclude/platform_freebsd_pthread.GNU | 8 - include/makeinclude/platform_hpux.GNU | 28 - include/makeinclude/platform_hpux_aCC.GNU | 129 - include/makeinclude/platform_hpux_gcc.GNU | 68 - include/makeinclude/platform_hpux_kcc.GNU | 119 - include/makeinclude/platform_hpux_orbix.GNU | 30 - include/makeinclude/platform_irix5.2.GNU | 21 - include/makeinclude/platform_irix5.3_g++.GNU | 21 - include/makeinclude/platform_irix5.3_sgic++.GNU | 26 - include/makeinclude/platform_irix6.x_common.GNU | 13 - include/makeinclude/platform_irix6.x_g++.GNU | 30 - include/makeinclude/platform_irix6.x_kcc.GNU | 35 - include/makeinclude/platform_irix6.x_sgic++.GNU | 66 - include/makeinclude/platform_linux.GNU | 36 - include/makeinclude/platform_linux_cxx.GNU | 51 - include/makeinclude/platform_linux_kcc.GNU | 64 - include/makeinclude/platform_linux_lxpthread.GNU | 6 - include/makeinclude/platform_linux_lxpthreads.GNU | 86 - include/makeinclude/platform_linux_pthread.GNU | 31 - include/makeinclude/platform_lynxos.GNU | 96 - include/makeinclude/platform_m88k.GNU | 30 - include/makeinclude/platform_mvs.GNU | 34 - include/makeinclude/platform_netbsd.GNU | 28 - include/makeinclude/platform_osf1_3.2.GNU | 27 - include/makeinclude/platform_osf1_4.0.GNU | 73 - include/makeinclude/platform_osf1_4.0_g++.GNU | 25 - include/makeinclude/platform_osf1_4.0_kcc.GNU | 37 - include/makeinclude/platform_osf1_4.0_rcc.GNU | 25 - include/makeinclude/platform_psos_diab.GNU | 189 - include/makeinclude/platform_psos_diab_ppc.GNU | 200 - include/makeinclude/platform_psos_tm.GNU | 47 - include/makeinclude/platform_psosim_g++.GNU | 57 - include/makeinclude/platform_qnx_neutrino.GNU | 35 - include/makeinclude/platform_sco-nothread.GNU | 22 - .../platform_sco5.0.0-CC-fsu-pthread.GNU | 36 - .../makeinclude/platform_sco5.0.0-fsu-pthread.GNU | 46 - .../makeinclude/platform_sco5.0.0-mit-pthread.GNU | 35 - include/makeinclude/platform_sco5.0.0-nothread.GNU | 33 - include/makeinclude/platform_sunos4_g++.GNU | 26 - include/makeinclude/platform_sunos4_lucid.GNU | 21 - include/makeinclude/platform_sunos4_sunc++3.x.GNU | 27 - include/makeinclude/platform_sunos4_sunc++4.x.GNU | 24 - .../platform_sunos4_sunc++4.x_orbix.GNU | 25 - include/makeinclude/platform_sunos5_centerline.GNU | 22 - .../platform_sunos5_centerline_orbix.GNU | 23 - include/makeinclude/platform_sunos5_egcs.GNU | 13 - include/makeinclude/platform_sunos5_g++.GNU | 49 - include/makeinclude/platform_sunos5_ghs.GNU | 38 - include/makeinclude/platform_sunos5_kcc.GNU | 107 - include/makeinclude/platform_sunos5_sunc++.GNU | 197 - .../makeinclude/platform_sunos5_sunc++_orbix.GNU | 7 - include/makeinclude/platform_tandem.GNU | 93 - include/makeinclude/platform_tru64_cxx.GNU | 48 - include/makeinclude/platform_tru64_g++.GNU | 30 - include/makeinclude/platform_unixware_g++.GNU | 24 - include/makeinclude/platform_vxworks5.x_diab.GNU | 153 - include/makeinclude/platform_vxworks5.x_g++.GNU | 254 - include/makeinclude/platform_vxworks5.x_ghs.GNU | 92 - include/makeinclude/recurse.bor | 73 - include/makeinclude/rules.bin.GNU | 29 - include/makeinclude/rules.common.GNU | 17 - include/makeinclude/rules.lib.GNU | 155 - include/makeinclude/rules.local.GNU | 259 - include/makeinclude/rules.nested.GNU | 20 - include/makeinclude/rules.nolocal.GNU | 8 - include/makeinclude/rules.nonested.GNU | 8 - include/makeinclude/wrapper_macros.GNU | 574 - install-sh | 251 - java/ChangeLog | 122 - java/ImageProcessing/ImageProcessing.dsp | 253 - java/ImageProcessing/ImageProcessing.dsw | 29 - java/ImageProcessing/filters/Assert.java | 33 - java/ImageProcessing/filters/BleachFilter.java | 65 - java/ImageProcessing/filters/BlurFilter.java | 95 - java/ImageProcessing/filters/DarkenFilter.java | 48 - java/ImageProcessing/filters/DeSpeckleFilter.java | 123 - java/ImageProcessing/filters/DissolveFilter.java | 52 - java/ImageProcessing/filters/EdgeDetectFilter.java | 250 - java/ImageProcessing/filters/EmbossFilter.java | 86 - java/ImageProcessing/filters/Makefile | 36 - java/ImageProcessing/filters/MedFilter.java | 6 - java/ImageProcessing/filters/OilPaintFilter.java | 97 - java/ImageProcessing/filters/PixelizeFilter.java | 117 - java/ImageProcessing/filters/RandomizeFilter.java | 36 - java/ImageProcessing/filters/RotateFilter.java | 358 - java/ImageProcessing/filters/SharpenFilter.java | 272 - java/ImageProcessing/filters/SpatialFilter.java | 213 - java/ImageProcessing/filters/SpreadFilter.java | 130 - java/ImageProcessing/filters/Timer.java | 23 - java/ImageProcessing/framework/BaseButton.java | 234 - .../ImageProcessing/framework/BenchmarkApplet.java | 622 - java/ImageProcessing/framework/DialogManager.java | 277 - java/ImageProcessing/framework/DialogType.java | 11 - java/ImageProcessing/framework/FileBrowser.java | 173 - java/ImageProcessing/framework/FilePanel.java | 161 - java/ImageProcessing/framework/FilterTest.java | 62 - java/ImageProcessing/framework/GIFHandler.java | 75 - java/ImageProcessing/framework/GifEncoder.java | 693 - java/ImageProcessing/framework/Hierarchy.java | 347 - .../framework/HierarchyAdapter.java | 34 - java/ImageProcessing/framework/Icon.java | 70 - java/ImageProcessing/framework/ImageApp.java | 303 - .../framework/ImageByteCounter.java | 94 - java/ImageProcessing/framework/ImageCanvas.java | 166 - java/ImageProcessing/framework/ImageEncoder.java | 271 - java/ImageProcessing/framework/ImageProcessor.java | 111 - java/ImageProcessing/framework/ImageSender.java | 128 - java/ImageProcessing/framework/IntHashtable.java | 396 - java/ImageProcessing/framework/ListFiles.java | 167 - java/ImageProcessing/framework/LoadURLFrame.java | 142 - java/ImageProcessing/framework/Makefile | 45 - java/ImageProcessing/framework/MedJava.html | 15 - java/ImageProcessing/framework/Options.java | 25 - java/ImageProcessing/framework/SaveURLFrame.java | 133 - java/ImageProcessing/framework/Separator.java | 90 - java/ImageProcessing/framework/ServerHandler.java | 50 - java/ImageProcessing/framework/ServerTest.java | 67 - java/ImageProcessing/framework/StatusDisplay.java | 23 - .../ImageProcessing/framework/StatusIndicator.java | 70 - java/ImageProcessing/framework/TestHandler.java | 149 - java/ImageProcessing/framework/Tester.java | 148 - java/ImageProcessing/framework/doc01.gif | Bin 223 -> 0 bytes java/ImageProcessing/framework/file03.gif | Bin 267 -> 0 bytes java/ImageProcessing/framework/filter.conf | 15 - java/ImageProcessing/framework/help.conf | 216 - java/ImageProcessing/framework/test.html | 19 - java/ImageProcessing/framework/testFilter.conf | 15 - java/JACE/ASX/IOCntlCmds.java | 38 - java/JACE/ASX/IOCntlMsg.java | 124 - java/JACE/ASX/MessageBlock.java | 447 - java/JACE/ASX/MessageQueue.java | 633 - java/JACE/ASX/MessageType.java | 102 - java/JACE/ASX/Module.java | 246 - java/JACE/ASX/Stream.java | 436 - java/JACE/ASX/StreamHead.java | 123 - java/JACE/ASX/StreamTail.java | 114 - java/JACE/ASX/Task.java | 443 - java/JACE/ASX/TaskFlags.java | 49 - java/JACE/ASX/ThruTask.java | 44 - java/JACE/ASX/TimeValue.java | 296 - java/JACE/ASX/TimedWait.java | 157 - java/JACE/ASX/TimeoutException.java | 37 - java/JACE/ASX/package.html | 11 - java/JACE/Concurrency/AbstractLock.java | 269 - java/JACE/Concurrency/Condition.java | 124 - java/JACE/Concurrency/LockAdapter.java | 262 - java/JACE/Concurrency/LockException.java | 28 - java/JACE/Concurrency/Mutex.java | 239 - java/JACE/Concurrency/RWMutex.java | 268 - java/JACE/Concurrency/RenewObject.java | 36 - java/JACE/Concurrency/Semaphore.java | 263 - java/JACE/Concurrency/ThreadManager.java | 113 - java/JACE/Concurrency/Token.java | 301 - java/JACE/Concurrency/WaitObject.java | 39 - java/JACE/Concurrency/package.html | 15 - java/JACE/Connection/AcceptStrategy.java | 87 - java/JACE/Connection/Acceptor.java | 215 - java/JACE/Connection/ActivateStrategy.java | 40 - java/JACE/Connection/Blob.java | 114 - java/JACE/Connection/BlobHandler.java | 35 - java/JACE/Connection/BlobReader.java | 108 - java/JACE/Connection/BlobWriter.java | 224 - java/JACE/Connection/Connector.java | 148 - java/JACE/Connection/CreationStrategy.java | 57 - java/JACE/Connection/HTTPHelper.java | 182 - java/JACE/Connection/StrategyAcceptor.java | 174 - java/JACE/Connection/SvcHandler.java | 101 - java/JACE/Connection/package.html | 7 - java/JACE/Makefile | 234 - java/JACE/Misc/GetOpt.java | 171 - java/JACE/Misc/package.html | 6 - java/JACE/OS/ACE.java | 156 - java/JACE/OS/OS.java | 65 - java/JACE/OS/package.html | 6 - java/JACE/Reactor/EventHandler.java | 43 - java/JACE/Reactor/TimerQueue.java | 437 - java/JACE/Reactor/package.html | 6 - java/JACE/SOCK_SAP/INETAddr.java | 96 - java/JACE/SOCK_SAP/SOCKAcceptor.java | 113 - java/JACE/SOCK_SAP/SOCKConnector.java | 73 - java/JACE/SOCK_SAP/SOCKStream.java | 227 - java/JACE/SOCK_SAP/package.html | 8 - java/JACE/ServiceConfigurator/Service.java | 96 - java/JACE/ServiceConfigurator/ServiceConfig.java | 482 - java/JACE/ServiceConfigurator/ServiceLoader.java | 254 - java/JACE/ServiceConfigurator/ServiceObject.java | 130 - .../ServiceConfigurator/ServiceRepository.java | 274 - java/JACE/ServiceConfigurator/package.html | 10 - java/JACE/Timers/ProfileTimer.java | 46 - java/JACE/Timers/package.html | 8 - java/JACE/makebat.zip | Bin 1326 -> 0 bytes java/JACE/netsvcs/Handler.java | 185 - java/JACE/netsvcs/Logger/LogRecord.java | 290 - java/JACE/netsvcs/Logger/LoggingStrategy.java | 35 - .../JACE/netsvcs/Logger/ServerLoggingAcceptor.java | 147 - java/JACE/netsvcs/Logger/ServerLoggingHandler.java | 60 - java/JACE/netsvcs/Logger/StderrStrategy.java | 36 - java/JACE/netsvcs/Logger/c.bat | 2 - java/JACE/netsvcs/Logger/package.html | 17 - java/JACE/netsvcs/Naming/NameAcceptor.java | 313 - java/JACE/netsvcs/Naming/NameHandler.java | 473 - java/JACE/netsvcs/Naming/NameProxy.java | 405 - java/JACE/netsvcs/Naming/NameReply.java | 169 - java/JACE/netsvcs/Naming/NameRequest.java | 373 - java/JACE/netsvcs/Naming/c.bat | 2 - java/JACE/netsvcs/Naming/package.html | 11 - java/JACE/netsvcs/Server.java | 356 - java/JACE/netsvcs/Time/TSClerkHandler.java | 195 - java/JACE/netsvcs/Time/TSClerkProcessor.java | 307 - java/JACE/netsvcs/Time/TSServerAcceptor.java | 116 - java/JACE/netsvcs/Time/TSServerHandler.java | 53 - java/JACE/netsvcs/Time/TimeInfo.java | 90 - java/JACE/netsvcs/Time/TimeRequest.java | 121 - java/JACE/netsvcs/Time/c.bat | 1 - java/JACE/netsvcs/Time/package.html | 10 - java/JACE/netsvcs/Time/r.bat | 1 - java/JACE/netsvcs/Token/LockHandler.java | 38 - java/JACE/netsvcs/Token/LockHandlerAdapter.java | 380 - java/JACE/netsvcs/Token/LockOperations.java | 16 - java/JACE/netsvcs/Token/LockTypes.java | 19 - java/JACE/netsvcs/Token/MutexHandler.java | 51 - java/JACE/netsvcs/Token/RWMutexHandler.java | 54 - java/JACE/netsvcs/Token/RemoteLock.java | 543 - java/JACE/netsvcs/Token/RemoteMutex.java | 28 - java/JACE/netsvcs/Token/RemoteRWMutex.java | 29 - java/JACE/netsvcs/Token/TokenAcceptor.java | 353 - java/JACE/netsvcs/Token/TokenReply.java | 171 - java/JACE/netsvcs/Token/TokenRequest.java | 426 - java/JACE/netsvcs/Token/TokenRequestHandler.java | 180 - java/JACE/netsvcs/Token/package.html | 16 - java/JACE/netsvcs/package.html | 11 - java/JACE/overview.html | 84 - java/JACE/package.html | 32 - java/JACE/tests/ASX/BufferStreamTest.java | 189 - java/JACE/tests/ASX/MessageQueueTest.java | 54 - java/JACE/tests/ASX/PriorityBufferTest.java | 118 - java/JACE/tests/ASX/TaskTest.java | 95 - java/JACE/tests/ASX/ThreadPoolTest.java | 187 - .../JACE/tests/Concurrency/Condition/Consumer.java | 75 - .../Concurrency/Condition/JoinableThreadGroup.java | 24 - .../JACE/tests/Concurrency/Condition/Producer.java | 70 - .../tests/Concurrency/Condition/QueueTest.java | 68 - .../Concurrency/Condition/SimpleMessageQueue.java | 86 - java/JACE/tests/Concurrency/IterationTest.java | 235 - java/JACE/tests/Concurrency/RWMutexTest.java | 137 - java/JACE/tests/Concurrency/TimingTest.java | 290 - java/JACE/tests/Concurrency/TokenTest.java | 95 - java/JACE/tests/Connection/AcceptorTest.java | 83 - java/JACE/tests/Connection/ClientHandler.java | 77 - java/JACE/tests/Connection/ConnectorTest.java | 78 - java/JACE/tests/Connection/HTTPHelperTest.java | 34 - java/JACE/tests/Connection/ServerHandler.java | 68 - java/JACE/tests/Makefile | 115 - java/JACE/tests/Misc/ParseArgsTest.java | 48 - java/JACE/tests/Reactor/TimeValueTest.java | 52 - java/JACE/tests/Reactor/TimerQueueTest.java | 84 - java/JACE/tests/SOCK_SAP/SOCKAcceptorTest.java | 110 - java/JACE/tests/SOCK_SAP/SOCKConnectorTest.java | 97 - java/JACE/tests/ServiceConfigurator/Main.java | 113 - java/JACE/tests/ServiceConfigurator/svc.conf | 4 - java/JACE/tests/netsvcs/Logger/LoggerTest.java | 115 - java/JACE/tests/netsvcs/Naming/ClientTest.java | 107 - java/JACE/tests/netsvcs/Time/TSClient.java | 37 - java/JACE/tests/netsvcs/Token/ProxyClientTest.java | 200 - java/MSVJProjects.zip | Bin 35698 -> 0 bytes java/README | 40 - java/VERSION | 5 - java/apps/NexusII/README | 58 - java/apps/NexusII/classes/ClientHandler.class | Bin 689 -> 0 bytes java/apps/NexusII/classes/FrameHandler.class | Bin 828 -> 0 bytes java/apps/NexusII/classes/ImageCanvas.class | Bin 1771 -> 0 bytes java/apps/NexusII/classes/NexusClientApplet.class | Bin 581 -> 0 bytes java/apps/NexusII/classes/NexusIIserver.class | Bin 1265 -> 0 bytes java/apps/NexusII/classes/Room.class | Bin 2049 -> 0 bytes java/apps/NexusII/classes/RoomFactory.class | Bin 751 -> 0 bytes java/apps/NexusII/classes/RoomFrame.class | Bin 186 -> 0 bytes java/apps/NexusII/classes/RoomThread.class | Bin 79 -> 0 bytes java/apps/NexusII/classes/awtCommand/CApplet.class | Bin 29 -> 0 bytes java/apps/NexusII/classes/awtCommand/CApplet.java | 199 - java/apps/NexusII/classes/awtCommand/CButton.class | Bin 41 -> 0 bytes java/apps/NexusII/classes/awtCommand/CButton.java | 41 - java/apps/NexusII/classes/awtCommand/CCanvas.class | Bin 2249 -> 0 bytes java/apps/NexusII/classes/awtCommand/CCanvas.java | 381 - java/apps/NexusII/classes/awtCommand/CFrame.class | Bin 3543 -> 0 bytes java/apps/NexusII/classes/awtCommand/CFrame.java | 486 - java/apps/NexusII/classes/awtCommand/CList.class | Bin 825 -> 0 bytes java/apps/NexusII/classes/awtCommand/CList.java | 96 - java/apps/NexusII/classes/awtCommand/CPanel.class | Bin 2246 -> 0 bytes java/apps/NexusII/classes/awtCommand/CPanel.java | 381 - .../NexusII/classes/awtCommand/CTextArea.class | Bin 57 -> 0 bytes .../apps/NexusII/classes/awtCommand/CTextArea.java | 93 - .../NexusII/classes/awtCommand/CTextField.class | Bin 91 -> 0 bytes .../NexusII/classes/awtCommand/CTextField.java | 110 - java/apps/NexusII/classes/awtCommand/Command.class | Bin 253 -> 0 bytes java/apps/NexusII/classes/awtCommand/Command.java | 25 - java/apps/NexusII/classes/commandHandler.class | Bin 58 -> 0 bytes java/apps/NexusII/classes/commandParser.class | Bin 1430 -> 0 bytes java/apps/NexusII/classes/connectionHandler.class | Bin 248 -> 0 bytes java/apps/NexusII/classes/joinHandler.class | Bin 2048 -> 0 bytes java/apps/NexusII/classes/roomHandler.class | Bin 1837 -> 0 bytes java/apps/NexusII/classes/textHandler.class | Bin 1752 -> 0 bytes java/apps/NexusII/src/Consumer.java | 74 - java/apps/NexusII/src/MT_Bounded_Queue.java | 226 - java/apps/NexusII/src/MT_Bounded_Queue_Group.java | 79 - java/apps/NexusII/src/NexusClientApplet.java | 494 - java/apps/NexusII/src/NexusIIserver.java | 280 - java/apps/NexusII/src/Producer.java | 87 - java/apps/NexusII/src/Room.java | 97 - java/apps/NexusII/src/RoomFrame.java | 297 - java/apps/NexusII/src/RoomSpace.java | 110 - java/apps/NexusII/src/Timed_Wait.java | 86 - java/apps/NexusII/src/Timer.java | 31 - java/apps/NexusII/src/commandHandler.java | 44 - java/apps/NexusII/src/commandParser.java | 124 - java/apps/NexusII/src/connectionHandler.java | 236 - java/apps/NexusII/src/consts.java | 40 - java/apps/NexusII/src/dataPacket.java | 124 - java/apps/NexusII/src/joinHandler.java | 181 - java/apps/NexusII/src/makefile | 15 - java/apps/NexusII/src/nexusDemuxThread.java | 97 - java/apps/NexusII/src/roomHandler.java | 125 - java/apps/NexusII/src/socketReaderThread.java | 126 - java/apps/NexusII/src/socketWriterThread.java | 119 - java/apps/NexusII/src/url_to_url.java | 33 - java/apps/NexusII/start | 27 - java/apps/NexusII/start.html | 3 - java/classes/README.TXT | 2 - java/doc/images/GridBagEx.gif | Bin 2453 -> 0 bytes java/doc/images/OpenBookIcon.gif | Bin 2241 -> 0 bytes java/doc/images/blue-ball-small.gif | Bin 255 -> 0 bytes java/doc/images/blue-ball.gif | Bin 925 -> 0 bytes java/doc/images/class-index.gif | Bin 1497 -> 0 bytes java/doc/images/constructor-index.gif | Bin 1711 -> 0 bytes java/doc/images/constructors.gif | Bin 1565 -> 0 bytes java/doc/images/cyan-ball-small.gif | Bin 255 -> 0 bytes java/doc/images/cyan-ball.gif | Bin 925 -> 0 bytes java/doc/images/error-index.gif | Bin 1438 -> 0 bytes java/doc/images/exception-index.gif | Bin 1707 -> 0 bytes java/doc/images/green-ball-small.gif | Bin 102 -> 0 bytes java/doc/images/green-ball.gif | Bin 886 -> 0 bytes java/doc/images/interface-index.gif | Bin 1648 -> 0 bytes java/doc/images/magenta-ball-small.gif | Bin 104 -> 0 bytes java/doc/images/magenta-ball.gif | Bin 896 -> 0 bytes java/doc/images/method-index.gif | Bin 1588 -> 0 bytes java/doc/images/methods.gif | Bin 1403 -> 0 bytes java/doc/images/package-index.gif | Bin 1607 -> 0 bytes java/doc/images/red-ball-small.gif | Bin 255 -> 0 bytes java/doc/images/red-ball.gif | Bin 527 -> 0 bytes java/doc/images/variable-index.gif | Bin 1576 -> 0 bytes java/doc/images/variables.gif | Bin 1380 -> 0 bytes java/doc/images/yellow-ball-small.gif | Bin 255 -> 0 bytes java/doc/images/yellow-ball.gif | Bin 925 -> 0 bytes java/examples/Logger/README | 29 - java/examples/Logger/simple-server/LogRecord.java | 145 - .../Logger/simple-server/LoggerConstants.java | 7 - .../Logger/simple-server/LoggingAcceptor.java | 33 - .../Logger/simple-server/LoggingClient.java | 108 - .../Logger/simple-server/LoggingHandler.java | 121 - java/examples/Logger/simple-server/Makefile | 34 - java/examples/Logger/simple-server/README | 25 - .../Logger/simple-server/SimpleLogger.java | 44 - java/gjt/Assert.java | 33 - java/gjt/Bargauge.java | 80 - java/gjt/Border.java | 105 - java/gjt/Box.java | 81 - java/gjt/BulletinLayout.java | 100 - java/gjt/ButtonPanel.java | 51 - java/gjt/CardPanel.java | 48 - java/gjt/ChoiceCardPanel.java | 53 - java/gjt/ColumnLayout.java | 154 - java/gjt/ComponentScroller.java | 42 - java/gjt/DialogClient.java | 20 - java/gjt/DrawingPanel.java | 72 - java/gjt/DrawnRectangle.java | 136 - java/gjt/EtchedBorder.java | 59 - java/gjt/EtchedRectangle.java | 97 - java/gjt/Etching.java | 22 - java/gjt/ExclusiveImageButtonPanel.java | 47 - java/gjt/FontDialog.java | 362 - java/gjt/GJT.DSP | 456 - java/gjt/GJT.DSW | 29 - java/gjt/GJTDialog.java | 51 - java/gjt/IconCardPanel.java | 55 - java/gjt/ImageButton.java | 209 - java/gjt/ImageButtonController.java | 79 - java/gjt/ImageButtonEvent.java | 103 - java/gjt/ImageButtonPanel.java | 106 - java/gjt/ImageButtonPanelController.java | 47 - java/gjt/ImageCanvas.java | 31 - java/gjt/ImageScroller.java | 62 - java/gjt/LabelCanvas.java | 93 - java/gjt/Makefile | 67 - java/gjt/MessageDialog.java | 77 - java/gjt/MouseController.java | 32 - java/gjt/Orientation.java | 87 - java/gjt/ProgressDialog.java | 67 - java/gjt/QuestionDialog.java | 130 - java/gjt/RadioImageButtonPanelController.java | 45 - java/gjt/RowLayout.java | 153 - java/gjt/Scroller.java | 154 - java/gjt/ScrollerLayout.java | 160 - java/gjt/SelectionEvent.java | 82 - java/gjt/Separator.java | 90 - java/gjt/SpringyImageButtonController.java | 54 - java/gjt/StateButton.java | 45 - java/gjt/StateButtonController.java | 27 - java/gjt/StickyImageButtonController.java | 87 - java/gjt/Stopwatch.java | 94 - java/gjt/StopwatchClient.java | 14 - java/gjt/ThreeDBorder.java | 53 - java/gjt/ThreeDBorderStyle.java | 24 - java/gjt/ThreeDRectangle.java | 105 - java/gjt/Toolbar.java | 58 - java/gjt/Util.java | 69 - java/gjt/YesNoDialog.java | 80 - java/gjt/animation/CollisionArena.java | 39 - java/gjt/animation/CollisionDetector.java | 24 - java/gjt/animation/EdgeCollisionDetector.java | 53 - java/gjt/animation/Playfield.java | 140 - java/gjt/animation/Sequence.java | 119 - java/gjt/animation/Sprite.java | 191 - java/gjt/animation/SpriteCollisionDetector.java | 45 - java/gjt/image/BleachImageFilter.java | 53 - java/gjt/image/DissolveFilter.java | 48 - java/gjt/image/ImageDissolver.java | 132 - java/gjt/rubberband/Rubberband.java | 100 - java/gjt/rubberband/RubberbandEllipse.java | 32 - java/gjt/rubberband/RubberbandLine.java | 25 - java/gjt/rubberband/RubberbandPanel.java | 38 - java/gjt/rubberband/RubberbandRectangle.java | 29 - java/gjt/test/AttributesPanel.java | 78 - java/gjt/test/BargaugeTest.java | 130 - java/gjt/test/BleachImageFilterTest.java | 86 - java/gjt/test/BorderTest.java | 202 - java/gjt/test/BoxTest.java | 100 - java/gjt/test/BumpAnimationTest.java | 107 - java/gjt/test/ChoiceCardPanelTest.java | 34 - java/gjt/test/ColumnLayoutTest.java | 126 - java/gjt/test/ComponentScrollerTest.java | 205 - java/gjt/test/ConnectionsPanel.java | 9 - java/gjt/test/DialogTest.java | 140 - java/gjt/test/DrawnRectangleTest.java | 119 - java/gjt/test/FontDialogTest.java | 95 - java/gjt/test/IconCardPanelTest.java | 47 - java/gjt/test/ImageButtonTest.java | 130 - java/gjt/test/ImageDissolverTest.java | 69 - java/gjt/test/ImageScrollerTest.java | 55 - java/gjt/test/LabelCanvasTest.java | 75 - java/gjt/test/MessageDialogTest.java | 50 - java/gjt/test/OccupationOracle.java | 334 - java/gjt/test/RowLayoutTest.java | 124 - java/gjt/test/RubberbandTest.java | 112 - java/gjt/test/SeparatorTest.java | 64 - java/gjt/test/SimpleAnimationTest.java | 87 - java/gjt/test/SimpleBargaugeTest.java | 61 - java/gjt/test/StateButtonTest.java | 41 - java/gjt/test/TenPixelBorder.java | 44 - java/gjt/test/TitledPanel.java | 22 - java/gjt/test/ToolbarTest.java | 111 - java/gjt/test/TwoDrinkersAnimationTest.java | 130 - java/gjt/test/UnitTest.java | 46 - java/java-ace.gif | Bin 11028 -> 0 bytes java/netsvcs/Logger/DefaultLMR.java | 36 - java/netsvcs/Logger/LogMessageReceiver.java | 33 - java/netsvcs/Logger/LogRecord.java | 188 - java/netsvcs/Logger/Makefile | 23 - java/netsvcs/Logger/ServerLoggingAcceptor.java | 171 - java/netsvcs/Logger/ServerLoggingHandler.java | 105 - java/netsvcs/Naming/Makefile | 24 - java/netsvcs/Naming/NameAcceptor.java | 306 - java/netsvcs/Naming/NameHandler.java | 521 - java/netsvcs/Naming/NameProxy.java | 351 - java/netsvcs/Naming/NameReply.java | 145 - java/netsvcs/Naming/NameRequest.java | 331 - java/netsvcs/Time/Clerk.java | 23 - java/netsvcs/Time/Makefile | 26 - java/netsvcs/Time/Server.java | 23 - java/netsvcs/Time/TSClerkHandler.java | 296 - java/netsvcs/Time/TSClerkProcessor.java | 267 - java/netsvcs/Time/TSRequestAcceptor.java | 142 - java/netsvcs/Time/TSRequestHandler.java | 106 - java/netsvcs/Time/TSServerAcceptor.java | 100 - java/netsvcs/Time/TSServerHandler.java | 99 - java/src/ACE.java | 164 - java/src/AcceptStrategy.java | 89 - java/src/Acceptor.java | 216 - java/src/ActivateStrategy.java | 43 - java/src/AddServiceObjectNode.java | 54 - java/src/Blob.java | 94 - java/src/BlobHandler.java | 35 - java/src/BlobReader.java | 104 - java/src/BlobWriter.java | 220 - java/src/ClassNameGenerator.java | 181 - java/src/ClassReader.java | 146 - java/src/Condition.java | 122 - java/src/Connector.java | 157 - java/src/CreationStrategy.java | 64 - java/src/EventHandler.java | 53 - java/src/GetOpt.java | 150 - java/src/HTTPHelper.java | 84 - java/src/INETAddr.java | 99 - java/src/IOCntlCmds.java | 34 - java/src/IOCntlMsg.java | 128 - java/src/JACE.DSP | 292 - java/src/JACE.DSW | 29 - java/src/Makefile | 153 - java/src/MessageBlock.java | 453 - java/src/MessageQueue.java | 639 - java/src/MessageType.java | 110 - java/src/Module.java | 253 - java/src/Mutex.java | 109 - java/src/OS.java | 72 - java/src/ParseNode.java | 69 - java/src/ProfileTimer.java | 48 - java/src/README | 19 - java/src/RWMutex.java | 174 - java/src/RemoveNode.java | 35 - java/src/ResumeNode.java | 34 - java/src/SOCKAcceptor.java | 115 - java/src/SOCKConnector.java | 75 - java/src/SOCKStream.java | 218 - java/src/Semaphore.java | 103 - java/src/ServiceConfig.java | 375 - java/src/ServiceLoader.java | 260 - java/src/ServiceObject.java | 80 - java/src/ServiceObjectRecord.java | 33 - java/src/ServiceRecord.java | 253 - java/src/ServiceRepository.java | 189 - java/src/StrategyAcceptor.java | 156 - java/src/Stream.java | 440 - java/src/StreamHead.java | 127 - java/src/StreamTail.java | 119 - java/src/SuspendNode.java | 34 - java/src/SvcHandler.java | 85 - java/src/Task.java | 439 - java/src/TaskFlags.java | 44 - java/src/ThreadManager.java | 109 - java/src/ThruTask.java | 48 - java/src/TimeValue.java | 285 - java/src/TimedWait.java | 150 - java/src/TimeoutException.java | 34 - java/src/TimerQueue.java | 432 - java/src/Token.java | 336 - java/tests/ASX/BufferStreamTest.dsp | 73 - java/tests/ASX/BufferStreamTest.java | 185 - java/tests/ASX/Makefile | 26 - java/tests/ASX/MessageQueueTest.dsp | 73 - java/tests/ASX/MessageQueueTest.java | 50 - java/tests/ASX/PriorityBufferTest.dsp | 73 - java/tests/ASX/PriorityBufferTest.java | 116 - java/tests/ASX/TaskTest.dsp | 72 - java/tests/ASX/TaskTest.java | 86 - java/tests/ASX/ThreadPoolTest.dsp | 73 - java/tests/ASX/ThreadPoolTest.java | 185 - java/tests/Concurrency/Condition/Condition.dsp | 88 - java/tests/Concurrency/Condition/Consumer.java | 73 - .../Concurrency/Condition/JoinableThreadGroup.java | 24 - java/tests/Concurrency/Condition/Makefile | 25 - java/tests/Concurrency/Condition/Producer.java | 67 - java/tests/Concurrency/Condition/QueueTest.java | 64 - .../Concurrency/Condition/SimpleMessageQueue.java | 86 - java/tests/Concurrency/Makefile | 23 - java/tests/Concurrency/MutexTest.dsp | 72 - java/tests/Concurrency/MutexTest.java | 154 - java/tests/Concurrency/RWMutexTest.dsp | 73 - java/tests/Concurrency/RWMutexTest.java | 93 - java/tests/Concurrency/SemaphoreTest.dsp | 73 - java/tests/Concurrency/SemaphoreTest.java | 102 - java/tests/Concurrency/TokenTest.dsp | 72 - java/tests/Concurrency/TokenTest.java | 73 - java/tests/Connection/AcceptorTest.dsp | 73 - java/tests/Connection/AcceptorTest.java | 79 - java/tests/Connection/ClientHandler.dsp | 73 - java/tests/Connection/ClientHandler.java | 77 - java/tests/Connection/ConnectorTest.dsp | 73 - java/tests/Connection/ConnectorTest.java | 76 - java/tests/Connection/HTTPHelperTest.java | 27 - java/tests/Connection/Makefile | 26 - java/tests/Connection/ServerHandler.dsp | 73 - java/tests/Connection/ServerHandler.java | 68 - java/tests/Misc/Makefile | 21 - java/tests/Misc/ParseArgsTest.dsp | 73 - java/tests/Misc/ParseArgsTest.java | 45 - java/tests/Reactor/Makefile | 22 - java/tests/Reactor/TimeValueTest.dsp | 73 - java/tests/Reactor/TimeValueTest.java | 50 - java/tests/Reactor/TimerQueueTest.dsp | 73 - java/tests/Reactor/TimerQueueTest.java | 80 - java/tests/SOCK_SAP/Makefile | 22 - java/tests/SOCK_SAP/SOCKAcceptorTest.dsp | 73 - java/tests/SOCK_SAP/SOCKAcceptorTest.java | 108 - java/tests/SOCK_SAP/SOCKConnectorTest.dsp | 73 - java/tests/SOCK_SAP/SOCKConnectorTest.java | 95 - java/tests/ServiceConfigurator/Makefile | 25 - .../ServiceConfigurator/ServiceConfigurator.dsp | 81 - java/tests/ServiceConfigurator/TestService.java | 52 - java/tests/ServiceConfigurator/reloadTest.java | 61 - java/tests/ServiceConfigurator/suspendTest.java | 80 - java/tests/ServiceConfigurator/suspendTest1.conf | 1 - java/tests/ServiceConfigurator/suspendTest2.conf | 1 - java/tests/ServiceConfigurator/suspendTest3.conf | 1 - java/tests/ServiceConfigurator/svc.conf | 1 - java/tests/Tests.dsw | 257 - java/tests/netsvcs/Logger/LoggerTest.java | 122 - java/tests/netsvcs/Logger/Makefile | 19 - java/tests/netsvcs/Naming/ClientTest.java | 117 - java/tests/netsvcs/Naming/Makefile | 21 - ltcf-c.sh | 644 - ltcf-cxx.sh | 798 - m4/ace.m4 | 594 - m4/acinclude.m4 | 803 - m4/compiler.m4 | 319 - m4/features.m4 | 626 - m4/platform.m4 | 324 - m4/subsets.m4 | 594 - m4/threads.m4 | 433 - man/Makefile.am | 22 - man/html/Makefile.am | 34 - man/man3/Makefile.am | 25 - missing | 190 - mkinstalldirs | 40 - netsvcs/ACE-netsvcs.html | 881 - netsvcs/Makefile | 26 - netsvcs/Makefile.am | 21 - netsvcs/Makefile.bor | 7 - netsvcs/README | 20 - netsvcs/build.bor | 16 - netsvcs/clients/Logger/Logger.dsw | 41 - netsvcs/clients/Logger/Makefile | 101 - netsvcs/clients/Logger/Makefile.am | 29 - netsvcs/clients/Logger/Makefile.bor | 14 - netsvcs/clients/Logger/README | 18 - netsvcs/clients/Logger/direct_logging.cpp | 40 - netsvcs/clients/Logger/direct_logging.dsp | 94 - netsvcs/clients/Logger/indirect_logging.cpp | 49 - netsvcs/clients/Logger/indirect_logging.dsp | 94 - netsvcs/clients/Makefile | 19 - netsvcs/clients/Makefile.am | 18 - netsvcs/clients/Makefile.bor | 3 - netsvcs/clients/Naming/Client/Client.dsw | 44 - netsvcs/clients/Naming/Client/Client_Test.cpp | 647 - netsvcs/clients/Naming/Client/Client_Test.dsp | 97 - netsvcs/clients/Naming/Client/Client_Test.h | 12 - netsvcs/clients/Naming/Client/Makefile | 293 - netsvcs/clients/Naming/Client/Makefile.am | 36 - netsvcs/clients/Naming/Client/Makefile.bor | 8 - netsvcs/clients/Naming/Client/README | 123 - netsvcs/clients/Naming/Client/main.cpp | 77 - netsvcs/clients/Naming/Client/main.dsp | 93 - netsvcs/clients/Naming/Client/svc.conf | 7 - netsvcs/clients/Naming/Client/svc2.conf | 9 - .../clients/Naming/Dump_Restore/Dump_Restore.cpp | 461 - netsvcs/clients/Naming/Dump_Restore/Dump_Restore.h | 84 - netsvcs/clients/Naming/Dump_Restore/Makefile | 287 - netsvcs/clients/Naming/Dump_Restore/Makefile.am | 33 - netsvcs/clients/Naming/Dump_Restore/Makefile.bor | 8 - netsvcs/clients/Naming/Dump_Restore/README | 66 - netsvcs/clients/Naming/Dump_Restore/createfile.cpp | 34 - netsvcs/clients/Naming/Dump_Restore/main.cpp | 25 - netsvcs/clients/Naming/Dump_Restore/nametest.cpp | 112 - netsvcs/clients/Naming/Dump_Restore/nametest.h | 15 - netsvcs/clients/Naming/Makefile | 25 - netsvcs/clients/Naming/Makefile.am | 19 - netsvcs/clients/Naming/Makefile.bor | 3 - netsvcs/clients/README | 8 - netsvcs/clients/Tokens/Makefile | 26 - netsvcs/clients/Tokens/Makefile.am | 22 - netsvcs/clients/Tokens/Makefile.bor | 3 - netsvcs/clients/Tokens/README | 34 - netsvcs/clients/Tokens/collection/Makefile | 167 - netsvcs/clients/Tokens/collection/Makefile.am | 23 - netsvcs/clients/Tokens/collection/Makefile.bor | 5 - netsvcs/clients/Tokens/collection/README | 25 - netsvcs/clients/Tokens/collection/collection.cpp | 211 - netsvcs/clients/Tokens/collection/collection.dsp | 109 - netsvcs/clients/Tokens/collection/collection.dsw | 29 - netsvcs/clients/Tokens/collection/rw_locks.cpp | 174 - netsvcs/clients/Tokens/deadlock/Makefile | 169 - netsvcs/clients/Tokens/deadlock/Makefile.am | 24 - netsvcs/clients/Tokens/deadlock/Makefile.bor | 5 - netsvcs/clients/Tokens/deadlock/README | 98 - netsvcs/clients/Tokens/deadlock/deadlock.dsp | 112 - netsvcs/clients/Tokens/deadlock/deadlock.dsw | 29 - .../Tokens/deadlock/deadlock_detection_test.cpp | 341 - netsvcs/clients/Tokens/invariant/Makefile | 147 - netsvcs/clients/Tokens/invariant/Makefile.am | 24 - netsvcs/clients/Tokens/invariant/Makefile.bor | 5 - netsvcs/clients/Tokens/invariant/README | 27 - netsvcs/clients/Tokens/invariant/invariant.cpp | 197 - netsvcs/clients/Tokens/invariant/invariant.dsp | 99 - netsvcs/clients/Tokens/invariant/invariant.dsw | 29 - netsvcs/clients/Tokens/manual/Makefile | 47 - netsvcs/clients/Tokens/manual/Makefile.am | 28 - netsvcs/clients/Tokens/manual/Makefile.bor | 5 - netsvcs/clients/Tokens/manual/README | 67 - netsvcs/clients/Tokens/manual/manual.cpp | 368 - netsvcs/clients/Tokens/manual/manual.dsp | 97 - netsvcs/clients/Tokens/manual/manual.dsw | 29 - netsvcs/clients/Tokens/mutex/Makefile | 165 - netsvcs/clients/Tokens/mutex/Makefile.am | 25 - netsvcs/clients/Tokens/mutex/Makefile.bor | 5 - netsvcs/clients/Tokens/mutex/README | 23 - netsvcs/clients/Tokens/mutex/mutex.dsp | 97 - netsvcs/clients/Tokens/mutex/mutex.dsw | 29 - netsvcs/clients/Tokens/mutex/test_mutex.cpp | 143 - netsvcs/clients/Tokens/rw_lock/Makefile | 167 - netsvcs/clients/Tokens/rw_lock/Makefile.am | 24 - netsvcs/clients/Tokens/rw_lock/Makefile.bor | 5 - netsvcs/clients/Tokens/rw_lock/README | 40 - netsvcs/clients/Tokens/rw_lock/rw_lock.dsp | 98 - netsvcs/clients/Tokens/rw_lock/rw_lock.dsw | 29 - netsvcs/clients/Tokens/rw_lock/rw_locks.cpp | 253 - netsvcs/lib/Base_Optimizer.cpp | 31 - netsvcs/lib/Base_Optimizer.h | 52 - netsvcs/lib/Client_Logging_Handler.cpp | 537 - netsvcs/lib/Client_Logging_Handler.h | 98 - netsvcs/lib/Client_Logging_Handler.i | 4 - netsvcs/lib/Log_Message_Receiver.cpp | 170 - netsvcs/lib/Log_Message_Receiver.h | 215 - netsvcs/lib/Logging_Strategy.cpp | 151 - netsvcs/lib/Logging_Strategy.h | 66 - netsvcs/lib/Makefile | 1276 - netsvcs/lib/Makefile.am | 59 - netsvcs/lib/Makefile.bor | 22 - netsvcs/lib/Name_Handler.cpp | 619 - netsvcs/lib/Name_Handler.h | 205 - netsvcs/lib/README | 267 - netsvcs/lib/Server_Logging_Handler.cpp | 235 - netsvcs/lib/Server_Logging_Handler.h | 95 - netsvcs/lib/Server_Logging_Handler.i | 4 - netsvcs/lib/Server_Logging_Handler_T.cpp | 355 - netsvcs/lib/Server_Logging_Handler_T.h | 202 - netsvcs/lib/TS_Clerk_Handler.cpp | 637 - netsvcs/lib/TS_Clerk_Handler.h | 246 - netsvcs/lib/TS_Server_Handler.cpp | 283 - netsvcs/lib/TS_Server_Handler.h | 110 - netsvcs/lib/Token_Handler.cpp | 656 - netsvcs/lib/Token_Handler.h | 260 - netsvcs/lib/netsvcs.dsp | 306 - netsvcs/lib/netsvcs.dsw | 29 - netsvcs/netsvcs.dsw | 167 - netsvcs/servers/Makefile | 245 - netsvcs/servers/Makefile.am | 26 - netsvcs/servers/Makefile.bor | 7 - netsvcs/servers/README | 35 - netsvcs/servers/cli.conf | 11 - netsvcs/servers/main.cpp | 151 - netsvcs/servers/ntsvc.conf | 12 - netsvcs/servers/servers.dsp | 179 - netsvcs/servers/servers.dsw | 29 - netsvcs/servers/svc.conf | 17 - os-patches/linux-patches.html | 214 - os-patches/lynxos-patches.html | 91 - os-patches/vxworks-5.1.txt | 77 - performance-tests/Makefile | 35 - performance-tests/Misc/Makefile | 646 - performance-tests/Misc/basic_func.cpp | 49 - performance-tests/Misc/basic_func.h | 77 - performance-tests/Misc/basic_perf.cpp | 643 - performance-tests/Misc/basic_perf.dsp | 164 - performance-tests/Misc/childbirth_time.cpp | 401 - performance-tests/Misc/childbirth_time.dsp | 103 - performance-tests/Misc/context_switch_time.cpp | 1320 - performance-tests/Misc/context_switch_time.dsp | 156 - performance-tests/Misc/misc.dsw | 89 - performance-tests/Misc/preempt.cpp | 455 - performance-tests/Misc/test_guard.cpp | 114 - performance-tests/Misc/test_mutex.cpp | 232 - performance-tests/Misc/test_mutex.dsp | 103 - performance-tests/Misc/test_naming.cpp | 180 - performance-tests/Misc/test_naming.dsp | 103 - performance-tests/Misc/test_singleton.cpp | 178 - performance-tests/Misc/test_singleton.dsp | 103 - performance-tests/Misc/test_singleton.h | 24 - performance-tests/README | 17 - performance-tests/RPC/Makefile | 135 - performance-tests/RPC/README | 6 - performance-tests/RPC/client.cpp | 72 - performance-tests/RPC/ping.x | 12 - performance-tests/RPC/server.c | 15 - .../Server_Concurrency/Latency_Stats.h | 208 - .../Leader_Follower/Leader_Follower.dsp | 102 - .../Leader_Follower/Leader_Follower.dsw | 28 - .../Server_Concurrency/Leader_Follower/Makefile | 178 - .../Leader_Follower/leader_follower.cpp | 324 - performance-tests/Server_Concurrency/Makefile | 20 - .../Queue_Based_Workers/Makefile | 178 - .../Queue_Based_Workers/Queue_Based_Workers.dsp | 102 - .../Queue_Based_Workers/Queue_Based_Workers.dsw | 29 - .../Queue_Based_Workers/workers.cpp | 415 - .../Server_Concurrency/Server_Concurrency.dsw | 41 - performance-tests/Server_Concurrency/run_test.sh | 13 - .../Synch-Benchmarks/Base_Test/Base_Test.dsp | 115 - .../Synch-Benchmarks/Base_Test/Baseline_Test.cpp | 225 - .../Synch-Benchmarks/Base_Test/Baseline_Test.h | 147 - .../Synch-Benchmarks/Base_Test/Baseline_Test.i | 43 - .../Synch-Benchmarks/Base_Test/Makefile | 343 - .../Synch-Benchmarks/Base_Test/base_test.cpp | 57 - .../Synch-Benchmarks/Base_Test/mutex_test.cpp | 232 - performance-tests/Synch-Benchmarks/Makefile | 52 - performance-tests/Synch-Benchmarks/Makefile.driver | 41 - .../Synch-Benchmarks/Makefile.synch_tests | 948 - .../Adaptive_Lock_Performance_Test_Base.cpp | 49 - .../Adaptive_Lock_Performance_Test_Base.h | 24 - .../Perf_Test/Benchmark_Performance.cpp | 59 - .../Perf_Test/Benchmark_Performance.h | 46 - .../Synch-Benchmarks/Perf_Test/Makefile | 2108 -- .../Synch-Benchmarks/Perf_Test/Perf_Test.dsp | 187 - .../Perf_Test/Performance_Test.cpp | 114 - .../Synch-Benchmarks/Perf_Test/Performance_Test.h | 25 - .../Perf_Test/Performance_Test_Options.cpp | 476 - .../Perf_Test/Performance_Test_Options.h | 131 - .../Perf_Test/Performance_Test_Options.i | 264 - .../Synch-Benchmarks/Perf_Test/README | 76 - .../Perf_Test/adaptive_mutex_test.cpp | 36 - .../Perf_Test/adaptive_recursive_lock_test.cpp | 36 - .../Perf_Test/adaptive_sema_test.cpp | 41 - .../Synch-Benchmarks/Perf_Test/condb_test.cpp | 70 - .../Synch-Benchmarks/Perf_Test/conds_test.cpp | 73 - .../Synch-Benchmarks/Perf_Test/context_test.cpp | 39 - .../Synch-Benchmarks/Perf_Test/guard_test.cpp | 123 - .../Synch-Benchmarks/Perf_Test/memory_test.cpp | 41 - .../Synch-Benchmarks/Perf_Test/mutex_test.cpp | 46 - .../Synch-Benchmarks/Perf_Test/pipe_proc_test.cpp | 84 - .../Synch-Benchmarks/Perf_Test/pipe_thr_test.cpp | 77 - .../Perf_Test/recursive_lock_test.cpp | 44 - .../Synch-Benchmarks/Perf_Test/rwrd_test.cpp | 45 - .../Synch-Benchmarks/Perf_Test/rwwr_test.cpp | 45 - .../Synch-Benchmarks/Perf_Test/sema_test.cpp | 45 - .../Synch-Benchmarks/Perf_Test/sysvsema_test.cpp | 67 - .../Synch-Benchmarks/Perf_Test/token_test.cpp | 46 - performance-tests/Synch-Benchmarks/README | 46 - .../Synch-Benchmarks/Synch_Lib/Benchmark_Base.cpp | 99 - .../Synch-Benchmarks/Synch_Lib/Benchmark_Base.h | 113 - .../Synch-Benchmarks/Synch_Lib/Makefile | 135 - .../Synch-Benchmarks/Synch_Lib/README | 4 - .../Synch-Benchmarks/Synch_Lib/Synch_Lib.dsp | 99 - .../Synch-Benchmarks/Synch_Lib/export_mac.h | 36 - performance-tests/Synch-Benchmarks/Synch_Tests.dsp | 196 - performance-tests/Synch-Benchmarks/Synch_Tests.dsw | 77 - performance-tests/Synch-Benchmarks/benchmarks | 19 - performance-tests/Synch-Benchmarks/context.c | 72 - performance-tests/Synch-Benchmarks/context.csh | 16 - performance-tests/Synch-Benchmarks/orig-results | 73 - .../Synch-Benchmarks/results/.no_prune | 1 - performance-tests/Synch-Benchmarks/run_tests.pl | 131 - .../Synch-Benchmarks/svcconf/base_acquire.conf | 20 - .../svcconf/base_acquire_read.conf | 20 - .../svcconf/base_acquire_write.conf | 20 - .../Synch-Benchmarks/svcconf/base_tryacquire.conf | 20 - .../svcconf/base_tryacquire_read.conf | 20 - .../svcconf/base_tryacquire_write.conf | 20 - .../Synch-Benchmarks/svcconf/perf_t1.conf | 32 - .../Synch-Benchmarks/svcconf/perf_t16.conf | 32 - .../Synch-Benchmarks/svcconf/perf_t2.conf | 32 - .../Synch-Benchmarks/svcconf/perf_t32.conf | 32 - .../Synch-Benchmarks/svcconf/perf_t4.conf | 32 - .../Synch-Benchmarks/svcconf/perf_t64.conf | 32 - .../Synch-Benchmarks/svcconf/perf_t8.conf | 32 - .../Synch-Benchmarks/svcconf/svc.conf | 29 - .../Synch-Benchmarks/synch_driver.cpp | 52 - .../Synch-Benchmarks/synch_driver.dsp | 111 - performance-tests/TCP/Makefile | 161 - performance-tests/TCP/README | 17 - performance-tests/TCP/TCP.dsp | 102 - performance-tests/TCP/TCP.dsw | 29 - performance-tests/TCP/tcp_test.cpp | 659 - performance-tests/TTCP/ACE-C++/How_to_run_tests | 29 - performance-tests/TTCP/ACE-C++/Makefile | 47 - performance-tests/TTCP/ACE-C++/run_test | 35 - .../TTCP/ACE-C++/wrapper-new-ttcp.cpp | 967 - performance-tests/TTCP/C/How_to_run_tests | 30 - performance-tests/TTCP/C/Makefile | 47 - performance-tests/TTCP/C/README | 38 - performance-tests/TTCP/C/new-ttcp.cpp | 979 - performance-tests/TTCP/C/run_test | 35 - performance-tests/TTCP/Makefile | 25 - performance-tests/UDP/Makefile | 130 - performance-tests/UDP/README | 17 - performance-tests/UDP/udp_test.cpp | 735 - psosim/Makefile | 76 - psosim/drv_conf.c | 79 - rpc++/.dependencies | 131 - rpc++/COPYING | 481 - rpc++/Makefile | 55 - rpc++/Proj.make | 68 - rpc++/README | 18 - rpc++/README.ORIG | 9 - rpc++/StdHdrs/Makefile | 13 - rpc++/StdHdrs/README | 3 - rpc++/StdHdrs/rpc/auth.h | 171 - rpc++/StdHdrs/rpc/c_types.h | 79 - rpc++/StdHdrs/rpc/clnt.h | 347 - rpc++/StdHdrs/rpc/pmap_clnt.h | 82 - rpc++/StdHdrs/rpc/svc.h | 286 - rpc++/StdHdrs/rpc/xdr.h | 275 - rpc++/callback.cc | 38 - rpc++/example/Makefile | 40 - rpc++/example/calcsvc.cc | 30 - rpc++/example/calcsvc.h | 34 - rpc++/example/client.cc | 64 - rpc++/example/server.cc | 112 - rpc++/gcc-2.2.fix | 252 - rpc++/request.cc | 165 - rpc++/rpc++.cp | 13 - rpc++/rpc++.fn | 63 - rpc++/rpc++.ky | 0 rpc++/rpc++.pg | 0 rpc++/rpc++.texi | 1519 - rpc++/rpc++.toc | 23 - rpc++/rpc++.tp | 7 - rpc++/rpc++.vr | 13 - rpc++/rpc++/callback.h | 533 - rpc++/rpc++/request.h | 121 - rpc++/rpc++/service.h | 132 - rpc++/rpc++/stub.h | 145 - rpc++/rpc++/xdr++.h | 98 - rpc++/service.cc | 316 - rpc++/stub.cc | 207 - rpc++/version.h | 4 - rpc++/xdr++.cc | 75 - tests/ACE_Init_Test.cpp | 105 - tests/ACE_Init_Test.dsp | 107 - tests/ACE_Init_Test.h | 59 - tests/ACE_Init_Test.ico | Bin 1078 -> 0 bytes tests/ACE_Init_Test.rc | 174 - tests/ACE_Init_Test.rc2 | 13 - tests/ACE_Init_TestDlg.cpp | 94 - tests/ACE_Init_TestDlg.h | 47 - tests/ACE_Init_Test_Resource.h | 19 - tests/ACE_Init_Test_StdAfx.h | 44 - tests/ARGV_Test.cpp | 53 - tests/ARGV_Test.icc | 15 - tests/Aio_Platform_Test.cpp | 189 - tests/Aio_Platform_Test.icc | 15 - tests/Atomic_Op_Test.cpp | 75 - tests/Atomic_Op_Test.dsp | 160 - tests/Atomic_Op_Test.icc | 15 - tests/Auto_IncDec_Test.cpp | 152 - tests/Auto_IncDec_Test.dsp | 160 - tests/Auto_IncDec_Test.icc | 15 - tests/Barrier_Test.cpp | 105 - tests/Barrier_Test.dsp | 183 - tests/Barrier_Test.icc | 15 - tests/Basic_Types_Test.cpp | 172 - tests/Basic_Types_Test.dsp | 183 - tests/Basic_Types_Test.icc | 15 - tests/Buffer_Stream_Test.cpp | 232 - tests/Buffer_Stream_Test.dsp | 230 - tests/Buffer_Stream_Test.icc | 15 - tests/CDR_File_Test.cpp | 304 - tests/CDR_File_Test.dsp | 183 - tests/CDR_File_Test.icc | 15 - tests/CDR_Test.cpp | 487 - tests/CDR_Test.dsp | 171 - tests/CDR_Test.icc | 15 - tests/CLASSIX/CLASSIX_Addr_Test.cpp | 116 - tests/CLASSIX/CLASSIX_Addr_Test.icc | 22 - tests/CLASSIX/CLASSIX_CLD_Connector_Test.cpp | 392 - tests/CLASSIX/CLASSIX_CLD_Connector_Test.icc | 22 - tests/CLASSIX/CLASSIX_Con_Acc_Test.cpp | 373 - tests/CLASSIX/CLASSIX_Con_Acc_Test.h | 82 - tests/CLASSIX/CLASSIX_Con_Acc_Test.icc | 22 - tests/CLASSIX/CLASSIX_Group_Test.cpp | 85 - tests/CLASSIX/CLASSIX_Group_Test.icc | 22 - tests/CLASSIX/CLASSIX_Notify_Test.cpp | 267 - tests/CLASSIX/CLASSIX_Notify_Test.icc | 22 - tests/CLASSIX/CLASSIX_OS_Test.cpp | 43 - tests/CLASSIX/CLASSIX_OS_Test.icc | 22 - tests/CLASSIX/CLASSIX_Reactor_Test.cpp | 149 - tests/CLASSIX/CLASSIX_Reactor_Test.h | 57 - tests/CLASSIX/CLASSIX_Reactor_Test.icc | 22 - tests/CLASSIX/CLASSIX_Select_Reactor_Test.cpp | 166 - tests/CLASSIX/CLASSIX_Select_Reactor_Test.h | 56 - tests/CLASSIX/CLASSIX_Select_Reactor_Test.icc | 22 - tests/CLASSIX/CLASSIX_Stream_Test.cpp | 111 - tests/CLASSIX/CLASSIX_Stream_Test.icc | 22 - tests/CLASSIX/CLASSIX_test_config.h | 277 - tests/CLASSIX/Imakefile | 152 - tests/CLASSIX_Addr_Test.icc | 22 - tests/CLASSIX_CLD_Connector_Test.icc | 22 - tests/CLASSIX_Con_Acc_Test.icc | 22 - tests/CLASSIX_Group_Test.icc | 22 - tests/CLASSIX_Notify_Test.icc | 22 - tests/CLASSIX_OS_Test.icc | 22 - tests/CLASSIX_Reactor_Test.icc | 22 - tests/CLASSIX_Select_Reactor_Test.icc | 22 - tests/CLASSIX_Stream_Test.icc | 22 - tests/CPP_Test.cpp | 261 - tests/Cache_Map_Manager_Test.cpp | 707 - tests/Cache_Map_Manager_Test.dsp | 160 - tests/Cache_Map_Manager_Test.h | 38 - tests/Cache_Map_Manager_Test.icc | 15 - tests/Cached_Accept_Conn_Test.cpp | 732 - tests/Cached_Accept_Conn_Test.dsp | 264 - tests/Cached_Accept_Conn_Test.h | 148 - tests/Cached_Accept_Conn_Test.icc | 15 - tests/Cached_Conn_Test.cpp | 699 - tests/Cached_Conn_Test.dsp | 160 - tests/Cached_Conn_Test.h | 36 - tests/Cached_Conn_Test.icc | 15 - tests/Capabilities_Test.cpp | 106 - tests/Capabilities_Test.dsp | 123 - tests/Capabilities_Test.icc | 15 - tests/Collection_Test.cpp | 137 - tests/Collection_Test.dsp | 183 - tests/Collection_Test.icc | 15 - tests/Conn_Test.cpp | 862 - tests/Conn_Test.dsp | 264 - tests/Conn_Test.h | 61 - tests/Conn_Test.icc | 15 - tests/DLL_Test.cpp | 137 - tests/DLL_Test.dsp | 182 - tests/DLL_Test.h | 54 - tests/DLL_Test.icc | 15 - tests/DLList_Test.cpp | 125 - tests/DLList_Test.dsp | 183 - tests/DLList_Test.icc | 15 - tests/Dynamic_Priority_Test.cpp | 791 - tests/Dynamic_Priority_Test.dsp | 183 - tests/Dynamic_Priority_Test.icc | 15 - tests/Enum_Interfaces_Test.cpp | 73 - tests/Enum_Interfaces_Test.dsp | 154 - tests/Enum_Interfaces_Test.icc | 15 - tests/Env_Value_Test.cpp | 128 - tests/Env_Value_Test.dsp | 183 - tests/Env_Value_Test.icc | 15 - tests/FlReactor_Test.cpp | 300 - tests/FlReactor_Test.icc | 15 - tests/Future_Set_Test.cpp | 641 - tests/Future_Set_Test.dsp | 230 - tests/Future_Set_Test.icc | 15 - tests/Future_Test.cpp | 641 - tests/Future_Test.dsp | 230 - tests/Future_Test.icc | 15 - tests/Handle_Set_Test.cpp | 243 - tests/Handle_Set_Test.dsp | 188 - tests/Handle_Set_Test.icc | 15 - tests/Hash_Map_Bucket_Iterator_Test.cpp | 138 - tests/Hash_Map_Bucket_Iterator_Test.dsp | 196 - tests/Hash_Map_Bucket_Iterator_Test.icc | 15 - tests/Hash_Map_Manager_Test.cpp | 234 - tests/Hash_Map_Manager_Test.dsp | 196 - tests/Hash_Map_Manager_Test.icc | 15 - tests/High_Res_Timer_Test.cpp | 120 - tests/High_Res_Timer_Test.dsp | 183 - tests/High_Res_Timer_Test.icc | 15 - tests/IOStream_Test.cpp | 510 - tests/IOStream_Test.dsp | 255 - tests/IOStream_Test.icc | 15 - tests/Lazy_Map_Manager_Test.cpp | 368 - tests/Lazy_Map_Manager_Test.dsp | 160 - tests/Lazy_Map_Manager_Test.icc | 15 - tests/Log_Msg_Test.cpp | 445 - tests/Log_Msg_Test.icc | 15 - tests/MM_Shared_Memory_Test.cpp | 215 - tests/MM_Shared_Memory_Test.dsp | 186 - tests/MM_Shared_Memory_Test.icc | 15 - tests/MT_Reactor_Timer_Test.cpp | 359 - tests/MT_Reactor_Timer_Test.dsp | 183 - tests/MT_Reactor_Timer_Test.h | 109 - tests/MT_Reactor_Timer_Test.icc | 15 - tests/MT_SOCK_Test.cpp | 335 - tests/MT_SOCK_Test.dsp | 186 - tests/MT_SOCK_Test.icc | 15 - tests/Makefile | 8304 ----- tests/Makefile.DLL | 96 - tests/Makefile.am | 340 - tests/Makefile.bor | 106 - tests/Malloc_Test.cpp | 384 - tests/Malloc_Test.dsp | 183 - tests/Malloc_Test.h | 44 - tests/Malloc_Test.icc | 15 - tests/Map_Manager_Test.cpp | 1000 - tests/Map_Manager_Test.dsp | 207 - tests/Map_Manager_Test.icc | 15 - tests/Map_Test.cpp | 483 - tests/Map_Test.dsp | 207 - tests/Map_Test.h | 150 - tests/Map_Test.icc | 15 - tests/Mem_Map_Test.cpp | 203 - tests/Mem_Map_Test.dsp | 152 - tests/Mem_Map_Test.icc | 15 - tests/Message_Block_Test.cpp | 347 - tests/Message_Block_Test.dsp | 231 - tests/Message_Block_Test.icc | 15 - tests/Message_Queue_Notifications_Test.cpp | 362 - tests/Message_Queue_Notifications_Test.dsp | 231 - tests/Message_Queue_Notifications_Test.icc | 15 - tests/Message_Queue_Test.cpp | 527 - tests/Message_Queue_Test.dsp | 215 - tests/Message_Queue_Test.icc | 15 - tests/Naming_Test.cpp | 258 - tests/Naming_Test.dsp | 221 - tests/Naming_Test.icc | 15 - tests/New_Fail_Test.cpp | 166 - tests/New_Fail_Test.dsp | 183 - tests/New_Fail_Test.icc | 15 - tests/Notify_Performance_Test.cpp | 255 - tests/Notify_Performance_Test.dsp | 217 - tests/Notify_Performance_Test.icc | 15 - tests/Object_Manager_Test.cpp | 117 - tests/Object_Manager_Test.dsp | 119 - tests/Object_Manager_Test.icc | 15 - tests/OrdMultiSet_Test.cpp | 215 - tests/OrdMultiSet_Test.dsp | 183 - tests/OrdMultiSet_Test.icc | 15 - tests/Pipe_Test.cpp | 157 - tests/Pipe_Test.dsp | 156 - tests/Pipe_Test.icc | 15 - tests/Priority_Buffer_Test.cpp | 182 - tests/Priority_Buffer_Test.dsp | 215 - tests/Priority_Buffer_Test.icc | 15 - tests/Priority_Reactor_Test.cpp | 415 - tests/Priority_Reactor_Test.dsp | 254 - tests/Priority_Reactor_Test.h | 76 - tests/Priority_Reactor_Test.icc | 15 - tests/Priority_Task_Test.cpp | 238 - tests/Priority_Task_Test.dsp | 228 - tests/Priority_Task_Test.icc | 15 - tests/Process_Manager_Test.cpp | 273 - tests/Process_Manager_Test.dsp | 119 - tests/Process_Manager_Test.icc | 15 - tests/Process_Mutex_Test.cpp | 178 - tests/Process_Mutex_Test.dsp | 168 - tests/Process_Mutex_Test.icc | 15 - tests/Process_Strategy_Test.cpp | 716 - tests/Process_Strategy_Test.dsp | 257 - tests/Process_Strategy_Test.h | 142 - tests/Process_Strategy_Test.icc | 15 - tests/Purgable_Map_Manager_Test.cpp | 183 - tests/Purgable_Map_Manager_Test.icc | 15 - tests/RB_Tree_Test.cpp | 337 - tests/RB_Tree_Test.dsp | 160 - tests/RB_Tree_Test.h | 105 - tests/RB_Tree_Test.icc | 15 - tests/README | 83 - tests/Reactor_Exceptions_Test.cpp | 224 - tests/Reactor_Exceptions_Test.dsp | 202 - tests/Reactor_Exceptions_Test.icc | 15 - tests/Reactor_Notify_Test.cpp | 400 - tests/Reactor_Notify_Test.dsp | 228 - tests/Reactor_Notify_Test.icc | 15 - tests/Reactor_Performance_Test.cpp | 451 - tests/Reactor_Performance_Test.dsp | 255 - tests/Reactor_Performance_Test.h | 63 - tests/Reactor_Performance_Test.icc | 15 - tests/Reactor_Timer_Test.cpp | 253 - tests/Reactor_Timer_Test.dsp | 190 - tests/Reactor_Timer_Test.icc | 15 - tests/Reactors_Test.cpp | 267 - tests/Reactors_Test.dsp | 226 - tests/Reactors_Test.icc | 15 - tests/Reader_Writer_Test.cpp | 288 - tests/Reader_Writer_Test.dsp | 185 - tests/Reader_Writer_Test.icc | 15 - tests/Recursive_Mutex_Test.cpp | 95 - tests/Recursive_Mutex_Test.dsp | 185 - tests/Recursive_Mutex_Test.icc | 15 - tests/Reverse_Lock_Test.cpp | 55 - tests/Reverse_Lock_Test.dsp | 183 - tests/Reverse_Lock_Test.icc | 15 - tests/SOCK_Connector_Test.cpp | 259 - tests/SOCK_Connector_Test.dsp | 183 - tests/SOCK_Connector_Test.icc | 15 - tests/SOCK_Send_Recv_Test.cpp | 376 - tests/SOCK_Send_Recv_Test.dsp | 183 - tests/SOCK_Send_Recv_Test.icc | 15 - tests/SOCK_Test.cpp | 251 - tests/SOCK_Test.dsp | 202 - tests/SOCK_Test.icc | 15 - tests/SPIPE_Test.cpp | 134 - tests/SPIPE_Test.dsp | 196 - tests/SPIPE_Test.icc | 15 - tests/SString_Test.cpp | 174 - tests/SString_Test.dsp | 150 - tests/SString_Test.icc | 15 - tests/SV_Shared_Memory_Test.cpp | 197 - tests/SV_Shared_Memory_Test.dsp | 181 - tests/SV_Shared_Memory_Test.icc | 15 - tests/Semaphore_Test.cpp | 234 - tests/Semaphore_Test.dsp | 181 - tests/Semaphore_Test.icc | 15 - tests/Service_Config_Test.cpp | 146 - tests/Service_Config_Test.dsp | 197 - tests/Service_Config_Test.icc | 15 - tests/Shared_Memory_SV_Test.cpp | 83 - tests/Signal_Test.cpp | 489 - tests/Signal_Test.icc | 15 - tests/Sigset_Ops_Test.cpp | 130 - tests/Sigset_Ops_Test.dsp | 150 - tests/Sigset_Ops_Test.icc | 15 - tests/Simple_Message_Block_Test.cpp | 183 - tests/Simple_Message_Block_Test.dsp | 183 - tests/Simple_Message_Block_Test.icc | 15 - tests/Svc_Handler_Test.cpp | 130 - tests/Svc_Handler_Test.dsp | 226 - tests/Svc_Handler_Test.icc | 15 - tests/TSS_Test.cpp | 287 - tests/TSS_Test.dsp | 188 - tests/TSS_Test.icc | 15 - tests/TSS_Test_Errno.h | 76 - tests/Task_Test.cpp | 129 - tests/Task_Test.dsp | 226 - tests/Task_Test.icc | 15 - tests/Thread_Manager_Test.cpp | 336 - tests/Thread_Manager_Test.dsp | 183 - tests/Thread_Manager_Test.icc | 15 - tests/Thread_Mutex_Test.cpp | 93 - tests/Thread_Mutex_Test.dsp | 183 - tests/Thread_Mutex_Test.icc | 15 - tests/Thread_Pool_Reactor_Test.cpp | 351 - tests/Thread_Pool_Reactor_Test.dsp | 160 - tests/Thread_Pool_Reactor_Test.h | 50 - tests/Thread_Pool_Reactor_Test.icc | 15 - tests/Thread_Pool_Test.cpp | 457 - tests/Thread_Pool_Test.dsp | 226 - tests/Thread_Pool_Test.icc | 15 - tests/Time_Service_Test.cpp | 124 - tests/Time_Service_Test.dsp | 152 - tests/Time_Service_Test.icc | 15 - tests/Time_Value_Test.cpp | 220 - tests/Time_Value_Test.dsp | 150 - tests/Time_Value_Test.icc | 15 - tests/Timeprobe_Test.cpp | 126 - tests/Timeprobe_Test.dsp | 183 - tests/Timeprobe_Test.icc | 15 - tests/Timer_Queue_Test.cpp | 529 - tests/Timer_Queue_Test.dsp | 202 - tests/Timer_Queue_Test.icc | 15 - tests/TkReactor_Test.cpp | 345 - tests/TkReactor_Test.icc | 15 - tests/TkReactor_Test.tcl | 15 - tests/Tokens_Test.cpp | 270 - tests/Tokens_Test.dsp | 232 - tests/Tokens_Test.icc | 15 - tests/UNIXclerk.conf | 3 - tests/UNIXserver.conf | 7 - tests/UNIXtokens.conf | 5 - tests/UPIPE_SAP_Test.cpp | 202 - tests/UPIPE_SAP_Test.dsp | 248 - tests/UPIPE_SAP_Test.icc | 15 - tests/Upgradable_RW_Test.cpp | 506 - tests/Upgradable_RW_Test.dsp | 183 - tests/Upgradable_RW_Test.h | 147 - tests/Upgradable_RW_Test.icc | 15 - tests/Win32clerk.conf | 3 - tests/Win32server.conf | 10 - tests/Win32tokens.conf | 4 - tests/WinCE/Atomic_Op_Test.dsp | 974 - tests/WinCE/Barrier_Test.dsp | 1074 - tests/WinCE/Basic_Types_Test.dsp | 1068 - tests/WinCE/Buffer_Stream_Test.dsp | 1230 - tests/WinCE/Conn_Test.dsp | 1335 - tests/WinCE/DLL_Test.dsp | 974 - tests/WinCE/Enum_Interfaces_Test.dsp | 1080 - tests/WinCE/Future_Test.dsp | 1233 - tests/WinCE/Handle_Set_Test.dsp | 1089 - tests/WinCE/Hash_Map_Manager_Test.dsp | 1125 - tests/WinCE/MT_Reactor_Timer_Test.dsp | 701 - tests/WinCE/MT_SOCK_Test.dsp | 1131 - tests/WinCE/Map_Manager_Test.dsp | 1146 - tests/WinCE/Mem_Map_Test.dsp | 1068 - tests/WinCE/Message_Block_Test.dsp | 1233 - tests/WinCE/Message_Queue_Notifications_Test.dsp | 1068 - tests/WinCE/Message_Queue_Test.dsp | 1185 - tests/WinCE/Notify_Performance_Test.dsp | 1239 - tests/WinCE/OrdMultiSet_Test.dsp | 1068 - tests/WinCE/Priority_Buffer_Test.dsp | 1185 - tests/WinCE/Priority_Task_Test.dsp | 1224 - tests/WinCE/Reactor_Exceptions_Test.dsp | 698 - tests/WinCE/Reactor_Notify_Test.dsp | 1251 - tests/WinCE/Reactor_Performance_Test.dsp | 1068 - tests/WinCE/Reactor_Timer_Test.dsp | 1095 - tests/WinCE/Reactors_Test.dsp | 1218 - tests/WinCE/Reader_Writer_Test.dsp | 1080 - tests/WinCE/Recursive_Mutex_Test.dsp | 1080 - tests/WinCE/SOCK_Connector_Test.dsp | 1113 - tests/WinCE/SOCK_Test.dsp | 1131 - tests/WinCE/SString_Test.dsp | 1068 - tests/WinCE/Semaphore_Test.dsp | 1080 - tests/WinCE/Sigset_Ops_Test.dsp | 1068 - tests/WinCE/Simple_Message_Block_Test.dsp | 1074 - tests/WinCE/TSS_Test.dsp | 1077 - tests/WinCE/Task_Test.dsp | 1218 - tests/WinCE/Thread_Manager_Test.dsp | 1077 - tests/WinCE/Thread_Mutex_Test.dsp | 1074 - tests/WinCE/Thread_Pool_Test.dsp | 1218 - tests/WinCE/Time_Value_Test.dsp | 1068 - tests/WinCE/Timer_Queue_Test.dsp | 1131 - tests/WinCE/ce_tests.dsw | 485 - tests/XtReactor_Test.cpp | 369 - tests/XtReactor_Test.icc | 15 - tests/icc.bat | 226 - tests/libDLL_Test.icc | 26 - tests/log/Makefile.am | 81 - tests/makeicc.pl | 35 - tests/pharlap/Atomic_Op_Test.dsp | 74 - tests/pharlap/Auto_IncDec_Test.dsp | 74 - tests/pharlap/Barrier_Test.dsp | 78 - tests/pharlap/Basic_Types_Test.dsp | 78 - tests/pharlap/Buffer_Stream_Test.dsp | 78 - tests/pharlap/CDR_File_Test.dsp | 78 - tests/pharlap/CDR_Test.dsp | 66 - tests/pharlap/Cache_Map_Manager_Test.dsp | 74 - tests/pharlap/Cached_Accept_Conn_Test.dsp | 82 - tests/pharlap/Cached_Conn_Test.dsp | 74 - tests/pharlap/Capabilities_Test.dsp | 82 - tests/pharlap/Collection_Test.dsp | 78 - tests/pharlap/Conn_Test.dsp | 82 - tests/pharlap/DLList_Test.dsp | 78 - tests/pharlap/Dynamic_Priority_Test.dsp | 78 - tests/pharlap/Enum_Interfaces_Test.dsp | 78 - tests/pharlap/Env_Value_Test.dsp | 78 - tests/pharlap/Future_Set_Test.dsp | 78 - tests/pharlap/Future_Test.dsp | 78 - tests/pharlap/Handle_Set_Test.dsp | 78 - tests/pharlap/Hash_Map_Bucket_Iterator_Test.dsp | 74 - tests/pharlap/Hash_Map_Manager_Test.dsp | 74 - tests/pharlap/High_Res_Timer_Test.dsp | 78 - tests/pharlap/IOStream_Test.dsp | 78 - tests/pharlap/Lazy_Map_Manager_Test.dsp | 74 - tests/pharlap/MM_Shared_Memory_Test.dsp | 78 - tests/pharlap/MT_Reactor_Timer_Test.dsp | 78 - tests/pharlap/MT_SOCK_Test.dsp | 62 - tests/pharlap/Malloc_Test.dsp | 78 - tests/pharlap/Map_Manager_Test.dsp | 78 - tests/pharlap/Map_Test.dsp | 78 - tests/pharlap/Mem_Map_Test.dsp | 78 - tests/pharlap/Message_Block_Test.dsp | 78 - tests/pharlap/Message_Queue_Notifications_Test.dsp | 78 - tests/pharlap/Message_Queue_Test.dsp | 78 - tests/pharlap/Naming_Test.dsp | 78 - tests/pharlap/New_Fail_Test.dsp | 78 - tests/pharlap/Notify_Performance_Test.dsp | 62 - tests/pharlap/Object_Manager_Test.dsp | 78 - tests/pharlap/OrdMultiSet_Test.dsp | 78 - tests/pharlap/Pipe_Test.dsp | 78 - tests/pharlap/Priority_Buffer_Test.dsp | 78 - tests/pharlap/Priority_Reactor_Test.dsp | 62 - tests/pharlap/Priority_Task_Test.dsp | 78 - tests/pharlap/Process_Manager_Test.dsp | 78 - tests/pharlap/Process_Mutex_Test.dsp | 78 - tests/pharlap/Process_Strategy_Test.dsp | 78 - tests/pharlap/RB_Tree_Test.dsp | 74 - tests/pharlap/Reactor_Exceptions_Test.dsp | 78 - tests/pharlap/Reactor_Notify_Test.dsp | 78 - tests/pharlap/Reactor_Performance_Test.dsp | 62 - tests/pharlap/Reactor_Timer_Test.dsp | 78 - tests/pharlap/Reactors_Test.dsp | 78 - tests/pharlap/Reader_Writer_Test.dsp | 78 - tests/pharlap/Recursive_Mutex_Test.dsp | 78 - tests/pharlap/Reverse_Lock_Test.dsp | 78 - tests/pharlap/SOCK_Connector_Test.dsp | 78 - tests/pharlap/SOCK_Send_Recv_Test.dsp | 78 - tests/pharlap/SOCK_Test.dsp | 78 - tests/pharlap/SPIPE_Test.dsp | 78 - tests/pharlap/SString_Test.dsp | 78 - tests/pharlap/SV_Shared_Memory_Test.dsp | 78 - tests/pharlap/Semaphore_Test.dsp | 74 - tests/pharlap/Service_Config_Test.dsp | 78 - tests/pharlap/Sigset_Ops_Test.dsp | 78 - tests/pharlap/Simple_Message_Block_Test.dsp | 78 - tests/pharlap/Svc_Handler_Test.dsp | 78 - tests/pharlap/TSS_Test.dsp | 82 - tests/pharlap/Task_Test.dsp | 78 - tests/pharlap/Thread_Manager_Test.dsp | 78 - tests/pharlap/Thread_Mutex_Test.dsp | 78 - tests/pharlap/Thread_Pool_Reactor_Test.dsp | 74 - tests/pharlap/Thread_Pool_Test.dsp | 78 - tests/pharlap/Time_Service_Test.dsp | 78 - tests/pharlap/Time_Value_Test.dsp | 78 - tests/pharlap/Timeprobe_Test.dsp | 78 - tests/pharlap/Timer_Queue_Test.dsp | 78 - tests/pharlap/Tokens_Test.dsp | 78 - tests/pharlap/UPIPE_SAP_Test.dsp | 78 - tests/pharlap/Upgradable_RW_Test.dsp | 78 - tests/pharlap/pharlap_tests.dsw | 977 - tests/pharlap/run_pharlap_tests.bat | 130 - tests/run_tests.bat | 210 - tests/run_tests.check | 41 - tests/run_tests.ksh | 6 - tests/run_tests.lst | 82 - tests/run_tests.pl | 193 - tests/run_tests.psosim | 196 - tests/run_tests.sh | 230 - tests/run_tests.vxworks | 260 - tests/t.icc | 281 - tests/test_config.h | 308 - tests/tests.dsw | 1001 - tests/tests_pharlap_msvc.lnk | 72 - tests/vacpp_setup.icc | 31 - tests/version_tests/ACE_Init_Test.dsp | 298 - tests/version_tests/Atomic_Op_Test.dsp | 270 - tests/version_tests/Auto_IncDec_Test.dsp | 270 - tests/version_tests/Barrier_Test.dsp | 270 - tests/version_tests/Basic_Types_Test.dsp | 254 - tests/version_tests/Buffer_Stream_Test.dsp | 270 - tests/version_tests/CDR_File_Test.dsp | 270 - tests/version_tests/CDR_Test.dsp | 270 - tests/version_tests/Cache_Map_Manager_Test.dsp | 270 - tests/version_tests/Cached_Accept_Conn_Test.dsp | 270 - tests/version_tests/Cached_Conn_Test.dsp | 270 - tests/version_tests/Capabilities_Test.dsp | 274 - tests/version_tests/Collection_Test.dsp | 270 - tests/version_tests/Conn_Test.dsp | 274 - tests/version_tests/DLL_Test.dsp | 270 - tests/version_tests/DLList_Test.dsp | 270 - tests/version_tests/Dynamic_Priority_Test.dsp | 270 - tests/version_tests/Enum_Interfaces_Test.dsp | 270 - tests/version_tests/Env_Value_Test.dsp | 270 - tests/version_tests/Future_Set_Test.dsp | 270 - tests/version_tests/Future_Test.dsp | 278 - tests/version_tests/Handle_Set_Test.dsp | 270 - .../Hash_Map_Bucket_Iterator_Test.dsp | 270 - tests/version_tests/Hash_Map_Manager_Test.dsp | 274 - tests/version_tests/High_Res_Timer_Test.dsp | 270 - tests/version_tests/IOStream_Test.dsp | 270 - tests/version_tests/Lazy_Map_Manager_Test.dsp | 274 - tests/version_tests/MM_Shared_Memory_Test.dsp | 270 - tests/version_tests/MT_Reactor_Timer_Test.dsp | 270 - tests/version_tests/MT_SOCK_Test.dsp | 270 - tests/version_tests/Malloc_Test.dsp | 270 - tests/version_tests/Map_Manager_Test.dsp | 270 - tests/version_tests/Map_Test.dsp | 270 - tests/version_tests/Mem_Map_Test.dsp | 270 - tests/version_tests/Message_Block_Test.dsp | 270 - .../Message_Queue_Notifications_Test.dsp | 270 - tests/version_tests/Message_Queue_Test.dsp | 270 - tests/version_tests/Naming_Test.dsp | 270 - tests/version_tests/New_Fail_Test.dsp | 270 - tests/version_tests/Notify_Performance_Test.dsp | 270 - tests/version_tests/Object_Manager_Test.dsp | 270 - tests/version_tests/OrdMultiSet_Test.dsp | 270 - tests/version_tests/Pipe_Test.dsp | 270 - tests/version_tests/Priority_Buffer_Test.dsp | 270 - tests/version_tests/Priority_Reactor_Test.dsp | 270 - tests/version_tests/Priority_Task_Test.dsp | 270 - tests/version_tests/Process_Manager_Test.dsp | 270 - tests/version_tests/Process_Mutex_Test.dsp | 270 - tests/version_tests/Process_Strategy_Test.dsp | 270 - tests/version_tests/RB_Tree_Test.dsp | 270 - tests/version_tests/Reactor_Exception_Test.dsp | 270 - tests/version_tests/Reactor_Notify_Test.dsp | 270 - tests/version_tests/Reactor_Performance_Test.dsp | 274 - tests/version_tests/Reactor_Timer_Test.dsp | 270 - tests/version_tests/Reactors_Test.dsp | 270 - tests/version_tests/Reader_Writer_Test.dsp | 270 - tests/version_tests/Recursive_Mutex_Test.dsp | 270 - tests/version_tests/Reverse_Lock_Test.dsp | 270 - tests/version_tests/SOCK_Connector_Test.dsp | 270 - tests/version_tests/SOCK_Send_Recv_Test.dsp | 270 - tests/version_tests/SOCK_Test.dsp | 270 - tests/version_tests/SPIPE_Test.dsp | 270 - tests/version_tests/SString_Test.dsp | 270 - tests/version_tests/SV_Shared_Memory_Test.dsp | 270 - tests/version_tests/Semaphore_Test.dsp | 270 - tests/version_tests/Service_Config_Test.dsp | 270 - tests/version_tests/Sigset_Op_Test.dsp | 270 - tests/version_tests/Simple_Message_Block_Test.dsp | 270 - tests/version_tests/Svc_Handler_Test.dsp | 270 - tests/version_tests/TSS_Test.dsp | 274 - tests/version_tests/Task_Test.dsp | 270 - tests/version_tests/Thread_Manager_Test.dsp | 274 - tests/version_tests/Thread_Mutex_Test.dsp | 270 - tests/version_tests/Thread_Pool_Reactor_Test.dsp | 270 - tests/version_tests/Thread_Pool_Test.dsp | 270 - tests/version_tests/Time_Service_Test.dsp | 270 - tests/version_tests/Time_Value_Test.dsp | 270 - tests/version_tests/Timeprobe_Test.dsp | 270 - tests/version_tests/Timer_Queue_Test.dsp | 270 - tests/version_tests/Tokens_Test.dsp | 270 - tests/version_tests/UPIPE_SAP_Test.dsp | 270 - tests/version_tests/Upgradable_RW_Test.dsp | 274 - tests/version_tests/run_all_tests.bat | 75 - tests/version_tests/version_tests.dsw | 1001 - websvcs/Makefile | 24 - websvcs/README | 11 - websvcs/lib/Makefile | 70 - websvcs/lib/URL_Addr.cpp | 949 - websvcs/lib/URL_Addr.h | 403 - websvcs/lib/URL_Addr.i | 152 - websvcs/lib/websvcs.dsp | 111 - websvcs/lib/websvcs.dsw | 29 - websvcs/lib/websvcs_export.h | 35 - websvcs/tests/Makefile | 75 - websvcs/tests/Test_URL_Addr.cpp | 216 - websvcs/tests/Test_URL_Addr.dsp | 98 - websvcs/tests/tests.dsw | 29 - websvcs/websvcs.dsw | 41 - 4192 files changed, 962705 deletions(-) delete mode 100644 ACE-INSTALL.html delete mode 100644 ACE-configuration.txt delete mode 100644 ACE-install.sh delete mode 100644 ASNMP/COPYRIGHT delete mode 100644 ASNMP/ChangeLog delete mode 100644 ASNMP/Makefile delete mode 100644 ASNMP/README delete mode 100644 ASNMP/TO-DO delete mode 100644 ASNMP/agent/Makefile delete mode 100644 ASNMP/agent/agent_impl.cpp delete mode 100644 ASNMP/agent/agent_impl.h delete mode 100644 ASNMP/agent/main.cpp delete mode 100644 ASNMP/agent/snmp_agent.cpp delete mode 100644 ASNMP/agent/snmp_agent.h delete mode 100644 ASNMP/asnmp-overview.html delete mode 100644 ASNMP/asnmp/ChangeLog delete mode 100644 ASNMP/asnmp/Makefile delete mode 100644 ASNMP/asnmp/TODO delete mode 100644 ASNMP/asnmp/address.cpp delete mode 100644 ASNMP/asnmp/address.h delete mode 100644 ASNMP/asnmp/asn1.cpp delete mode 100644 ASNMP/asnmp/asn1.h delete mode 100644 ASNMP/asnmp/counter.cpp delete mode 100644 ASNMP/asnmp/counter.h delete mode 100644 ASNMP/asnmp/ctr64.cpp delete mode 100644 ASNMP/asnmp/ctr64.h delete mode 100644 ASNMP/asnmp/enttraps.h delete mode 100644 ASNMP/asnmp/gauge.cpp delete mode 100644 ASNMP/asnmp/gauge.h delete mode 100644 ASNMP/asnmp/integer.cpp delete mode 100644 ASNMP/asnmp/integer.h delete mode 100644 ASNMP/asnmp/octet.cpp delete mode 100644 ASNMP/asnmp/octet.h delete mode 100644 ASNMP/asnmp/oid.cpp delete mode 100644 ASNMP/asnmp/oid.h delete mode 100644 ASNMP/asnmp/oid_def.h delete mode 100644 ASNMP/asnmp/pdu.cpp delete mode 100644 ASNMP/asnmp/pdu.h delete mode 100644 ASNMP/asnmp/sagent.cpp delete mode 100644 ASNMP/asnmp/sagent.h delete mode 100644 ASNMP/asnmp/smi.h delete mode 100644 ASNMP/asnmp/smival.h delete mode 100644 ASNMP/asnmp/snmp.cpp delete mode 100644 ASNMP/asnmp/snmp.h delete mode 100644 ASNMP/asnmp/snmperrs.h delete mode 100644 ASNMP/asnmp/target.cpp delete mode 100644 ASNMP/asnmp/target.h delete mode 100644 ASNMP/asnmp/timetick.cpp delete mode 100644 ASNMP/asnmp/timetick.h delete mode 100644 ASNMP/asnmp/transaction.cpp delete mode 100644 ASNMP/asnmp/transaction.h delete mode 100644 ASNMP/asnmp/transaction_result.h delete mode 100644 ASNMP/asnmp/vb.cpp delete mode 100644 ASNMP/asnmp/vb.h delete mode 100644 ASNMP/asnmp/wpdu.cpp delete mode 100644 ASNMP/asnmp/wpdu.h delete mode 100644 ASNMP/examples/Makefile delete mode 100644 ASNMP/examples/get/Makefile delete mode 100644 ASNMP/examples/get/get.cpp delete mode 100644 ASNMP/examples/get/get_async.cpp delete mode 100644 ASNMP/examples/next/Makefile delete mode 100644 ASNMP/examples/next/next.cpp delete mode 100644 ASNMP/examples/set/Makefile delete mode 100644 ASNMP/examples/set/set.cpp delete mode 100644 ASNMP/examples/trap/Makefile delete mode 100644 ASNMP/examples/trap/purify4.1.txt delete mode 100644 ASNMP/examples/trap/trap.cpp delete mode 100644 ASNMP/examples/walk/Makefile delete mode 100644 ASNMP/examples/walk/walk.cpp delete mode 100644 ASNMP/mibs/RFC1213-MIB.my delete mode 100644 ASNMP/tests/Address_Test.cpp delete mode 100644 ASNMP/tests/Counter64_Test.cpp delete mode 100644 ASNMP/tests/Counter_Test.cpp delete mode 100644 ASNMP/tests/Gauge_Test.cpp delete mode 100644 ASNMP/tests/Integer_Test.cpp delete mode 100644 ASNMP/tests/Makefile delete mode 100644 ASNMP/tests/Octet_Test.cpp delete mode 100644 ASNMP/tests/Oid_Test.cpp delete mode 100644 ASNMP/tests/Target_Test.cpp delete mode 100644 ASNMP/tests/Varbind_Test.cpp delete mode 100644 ASNMP/tests/run_tests.bat delete mode 100755 ASNMP/tests/run_tests.sh delete mode 100644 ASNMP/tests/test_config.h delete mode 100644 AUTHORS delete mode 100644 BIBLIOGRAPHY delete mode 100644 COPYING delete mode 100644 ChangeLog delete mode 100644 ChangeLog-93 delete mode 100644 ChangeLog-94 delete mode 100644 ChangeLog-95 delete mode 100644 ChangeLog-96a delete mode 100644 ChangeLog-96b delete mode 100644 ChangeLog-97a delete mode 100644 ChangeLog-97b delete mode 100644 ChangeLog-98a delete mode 100644 ChangeLog-98b delete mode 100644 ChangeLog-99a delete mode 100644 ChangeLog-99b delete mode 100644 ChangeLogs/ChangeLog-02a delete mode 100644 ChangeLogs/ChangeLog-03a delete mode 100644 FAQ delete mode 100644 Makefile delete mode 100644 Makefile.am delete mode 100644 Makefile.bor delete mode 100644 PROBLEM-REPORT-FORM delete mode 100644 README delete mode 100644 STL/ACE_Changes delete mode 100644 STL/readme2.stl delete mode 100644 Static_Performance.dsw delete mode 100644 TAO/orbsvcs/orbsvcs/AVStreams_Full.idl delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.i delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.h delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.i delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Export.h delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.i delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp delete mode 100644 TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h delete mode 100644 THANKS delete mode 100644 TODO delete mode 100644 VERSION delete mode 100644 WindozeCE/ACEApp.cpp delete mode 100644 WindozeCE/ACEApp.h delete mode 100644 WindozeCE/README delete mode 100644 WindozeCE/StdAfx.cpp delete mode 100644 WindozeCE/StdAfx.h delete mode 100644 WindozeCE/WindozeCE.aps delete mode 100644 WindozeCE/WindozeCE.clw delete mode 100644 WindozeCE/WindozeCE.cpp delete mode 100644 WindozeCE/WindozeCE.dsp delete mode 100644 WindozeCE/WindozeCE.h delete mode 100644 WindozeCE/WindozeCE.plg delete mode 100644 WindozeCE/WindozeCE.rc delete mode 100644 WindozeCE/WindozeCEDlg.cpp delete mode 100644 WindozeCE/WindozeCEDlg.h delete mode 100644 WindozeCE/res/WindozeCE.ico delete mode 100644 WindozeCE/res/WindozeCE.rc2 delete mode 100644 WindozeCE/resource.h delete mode 100644 acconfig.h delete mode 100644 ace-config.1.in delete mode 100644 ace-config.in delete mode 100644 ace/ACE.cpp delete mode 100644 ace/ACE.h delete mode 100644 ace/ACE.i delete mode 100644 ace/ACE_export.h delete mode 100644 ace/ARGV.cpp delete mode 100644 ace/ARGV.h delete mode 100644 ace/ARGV.i delete mode 100644 ace/ATM_Acceptor.cpp delete mode 100644 ace/ATM_Acceptor.h delete mode 100644 ace/ATM_Acceptor.i delete mode 100644 ace/ATM_Addr.cpp delete mode 100644 ace/ATM_Addr.h delete mode 100644 ace/ATM_Addr.i delete mode 100644 ace/ATM_Connector.cpp delete mode 100644 ace/ATM_Connector.h delete mode 100644 ace/ATM_Connector.i delete mode 100644 ace/ATM_Params.cpp delete mode 100644 ace/ATM_Params.h delete mode 100644 ace/ATM_Params.i delete mode 100644 ace/ATM_QoS.cpp delete mode 100644 ace/ATM_QoS.h delete mode 100644 ace/ATM_QoS.i delete mode 100644 ace/ATM_Stream.cpp delete mode 100644 ace/ATM_Stream.h delete mode 100644 ace/ATM_Stream.i delete mode 100644 ace/Acceptor.cpp delete mode 100644 ace/Acceptor.h delete mode 100644 ace/Acceptor.i delete mode 100644 ace/Activation_Queue.cpp delete mode 100644 ace/Activation_Queue.h delete mode 100644 ace/Activation_Queue.i delete mode 100644 ace/Active_Map_Manager.cpp delete mode 100644 ace/Active_Map_Manager.h delete mode 100644 ace/Active_Map_Manager.i delete mode 100644 ace/Active_Map_Manager_T.cpp delete mode 100644 ace/Active_Map_Manager_T.h delete mode 100644 ace/Active_Map_Manager_T.i delete mode 100644 ace/Addr.cpp delete mode 100644 ace/Addr.h delete mode 100644 ace/Addr.i delete mode 100644 ace/Arg_Shifter.cpp delete mode 100644 ace/Arg_Shifter.h delete mode 100644 ace/Array.h delete mode 100644 ace/Asynch_Acceptor.cpp delete mode 100644 ace/Asynch_Acceptor.h delete mode 100644 ace/Asynch_Acceptor.i delete mode 100644 ace/Asynch_IO.cpp delete mode 100644 ace/Asynch_IO.h delete mode 100644 ace/Asynch_IO.i delete mode 100644 ace/Asynch_IO_Impl.cpp delete mode 100644 ace/Asynch_IO_Impl.h delete mode 100644 ace/Asynch_IO_Impl.i delete mode 100644 ace/Atomic_Op.i delete mode 100644 ace/Auto_IncDec_T.cpp delete mode 100644 ace/Auto_IncDec_T.h delete mode 100644 ace/Auto_IncDec_T.i delete mode 100644 ace/Auto_Ptr.cpp delete mode 100644 ace/Auto_Ptr.h delete mode 100644 ace/Auto_Ptr.i delete mode 100644 ace/Based_Pointer_Repository.cpp delete mode 100644 ace/Based_Pointer_Repository.h delete mode 100644 ace/Based_Pointer_T.cpp delete mode 100644 ace/Based_Pointer_T.h delete mode 100644 ace/Based_Pointer_T.i delete mode 100644 ace/Basic_Types.cpp delete mode 100644 ace/Basic_Types.h delete mode 100644 ace/Basic_Types.i delete mode 100644 ace/CDR_Stream.cpp delete mode 100644 ace/CDR_Stream.h delete mode 100644 ace/CDR_Stream.i delete mode 100644 ace/CLASSIX/CLASSIX_Addr.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Addr.h delete mode 100644 ace/CLASSIX/CLASSIX_Addr.i delete mode 100644 ace/CLASSIX/CLASSIX_CLD_Connector.cpp delete mode 100644 ace/CLASSIX/CLASSIX_CLD_Connector.h delete mode 100644 ace/CLASSIX/CLASSIX_CLD_Connector.i delete mode 100644 ace/CLASSIX/CLASSIX_CO_Acceptor.cpp delete mode 100644 ace/CLASSIX/CLASSIX_CO_Acceptor.h delete mode 100644 ace/CLASSIX/CLASSIX_CO_Acceptor.i delete mode 100644 ace/CLASSIX/CLASSIX_CO_Connector.cpp delete mode 100644 ace/CLASSIX/CLASSIX_CO_Connector.h delete mode 100644 ace/CLASSIX/CLASSIX_CO_Connector.i delete mode 100644 ace/CLASSIX/CLASSIX_Dgram_Mcast.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Dgram_Mcast.h delete mode 100644 ace/CLASSIX/CLASSIX_Dgram_Mcast.i delete mode 100644 ace/CLASSIX/CLASSIX_Group.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Group.h delete mode 100644 ace/CLASSIX/CLASSIX_Group.i delete mode 100644 ace/CLASSIX/CLASSIX_Group_Dynamic.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Group_Dynamic.h delete mode 100644 ace/CLASSIX/CLASSIX_Group_Dynamic.i delete mode 100644 ace/CLASSIX/CLASSIX_Group_Stamp.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Group_Stamp.h delete mode 100644 ace/CLASSIX/CLASSIX_Group_Stamp.i delete mode 100644 ace/CLASSIX/CLASSIX_OS.cpp delete mode 100644 ace/CLASSIX/CLASSIX_OS.h delete mode 100644 ace/CLASSIX/CLASSIX_OS.i delete mode 100644 ace/CLASSIX/CLASSIX_Peer_SAP.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Peer_SAP.h delete mode 100644 ace/CLASSIX/CLASSIX_Peer_SAP.i delete mode 100644 ace/CLASSIX/CLASSIX_Port.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Port.h delete mode 100644 ace/CLASSIX/CLASSIX_Port.i delete mode 100644 ace/CLASSIX/CLASSIX_Port_Core.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Port_Core.h delete mode 100644 ace/CLASSIX/CLASSIX_Port_Core.i delete mode 100644 ace/CLASSIX/CLASSIX_Port_Default.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Port_Default.h delete mode 100644 ace/CLASSIX/CLASSIX_Port_Default.i delete mode 100644 ace/CLASSIX/CLASSIX_SAP.cpp delete mode 100644 ace/CLASSIX/CLASSIX_SAP.h delete mode 100644 ace/CLASSIX/CLASSIX_SAP.i delete mode 100644 ace/CLASSIX/CLASSIX_Select_Reactor.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Select_Reactor.h delete mode 100644 ace/CLASSIX/CLASSIX_Select_Reactor.i delete mode 100644 ace/CLASSIX/CLASSIX_Stream.cpp delete mode 100644 ace/CLASSIX/CLASSIX_Stream.h delete mode 100644 ace/CLASSIX/CLASSIX_Stream.i delete mode 100644 ace/CLASSIX/Makefile delete mode 100644 ace/CORBA_Handler.cpp delete mode 100644 ace/CORBA_Handler.h delete mode 100644 ace/CORBA_Handler.i delete mode 100644 ace/CORBA_Ref.cpp delete mode 100644 ace/CORBA_Ref.h delete mode 100644 ace/CORBA_Ref.i delete mode 100644 ace/CORBA_macros.h delete mode 100644 ace/Cache_Map_Manager_T.cpp delete mode 100644 ace/Cache_Map_Manager_T.h delete mode 100644 ace/Cache_Map_Manager_T.i delete mode 100644 ace/Cached_Connect_Strategy_T.cpp delete mode 100644 ace/Cached_Connect_Strategy_T.h delete mode 100644 ace/Cached_Connect_Strategy_T.i delete mode 100644 ace/Caching_Strategies_T.cpp delete mode 100644 ace/Caching_Strategies_T.h delete mode 100644 ace/Caching_Strategies_T.i delete mode 100644 ace/Caching_Utility_T.cpp delete mode 100644 ace/Caching_Utility_T.h delete mode 100644 ace/Caching_Utility_T.i delete mode 100644 ace/Capabilities.cpp delete mode 100644 ace/Capabilities.h delete mode 100644 ace/Capabilities.i delete mode 100644 ace/Cleanup_Strategies_T.cpp delete mode 100644 ace/Cleanup_Strategies_T.h delete mode 100644 ace/Cleanup_Strategies_T.i delete mode 100644 ace/Codeset_IBM1047.cpp delete mode 100644 ace/Codeset_IBM1047.h delete mode 100644 ace/Configuration.cpp delete mode 100644 ace/Configuration.h delete mode 100644 ace/Configuration.i delete mode 100644 ace/Connector.cpp delete mode 100644 ace/Connector.h delete mode 100644 ace/Connector.i delete mode 100644 ace/Containers.cpp delete mode 100644 ace/Containers.h delete mode 100644 ace/Containers.i delete mode 100644 ace/Containers_T.cpp delete mode 100644 ace/Containers_T.h delete mode 100644 ace/Containers_T.i delete mode 100644 ace/DEV.cpp delete mode 100644 ace/DEV.h delete mode 100644 ace/DEV.i delete mode 100644 ace/DEV_Addr.cpp delete mode 100644 ace/DEV_Addr.h delete mode 100644 ace/DEV_Addr.i delete mode 100644 ace/DEV_Connector.cpp delete mode 100644 ace/DEV_Connector.h delete mode 100644 ace/DEV_Connector.i delete mode 100644 ace/DEV_IO.cpp delete mode 100644 ace/DEV_IO.h delete mode 100644 ace/DEV_IO.i delete mode 100644 ace/DLL.cpp delete mode 100644 ace/DLL.h delete mode 100644 ace/Date_Time.cpp delete mode 100644 ace/Date_Time.h delete mode 100644 ace/Date_Time.i delete mode 100644 ace/Dirent.cpp delete mode 100644 ace/Dirent.h delete mode 100644 ace/Dirent.i delete mode 100644 ace/Dump.cpp delete mode 100644 ace/Dump.h delete mode 100644 ace/Dump_T.cpp delete mode 100644 ace/Dump_T.h delete mode 100644 ace/Dynamic.cpp delete mode 100644 ace/Dynamic.h delete mode 100644 ace/Dynamic.i delete mode 100644 ace/Dynamic_Service.cpp delete mode 100644 ace/Dynamic_Service.h delete mode 100644 ace/Dynamic_Service.i delete mode 100644 ace/Env_Value_T.cpp delete mode 100644 ace/Env_Value_T.h delete mode 100644 ace/Env_Value_T.i delete mode 100644 ace/Event_Handler.cpp delete mode 100644 ace/Event_Handler.h delete mode 100644 ace/Event_Handler.i delete mode 100644 ace/Event_Handler_T.cpp delete mode 100644 ace/Event_Handler_T.h delete mode 100644 ace/Event_Handler_T.i delete mode 100644 ace/FIFO.cpp delete mode 100644 ace/FIFO.h delete mode 100644 ace/FIFO.i delete mode 100644 ace/FIFO_Recv.cpp delete mode 100644 ace/FIFO_Recv.h delete mode 100644 ace/FIFO_Recv.i delete mode 100644 ace/FIFO_Recv_Msg.cpp delete mode 100644 ace/FIFO_Recv_Msg.h delete mode 100644 ace/FIFO_Recv_Msg.i delete mode 100644 ace/FIFO_Send.cpp delete mode 100644 ace/FIFO_Send.h delete mode 100644 ace/FIFO_Send.i delete mode 100644 ace/FIFO_Send_Msg.cpp delete mode 100644 ace/FIFO_Send_Msg.h delete mode 100644 ace/FIFO_Send_Msg.i delete mode 100644 ace/FILE.cpp delete mode 100644 ace/FILE.h delete mode 100644 ace/FILE.i delete mode 100644 ace/FILE_Addr.cpp delete mode 100644 ace/FILE_Addr.h delete mode 100644 ace/FILE_Addr.i delete mode 100644 ace/FILE_Connector.cpp delete mode 100644 ace/FILE_Connector.h delete mode 100644 ace/FILE_Connector.i delete mode 100644 ace/FILE_IO.cpp delete mode 100644 ace/FILE_IO.h delete mode 100644 ace/FILE_IO.i delete mode 100644 ace/Filecache.cpp delete mode 100644 ace/Filecache.h delete mode 100644 ace/FlReactor.cpp delete mode 100644 ace/FlReactor.h delete mode 100644 ace/FlReactor.i delete mode 100644 ace/Free_List.cpp delete mode 100644 ace/Free_List.h delete mode 100644 ace/Free_List.i delete mode 100644 ace/Functor.cpp delete mode 100644 ace/Functor.h delete mode 100644 ace/Functor.i delete mode 100644 ace/Functor_T.cpp delete mode 100644 ace/Functor_T.h delete mode 100644 ace/Functor_T.i delete mode 100644 ace/Future.cpp delete mode 100644 ace/Future.h delete mode 100644 ace/Future_Set.cpp delete mode 100644 ace/Future_Set.h delete mode 100644 ace/Get_Opt.cpp delete mode 100644 ace/Get_Opt.h delete mode 100644 ace/Get_Opt.i delete mode 100644 ace/Handle_Gobbler.h delete mode 100644 ace/Handle_Gobbler.i delete mode 100644 ace/Handle_Set.cpp delete mode 100644 ace/Handle_Set.h delete mode 100644 ace/Handle_Set.i delete mode 100644 ace/Hash_Cache_Map_Manager_T.cpp delete mode 100644 ace/Hash_Cache_Map_Manager_T.h delete mode 100644 ace/Hash_Cache_Map_Manager_T.i delete mode 100644 ace/Hash_Map_Manager.cpp delete mode 100644 ace/Hash_Map_Manager.h delete mode 100644 ace/Hash_Map_Manager.i delete mode 100644 ace/Hash_Map_Manager_T.cpp delete mode 100644 ace/Hash_Map_Manager_T.h delete mode 100644 ace/Hash_Map_Manager_T.i delete mode 100644 ace/Hash_Map_With_Allocator_T.cpp delete mode 100644 ace/Hash_Map_With_Allocator_T.h delete mode 100644 ace/Hash_Map_With_Allocator_T.i delete mode 100644 ace/High_Res_Timer.cpp delete mode 100644 ace/High_Res_Timer.h delete mode 100644 ace/High_Res_Timer.i delete mode 100644 ace/INET_Addr.cpp delete mode 100644 ace/INET_Addr.h delete mode 100644 ace/INET_Addr.i delete mode 100644 ace/IOStream.cpp delete mode 100644 ace/IOStream.h delete mode 100644 ace/IOStream_T.cpp delete mode 100644 ace/IOStream_T.h delete mode 100644 ace/IOStream_T.i delete mode 100644 ace/IO_Cntl_Msg.cpp delete mode 100644 ace/IO_Cntl_Msg.h delete mode 100644 ace/IO_Cntl_Msg.i delete mode 100644 ace/IO_SAP.cpp delete mode 100644 ace/IO_SAP.h delete mode 100644 ace/IO_SAP.i delete mode 100644 ace/IPC_SAP.cpp delete mode 100644 ace/IPC_SAP.h delete mode 100644 ace/IPC_SAP.i delete mode 100644 ace/LOCK_SOCK_Acceptor.cpp delete mode 100644 ace/LOCK_SOCK_Acceptor.h delete mode 100644 ace/LSOCK.cpp delete mode 100644 ace/LSOCK.h delete mode 100644 ace/LSOCK.i delete mode 100644 ace/LSOCK_Acceptor.cpp delete mode 100644 ace/LSOCK_Acceptor.h delete mode 100644 ace/LSOCK_Acceptor.i delete mode 100644 ace/LSOCK_CODgram.cpp delete mode 100644 ace/LSOCK_CODgram.h delete mode 100644 ace/LSOCK_CODgram.i delete mode 100644 ace/LSOCK_Connector.cpp delete mode 100644 ace/LSOCK_Connector.h delete mode 100644 ace/LSOCK_Connector.i delete mode 100644 ace/LSOCK_Dgram.cpp delete mode 100644 ace/LSOCK_Dgram.h delete mode 100644 ace/LSOCK_Dgram.i delete mode 100644 ace/LSOCK_Stream.cpp delete mode 100644 ace/LSOCK_Stream.h delete mode 100644 ace/LSOCK_Stream.i delete mode 100644 ace/Local_Name_Space.cpp delete mode 100644 ace/Local_Name_Space.h delete mode 100644 ace/Local_Name_Space_T.cpp delete mode 100644 ace/Local_Name_Space_T.h delete mode 100644 ace/Local_Tokens.cpp delete mode 100644 ace/Local_Tokens.h delete mode 100644 ace/Local_Tokens.i delete mode 100644 ace/Log_Msg.cpp delete mode 100644 ace/Log_Msg.h delete mode 100644 ace/Log_Msg.i delete mode 100644 ace/Log_Priority.h delete mode 100644 ace/Log_Record.cpp delete mode 100644 ace/Log_Record.h delete mode 100644 ace/Log_Record.i delete mode 100644 ace/MEM_Acceptor.cpp delete mode 100644 ace/MEM_Acceptor.h delete mode 100644 ace/MEM_Acceptor.i delete mode 100644 ace/MEM_Addr.cpp delete mode 100644 ace/MEM_Addr.h delete mode 100644 ace/MEM_Addr.i delete mode 100644 ace/MEM_Connector.cpp delete mode 100644 ace/MEM_Connector.h delete mode 100644 ace/MEM_Connector.i delete mode 100644 ace/MEM_IO.cpp delete mode 100644 ace/MEM_IO.h delete mode 100644 ace/MEM_IO.i delete mode 100644 ace/MEM_SAP.cpp delete mode 100644 ace/MEM_SAP.h delete mode 100644 ace/MEM_SAP.i delete mode 100644 ace/MEM_Stream.cpp delete mode 100644 ace/MEM_Stream.h delete mode 100644 ace/MEM_Stream.i delete mode 100644 ace/Makefile delete mode 100644 ace/Makefile.am delete mode 100644 ace/Makefile.bor delete mode 100644 ace/Malloc.cpp delete mode 100644 ace/Malloc.h delete mode 100644 ace/Malloc.i delete mode 100644 ace/Malloc_Base.h delete mode 100644 ace/Malloc_T.cpp delete mode 100644 ace/Malloc_T.h delete mode 100644 ace/Malloc_T.i delete mode 100644 ace/Managed_Object.cpp delete mode 100644 ace/Managed_Object.h delete mode 100644 ace/Managed_Object.i delete mode 100644 ace/Map.cpp delete mode 100644 ace/Map.h delete mode 100644 ace/Map.i delete mode 100644 ace/Map_Manager.cpp delete mode 100644 ace/Map_Manager.h delete mode 100644 ace/Map_Manager.i delete mode 100644 ace/Map_T.cpp delete mode 100644 ace/Map_T.h delete mode 100644 ace/Map_T.i delete mode 100644 ace/Mem_Map.cpp delete mode 100644 ace/Mem_Map.h delete mode 100644 ace/Mem_Map.i delete mode 100644 ace/Memory_Pool.cpp delete mode 100644 ace/Memory_Pool.h delete mode 100644 ace/Memory_Pool.i delete mode 100644 ace/Message_Block.cpp delete mode 100644 ace/Message_Block.h delete mode 100644 ace/Message_Block.i delete mode 100644 ace/Message_Block_T.cpp delete mode 100644 ace/Message_Block_T.h delete mode 100644 ace/Message_Block_T.i delete mode 100644 ace/Message_Queue.cpp delete mode 100644 ace/Message_Queue.h delete mode 100644 ace/Message_Queue.i delete mode 100644 ace/Message_Queue_T.cpp delete mode 100644 ace/Message_Queue_T.h delete mode 100644 ace/Message_Queue_T.i delete mode 100644 ace/Method_Object.h delete mode 100644 ace/Method_Request.cpp delete mode 100644 ace/Method_Request.h delete mode 100644 ace/Min_Max.h delete mode 100644 ace/Module.cpp delete mode 100644 ace/Module.h delete mode 100644 ace/Module.i delete mode 100644 ace/Msg_WFMO_Reactor.cpp delete mode 100644 ace/Msg_WFMO_Reactor.h delete mode 100644 ace/Msg_WFMO_Reactor.i delete mode 100644 ace/Multiplexor.cpp delete mode 100644 ace/Multiplexor.h delete mode 100644 ace/Multiplexor.i delete mode 100644 ace/NT_Service.cpp delete mode 100644 ace/NT_Service.h delete mode 100644 ace/NT_Service.i delete mode 100644 ace/Name_Proxy.cpp delete mode 100644 ace/Name_Proxy.h delete mode 100644 ace/Name_Request_Reply.cpp delete mode 100644 ace/Name_Request_Reply.h delete mode 100644 ace/Name_Space.cpp delete mode 100644 ace/Name_Space.h delete mode 100644 ace/Naming_Context.cpp delete mode 100644 ace/Naming_Context.h delete mode 100644 ace/OS.cpp delete mode 100644 ace/OS.h delete mode 100644 ace/OS.i delete mode 100644 ace/Object_Manager.cpp delete mode 100644 ace/Object_Manager.h delete mode 100644 ace/Object_Manager.i delete mode 100644 ace/Obstack.cpp delete mode 100644 ace/Obstack.h delete mode 100644 ace/Obstack.i delete mode 100644 ace/POSIX_Asynch_IO.cpp delete mode 100644 ace/POSIX_Asynch_IO.h delete mode 100644 ace/POSIX_Asynch_IO.i delete mode 100644 ace/POSIX_Proactor.cpp delete mode 100644 ace/POSIX_Proactor.h delete mode 100644 ace/POSIX_Proactor.i delete mode 100644 ace/Pair.cpp delete mode 100644 ace/Pair.h delete mode 100644 ace/Pair.i delete mode 100644 ace/Pair_T.cpp delete mode 100644 ace/Pair_T.h delete mode 100644 ace/Pair_T.i delete mode 100644 ace/Parse_Node.cpp delete mode 100644 ace/Parse_Node.h delete mode 100644 ace/Parse_Node.i delete mode 100644 ace/Pipe.cpp delete mode 100644 ace/Pipe.h delete mode 100644 ace/Pipe.i delete mode 100644 ace/Priority_Reactor.cpp delete mode 100644 ace/Priority_Reactor.h delete mode 100644 ace/Priority_Reactor.i delete mode 100644 ace/Proactor.cpp delete mode 100644 ace/Proactor.h delete mode 100644 ace/Proactor.i delete mode 100644 ace/Proactor_Impl.h delete mode 100644 ace/Process.cpp delete mode 100644 ace/Process.h delete mode 100644 ace/Process.i delete mode 100644 ace/Process_Manager.cpp delete mode 100644 ace/Process_Manager.h delete mode 100644 ace/Process_Manager.i delete mode 100644 ace/Profile_Timer.cpp delete mode 100644 ace/Profile_Timer.h delete mode 100644 ace/Profile_Timer.i delete mode 100644 ace/QoS_Manager.cpp delete mode 100644 ace/QoS_Manager.h delete mode 100644 ace/QoS_Session.h delete mode 100644 ace/QoS_Session_Factory.cpp delete mode 100644 ace/QoS_Session_Factory.h delete mode 100644 ace/QoS_Session_Impl.cpp delete mode 100644 ace/QoS_Session_Impl.h delete mode 100644 ace/QoS_Session_Impl.i delete mode 100644 ace/QtReactor.cpp delete mode 100644 ace/QtReactor.h delete mode 100644 ace/RB_Tree.cpp delete mode 100644 ace/RB_Tree.h delete mode 100644 ace/RB_Tree.i delete mode 100644 ace/README delete mode 100644 ace/Reactor.cpp delete mode 100644 ace/Reactor.h delete mode 100644 ace/Reactor.i delete mode 100644 ace/Reactor_Impl.h delete mode 100644 ace/Read_Buffer.cpp delete mode 100644 ace/Read_Buffer.h delete mode 100644 ace/Read_Buffer.i delete mode 100644 ace/Registry.cpp delete mode 100644 ace/Registry.h delete mode 100644 ace/Registry_Name_Space.cpp delete mode 100644 ace/Registry_Name_Space.h delete mode 100644 ace/Remote_Name_Space.cpp delete mode 100644 ace/Remote_Name_Space.h delete mode 100644 ace/Remote_Tokens.cpp delete mode 100644 ace/Remote_Tokens.h delete mode 100644 ace/Remote_Tokens.i delete mode 100644 ace/SOCK.cpp delete mode 100644 ace/SOCK.h delete mode 100644 ace/SOCK.i delete mode 100644 ace/SOCK_Acceptor.cpp delete mode 100644 ace/SOCK_Acceptor.h delete mode 100644 ace/SOCK_Acceptor.i delete mode 100644 ace/SOCK_CODgram.cpp delete mode 100644 ace/SOCK_CODgram.h delete mode 100644 ace/SOCK_CODgram.i delete mode 100644 ace/SOCK_Connector.cpp delete mode 100644 ace/SOCK_Connector.h delete mode 100644 ace/SOCK_Connector.i delete mode 100644 ace/SOCK_Dgram.cpp delete mode 100644 ace/SOCK_Dgram.h delete mode 100644 ace/SOCK_Dgram.i delete mode 100644 ace/SOCK_Dgram_Bcast.cpp delete mode 100644 ace/SOCK_Dgram_Bcast.h delete mode 100644 ace/SOCK_Dgram_Bcast.i delete mode 100644 ace/SOCK_Dgram_Mcast.cpp delete mode 100644 ace/SOCK_Dgram_Mcast.h delete mode 100644 ace/SOCK_Dgram_Mcast.i delete mode 100644 ace/SOCK_Dgram_Mcast_QoS.cpp delete mode 100644 ace/SOCK_Dgram_Mcast_QoS.h delete mode 100644 ace/SOCK_Dgram_Mcast_QoS.i delete mode 100644 ace/SOCK_IO.cpp delete mode 100644 ace/SOCK_IO.h delete mode 100644 ace/SOCK_IO.i delete mode 100644 ace/SOCK_Stream.cpp delete mode 100644 ace/SOCK_Stream.h delete mode 100644 ace/SOCK_Stream.i delete mode 100644 ace/SPIPE.cpp delete mode 100644 ace/SPIPE.h delete mode 100644 ace/SPIPE.i delete mode 100644 ace/SPIPE_Acceptor.cpp delete mode 100644 ace/SPIPE_Acceptor.h delete mode 100644 ace/SPIPE_Acceptor.i delete mode 100644 ace/SPIPE_Addr.cpp delete mode 100644 ace/SPIPE_Addr.h delete mode 100644 ace/SPIPE_Addr.i delete mode 100644 ace/SPIPE_Connector.cpp delete mode 100644 ace/SPIPE_Connector.h delete mode 100644 ace/SPIPE_Connector.i delete mode 100644 ace/SPIPE_Stream.cpp delete mode 100644 ace/SPIPE_Stream.h delete mode 100644 ace/SPIPE_Stream.i delete mode 100644 ace/SSL/ACE_SSL.dsp delete mode 100644 ace/SSL/SSL_Context.cpp delete mode 100644 ace/SSL/SSL_Context.h delete mode 100644 ace/SSL/SSL_Context.i delete mode 100644 ace/SSL/SSL_Context.inl delete mode 100644 ace/SSL/SSL_Export.h delete mode 100644 ace/SSL/SSL_SOCK.cpp delete mode 100644 ace/SSL/SSL_SOCK.h delete mode 100644 ace/SSL/SSL_SOCK.i delete mode 100644 ace/SSL/SSL_SOCK_Acceptor.cpp delete mode 100644 ace/SSL/SSL_SOCK_Acceptor.h delete mode 100644 ace/SSL/SSL_SOCK_Acceptor.i delete mode 100644 ace/SSL/SSL_SOCK_Connector.cpp delete mode 100644 ace/SSL/SSL_SOCK_Connector.h delete mode 100644 ace/SSL/SSL_SOCK_Connector.i delete mode 100644 ace/SSL/SSL_SOCK_Stream.cpp delete mode 100644 ace/SSL/SSL_SOCK_Stream.h delete mode 100644 ace/SSL/SSL_SOCK_Stream.i delete mode 100644 ace/SSL/sslconf.h delete mode 100644 ace/SString.cpp delete mode 100644 ace/SString.h delete mode 100644 ace/SString.i delete mode 100644 ace/SV_Message.cpp delete mode 100644 ace/SV_Message.h delete mode 100644 ace/SV_Message.i delete mode 100644 ace/SV_Message_Queue.cpp delete mode 100644 ace/SV_Message_Queue.h delete mode 100644 ace/SV_Message_Queue.i delete mode 100644 ace/SV_Semaphore_Complex.cpp delete mode 100644 ace/SV_Semaphore_Complex.h delete mode 100644 ace/SV_Semaphore_Complex.i delete mode 100644 ace/SV_Semaphore_Simple.cpp delete mode 100644 ace/SV_Semaphore_Simple.h delete mode 100644 ace/SV_Semaphore_Simple.i delete mode 100644 ace/SV_Shared_Memory.cpp delete mode 100644 ace/SV_Shared_Memory.h delete mode 100644 ace/SV_Shared_Memory.i delete mode 100644 ace/Sched_Params.cpp delete mode 100644 ace/Sched_Params.h delete mode 100644 ace/Sched_Params.i delete mode 100644 ace/Select_Reactor.cpp delete mode 100644 ace/Select_Reactor.h delete mode 100644 ace/Select_Reactor.i delete mode 100644 ace/Select_Reactor_Base.cpp delete mode 100644 ace/Select_Reactor_Base.h delete mode 100644 ace/Select_Reactor_Base.i delete mode 100644 ace/Select_Reactor_T.cpp delete mode 100644 ace/Select_Reactor_T.h delete mode 100644 ace/Select_Reactor_T.i delete mode 100644 ace/Service_Config.cpp delete mode 100644 ace/Service_Config.h delete mode 100644 ace/Service_Config.i delete mode 100644 ace/Service_Manager.cpp delete mode 100644 ace/Service_Manager.h delete mode 100644 ace/Service_Manager.i delete mode 100644 ace/Service_Object.cpp delete mode 100644 ace/Service_Object.h delete mode 100644 ace/Service_Object.i delete mode 100644 ace/Service_Repository.cpp delete mode 100644 ace/Service_Repository.h delete mode 100644 ace/Service_Repository.i delete mode 100644 ace/Service_Types.cpp delete mode 100644 ace/Service_Types.h delete mode 100644 ace/Service_Types.i delete mode 100644 ace/Shared_Memory.cpp delete mode 100644 ace/Shared_Memory.h delete mode 100644 ace/Shared_Memory_MM.cpp delete mode 100644 ace/Shared_Memory_MM.h delete mode 100644 ace/Shared_Memory_MM.i delete mode 100644 ace/Shared_Memory_SV.cpp delete mode 100644 ace/Shared_Memory_SV.h delete mode 100644 ace/Shared_Memory_SV.i delete mode 100644 ace/Shared_Object.cpp delete mode 100644 ace/Shared_Object.h delete mode 100644 ace/Shared_Object.i delete mode 100644 ace/Signal.cpp delete mode 100644 ace/Signal.h delete mode 100644 ace/Signal.i delete mode 100644 ace/Singleton.cpp delete mode 100644 ace/Singleton.h delete mode 100644 ace/Singleton.i delete mode 100644 ace/Stats.cpp delete mode 100644 ace/Stats.h delete mode 100644 ace/Stats.i delete mode 100644 ace/Strategies.cpp delete mode 100644 ace/Strategies.h delete mode 100644 ace/Strategies.i delete mode 100644 ace/Strategies_T.cpp delete mode 100644 ace/Strategies_T.h delete mode 100644 ace/Strategies_T.i delete mode 100644 ace/Stream.cpp delete mode 100644 ace/Stream.h delete mode 100644 ace/Stream.i delete mode 100644 ace/Stream_Modules.cpp delete mode 100644 ace/Stream_Modules.h delete mode 100644 ace/Stream_Modules.i delete mode 100644 ace/Svc_Conf.h delete mode 100644 ace/Svc_Conf.l delete mode 100644 ace/Svc_Conf.y delete mode 100644 ace/Svc_Conf_Tokens.h delete mode 100644 ace/Svc_Conf_l.cpp delete mode 100644 ace/Svc_Conf_y.cpp delete mode 100644 ace/Svc_Handler.cpp delete mode 100644 ace/Svc_Handler.h delete mode 100644 ace/Svc_Handler.i delete mode 100644 ace/Synch.cpp delete mode 100644 ace/Synch.h delete mode 100644 ace/Synch.i delete mode 100644 ace/Synch_Options.cpp delete mode 100644 ace/Synch_Options.h delete mode 100644 ace/Synch_Options.i delete mode 100644 ace/Synch_T.cpp delete mode 100644 ace/Synch_T.h delete mode 100644 ace/Synch_T.i delete mode 100644 ace/System_Time.cpp delete mode 100644 ace/System_Time.h delete mode 100644 ace/TLI.cpp delete mode 100644 ace/TLI.h delete mode 100644 ace/TLI.i delete mode 100644 ace/TLI_Acceptor.cpp delete mode 100644 ace/TLI_Acceptor.h delete mode 100644 ace/TLI_Acceptor.i delete mode 100644 ace/TLI_Connector.cpp delete mode 100644 ace/TLI_Connector.h delete mode 100644 ace/TLI_Connector.i delete mode 100644 ace/TLI_Stream.cpp delete mode 100644 ace/TLI_Stream.h delete mode 100644 ace/TLI_Stream.i delete mode 100644 ace/TP_Reactor.cpp delete mode 100644 ace/TP_Reactor.h delete mode 100644 ace/TP_Reactor.i delete mode 100644 ace/TTY_IO.cpp delete mode 100644 ace/TTY_IO.h delete mode 100644 ace/Task.cpp delete mode 100644 ace/Task.h delete mode 100644 ace/Task.i delete mode 100644 ace/Task_T.cpp delete mode 100644 ace/Task_T.h delete mode 100644 ace/Task_T.i delete mode 100644 ace/Template_Instantiations.cpp delete mode 100644 ace/Thread.cpp delete mode 100644 ace/Thread.h delete mode 100644 ace/Thread.i delete mode 100644 ace/Thread_Manager.cpp delete mode 100644 ace/Thread_Manager.h delete mode 100644 ace/Thread_Manager.i delete mode 100644 ace/Time_Request_Reply.cpp delete mode 100644 ace/Time_Request_Reply.h delete mode 100644 ace/Time_Value.h delete mode 100644 ace/Timeprobe.cpp delete mode 100644 ace/Timeprobe.h delete mode 100644 ace/Timeprobe.i delete mode 100644 ace/Timeprobe_T.cpp delete mode 100644 ace/Timeprobe_T.h delete mode 100644 ace/Timer_Hash.cpp delete mode 100644 ace/Timer_Hash.h delete mode 100644 ace/Timer_Hash_T.cpp delete mode 100644 ace/Timer_Hash_T.h delete mode 100644 ace/Timer_Heap.cpp delete mode 100644 ace/Timer_Heap.h delete mode 100644 ace/Timer_Heap_T.cpp delete mode 100644 ace/Timer_Heap_T.h delete mode 100644 ace/Timer_List.cpp delete mode 100644 ace/Timer_List.h delete mode 100644 ace/Timer_List_T.cpp delete mode 100644 ace/Timer_List_T.h delete mode 100644 ace/Timer_Queue.cpp delete mode 100644 ace/Timer_Queue.h delete mode 100644 ace/Timer_Queue.i delete mode 100644 ace/Timer_Queue_Adapters.cpp delete mode 100644 ace/Timer_Queue_Adapters.h delete mode 100644 ace/Timer_Queue_Adapters.i delete mode 100644 ace/Timer_Queue_T.cpp delete mode 100644 ace/Timer_Queue_T.h delete mode 100644 ace/Timer_Queue_T.i delete mode 100644 ace/Timer_Wheel.cpp delete mode 100644 ace/Timer_Wheel.h delete mode 100644 ace/Timer_Wheel_T.cpp delete mode 100644 ace/Timer_Wheel_T.h delete mode 100644 ace/TkReactor.cpp delete mode 100644 ace/TkReactor.h delete mode 100644 ace/Token.cpp delete mode 100644 ace/Token.h delete mode 100644 ace/Token.i delete mode 100644 ace/Token_Collection.cpp delete mode 100644 ace/Token_Collection.h delete mode 100644 ace/Token_Collection.i delete mode 100644 ace/Token_Invariants.cpp delete mode 100644 ace/Token_Invariants.h delete mode 100644 ace/Token_Invariants.i delete mode 100644 ace/Token_Manager.cpp delete mode 100644 ace/Token_Manager.h delete mode 100644 ace/Token_Manager.i delete mode 100644 ace/Token_Request_Reply.cpp delete mode 100644 ace/Token_Request_Reply.h delete mode 100644 ace/Token_Request_Reply.i delete mode 100644 ace/Trace.cpp delete mode 100644 ace/Trace.h delete mode 100644 ace/Trace.i delete mode 100644 ace/Typed_SV_Message.cpp delete mode 100644 ace/Typed_SV_Message.h delete mode 100644 ace/Typed_SV_Message.i delete mode 100644 ace/Typed_SV_Message_Queue.cpp delete mode 100644 ace/Typed_SV_Message_Queue.h delete mode 100644 ace/Typed_SV_Message_Queue.i delete mode 100644 ace/UNIX_Addr.cpp delete mode 100644 ace/UNIX_Addr.h delete mode 100644 ace/UNIX_Addr.i delete mode 100644 ace/UPIPE_Acceptor.cpp delete mode 100644 ace/UPIPE_Acceptor.h delete mode 100644 ace/UPIPE_Acceptor.i delete mode 100644 ace/UPIPE_Addr.h delete mode 100644 ace/UPIPE_Connector.cpp delete mode 100644 ace/UPIPE_Connector.h delete mode 100644 ace/UPIPE_Connector.i delete mode 100644 ace/UPIPE_Stream.cpp delete mode 100644 ace/UPIPE_Stream.h delete mode 100644 ace/UPIPE_Stream.i delete mode 100644 ace/Version.h delete mode 100644 ace/WFMO_Reactor.cpp delete mode 100644 ace/WFMO_Reactor.h delete mode 100644 ace/WFMO_Reactor.i delete mode 100644 ace/WIN32_Asynch_IO.cpp delete mode 100644 ace/WIN32_Asynch_IO.h delete mode 100644 ace/WIN32_Asynch_IO.i delete mode 100644 ace/WIN32_Proactor.cpp delete mode 100644 ace/WIN32_Proactor.h delete mode 100644 ace/WIN32_Proactor.i delete mode 100644 ace/XTI_ATM_Mcast.cpp delete mode 100644 ace/XTI_ATM_Mcast.h delete mode 100644 ace/XTI_ATM_Mcast.i delete mode 100644 ace/XtReactor.cpp delete mode 100644 ace/XtReactor.h delete mode 100644 ace/ace-dll.icc delete mode 100644 ace/ace-lib.icc delete mode 100644 ace/ace.dsw delete mode 100755 ace/ace.icc delete mode 100644 ace/ace.rc delete mode 100644 ace/ace_ce.dsw delete mode 100644 ace/ace_ce_dll.cfg delete mode 100644 ace/ace_dll.dsp delete mode 100644 ace/ace_dll_ce.dsp delete mode 100644 ace/ace_lib.dsp delete mode 100644 ace/ace_wchar.h delete mode 100644 ace/config-WinCE.h delete mode 100644 ace/config-aix-3.2.5.h delete mode 100644 ace/config-aix-4.1.x.h delete mode 100644 ace/config-aix-4.2.x.h delete mode 100644 ace/config-aix-4.3.x.h delete mode 100644 ace/config-aix-4.x.h delete mode 100644 ace/config-all.h delete mode 100644 ace/config-chorus.h delete mode 100644 ace/config-cray.h delete mode 100644 ace/config-cxx-common.h delete mode 100644 ace/config-cygwin32-common.h delete mode 100644 ace/config-cygwin32.h delete mode 100644 ace/config-dgux-4.11-epc.h delete mode 100644 ace/config-dgux-4.x-ghs.h delete mode 100644 ace/config-freebsd-pthread.h delete mode 100644 ace/config-freebsd.h delete mode 100644 ace/config-fsu-pthread.h delete mode 100644 ace/config-g++-common.h delete mode 100644 ace/config-ghs-common.h delete mode 100644 ace/config-hpux-10.x-g++.h delete mode 100644 ace/config-hpux-10.x-hpc++.h delete mode 100644 ace/config-hpux-10.x.h delete mode 100644 ace/config-hpux-11.00.h delete mode 100644 ace/config-hpux-11.x-hpc++.h delete mode 100644 ace/config-hpux-9.x-orbix.h delete mode 100644 ace/config-hpux-9.x.h delete mode 100644 ace/config-hpux11.h delete mode 100644 ace/config-irix5.2.h delete mode 100644 ace/config-irix5.3-g++.h delete mode 100644 ace/config-irix5.3-sgic++.h delete mode 100644 ace/config-irix6.x-common.h delete mode 100644 ace/config-irix6.x-g++.h delete mode 100644 ace/config-irix6.x-kcc.h delete mode 100644 ace/config-irix6.x-sgic++-nothreads.h delete mode 100644 ace/config-irix6.x-sgic++.h delete mode 100644 ace/config-kcc-common.h delete mode 100644 ace/config-linux-common.h delete mode 100644 ace/config-linux-lxpthreads.h delete mode 100644 ace/config-linux-pthread.h delete mode 100644 ace/config-linux.h delete mode 100644 ace/config-lynxos.h delete mode 100644 ace/config-m88k.h delete mode 100644 ace/config-minimal.h delete mode 100644 ace/config-mit-pthread.h delete mode 100644 ace/config-mklinux.h delete mode 100644 ace/config-mvs.h delete mode 100644 ace/config-netbsd.h delete mode 100644 ace/config-osf1-3.2.h delete mode 100644 ace/config-osf1-4.0.h delete mode 100644 ace/config-pharlap.h delete mode 100644 ace/config-psos-diab-mips.h delete mode 100644 ace/config-psos-diab-ppc.h delete mode 100644 ace/config-psos-diab.h delete mode 100644 ace/config-psos-tm.h delete mode 100644 ace/config-psosim-g++.h delete mode 100644 ace/config-qnx-neutrino.h delete mode 100644 ace/config-sco-4.2-nothread.h delete mode 100644 ace/config-sco-5.0.0-fsu-pthread.h delete mode 100644 ace/config-sco-5.0.0-mit-pthread.h delete mode 100644 ace/config-sco-5.0.0-nothread.h delete mode 100644 ace/config-sco-5.0.0.h delete mode 100644 ace/config-sunos4-g++.h delete mode 100644 ace/config-sunos4-lucid3.2.h delete mode 100644 ace/config-sunos4-sun3.x.h delete mode 100644 ace/config-sunos4-sun4.1.4.h delete mode 100644 ace/config-sunos4-sun4.x-orbix.h delete mode 100644 ace/config-sunos4-sun4.x.h delete mode 100644 ace/config-sunos5.4-centerline-2.x.h delete mode 100644 ace/config-sunos5.4-g++.h delete mode 100644 ace/config-sunos5.4-sunc++-4.x-orbix.h delete mode 100644 ace/config-sunos5.4-sunc++-4.x.h delete mode 100644 ace/config-sunos5.5.h delete mode 100644 ace/config-sunos5.6.h delete mode 100644 ace/config-sunos5.7.h delete mode 100644 ace/config-sunos5.x-sunc++-4.x-orbix.h delete mode 100644 ace/config-tandem.h delete mode 100644 ace/config-tru64.h delete mode 100644 ace/config-unixware-2.01-g++.h delete mode 100644 ace/config-unixware-2.1.2-g++.h delete mode 100644 ace/config-visualage.h delete mode 100644 ace/config-vxworks5.x.h delete mode 100644 ace/config-win32-borland.h delete mode 100644 ace/config-win32-common.h delete mode 100644 ace/config-win32-msvc.h delete mode 100644 ace/config-win32-visualage.h delete mode 100644 ace/config-win32.h delete mode 100644 ace/gethrtime.cpp delete mode 100644 ace/iosfwd.h delete mode 100644 ace/makefile-light delete mode 100644 ace/post.h delete mode 100644 ace/pre.h delete mode 100644 ace/streams.h delete mode 100644 ace/svc_export.h delete mode 100644 ace/ws2tcpip.h delete mode 100644 aceConf.sh.in delete mode 100644 apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp delete mode 100644 apps/Gateway/Gateway/Concrete_Connection_Handlers.h delete mode 100644 apps/Gateway/Gateway/Concurrency_Strategies.h delete mode 100644 apps/Gateway/Gateway/Config_Files.cpp delete mode 100644 apps/Gateway/Gateway/Config_Files.h delete mode 100644 apps/Gateway/Gateway/Connection_Handler.cpp delete mode 100644 apps/Gateway/Gateway/Connection_Handler.h delete mode 100644 apps/Gateway/Gateway/Connection_Handler_Acceptor.cpp delete mode 100644 apps/Gateway/Gateway/Connection_Handler_Acceptor.h delete mode 100644 apps/Gateway/Gateway/Connection_Handler_Connector.cpp delete mode 100644 apps/Gateway/Gateway/Connection_Handler_Connector.h delete mode 100644 apps/Gateway/Gateway/Consumer_Dispatch_Set.h delete mode 100644 apps/Gateway/Gateway/Event.h delete mode 100644 apps/Gateway/Gateway/Event_Channel.cpp delete mode 100644 apps/Gateway/Gateway/Event_Channel.h delete mode 100644 apps/Gateway/Gateway/Event_Forwarding_Discriminator.cpp delete mode 100644 apps/Gateway/Gateway/Event_Forwarding_Discriminator.h delete mode 100644 apps/Gateway/Gateway/File_Parser.cpp delete mode 100644 apps/Gateway/Gateway/File_Parser.h delete mode 100644 apps/Gateway/Gateway/Gateway.cpp delete mode 100644 apps/Gateway/Gateway/Gateway.dsp delete mode 100644 apps/Gateway/Gateway/Gateway.dsw delete mode 100644 apps/Gateway/Gateway/Gateway.h delete mode 100644 apps/Gateway/Gateway/Makefile delete mode 100644 apps/Gateway/Gateway/Makefile.bor delete mode 100644 apps/Gateway/Gateway/Options.cpp delete mode 100644 apps/Gateway/Gateway/Options.h delete mode 100644 apps/Gateway/Gateway/Peer_Message.h delete mode 100644 apps/Gateway/Gateway/connection_config delete mode 100644 apps/Gateway/Gateway/consumer_config delete mode 100644 apps/Gateway/Gateway/gatewayd.cpp delete mode 100644 apps/Gateway/Gateway/gatewayd.dsp delete mode 100644 apps/Gateway/Gateway/svc.conf delete mode 100644 apps/Gateway/Makefile delete mode 100644 apps/Gateway/Makefile.bor delete mode 100644 apps/Gateway/Peer/Makefile delete mode 100644 apps/Gateway/Peer/Makefile.bor delete mode 100644 apps/Gateway/Peer/Options.cpp delete mode 100644 apps/Gateway/Peer/Options.h delete mode 100644 apps/Gateway/Peer/Peer.cpp delete mode 100644 apps/Gateway/Peer/Peer.dsp delete mode 100644 apps/Gateway/Peer/Peer.dsw delete mode 100644 apps/Gateway/Peer/Peer.h delete mode 100644 apps/Gateway/Peer/peerd.cpp delete mode 100644 apps/Gateway/Peer/peerd.dsp delete mode 100644 apps/Gateway/Peer/svc.conf delete mode 100644 apps/Gateway/README delete mode 100644 apps/JAWS/ChangeLog delete mode 100644 apps/JAWS/Makefile delete mode 100644 apps/JAWS/Makefile.bor delete mode 100644 apps/JAWS/README delete mode 100644 apps/JAWS/clients/Blobby/Blob.cpp delete mode 100644 apps/JAWS/clients/Blobby/Blob.h delete mode 100644 apps/JAWS/clients/Blobby/Blob_Handler.cpp delete mode 100644 apps/JAWS/clients/Blobby/Blob_Handler.h delete mode 100644 apps/JAWS/clients/Blobby/Makefile delete mode 100644 apps/JAWS/clients/Blobby/Makefile.bor delete mode 100644 apps/JAWS/clients/Blobby/Options.cpp delete mode 100644 apps/JAWS/clients/Blobby/Options.h delete mode 100644 apps/JAWS/clients/Blobby/README delete mode 100644 apps/JAWS/clients/Blobby/blobby.cpp delete mode 100644 apps/JAWS/clients/Caching/Caching.dsp delete mode 100644 apps/JAWS/clients/Caching/Caching.dsw delete mode 100644 apps/JAWS/clients/Caching/ID_Generator.cpp delete mode 100644 apps/JAWS/clients/Caching/ID_Generator.h delete mode 100644 apps/JAWS/clients/Caching/Local_Locator.cpp delete mode 100644 apps/JAWS/clients/Caching/Local_Locator.h delete mode 100644 apps/JAWS/clients/Caching/Local_Locator.i delete mode 100644 apps/JAWS/clients/Caching/Locator_Request_Reply.cpp delete mode 100644 apps/JAWS/clients/Caching/Locator_Request_Reply.h delete mode 100644 apps/JAWS/clients/Caching/Locator_Request_Reply.i delete mode 100644 apps/JAWS/clients/Caching/Makefile delete mode 100644 apps/JAWS/clients/Caching/Makefile.bor delete mode 100644 apps/JAWS/clients/Caching/README delete mode 100644 apps/JAWS/clients/Caching/URL_Array_Helper.cpp delete mode 100644 apps/JAWS/clients/Caching/URL_Array_Helper.h delete mode 100644 apps/JAWS/clients/Caching/URL_Locator.cpp delete mode 100644 apps/JAWS/clients/Caching/URL_Locator.h delete mode 100644 apps/JAWS/clients/Caching/URL_Locator.i delete mode 100644 apps/JAWS/clients/Caching/URL_Properties.cpp delete mode 100644 apps/JAWS/clients/Caching/URL_Properties.h delete mode 100644 apps/JAWS/clients/Caching/URL_Properties.i delete mode 100644 apps/JAWS/clients/Caching/http_client.cpp delete mode 100644 apps/JAWS/clients/Caching/http_handler.cpp delete mode 100644 apps/JAWS/clients/Caching/http_handler.h delete mode 100644 apps/JAWS/clients/Caching/test_URL.cpp delete mode 100644 apps/JAWS/clients/Caching/testing.dsp delete mode 100644 apps/JAWS/clients/Makefile delete mode 100644 apps/JAWS/clients/Makefile.bor delete mode 100644 apps/JAWS/clients/README delete mode 100644 apps/JAWS/clients/WebSTONE/COPYING delete mode 100644 apps/JAWS/clients/WebSTONE/README delete mode 100644 apps/JAWS/clients/WebSTONE/README.DynamicWorkload delete mode 100644 apps/JAWS/clients/WebSTONE/README.FIRST delete mode 100644 apps/JAWS/clients/WebSTONE/WEBSTONE-VERSION-2.0 delete mode 100755 apps/JAWS/clients/WebSTONE/bin/WebStone-common.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/WebStone-manage.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/WebStone-run.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/WebStone-setup.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/checkfilelist delete mode 100755 apps/JAWS/clients/WebSTONE/bin/genfiles delete mode 100755 apps/JAWS/clients/WebSTONE/bin/genfiles-from-filelist.sh delete mode 100755 apps/JAWS/clients/WebSTONE/bin/gui-configure delete mode 100755 apps/JAWS/clients/WebSTONE/bin/killbench delete mode 100755 apps/JAWS/clients/WebSTONE/bin/killbench.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/mine-logs.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/move-filelist.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/move-runs.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/rebootall delete mode 100755 apps/JAWS/clients/WebSTONE/bin/runbench delete mode 100755 apps/JAWS/clients/WebSTONE/bin/runbench.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/tabs2html delete mode 100755 apps/JAWS/clients/WebSTONE/bin/view-results.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/webstone-gui.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/write-testbed.pl delete mode 100755 apps/JAWS/clients/WebSTONE/bin/wscollect.pl delete mode 100644 apps/JAWS/clients/WebSTONE/conf/filelist delete mode 100644 apps/JAWS/clients/WebSTONE/conf/filelist.cgi-heavy delete mode 100644 apps/JAWS/clients/WebSTONE/conf/filelist.dynamic-heavy delete mode 100644 apps/JAWS/clients/WebSTONE/conf/filelist.dynamic-light delete mode 100644 apps/JAWS/clients/WebSTONE/conf/filelist.dynamic-medium delete mode 100644 apps/JAWS/clients/WebSTONE/conf/filelist.homepage delete mode 100644 apps/JAWS/clients/WebSTONE/conf/filelist.sample delete mode 100644 apps/JAWS/clients/WebSTONE/conf/filelist.standard delete mode 100644 apps/JAWS/clients/WebSTONE/conf/fileset delete mode 100755 apps/JAWS/clients/WebSTONE/conf/paths.pl delete mode 100644 apps/JAWS/clients/WebSTONE/conf/paths.sh delete mode 100644 apps/JAWS/clients/WebSTONE/conf/testbed delete mode 100644 apps/JAWS/clients/WebSTONE/doc/COPYING delete mode 100644 apps/JAWS/clients/WebSTONE/doc/FAQ-webstone.html delete mode 100644 apps/JAWS/clients/WebSTONE/doc/LICENSE.html delete mode 100644 apps/JAWS/clients/WebSTONE/doc/WebStone.html delete mode 100755 apps/JAWS/clients/WebSTONE/doc/testbed.help delete mode 100644 apps/JAWS/clients/WebSTONE/doc/webstone-white-paper.ps delete mode 100644 apps/JAWS/clients/WebSTONE/doc/webstone.gif delete mode 100644 apps/JAWS/clients/WebSTONE/doc/webstone2.html delete mode 100644 apps/JAWS/clients/WebSTONE/src/Makefile delete mode 100755 apps/JAWS/clients/WebSTONE/src/README delete mode 100644 apps/JAWS/clients/WebSTONE/src/acconfig.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/bench.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/bench.h delete mode 100755 apps/JAWS/clients/WebSTONE/src/cgi-send delete mode 100644 apps/JAWS/clients/WebSTONE/src/cgi-send.c delete mode 100755 apps/JAWS/clients/WebSTONE/src/client/webclient.mak delete mode 100644 apps/JAWS/clients/WebSTONE/src/config.cache delete mode 100755 apps/JAWS/clients/WebSTONE/src/config.guess delete mode 100644 apps/JAWS/clients/WebSTONE/src/config.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/config.h.in delete mode 100644 apps/JAWS/clients/WebSTONE/src/config.log delete mode 100755 apps/JAWS/clients/WebSTONE/src/config.status delete mode 100755 apps/JAWS/clients/WebSTONE/src/config.sub delete mode 100755 apps/JAWS/clients/WebSTONE/src/configure delete mode 100644 apps/JAWS/clients/WebSTONE/src/configure.in delete mode 100644 apps/JAWS/clients/WebSTONE/src/debug.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/errexit.c delete mode 100755 apps/JAWS/clients/WebSTONE/src/gendata/genrand.mak delete mode 100644 apps/JAWS/clients/WebSTONE/src/genrand.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/get.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/get.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/getopt.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/gettimeofday.c delete mode 100755 apps/JAWS/clients/WebSTONE/src/install-sh delete mode 100644 apps/JAWS/clients/WebSTONE/src/logfile27859 delete mode 100755 apps/JAWS/clients/WebSTONE/src/master/webmaster.mak delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/buffer.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/cinfo.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/crit.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/daemon.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/dll.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/ereport.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/eventlog.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/file.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/minissl.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/net.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/nodelock.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/nterrors.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/objndx.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/pblock.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/sem.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/session.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/shexp.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/shmem.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/systems.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/systhr.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/base/util.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/conf.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/dnfilter.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/func.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/httpact.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/ipfilter.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/log.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/object.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/objset.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/protocol.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/req.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/servact.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-includes/netsite.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/nsapi-send.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/parse_file_list.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/parse_file_list.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/rexec.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/statistics.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/statistics.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/sysdep.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/sysdep.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/timefunc.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/timefunc.h delete mode 100644 apps/JAWS/clients/WebSTONE/src/webclient.c delete mode 100644 apps/JAWS/clients/WebSTONE/src/webmaster.c delete mode 100755 apps/JAWS/clients/WebSTONE/webstone delete mode 100755 apps/JAWS/remora/app/Makefile delete mode 100644 apps/JAWS/remora/app/Remora_Export.cc delete mode 100644 apps/JAWS/remora/app/Remora_Export.h delete mode 100644 apps/JAWS/remora/app/Remora_Export.i delete mode 100644 apps/JAWS/remora/app/Remora_Import.cc delete mode 100644 apps/JAWS/remora/app/Remora_Import.h delete mode 100644 apps/JAWS/remora/app/Remora_Import.i delete mode 100644 apps/JAWS/remora/app/remora.idl delete mode 100755 apps/JAWS/remora/app/stdmk delete mode 100644 apps/JAWS/remora/app/test.cc delete mode 100644 apps/JAWS/server/HTTP_Config.cpp delete mode 100644 apps/JAWS/server/HTTP_Config.h delete mode 100644 apps/JAWS/server/HTTP_Handler.cpp delete mode 100644 apps/JAWS/server/HTTP_Handler.h delete mode 100644 apps/JAWS/server/HTTP_Helpers.cpp delete mode 100644 apps/JAWS/server/HTTP_Helpers.h delete mode 100644 apps/JAWS/server/HTTP_Request.cpp delete mode 100644 apps/JAWS/server/HTTP_Request.h delete mode 100644 apps/JAWS/server/HTTP_Response.cpp delete mode 100644 apps/JAWS/server/HTTP_Response.h delete mode 100644 apps/JAWS/server/HTTP_Server.cpp delete mode 100644 apps/JAWS/server/HTTP_Server.h delete mode 100644 apps/JAWS/server/IO.cpp delete mode 100644 apps/JAWS/server/IO.h delete mode 100644 apps/JAWS/server/JAWS_Concurrency.cpp delete mode 100644 apps/JAWS/server/JAWS_Concurrency.h delete mode 100644 apps/JAWS/server/JAWS_Pipeline.cpp delete mode 100644 apps/JAWS/server/JAWS_Pipeline.h delete mode 100644 apps/JAWS/server/JAWS_Pipeline_Handler.cpp delete mode 100644 apps/JAWS/server/JAWS_Pipeline_Handler.h delete mode 100644 apps/JAWS/server/Makefile delete mode 100644 apps/JAWS/server/Makefile.bor delete mode 100644 apps/JAWS/server/Parse_Headers.cpp delete mode 100644 apps/JAWS/server/Parse_Headers.h delete mode 100644 apps/JAWS/server/README delete mode 100644 apps/JAWS/server/jaws.auth delete mode 100644 apps/JAWS/server/jaws.dsp delete mode 100644 apps/JAWS/server/jaws.dsw delete mode 100644 apps/JAWS/server/main.cpp delete mode 100644 apps/JAWS/server/svc.conf delete mode 100755 apps/JAWS/server/test.cgi delete mode 100644 apps/JAWS/stress_testing/Makefile delete mode 100644 apps/JAWS/stress_testing/README delete mode 100644 apps/JAWS/stress_testing/benchd.cpp delete mode 100644 apps/JAWS/stress_testing/client.h delete mode 100644 apps/JAWS/stress_testing/config delete mode 100644 apps/JAWS/stress_testing/connection.cpp delete mode 100644 apps/JAWS/stress_testing/connection.h delete mode 100644 apps/JAWS/stress_testing/cp.cpp delete mode 100644 apps/JAWS/stress_testing/cp.h delete mode 100644 apps/JAWS/stress_testing/global.h delete mode 100644 apps/JAWS/stress_testing/http.h delete mode 100644 apps/JAWS/stress_testing/http_tester.cpp delete mode 100644 apps/JAWS/stress_testing/out delete mode 100644 apps/JAWS/stress_testing/stats.cpp delete mode 100644 apps/JAWS/stress_testing/stats.h delete mode 100644 apps/JAWS/stress_testing/util.cpp delete mode 100644 apps/JAWS/stress_testing/util.h delete mode 100644 apps/JAWS2/1000K.html delete mode 100644 apps/JAWS2/100K.html delete mode 100644 apps/JAWS2/500K.html delete mode 100644 apps/JAWS2/50K.html delete mode 100644 apps/JAWS2/5K.html delete mode 100644 apps/JAWS2/HTTPU/HTTPU.DSP delete mode 100644 apps/JAWS2/HTTPU/HTTPU.DSW delete mode 100644 apps/JAWS2/HTTPU/Makefile delete mode 100644 apps/JAWS2/HTTPU/http_base.cpp delete mode 100644 apps/JAWS2/HTTPU/http_base.h delete mode 100644 apps/JAWS2/HTTPU/http_base.i delete mode 100644 apps/JAWS2/HTTPU/http_export.h delete mode 100644 apps/JAWS2/HTTPU/http_headers.cpp delete mode 100644 apps/JAWS2/HTTPU/http_headers.h delete mode 100644 apps/JAWS2/HTTPU/http_headers.i delete mode 100644 apps/JAWS2/HTTPU/http_request.cpp delete mode 100644 apps/JAWS2/HTTPU/http_request.h delete mode 100644 apps/JAWS2/HTTPU/http_request.i delete mode 100644 apps/JAWS2/HTTPU/http_response.cpp delete mode 100644 apps/JAWS2/HTTPU/http_response.h delete mode 100644 apps/JAWS2/HTTPU/http_response.i delete mode 100644 apps/JAWS2/HTTPU/http_status.cpp delete mode 100644 apps/JAWS2/HTTPU/http_status.h delete mode 100644 apps/JAWS2/HTTPU/http_status.i delete mode 100644 apps/JAWS2/HTTPU/parse_http_request.cpp delete mode 100644 apps/JAWS2/HTTPU/parse_http_request.h delete mode 100644 apps/JAWS2/HTTPU/parse_http_request.i delete mode 100644 apps/JAWS2/HTTPU/parse_http_response.cpp delete mode 100644 apps/JAWS2/HTTPU/parse_http_response.h delete mode 100644 apps/JAWS2/HTTPU/parse_http_response.i delete mode 100644 apps/JAWS2/HTTPU/parse_url.cpp delete mode 100644 apps/JAWS2/HTTPU/parse_url.h delete mode 100644 apps/JAWS2/HTTP_10.cpp delete mode 100644 apps/JAWS2/HTTP_10.h delete mode 100644 apps/JAWS2/HTTP_10_Parse.cpp delete mode 100644 apps/JAWS2/HTTP_10_Read.cpp delete mode 100644 apps/JAWS2/HTTP_10_Request.cpp delete mode 100644 apps/JAWS2/HTTP_10_Request.h delete mode 100644 apps/JAWS2/HTTP_10_Write.cpp delete mode 100644 apps/JAWS2/HTTP_Policy.cpp delete mode 100644 apps/JAWS2/HTTP_Policy.h delete mode 100644 apps/JAWS2/JAWS/Assoc_Array.cpp delete mode 100644 apps/JAWS2/JAWS/Assoc_Array.h delete mode 100644 apps/JAWS2/JAWS/Cache_Hash_T.cpp delete mode 100644 apps/JAWS2/JAWS/Cache_Hash_T.h delete mode 100644 apps/JAWS2/JAWS/Cache_Heap_T.cpp delete mode 100644 apps/JAWS2/JAWS/Cache_Heap_T.h delete mode 100644 apps/JAWS2/JAWS/Cache_List_T.cpp delete mode 100644 apps/JAWS2/JAWS/Cache_List_T.h delete mode 100644 apps/JAWS2/JAWS/Cache_Manager.cpp delete mode 100644 apps/JAWS2/JAWS/Cache_Manager.h delete mode 100644 apps/JAWS2/JAWS/Cache_Manager_T.cpp delete mode 100644 apps/JAWS2/JAWS/Cache_Manager_T.h delete mode 100644 apps/JAWS2/JAWS/Cache_Object.cpp delete mode 100644 apps/JAWS2/JAWS/Cache_Object.h delete mode 100644 apps/JAWS2/JAWS/Concurrency.cpp delete mode 100644 apps/JAWS2/JAWS/Concurrency.h delete mode 100644 apps/JAWS2/JAWS/Data_Block.cpp delete mode 100644 apps/JAWS2/JAWS/Data_Block.h delete mode 100644 apps/JAWS2/JAWS/Export.h delete mode 100644 apps/JAWS2/JAWS/FILE.cpp delete mode 100644 apps/JAWS2/JAWS/FILE.h delete mode 100644 apps/JAWS2/JAWS/Filecache.cpp delete mode 100644 apps/JAWS2/JAWS/Filecache.h delete mode 100644 apps/JAWS2/JAWS/Hash_Bucket_T.cpp delete mode 100644 apps/JAWS2/JAWS/Hash_Bucket_T.h delete mode 100644 apps/JAWS2/JAWS/Headers.cpp delete mode 100644 apps/JAWS2/JAWS/Headers.h delete mode 100644 apps/JAWS2/JAWS/IO.cpp delete mode 100644 apps/JAWS2/JAWS/IO.h delete mode 100644 apps/JAWS2/JAWS/IO_Acceptor.cpp delete mode 100644 apps/JAWS2/JAWS/IO_Acceptor.h delete mode 100644 apps/JAWS2/JAWS/IO_Handler.cpp delete mode 100644 apps/JAWS2/JAWS/IO_Handler.h delete mode 100644 apps/JAWS2/JAWS/JAWS.h delete mode 100644 apps/JAWS2/JAWS/Makefile delete mode 100644 apps/JAWS2/JAWS/Makefile.bor delete mode 100644 apps/JAWS2/JAWS/Parse_Headers.cpp delete mode 100644 apps/JAWS2/JAWS/Parse_Headers.h delete mode 100644 apps/JAWS2/JAWS/Pipeline.cpp delete mode 100644 apps/JAWS2/JAWS/Pipeline.h delete mode 100644 apps/JAWS2/JAWS/Pipeline_Handler_T.cpp delete mode 100644 apps/JAWS2/JAWS/Pipeline_Handler_T.h delete mode 100644 apps/JAWS2/JAWS/Pipeline_Tasks.cpp delete mode 100644 apps/JAWS2/JAWS/Pipeline_Tasks.h delete mode 100644 apps/JAWS2/JAWS/Policy.cpp delete mode 100644 apps/JAWS2/JAWS/Policy.h delete mode 100644 apps/JAWS2/JAWS/Reaper.cpp delete mode 100644 apps/JAWS2/JAWS/Reaper.h delete mode 100644 apps/JAWS2/JAWS/Server.cpp delete mode 100644 apps/JAWS2/JAWS/Server.h delete mode 100644 apps/JAWS2/JAWS/Waiter.cpp delete mode 100644 apps/JAWS2/JAWS/Waiter.h delete mode 100644 apps/JAWS2/JAWS/jaws.dsp delete mode 100644 apps/JAWS2/JAWS/jaws.dsw delete mode 100644 apps/JAWS2/Makefile delete mode 100644 apps/JAWS2/Makefile.bor delete mode 100644 apps/JAWS2/README delete mode 100644 apps/JAWS2/main.cpp delete mode 100644 apps/JAWS2/server.dsp delete mode 100644 apps/JAWS2/server.dsw delete mode 100644 apps/Makefile delete mode 100644 apps/Makefile.am delete mode 100644 apps/Makefile.bor delete mode 100644 apps/Orbix-Examples/Event_Comm/Consumer/Input_Handler.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/Consumer/Input_Handler.h delete mode 100644 apps/Orbix-Examples/Event_Comm/Consumer/Makefile delete mode 100644 apps/Orbix-Examples/Event_Comm/Consumer/Notification_Receiver_Handler.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/Consumer/Notification_Receiver_Handler.h delete mode 100644 apps/Orbix-Examples/Event_Comm/Consumer/consumer.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/Makefile delete mode 100644 apps/Orbix-Examples/Event_Comm/README delete mode 100644 apps/Orbix-Examples/Event_Comm/Supplier/Input_Handler.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/Supplier/Input_Handler.h delete mode 100644 apps/Orbix-Examples/Event_Comm/Supplier/Makefile delete mode 100644 apps/Orbix-Examples/Event_Comm/Supplier/Notifier_Handler.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/Supplier/Notifier_Handler.h delete mode 100644 apps/Orbix-Examples/Event_Comm/Supplier/supplier.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/include/Event_Comm.hh delete mode 100644 apps/Orbix-Examples/Event_Comm/include/Event_Comm_i.h delete mode 100644 apps/Orbix-Examples/Event_Comm/include/Notification_Receiver_i.h delete mode 100644 apps/Orbix-Examples/Event_Comm/include/Notifier_i.h delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Event_Comm.hh delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Event_Comm.idl delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Event_CommC.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Event_CommS.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Event_Comm_i.h delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Makefile delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Notification.idl delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Notification_Receiver.idl delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Notification_Receiver_i.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Notification_Receiver_i.h delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Notifier.idl delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Notifier_i.cpp delete mode 100644 apps/Orbix-Examples/Event_Comm/libsrc/Notifier_i.h delete mode 100644 apps/Orbix-Examples/Logger/Logger.cpp delete mode 100644 apps/Orbix-Examples/Logger/Logger.h delete mode 100644 apps/Orbix-Examples/Logger/Makefile delete mode 100644 apps/Orbix-Examples/Logger/Orbix.hostgroups delete mode 100644 apps/Orbix-Examples/Logger/Orbix.hosts delete mode 100644 apps/Orbix-Examples/Logger/README delete mode 100644 apps/Orbix-Examples/Logger/a1.tex delete mode 100644 apps/Orbix-Examples/Logger/client.cpp delete mode 100644 apps/Orbix-Examples/Logger/logger.hh delete mode 100644 apps/Orbix-Examples/Logger/logger.idl delete mode 100644 apps/Orbix-Examples/Logger/loggerS.cpp delete mode 100644 apps/Orbix-Examples/Logger/logger_i.cpp delete mode 100644 apps/Orbix-Examples/Logger/logger_i.h delete mode 100644 apps/Orbix-Examples/Logger/server.cpp delete mode 100644 apps/Orbix-Examples/Makefile delete mode 100644 apps/README delete mode 100644 apps/build.bor delete mode 100644 apps/drwho/BS_Client.cpp delete mode 100644 apps/drwho/BS_Client.h delete mode 100644 apps/drwho/BS_Server.cpp delete mode 100644 apps/drwho/BS_Server.h delete mode 100644 apps/drwho/Binary_Search.cpp delete mode 100644 apps/drwho/Binary_Search.h delete mode 100644 apps/drwho/CM_Client.cpp delete mode 100644 apps/drwho/CM_Client.h delete mode 100644 apps/drwho/CM_Server.cpp delete mode 100644 apps/drwho/CM_Server.h delete mode 100644 apps/drwho/ChangeLog delete mode 100644 apps/drwho/Comm_Manager.h delete mode 100644 apps/drwho/Drwho_Node.cpp delete mode 100644 apps/drwho/Drwho_Node.h delete mode 100644 apps/drwho/File_Manager.cpp delete mode 100644 apps/drwho/File_Manager.h delete mode 100644 apps/drwho/HT_Client.cpp delete mode 100644 apps/drwho/HT_Client.h delete mode 100644 apps/drwho/HT_Server.cpp delete mode 100644 apps/drwho/HT_Server.h delete mode 100644 apps/drwho/Hash_Table.cpp delete mode 100644 apps/drwho/Hash_Table.h delete mode 100644 apps/drwho/Makefile delete mode 100644 apps/drwho/Multicast_Manager.cpp delete mode 100644 apps/drwho/Multicast_Manager.h delete mode 100644 apps/drwho/Options.cpp delete mode 100644 apps/drwho/Options.h delete mode 100644 apps/drwho/PMC_All.cpp delete mode 100644 apps/drwho/PMC_All.h delete mode 100644 apps/drwho/PMC_Flo.cpp delete mode 100644 apps/drwho/PMC_Flo.h delete mode 100644 apps/drwho/PMC_Ruser.cpp delete mode 100644 apps/drwho/PMC_Ruser.h delete mode 100644 apps/drwho/PMC_Usr.cpp delete mode 100644 apps/drwho/PMC_Usr.h delete mode 100644 apps/drwho/PMS_All.cpp delete mode 100644 apps/drwho/PMS_All.h delete mode 100644 apps/drwho/PMS_Flo.cpp delete mode 100644 apps/drwho/PMS_Flo.h delete mode 100644 apps/drwho/PMS_Ruser.cpp delete mode 100644 apps/drwho/PMS_Ruser.h delete mode 100644 apps/drwho/PMS_Usr.cpp delete mode 100644 apps/drwho/PMS_Usr.h delete mode 100644 apps/drwho/PM_Client.cpp delete mode 100644 apps/drwho/PM_Client.h delete mode 100644 apps/drwho/PM_Server.cpp delete mode 100644 apps/drwho/PM_Server.h delete mode 100644 apps/drwho/Protocol_Manager.cpp delete mode 100644 apps/drwho/Protocol_Manager.h delete mode 100644 apps/drwho/Protocol_Record.cpp delete mode 100644 apps/drwho/Protocol_Record.h delete mode 100644 apps/drwho/README delete mode 100644 apps/drwho/Rwho_DB_Manager.cpp delete mode 100644 apps/drwho/Rwho_DB_Manager.h delete mode 100644 apps/drwho/SL_Client.cpp delete mode 100644 apps/drwho/SL_Client.h delete mode 100644 apps/drwho/SL_Server.cpp delete mode 100644 apps/drwho/SL_Server.h delete mode 100644 apps/drwho/SML_Client.cpp delete mode 100644 apps/drwho/SML_Client.h delete mode 100644 apps/drwho/SML_Server.cpp delete mode 100644 apps/drwho/SML_Server.h delete mode 100644 apps/drwho/SMR_Client.cpp delete mode 100644 apps/drwho/SMR_Client.h delete mode 100644 apps/drwho/SMR_Server.cpp delete mode 100644 apps/drwho/SMR_Server.h delete mode 100644 apps/drwho/SM_Client.cpp delete mode 100644 apps/drwho/SM_Client.h delete mode 100644 apps/drwho/SM_Server.cpp delete mode 100644 apps/drwho/SM_Server.h delete mode 100644 apps/drwho/Search_Struct.cpp delete mode 100644 apps/drwho/Search_Struct.h delete mode 100644 apps/drwho/Select_Manager.h delete mode 100644 apps/drwho/Single_Lookup.cpp delete mode 100644 apps/drwho/Single_Lookup.h delete mode 100644 apps/drwho/client.cpp delete mode 100644 apps/drwho/global.h delete mode 100644 apps/drwho/server.cpp delete mode 100644 apps/gperf/COPYING delete mode 100644 apps/gperf/ChangeLog delete mode 100644 apps/gperf/Makefile delete mode 100644 apps/gperf/Makefile.am delete mode 100644 apps/gperf/Makefile.bor delete mode 100644 apps/gperf/README delete mode 100644 apps/gperf/gperf.1 delete mode 100644 apps/gperf/gperf.info delete mode 100644 apps/gperf/gperf.texi delete mode 100755 apps/gperf/mdate-sh delete mode 100644 apps/gperf/src/Bool_Array.cpp delete mode 100644 apps/gperf/src/Bool_Array.h delete mode 100644 apps/gperf/src/Gen_Perf.cpp delete mode 100644 apps/gperf/src/Gen_Perf.h delete mode 100644 apps/gperf/src/Hash_Table.cpp delete mode 100644 apps/gperf/src/Hash_Table.h delete mode 100644 apps/gperf/src/Iterator.cpp delete mode 100644 apps/gperf/src/Iterator.h delete mode 100644 apps/gperf/src/Key_List.cpp delete mode 100644 apps/gperf/src/Key_List.h delete mode 100644 apps/gperf/src/List_Node.cpp delete mode 100644 apps/gperf/src/List_Node.h delete mode 100644 apps/gperf/src/Makefile delete mode 100644 apps/gperf/src/Makefile.am delete mode 100644 apps/gperf/src/Makefile.bor delete mode 100644 apps/gperf/src/Options.cpp delete mode 100644 apps/gperf/src/Options.h delete mode 100644 apps/gperf/src/Vectors.cpp delete mode 100644 apps/gperf/src/Vectors.h delete mode 100644 apps/gperf/src/Version.cpp delete mode 100644 apps/gperf/src/gperf.cpp delete mode 100644 apps/gperf/src/gperf.dsp delete mode 100644 apps/gperf/src/gperf.dsw delete mode 100644 apps/gperf/src/gperf_lib.dsp delete mode 100644 apps/gperf/tests/Makefile delete mode 100644 apps/gperf/tests/Makefile.am delete mode 100644 apps/gperf/tests/ada-pred.exp delete mode 100644 apps/gperf/tests/ada-res.exp delete mode 100644 apps/gperf/tests/ada.gperf delete mode 100644 apps/gperf/tests/adadefs.gperf delete mode 100644 apps/gperf/tests/c++-res.exp delete mode 100644 apps/gperf/tests/c++.gperf delete mode 100644 apps/gperf/tests/c-parse.gperf delete mode 100644 apps/gperf/tests/c.exp delete mode 100644 apps/gperf/tests/c.gperf delete mode 100644 apps/gperf/tests/corba.exp delete mode 100644 apps/gperf/tests/corba.gperf delete mode 100644 apps/gperf/tests/gpc.gperf delete mode 100644 apps/gperf/tests/gplus.gperf delete mode 100644 apps/gperf/tests/idl.exp delete mode 100644 apps/gperf/tests/idl.gperf delete mode 100644 apps/gperf/tests/irc.gperf delete mode 100644 apps/gperf/tests/makeinfo.gperf delete mode 100644 apps/gperf/tests/modula.exp delete mode 100644 apps/gperf/tests/modula2.gperf delete mode 100644 apps/gperf/tests/modula3.gperf delete mode 100644 apps/gperf/tests/pascal.exp delete mode 100644 apps/gperf/tests/pascal.gperf delete mode 100644 apps/gperf/tests/test-1.exp delete mode 100644 apps/gperf/tests/test-2.exp delete mode 100644 apps/gperf/tests/test-3.exp delete mode 100644 apps/gperf/tests/test-4.exp delete mode 100644 apps/gperf/tests/test-5.exp delete mode 100644 apps/gperf/tests/test-6.exp delete mode 100644 apps/gperf/tests/test-7.exp delete mode 100644 apps/gperf/tests/test.cpp delete mode 100644 apps/gperf/texinfo.tex delete mode 100644 apps/gperf/version.texi delete mode 100644 bin/ACEutils.pm delete mode 100644 bin/ADDIDL.DSM delete mode 100755 bin/Array.pl delete mode 100755 bin/Array_Helper delete mode 100755 bin/Hash_Map_Manager.pl delete mode 100755 bin/Hash_Map_Manager_Helper delete mode 100644 bin/Makefile delete mode 100644 bin/Process.pm delete mode 100644 bin/Process_Unix.pm delete mode 100644 bin/Process_Win32.pm delete mode 100644 bin/README.html delete mode 100755 bin/Service_Config.perl delete mode 100644 bin/Uniqueid.pm delete mode 100755 bin/ace_components delete mode 100755 bin/ace_ld delete mode 100755 bin/am_edit delete mode 100755 bin/auto_compile delete mode 100755 bin/auto_compile_win32.pl delete mode 100755 bin/auto_compile_wrapper delete mode 100755 bin/auto_ptr.perl delete mode 100755 bin/bootstrap delete mode 100755 bin/check_build_logs delete mode 100755 bin/class2hxxcxx delete mode 100755 bin/class2hxxcxxsingle delete mode 100755 bin/class2info delete mode 100644 bin/class2info.awk delete mode 100755 bin/class2man delete mode 100755 bin/class2mml delete mode 100755 bin/class2src delete mode 100755 bin/classinfo.ps delete mode 100644 bin/clone.1 delete mode 100644 bin/clone.cpp delete mode 100644 bin/clone.csh delete mode 100755 bin/corba-boolean.perl delete mode 100755 bin/count_lines delete mode 100755 bin/create_ace_build delete mode 100755 bin/cvslog delete mode 100755 bin/dsp2dsp.pl delete mode 100644 bin/envinfo.cpp delete mode 100755 bin/g++dep delete mode 100755 bin/generate_export_file.pl delete mode 100755 bin/generate_html_windex delete mode 100755 bin/generate_man_pages delete mode 100644 bin/hiding.fmt delete mode 100755 bin/html-windex delete mode 100755 bin/indent_macros.perl delete mode 100755 bin/info2doc.awk delete mode 100644 bin/info2doc.fmt delete mode 100755 bin/info2head delete mode 100644 bin/info2head.fmt delete mode 100755 bin/info2headsrc delete mode 100755 bin/info2man delete mode 100755 bin/info2mml delete mode 100755 bin/info2src delete mode 100755 bin/info2src.awk delete mode 100755 bin/libsize.pl delete mode 100755 bin/make_release delete mode 100755 bin/man2html delete mode 100644 bin/man2html1.awk delete mode 100644 bin/man2html2.awk delete mode 100755 bin/msvc_auto_compile.pl delete mode 100755 bin/rename-ace.pl delete mode 100755 bin/run_all.pl delete mode 100644 bin/run_all_list.pm delete mode 100755 bin/run_all_win32.pl delete mode 100755 bin/tao_env.pl delete mode 100755 bin/tao_svcconf.pl delete mode 100755 bin/update-ace+tao.sh delete mode 100755 bin/vc_filter.pl delete mode 100755 bin/vendor.fmt delete mode 100755 config.guess delete mode 100755 config.sub delete mode 100644 configure.in delete mode 100644 docs/ACE-FMM.html delete mode 100644 docs/ACE-SSL.html delete mode 100644 docs/ACE-bug-process.html delete mode 100644 docs/ACE-categories.html delete mode 100644 docs/ACE-development-process.html delete mode 100644 docs/ACE-guidelines.html delete mode 100644 docs/ACE-inheritance.pdf.gz delete mode 100644 docs/ACE-inheritance.ps.gz delete mode 100644 docs/ACE-lessons.html delete mode 100644 docs/ACE-porting.html delete mode 100644 docs/ACE-subsets.html delete mode 100644 docs/ACE-tutorials.html delete mode 100644 docs/CE-status.txt delete mode 100644 docs/exceptions.html delete mode 100644 docs/tutorials/001/001.dsp delete mode 100644 docs/tutorials/001/00SetEnv delete mode 100644 docs/tutorials/001/Makefile delete mode 100644 docs/tutorials/001/acceptor.h delete mode 100644 docs/tutorials/001/combine.shar delete mode 100644 docs/tutorials/001/logger.h delete mode 100644 docs/tutorials/001/page01.html delete mode 100644 docs/tutorials/001/page02.html delete mode 100644 docs/tutorials/001/page03.html delete mode 100644 docs/tutorials/001/page04.html delete mode 100644 docs/tutorials/001/page05.html delete mode 100644 docs/tutorials/001/server.cpp delete mode 100644 docs/tutorials/001/simple.fig delete mode 100644 docs/tutorials/001/simple.gif delete mode 100644 docs/tutorials/002/002.dsp delete mode 100644 docs/tutorials/002/00SetEnv delete mode 100644 docs/tutorials/002/Makefile delete mode 100644 docs/tutorials/002/combine.shar delete mode 100644 docs/tutorials/002/handler.h delete mode 100644 docs/tutorials/002/page01.html delete mode 100644 docs/tutorials/002/page02.html delete mode 100644 docs/tutorials/002/page03.html delete mode 100644 docs/tutorials/002/page04.html delete mode 100644 docs/tutorials/002/server.cpp delete mode 100644 docs/tutorials/003/003.dsp delete mode 100644 docs/tutorials/003/00SetEnv delete mode 100644 docs/tutorials/003/Makefile delete mode 100644 docs/tutorials/003/client.cpp delete mode 100644 docs/tutorials/003/combine.shar delete mode 100644 docs/tutorials/003/page01.html delete mode 100644 docs/tutorials/004/004.dsp delete mode 100644 docs/tutorials/004/00SetEnv delete mode 100644 docs/tutorials/004/Makefile delete mode 100644 docs/tutorials/004/client.cpp delete mode 100644 docs/tutorials/004/combine.shar delete mode 100644 docs/tutorials/004/page01.html delete mode 100644 docs/tutorials/005/005.dsp delete mode 100644 docs/tutorials/005/00SetEnv delete mode 100644 docs/tutorials/005/Makefile delete mode 100644 docs/tutorials/005/client_acceptor.h delete mode 100644 docs/tutorials/005/client_handler.cpp delete mode 100644 docs/tutorials/005/client_handler.h delete mode 100644 docs/tutorials/005/combine.shar delete mode 100644 docs/tutorials/005/page01.html delete mode 100644 docs/tutorials/005/page02.html delete mode 100644 docs/tutorials/005/page03.html delete mode 100644 docs/tutorials/005/page04.html delete mode 100644 docs/tutorials/005/page05.html delete mode 100644 docs/tutorials/005/page06.html delete mode 100644 docs/tutorials/005/page07.html delete mode 100644 docs/tutorials/005/page08.html delete mode 100644 docs/tutorials/005/server.brk delete mode 100644 docs/tutorials/005/server.cpp delete mode 100644 docs/tutorials/006/006.dsp delete mode 100644 docs/tutorials/006/Makefile delete mode 100644 docs/tutorials/006/client_acceptor.h delete mode 100644 docs/tutorials/006/client_handler.cpp delete mode 100644 docs/tutorials/006/client_handler.h delete mode 100644 docs/tutorials/006/combine.shar delete mode 100644 docs/tutorials/006/page01.html delete mode 100644 docs/tutorials/006/page02.html delete mode 100644 docs/tutorials/006/page03.html delete mode 100644 docs/tutorials/006/page04.html delete mode 100644 docs/tutorials/006/page05.html delete mode 100644 docs/tutorials/006/page06.html delete mode 100644 docs/tutorials/006/server.cpp delete mode 100644 docs/tutorials/007/007.dsp delete mode 100644 docs/tutorials/007/Makefile delete mode 100644 docs/tutorials/007/client_acceptor.cpp delete mode 100644 docs/tutorials/007/client_acceptor.h delete mode 100644 docs/tutorials/007/client_handler.cpp delete mode 100644 docs/tutorials/007/client_handler.h delete mode 100644 docs/tutorials/007/combine.shar delete mode 100644 docs/tutorials/007/page01.html delete mode 100644 docs/tutorials/007/page02.html delete mode 100644 docs/tutorials/007/page03.html delete mode 100644 docs/tutorials/007/page04.html delete mode 100644 docs/tutorials/007/page05.html delete mode 100644 docs/tutorials/007/page06.html delete mode 100644 docs/tutorials/007/page07.html delete mode 100644 docs/tutorials/007/page08.html delete mode 100644 docs/tutorials/007/page09.html delete mode 100644 docs/tutorials/007/server.cpp delete mode 100644 docs/tutorials/007/thread_pool.cpp delete mode 100644 docs/tutorials/007/thread_pool.h delete mode 100644 docs/tutorials/008/008-broadcast.dsp delete mode 100644 docs/tutorials/008/008-direct.dsp delete mode 100644 docs/tutorials/008/008-server.dsp delete mode 100644 docs/tutorials/008/Makefile delete mode 100644 docs/tutorials/008/broadcast_client.cpp delete mode 100644 docs/tutorials/008/combine.shar delete mode 100644 docs/tutorials/008/directed_client.cpp delete mode 100644 docs/tutorials/008/page01.html delete mode 100644 docs/tutorials/008/page02.html delete mode 100644 docs/tutorials/008/page03.html delete mode 100644 docs/tutorials/008/page04.html delete mode 100644 docs/tutorials/008/page05.html delete mode 100644 docs/tutorials/008/server.cpp delete mode 100644 docs/tutorials/009/009-broadcast.dsp delete mode 100644 docs/tutorials/009/009-directed.dsp delete mode 100644 docs/tutorials/009/009-server.dsp delete mode 100644 docs/tutorials/009/Makefile delete mode 100644 docs/tutorials/009/broadcast_client.cpp delete mode 100644 docs/tutorials/009/combine.shar delete mode 100644 docs/tutorials/009/directed_client.cpp delete mode 100644 docs/tutorials/009/page01.html delete mode 100644 docs/tutorials/009/page02.html delete mode 100644 docs/tutorials/009/page03.html delete mode 100644 docs/tutorials/009/page04.html delete mode 100644 docs/tutorials/009/page05.html delete mode 100644 docs/tutorials/009/server.cpp delete mode 100644 docs/tutorials/010/010.dsp delete mode 100644 docs/tutorials/010/Makefile delete mode 100644 docs/tutorials/010/block.h delete mode 100644 docs/tutorials/010/combine.shar delete mode 100644 docs/tutorials/010/message_queue.cpp delete mode 100644 docs/tutorials/010/page01.html delete mode 100644 docs/tutorials/010/page02.html delete mode 100644 docs/tutorials/010/page03.html delete mode 100644 docs/tutorials/010/page04.html delete mode 100644 docs/tutorials/010/page05.html delete mode 100644 docs/tutorials/010/page06.html delete mode 100644 docs/tutorials/010/page07.html delete mode 100644 docs/tutorials/010/task.cpp delete mode 100644 docs/tutorials/010/task.h delete mode 100644 docs/tutorials/011/011.dsp delete mode 100644 docs/tutorials/011/Makefile delete mode 100644 docs/tutorials/011/block.h delete mode 100644 docs/tutorials/011/combine.shar delete mode 100644 docs/tutorials/011/data.h delete mode 100644 docs/tutorials/011/message_queue.cpp delete mode 100644 docs/tutorials/011/page01.html delete mode 100644 docs/tutorials/011/page02.html delete mode 100644 docs/tutorials/011/page03.html delete mode 100644 docs/tutorials/011/page04.html delete mode 100644 docs/tutorials/011/page05.html delete mode 100644 docs/tutorials/011/page06.html delete mode 100644 docs/tutorials/011/task.cpp delete mode 100644 docs/tutorials/011/task.h delete mode 100644 docs/tutorials/012/012.dsp delete mode 100644 docs/tutorials/012/Makefile delete mode 100644 docs/tutorials/012/block.h delete mode 100644 docs/tutorials/012/combine.shar delete mode 100644 docs/tutorials/012/message_queue.cpp delete mode 100644 docs/tutorials/012/page01.html delete mode 100644 docs/tutorials/012/page02.html delete mode 100644 docs/tutorials/012/page03.html delete mode 100644 docs/tutorials/012/page04.html delete mode 100644 docs/tutorials/012/page05.html delete mode 100644 docs/tutorials/012/page06.html delete mode 100644 docs/tutorials/012/task.cpp delete mode 100644 docs/tutorials/012/task.h delete mode 100644 docs/tutorials/012/work.h delete mode 100644 docs/tutorials/013/013.dsp delete mode 100644 docs/tutorials/013/Makefile delete mode 100644 docs/tutorials/013/block.cpp delete mode 100644 docs/tutorials/013/block.h delete mode 100644 docs/tutorials/013/combine.shar delete mode 100644 docs/tutorials/013/message_queue.cpp delete mode 100644 docs/tutorials/013/mld.cpp delete mode 100644 docs/tutorials/013/mld.h delete mode 100644 docs/tutorials/013/page01.html delete mode 100644 docs/tutorials/013/page02.html delete mode 100644 docs/tutorials/013/page03.html delete mode 100644 docs/tutorials/013/page04.html delete mode 100644 docs/tutorials/013/page05.html delete mode 100644 docs/tutorials/013/page06.html delete mode 100644 docs/tutorials/013/page07.html delete mode 100644 docs/tutorials/013/page08.html delete mode 100644 docs/tutorials/013/task.cpp delete mode 100644 docs/tutorials/013/task.h delete mode 100644 docs/tutorials/013/work.cpp delete mode 100644 docs/tutorials/013/work.h delete mode 100644 docs/tutorials/014/014.dsp delete mode 100644 docs/tutorials/014/EndTask.h delete mode 100644 docs/tutorials/014/Makefile delete mode 100644 docs/tutorials/014/Task.cpp delete mode 100644 docs/tutorials/014/Task.h delete mode 100644 docs/tutorials/014/combine.shar delete mode 100644 docs/tutorials/014/page01.html delete mode 100644 docs/tutorials/014/page02.html delete mode 100644 docs/tutorials/014/page03.html delete mode 100644 docs/tutorials/014/page04.html delete mode 100644 docs/tutorials/014/page05.html delete mode 100644 docs/tutorials/014/stream.cpp delete mode 100644 docs/tutorials/015/015-client.dsp delete mode 100644 docs/tutorials/015/015-server.dsp delete mode 100644 docs/tutorials/015/Client_i.cpp delete mode 100644 docs/tutorials/015/Client_i.h delete mode 100644 docs/tutorials/015/Compressor.cpp delete mode 100644 docs/tutorials/015/Compressor.h delete mode 100644 docs/tutorials/015/Crypt.cpp delete mode 100644 docs/tutorials/015/Crypt.h delete mode 100644 docs/tutorials/015/Handler.cpp delete mode 100644 docs/tutorials/015/Handler.h delete mode 100644 docs/tutorials/015/Makefile delete mode 100644 docs/tutorials/015/Makefile.client delete mode 100644 docs/tutorials/015/Makefile.server delete mode 100644 docs/tutorials/015/Protocol_Stream.cpp delete mode 100644 docs/tutorials/015/Protocol_Stream.h delete mode 100644 docs/tutorials/015/Protocol_Task.cpp delete mode 100644 docs/tutorials/015/Protocol_Task.h delete mode 100644 docs/tutorials/015/Recv.cpp delete mode 100644 docs/tutorials/015/Recv.h delete mode 100644 docs/tutorials/015/Server_i.cpp delete mode 100644 docs/tutorials/015/Server_i.h delete mode 100644 docs/tutorials/015/Xmit.cpp delete mode 100644 docs/tutorials/015/Xmit.h delete mode 100644 docs/tutorials/015/client.cpp delete mode 100644 docs/tutorials/015/combine.shar delete mode 100644 docs/tutorials/015/page01.html delete mode 100644 docs/tutorials/015/page02.html delete mode 100644 docs/tutorials/015/page03.html delete mode 100644 docs/tutorials/015/page04.html delete mode 100644 docs/tutorials/015/page05.html delete mode 100644 docs/tutorials/015/page06.html delete mode 100644 docs/tutorials/015/page07.html delete mode 100644 docs/tutorials/015/page08.html delete mode 100644 docs/tutorials/015/page09.html delete mode 100644 docs/tutorials/015/page10.html delete mode 100644 docs/tutorials/015/page11.html delete mode 100644 docs/tutorials/015/page12.html delete mode 100644 docs/tutorials/015/page13.html delete mode 100644 docs/tutorials/015/page14.html delete mode 100644 docs/tutorials/015/page15.html delete mode 100644 docs/tutorials/015/page16.html delete mode 100644 docs/tutorials/015/page17.html delete mode 100644 docs/tutorials/015/page18.html delete mode 100644 docs/tutorials/015/page19.html delete mode 100644 docs/tutorials/015/page20.html delete mode 100644 docs/tutorials/015/page21.html delete mode 100644 docs/tutorials/015/page22.html delete mode 100644 docs/tutorials/015/server.cpp delete mode 100644 docs/tutorials/015/stream.gif delete mode 100644 docs/tutorials/016/016.dsp delete mode 100644 docs/tutorials/016/Condition_i.cpp delete mode 100644 docs/tutorials/016/Condition_i.h delete mode 100644 docs/tutorials/016/Makefile delete mode 100644 docs/tutorials/016/combine.shar delete mode 100644 docs/tutorials/016/condition.cpp delete mode 100644 docs/tutorials/016/page01.html delete mode 100644 docs/tutorials/016/page02.html delete mode 100644 docs/tutorials/016/page03.html delete mode 100644 docs/tutorials/016/page04.html delete mode 100644 docs/tutorials/016/page05.html delete mode 100644 docs/tutorials/017/017.dsp delete mode 100644 docs/tutorials/017/Barrier_i.cpp delete mode 100644 docs/tutorials/017/Barrier_i.h delete mode 100644 docs/tutorials/017/Makefile delete mode 100644 docs/tutorials/017/barrier.cpp delete mode 100644 docs/tutorials/017/barrier2.cpp delete mode 100644 docs/tutorials/017/combine.shar delete mode 100644 docs/tutorials/017/page01.html delete mode 100644 docs/tutorials/017/page02.html delete mode 100644 docs/tutorials/017/page03.html delete mode 100644 docs/tutorials/017/page04.html delete mode 100644 docs/tutorials/017/page05.html delete mode 100644 docs/tutorials/017/page06.html delete mode 100644 docs/tutorials/018/018.dsp delete mode 100644 docs/tutorials/018/Makefile delete mode 100644 docs/tutorials/018/Mutex_i.h delete mode 100644 docs/tutorials/018/Test_T.cpp delete mode 100644 docs/tutorials/018/Test_T.h delete mode 100644 docs/tutorials/018/Token_i.h delete mode 100644 docs/tutorials/018/combine.shar delete mode 100644 docs/tutorials/018/output delete mode 100644 docs/tutorials/018/page01.html delete mode 100644 docs/tutorials/018/page02.html delete mode 100644 docs/tutorials/018/page03.html delete mode 100644 docs/tutorials/018/page04.html delete mode 100644 docs/tutorials/018/page05.html delete mode 100644 docs/tutorials/018/page06.html delete mode 100644 docs/tutorials/018/page07.html delete mode 100644 docs/tutorials/018/token.cpp delete mode 100644 docs/tutorials/019/019-client.dsp delete mode 100644 docs/tutorials/019/019-client2.dsp delete mode 100644 docs/tutorials/019/019-server.dsp delete mode 100644 docs/tutorials/019/019-server2.dsp delete mode 100644 docs/tutorials/019/Makefile delete mode 100644 docs/tutorials/019/client.cpp delete mode 100644 docs/tutorials/019/client2.cpp delete mode 100644 docs/tutorials/019/combine.shar delete mode 100644 docs/tutorials/019/page01.html delete mode 100644 docs/tutorials/019/page02.html delete mode 100644 docs/tutorials/019/page03.html delete mode 100644 docs/tutorials/019/page04.html delete mode 100644 docs/tutorials/019/page05.html delete mode 100644 docs/tutorials/019/page06.html delete mode 100644 docs/tutorials/019/server.cpp delete mode 100644 docs/tutorials/019/server2.cpp delete mode 100644 docs/tutorials/019/shmem.cpp delete mode 100644 docs/tutorials/019/shmem.h delete mode 100644 docs/tutorials/020/020-client.dsp delete mode 100644 docs/tutorials/020/020-client2.dsp delete mode 100644 docs/tutorials/020/020-server.dsp delete mode 100644 docs/tutorials/020/020-server2.dsp delete mode 100644 docs/tutorials/020/Makefile delete mode 100644 docs/tutorials/020/client.cpp delete mode 100644 docs/tutorials/020/client2.cpp delete mode 100644 docs/tutorials/020/combine.shar delete mode 100644 docs/tutorials/020/mmap.cpp delete mode 100644 docs/tutorials/020/mmap.h delete mode 100644 docs/tutorials/020/mmapfile delete mode 100644 docs/tutorials/020/page01.html delete mode 100644 docs/tutorials/020/page02.html delete mode 100644 docs/tutorials/020/page03.html delete mode 100644 docs/tutorials/020/page04.html delete mode 100644 docs/tutorials/020/page05.html delete mode 100644 docs/tutorials/020/page06.html delete mode 100644 docs/tutorials/020/server.cpp delete mode 100644 docs/tutorials/020/server2.cpp delete mode 100644 docs/tutorials/021/021-client.dsp delete mode 100644 docs/tutorials/021/021-server.dsp delete mode 100644 docs/tutorials/021/Makefile delete mode 100644 docs/tutorials/021/client.cpp delete mode 100644 docs/tutorials/021/combine.shar delete mode 100644 docs/tutorials/021/mpool.cpp delete mode 100644 docs/tutorials/021/mpool.h delete mode 100644 docs/tutorials/021/page01.html delete mode 100644 docs/tutorials/021/page02.html delete mode 100644 docs/tutorials/021/page03.html delete mode 100644 docs/tutorials/021/page04.html delete mode 100644 docs/tutorials/021/page05.html delete mode 100644 docs/tutorials/021/page06.html delete mode 100644 docs/tutorials/021/server.cpp delete mode 100644 docs/tutorials/Chap_2/Chap_2.zip delete mode 100644 docs/tutorials/Chap_2/ex01.html delete mode 100644 docs/tutorials/Chap_2/ex02.html delete mode 100644 docs/tutorials/Chap_2/ex03.html delete mode 100644 docs/tutorials/Chap_2/ex04.html delete mode 100644 docs/tutorials/Chap_2/ex05.htm delete mode 100644 docs/tutorials/Chap_2/ex05.html delete mode 100644 docs/tutorials/Chap_2/ex06.html delete mode 100644 docs/tutorials/Chap_3/Chap_3.zip delete mode 100644 docs/tutorials/Chap_3/Makefile delete mode 100644 docs/tutorials/Chap_3/README delete mode 100644 docs/tutorials/Chap_3/ex01.html delete mode 100644 docs/tutorials/Chap_3/ex02.html delete mode 100644 docs/tutorials/Chap_3/ex03.html delete mode 100644 docs/tutorials/Chap_3/mm.cpp delete mode 100644 docs/tutorials/Chap_4/Chap_4.zip delete mode 100644 docs/tutorials/Chap_4/ex01.html delete mode 100644 docs/tutorials/Chap_4/ex02.html delete mode 100644 docs/tutorials/Chap_4/ex03.html delete mode 100644 docs/tutorials/Chap_4/ex04.html delete mode 100644 docs/tutorials/Chap_4/ex05.html delete mode 100644 docs/tutorials/Chap_4/ex06.html delete mode 100644 docs/tutorials/Chap_4/ex07.html delete mode 100644 docs/tutorials/Chap_4/ex08.html delete mode 100644 docs/tutorials/Chap_5/Chap_5.zip delete mode 100644 docs/tutorials/Chap_5/ex01.html delete mode 100644 docs/tutorials/Chap_5/ex02.html delete mode 100644 docs/tutorials/Chap_5/ex03.html delete mode 100644 docs/tutorials/Chap_5/ex04.html delete mode 100644 docs/tutorials/Chap_5/ex05.html delete mode 100644 docs/tutorials/Chap_6/Chap_6.zip delete mode 100644 docs/tutorials/Chap_6/ex01.html delete mode 100644 docs/tutorials/Chap_6/ex02.html delete mode 100644 docs/tutorials/Chap_6/ex03.html delete mode 100644 docs/tutorials/Chap_6/ex04.html delete mode 100644 docs/tutorials/Chap_6/ex05.html delete mode 100644 docs/tutorials/Chap_6/ex06.html delete mode 100644 docs/tutorials/Chap_6/ex07.html delete mode 100644 docs/tutorials/Chap_6/ex08.html delete mode 100644 docs/tutorials/Chap_6/ex09.html delete mode 100644 docs/tutorials/Chap_6/ex10.html delete mode 100644 docs/tutorials/Chap_7/Chap_7.zip delete mode 100644 docs/tutorials/Chap_7/ex01.html delete mode 100644 docs/tutorials/Chap_7/ex02.html delete mode 100644 docs/tutorials/Chap_7/ex03.html delete mode 100644 docs/tutorials/Makefile delete mode 100755 docs/tutorials/colorize delete mode 100755 docs/tutorials/combine delete mode 100755 docs/tutorials/fix.Makefile delete mode 100644 docs/tutorials/guide-tutorials.html delete mode 100755 docs/tutorials/linify delete mode 100644 docs/tutorials/new-tutorials.html delete mode 100644 docs/tutorials/online-tutorials.html delete mode 100644 docs/tutorials/templates.html delete mode 100644 docs/tutorials/tutorials.dsw delete mode 100644 docs/usage-bugzilla.html delete mode 100644 etc/DOC-way.html delete mode 100644 etc/README delete mode 100644 etc/Svc_Conf_l.cpp.diff delete mode 100644 etc/Svc_Conf_y.cpp.diff delete mode 100755 etc/create-jace-release delete mode 100644 etc/enforce_ace_try.diff delete mode 100644 etc/purify.solaris2 delete mode 100644 etc/xlc_dummy.cpp delete mode 100644 examples/ASX/CCM_App/CCM_App.cpp delete mode 100644 examples/ASX/CCM_App/Makefile delete mode 100644 examples/ASX/CCM_App/SC_Client.cpp delete mode 100644 examples/ASX/CCM_App/SC_Server.cpp delete mode 100644 examples/ASX/CCM_App/svc.conf delete mode 100644 examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp delete mode 100644 examples/ASX/Event_Server/Event_Server/Consumer_Router.h delete mode 100644 examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp delete mode 100644 examples/ASX/Event_Server/Event_Server/Event_Analyzer.h delete mode 100644 examples/ASX/Event_Server/Event_Server/Event_Server.dsp delete mode 100644 examples/ASX/Event_Server/Event_Server/Event_Server.dsw delete mode 100644 examples/ASX/Event_Server/Event_Server/Makefile delete mode 100644 examples/ASX/Event_Server/Event_Server/Options.cpp delete mode 100644 examples/ASX/Event_Server/Event_Server/Options.h delete mode 100644 examples/ASX/Event_Server/Event_Server/Options.i delete mode 100644 examples/ASX/Event_Server/Event_Server/Peer_Router.cpp delete mode 100644 examples/ASX/Event_Server/Event_Server/Peer_Router.h delete mode 100644 examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp delete mode 100644 examples/ASX/Event_Server/Event_Server/Supplier_Router.h delete mode 100644 examples/ASX/Event_Server/Event_Server/event_server.cpp delete mode 100644 examples/ASX/Event_Server/Makefile delete mode 100644 examples/ASX/Event_Server/README delete mode 100644 examples/ASX/Event_Server/Transceiver/Makefile delete mode 100644 examples/ASX/Event_Server/Transceiver/transceiver.cpp delete mode 100644 examples/ASX/Event_Server/Transceiver/transceiver.dsp delete mode 100644 examples/ASX/Event_Server/Transceiver/transceiver.dsw delete mode 100644 examples/ASX/Event_Server/Transceiver/transceiver.h delete mode 100644 examples/ASX/Makefile delete mode 100644 examples/ASX/Message_Queue/Bounded_Buffer.dsp delete mode 100644 examples/ASX/Message_Queue/Buffer_Stream.dsp delete mode 100644 examples/ASX/Message_Queue/Makefile delete mode 100644 examples/ASX/Message_Queue/Message_Queue_Example.dsw delete mode 100644 examples/ASX/Message_Queue/Priority_Buffer.dsp delete mode 100644 examples/ASX/Message_Queue/bounded_buffer.cpp delete mode 100644 examples/ASX/Message_Queue/buffer_stream.cpp delete mode 100644 examples/ASX/Message_Queue/priority_buffer.cpp delete mode 100644 examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp delete mode 100644 examples/ASX/UPIPE_Event_Server/Consumer_Router.h delete mode 100644 examples/ASX/UPIPE_Event_Server/Event_Analyzer.cpp delete mode 100644 examples/ASX/UPIPE_Event_Server/Event_Analyzer.h delete mode 100644 examples/ASX/UPIPE_Event_Server/Makefile delete mode 100644 examples/ASX/UPIPE_Event_Server/Options.cpp delete mode 100644 examples/ASX/UPIPE_Event_Server/Options.h delete mode 100644 examples/ASX/UPIPE_Event_Server/Options.i delete mode 100644 examples/ASX/UPIPE_Event_Server/Peer_Router.cpp delete mode 100644 examples/ASX/UPIPE_Event_Server/Peer_Router.h delete mode 100644 examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp delete mode 100644 examples/ASX/UPIPE_Event_Server/Supplier_Router.h delete mode 100644 examples/ASX/UPIPE_Event_Server/UPIPE_Event_Server.dsp delete mode 100644 examples/ASX/UPIPE_Event_Server/UPIPE_Event_Server.dsw delete mode 100644 examples/ASX/UPIPE_Event_Server/event_server.cpp delete mode 100644 examples/Bounded_Packet_Relay/BPR_Drivers.cpp delete mode 100644 examples/Bounded_Packet_Relay/BPR_Drivers.h delete mode 100644 examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp delete mode 100644 examples/Bounded_Packet_Relay/BPR_Drivers_T.h delete mode 100644 examples/Bounded_Packet_Relay/Bounded_Packet_Relay.dsp delete mode 100644 examples/Bounded_Packet_Relay/Bounded_Packet_Relay.dsw delete mode 100644 examples/Bounded_Packet_Relay/Makefile delete mode 100644 examples/Bounded_Packet_Relay/README delete mode 100644 examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp delete mode 100644 examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.h delete mode 100644 examples/Bounded_Packet_Relay/bpr_thread.cpp delete mode 100644 examples/CORBA/Makefile delete mode 100644 examples/CORBA/Test.idl delete mode 100644 examples/CORBA/Test_i.cpp delete mode 100644 examples/CORBA/Test_i.h delete mode 100644 examples/CORBA/client.cpp delete mode 100644 examples/CORBA/server.cpp delete mode 100644 examples/Configuration/Configuration.dsw delete mode 100644 examples/Configuration/Makefile delete mode 100644 examples/Configuration/Test.dsp delete mode 100644 examples/Configuration/config_test.cpp delete mode 100644 examples/Connection/Makefile delete mode 100644 examples/Connection/blocking/README delete mode 100644 examples/Connection/blocking/SPIPE-acceptor.cpp delete mode 100644 examples/Connection/blocking/SPIPE-acceptor.h delete mode 100644 examples/Connection/blocking/SPIPE-connector.cpp delete mode 100644 examples/Connection/blocking/SPIPE-connector.h delete mode 100644 examples/Connection/blocking/SPIPE.dsp delete mode 100644 examples/Connection/blocking/SPIPE.dsw delete mode 100644 examples/Connection/blocking/acceptor.dsp delete mode 100644 examples/Connection/blocking/test_spipe_acceptor.cpp delete mode 100644 examples/Connection/blocking/test_spipe_connector.cpp delete mode 100644 examples/Connection/misc/Connection_Handler.cpp delete mode 100644 examples/Connection/misc/Connection_Handler.h delete mode 100644 examples/Connection/misc/Makefile delete mode 100644 examples/Connection/misc/test_upipe.cpp delete mode 100644 examples/Connection/misc/test_upipe.h delete mode 100644 examples/Connection/non_blocking/CPP-acceptor.cpp delete mode 100644 examples/Connection/non_blocking/CPP-acceptor.h delete mode 100644 examples/Connection/non_blocking/CPP-connector.cpp delete mode 100644 examples/Connection/non_blocking/CPP-connector.h delete mode 100644 examples/Connection/non_blocking/Makefile delete mode 100644 examples/Connection/non_blocking/README delete mode 100644 examples/Connection/non_blocking/non_blocking.dsp delete mode 100644 examples/Connection/non_blocking/non_blocking.dsw delete mode 100644 examples/Connection/non_blocking/server.dsp delete mode 100644 examples/Connection/non_blocking/test_lsock_acceptor.cpp delete mode 100644 examples/Connection/non_blocking/test_lsock_connector.cpp delete mode 100644 examples/Connection/non_blocking/test_sock_acceptor.cpp delete mode 100644 examples/Connection/non_blocking/test_sock_connector.cpp delete mode 100644 examples/Connection/non_blocking/test_spipe_acceptor.cpp delete mode 100644 examples/Connection/non_blocking/test_spipe_connector.cpp delete mode 100644 examples/Connection/non_blocking/test_tli_acceptor.cpp delete mode 100644 examples/Connection/non_blocking/test_tli_connector.cpp delete mode 100644 examples/DLL/Dll.dsw delete mode 100644 examples/DLL/Magazine.h delete mode 100644 examples/DLL/Main.dsp delete mode 100644 examples/DLL/Makefile delete mode 100644 examples/DLL/Makefile.Newsweek delete mode 100644 examples/DLL/Makefile.Today delete mode 100644 examples/DLL/Newsweek.cpp delete mode 100644 examples/DLL/Newsweek.dsp delete mode 100644 examples/DLL/Newsweek.h delete mode 100644 examples/DLL/README delete mode 100644 examples/DLL/Today.cpp delete mode 100644 examples/DLL/Today.dsp delete mode 100644 examples/DLL/Today.h delete mode 100644 examples/DLL/test_dll.cpp delete mode 100644 examples/IOStream/Makefile delete mode 100644 examples/IOStream/README delete mode 100644 examples/IOStream/client/Makefile delete mode 100644 examples/IOStream/client/iostream_client.cpp delete mode 100644 examples/IOStream/server/Makefile delete mode 100644 examples/IOStream/server/iostream_server.cpp delete mode 100644 examples/IOStream/server/iostream_server.h delete mode 100644 examples/IPC_SAP/ATM_SAP/ATM_SAP.dsw delete mode 100644 examples/IPC_SAP/ATM_SAP/CPP-client.cpp delete mode 100644 examples/IPC_SAP/ATM_SAP/CPP-server.cpp delete mode 100644 examples/IPC_SAP/ATM_SAP/CPP_client.dsp delete mode 100644 examples/IPC_SAP/ATM_SAP/CPP_server.dsp delete mode 100644 examples/IPC_SAP/ATM_SAP/Makefile delete mode 100644 examples/IPC_SAP/DEV_SAP/Makefile delete mode 100644 examples/IPC_SAP/DEV_SAP/README delete mode 100644 examples/IPC_SAP/DEV_SAP/reader/Makefile delete mode 100644 examples/IPC_SAP/DEV_SAP/reader/reader.cpp delete mode 100644 examples/IPC_SAP/DEV_SAP/writer/Makefile delete mode 100644 examples/IPC_SAP/DEV_SAP/writer/writer.cpp delete mode 100644 examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp delete mode 100644 examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp delete mode 100644 examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp delete mode 100644 examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp delete mode 100644 examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp delete mode 100644 examples/IPC_SAP/FIFO_SAP/Makefile delete mode 100644 examples/IPC_SAP/FILE_SAP/File_sap.dsw delete mode 100644 examples/IPC_SAP/FILE_SAP/Makefile delete mode 100644 examples/IPC_SAP/FILE_SAP/client.cpp delete mode 100644 examples/IPC_SAP/FILE_SAP/client.dsp delete mode 100644 examples/IPC_SAP/FILE_SAP/testfile delete mode 100644 examples/IPC_SAP/Makefile delete mode 100644 examples/IPC_SAP/SOCK_SAP/C-inclient.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/C-inserver.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-inclient.h delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.h delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-inserver-poll.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-memclient.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-memserver.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP-unserver.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP_inclient.dsp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP_inserver.dsp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP_memclient.dsp delete mode 100644 examples/IPC_SAP/SOCK_SAP/CPP_memserver.dsp delete mode 100644 examples/IPC_SAP/SOCK_SAP/C_inserver.dsp delete mode 100644 examples/IPC_SAP/SOCK_SAP/FD-unclient.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/FD-unserver.cpp delete mode 100644 examples/IPC_SAP/SOCK_SAP/Makefile delete mode 100644 examples/IPC_SAP/SOCK_SAP/README delete mode 100644 examples/IPC_SAP/SOCK_SAP/SOCK_SAP.dsp delete mode 100644 examples/IPC_SAP/SOCK_SAP/SOCK_SAP.dsw delete mode 100644 examples/IPC_SAP/SOCK_SAP/local_data delete mode 100755 examples/IPC_SAP/SOCK_SAP/run_test delete mode 100755 examples/IPC_SAP/SOCK_SAP/summarize delete mode 100644 examples/IPC_SAP/SPIPE_SAP/Makefile delete mode 100644 examples/IPC_SAP/SPIPE_SAP/NPClient.cpp delete mode 100644 examples/IPC_SAP/SPIPE_SAP/NPServer.cpp delete mode 100644 examples/IPC_SAP/SPIPE_SAP/client.cpp delete mode 100644 examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp delete mode 100644 examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp delete mode 100644 examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp delete mode 100644 examples/IPC_SAP/SPIPE_SAP/producer_read.cpp delete mode 100644 examples/IPC_SAP/SPIPE_SAP/server.cpp delete mode 100644 examples/IPC_SAP/SPIPE_SAP/shared.h delete mode 100644 examples/IPC_SAP/SSL_SAP/Makefile delete mode 100644 examples/IPC_SAP/SSL_SAP/README delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-client-simple.cpp delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-client-simple.h delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-client.cpp delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-client.dsp delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-client.h delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-server-fancy.h delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-server-poll.cpp delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-server-simple.cpp delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-server.cpp delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL-server.dsp delete mode 100644 examples/IPC_SAP/SSL_SAP/SSL_SOCK_SAP.dsw delete mode 100644 examples/IPC_SAP/SSL_SAP/dummy.pem delete mode 100644 examples/IPC_SAP/SSL_SAP/key.pem delete mode 100644 examples/IPC_SAP/SSL_SAP/local_data delete mode 100755 examples/IPC_SAP/SSL_SAP/summarize delete mode 100644 examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp delete mode 100644 examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp delete mode 100644 examples/IPC_SAP/TLI_SAP/CPP-client.cpp delete mode 100644 examples/IPC_SAP/TLI_SAP/CPP-server.cpp delete mode 100644 examples/IPC_SAP/TLI_SAP/Makefile delete mode 100644 examples/IPC_SAP/TLI_SAP/db-client.cpp delete mode 100644 examples/IPC_SAP/TLI_SAP/db-server.cpp delete mode 100644 examples/IPC_SAP/TLI_SAP/ftp-client.cpp delete mode 100644 examples/IPC_SAP/TLI_SAP/ftp-server.cpp delete mode 100644 examples/IPC_SAP/UPIPE_SAP/Makefile delete mode 100644 examples/IPC_SAP/UPIPE_SAP/ex1.cpp delete mode 100644 examples/IPC_SAP/UPIPE_SAP/ex2.cpp delete mode 100644 examples/IPC_SAP/UPIPE_SAP/ex3.cpp delete mode 100644 examples/Log_Msg/Callback.dsp delete mode 100644 examples/Log_Msg/Log_Msg.dsp delete mode 100644 examples/Log_Msg/Makefile delete mode 100644 examples/Log_Msg/Ostream.dsp delete mode 100644 examples/Log_Msg/README delete mode 100644 examples/Log_Msg/test_callback.cpp delete mode 100644 examples/Log_Msg/test_log_msg.cpp delete mode 100644 examples/Log_Msg/test_ostream.cpp delete mode 100644 examples/Logger/Acceptor-server/Makefile delete mode 100644 examples/Logger/Acceptor-server/server_loggerd.cpp delete mode 100644 examples/Logger/Acceptor-server/server_loggerd.dsp delete mode 100644 examples/Logger/Acceptor-server/server_loggerd.dsw delete mode 100644 examples/Logger/Acceptor-server/server_loggerd.h delete mode 100644 examples/Logger/Makefile delete mode 100644 examples/Logger/README delete mode 100644 examples/Logger/client/Makefile delete mode 100644 examples/Logger/client/client.dsp delete mode 100644 examples/Logger/client/client.dsw delete mode 100644 examples/Logger/client/logging_app.cpp delete mode 100644 examples/Logger/simple-server/Logging_Acceptor.cpp delete mode 100644 examples/Logger/simple-server/Logging_Acceptor.h delete mode 100644 examples/Logger/simple-server/Logging_Handler.cpp delete mode 100644 examples/Logger/simple-server/Logging_Handler.h delete mode 100644 examples/Logger/simple-server/Makefile delete mode 100644 examples/Logger/simple-server/Reactor_Singleton.h delete mode 100644 examples/Logger/simple-server/server_loggerd.cpp delete mode 100644 examples/Logger/simple-server/server_loggerd.dsp delete mode 100644 examples/Logger/simple-server/server_loggerd.dsw delete mode 100644 examples/Makefile delete mode 100644 examples/Map_Manager/Makefile delete mode 100644 examples/Map_Manager/test_hash_map_manager.cpp delete mode 100644 examples/Mem_Map/IO-tests/IO_Test.cpp delete mode 100644 examples/Mem_Map/IO-tests/IO_Test.h delete mode 100644 examples/Mem_Map/IO-tests/Makefile delete mode 100644 examples/Mem_Map/IO-tests/test_io.cpp delete mode 100644 examples/Mem_Map/Makefile delete mode 100644 examples/Mem_Map/file-reverse/Makefile delete mode 100644 examples/Mem_Map/file-reverse/file-reverse.cpp delete mode 100644 examples/Mem_Map/file-reverse/file_reverse.dsp delete mode 100644 examples/Mem_Map/file-reverse/file_reverse.dsw delete mode 100644 examples/Misc/Makefile delete mode 100644 examples/Misc/test_XtReactor1.cpp delete mode 100644 examples/Misc/test_XtReactor2.cpp delete mode 100644 examples/Misc/test_dump.cpp delete mode 100644 examples/Misc/test_dump.h delete mode 100644 examples/Misc/test_get_opt.cpp delete mode 100644 examples/Misc/test_profile_timer.cpp delete mode 100644 examples/Misc/test_read_buffer.cpp delete mode 100644 examples/Misc/test_set.cpp delete mode 100644 examples/Misc/test_sstring.cpp delete mode 100644 examples/Misc/test_trace.cpp delete mode 100644 examples/NT_Service/NT_Service.dsp delete mode 100644 examples/NT_Service/NT_Service.dsw delete mode 100644 examples/NT_Service/README delete mode 100644 examples/NT_Service/main.cpp delete mode 100644 examples/NT_Service/ntsvc.cpp delete mode 100644 examples/NT_Service/ntsvc.h delete mode 100644 examples/Naming/Makefile delete mode 100644 examples/Naming/Naming.dsp delete mode 100644 examples/Naming/Naming.dsw delete mode 100644 examples/Naming/multiple_contexts.dsp delete mode 100644 examples/Naming/non_existent.dsp delete mode 100644 examples/Naming/test_multiple_contexts.cpp delete mode 100644 examples/Naming/test_non_existent.cpp delete mode 100644 examples/Naming/test_open.cpp delete mode 100644 examples/Naming/test_writers.cpp delete mode 100644 examples/OS/Makefile delete mode 100644 examples/OS/Process/Makefile delete mode 100644 examples/OS/Process/Process.dsp delete mode 100644 examples/OS/Process/Process.dsw delete mode 100644 examples/OS/Process/README delete mode 100644 examples/OS/Process/imore.cpp delete mode 100644 examples/OS/Process/imore.dsp delete mode 100644 examples/OS/Process/process.cpp delete mode 100644 examples/QOS/Makefile delete mode 100644 examples/QOS/QOS.dsw delete mode 100644 examples/QOS/QosEvent.h delete mode 100644 examples/QOS/README delete mode 100644 examples/QOS/Receiver_QOS_Event_Handler.cpp delete mode 100644 examples/QOS/Receiver_QOS_Event_Handler.h delete mode 100644 examples/QOS/Sender_QOS_Event_Handler.cpp delete mode 100644 examples/QOS/Sender_QOS_Event_Handler.h delete mode 100644 examples/QOS/client.cpp delete mode 100644 examples/QOS/client.dsp delete mode 100644 examples/QOS/server.cpp delete mode 100644 examples/QOS/server.dsp delete mode 100644 examples/README delete mode 100644 examples/Reactor/Dgram/CODgram.cpp delete mode 100644 examples/Reactor/Dgram/CODgram.dsp delete mode 100644 examples/Reactor/Dgram/Dgram.cpp delete mode 100644 examples/Reactor/Dgram/Dgram.dsp delete mode 100644 examples/Reactor/Dgram/Dgram.dsw delete mode 100644 examples/Reactor/Dgram/Makefile delete mode 100644 examples/Reactor/FIFO/Makefile delete mode 100644 examples/Reactor/FIFO/client.cpp delete mode 100644 examples/Reactor/FIFO/server.cpp delete mode 100644 examples/Reactor/Makefile delete mode 100644 examples/Reactor/Misc/Makefile delete mode 100644 examples/Reactor/Misc/Misc.dsp delete mode 100644 examples/Reactor/Misc/Misc.dsw delete mode 100644 examples/Reactor/Misc/demuxing.dsp delete mode 100644 examples/Reactor/Misc/early_timeouts.dsp delete mode 100644 examples/Reactor/Misc/notification.cpp delete mode 100644 examples/Reactor/Misc/notification.dsp delete mode 100644 examples/Reactor/Misc/pingpong.cpp delete mode 100644 examples/Reactor/Misc/reactors.dsp delete mode 100644 examples/Reactor/Misc/signal_tester.cpp delete mode 100644 examples/Reactor/Misc/signals_1.dsp delete mode 100644 examples/Reactor/Misc/signals_2.dsp delete mode 100644 examples/Reactor/Misc/test_demuxing.cpp delete mode 100644 examples/Reactor/Misc/test_early_timeouts.cpp delete mode 100644 examples/Reactor/Misc/test_event_handler_t.cpp delete mode 100644 examples/Reactor/Misc/test_reactors.cpp delete mode 100644 examples/Reactor/Misc/test_signals.cpp delete mode 100644 examples/Reactor/Misc/test_signals_1.cpp delete mode 100644 examples/Reactor/Misc/test_signals_2.cpp delete mode 100644 examples/Reactor/Misc/test_time_value.cpp delete mode 100644 examples/Reactor/Misc/test_timer_queue.cpp delete mode 100644 examples/Reactor/Multicast/Log_Wrapper.cpp delete mode 100644 examples/Reactor/Multicast/Log_Wrapper.h delete mode 100644 examples/Reactor/Multicast/Makefile delete mode 100644 examples/Reactor/Multicast/Multicast.dsw delete mode 100644 examples/Reactor/Multicast/README delete mode 100644 examples/Reactor/Multicast/client.cpp delete mode 100644 examples/Reactor/Multicast/client.dsp delete mode 100644 examples/Reactor/Multicast/server.cpp delete mode 100644 examples/Reactor/Multicast/server.dsp delete mode 100644 examples/Reactor/Ntalker/Makefile delete mode 100644 examples/Reactor/Ntalker/README delete mode 100644 examples/Reactor/Ntalker/ntalker.cpp delete mode 100644 examples/Reactor/Ntalker/ntalker.dsp delete mode 100644 examples/Reactor/Ntalker/ntalker.dsw delete mode 100644 examples/Reactor/Proactor/Aio_Platform_Test_C.cpp delete mode 100644 examples/Reactor/Proactor/Makefile delete mode 100644 examples/Reactor/Proactor/README delete mode 100644 examples/Reactor/Proactor/post_completions.cpp delete mode 100644 examples/Reactor/Proactor/post_completions.dsp delete mode 100644 examples/Reactor/Proactor/simple_test_proactor.cpp delete mode 100644 examples/Reactor/Proactor/test_aiocb.cpp delete mode 100644 examples/Reactor/Proactor/test_aiocb_ace.cpp delete mode 100644 examples/Reactor/Proactor/test_aiosig.cpp delete mode 100644 examples/Reactor/Proactor/test_aiosig_ace.cpp delete mode 100644 examples/Reactor/Proactor/test_cancel.cpp delete mode 100644 examples/Reactor/Proactor/test_cancel.dsp delete mode 100644 examples/Reactor/Proactor/test_end_event_loop.cpp delete mode 100644 examples/Reactor/Proactor/test_end_event_loop.dsp delete mode 100644 examples/Reactor/Proactor/test_multiple_loops.cpp delete mode 100644 examples/Reactor/Proactor/test_multiple_loops.dsp delete mode 100644 examples/Reactor/Proactor/test_proactor.cpp delete mode 100644 examples/Reactor/Proactor/test_proactor.dsp delete mode 100644 examples/Reactor/Proactor/test_proactor.dsw delete mode 100644 examples/Reactor/Proactor/test_timeout.cpp delete mode 100644 examples/Reactor/Proactor/test_timeout.dsp delete mode 100644 examples/Reactor/Proactor/test_timeout_st.cpp delete mode 100644 examples/Reactor/README delete mode 100644 examples/Reactor/WFMO_Reactor/APC.DSP delete mode 100644 examples/Reactor/WFMO_Reactor/Abondoned.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Console_Input.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Directory_Changes.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Exceptions.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Handle_Close.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Multithreading.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Network_Events.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Prerun_State_Changes.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Registration.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Registry_Changes.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Removals.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Talker.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/Timeouts.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/WFMO_Reactor.dsw delete mode 100644 examples/Reactor/WFMO_Reactor/Window_Messages.dsp delete mode 100644 examples/Reactor/WFMO_Reactor/test_abandoned.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_apc.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_console_input.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_directory_changes.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_exceptions.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_handle_close.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_multithreading.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_network_events.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_prerun_state_changes.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_registration.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_registry_changes.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_removals.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_talker.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_timeouts.cpp delete mode 100644 examples/Reactor/WFMO_Reactor/test_window_messages.cpp delete mode 100644 examples/Registry/Registry.dsp delete mode 100644 examples/Registry/Registry.dsw delete mode 100644 examples/Registry/test_registry_iterator.cpp delete mode 100644 examples/Registry/test_registry_update.cpp delete mode 100644 examples/Registry/update.dsp delete mode 100644 examples/Service_Configurator/IPC-tests/Makefile delete mode 100644 examples/Service_Configurator/IPC-tests/README delete mode 100644 examples/Service_Configurator/IPC-tests/client/Makefile delete mode 100644 examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/local_data delete mode 100644 examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/local_fifo_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/local_spipe_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_data delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_data1 delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_data2 delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_data3 delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_data4 delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_dgram_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_service_directory_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_stream_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/client/remote_thr_stream_client_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Broadcast.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Broadcast.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Broadcast.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_R_Stream.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Timeout.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Timeout.h delete mode 100644 examples/Service_Configurator/IPC-tests/server/Handle_Timeout.i delete mode 100644 examples/Service_Configurator/IPC-tests/server/Makefile delete mode 100644 examples/Service_Configurator/IPC-tests/server/server_test.cpp delete mode 100644 examples/Service_Configurator/IPC-tests/server/svc.conf delete mode 100644 examples/Service_Configurator/Makefile delete mode 100644 examples/Service_Configurator/Misc/Makefile delete mode 100644 examples/Service_Configurator/Misc/Misc.dsw delete mode 100644 examples/Service_Configurator/Misc/README delete mode 100644 examples/Service_Configurator/Misc/Timer.dsp delete mode 100644 examples/Service_Configurator/Misc/Timer_Service.cpp delete mode 100644 examples/Service_Configurator/Misc/Timer_Service.h delete mode 100644 examples/Service_Configurator/Misc/main.cpp delete mode 100644 examples/Service_Configurator/Misc/main.dsp delete mode 100644 examples/Service_Configurator/Misc/svc.conf1 delete mode 100644 examples/Service_Configurator/Misc/svc.conf2 delete mode 100644 examples/Shared_Malloc/Makefile delete mode 100644 examples/Shared_Malloc/Malloc.cpp delete mode 100644 examples/Shared_Malloc/Malloc.h delete mode 100644 examples/Shared_Malloc/Options.cpp delete mode 100644 examples/Shared_Malloc/Options.h delete mode 100644 examples/Shared_Malloc/Shared_Malloc.dsw delete mode 100644 examples/Shared_Malloc/malloc.dsp delete mode 100644 examples/Shared_Malloc/multiple_mallocs.dsp delete mode 100644 examples/Shared_Malloc/persistence.dsp delete mode 100644 examples/Shared_Malloc/position_independent_malloc.dsp delete mode 100644 examples/Shared_Malloc/test_malloc.cpp delete mode 100644 examples/Shared_Malloc/test_multiple_mallocs.cpp delete mode 100644 examples/Shared_Malloc/test_persistence.cpp delete mode 100644 examples/Shared_Malloc/test_position_independent_malloc.cpp delete mode 100644 examples/Shared_Malloc/test_position_independent_malloc.h delete mode 100644 examples/Shared_Memory/Makefile delete mode 100644 examples/Shared_Memory/test_MM.cpp delete mode 100644 examples/Shared_Memory/test_SV.cpp delete mode 100644 examples/System_V_IPC/Makefile delete mode 100644 examples/System_V_IPC/README delete mode 100644 examples/System_V_IPC/SV_Message_Queues/MQ_Client.cpp delete mode 100644 examples/System_V_IPC/SV_Message_Queues/MQ_Server.cpp delete mode 100644 examples/System_V_IPC/SV_Message_Queues/Makefile delete mode 100644 examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp delete mode 100644 examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp delete mode 100644 examples/System_V_IPC/SV_Message_Queues/test.h delete mode 100644 examples/System_V_IPC/SV_Semaphores/Makefile delete mode 100644 examples/System_V_IPC/SV_Semaphores/Semaphore_Client.cpp delete mode 100644 examples/System_V_IPC/SV_Semaphores/Semaphore_Server.cpp delete mode 100644 examples/System_V_IPC/SV_Semaphores/Semaphore_Test.h delete mode 100644 examples/System_V_IPC/SV_Semaphores/Semaphores.cpp delete mode 100644 examples/System_V_IPC/SV_Semaphores/Semaphores_1.cpp delete mode 100644 examples/System_V_IPC/SV_Semaphores/Semaphores_2.cpp delete mode 100644 examples/System_V_IPC/SV_Shared_Memory/Makefile delete mode 100644 examples/System_V_IPC/SV_Shared_Memory/SV_Shared_Memory_Test.cpp delete mode 100644 examples/System_V_IPC/SV_Shared_Memory/SV_Shared_Memory_Test.h delete mode 100644 examples/Threads/Makefile delete mode 100644 examples/Threads/TSS_Data.h delete mode 100644 examples/Threads/TSS_Obj.h delete mode 100644 examples/Threads/TSS_Task.h delete mode 100644 examples/Threads/auto_event.cpp delete mode 100644 examples/Threads/barrier1.cpp delete mode 100644 examples/Threads/barrier1.dsp delete mode 100644 examples/Threads/barrier2.cpp delete mode 100644 examples/Threads/barrier2.dsp delete mode 100644 examples/Threads/cancel.cpp delete mode 100644 examples/Threads/cancel.dsp delete mode 100644 examples/Threads/future1.cpp delete mode 100644 examples/Threads/future1.dsp delete mode 100644 examples/Threads/future2.cpp delete mode 100644 examples/Threads/future2.dsp delete mode 100644 examples/Threads/manual_event.cpp delete mode 100644 examples/Threads/manual_event.dsp delete mode 100644 examples/Threads/process_manager.cpp delete mode 100644 examples/Threads/process_mutex.cpp delete mode 100644 examples/Threads/process_mutex.dsp delete mode 100644 examples/Threads/process_semaphore.cpp delete mode 100644 examples/Threads/process_semaphore.dsp delete mode 100644 examples/Threads/reader_writer.cpp delete mode 100644 examples/Threads/reader_writer.dsp delete mode 100644 examples/Threads/recursive_mutex.cpp delete mode 100644 examples/Threads/recursive_mutex.dsp delete mode 100644 examples/Threads/task_five.cpp delete mode 100644 examples/Threads/task_five.dsp delete mode 100644 examples/Threads/task_four.cpp delete mode 100644 examples/Threads/task_four.dsp delete mode 100644 examples/Threads/task_one.cpp delete mode 100644 examples/Threads/task_one.dsp delete mode 100644 examples/Threads/task_three.cpp delete mode 100644 examples/Threads/task_three.dsp delete mode 100644 examples/Threads/task_two.cpp delete mode 100644 examples/Threads/task_two.dsp delete mode 100644 examples/Threads/test.dsp delete mode 100644 examples/Threads/test.dsw delete mode 100644 examples/Threads/test_auto_event.cpp delete mode 100644 examples/Threads/test_barrier1.cpp delete mode 100644 examples/Threads/test_barrier2.cpp delete mode 100644 examples/Threads/test_cancel.cpp delete mode 100644 examples/Threads/test_future1.cpp delete mode 100644 examples/Threads/test_future2.cpp delete mode 100644 examples/Threads/test_manual_event.cpp delete mode 100644 examples/Threads/test_process_mutex.cpp delete mode 100644 examples/Threads/test_process_semaphore.cpp delete mode 100644 examples/Threads/test_reader_writer.cpp delete mode 100644 examples/Threads/test_recursive_mutex.cpp delete mode 100644 examples/Threads/test_task.cpp delete mode 100644 examples/Threads/test_task_four.cpp delete mode 100644 examples/Threads/test_task_one.cpp delete mode 100644 examples/Threads/test_task_three.cpp delete mode 100644 examples/Threads/test_task_two.cpp delete mode 100644 examples/Threads/test_thread_manager.cpp delete mode 100644 examples/Threads/test_thread_pool.cpp delete mode 100644 examples/Threads/test_thread_specific.cpp delete mode 100644 examples/Threads/test_token.cpp delete mode 100644 examples/Threads/test_tss.cpp delete mode 100644 examples/Threads/test_tss1.cpp delete mode 100644 examples/Threads/test_tss2.cpp delete mode 100644 examples/Threads/thread_manager.cpp delete mode 100644 examples/Threads/thread_manager.dsp delete mode 100644 examples/Threads/thread_pool.cpp delete mode 100644 examples/Threads/thread_pool.dsp delete mode 100644 examples/Threads/thread_specific.cpp delete mode 100644 examples/Threads/thread_specific.dsp delete mode 100644 examples/Threads/thread_specific.h delete mode 100644 examples/Threads/token.cpp delete mode 100644 examples/Threads/token.dsp delete mode 100644 examples/Threads/tss1.cpp delete mode 100644 examples/Threads/tss1.dsp delete mode 100644 examples/Threads/tss2.cpp delete mode 100644 examples/Threads/tss2.dsp delete mode 100644 examples/Threads/wfmo.cpp delete mode 100644 examples/Timer_Queue/Async_Timer_Queue_Test.cpp delete mode 100644 examples/Timer_Queue/Async_Timer_Queue_Test.dsp delete mode 100644 examples/Timer_Queue/Async_Timer_Queue_Test.h delete mode 100644 examples/Timer_Queue/Driver.cpp delete mode 100644 examples/Timer_Queue/Driver.h delete mode 100644 examples/Timer_Queue/Makefile delete mode 100644 examples/Timer_Queue/README delete mode 100644 examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp delete mode 100644 examples/Timer_Queue/Reactor_Timer_Queue_Test.dsp delete mode 100644 examples/Timer_Queue/Reactor_Timer_Queue_Test.h delete mode 100644 examples/Timer_Queue/Thread_Timer_Queue_Test.cpp delete mode 100644 examples/Timer_Queue/Thread_Timer_Queue_Test.dsp delete mode 100644 examples/Timer_Queue/Thread_Timer_Queue_Test.h delete mode 100644 examples/Timer_Queue/Timer_Queue.dsw delete mode 100644 examples/Timer_Queue/main_async.cpp delete mode 100644 examples/Timer_Queue/main_reactor.cpp delete mode 100644 examples/Timer_Queue/main_thread.cpp delete mode 100644 examples/Web_Crawler/Command_Processor.cpp delete mode 100644 examples/Web_Crawler/Command_Processor.h delete mode 100644 examples/Web_Crawler/HTTP_URL.cpp delete mode 100644 examples/Web_Crawler/HTTP_URL.h delete mode 100644 examples/Web_Crawler/Iterators.cpp delete mode 100644 examples/Web_Crawler/Iterators.h delete mode 100644 examples/Web_Crawler/Makefile delete mode 100644 examples/Web_Crawler/Mem_Map_Stream.cpp delete mode 100644 examples/Web_Crawler/Mem_Map_Stream.h delete mode 100644 examples/Web_Crawler/Options.cpp delete mode 100644 examples/Web_Crawler/Options.h delete mode 100644 examples/Web_Crawler/README delete mode 100644 examples/Web_Crawler/URL.cpp delete mode 100644 examples/Web_Crawler/URL.h delete mode 100644 examples/Web_Crawler/URL_Addr.cpp delete mode 100644 examples/Web_Crawler/URL_Addr.h delete mode 100644 examples/Web_Crawler/URL_Status.cpp delete mode 100644 examples/Web_Crawler/URL_Status.h delete mode 100644 examples/Web_Crawler/URL_Visitor.cpp delete mode 100644 examples/Web_Crawler/URL_Visitor.h delete mode 100644 examples/Web_Crawler/URL_Visitor_Factory.cpp delete mode 100644 examples/Web_Crawler/URL_Visitor_Factory.h delete mode 100644 examples/Web_Crawler/Web_Crawler.cpp delete mode 100644 examples/Web_Crawler/Web_Crawler.dsp delete mode 100644 examples/Web_Crawler/Web_Crawler.dsw delete mode 100644 examples/Web_Crawler/Web_Crawler.h delete mode 100644 examples/Web_Crawler/main.cpp delete mode 100644 include/makeinclude/ace_flags.bor delete mode 100644 include/makeinclude/build_core_exe.bor delete mode 100644 include/makeinclude/build_core_library.bor delete mode 100644 include/makeinclude/build_dll.bor delete mode 100644 include/makeinclude/build_example.bor delete mode 100644 include/makeinclude/build_exe.bor delete mode 100644 include/makeinclude/build_lib.bor delete mode 100644 include/makeinclude/build_library.bor delete mode 100644 include/makeinclude/compiler.bor delete mode 100644 include/makeinclude/decorator.bor delete mode 100644 include/makeinclude/macros.GNU delete mode 100644 include/makeinclude/make_flags.bor delete mode 100644 include/makeinclude/outputdir.bor delete mode 100644 include/makeinclude/platform_aix.GNU delete mode 100644 include/makeinclude/platform_aix4.2.GNU delete mode 100644 include/makeinclude/platform_aix4_cset++.GNU delete mode 100644 include/makeinclude/platform_aix4_g++.GNU delete mode 100644 include/makeinclude/platform_aix_g++.GNU delete mode 100644 include/makeinclude/platform_aix_vacpp.GNU delete mode 100644 include/makeinclude/platform_chorus.GNU delete mode 100644 include/makeinclude/platform_chorus4.x_g++.GNU delete mode 100644 include/makeinclude/platform_chorus_ghs.GNU delete mode 100644 include/makeinclude/platform_cray.GNU delete mode 100644 include/makeinclude/platform_dgux4_epc.GNU delete mode 100644 include/makeinclude/platform_dgux4_ghs.GNU delete mode 100644 include/makeinclude/platform_freebsd.GNU delete mode 100644 include/makeinclude/platform_freebsd_pthread.GNU delete mode 100644 include/makeinclude/platform_hpux.GNU delete mode 100644 include/makeinclude/platform_hpux_aCC.GNU delete mode 100644 include/makeinclude/platform_hpux_gcc.GNU delete mode 100644 include/makeinclude/platform_hpux_kcc.GNU delete mode 100644 include/makeinclude/platform_hpux_orbix.GNU delete mode 100644 include/makeinclude/platform_irix5.2.GNU delete mode 100644 include/makeinclude/platform_irix5.3_g++.GNU delete mode 100644 include/makeinclude/platform_irix5.3_sgic++.GNU delete mode 100644 include/makeinclude/platform_irix6.x_common.GNU delete mode 100644 include/makeinclude/platform_irix6.x_g++.GNU delete mode 100644 include/makeinclude/platform_irix6.x_kcc.GNU delete mode 100644 include/makeinclude/platform_irix6.x_sgic++.GNU delete mode 100644 include/makeinclude/platform_linux.GNU delete mode 100644 include/makeinclude/platform_linux_cxx.GNU delete mode 100644 include/makeinclude/platform_linux_kcc.GNU delete mode 100644 include/makeinclude/platform_linux_lxpthread.GNU delete mode 100644 include/makeinclude/platform_linux_lxpthreads.GNU delete mode 100644 include/makeinclude/platform_linux_pthread.GNU delete mode 100644 include/makeinclude/platform_lynxos.GNU delete mode 100644 include/makeinclude/platform_m88k.GNU delete mode 100644 include/makeinclude/platform_mvs.GNU delete mode 100644 include/makeinclude/platform_netbsd.GNU delete mode 100644 include/makeinclude/platform_osf1_3.2.GNU delete mode 100644 include/makeinclude/platform_osf1_4.0.GNU delete mode 100644 include/makeinclude/platform_osf1_4.0_g++.GNU delete mode 100644 include/makeinclude/platform_osf1_4.0_kcc.GNU delete mode 100644 include/makeinclude/platform_osf1_4.0_rcc.GNU delete mode 100644 include/makeinclude/platform_psos_diab.GNU delete mode 100644 include/makeinclude/platform_psos_diab_ppc.GNU delete mode 100644 include/makeinclude/platform_psos_tm.GNU delete mode 100644 include/makeinclude/platform_psosim_g++.GNU delete mode 100644 include/makeinclude/platform_qnx_neutrino.GNU delete mode 100644 include/makeinclude/platform_sco-nothread.GNU delete mode 100644 include/makeinclude/platform_sco5.0.0-CC-fsu-pthread.GNU delete mode 100644 include/makeinclude/platform_sco5.0.0-fsu-pthread.GNU delete mode 100644 include/makeinclude/platform_sco5.0.0-mit-pthread.GNU delete mode 100644 include/makeinclude/platform_sco5.0.0-nothread.GNU delete mode 100644 include/makeinclude/platform_sunos4_g++.GNU delete mode 100644 include/makeinclude/platform_sunos4_lucid.GNU delete mode 100644 include/makeinclude/platform_sunos4_sunc++3.x.GNU delete mode 100644 include/makeinclude/platform_sunos4_sunc++4.x.GNU delete mode 100644 include/makeinclude/platform_sunos4_sunc++4.x_orbix.GNU delete mode 100644 include/makeinclude/platform_sunos5_centerline.GNU delete mode 100644 include/makeinclude/platform_sunos5_centerline_orbix.GNU delete mode 100644 include/makeinclude/platform_sunos5_egcs.GNU delete mode 100644 include/makeinclude/platform_sunos5_g++.GNU delete mode 100644 include/makeinclude/platform_sunos5_ghs.GNU delete mode 100644 include/makeinclude/platform_sunos5_kcc.GNU delete mode 100644 include/makeinclude/platform_sunos5_sunc++.GNU delete mode 100644 include/makeinclude/platform_sunos5_sunc++_orbix.GNU delete mode 100644 include/makeinclude/platform_tandem.GNU delete mode 100644 include/makeinclude/platform_tru64_cxx.GNU delete mode 100644 include/makeinclude/platform_tru64_g++.GNU delete mode 100644 include/makeinclude/platform_unixware_g++.GNU delete mode 100644 include/makeinclude/platform_vxworks5.x_diab.GNU delete mode 100644 include/makeinclude/platform_vxworks5.x_g++.GNU delete mode 100644 include/makeinclude/platform_vxworks5.x_ghs.GNU delete mode 100644 include/makeinclude/recurse.bor delete mode 100644 include/makeinclude/rules.bin.GNU delete mode 100644 include/makeinclude/rules.common.GNU delete mode 100644 include/makeinclude/rules.lib.GNU delete mode 100644 include/makeinclude/rules.local.GNU delete mode 100644 include/makeinclude/rules.nested.GNU delete mode 100644 include/makeinclude/rules.nolocal.GNU delete mode 100644 include/makeinclude/rules.nonested.GNU delete mode 100644 include/makeinclude/wrapper_macros.GNU delete mode 100755 install-sh delete mode 100644 java/ChangeLog delete mode 100644 java/ImageProcessing/ImageProcessing.dsp delete mode 100644 java/ImageProcessing/ImageProcessing.dsw delete mode 100644 java/ImageProcessing/filters/Assert.java delete mode 100644 java/ImageProcessing/filters/BleachFilter.java delete mode 100644 java/ImageProcessing/filters/BlurFilter.java delete mode 100644 java/ImageProcessing/filters/DarkenFilter.java delete mode 100644 java/ImageProcessing/filters/DeSpeckleFilter.java delete mode 100644 java/ImageProcessing/filters/DissolveFilter.java delete mode 100644 java/ImageProcessing/filters/EdgeDetectFilter.java delete mode 100644 java/ImageProcessing/filters/EmbossFilter.java delete mode 100644 java/ImageProcessing/filters/Makefile delete mode 100644 java/ImageProcessing/filters/MedFilter.java delete mode 100644 java/ImageProcessing/filters/OilPaintFilter.java delete mode 100644 java/ImageProcessing/filters/PixelizeFilter.java delete mode 100644 java/ImageProcessing/filters/RandomizeFilter.java delete mode 100644 java/ImageProcessing/filters/RotateFilter.java delete mode 100644 java/ImageProcessing/filters/SharpenFilter.java delete mode 100644 java/ImageProcessing/filters/SpatialFilter.java delete mode 100644 java/ImageProcessing/filters/SpreadFilter.java delete mode 100644 java/ImageProcessing/filters/Timer.java delete mode 100644 java/ImageProcessing/framework/BaseButton.java delete mode 100644 java/ImageProcessing/framework/BenchmarkApplet.java delete mode 100644 java/ImageProcessing/framework/DialogManager.java delete mode 100644 java/ImageProcessing/framework/DialogType.java delete mode 100644 java/ImageProcessing/framework/FileBrowser.java delete mode 100644 java/ImageProcessing/framework/FilePanel.java delete mode 100644 java/ImageProcessing/framework/FilterTest.java delete mode 100644 java/ImageProcessing/framework/GIFHandler.java delete mode 100644 java/ImageProcessing/framework/GifEncoder.java delete mode 100644 java/ImageProcessing/framework/Hierarchy.java delete mode 100644 java/ImageProcessing/framework/HierarchyAdapter.java delete mode 100644 java/ImageProcessing/framework/Icon.java delete mode 100644 java/ImageProcessing/framework/ImageApp.java delete mode 100644 java/ImageProcessing/framework/ImageByteCounter.java delete mode 100644 java/ImageProcessing/framework/ImageCanvas.java delete mode 100644 java/ImageProcessing/framework/ImageEncoder.java delete mode 100644 java/ImageProcessing/framework/ImageProcessor.java delete mode 100644 java/ImageProcessing/framework/ImageSender.java delete mode 100644 java/ImageProcessing/framework/IntHashtable.java delete mode 100644 java/ImageProcessing/framework/ListFiles.java delete mode 100755 java/ImageProcessing/framework/LoadURLFrame.java delete mode 100644 java/ImageProcessing/framework/Makefile delete mode 100644 java/ImageProcessing/framework/MedJava.html delete mode 100644 java/ImageProcessing/framework/Options.java delete mode 100755 java/ImageProcessing/framework/SaveURLFrame.java delete mode 100644 java/ImageProcessing/framework/Separator.java delete mode 100644 java/ImageProcessing/framework/ServerHandler.java delete mode 100644 java/ImageProcessing/framework/ServerTest.java delete mode 100644 java/ImageProcessing/framework/StatusDisplay.java delete mode 100644 java/ImageProcessing/framework/StatusIndicator.java delete mode 100644 java/ImageProcessing/framework/TestHandler.java delete mode 100644 java/ImageProcessing/framework/Tester.java delete mode 100644 java/ImageProcessing/framework/doc01.gif delete mode 100644 java/ImageProcessing/framework/file03.gif delete mode 100644 java/ImageProcessing/framework/filter.conf delete mode 100644 java/ImageProcessing/framework/help.conf delete mode 100644 java/ImageProcessing/framework/test.html delete mode 100644 java/ImageProcessing/framework/testFilter.conf delete mode 100644 java/JACE/ASX/IOCntlCmds.java delete mode 100644 java/JACE/ASX/IOCntlMsg.java delete mode 100644 java/JACE/ASX/MessageBlock.java delete mode 100644 java/JACE/ASX/MessageQueue.java delete mode 100644 java/JACE/ASX/MessageType.java delete mode 100644 java/JACE/ASX/Module.java delete mode 100644 java/JACE/ASX/Stream.java delete mode 100644 java/JACE/ASX/StreamHead.java delete mode 100644 java/JACE/ASX/StreamTail.java delete mode 100644 java/JACE/ASX/Task.java delete mode 100644 java/JACE/ASX/TaskFlags.java delete mode 100644 java/JACE/ASX/ThruTask.java delete mode 100644 java/JACE/ASX/TimeValue.java delete mode 100644 java/JACE/ASX/TimedWait.java delete mode 100644 java/JACE/ASX/TimeoutException.java delete mode 100644 java/JACE/ASX/package.html delete mode 100644 java/JACE/Concurrency/AbstractLock.java delete mode 100644 java/JACE/Concurrency/Condition.java delete mode 100644 java/JACE/Concurrency/LockAdapter.java delete mode 100644 java/JACE/Concurrency/LockException.java delete mode 100644 java/JACE/Concurrency/Mutex.java delete mode 100644 java/JACE/Concurrency/RWMutex.java delete mode 100644 java/JACE/Concurrency/RenewObject.java delete mode 100644 java/JACE/Concurrency/Semaphore.java delete mode 100644 java/JACE/Concurrency/ThreadManager.java delete mode 100644 java/JACE/Concurrency/Token.java delete mode 100644 java/JACE/Concurrency/WaitObject.java delete mode 100644 java/JACE/Concurrency/package.html delete mode 100644 java/JACE/Connection/AcceptStrategy.java delete mode 100644 java/JACE/Connection/Acceptor.java delete mode 100644 java/JACE/Connection/ActivateStrategy.java delete mode 100644 java/JACE/Connection/Blob.java delete mode 100644 java/JACE/Connection/BlobHandler.java delete mode 100644 java/JACE/Connection/BlobReader.java delete mode 100644 java/JACE/Connection/BlobWriter.java delete mode 100644 java/JACE/Connection/Connector.java delete mode 100644 java/JACE/Connection/CreationStrategy.java delete mode 100644 java/JACE/Connection/HTTPHelper.java delete mode 100644 java/JACE/Connection/StrategyAcceptor.java delete mode 100644 java/JACE/Connection/SvcHandler.java delete mode 100644 java/JACE/Connection/package.html delete mode 100644 java/JACE/Makefile delete mode 100644 java/JACE/Misc/GetOpt.java delete mode 100644 java/JACE/Misc/package.html delete mode 100644 java/JACE/OS/ACE.java delete mode 100644 java/JACE/OS/OS.java delete mode 100644 java/JACE/OS/package.html delete mode 100644 java/JACE/Reactor/EventHandler.java delete mode 100644 java/JACE/Reactor/TimerQueue.java delete mode 100644 java/JACE/Reactor/package.html delete mode 100644 java/JACE/SOCK_SAP/INETAddr.java delete mode 100644 java/JACE/SOCK_SAP/SOCKAcceptor.java delete mode 100644 java/JACE/SOCK_SAP/SOCKConnector.java delete mode 100644 java/JACE/SOCK_SAP/SOCKStream.java delete mode 100644 java/JACE/SOCK_SAP/package.html delete mode 100644 java/JACE/ServiceConfigurator/Service.java delete mode 100644 java/JACE/ServiceConfigurator/ServiceConfig.java delete mode 100644 java/JACE/ServiceConfigurator/ServiceLoader.java delete mode 100644 java/JACE/ServiceConfigurator/ServiceObject.java delete mode 100644 java/JACE/ServiceConfigurator/ServiceRepository.java delete mode 100644 java/JACE/ServiceConfigurator/package.html delete mode 100644 java/JACE/Timers/ProfileTimer.java delete mode 100644 java/JACE/Timers/package.html delete mode 100644 java/JACE/makebat.zip delete mode 100644 java/JACE/netsvcs/Handler.java delete mode 100644 java/JACE/netsvcs/Logger/LogRecord.java delete mode 100644 java/JACE/netsvcs/Logger/LoggingStrategy.java delete mode 100644 java/JACE/netsvcs/Logger/ServerLoggingAcceptor.java delete mode 100644 java/JACE/netsvcs/Logger/ServerLoggingHandler.java delete mode 100644 java/JACE/netsvcs/Logger/StderrStrategy.java delete mode 100644 java/JACE/netsvcs/Logger/c.bat delete mode 100644 java/JACE/netsvcs/Logger/package.html delete mode 100644 java/JACE/netsvcs/Naming/NameAcceptor.java delete mode 100644 java/JACE/netsvcs/Naming/NameHandler.java delete mode 100644 java/JACE/netsvcs/Naming/NameProxy.java delete mode 100644 java/JACE/netsvcs/Naming/NameReply.java delete mode 100644 java/JACE/netsvcs/Naming/NameRequest.java delete mode 100644 java/JACE/netsvcs/Naming/c.bat delete mode 100644 java/JACE/netsvcs/Naming/package.html delete mode 100644 java/JACE/netsvcs/Server.java delete mode 100644 java/JACE/netsvcs/Time/TSClerkHandler.java delete mode 100644 java/JACE/netsvcs/Time/TSClerkProcessor.java delete mode 100644 java/JACE/netsvcs/Time/TSServerAcceptor.java delete mode 100644 java/JACE/netsvcs/Time/TSServerHandler.java delete mode 100644 java/JACE/netsvcs/Time/TimeInfo.java delete mode 100644 java/JACE/netsvcs/Time/TimeRequest.java delete mode 100644 java/JACE/netsvcs/Time/c.bat delete mode 100644 java/JACE/netsvcs/Time/package.html delete mode 100644 java/JACE/netsvcs/Time/r.bat delete mode 100644 java/JACE/netsvcs/Token/LockHandler.java delete mode 100644 java/JACE/netsvcs/Token/LockHandlerAdapter.java delete mode 100644 java/JACE/netsvcs/Token/LockOperations.java delete mode 100644 java/JACE/netsvcs/Token/LockTypes.java delete mode 100644 java/JACE/netsvcs/Token/MutexHandler.java delete mode 100644 java/JACE/netsvcs/Token/RWMutexHandler.java delete mode 100644 java/JACE/netsvcs/Token/RemoteLock.java delete mode 100644 java/JACE/netsvcs/Token/RemoteMutex.java delete mode 100644 java/JACE/netsvcs/Token/RemoteRWMutex.java delete mode 100644 java/JACE/netsvcs/Token/TokenAcceptor.java delete mode 100644 java/JACE/netsvcs/Token/TokenReply.java delete mode 100644 java/JACE/netsvcs/Token/TokenRequest.java delete mode 100644 java/JACE/netsvcs/Token/TokenRequestHandler.java delete mode 100644 java/JACE/netsvcs/Token/package.html delete mode 100644 java/JACE/netsvcs/package.html delete mode 100644 java/JACE/overview.html delete mode 100644 java/JACE/package.html delete mode 100644 java/JACE/tests/ASX/BufferStreamTest.java delete mode 100644 java/JACE/tests/ASX/MessageQueueTest.java delete mode 100644 java/JACE/tests/ASX/PriorityBufferTest.java delete mode 100644 java/JACE/tests/ASX/TaskTest.java delete mode 100644 java/JACE/tests/ASX/ThreadPoolTest.java delete mode 100644 java/JACE/tests/Concurrency/Condition/Consumer.java delete mode 100644 java/JACE/tests/Concurrency/Condition/JoinableThreadGroup.java delete mode 100644 java/JACE/tests/Concurrency/Condition/Producer.java delete mode 100644 java/JACE/tests/Concurrency/Condition/QueueTest.java delete mode 100644 java/JACE/tests/Concurrency/Condition/SimpleMessageQueue.java delete mode 100644 java/JACE/tests/Concurrency/IterationTest.java delete mode 100644 java/JACE/tests/Concurrency/RWMutexTest.java delete mode 100644 java/JACE/tests/Concurrency/TimingTest.java delete mode 100644 java/JACE/tests/Concurrency/TokenTest.java delete mode 100644 java/JACE/tests/Connection/AcceptorTest.java delete mode 100644 java/JACE/tests/Connection/ClientHandler.java delete mode 100644 java/JACE/tests/Connection/ConnectorTest.java delete mode 100644 java/JACE/tests/Connection/HTTPHelperTest.java delete mode 100644 java/JACE/tests/Connection/ServerHandler.java delete mode 100644 java/JACE/tests/Makefile delete mode 100644 java/JACE/tests/Misc/ParseArgsTest.java delete mode 100644 java/JACE/tests/Reactor/TimeValueTest.java delete mode 100644 java/JACE/tests/Reactor/TimerQueueTest.java delete mode 100644 java/JACE/tests/SOCK_SAP/SOCKAcceptorTest.java delete mode 100644 java/JACE/tests/SOCK_SAP/SOCKConnectorTest.java delete mode 100644 java/JACE/tests/ServiceConfigurator/Main.java delete mode 100644 java/JACE/tests/ServiceConfigurator/svc.conf delete mode 100644 java/JACE/tests/netsvcs/Logger/LoggerTest.java delete mode 100644 java/JACE/tests/netsvcs/Naming/ClientTest.java delete mode 100644 java/JACE/tests/netsvcs/Time/TSClient.java delete mode 100644 java/JACE/tests/netsvcs/Token/ProxyClientTest.java delete mode 100644 java/MSVJProjects.zip delete mode 100644 java/README delete mode 100644 java/VERSION delete mode 100644 java/apps/NexusII/README delete mode 100644 java/apps/NexusII/classes/ClientHandler.class delete mode 100644 java/apps/NexusII/classes/FrameHandler.class delete mode 100644 java/apps/NexusII/classes/ImageCanvas.class delete mode 100644 java/apps/NexusII/classes/NexusClientApplet.class delete mode 100644 java/apps/NexusII/classes/NexusIIserver.class delete mode 100644 java/apps/NexusII/classes/Room.class delete mode 100644 java/apps/NexusII/classes/RoomFactory.class delete mode 100644 java/apps/NexusII/classes/RoomFrame.class delete mode 100644 java/apps/NexusII/classes/RoomThread.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CApplet.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CApplet.java delete mode 100644 java/apps/NexusII/classes/awtCommand/CButton.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CButton.java delete mode 100644 java/apps/NexusII/classes/awtCommand/CCanvas.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CCanvas.java delete mode 100644 java/apps/NexusII/classes/awtCommand/CFrame.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CFrame.java delete mode 100644 java/apps/NexusII/classes/awtCommand/CList.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CList.java delete mode 100644 java/apps/NexusII/classes/awtCommand/CPanel.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CPanel.java delete mode 100644 java/apps/NexusII/classes/awtCommand/CTextArea.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CTextArea.java delete mode 100644 java/apps/NexusII/classes/awtCommand/CTextField.class delete mode 100644 java/apps/NexusII/classes/awtCommand/CTextField.java delete mode 100644 java/apps/NexusII/classes/awtCommand/Command.class delete mode 100644 java/apps/NexusII/classes/awtCommand/Command.java delete mode 100644 java/apps/NexusII/classes/commandHandler.class delete mode 100644 java/apps/NexusII/classes/commandParser.class delete mode 100644 java/apps/NexusII/classes/connectionHandler.class delete mode 100644 java/apps/NexusII/classes/joinHandler.class delete mode 100644 java/apps/NexusII/classes/roomHandler.class delete mode 100644 java/apps/NexusII/classes/textHandler.class delete mode 100644 java/apps/NexusII/src/Consumer.java delete mode 100644 java/apps/NexusII/src/MT_Bounded_Queue.java delete mode 100644 java/apps/NexusII/src/MT_Bounded_Queue_Group.java delete mode 100644 java/apps/NexusII/src/NexusClientApplet.java delete mode 100644 java/apps/NexusII/src/NexusIIserver.java delete mode 100644 java/apps/NexusII/src/Producer.java delete mode 100644 java/apps/NexusII/src/Room.java delete mode 100644 java/apps/NexusII/src/RoomFrame.java delete mode 100644 java/apps/NexusII/src/RoomSpace.java delete mode 100644 java/apps/NexusII/src/Timed_Wait.java delete mode 100644 java/apps/NexusII/src/Timer.java delete mode 100644 java/apps/NexusII/src/commandHandler.java delete mode 100644 java/apps/NexusII/src/commandParser.java delete mode 100644 java/apps/NexusII/src/connectionHandler.java delete mode 100644 java/apps/NexusII/src/consts.java delete mode 100644 java/apps/NexusII/src/dataPacket.java delete mode 100644 java/apps/NexusII/src/joinHandler.java delete mode 100644 java/apps/NexusII/src/makefile delete mode 100644 java/apps/NexusII/src/nexusDemuxThread.java delete mode 100644 java/apps/NexusII/src/roomHandler.java delete mode 100644 java/apps/NexusII/src/socketReaderThread.java delete mode 100644 java/apps/NexusII/src/socketWriterThread.java delete mode 100644 java/apps/NexusII/src/url_to_url.java delete mode 100755 java/apps/NexusII/start delete mode 100644 java/apps/NexusII/start.html delete mode 100644 java/classes/README.TXT delete mode 100644 java/doc/images/GridBagEx.gif delete mode 100644 java/doc/images/OpenBookIcon.gif delete mode 100644 java/doc/images/blue-ball-small.gif delete mode 100644 java/doc/images/blue-ball.gif delete mode 100644 java/doc/images/class-index.gif delete mode 100644 java/doc/images/constructor-index.gif delete mode 100644 java/doc/images/constructors.gif delete mode 100644 java/doc/images/cyan-ball-small.gif delete mode 100644 java/doc/images/cyan-ball.gif delete mode 100644 java/doc/images/error-index.gif delete mode 100644 java/doc/images/exception-index.gif delete mode 100644 java/doc/images/green-ball-small.gif delete mode 100644 java/doc/images/green-ball.gif delete mode 100644 java/doc/images/interface-index.gif delete mode 100644 java/doc/images/magenta-ball-small.gif delete mode 100644 java/doc/images/magenta-ball.gif delete mode 100644 java/doc/images/method-index.gif delete mode 100644 java/doc/images/methods.gif delete mode 100644 java/doc/images/package-index.gif delete mode 100644 java/doc/images/red-ball-small.gif delete mode 100644 java/doc/images/red-ball.gif delete mode 100644 java/doc/images/variable-index.gif delete mode 100644 java/doc/images/variables.gif delete mode 100644 java/doc/images/yellow-ball-small.gif delete mode 100644 java/doc/images/yellow-ball.gif delete mode 100644 java/examples/Logger/README delete mode 100644 java/examples/Logger/simple-server/LogRecord.java delete mode 100644 java/examples/Logger/simple-server/LoggerConstants.java delete mode 100644 java/examples/Logger/simple-server/LoggingAcceptor.java delete mode 100644 java/examples/Logger/simple-server/LoggingClient.java delete mode 100644 java/examples/Logger/simple-server/LoggingHandler.java delete mode 100644 java/examples/Logger/simple-server/Makefile delete mode 100644 java/examples/Logger/simple-server/README delete mode 100644 java/examples/Logger/simple-server/SimpleLogger.java delete mode 100644 java/gjt/Assert.java delete mode 100644 java/gjt/Bargauge.java delete mode 100644 java/gjt/Border.java delete mode 100644 java/gjt/Box.java delete mode 100644 java/gjt/BulletinLayout.java delete mode 100644 java/gjt/ButtonPanel.java delete mode 100644 java/gjt/CardPanel.java delete mode 100644 java/gjt/ChoiceCardPanel.java delete mode 100644 java/gjt/ColumnLayout.java delete mode 100644 java/gjt/ComponentScroller.java delete mode 100644 java/gjt/DialogClient.java delete mode 100644 java/gjt/DrawingPanel.java delete mode 100644 java/gjt/DrawnRectangle.java delete mode 100644 java/gjt/EtchedBorder.java delete mode 100644 java/gjt/EtchedRectangle.java delete mode 100644 java/gjt/Etching.java delete mode 100644 java/gjt/ExclusiveImageButtonPanel.java delete mode 100644 java/gjt/FontDialog.java delete mode 100644 java/gjt/GJT.DSP delete mode 100644 java/gjt/GJT.DSW delete mode 100644 java/gjt/GJTDialog.java delete mode 100644 java/gjt/IconCardPanel.java delete mode 100644 java/gjt/ImageButton.java delete mode 100644 java/gjt/ImageButtonController.java delete mode 100644 java/gjt/ImageButtonEvent.java delete mode 100644 java/gjt/ImageButtonPanel.java delete mode 100644 java/gjt/ImageButtonPanelController.java delete mode 100644 java/gjt/ImageCanvas.java delete mode 100644 java/gjt/ImageScroller.java delete mode 100644 java/gjt/LabelCanvas.java delete mode 100644 java/gjt/Makefile delete mode 100644 java/gjt/MessageDialog.java delete mode 100644 java/gjt/MouseController.java delete mode 100644 java/gjt/Orientation.java delete mode 100644 java/gjt/ProgressDialog.java delete mode 100644 java/gjt/QuestionDialog.java delete mode 100644 java/gjt/RadioImageButtonPanelController.java delete mode 100644 java/gjt/RowLayout.java delete mode 100644 java/gjt/Scroller.java delete mode 100644 java/gjt/ScrollerLayout.java delete mode 100644 java/gjt/SelectionEvent.java delete mode 100644 java/gjt/Separator.java delete mode 100644 java/gjt/SpringyImageButtonController.java delete mode 100644 java/gjt/StateButton.java delete mode 100644 java/gjt/StateButtonController.java delete mode 100644 java/gjt/StickyImageButtonController.java delete mode 100644 java/gjt/Stopwatch.java delete mode 100644 java/gjt/StopwatchClient.java delete mode 100644 java/gjt/ThreeDBorder.java delete mode 100644 java/gjt/ThreeDBorderStyle.java delete mode 100644 java/gjt/ThreeDRectangle.java delete mode 100644 java/gjt/Toolbar.java delete mode 100644 java/gjt/Util.java delete mode 100644 java/gjt/YesNoDialog.java delete mode 100644 java/gjt/animation/CollisionArena.java delete mode 100644 java/gjt/animation/CollisionDetector.java delete mode 100644 java/gjt/animation/EdgeCollisionDetector.java delete mode 100644 java/gjt/animation/Playfield.java delete mode 100644 java/gjt/animation/Sequence.java delete mode 100644 java/gjt/animation/Sprite.java delete mode 100644 java/gjt/animation/SpriteCollisionDetector.java delete mode 100644 java/gjt/image/BleachImageFilter.java delete mode 100644 java/gjt/image/DissolveFilter.java delete mode 100644 java/gjt/image/ImageDissolver.java delete mode 100644 java/gjt/rubberband/Rubberband.java delete mode 100644 java/gjt/rubberband/RubberbandEllipse.java delete mode 100644 java/gjt/rubberband/RubberbandLine.java delete mode 100644 java/gjt/rubberband/RubberbandPanel.java delete mode 100644 java/gjt/rubberband/RubberbandRectangle.java delete mode 100644 java/gjt/test/AttributesPanel.java delete mode 100644 java/gjt/test/BargaugeTest.java delete mode 100644 java/gjt/test/BleachImageFilterTest.java delete mode 100644 java/gjt/test/BorderTest.java delete mode 100644 java/gjt/test/BoxTest.java delete mode 100644 java/gjt/test/BumpAnimationTest.java delete mode 100644 java/gjt/test/ChoiceCardPanelTest.java delete mode 100644 java/gjt/test/ColumnLayoutTest.java delete mode 100644 java/gjt/test/ComponentScrollerTest.java delete mode 100644 java/gjt/test/ConnectionsPanel.java delete mode 100644 java/gjt/test/DialogTest.java delete mode 100644 java/gjt/test/DrawnRectangleTest.java delete mode 100644 java/gjt/test/FontDialogTest.java delete mode 100644 java/gjt/test/IconCardPanelTest.java delete mode 100644 java/gjt/test/ImageButtonTest.java delete mode 100644 java/gjt/test/ImageDissolverTest.java delete mode 100644 java/gjt/test/ImageScrollerTest.java delete mode 100644 java/gjt/test/LabelCanvasTest.java delete mode 100644 java/gjt/test/MessageDialogTest.java delete mode 100644 java/gjt/test/OccupationOracle.java delete mode 100644 java/gjt/test/RowLayoutTest.java delete mode 100644 java/gjt/test/RubberbandTest.java delete mode 100644 java/gjt/test/SeparatorTest.java delete mode 100644 java/gjt/test/SimpleAnimationTest.java delete mode 100644 java/gjt/test/SimpleBargaugeTest.java delete mode 100644 java/gjt/test/StateButtonTest.java delete mode 100644 java/gjt/test/TenPixelBorder.java delete mode 100644 java/gjt/test/TitledPanel.java delete mode 100644 java/gjt/test/ToolbarTest.java delete mode 100644 java/gjt/test/TwoDrinkersAnimationTest.java delete mode 100644 java/gjt/test/UnitTest.java delete mode 100644 java/java-ace.gif delete mode 100644 java/netsvcs/Logger/DefaultLMR.java delete mode 100644 java/netsvcs/Logger/LogMessageReceiver.java delete mode 100644 java/netsvcs/Logger/LogRecord.java delete mode 100644 java/netsvcs/Logger/Makefile delete mode 100644 java/netsvcs/Logger/ServerLoggingAcceptor.java delete mode 100644 java/netsvcs/Logger/ServerLoggingHandler.java delete mode 100644 java/netsvcs/Naming/Makefile delete mode 100644 java/netsvcs/Naming/NameAcceptor.java delete mode 100644 java/netsvcs/Naming/NameHandler.java delete mode 100644 java/netsvcs/Naming/NameProxy.java delete mode 100644 java/netsvcs/Naming/NameReply.java delete mode 100644 java/netsvcs/Naming/NameRequest.java delete mode 100755 java/netsvcs/Time/Clerk.java delete mode 100755 java/netsvcs/Time/Makefile delete mode 100755 java/netsvcs/Time/Server.java delete mode 100755 java/netsvcs/Time/TSClerkHandler.java delete mode 100755 java/netsvcs/Time/TSClerkProcessor.java delete mode 100755 java/netsvcs/Time/TSRequestAcceptor.java delete mode 100755 java/netsvcs/Time/TSRequestHandler.java delete mode 100755 java/netsvcs/Time/TSServerAcceptor.java delete mode 100755 java/netsvcs/Time/TSServerHandler.java delete mode 100644 java/src/ACE.java delete mode 100644 java/src/AcceptStrategy.java delete mode 100644 java/src/Acceptor.java delete mode 100644 java/src/ActivateStrategy.java delete mode 100644 java/src/AddServiceObjectNode.java delete mode 100644 java/src/Blob.java delete mode 100644 java/src/BlobHandler.java delete mode 100644 java/src/BlobReader.java delete mode 100644 java/src/BlobWriter.java delete mode 100644 java/src/ClassNameGenerator.java delete mode 100644 java/src/ClassReader.java delete mode 100644 java/src/Condition.java delete mode 100644 java/src/Connector.java delete mode 100644 java/src/CreationStrategy.java delete mode 100644 java/src/EventHandler.java delete mode 100644 java/src/GetOpt.java delete mode 100644 java/src/HTTPHelper.java delete mode 100644 java/src/INETAddr.java delete mode 100644 java/src/IOCntlCmds.java delete mode 100644 java/src/IOCntlMsg.java delete mode 100644 java/src/JACE.DSP delete mode 100644 java/src/JACE.DSW delete mode 100644 java/src/Makefile delete mode 100644 java/src/MessageBlock.java delete mode 100644 java/src/MessageQueue.java delete mode 100644 java/src/MessageType.java delete mode 100644 java/src/Module.java delete mode 100644 java/src/Mutex.java delete mode 100644 java/src/OS.java delete mode 100644 java/src/ParseNode.java delete mode 100644 java/src/ProfileTimer.java delete mode 100644 java/src/README delete mode 100644 java/src/RWMutex.java delete mode 100644 java/src/RemoveNode.java delete mode 100644 java/src/ResumeNode.java delete mode 100644 java/src/SOCKAcceptor.java delete mode 100644 java/src/SOCKConnector.java delete mode 100644 java/src/SOCKStream.java delete mode 100644 java/src/Semaphore.java delete mode 100644 java/src/ServiceConfig.java delete mode 100644 java/src/ServiceLoader.java delete mode 100644 java/src/ServiceObject.java delete mode 100644 java/src/ServiceObjectRecord.java delete mode 100644 java/src/ServiceRecord.java delete mode 100644 java/src/ServiceRepository.java delete mode 100644 java/src/StrategyAcceptor.java delete mode 100644 java/src/Stream.java delete mode 100644 java/src/StreamHead.java delete mode 100644 java/src/StreamTail.java delete mode 100644 java/src/SuspendNode.java delete mode 100644 java/src/SvcHandler.java delete mode 100644 java/src/Task.java delete mode 100644 java/src/TaskFlags.java delete mode 100644 java/src/ThreadManager.java delete mode 100644 java/src/ThruTask.java delete mode 100644 java/src/TimeValue.java delete mode 100644 java/src/TimedWait.java delete mode 100644 java/src/TimeoutException.java delete mode 100644 java/src/TimerQueue.java delete mode 100644 java/src/Token.java delete mode 100644 java/tests/ASX/BufferStreamTest.dsp delete mode 100644 java/tests/ASX/BufferStreamTest.java delete mode 100644 java/tests/ASX/Makefile delete mode 100644 java/tests/ASX/MessageQueueTest.dsp delete mode 100644 java/tests/ASX/MessageQueueTest.java delete mode 100644 java/tests/ASX/PriorityBufferTest.dsp delete mode 100644 java/tests/ASX/PriorityBufferTest.java delete mode 100644 java/tests/ASX/TaskTest.dsp delete mode 100644 java/tests/ASX/TaskTest.java delete mode 100644 java/tests/ASX/ThreadPoolTest.dsp delete mode 100644 java/tests/ASX/ThreadPoolTest.java delete mode 100644 java/tests/Concurrency/Condition/Condition.dsp delete mode 100644 java/tests/Concurrency/Condition/Consumer.java delete mode 100644 java/tests/Concurrency/Condition/JoinableThreadGroup.java delete mode 100644 java/tests/Concurrency/Condition/Makefile delete mode 100644 java/tests/Concurrency/Condition/Producer.java delete mode 100644 java/tests/Concurrency/Condition/QueueTest.java delete mode 100644 java/tests/Concurrency/Condition/SimpleMessageQueue.java delete mode 100644 java/tests/Concurrency/Makefile delete mode 100644 java/tests/Concurrency/MutexTest.dsp delete mode 100644 java/tests/Concurrency/MutexTest.java delete mode 100644 java/tests/Concurrency/RWMutexTest.dsp delete mode 100644 java/tests/Concurrency/RWMutexTest.java delete mode 100644 java/tests/Concurrency/SemaphoreTest.dsp delete mode 100644 java/tests/Concurrency/SemaphoreTest.java delete mode 100644 java/tests/Concurrency/TokenTest.dsp delete mode 100644 java/tests/Concurrency/TokenTest.java delete mode 100644 java/tests/Connection/AcceptorTest.dsp delete mode 100644 java/tests/Connection/AcceptorTest.java delete mode 100644 java/tests/Connection/ClientHandler.dsp delete mode 100644 java/tests/Connection/ClientHandler.java delete mode 100644 java/tests/Connection/ConnectorTest.dsp delete mode 100644 java/tests/Connection/ConnectorTest.java delete mode 100644 java/tests/Connection/HTTPHelperTest.java delete mode 100644 java/tests/Connection/Makefile delete mode 100644 java/tests/Connection/ServerHandler.dsp delete mode 100644 java/tests/Connection/ServerHandler.java delete mode 100644 java/tests/Misc/Makefile delete mode 100644 java/tests/Misc/ParseArgsTest.dsp delete mode 100644 java/tests/Misc/ParseArgsTest.java delete mode 100644 java/tests/Reactor/Makefile delete mode 100644 java/tests/Reactor/TimeValueTest.dsp delete mode 100644 java/tests/Reactor/TimeValueTest.java delete mode 100644 java/tests/Reactor/TimerQueueTest.dsp delete mode 100644 java/tests/Reactor/TimerQueueTest.java delete mode 100644 java/tests/SOCK_SAP/Makefile delete mode 100644 java/tests/SOCK_SAP/SOCKAcceptorTest.dsp delete mode 100644 java/tests/SOCK_SAP/SOCKAcceptorTest.java delete mode 100644 java/tests/SOCK_SAP/SOCKConnectorTest.dsp delete mode 100644 java/tests/SOCK_SAP/SOCKConnectorTest.java delete mode 100644 java/tests/ServiceConfigurator/Makefile delete mode 100644 java/tests/ServiceConfigurator/ServiceConfigurator.dsp delete mode 100644 java/tests/ServiceConfigurator/TestService.java delete mode 100644 java/tests/ServiceConfigurator/reloadTest.java delete mode 100644 java/tests/ServiceConfigurator/suspendTest.java delete mode 100644 java/tests/ServiceConfigurator/suspendTest1.conf delete mode 100644 java/tests/ServiceConfigurator/suspendTest2.conf delete mode 100644 java/tests/ServiceConfigurator/suspendTest3.conf delete mode 100644 java/tests/ServiceConfigurator/svc.conf delete mode 100644 java/tests/Tests.dsw delete mode 100644 java/tests/netsvcs/Logger/LoggerTest.java delete mode 100644 java/tests/netsvcs/Logger/Makefile delete mode 100644 java/tests/netsvcs/Naming/ClientTest.java delete mode 100644 java/tests/netsvcs/Naming/Makefile delete mode 100644 ltcf-c.sh delete mode 100644 ltcf-cxx.sh delete mode 100644 m4/ace.m4 delete mode 100644 m4/acinclude.m4 delete mode 100644 m4/compiler.m4 delete mode 100644 m4/features.m4 delete mode 100644 m4/platform.m4 delete mode 100644 m4/subsets.m4 delete mode 100644 m4/threads.m4 delete mode 100644 man/Makefile.am delete mode 100644 man/html/Makefile.am delete mode 100644 man/man3/Makefile.am delete mode 100755 missing delete mode 100755 mkinstalldirs delete mode 100644 netsvcs/ACE-netsvcs.html delete mode 100644 netsvcs/Makefile delete mode 100644 netsvcs/Makefile.am delete mode 100644 netsvcs/Makefile.bor delete mode 100644 netsvcs/README delete mode 100644 netsvcs/build.bor delete mode 100644 netsvcs/clients/Logger/Logger.dsw delete mode 100644 netsvcs/clients/Logger/Makefile delete mode 100644 netsvcs/clients/Logger/Makefile.am delete mode 100644 netsvcs/clients/Logger/Makefile.bor delete mode 100644 netsvcs/clients/Logger/README delete mode 100644 netsvcs/clients/Logger/direct_logging.cpp delete mode 100644 netsvcs/clients/Logger/direct_logging.dsp delete mode 100644 netsvcs/clients/Logger/indirect_logging.cpp delete mode 100644 netsvcs/clients/Logger/indirect_logging.dsp delete mode 100644 netsvcs/clients/Makefile delete mode 100644 netsvcs/clients/Makefile.am delete mode 100644 netsvcs/clients/Makefile.bor delete mode 100644 netsvcs/clients/Naming/Client/Client.dsw delete mode 100644 netsvcs/clients/Naming/Client/Client_Test.cpp delete mode 100644 netsvcs/clients/Naming/Client/Client_Test.dsp delete mode 100644 netsvcs/clients/Naming/Client/Client_Test.h delete mode 100644 netsvcs/clients/Naming/Client/Makefile delete mode 100644 netsvcs/clients/Naming/Client/Makefile.am delete mode 100644 netsvcs/clients/Naming/Client/Makefile.bor delete mode 100644 netsvcs/clients/Naming/Client/README delete mode 100644 netsvcs/clients/Naming/Client/main.cpp delete mode 100644 netsvcs/clients/Naming/Client/main.dsp delete mode 100644 netsvcs/clients/Naming/Client/svc.conf delete mode 100644 netsvcs/clients/Naming/Client/svc2.conf delete mode 100644 netsvcs/clients/Naming/Dump_Restore/Dump_Restore.cpp delete mode 100644 netsvcs/clients/Naming/Dump_Restore/Dump_Restore.h delete mode 100644 netsvcs/clients/Naming/Dump_Restore/Makefile delete mode 100644 netsvcs/clients/Naming/Dump_Restore/Makefile.am delete mode 100644 netsvcs/clients/Naming/Dump_Restore/Makefile.bor delete mode 100644 netsvcs/clients/Naming/Dump_Restore/README delete mode 100644 netsvcs/clients/Naming/Dump_Restore/createfile.cpp delete mode 100644 netsvcs/clients/Naming/Dump_Restore/main.cpp delete mode 100644 netsvcs/clients/Naming/Dump_Restore/nametest.cpp delete mode 100644 netsvcs/clients/Naming/Dump_Restore/nametest.h delete mode 100644 netsvcs/clients/Naming/Makefile delete mode 100644 netsvcs/clients/Naming/Makefile.am delete mode 100644 netsvcs/clients/Naming/Makefile.bor delete mode 100644 netsvcs/clients/README delete mode 100644 netsvcs/clients/Tokens/Makefile delete mode 100644 netsvcs/clients/Tokens/Makefile.am delete mode 100644 netsvcs/clients/Tokens/Makefile.bor delete mode 100644 netsvcs/clients/Tokens/README delete mode 100644 netsvcs/clients/Tokens/collection/Makefile delete mode 100644 netsvcs/clients/Tokens/collection/Makefile.am delete mode 100644 netsvcs/clients/Tokens/collection/Makefile.bor delete mode 100644 netsvcs/clients/Tokens/collection/README delete mode 100644 netsvcs/clients/Tokens/collection/collection.cpp delete mode 100644 netsvcs/clients/Tokens/collection/collection.dsp delete mode 100644 netsvcs/clients/Tokens/collection/collection.dsw delete mode 100644 netsvcs/clients/Tokens/collection/rw_locks.cpp delete mode 100644 netsvcs/clients/Tokens/deadlock/Makefile delete mode 100644 netsvcs/clients/Tokens/deadlock/Makefile.am delete mode 100644 netsvcs/clients/Tokens/deadlock/Makefile.bor delete mode 100644 netsvcs/clients/Tokens/deadlock/README delete mode 100644 netsvcs/clients/Tokens/deadlock/deadlock.dsp delete mode 100644 netsvcs/clients/Tokens/deadlock/deadlock.dsw delete mode 100644 netsvcs/clients/Tokens/deadlock/deadlock_detection_test.cpp delete mode 100644 netsvcs/clients/Tokens/invariant/Makefile delete mode 100644 netsvcs/clients/Tokens/invariant/Makefile.am delete mode 100644 netsvcs/clients/Tokens/invariant/Makefile.bor delete mode 100644 netsvcs/clients/Tokens/invariant/README delete mode 100644 netsvcs/clients/Tokens/invariant/invariant.cpp delete mode 100644 netsvcs/clients/Tokens/invariant/invariant.dsp delete mode 100644 netsvcs/clients/Tokens/invariant/invariant.dsw delete mode 100644 netsvcs/clients/Tokens/manual/Makefile delete mode 100644 netsvcs/clients/Tokens/manual/Makefile.am delete mode 100644 netsvcs/clients/Tokens/manual/Makefile.bor delete mode 100644 netsvcs/clients/Tokens/manual/README delete mode 100644 netsvcs/clients/Tokens/manual/manual.cpp delete mode 100644 netsvcs/clients/Tokens/manual/manual.dsp delete mode 100644 netsvcs/clients/Tokens/manual/manual.dsw delete mode 100644 netsvcs/clients/Tokens/mutex/Makefile delete mode 100644 netsvcs/clients/Tokens/mutex/Makefile.am delete mode 100644 netsvcs/clients/Tokens/mutex/Makefile.bor delete mode 100644 netsvcs/clients/Tokens/mutex/README delete mode 100644 netsvcs/clients/Tokens/mutex/mutex.dsp delete mode 100644 netsvcs/clients/Tokens/mutex/mutex.dsw delete mode 100644 netsvcs/clients/Tokens/mutex/test_mutex.cpp delete mode 100644 netsvcs/clients/Tokens/rw_lock/Makefile delete mode 100644 netsvcs/clients/Tokens/rw_lock/Makefile.am delete mode 100644 netsvcs/clients/Tokens/rw_lock/Makefile.bor delete mode 100644 netsvcs/clients/Tokens/rw_lock/README delete mode 100644 netsvcs/clients/Tokens/rw_lock/rw_lock.dsp delete mode 100644 netsvcs/clients/Tokens/rw_lock/rw_lock.dsw delete mode 100644 netsvcs/clients/Tokens/rw_lock/rw_locks.cpp delete mode 100644 netsvcs/lib/Base_Optimizer.cpp delete mode 100644 netsvcs/lib/Base_Optimizer.h delete mode 100644 netsvcs/lib/Client_Logging_Handler.cpp delete mode 100644 netsvcs/lib/Client_Logging_Handler.h delete mode 100644 netsvcs/lib/Client_Logging_Handler.i delete mode 100644 netsvcs/lib/Log_Message_Receiver.cpp delete mode 100644 netsvcs/lib/Log_Message_Receiver.h delete mode 100644 netsvcs/lib/Logging_Strategy.cpp delete mode 100644 netsvcs/lib/Logging_Strategy.h delete mode 100644 netsvcs/lib/Makefile delete mode 100644 netsvcs/lib/Makefile.am delete mode 100644 netsvcs/lib/Makefile.bor delete mode 100644 netsvcs/lib/Name_Handler.cpp delete mode 100644 netsvcs/lib/Name_Handler.h delete mode 100644 netsvcs/lib/README delete mode 100644 netsvcs/lib/Server_Logging_Handler.cpp delete mode 100644 netsvcs/lib/Server_Logging_Handler.h delete mode 100644 netsvcs/lib/Server_Logging_Handler.i delete mode 100644 netsvcs/lib/Server_Logging_Handler_T.cpp delete mode 100644 netsvcs/lib/Server_Logging_Handler_T.h delete mode 100644 netsvcs/lib/TS_Clerk_Handler.cpp delete mode 100644 netsvcs/lib/TS_Clerk_Handler.h delete mode 100644 netsvcs/lib/TS_Server_Handler.cpp delete mode 100644 netsvcs/lib/TS_Server_Handler.h delete mode 100644 netsvcs/lib/Token_Handler.cpp delete mode 100644 netsvcs/lib/Token_Handler.h delete mode 100644 netsvcs/lib/netsvcs.dsp delete mode 100644 netsvcs/lib/netsvcs.dsw delete mode 100644 netsvcs/netsvcs.dsw delete mode 100644 netsvcs/servers/Makefile delete mode 100644 netsvcs/servers/Makefile.am delete mode 100644 netsvcs/servers/Makefile.bor delete mode 100644 netsvcs/servers/README delete mode 100644 netsvcs/servers/cli.conf delete mode 100644 netsvcs/servers/main.cpp delete mode 100644 netsvcs/servers/ntsvc.conf delete mode 100644 netsvcs/servers/servers.dsp delete mode 100644 netsvcs/servers/servers.dsw delete mode 100644 netsvcs/servers/svc.conf delete mode 100644 os-patches/linux-patches.html delete mode 100644 os-patches/lynxos-patches.html delete mode 100644 os-patches/vxworks-5.1.txt delete mode 100644 performance-tests/Makefile delete mode 100644 performance-tests/Misc/Makefile delete mode 100644 performance-tests/Misc/basic_func.cpp delete mode 100644 performance-tests/Misc/basic_func.h delete mode 100644 performance-tests/Misc/basic_perf.cpp delete mode 100644 performance-tests/Misc/basic_perf.dsp delete mode 100644 performance-tests/Misc/childbirth_time.cpp delete mode 100644 performance-tests/Misc/childbirth_time.dsp delete mode 100644 performance-tests/Misc/context_switch_time.cpp delete mode 100644 performance-tests/Misc/context_switch_time.dsp delete mode 100644 performance-tests/Misc/misc.dsw delete mode 100644 performance-tests/Misc/preempt.cpp delete mode 100644 performance-tests/Misc/test_guard.cpp delete mode 100644 performance-tests/Misc/test_mutex.cpp delete mode 100644 performance-tests/Misc/test_mutex.dsp delete mode 100644 performance-tests/Misc/test_naming.cpp delete mode 100644 performance-tests/Misc/test_naming.dsp delete mode 100644 performance-tests/Misc/test_singleton.cpp delete mode 100644 performance-tests/Misc/test_singleton.dsp delete mode 100644 performance-tests/Misc/test_singleton.h delete mode 100644 performance-tests/README delete mode 100644 performance-tests/RPC/Makefile delete mode 100644 performance-tests/RPC/README delete mode 100644 performance-tests/RPC/client.cpp delete mode 100644 performance-tests/RPC/ping.x delete mode 100644 performance-tests/RPC/server.c delete mode 100644 performance-tests/Server_Concurrency/Latency_Stats.h delete mode 100644 performance-tests/Server_Concurrency/Leader_Follower/Leader_Follower.dsp delete mode 100644 performance-tests/Server_Concurrency/Leader_Follower/Leader_Follower.dsw delete mode 100644 performance-tests/Server_Concurrency/Leader_Follower/Makefile delete mode 100644 performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp delete mode 100644 performance-tests/Server_Concurrency/Makefile delete mode 100644 performance-tests/Server_Concurrency/Queue_Based_Workers/Makefile delete mode 100644 performance-tests/Server_Concurrency/Queue_Based_Workers/Queue_Based_Workers.dsp delete mode 100644 performance-tests/Server_Concurrency/Queue_Based_Workers/Queue_Based_Workers.dsw delete mode 100644 performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp delete mode 100644 performance-tests/Server_Concurrency/Server_Concurrency.dsw delete mode 100755 performance-tests/Server_Concurrency/run_test.sh delete mode 100644 performance-tests/Synch-Benchmarks/Base_Test/Base_Test.dsp delete mode 100644 performance-tests/Synch-Benchmarks/Base_Test/Baseline_Test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Base_Test/Baseline_Test.h delete mode 100644 performance-tests/Synch-Benchmarks/Base_Test/Baseline_Test.i delete mode 100644 performance-tests/Synch-Benchmarks/Base_Test/Makefile delete mode 100644 performance-tests/Synch-Benchmarks/Base_Test/base_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Base_Test/mutex_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Makefile delete mode 100644 performance-tests/Synch-Benchmarks/Makefile.driver delete mode 100644 performance-tests/Synch-Benchmarks/Makefile.synch_tests delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Adaptive_Lock_Performance_Test_Base.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Adaptive_Lock_Performance_Test_Base.h delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Benchmark_Performance.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Benchmark_Performance.h delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Makefile delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Perf_Test.dsp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test.h delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.h delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.i delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/README delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/adaptive_mutex_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/adaptive_recursive_lock_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/adaptive_sema_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/condb_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/conds_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/context_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/guard_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/memory_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/mutex_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/pipe_proc_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/pipe_thr_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/recursive_lock_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/rwrd_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/rwwr_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/sema_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Perf_Test/token_test.cpp delete mode 100644 performance-tests/Synch-Benchmarks/README delete mode 100644 performance-tests/Synch-Benchmarks/Synch_Lib/Benchmark_Base.cpp delete mode 100644 performance-tests/Synch-Benchmarks/Synch_Lib/Benchmark_Base.h delete mode 100644 performance-tests/Synch-Benchmarks/Synch_Lib/Makefile delete mode 100644 performance-tests/Synch-Benchmarks/Synch_Lib/README delete mode 100644 performance-tests/Synch-Benchmarks/Synch_Lib/Synch_Lib.dsp delete mode 100644 performance-tests/Synch-Benchmarks/Synch_Lib/export_mac.h delete mode 100644 performance-tests/Synch-Benchmarks/Synch_Tests.dsp delete mode 100644 performance-tests/Synch-Benchmarks/Synch_Tests.dsw delete mode 100644 performance-tests/Synch-Benchmarks/benchmarks delete mode 100644 performance-tests/Synch-Benchmarks/context.c delete mode 100644 performance-tests/Synch-Benchmarks/context.csh delete mode 100644 performance-tests/Synch-Benchmarks/orig-results delete mode 100644 performance-tests/Synch-Benchmarks/results/.no_prune delete mode 100755 performance-tests/Synch-Benchmarks/run_tests.pl delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/base_acquire.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/base_acquire_read.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/base_acquire_write.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/base_tryacquire.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/base_tryacquire_read.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/base_tryacquire_write.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/perf_t1.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/perf_t16.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/perf_t2.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/perf_t32.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/perf_t4.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/perf_t64.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/perf_t8.conf delete mode 100644 performance-tests/Synch-Benchmarks/svcconf/svc.conf delete mode 100644 performance-tests/Synch-Benchmarks/synch_driver.cpp delete mode 100644 performance-tests/Synch-Benchmarks/synch_driver.dsp delete mode 100644 performance-tests/TCP/Makefile delete mode 100644 performance-tests/TCP/README delete mode 100644 performance-tests/TCP/TCP.dsp delete mode 100644 performance-tests/TCP/TCP.dsw delete mode 100644 performance-tests/TCP/tcp_test.cpp delete mode 100644 performance-tests/TTCP/ACE-C++/How_to_run_tests delete mode 100644 performance-tests/TTCP/ACE-C++/Makefile delete mode 100644 performance-tests/TTCP/ACE-C++/run_test delete mode 100644 performance-tests/TTCP/ACE-C++/wrapper-new-ttcp.cpp delete mode 100644 performance-tests/TTCP/C/How_to_run_tests delete mode 100644 performance-tests/TTCP/C/Makefile delete mode 100644 performance-tests/TTCP/C/README delete mode 100644 performance-tests/TTCP/C/new-ttcp.cpp delete mode 100644 performance-tests/TTCP/C/run_test delete mode 100644 performance-tests/TTCP/Makefile delete mode 100644 performance-tests/UDP/Makefile delete mode 100644 performance-tests/UDP/README delete mode 100644 performance-tests/UDP/udp_test.cpp delete mode 100644 psosim/Makefile delete mode 100644 psosim/drv_conf.c delete mode 100644 rpc++/.dependencies delete mode 100644 rpc++/COPYING delete mode 100644 rpc++/Makefile delete mode 100644 rpc++/Proj.make delete mode 100644 rpc++/README delete mode 100644 rpc++/README.ORIG delete mode 100644 rpc++/StdHdrs/Makefile delete mode 100644 rpc++/StdHdrs/README delete mode 100644 rpc++/StdHdrs/rpc/auth.h delete mode 100644 rpc++/StdHdrs/rpc/c_types.h delete mode 100644 rpc++/StdHdrs/rpc/clnt.h delete mode 100644 rpc++/StdHdrs/rpc/pmap_clnt.h delete mode 100644 rpc++/StdHdrs/rpc/svc.h delete mode 100644 rpc++/StdHdrs/rpc/xdr.h delete mode 100644 rpc++/callback.cc delete mode 100644 rpc++/example/Makefile delete mode 100644 rpc++/example/calcsvc.cc delete mode 100644 rpc++/example/calcsvc.h delete mode 100644 rpc++/example/client.cc delete mode 100644 rpc++/example/server.cc delete mode 100644 rpc++/gcc-2.2.fix delete mode 100644 rpc++/request.cc delete mode 100644 rpc++/rpc++.cp delete mode 100644 rpc++/rpc++.fn delete mode 100644 rpc++/rpc++.ky delete mode 100644 rpc++/rpc++.pg delete mode 100644 rpc++/rpc++.texi delete mode 100644 rpc++/rpc++.toc delete mode 100644 rpc++/rpc++.tp delete mode 100644 rpc++/rpc++.vr delete mode 100644 rpc++/rpc++/callback.h delete mode 100644 rpc++/rpc++/request.h delete mode 100644 rpc++/rpc++/service.h delete mode 100644 rpc++/rpc++/stub.h delete mode 100644 rpc++/rpc++/xdr++.h delete mode 100644 rpc++/service.cc delete mode 100644 rpc++/stub.cc delete mode 100644 rpc++/version.h delete mode 100644 rpc++/xdr++.cc delete mode 100644 tests/ACE_Init_Test.cpp delete mode 100644 tests/ACE_Init_Test.dsp delete mode 100644 tests/ACE_Init_Test.h delete mode 100644 tests/ACE_Init_Test.ico delete mode 100644 tests/ACE_Init_Test.rc delete mode 100644 tests/ACE_Init_Test.rc2 delete mode 100644 tests/ACE_Init_TestDlg.cpp delete mode 100644 tests/ACE_Init_TestDlg.h delete mode 100644 tests/ACE_Init_Test_Resource.h delete mode 100644 tests/ACE_Init_Test_StdAfx.h delete mode 100644 tests/ARGV_Test.cpp delete mode 100644 tests/ARGV_Test.icc delete mode 100644 tests/Aio_Platform_Test.cpp delete mode 100644 tests/Aio_Platform_Test.icc delete mode 100644 tests/Atomic_Op_Test.cpp delete mode 100644 tests/Atomic_Op_Test.dsp delete mode 100644 tests/Atomic_Op_Test.icc delete mode 100644 tests/Auto_IncDec_Test.cpp delete mode 100644 tests/Auto_IncDec_Test.dsp delete mode 100644 tests/Auto_IncDec_Test.icc delete mode 100644 tests/Barrier_Test.cpp delete mode 100644 tests/Barrier_Test.dsp delete mode 100644 tests/Barrier_Test.icc delete mode 100644 tests/Basic_Types_Test.cpp delete mode 100644 tests/Basic_Types_Test.dsp delete mode 100644 tests/Basic_Types_Test.icc delete mode 100644 tests/Buffer_Stream_Test.cpp delete mode 100644 tests/Buffer_Stream_Test.dsp delete mode 100644 tests/Buffer_Stream_Test.icc delete mode 100644 tests/CDR_File_Test.cpp delete mode 100644 tests/CDR_File_Test.dsp delete mode 100644 tests/CDR_File_Test.icc delete mode 100644 tests/CDR_Test.cpp delete mode 100644 tests/CDR_Test.dsp delete mode 100644 tests/CDR_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_Addr_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_Addr_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_CLD_Connector_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_CLD_Connector_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_Con_Acc_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_Con_Acc_Test.h delete mode 100644 tests/CLASSIX/CLASSIX_Con_Acc_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_Group_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_Group_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_Notify_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_Notify_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_OS_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_OS_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_Reactor_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_Reactor_Test.h delete mode 100644 tests/CLASSIX/CLASSIX_Reactor_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_Select_Reactor_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_Select_Reactor_Test.h delete mode 100644 tests/CLASSIX/CLASSIX_Select_Reactor_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_Stream_Test.cpp delete mode 100644 tests/CLASSIX/CLASSIX_Stream_Test.icc delete mode 100644 tests/CLASSIX/CLASSIX_test_config.h delete mode 100644 tests/CLASSIX/Imakefile delete mode 100644 tests/CLASSIX_Addr_Test.icc delete mode 100644 tests/CLASSIX_CLD_Connector_Test.icc delete mode 100644 tests/CLASSIX_Con_Acc_Test.icc delete mode 100644 tests/CLASSIX_Group_Test.icc delete mode 100644 tests/CLASSIX_Notify_Test.icc delete mode 100644 tests/CLASSIX_OS_Test.icc delete mode 100644 tests/CLASSIX_Reactor_Test.icc delete mode 100644 tests/CLASSIX_Select_Reactor_Test.icc delete mode 100644 tests/CLASSIX_Stream_Test.icc delete mode 100644 tests/CPP_Test.cpp delete mode 100644 tests/Cache_Map_Manager_Test.cpp delete mode 100644 tests/Cache_Map_Manager_Test.dsp delete mode 100644 tests/Cache_Map_Manager_Test.h delete mode 100644 tests/Cache_Map_Manager_Test.icc delete mode 100644 tests/Cached_Accept_Conn_Test.cpp delete mode 100644 tests/Cached_Accept_Conn_Test.dsp delete mode 100644 tests/Cached_Accept_Conn_Test.h delete mode 100644 tests/Cached_Accept_Conn_Test.icc delete mode 100644 tests/Cached_Conn_Test.cpp delete mode 100644 tests/Cached_Conn_Test.dsp delete mode 100644 tests/Cached_Conn_Test.h delete mode 100644 tests/Cached_Conn_Test.icc delete mode 100644 tests/Capabilities_Test.cpp delete mode 100644 tests/Capabilities_Test.dsp delete mode 100644 tests/Capabilities_Test.icc delete mode 100644 tests/Collection_Test.cpp delete mode 100644 tests/Collection_Test.dsp delete mode 100644 tests/Collection_Test.icc delete mode 100644 tests/Conn_Test.cpp delete mode 100644 tests/Conn_Test.dsp delete mode 100644 tests/Conn_Test.h delete mode 100644 tests/Conn_Test.icc delete mode 100644 tests/DLL_Test.cpp delete mode 100644 tests/DLL_Test.dsp delete mode 100644 tests/DLL_Test.h delete mode 100644 tests/DLL_Test.icc delete mode 100644 tests/DLList_Test.cpp delete mode 100644 tests/DLList_Test.dsp delete mode 100644 tests/DLList_Test.icc delete mode 100644 tests/Dynamic_Priority_Test.cpp delete mode 100644 tests/Dynamic_Priority_Test.dsp delete mode 100644 tests/Dynamic_Priority_Test.icc delete mode 100644 tests/Enum_Interfaces_Test.cpp delete mode 100644 tests/Enum_Interfaces_Test.dsp delete mode 100644 tests/Enum_Interfaces_Test.icc delete mode 100644 tests/Env_Value_Test.cpp delete mode 100644 tests/Env_Value_Test.dsp delete mode 100644 tests/Env_Value_Test.icc delete mode 100644 tests/FlReactor_Test.cpp delete mode 100644 tests/FlReactor_Test.icc delete mode 100644 tests/Future_Set_Test.cpp delete mode 100644 tests/Future_Set_Test.dsp delete mode 100644 tests/Future_Set_Test.icc delete mode 100644 tests/Future_Test.cpp delete mode 100644 tests/Future_Test.dsp delete mode 100644 tests/Future_Test.icc delete mode 100644 tests/Handle_Set_Test.cpp delete mode 100644 tests/Handle_Set_Test.dsp delete mode 100644 tests/Handle_Set_Test.icc delete mode 100644 tests/Hash_Map_Bucket_Iterator_Test.cpp delete mode 100644 tests/Hash_Map_Bucket_Iterator_Test.dsp delete mode 100644 tests/Hash_Map_Bucket_Iterator_Test.icc delete mode 100644 tests/Hash_Map_Manager_Test.cpp delete mode 100644 tests/Hash_Map_Manager_Test.dsp delete mode 100644 tests/Hash_Map_Manager_Test.icc delete mode 100644 tests/High_Res_Timer_Test.cpp delete mode 100644 tests/High_Res_Timer_Test.dsp delete mode 100644 tests/High_Res_Timer_Test.icc delete mode 100644 tests/IOStream_Test.cpp delete mode 100644 tests/IOStream_Test.dsp delete mode 100644 tests/IOStream_Test.icc delete mode 100644 tests/Lazy_Map_Manager_Test.cpp delete mode 100644 tests/Lazy_Map_Manager_Test.dsp delete mode 100644 tests/Lazy_Map_Manager_Test.icc delete mode 100644 tests/Log_Msg_Test.cpp delete mode 100644 tests/Log_Msg_Test.icc delete mode 100644 tests/MM_Shared_Memory_Test.cpp delete mode 100644 tests/MM_Shared_Memory_Test.dsp delete mode 100644 tests/MM_Shared_Memory_Test.icc delete mode 100644 tests/MT_Reactor_Timer_Test.cpp delete mode 100644 tests/MT_Reactor_Timer_Test.dsp delete mode 100644 tests/MT_Reactor_Timer_Test.h delete mode 100644 tests/MT_Reactor_Timer_Test.icc delete mode 100644 tests/MT_SOCK_Test.cpp delete mode 100644 tests/MT_SOCK_Test.dsp delete mode 100644 tests/MT_SOCK_Test.icc delete mode 100644 tests/Makefile delete mode 100644 tests/Makefile.DLL delete mode 100644 tests/Makefile.am delete mode 100644 tests/Makefile.bor delete mode 100644 tests/Malloc_Test.cpp delete mode 100644 tests/Malloc_Test.dsp delete mode 100644 tests/Malloc_Test.h delete mode 100644 tests/Malloc_Test.icc delete mode 100644 tests/Map_Manager_Test.cpp delete mode 100644 tests/Map_Manager_Test.dsp delete mode 100644 tests/Map_Manager_Test.icc delete mode 100644 tests/Map_Test.cpp delete mode 100644 tests/Map_Test.dsp delete mode 100644 tests/Map_Test.h delete mode 100644 tests/Map_Test.icc delete mode 100644 tests/Mem_Map_Test.cpp delete mode 100644 tests/Mem_Map_Test.dsp delete mode 100644 tests/Mem_Map_Test.icc delete mode 100644 tests/Message_Block_Test.cpp delete mode 100644 tests/Message_Block_Test.dsp delete mode 100644 tests/Message_Block_Test.icc delete mode 100644 tests/Message_Queue_Notifications_Test.cpp delete mode 100644 tests/Message_Queue_Notifications_Test.dsp delete mode 100644 tests/Message_Queue_Notifications_Test.icc delete mode 100644 tests/Message_Queue_Test.cpp delete mode 100644 tests/Message_Queue_Test.dsp delete mode 100644 tests/Message_Queue_Test.icc delete mode 100644 tests/Naming_Test.cpp delete mode 100644 tests/Naming_Test.dsp delete mode 100644 tests/Naming_Test.icc delete mode 100644 tests/New_Fail_Test.cpp delete mode 100644 tests/New_Fail_Test.dsp delete mode 100644 tests/New_Fail_Test.icc delete mode 100644 tests/Notify_Performance_Test.cpp delete mode 100644 tests/Notify_Performance_Test.dsp delete mode 100644 tests/Notify_Performance_Test.icc delete mode 100644 tests/Object_Manager_Test.cpp delete mode 100644 tests/Object_Manager_Test.dsp delete mode 100644 tests/Object_Manager_Test.icc delete mode 100644 tests/OrdMultiSet_Test.cpp delete mode 100644 tests/OrdMultiSet_Test.dsp delete mode 100644 tests/OrdMultiSet_Test.icc delete mode 100644 tests/Pipe_Test.cpp delete mode 100644 tests/Pipe_Test.dsp delete mode 100644 tests/Pipe_Test.icc delete mode 100644 tests/Priority_Buffer_Test.cpp delete mode 100644 tests/Priority_Buffer_Test.dsp delete mode 100644 tests/Priority_Buffer_Test.icc delete mode 100644 tests/Priority_Reactor_Test.cpp delete mode 100644 tests/Priority_Reactor_Test.dsp delete mode 100644 tests/Priority_Reactor_Test.h delete mode 100644 tests/Priority_Reactor_Test.icc delete mode 100644 tests/Priority_Task_Test.cpp delete mode 100644 tests/Priority_Task_Test.dsp delete mode 100644 tests/Priority_Task_Test.icc delete mode 100644 tests/Process_Manager_Test.cpp delete mode 100644 tests/Process_Manager_Test.dsp delete mode 100644 tests/Process_Manager_Test.icc delete mode 100644 tests/Process_Mutex_Test.cpp delete mode 100644 tests/Process_Mutex_Test.dsp delete mode 100644 tests/Process_Mutex_Test.icc delete mode 100644 tests/Process_Strategy_Test.cpp delete mode 100644 tests/Process_Strategy_Test.dsp delete mode 100644 tests/Process_Strategy_Test.h delete mode 100644 tests/Process_Strategy_Test.icc delete mode 100644 tests/Purgable_Map_Manager_Test.cpp delete mode 100644 tests/Purgable_Map_Manager_Test.icc delete mode 100644 tests/RB_Tree_Test.cpp delete mode 100644 tests/RB_Tree_Test.dsp delete mode 100644 tests/RB_Tree_Test.h delete mode 100644 tests/RB_Tree_Test.icc delete mode 100644 tests/README delete mode 100644 tests/Reactor_Exceptions_Test.cpp delete mode 100644 tests/Reactor_Exceptions_Test.dsp delete mode 100644 tests/Reactor_Exceptions_Test.icc delete mode 100644 tests/Reactor_Notify_Test.cpp delete mode 100644 tests/Reactor_Notify_Test.dsp delete mode 100644 tests/Reactor_Notify_Test.icc delete mode 100644 tests/Reactor_Performance_Test.cpp delete mode 100644 tests/Reactor_Performance_Test.dsp delete mode 100644 tests/Reactor_Performance_Test.h delete mode 100644 tests/Reactor_Performance_Test.icc delete mode 100644 tests/Reactor_Timer_Test.cpp delete mode 100644 tests/Reactor_Timer_Test.dsp delete mode 100644 tests/Reactor_Timer_Test.icc delete mode 100644 tests/Reactors_Test.cpp delete mode 100644 tests/Reactors_Test.dsp delete mode 100644 tests/Reactors_Test.icc delete mode 100644 tests/Reader_Writer_Test.cpp delete mode 100644 tests/Reader_Writer_Test.dsp delete mode 100644 tests/Reader_Writer_Test.icc delete mode 100644 tests/Recursive_Mutex_Test.cpp delete mode 100644 tests/Recursive_Mutex_Test.dsp delete mode 100644 tests/Recursive_Mutex_Test.icc delete mode 100644 tests/Reverse_Lock_Test.cpp delete mode 100644 tests/Reverse_Lock_Test.dsp delete mode 100644 tests/Reverse_Lock_Test.icc delete mode 100644 tests/SOCK_Connector_Test.cpp delete mode 100644 tests/SOCK_Connector_Test.dsp delete mode 100644 tests/SOCK_Connector_Test.icc delete mode 100644 tests/SOCK_Send_Recv_Test.cpp delete mode 100644 tests/SOCK_Send_Recv_Test.dsp delete mode 100644 tests/SOCK_Send_Recv_Test.icc delete mode 100644 tests/SOCK_Test.cpp delete mode 100644 tests/SOCK_Test.dsp delete mode 100644 tests/SOCK_Test.icc delete mode 100644 tests/SPIPE_Test.cpp delete mode 100644 tests/SPIPE_Test.dsp delete mode 100644 tests/SPIPE_Test.icc delete mode 100644 tests/SString_Test.cpp delete mode 100644 tests/SString_Test.dsp delete mode 100644 tests/SString_Test.icc delete mode 100644 tests/SV_Shared_Memory_Test.cpp delete mode 100644 tests/SV_Shared_Memory_Test.dsp delete mode 100644 tests/SV_Shared_Memory_Test.icc delete mode 100644 tests/Semaphore_Test.cpp delete mode 100644 tests/Semaphore_Test.dsp delete mode 100644 tests/Semaphore_Test.icc delete mode 100644 tests/Service_Config_Test.cpp delete mode 100644 tests/Service_Config_Test.dsp delete mode 100644 tests/Service_Config_Test.icc delete mode 100644 tests/Shared_Memory_SV_Test.cpp delete mode 100644 tests/Signal_Test.cpp delete mode 100644 tests/Signal_Test.icc delete mode 100644 tests/Sigset_Ops_Test.cpp delete mode 100644 tests/Sigset_Ops_Test.dsp delete mode 100644 tests/Sigset_Ops_Test.icc delete mode 100644 tests/Simple_Message_Block_Test.cpp delete mode 100644 tests/Simple_Message_Block_Test.dsp delete mode 100644 tests/Simple_Message_Block_Test.icc delete mode 100644 tests/Svc_Handler_Test.cpp delete mode 100644 tests/Svc_Handler_Test.dsp delete mode 100644 tests/Svc_Handler_Test.icc delete mode 100644 tests/TSS_Test.cpp delete mode 100644 tests/TSS_Test.dsp delete mode 100644 tests/TSS_Test.icc delete mode 100644 tests/TSS_Test_Errno.h delete mode 100644 tests/Task_Test.cpp delete mode 100644 tests/Task_Test.dsp delete mode 100644 tests/Task_Test.icc delete mode 100644 tests/Thread_Manager_Test.cpp delete mode 100644 tests/Thread_Manager_Test.dsp delete mode 100644 tests/Thread_Manager_Test.icc delete mode 100644 tests/Thread_Mutex_Test.cpp delete mode 100644 tests/Thread_Mutex_Test.dsp delete mode 100644 tests/Thread_Mutex_Test.icc delete mode 100644 tests/Thread_Pool_Reactor_Test.cpp delete mode 100644 tests/Thread_Pool_Reactor_Test.dsp delete mode 100644 tests/Thread_Pool_Reactor_Test.h delete mode 100644 tests/Thread_Pool_Reactor_Test.icc delete mode 100644 tests/Thread_Pool_Test.cpp delete mode 100644 tests/Thread_Pool_Test.dsp delete mode 100644 tests/Thread_Pool_Test.icc delete mode 100644 tests/Time_Service_Test.cpp delete mode 100644 tests/Time_Service_Test.dsp delete mode 100644 tests/Time_Service_Test.icc delete mode 100644 tests/Time_Value_Test.cpp delete mode 100644 tests/Time_Value_Test.dsp delete mode 100644 tests/Time_Value_Test.icc delete mode 100644 tests/Timeprobe_Test.cpp delete mode 100644 tests/Timeprobe_Test.dsp delete mode 100644 tests/Timeprobe_Test.icc delete mode 100644 tests/Timer_Queue_Test.cpp delete mode 100644 tests/Timer_Queue_Test.dsp delete mode 100644 tests/Timer_Queue_Test.icc delete mode 100644 tests/TkReactor_Test.cpp delete mode 100644 tests/TkReactor_Test.icc delete mode 100644 tests/TkReactor_Test.tcl delete mode 100644 tests/Tokens_Test.cpp delete mode 100644 tests/Tokens_Test.dsp delete mode 100644 tests/Tokens_Test.icc delete mode 100644 tests/UNIXclerk.conf delete mode 100644 tests/UNIXserver.conf delete mode 100644 tests/UNIXtokens.conf delete mode 100644 tests/UPIPE_SAP_Test.cpp delete mode 100644 tests/UPIPE_SAP_Test.dsp delete mode 100644 tests/UPIPE_SAP_Test.icc delete mode 100644 tests/Upgradable_RW_Test.cpp delete mode 100644 tests/Upgradable_RW_Test.dsp delete mode 100644 tests/Upgradable_RW_Test.h delete mode 100644 tests/Upgradable_RW_Test.icc delete mode 100644 tests/Win32clerk.conf delete mode 100644 tests/Win32server.conf delete mode 100644 tests/Win32tokens.conf delete mode 100644 tests/WinCE/Atomic_Op_Test.dsp delete mode 100644 tests/WinCE/Barrier_Test.dsp delete mode 100644 tests/WinCE/Basic_Types_Test.dsp delete mode 100644 tests/WinCE/Buffer_Stream_Test.dsp delete mode 100644 tests/WinCE/Conn_Test.dsp delete mode 100644 tests/WinCE/DLL_Test.dsp delete mode 100644 tests/WinCE/Enum_Interfaces_Test.dsp delete mode 100644 tests/WinCE/Future_Test.dsp delete mode 100644 tests/WinCE/Handle_Set_Test.dsp delete mode 100644 tests/WinCE/Hash_Map_Manager_Test.dsp delete mode 100644 tests/WinCE/MT_Reactor_Timer_Test.dsp delete mode 100644 tests/WinCE/MT_SOCK_Test.dsp delete mode 100644 tests/WinCE/Map_Manager_Test.dsp delete mode 100644 tests/WinCE/Mem_Map_Test.dsp delete mode 100644 tests/WinCE/Message_Block_Test.dsp delete mode 100644 tests/WinCE/Message_Queue_Notifications_Test.dsp delete mode 100644 tests/WinCE/Message_Queue_Test.dsp delete mode 100644 tests/WinCE/Notify_Performance_Test.dsp delete mode 100644 tests/WinCE/OrdMultiSet_Test.dsp delete mode 100644 tests/WinCE/Priority_Buffer_Test.dsp delete mode 100644 tests/WinCE/Priority_Task_Test.dsp delete mode 100644 tests/WinCE/Reactor_Exceptions_Test.dsp delete mode 100644 tests/WinCE/Reactor_Notify_Test.dsp delete mode 100644 tests/WinCE/Reactor_Performance_Test.dsp delete mode 100644 tests/WinCE/Reactor_Timer_Test.dsp delete mode 100644 tests/WinCE/Reactors_Test.dsp delete mode 100644 tests/WinCE/Reader_Writer_Test.dsp delete mode 100644 tests/WinCE/Recursive_Mutex_Test.dsp delete mode 100644 tests/WinCE/SOCK_Connector_Test.dsp delete mode 100644 tests/WinCE/SOCK_Test.dsp delete mode 100644 tests/WinCE/SString_Test.dsp delete mode 100644 tests/WinCE/Semaphore_Test.dsp delete mode 100644 tests/WinCE/Sigset_Ops_Test.dsp delete mode 100644 tests/WinCE/Simple_Message_Block_Test.dsp delete mode 100644 tests/WinCE/TSS_Test.dsp delete mode 100644 tests/WinCE/Task_Test.dsp delete mode 100644 tests/WinCE/Thread_Manager_Test.dsp delete mode 100644 tests/WinCE/Thread_Mutex_Test.dsp delete mode 100644 tests/WinCE/Thread_Pool_Test.dsp delete mode 100644 tests/WinCE/Time_Value_Test.dsp delete mode 100644 tests/WinCE/Timer_Queue_Test.dsp delete mode 100644 tests/WinCE/ce_tests.dsw delete mode 100644 tests/XtReactor_Test.cpp delete mode 100644 tests/XtReactor_Test.icc delete mode 100644 tests/icc.bat delete mode 100644 tests/libDLL_Test.icc delete mode 100644 tests/log/Makefile.am delete mode 100755 tests/makeicc.pl delete mode 100644 tests/pharlap/Atomic_Op_Test.dsp delete mode 100644 tests/pharlap/Auto_IncDec_Test.dsp delete mode 100644 tests/pharlap/Barrier_Test.dsp delete mode 100644 tests/pharlap/Basic_Types_Test.dsp delete mode 100644 tests/pharlap/Buffer_Stream_Test.dsp delete mode 100644 tests/pharlap/CDR_File_Test.dsp delete mode 100644 tests/pharlap/CDR_Test.dsp delete mode 100644 tests/pharlap/Cache_Map_Manager_Test.dsp delete mode 100644 tests/pharlap/Cached_Accept_Conn_Test.dsp delete mode 100644 tests/pharlap/Cached_Conn_Test.dsp delete mode 100644 tests/pharlap/Capabilities_Test.dsp delete mode 100644 tests/pharlap/Collection_Test.dsp delete mode 100644 tests/pharlap/Conn_Test.dsp delete mode 100644 tests/pharlap/DLList_Test.dsp delete mode 100644 tests/pharlap/Dynamic_Priority_Test.dsp delete mode 100644 tests/pharlap/Enum_Interfaces_Test.dsp delete mode 100644 tests/pharlap/Env_Value_Test.dsp delete mode 100644 tests/pharlap/Future_Set_Test.dsp delete mode 100644 tests/pharlap/Future_Test.dsp delete mode 100644 tests/pharlap/Handle_Set_Test.dsp delete mode 100644 tests/pharlap/Hash_Map_Bucket_Iterator_Test.dsp delete mode 100644 tests/pharlap/Hash_Map_Manager_Test.dsp delete mode 100644 tests/pharlap/High_Res_Timer_Test.dsp delete mode 100644 tests/pharlap/IOStream_Test.dsp delete mode 100644 tests/pharlap/Lazy_Map_Manager_Test.dsp delete mode 100644 tests/pharlap/MM_Shared_Memory_Test.dsp delete mode 100644 tests/pharlap/MT_Reactor_Timer_Test.dsp delete mode 100644 tests/pharlap/MT_SOCK_Test.dsp delete mode 100644 tests/pharlap/Malloc_Test.dsp delete mode 100644 tests/pharlap/Map_Manager_Test.dsp delete mode 100644 tests/pharlap/Map_Test.dsp delete mode 100644 tests/pharlap/Mem_Map_Test.dsp delete mode 100644 tests/pharlap/Message_Block_Test.dsp delete mode 100644 tests/pharlap/Message_Queue_Notifications_Test.dsp delete mode 100644 tests/pharlap/Message_Queue_Test.dsp delete mode 100644 tests/pharlap/Naming_Test.dsp delete mode 100644 tests/pharlap/New_Fail_Test.dsp delete mode 100644 tests/pharlap/Notify_Performance_Test.dsp delete mode 100644 tests/pharlap/Object_Manager_Test.dsp delete mode 100644 tests/pharlap/OrdMultiSet_Test.dsp delete mode 100644 tests/pharlap/Pipe_Test.dsp delete mode 100644 tests/pharlap/Priority_Buffer_Test.dsp delete mode 100644 tests/pharlap/Priority_Reactor_Test.dsp delete mode 100644 tests/pharlap/Priority_Task_Test.dsp delete mode 100644 tests/pharlap/Process_Manager_Test.dsp delete mode 100644 tests/pharlap/Process_Mutex_Test.dsp delete mode 100644 tests/pharlap/Process_Strategy_Test.dsp delete mode 100644 tests/pharlap/RB_Tree_Test.dsp delete mode 100644 tests/pharlap/Reactor_Exceptions_Test.dsp delete mode 100644 tests/pharlap/Reactor_Notify_Test.dsp delete mode 100644 tests/pharlap/Reactor_Performance_Test.dsp delete mode 100644 tests/pharlap/Reactor_Timer_Test.dsp delete mode 100644 tests/pharlap/Reactors_Test.dsp delete mode 100644 tests/pharlap/Reader_Writer_Test.dsp delete mode 100644 tests/pharlap/Recursive_Mutex_Test.dsp delete mode 100644 tests/pharlap/Reverse_Lock_Test.dsp delete mode 100644 tests/pharlap/SOCK_Connector_Test.dsp delete mode 100644 tests/pharlap/SOCK_Send_Recv_Test.dsp delete mode 100644 tests/pharlap/SOCK_Test.dsp delete mode 100644 tests/pharlap/SPIPE_Test.dsp delete mode 100644 tests/pharlap/SString_Test.dsp delete mode 100644 tests/pharlap/SV_Shared_Memory_Test.dsp delete mode 100644 tests/pharlap/Semaphore_Test.dsp delete mode 100644 tests/pharlap/Service_Config_Test.dsp delete mode 100644 tests/pharlap/Sigset_Ops_Test.dsp delete mode 100644 tests/pharlap/Simple_Message_Block_Test.dsp delete mode 100644 tests/pharlap/Svc_Handler_Test.dsp delete mode 100644 tests/pharlap/TSS_Test.dsp delete mode 100644 tests/pharlap/Task_Test.dsp delete mode 100644 tests/pharlap/Thread_Manager_Test.dsp delete mode 100644 tests/pharlap/Thread_Mutex_Test.dsp delete mode 100644 tests/pharlap/Thread_Pool_Reactor_Test.dsp delete mode 100644 tests/pharlap/Thread_Pool_Test.dsp delete mode 100644 tests/pharlap/Time_Service_Test.dsp delete mode 100644 tests/pharlap/Time_Value_Test.dsp delete mode 100644 tests/pharlap/Timeprobe_Test.dsp delete mode 100644 tests/pharlap/Timer_Queue_Test.dsp delete mode 100644 tests/pharlap/Tokens_Test.dsp delete mode 100644 tests/pharlap/UPIPE_SAP_Test.dsp delete mode 100644 tests/pharlap/Upgradable_RW_Test.dsp delete mode 100644 tests/pharlap/pharlap_tests.dsw delete mode 100755 tests/pharlap/run_pharlap_tests.bat delete mode 100644 tests/run_tests.bat delete mode 100755 tests/run_tests.check delete mode 100755 tests/run_tests.ksh delete mode 100644 tests/run_tests.lst delete mode 100755 tests/run_tests.pl delete mode 100755 tests/run_tests.psosim delete mode 100755 tests/run_tests.sh delete mode 100644 tests/run_tests.vxworks delete mode 100644 tests/t.icc delete mode 100644 tests/test_config.h delete mode 100644 tests/tests.dsw delete mode 100644 tests/tests_pharlap_msvc.lnk delete mode 100644 tests/vacpp_setup.icc delete mode 100644 tests/version_tests/ACE_Init_Test.dsp delete mode 100644 tests/version_tests/Atomic_Op_Test.dsp delete mode 100644 tests/version_tests/Auto_IncDec_Test.dsp delete mode 100644 tests/version_tests/Barrier_Test.dsp delete mode 100644 tests/version_tests/Basic_Types_Test.dsp delete mode 100644 tests/version_tests/Buffer_Stream_Test.dsp delete mode 100644 tests/version_tests/CDR_File_Test.dsp delete mode 100644 tests/version_tests/CDR_Test.dsp delete mode 100644 tests/version_tests/Cache_Map_Manager_Test.dsp delete mode 100644 tests/version_tests/Cached_Accept_Conn_Test.dsp delete mode 100644 tests/version_tests/Cached_Conn_Test.dsp delete mode 100644 tests/version_tests/Capabilities_Test.dsp delete mode 100644 tests/version_tests/Collection_Test.dsp delete mode 100644 tests/version_tests/Conn_Test.dsp delete mode 100644 tests/version_tests/DLL_Test.dsp delete mode 100644 tests/version_tests/DLList_Test.dsp delete mode 100644 tests/version_tests/Dynamic_Priority_Test.dsp delete mode 100644 tests/version_tests/Enum_Interfaces_Test.dsp delete mode 100644 tests/version_tests/Env_Value_Test.dsp delete mode 100644 tests/version_tests/Future_Set_Test.dsp delete mode 100644 tests/version_tests/Future_Test.dsp delete mode 100644 tests/version_tests/Handle_Set_Test.dsp delete mode 100644 tests/version_tests/Hash_Map_Bucket_Iterator_Test.dsp delete mode 100644 tests/version_tests/Hash_Map_Manager_Test.dsp delete mode 100644 tests/version_tests/High_Res_Timer_Test.dsp delete mode 100644 tests/version_tests/IOStream_Test.dsp delete mode 100644 tests/version_tests/Lazy_Map_Manager_Test.dsp delete mode 100644 tests/version_tests/MM_Shared_Memory_Test.dsp delete mode 100644 tests/version_tests/MT_Reactor_Timer_Test.dsp delete mode 100644 tests/version_tests/MT_SOCK_Test.dsp delete mode 100644 tests/version_tests/Malloc_Test.dsp delete mode 100644 tests/version_tests/Map_Manager_Test.dsp delete mode 100644 tests/version_tests/Map_Test.dsp delete mode 100644 tests/version_tests/Mem_Map_Test.dsp delete mode 100644 tests/version_tests/Message_Block_Test.dsp delete mode 100644 tests/version_tests/Message_Queue_Notifications_Test.dsp delete mode 100644 tests/version_tests/Message_Queue_Test.dsp delete mode 100644 tests/version_tests/Naming_Test.dsp delete mode 100644 tests/version_tests/New_Fail_Test.dsp delete mode 100644 tests/version_tests/Notify_Performance_Test.dsp delete mode 100644 tests/version_tests/Object_Manager_Test.dsp delete mode 100644 tests/version_tests/OrdMultiSet_Test.dsp delete mode 100644 tests/version_tests/Pipe_Test.dsp delete mode 100644 tests/version_tests/Priority_Buffer_Test.dsp delete mode 100644 tests/version_tests/Priority_Reactor_Test.dsp delete mode 100644 tests/version_tests/Priority_Task_Test.dsp delete mode 100644 tests/version_tests/Process_Manager_Test.dsp delete mode 100644 tests/version_tests/Process_Mutex_Test.dsp delete mode 100644 tests/version_tests/Process_Strategy_Test.dsp delete mode 100644 tests/version_tests/RB_Tree_Test.dsp delete mode 100644 tests/version_tests/Reactor_Exception_Test.dsp delete mode 100644 tests/version_tests/Reactor_Notify_Test.dsp delete mode 100644 tests/version_tests/Reactor_Performance_Test.dsp delete mode 100644 tests/version_tests/Reactor_Timer_Test.dsp delete mode 100644 tests/version_tests/Reactors_Test.dsp delete mode 100644 tests/version_tests/Reader_Writer_Test.dsp delete mode 100644 tests/version_tests/Recursive_Mutex_Test.dsp delete mode 100644 tests/version_tests/Reverse_Lock_Test.dsp delete mode 100644 tests/version_tests/SOCK_Connector_Test.dsp delete mode 100644 tests/version_tests/SOCK_Send_Recv_Test.dsp delete mode 100644 tests/version_tests/SOCK_Test.dsp delete mode 100644 tests/version_tests/SPIPE_Test.dsp delete mode 100644 tests/version_tests/SString_Test.dsp delete mode 100644 tests/version_tests/SV_Shared_Memory_Test.dsp delete mode 100644 tests/version_tests/Semaphore_Test.dsp delete mode 100644 tests/version_tests/Service_Config_Test.dsp delete mode 100644 tests/version_tests/Sigset_Op_Test.dsp delete mode 100644 tests/version_tests/Simple_Message_Block_Test.dsp delete mode 100644 tests/version_tests/Svc_Handler_Test.dsp delete mode 100644 tests/version_tests/TSS_Test.dsp delete mode 100644 tests/version_tests/Task_Test.dsp delete mode 100644 tests/version_tests/Thread_Manager_Test.dsp delete mode 100644 tests/version_tests/Thread_Mutex_Test.dsp delete mode 100644 tests/version_tests/Thread_Pool_Reactor_Test.dsp delete mode 100644 tests/version_tests/Thread_Pool_Test.dsp delete mode 100644 tests/version_tests/Time_Service_Test.dsp delete mode 100644 tests/version_tests/Time_Value_Test.dsp delete mode 100644 tests/version_tests/Timeprobe_Test.dsp delete mode 100644 tests/version_tests/Timer_Queue_Test.dsp delete mode 100644 tests/version_tests/Tokens_Test.dsp delete mode 100644 tests/version_tests/UPIPE_SAP_Test.dsp delete mode 100644 tests/version_tests/Upgradable_RW_Test.dsp delete mode 100755 tests/version_tests/run_all_tests.bat delete mode 100644 tests/version_tests/version_tests.dsw delete mode 100644 websvcs/Makefile delete mode 100644 websvcs/README delete mode 100644 websvcs/lib/Makefile delete mode 100644 websvcs/lib/URL_Addr.cpp delete mode 100644 websvcs/lib/URL_Addr.h delete mode 100644 websvcs/lib/URL_Addr.i delete mode 100644 websvcs/lib/websvcs.dsp delete mode 100644 websvcs/lib/websvcs.dsw delete mode 100644 websvcs/lib/websvcs_export.h delete mode 100644 websvcs/tests/Makefile delete mode 100644 websvcs/tests/Test_URL_Addr.cpp delete mode 100644 websvcs/tests/Test_URL_Addr.dsp delete mode 100644 websvcs/tests/tests.dsw delete mode 100644 websvcs/websvcs.dsw diff --git a/ACE-INSTALL.html b/ACE-INSTALL.html deleted file mode 100644 index 84b1640bbab..00000000000 --- a/ACE-INSTALL.html +++ /dev/null @@ -1,2086 +0,0 @@ - - - - - Building and Installing ACE and Its Network Services - - - - - -
-

Building and Installing ACE and Its Network Services

- -

Synopsis

- -The file explains how to build and install ACE and its Network -Services on the various OS platforms and compilers that it has been -ported to. Please consult the ChangeLog file -to see whether any recent changes to the release will affect your -code. You also might want to read the ACE FAQ before -building and installing ACE. In addition, you might want to check out -our development -process, as well. And as you start working with ACE, you might -want to consult the ACE Frequently Made -Mistakes page. If you encounter any problems or would like to request -an enhancement, then use our -bug tracking system to submit a report.

- - -

Document Index

- - - - -


-

Supported Platforms and C++ Compilers

- - - -

The following table summarizes platforms on which ACE runs:

- - - - - - - - - - - - - - - - - - -
Fully supported, i.e., continually tested and used dailySolaris 2.5, 2.6, and 7, Windows NT 4.0 (MSVC++ 5.0, and 6.0), - Linux/Intel, Linux/Alpha, VxWorks, LynxOS, Digital UNIX 4.0 and 5.0, - HP/UX 10.x and 11.x, AIX 4.x, IRIX 6.x, and QNX Neutrino 2.0 -
Nearly fully supported, i.e., periodically testedWindows 95, MVS, DEC Alpha Windows NT (MSVC++ 5.0, 6.0), Chorus, - PharLap TNT Embedded ToolSuite 9.1 -
Partially supported, i.e., infrequently tested Windows NT (Borland C++ Builder 4.0 and IBM VisualAge C++), - Windows CE, Tandem, SCO, UnixWare, SunOS 4.x, FreeBSD, NetBSD, - Linux/PPC. -
Planned support, i.e., pending pSoS,
- -

Any UNIX/POSIX/Win32 variation is a potential target platform for -TAO. If you have porting -questions or have a problem compiling the ACE wrappers on the -platforms shown above please send email to either ACE Newsgroup or the ACE mailing list and we'll -try to help you fix the problems. - - -


-

Installation Notes for Supported Platforms

- - - - -
-

Compiling ACE with GNU g++

- -If you use the GNU GCC g++ compiler please note the following: - - - - -


-

Compiling ACE with egcs

- - - -


-

Building and Installing ACE

- -The following explains how to build ACE on UNIX -and Win32. - -

General Rules

- - -
-

Building and Installing ACE on UNIX

- -Building and installing ACE on UNIX is relatively simple (the process for Win32 is different). Here's what you -need to do:

- -

    -
  1. Install GNU make - 3.7 or greater on your system (available via - anonymous ftp from prep.ai.mit.edu in the pub/gnu/make/ directory). - You must use GNU make or ACE won't compile.

    - -

  2. Add an environment variable called ACE_ROOT that contains the - name of the root of the directory where you keep the ACE wrapper - source tree. The ACE recursive Makefile scheme needs this information. - There are several ways to set the ACE_ROOT variable. For - instance, in my .login file I have the following entry:

    - -

    
    -      % setenv ACE_ROOT /home/cs/faculty/schmidt/ACE_wrappers
    -      

    - - However, if you're building a number of versions of ACE, e.g., for - different OS platforms or for different releases of ACE, you might use - the following approach: - -

    
    -      % setenv ACE_ROOT $cwd
    -      
    - -
  3. Edit the $ACE_ROOT/ace/OS.h file to update things like default - hostname and port numbers you'd like the programs in the - $ACE_ROOT/{apps,tests} directories to use by default. Note, - however that you can normally skip this step because the - defaults are typically fine for most systems.

    - -

  4. Create (via ln -s or cp) a - $ACE_ROOT/ace/config.h - file that contains the appropriate platform/compiler-specific - header configurations, e.g., -
    
    -% ln -s config-sunos5-sunc++-4.x.h config.h
    -
    - This file - contains the #defines that are used throughout ACE to indicate - which features your system supports (see the - $ACE_ROOT/ace/OS.h file for many examples of how - the ACE build configuration is affected by these macro - settings). Make sure you settings are placed - before the inclusion of the platform-specific - header file.

    - - There are config files for most versions of UNIX. If there - isn't a version of this file that matches your - platform/compiler, you'll need to make one. Please send me - email if you get it working so I can add it to the master ACE - release.

    - -

  5. Create (via ln -s or cp) a - $ACE_ROOT/include/makeinclude/platform_macros.GNU file - that contains the appropriate platform/compiler-specific - Makefile configurations, e.g., -
    
    -% ln -s platform_sunos5_sunc++.GNU platform_macros.GNU
    -
    - This file - contains the compiler and Makefile directives that are - platform/compiler-specific

    - -

  6. Note that because ACE builds shared libraries, you'll need to set - LD_LIBRARY_PATH to whereever you put the binary version of the - ACE library. For example, you probably want to do something - like the following

    - -

    
    -      % setenv LD_LIBRARY_PATH $ACE_ROOT/ace:$LD_LIBRARY_PATH
    -      

    - -

  7. When all this is done, hopefully all you'll need to do is type:

    - -

    
    -      % make
    -      

    - - at the root of the ACE source tree. This will build the ACE - library, tests, the examples, and the sample applications. - Building the entire ACE release can take a long time and consume - lots of disk space, however. Therefore, you might consider - cd'ing into the $ACE_ROOT/ace/ directory and - running make there to build just the ACE library. - As a sanity check, you might also want to build and run the - automated ``one-button'' tests in $ACE_ROOT/tests/. Finally, if you're also - planning on building TAO, you - should build the gperf - perfect hash function generator application in $ACE_ROOT/apps/gperf/.

    - -

  8. If you need to regenerate the Svc_Conf_y.cpp file, you'll need to - get Berkeley - YACC. However, you should rarely, if ever, need to do this.

    - -

- - -


-

Building and Installing ACE on Win32

- -First, if you are upgrading from an older release, clean up everything -and rebuild from scratch to ensure that everything is rebuilt -correctly. You might have to manually go through the ACE directories -and delete all *.obj, *.dll, *.lib, *.ilk, *.pdb, *.idb, *.ncb, *.opt, -and *.exp files in order to start over from scratch (the Clean command -in MSVC may not do this).

- -ACE contains project files for Microsoft Visual C++ 5.0 or later -(*.dsw), Borland C++ 5.x (ace.ide), IBM's VisualAge C++ compiler -(*.icc). There are also Makefile.bor files to compile ACE, the ACE -one-button tests, and TAO with Borland C++ Builder 4.0.

- -The Borland C++ Builder 4.0 port has been done by Jody Hagins and Christopher Kohlhoff. By -default, the ACE/TAO libraries built for Borland C++ Builder are -intended for use with generic console or windows applications and they -link against the corresponding C++ runtime library. Applications -created using BCB's RAD environment, such as ChatClient, must link -against the VCL-compatible (ie pascal-compatible) runtime library. To -tell the difference between these libraries the VCL-compatible ones -have a 'p' in the suffix (i.e., 'p' for pascal). To build VCL -compatible libraries try -


-make -f Makefile.bor -DPASCAL
-
- -Please see http://www.tenermerx.com/tao_bcb/index.html -for more information on building ACE+TAO with Borland C++ Builder.

- -Note concerning MSVC 5.0 and Service Pack 3: There has been -confusion regarding MSVC 5 and its Service Pack 3. Some ACE users -have, in the past, had problems with SP3 that were not present in SP2. -Thanks to the diligent efforts of Bill Fulton, the -mystery appears to be solved. The key? (Oh, this is a good one...) -It would appear that there are actually multiple versions of SP3 in -existence. The earlier ones have the bug, while later ones have it -fixed. The service pack downloadable from Microsoft's web site as of -June 16, 1998 works fine. The CD containing SP3, if it has part -number X03-50158 on the disc (the part number on the jacket is -probably different), also works fine.

- -So, if you are experiencing problems with SP3, get a newer one - it'll -probably work. Sheesh...

- -We no longer actively support MSVC 4.x. ACE might work with the -compiler but not without some work.

- -Note, however, that regardless of the version of SP3, there are some -STL bugs in SP3 which you should get corrected. Please see http://www.dinkumware.com/vc_fixes.html -for details. Thank you to Ben Eng -for the pointer to the STL fixes. - -

    -
  1. Uncompress the ACE distribution into a directory, where it will create a - ACE_wrappers directory containing the distribution. The ACE_wrappers - directory will be referred to as ACE_ROOT in the following steps -- so - ACE_ROOT\ace would be C:\ACE_wrappers\ace if you uncompressed into the - root directory.
    -
    -
  2. Create a file called config.h in the ACE_ROOT\ace - directory that contains:
    -
    - #include "ace/config-win32.h"
    -
    -
  3. Now load up the project file for ACE (ACE_ROOT\ace\ACE_Library.mdp or - ACE_ROOT\ace\ace.dsw).

    -
  4. Each project will contain 8 different configurations. These - are a mixture of Debug/Release, Unicode/non-Unicode, and - Static/Dynamic library versions for both i386 and Alpha machines. - Make sure you are building the one you'll use. All these - different configurations are provided for your convenience. You - can either adopt the scheme to build your applications with - different configurations, or use ace/config.h to - tweak with the default settings on NT. - Note: If you - use the dynamic libraries, make sure you include ACE_ROOT\bin - in your PATH whenever you run programs that use ACE.

    -
  5. If you are building for Windows NT then you can start building - now. If you are building on Windows 95 or Windows 98, then you - should add the line
    -
    - #define ACE_HAS_WINNT4 0
    -
    - before the #include statement in ACE_ROOT\ace\config.h and it - will turn off Windows NT 4 specific code.
    -
    -
  6. If you want to use the standard C++ headers (iostream, cstdio, ... - as defined by the C++ Standard Draft 2) that comes with MSVC 5, - then add the line
    -
    - #define ACE_HAS_STANDARD_CPP_LIBRARY 1
    -
    - before the #include statement in ACE_ROOT\ace\config.h.
    -
    -
  7. To use ACE with MFC libraries, also add the following to - your config.h file. Notice that if you want to - spawn a new thread with CWinThread, make sure you spawn the - thread with THR_USE_AFX flag set.
    -
    - #define ACE_HAS_MFC 1
    -
    - By default, all ACE examples use DLL version of run-time libraries - regardless you are building DLL or static version of ACE. You - can still choose to link ACE statically or dynamically - regardless of run-time libraries. The reason of choosing to - link run-time library dynamically is almost every NT box has - these library installed and to save disk space. If - you prefer to link MFC as a static library into ACE, you can do - this by defining ACE_USES_STATIC_MFC in your - config.h file. If you insist on linking everything - statically, you'll have to modify the project file yourself.

    -

  8. Static version of ACE libraries are build with the following macros defined:
    -
    - ACE_HAS_DLL=0
    - ACE_NO_INLINE
    -
    - You should also have them defined in you application projects if you - want to use the default static ACE libraries with them.

    - -

  9. If you are building for Windows CE, you need to add the line
    -
    - #define ACE_HAS_WINCE -
    - before including <ace/config-win32.h>. Notice that CE uses a - different set of dsw/dsp files.

    - -
  10. The default project files which build ACE library have various - configurations to build dynamic/static, with or without Unicode - support. Although we recommend using the dynamic library, if, - for some reasons, you would rather work with static library, - you'll need to add the line
    -
    - #define ACE_HAS_DLL 0
    -
    - before the #include statement in ACE_ROOT\ace\config.h. - Optionally but highly recommended, you can also add the line
    -
    - #define ACE_NO_INLINE
    -
    - before the #include statement in ACE_ROOT\ace\config.h to disable - inline function and reduce the size of static libraries (and your - executables.) Notice that you need to use DLL version of - run-time libraries even you are using ACE as a static library. - That's the default behavior.

    - -
  11. ACE DLL and LIB naming scheme:
    -
    - We use the following rules to name the DLL and LIB files in ACE - when using MSVC.
    -
    - "Library/DLL name" + (Is static library ? "s" : "") + (Support Unicode ? "u" : "") + (Is Debugging enable ? "d" : "") + {".dll"|".lib"}
    -
    - -
  12. Barry - Hoggard maintains a CORBA Page - which contains very helpful information on setting MSVC project - settings. You'll need to filter out stuff related to TAO if you - only use ACE.

    -
- -ACE TESTS

- -The tests are located in ACE_ROOT\tests. There are two corresponding -project files in that directory also (tests.mdp and tests.dsp).

- -Once you build all the tests (Batch Build works well for this), you -can run the batch file run_tests.bat in the -tests directory to try all the tests.

- - BUILDING ACE ON A WIN32 MACHINE THAT LACKS A NETWORK CARD

- -You may want to run ACE on a non-networked machine. To do so, you must -install TCP/IP and configure it to ignore the absence of a network -card. This is one method:

- -

    -
  1. Run Control Panel -
  2. Choose Network from Control Panel -
  3. Add Adapter: MS Loopback Adapter -
  4. Configure MS Loopback Adapter with 802.3 (default) -
  5. Add Protocol: TCP/IP Protocol -
  6. Configure TCP/IP Protocol with a valid IP address and subnet mask. - Leave everything else at the default settings. -
  7. Add Service: Workstation -
  8. Exit and Restart System -
  9. Run Control Panel again -
  10. Choose Services from Control Panel -
  11. The following services are not necessary and may - be set to Disabled Startup:
    - Alerter
    - Computer Browser
    - Net logon
    - Messanger
    -
  12. Choose Network from Control Panel -
  13. Confirm the following setup. This is all you need to run ACE:
    - Installed Software:
    - Computer Browser
    - MS Loopback Adapter Driver
    - TCP/IP Protocol
    - Workstation
    - Installed Adapter Cards:
    - MS Loopback Adapter

    -

- -NT ALPHA CONFIGURATIONS - -

Many project files already contain Alpha NT configurations, but others do -not (requiring them to be added). Also, since most of the development happens -on x86, problems building ACE on Alpha NT can often be fixed by recreating the -configurations from the x86 versions.

- -

Here are the steps to add an Alpha Configuration.

- -
    -
  1. Load the project on the Alpha machine. -
  2. Go to the Build menu and then Configurations. -
  3. Select the project that you want to convert. -
  4. Click on Add. -
  5. Select the x86 configuration to "Copy settings from" - (either Debug or Release versions). -
  6. Prepend "Alpha " to the beginning of the name under - "Configuration". -
  7. Click OK. -
  8. Close the "Configurations" window. -
  9. Now go to the Project settings. -
  10. For the General Settings, change the output directories to standard ACE - output directores. Intermediate Directories are "Debug" and - "Release" in most cases. The Output Directories are blank, - except for Release versions of executables, in which it is also - "Release". -
  11. For the C/C++ Settings, make sure that the Code Generation's runtime - library is set to "Multithreaded DLL" or "Debug Multithreaded - DLL". -
- -

Note: MSVC 6 has a bug where if a .dsp is converted from version 5 to 6 on -x86, the Alpha configuration will be partially corrupted. If this occurs, the -easiest way to fix it is as above, recreate it.

- - -


-

Building and Installing ACE on VxWorks

-For the most part, you should be able to follow the instructions above -to build ACE and applications that use it. Start with the -Unix instructions above to build ACE and the -applications that use it. Please see below for more information on -building ACE on NT hosts for VxWorks targets.

- -A few notes on VxWorks builds (thanks to -Paul von Behren -for these notes):

-

- -You'll have to let ACE know the target type at compile time. There -are several ways to do this; please see the -$ACE_ROOT/include/makeinclude/platform_vxworks5.x_g++.GNU -platform file for detailed information.

- -The VxWorks platform_vxworks*.GNU files are set up so that shared -libraries are not built on VxWorks, by default. Only static -libraries, with .a extension, are built. Therefore, it's not -necessary to set the LD_LIBRARY_PATH environment variable on your host -system when building for VxWorks targets. Please note, however, if -you use TAO on VxWorks that you will need to set your LD_LIBRARY_PATH -to find the TAO IDL compiler libraries (installed in the ace -directory) on the host.

- -With g++, $ACE_ROOT/bin/ace_ld is used to munch object files and -libraries to set up calls to static constructors and destructors. -bin/ace_ld requires perl on the host platform.

- -These non-default VxWorks kernel configuration #defines -are required with ACE:

- -

-#define INCLUDE_CPLUS           /* include C++ support */
-#define INCLUDE_CPLUS_IOSTREAMS /* include iostreams classes */
-#define INCLUDE_POSIX_ALL       /* include all available POSIX functions */
-
- -For completeness, here are the non-default #defines that -we used for VxWorks 5.3.1/g++ 2.7.2: - -
-#define INCLUDE_CPLUS           /* include C++ support */
-#define INCLUDE_CPLUS_IOSTREAMS /* include iostreams classes */
-#define INCLUDE_CONFIGURATION_5_2 /* pre-tornado tools */
-#define INCLUDE_DEBUG           /* pre-tornado debugging */
-#define INCLUDE_LOADER          /* object module loading */
-#define INCLUDE_NET_SYM_TBL     /* load symbol table from network */
-#define INCLUDE_SYM_TBL_SYNC    /* synchronize host and target symbol tables */
-#define INCLUDE_NFS             /* nfs package */
-#define INCLUDE_PING            /* ping() utility */
-#define INCLUDE_POSIX_ALL       /* include all available POSIX functions */
-#define INCLUDE_RDB             /* remote debugging package */
-#define INCLUDE_RLOGIN          /* remote login */
-#define INCLUDE_RPC             /* rpc package */
-#define INCLUDE_SECURITY        /* shell security for network access */
-#define INCLUDE_SHELL           /* interactive c-expression interpreter */
-#define INCLUDE_SHOW_ROUTINES   /* show routines for system facilities*/
-#define INCLUDE_SPY             /* spyLib for task monitoring */
-#define INCLUDE_STARTUP_SCRIPT  /* execute start-up script */
-#define INCLUDE_STAT_SYM_TBL    /* create user-readable error status */
-#define INCLUDE_SYM_TBL         /* symbol table package */
-#define INCLUDE_UNLOADER        /* object module unloading */
-#define INCLUDE_WINDVIEW        /* WindView command server */
-
- -Also, automatic construction/destruction of static objects -should be enabled.

- -If you use TAO, it's also a good idea to increase the -NUM_FILES parameter from its default of 50 to, -say, 1000.

- -Please note that those VxWorks kernel configuration parameters -are set in the VxWorks configAll.h file. You must rebuild your -VxWorks kernel after modifying that file.

- -If you're first getting started with ACE and/or VxWorks, I recommend -just building the ACE library and tests first. (Some of the ACE -examples, in System_V_IPC, don't build on VxWorks yet.) Then try -running the tests. Please see $ACE_ROOT/tests/README for the latest -status of the ACE tests on VxWorks.

- -Please note that the main entry point is renamed to -ace_main (configurable via ACE_MAIN) on VxWorks with g++, -to comply with its restriction against using main. -In addition, ACE_HAS_NONSTATIC_OBJECT_MANAGER is enabled by default -to cleanly support construction and destruction of static objects. -Please see the Non-static -ACE_Object_Manager discussion for the important implication -of this feature.

- -ACE threads (VxWorks tasks) can be named, for example, by supplying a -non-null argument to the Thread_Manager spawn routines. However, -names beginning with "==ace_t==" are forbidden because -that prefix is used internally by ACE.

- -You can spawn a new task to run ace_main, using either -VxWorks sp, or ACE'S spa. -spa can be used from the VxWorks shell to pass arguments -to ace_main. Its usage is: - -


-spa ace_main, "arg1" [, ...]
-
- -All arguments must be quoted, even numbers.

- -The ACE tests write their output files in a -directory named log/, below the current -(tests) directory. If you don't have NFS included in -your VxWorks kernel, you can use these steps, provided by -Clarence M. Weaver, -to run the tests and capture their output:

-

    -
  1. What I did was create a log directory on the boot NT host of my vxworks - target.

    -

  2. I copied all the test applications and the run_tests.vxworks script to - the parent of the log directory.

    -

  3. Using the target shell not the host shell, I "cd" to the directory - containing the script and test programs.

    -

  4. Invoked the script < run_tests.vxworks from this target shell.

    -

- -Kirk Davies provided this -approach for running the ACE tests on Tornado II: - - - -
Building Shared Libraries for VxWorks.
- -ACE supports shared libraries for VxWorks, but only with the g++ -compiler. To build shared libraries instead of the default static -libraries, added shared_libs=1 (not -shared_libs_only=1) to either your -ACE_wrappers/include/makeinclude/platform_macros.GNU or -your make invocation. Then, be sure to load the ACE (and -any other) shared library before loading your executable(s).

- -A shared library for VxWorks uses the same code as for a static -(non-shared) library. However, calls to static constructors/ -destructors are added. The code in the shared library must -be reentrant if you shared it between programs (tasks). The -ACE library meets this requirement.

- -Shared libraries reduce build time, executable size, and load -time of the executable. But, you must manually load the shared -library before loading your executable(s) with a command such as: -


--> ld < libACE.so
-
-Shared libraries can be unloaded the same way an executable -(module) is unloaded.

- -NOTE: Shared libraries on VxWorks aren't the same as -shared libraries on other operating systems. In particular, there is -no support for creating copies of writeable global (static) data in -the shared library. This includes the singleton ACE_Object_Manager -instance pointer. If you share global data between separate programs, -they may not work properly. See the discussion of shared code and -reentrancy in the VxWorks' Programmers Guide.

- -Instead of trying to run separate programs onto a VxWorks target, we -recommend creating just one program, and spawning a thread for each -task. The TAO IDL_Cubit test collocation -test is a good example.

- -

Linking ACE and/or TAO Libraries into the VxWorks Kernel.
- -It's easy to link your ACE and/or TAO libraries into the VxWorks kernel. -Just build shared versions, but -disable the munch step. The easiest way to do that is to set the -LD make variable to the name of your linker. For -example, to build a libACE.so for PowerPC that can be linked into -the kernel: -
-% cd $ACE_ROOT/ace
-% make LD=ldppc shared_libs=1
-
-After building the shared lib, link it into the kernel by setting -the MACH_EXTRA make variable in the kernel configuration -Makefile. Then, build the kernel using make exe.

- - -

Building ACE on Tornado/NT hosts for VxWorks targets.
-The following, very useful information was contributed by -Chris Ryan -and Paul von Behren. -Please submit corrections, additions, or clarifications to the -the ACE mailing list.

- -NOTE:The make (version 3.74) that is provided with -Tornado II cannot be used to build ACE. Use Cygnus' make (version 3.75) -instead.)

- -NOTE:Optimization is enabled be default in -platform_vxworks5.x_g++.GNU. However, the compiler that is shipped with Tornado II has -trouble compiling some files with -O2. To disable optimization -for an individual file, just add optimize=0 to your -make invocation when compiling that file.

- -Using the Cygnus tools, this approach works: -

- -A few additional Windows Notes, from Paul von Behren:

-

- -And Chris Ryan's instructions for building for VxWorks targets -on Windows NT hosts: - -
    -
  1. Path setting that seems to be working is:

    -

    -      /tornado/host/x86-win32/bin:
    -      /tornado/host/x86-win32/lib/gcc-lib/i386-wrs-vxworks/cygnus-2.7.2-960126:
    -      /tornado/host/x86-win32/i386-wrs-vxworks/bin:
    -      /ace/ace_wrappers/bin:
    -      /gnuwin32/b18/H-i386-cygwin32/bin:
    -      /gnuwin32/b18/tcl/bin:
    -      /WINNT/system32:
    -      /WINNT:
    -      /WINNT/system32/nls/ENGLISH:
    -      /bin
    -      
    - - Other environment variables:

    -

    -      WIND_BASE=/tornado
    -      SHELL=/bin/sh.exe
    -      TERM=pcbios
    -      TAO_ROOT=/ace/ACE_wrappers.vxworks/TAO
    -      CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.EXE
    -      GCC_EXEC_PREFIX=/tornado/host/x86-win32/lib/gcc-lib/
    -      WIND_HOST_TYPE=x86-win32
    -      ACE_ROOT=/ace/ACE_wrappers.vxworks
    -      
    - -
  2. /tornado is the root of the Tornado install - ($WIND_BASE). - -
  3. /gnuwin32 is the root of a Cygnus GNU download and install. - -
  4. /bin content is:

    -

    -      aced.dll
    -      cygwin.dll
    -      perl.exe
    -      rm.exe
    -      sh.exe
    -      true
    -      
    - - aced.dll is produced in an ACE NT source tree according to - documented procedure for NT VC++5.0 ACE build. - - cygwin.dll is from the Cygnus GNU software download and install. - -
  5. Basically, follow documented procedure for ACE build/install on UNIX - platform. Create a $ACE_ROOT/ace/config.h that looks - like:

    -

    -      #include "config-vxworks5.x.h"
    -      
    - - And create a - $ACE_ROOT/include/makeinclude/platform_macros.GNU - that looks like:

    -

    -      WIND_BASE = /tornado
    -      WIND_HOST_TYPE = x86-win32
    -      CPU = I80486
    -      include $(ACE_ROOT)/include/makeinclude/platform_vxworks5.x_g++.GNU
    -      
    - -
  6. When using cygnus windows GNUTools on WinNT you have to start - make with "--unix" option, otherwise WinNT shell cmd.exe is responded and - not sh.exe, i.e., -
    - make --unix static_libs=1
    - 
    -
- -
TAO on NT Tornado host, VxWorks target.
- -
    -
  1. Build ACE and TAO_IDL in the NT tree as already documented. As - mentioned above, I put aced.dll in /bin. - Be sure to build ACE's gperf on NT, in - ACE_wrappers/apps/gperf/src.

    - -

  2. Build $TAO_ROOT/tao -
    -      CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.exe
    -      cd $TAO_ROOT/tao
    -      /gnuwin32/b18/H-i386-cygwin32/bin/make
    -      
    - -
  3. Build orbsvcs. -
    -      CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.exe
    -      cd $TAO_ROOT/orbsvcs/orbsvcs
    -      /gnuwin32/b18/H-i386-cygwin32/bin/make
    -      
    - -
  4. Build $TAO_ROOT/tests

    -

- - -
-

Building and Installing ACE Network Services

- -The following explains how to build the ACE network services on UNIX and Win32. - -


-

Building and Installing ACE Network Services on UNIX

- -Building and installing ACE Network Services on UNIX is relatively -simple (the process for Win32 is different). -Here's what you need to do:

- -

    - -
  1. Build and install ACE on UNIX as described earlier. If ACE is built at the root of the ACE - source tree (and ACE has been ported to your platform, of course) the - netsvcs static and shared object libraries should be built - automatically. In addition, the server driver program - (main) contained in $ACE_ROOT/netsvcs/servers/main.cpp - should also be compiled and ready to run.

    - -

  2. Set your LD_LIBRARY_PATH environment variable to where the binary - version of the ACE netsvcs library. For example, you probably - want to do something like the following

    - -

    
    -      % setenv LD_LIBRARY_PATH $ACE_ROOT/ace:$LD_LIBRARY_PATH
    -      

    - -

  3. By default, if the shared object library is built, the services - are linked into the main driver program dynamically. - To specify which services should be linked in and executed, edit the - $ACE_ROOT/netsvcs/servers/svc.conf - file. During your editing, you should update information (such as the - default service port numbers) that affects the initialization of - services in this file. Refer to the - Service Configurator - documentation to learn how the configuration file is parsed and - how the services are dynamically linked and executed. In - addition, refer to the Network - Services documentation to learn more about how to configure - each network service.

    - -

  4. If you only want to link the services statically, simply remove - or rename the svc.conf file.

    -

- -


-

Building and Installing ACE Network Services on Win32

- -Once again, there are supplied project for MSVC 5.0 or later for -the Network Services.

- - -


-

What Do I Need to Build for TAO?

-Toshio Hori <toshi@etl.go.jp> provided these suggestions on building -just what's needed for (a subset of) TAO:

- -I usually make: -

-    $ACE_ROOT/ace,
-    $ACE_ROOT/apps/gperf,
-    $TAO_ROOT/tao,
-    $TAO_ROOT/TAO_IDL, and
-    $TAO_ROOT/orbsvcs/orbsvcs
-
-and the whole make takes less than an hour on my Solaris 7 for intel, -Pentium-III/550MHz, 256MB memory, 512MB swap machine. (Top secret: I -renice the 'make' process to the highest priority, -20... ;-) - -To save time and space, I set -
-    TAO_ORBSVCS = Naming Time Trader ImplRepo
-
-in $ACE_ROOT/include/makeinclude/platform_macros.GNU also. See -TAO's orbsvcs -library customization instructions for more information.

- - -


-

System Resource Requirements

-The amount of system resources required to build ACE and TAO varies -greatly. Platform, build options, and components built primarily -influence the required system resources. As a rough guide, the -typical peak memory requirement could be well over 256 Mb (notably, -for TAO's orbsvcs). An entire build of ACE and TAO -can use well over 1300 Mb of disk space. It's usually not necessary -to build all of ACE and TAO, though.

- -Much less disk space is required for just the libraries. For example, -see the ACE -library subset sizes.

- -If you run out of memory when building, you might consider trying -some or all of these suggestions:

-

- - -

-

Advanced Topics

- - - -


-

Non-static -ACE_Object_Manager

The ACE_Object_Manager can be instantiated -as a static object, can be instantiated on the stack of the main -program thread, or can be explicitly instantiated and destroyed by the -application with ACE::init () and ACE::fini -(). The comments in the header -file, ace/Object_Manager.h provide more detail.

- -NOTE: -Special requirements are imposed on applications if the -ACE_Object_Manager is instantiated, by ACE, on the stack of the main -thread. This behavior is selected by defining -ACE_HAS_NONSTATIC_OBJECT_MANAGER in -ace/config.h. Again, see the ACE Object_Manager header file, -ace/Object_Manager.h for more information. One of -these requirements is discussed here, because it is so important. -Please note that ACE_HAS_NONSTATIC_OBJECT_MANAGER is -defined in the distributed ACE config.h headers for -VxWorks and Win32.

- -The important requirement is that the program must -declare its main function with two arguments, even if -they're not used, and with int return type: - -


-int
-main (int, char *[])
-
- -If you don't declare main exactly that -way, then you'll see a link error about ace_main_i being -undefined.

- -Alternatively, this feature can be disabled by commenting out the -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER in the -ace/config.h. But, that will make repeated testing more -difficult on VxWorks. And, you'd either have to call static -constructors and destructors manually or unload/load the program -between runs. On Win32, disabling the feature can possibly lead to -shutdown difficulties.

- -WARNING: -ACE_HAS_NONSTATIC_OBJECT_MANAGER assumes that your -main function is named main. Any violation -of this assumption is at your peril. If you really need to call your -entry point something other than main, you'll need to -construct and destroy the ACE_Object_Manager. The best way to do that -is to call ACE::init () and ACE::fini (). -Or, see the #define of main (int, char *[]) -in ace/OS.h to see how ACE does -that for entry points named main.

- -


-

Cloning the Source Tree

- -On UNIX platforms, we typically like to support multiple platform -builds using the same ACE source tree. This idiom is supported by ACE -using the $ACE_ROOT/bin/create_ace_build script or -$ACE_ROOT/bin/clone.cpp program. - -To use build and use the clone program, first make sure there's a file -called platform_macros.GNU that contains the correct platform-specific -Makefile configurations in the $ACE_ROOT/include/makeinclude/ -directory, as well as making sure there's a $ACE_ROOT/ace/config.h -file that includes the desired platform/compiler specific -configuration header. Then perform the following steps:

- -

-% cd $ACE_ROOT/bin
-% make
-% mv clone ~/bin
-% rehash
-

- -Then create a ./build subdirectory someplace, e.g., under $ACE_ROOT. -Once this is done, then invoke the top-level Makefile with the -``clone'' target, e.g.:

- -

-% cd $ACE_ROOT
-% mkdir build-SunOS5
-% cd build-SunOS5
-% make -f ../Makefile clone
-% setenv ACE_ROOT $cwd
-% make
-

- -This will establish a complete tree of links. In addition, make sure -you set your LD_LIBRARY_PATH to $ACE_ROOT/ace:$LD_LIBRARY_PATH on SVR4 -UNIX platforms.

- -When you do a make in the $ACE_ROOT directory you will be producing -object code that is not stored in the same place as the original -source tree. This way, you can easily build another platform in a -parallel tree structure.

- - VERY IMPORTANT!

- -If you use the ``clone trick'' discussed above, make sure that the -symbolic links are correctly in place before starting the build. In -particular, if you plan to clone the tree, it is preferable to do so -before you start a build procedure on the original tree. This is -because the build procedure create object directories (.obj and -.shobj) and the cloning procedure will clone these directories also. -You would end up with links pointing to object files of another -platform. If you clone the tree after you've done a build on the -original tree, make sure to remove all ".obj", ".shobj" and (any other -files or directories) in all subdirectories before starting the build -on your cloned tree.

- -Alternatively, the perl script -ACE_wrappers/bin/create_ace_build can be used to create -build trees. It creates them below ACE_wrappers/build. -It filters out all but the necessary files, so the warning above does -not apply. See the comments at the top of the script itself for usage -information. - -


-

Building CORBA Versions of ACE

- -Note that if you are compiling with IONA's Orbix implementation of -CORBA or Visigenix's implementation of CORBA, you'll also need to set -ORBIX_ROOT to point to the root of the Orbix source tree and -ORBELINE_ROOT to point to the root of the ORBeline source tree. Since -many platforms don't have these CORBA tools the default for ACE does -*not* incorporate them. Thus, if you are compiling with Orbix or -ORBeline, make sure that you set up -$ACE_ROOT/include/makeinclude/platform_macros.GNU and -$ACE_ROOT/ace/config.h to use the config* and platform* -files that have "-orbix" in them! - - -


-

Additional Build Tips for MVS

- -For all intents and purpose, MVS OpenEdition (OE) is another flavor of -UNIX, therefore, the instructions under Building -and Installing ACE on Unix can be used along with the following -additional tips:

- -You can get a copy of GNU make that has been ported to MVS OpenEdition from -the IBM OpenEdition web site. -ACE's make scheme generates compile commands that have options and -operands interspersed. By default, the c89/cc/c++ compiler expects all options to -precede all operands. To get around this, you must set a special -compiler environment variable (_CXX_CCMODE) to 1 which tells the compiler -to allow options and operands to be interspersed.

- -Note that the environment variable LD_LIBRARY_PATH is called LIBPATH -on MVS.

- -Shared objects are built a little different on MVS than on -other UNIX implementations. This has been accounted for in the makefiles -that come with ACE When the linker (via the cxx command) builds the -libACE.so file it will also create a file called libACE.x. This is a -side-deck file and it must be included in subsequent link edits with -application code. For more information on this see the C/C++ MVS -Programming Guide. If you want to build your application statically, -i.e., using libACE.a instead of libACE.so, you can set ACELIB to -ACELIB_STATIC in platform_mvs.GNU.

- -When the libACE.so file is built (via the MVS pre-linker and binder), you -will get a rc=4 from the pre-linker. This is ok. This is due to some -warnings about unresolved references which should get resolved during the -link step. Note, however, there shouldn't be any unresolved references -from the binder (linkage editor). You can get pre-link and link maps by -uncommenting the PMAP and LMAP lines in the platform_mvs.GNU file.

- - -


-

Makefile Flags

- -GNU make provides many options to customize its operation. See its -documentation for more information. One example is that for multi-cpu -UNIX machines you will be able to build faster if you use:

- -


-% make -j n
-

- -which allows parallel compilation. The number n should -typically be the number of CPUs. It is likely that builds will be -faster even on single-CPU UNIX machines with make -j -2.

- -ACE further supports the following flags. They can be enabled either -on the command line, e.g., "make purify=1", or added to your -platform_macros.GNU. To disable the option, set the flag to null, -e.g., "make debug=". Some flags support setting to 0 disable, e.g., -"make debug=0". debug=1 is enabled in the platform files that are -released with ACE.

- -Please note that the effects of a flag may be platform specific. -Also, combinations of certain flags may or may not be allowed on -specific platforms, e.g., debug=1 opt=1 is supported by g++ but -not all other C++ compilers.

- -If you use Purify or Quantify: purify or quantify must -be on your PATH. By default, ACE puts the Purify/Quantify -caches below /tmp. To override that, set the -PURE_CACHE_BASE_DIR variable, either in your environment -or on the make make command line, to the destination -directory for your instrumented libraries.

- -

-Flag             Description
-----             -----------
-debug            Enable debugging; see DCFLAGS and DCCFLAGS.
-exceptions       Enable exception handling (not supported by all platforms).
-fast             Enable -fast option, e.g., with Sun C++.
-inline           Enable ACE inlining.  Some platforms enable inlining by
-default, others do not.
-optimize         Enable optimization; see OCFLAGS and OCCFLAGS.
-orbix            Enable use of Orbix.
-probe            Enable ACE_Timeprobes.
-profile          Enable profiling; see PCFLAGS and PCCFLAGS.
-purify           Purify all executables.
-quantify         Quantify all executables.
-repo             Use GNU template repository (g++ with repo patches and
-                   egcs only).
-rtti             Enable run-time type identification.  On some platforms,
-                   it is enabled by default, so this is ignored.
-shared_libs      Build shared libraries. Ignored if static_libs_only is set.
-static_libs      Build shared libraries. Ignored if shared_libs_only is set.
-shared_libs_only Only build shared libraries.  Ignored if no SHLIBs are
-specified by the Makefile, as in performance-tests/Misc.
-static_libs_only Only build static libraries.
-threads          Build with thread support.
-xt_reactor       Build the XtReactor.
-
-Usually, users do not need to be concerned with make targets.
-Just enter ``make'' on the command line to build.  A few notable
-targets are listed below.
-
-Target             Description
-------             -----------
-show_statics       Lists all static objects in object files built for
-current directory.  Only supported for g++.
-show_uninit        Lists all uninitialized in object files built for
-current directory.  Only supported for g++.
-
-
-

- -Back to the ACE -home page. - - - - diff --git a/ACE-configuration.txt b/ACE-configuration.txt deleted file mode 100644 index c638cfe8459..00000000000 --- a/ACE-configuration.txt +++ /dev/null @@ -1,181 +0,0 @@ -* $Id$ * - -================================================================ -Configuring ACE Using the `configure' Script -================================================================ - -QuickStart ----------- -GNU Autoconf support in ACE is still under development. However it is -a small subset of Autoconf support in ACE has been made available for -testing and feedback purposes. To use Autoconf support in ACE, do -something like the following: - - cd ACE_wrappers - mkdir objdir - cd objdir - -Then: - Bourne Shell: CXX=c++ ../configure - C Shell: env CXX=c++ ../configure -make - -Description ------------ -To help speed development, the work being done by the ACE -Configuration Project is being slowly introduced into the official ACE -distribution. Some of the functionality in the work created by the -ACE Configuration Project has been removed so that ACE may be built in -the usual fashion. Once the ACE Configuration Project work stabilizes -on more platforms that removed functionality may be added to ACE. - -Currently the configure script contains most of the tests that are -necessary to properly configure ACE on most platforms. However, there -are still some autoconf tests that are missing. As such, you may -encounter and most likely will have compilation problems. Please -report any problems to the contacts listed at the end of this -document. - -The `configure' script that is currently being used has been modified -from the ACE Configuration Project's `configure' script to prevent -makefiles from being automatically generated since there are still -some issues that must be addressed before automatically generated -makefiles are incorporated into the official ACE distribution. - -A listing of available configure script options can be shown by -entering: - - ./configure --help - -at the command line. The output should look something like the -following: - - -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print `checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [/usr/local] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR ---enable and --with options recognized: - --enable-static[=PKGS] build static libraries [default=no] - --enable-shared[=PKGS] build shared libraries [default=yes] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --disable-libtool-lock force libtool not to do file locking - --enable-debug enable debugging [default=yes] - --enable-exceptions enable C++ exception handling [default=yes] - --enable-fast enable -fast flag, e.g. Sun C++ [default=no] - --enable-inline enable code inlining [default=yes] - --enable-log-msg-prop enable threads inheriting - ACE_Log_Msg properties from parent - thread [default=yes] - --enable-logging enable ACE logging macros [default=yes] - --enable-malloc-stats enable malloc statistics - collection [default=no] - --enable-optimize enable additional optimizations [default=yes] - --enable-probe enable ACE_Timeprobes [default=no] - --enable-profile enable profiling [default=no] - --enable-purify Purify all executables [default=no] - --enable-quantify Quantify all executables [default=no] - --enable-reentrant enable reentrant functions [default=yes] - --enable-repo use GNU template repository - GNU C++ with repo patches and - EGCS only [default=no] - --enable-rtti enable run-time type - identification - *Currently only for Sun C++ [default=no] - --enable-static-obj-mgr enable static Object_Manager [default=yes] - --enable-threads enable thread support [default=yes] - --enable-verb-not-sup enable verbose ENOTSUP reports [default=no] - --enable-trace enable ACE tracing [default=no] - --enable-xt-reactor build support for the XtReactor [default=no] - --with-x use the X Window System - --with-gperf compile the gperf program [default=yes] - --with-orbix[=DIR] compile ACE with Orbix [default=no] - --with-tli-device[=DEV] device for TCP on TLI [default=/dev/tcp] - -To enable debugging and disable code inlining, for example, just enter -the following on the command line: - - ./configure --enable-debug --disable-inline - -This will generate a configuration header file `ace/config.h' to be -used when compiling ACE that will enable ACE debugging macros and -disable code inlining during compilation of ACE. - -Once the `ace/config.h' header has been created you will have to -select a platform macros file. Please read the ACE installation -documents for more information about this. - ----------------------------------------------------------------- -Caveats ----------------------------------------------------------------- -The `configure' script will check for libraries that contain certain -functions. If it finds a library that isn't listed in your -platform_macros.GNU file you will have to add that library to the list -of libraries to link against. - -Shared library generation when using ACE Autoconf support is different -from the stock ACE shared library generation mechanism. The Autoconf -supported shared library mechanism does not yet fully support all of -the platforms ACE's stock shared library mechanism supports. As such, -you may encounter problems if an attempt is made to build a shared -library when using ACE's autoconf support. - -Remember that the stock ACE build procedure is always available. If -your attempts to use ACE's Autoconf support are unsuccessful then -contact the parties listed below, and use ACE stock build procedure as -described in ACE-INSTALL.html. - ----------------------------------------------------------------- -Contacts ----------------------------------------------------------------- -If you do have problems please e-mail the ACE Configuration Project -maintainer at: - - Ossama Othman - -or send mail to the ACE mailing list. - -For more information take at a look at the ACE Configuration Project -web page at: - - http://www.cs.wustl.edu/~othman/aceconf - diff --git a/ACE-install.sh b/ACE-install.sh deleted file mode 100644 index 76c1e8064f7..00000000000 --- a/ACE-install.sh +++ /dev/null @@ -1,356 +0,0 @@ -#!/bin/sh -########################## Begin Install Script ########################## -# -# NAME: ACE-install.sh -# -# PURPOSE: Bourne shell script to install ACE for UNIX platforms -# -# AUTHOR: Ajit Sagar -# -# HISTORY: 5/20/96 Ajit Sagar Created -# x/xx/xx xxxxxxxxxxxxxx Modified -# x/xx/xx xxxxxxxxxxxxxx Modified -# -# DESCRIPTION: This script installs the ACE toolkit for a Unix system. -# Before using this script, you must do the following: -# -# NOTES: 1) Download the gzipped version of ACE from -# http://www.cs.wustl.edu/~schmidt/ (Select "Obtaining ACE") -# OR -# ftp from wuarchive.wustl.edu in the /languages/c++/ACE directory -# -# The local directory to which this will be downloaded is -# refered to as the "MY_ACEDIR" in this script. -# -# 2) Make sure there is only one file that matches "ACE*tar*". -# This should be the one you just downloaded. -# remove older versions of tar files downloaded earlier. -# -# 3) At the end of this script, you should have: -# -# a) A compiled toolkit in the $ACE_ROOT directory -# b) If you selected to save the existing installation, -# a file oldACE.tar.gz will be created in MY_ACEDIR -# c) The gzipped ACE source file that was initially downloaded. -# -# 4) This script may be executed without user interaction -# by using the "auto" option (see USAGE section below). -# It is advisable to execute it without the "auto" option the -# first time to make sure everything works. -# -# THE FOLLOWING NEED TO BE DONE ONLY THE FIRST TIME THIS -# SCRIPT IS RUN: -# -# 5) Read the README file in -# http://www.cs.wustl.edu/~schmidt/ACE.html directory -# -# 6) Define an environment variable ACE_ROOT the -# defines which directory your ACE toolkit is to be -# installed in. -# -# DO NOT MAKE "ACE_ROOT" THE SAME AS "MY_ACEDIR". -# -# 7) Redefine "MY_ACEDIR" in this script to default -# to the directory in which you have downloaded the ACE source. -# -# 8) This script has been tested on Solaris 2.x for the -# Sun C++4.0 compiler. To use this on some other UNIX -# platform, uncomment and redefine the following -# in this script: -# -# MY_ACE_CONFIG -# MY_ACE_GNU_MACROS -# -# Check the README file to define these variables. If -# these are not defined, the script will prompt you -# help you to change these variables. But in that case -# you cannot run with the "auto" option. -# -# -# USAGE: myacemaker [ auto ] -# -# auto automatic make (no user interaction) -# -# Under this option, the source will be -# extracted and compiled without any user interaction, -# i.e., you can kick off this script, go home, -# and check it in the morning. The following -# assumptions are made: -# -# 1) MY_ACE_DIR is properly defined in this script. -# 2) MY_ACE_CONFIG is properlly defined -# in this script. -# 3) MY_ACE_GNU_MACROS is properly defined in this -# script. -# 4) A backup of existing installation -# is to be made. -# -# COPYRIGHT INFORMATION: -# -# You are free to do anything you like with this script such as -# including it in commercial software. You may modify it and freely redistribute -# it. The author accepts no responsibility for any bugs or problems that -# arise as a consequence of using this code. -# -# -- Ajit Sagar -# -######################################################################### -# -ACE_ERRFILE=/tmp/myacemaker.err -OLD_ACE_TAR_FILE=oldACE.tar -OLD_ACE_GZIPPED_TAR_FILE=oldACE.tar.gz -USAGE=" : myacemaker [ auto ]" -# -############################################################## -# -# Platform-specific definitions -# -############################################################## - -# Directory where ACE-x.x.xx.tar.gz is located - -MY_ACEDIR=${HOME}/aceconfig - -####################################################### -# Platform specific config file in ${ACE_ROOT}/ace/ -# Uncomment and redefine this -####################################################### - -# MY_ACE_CONFIG=config-sunos5.4-sunc++-4.x.h - -####################################################### -# Platform specific GNU macros file in -# ${ACE_ROOT}/include/makeinclude/ -# Uncomment and redefine this -####################################################### - -# MY_ACE_GNU_MACROS=platform_sunos5_sunc++.GNU - - -############################################################## -# -# Main Script For Installing ACE -# -############################################################## - -AUTO="$#" - -ACE_ROOT=${ACE_ROOT:?"ERROR: Environment variable ACE_ROOT not set"} -if [ ${AUTO} -gt 1 ] -then - echo "$USAGE" - exit 1 -fi - -if [ ${AUTO} -eq 1 ] -then - if [ $1 != "auto" ] - then - if [ $1 = "nounzip" ] ; then - UNZIP=0 - AUTO=0 - else - echo "$USAGE" - exit 2 - fi - fi -fi - -echo "" -echo "ACE source in `ls ${MY_ACEDIR}/ACE*tar.gz`" -echo "ACE will be installed in ${ACE_ROOT}" -echo "" - -if [ $AUTO -eq 0 ] -then - echo "OK to continue? [Y/N] : \c" - read choice -else - choice='Y' -fi - -if [ ${choice} != 'Y' -a ${choice} != 'y' ] -then - echo "" - echo "ACE installation aborted" - echo "" - exit 11 -fi - -cd ${MY_ACEDIR} - -echo "Uncomressing ACE archive and extracting ACE files" -echo "into `pwd`/ACE_wrappers directory ..." -echo "" - -gunzip -c ACE*tar.gz | tar xvf - || \ -{ - echo "" - echo "gunzip or tar failed. Aborting script !!" - echo "" - exit 33 -} - -if [ -d ${ACE_ROOT} ] -then - - if [ $AUTO -eq 0 ] - then - echo "Save a copy of existing ACE installation? [Y/N] : \c" - read choice - echo "" - else - choice='Y' - fi - - if [ ${choice} = 'Y' -o ${choice} = 'y' ] - then - - echo "Archiving ${ACE_ROOT} to `pwd`/${OLD_ACE_TAR_FILE} using ..." - tar cvpf ${OLD_ACE_TAR_FILE} ${ACE_ROOT} - echo "" - - if [ -f ${OLD_ACE_GZIPPED_TAR_FILE} ] - then - echo "Removing ${OLD_ACE_GZIPPED_TAR_FILE} ..." - rm ${OLD_ACE_GZIPPED_TAR_FILE} - echo "" - fi - - echo "Compressing ${OLD_ACE_TAR_FILE} using ..." - gzip -9 ${OLD_ACE_TAR_FILE} - echo "" - - fi - - echo "Removing ${ACE_ROOT} ..." - rm -r ${ACE_ROOT} - echo "" -fi - -echo "Moving `pwd`/ACE_wrappers to ${ACE_ROOT} ..." -mv ./ACE_wrappers ${ACE_ROOT} -echo "" - -cd ${ACE_ROOT}/ace - -if [ ${MY_ACE_CONFIG:-undefined} = undefined ] -then - - if [ $AUTO -eq 1 ] - then - if [ ! -f ${MY_ACE_CONFIG} ] - then - echo "" - echo "${MY_ACE_CONFIG} does not exist. Aborting script ..." - echo "" - exit 44 - fi - fi - - echo "Select one of the following files for linking to config.h" - echo "" - echo "`ls config*h`" - echo "" - - echo "Type the filename for your compiler: \c" - read MY_ACE_CONFIG - echo "" - - if [ ! -f ${MY_ACE_CONFIG} ] - then - echo "" - echo "${MY_ACE_CONFIG} does not exist. Aborting script ..." - echo "" - exit 55 - fi - -fi - - -echo "Creating link config.h for ${MY_ACE_CONFIG} in directory `pwd` ..." - -rm ./config.h -ln -s ${MY_ACE_CONFIG} config.h - -echo "" - -cd ${ACE_ROOT}/include/makeinclude - -if [ ${MY_ACE_GNU_MACROS:-undefined} = undefined ] -then - - if [ $AUTO -eq 1 ] - then - if [ ! -f ${MY_ACE_GNU_MACROS} ] - then - echo "" - echo "${MY_ACE_GNU_MACROS} does not exist. Aborting script ..." - echo "" - exit 66 - fi - fi - - echo "Select one of the following files for linking to config.h" - echo "" - echo "`ls platform*GNU`" - echo "" - echo "Type the filename for your compiler: \c" - - read MY_ACE_GNU_MACROS - echo "" - - if [ ! -f ${MY_ACE_GNU_MACROS} ] - then - echo "" - echo "${MY_ACE_GNU_MACROS} does not exist. Aborting script ..." - echo "" - exit 77 - fi - -fi - -echo "Creating link platform_macros.GNU for ${MY_ACE_GNU_MACROS}" -echo "in directory `pwd` ..." - -rm ./platform_macros.GNU -ln -s ${MY_ACE_GNU_MACROS} platform_macros.GNU - -echo "" - -if [ ${AUTO} -eq 0 ] -then - echo "Make ACE now with default setup? [Y/N] : \c" - read choice - echo "" -else - choice='Y' -fi - -if [ ${choice} != 'Y' -a ${choice} != 'y' ] -then - echo "" - echo "ACE make skipped. You can use to make ACE later" - echo "" - exit 0 -fi - -echo "" -echo "Making ACE now. Examine file ${ACE_ERRFILE} for errors ..." -echo "" - -cd ${ACE_ROOT} - -echo "" -echo "Executing ..." -echo "" -gmake | tee ${ACE_ERRFILE} 2>&1 - -echo "" -echo "Examine file ${ACE_ERRFILE} for possible errors ..." -echo "" -echo "********** End of myacemaker script !!! ***********" -echo "" - -# -######################################################################### diff --git a/ASNMP/COPYRIGHT b/ASNMP/COPYRIGHT deleted file mode 100644 index ad880b9cf90..00000000000 --- a/ASNMP/COPYRIGHT +++ /dev/null @@ -1,68 +0,0 @@ -Mon Jul 14 12:12:32 PDT 1997 - -These copyrights apply to the SNMP++ module shipped with the ACE library: - - -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. - -=====================================================================*/ - -/********************************************************************** - Copyright 1988, 1989, 1991, 1992 by Carnegie Mellon University - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of CMU not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. -******************************************************************/ - -Certain portions of this version of HP's SNMP++ are: - -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - diff --git a/ASNMP/ChangeLog b/ASNMP/ChangeLog deleted file mode 100644 index 3003192112b..00000000000 --- a/ASNMP/ChangeLog +++ /dev/null @@ -1,350 +0,0 @@ -Tue Dec 21 16:22:21 1999 David L. Levine - - * tests/*.cpp: removed the unnecessary explicit template - instantiation. Other instantiations were necessary - with it, and it seemed to serve no useful purpose: - there was no use of an ACE_Unbounded_Set. - Thanks to Jose Rubio for - reporting link failures with Sun CC 5.0, with explicit - template instantiation enabled. - - * tests/test_config.h: added #include of "ace/ACE.h", - because the file uses it later. g++ 2.91.66 on Linux - needed it. - -Wed Jul 14 08:26:42 1999 Brian Raven - - * asnmp/snmp.{h,cpp},wpdu.cpp: - SYNOPSIS: - 1) The agent IP address in traps originating from logical - domains on an Enterprise 10000 is that of the physical domain. - - 2) The code that gets the IP address uses gethostbyname - which is unsafe in a MT environment (according to the man page). - - DESCRIPTION: - 1) The problem seems to be caused by hostname only returning - the physical domain name. - - SAMPLE FIX/WORKAROUND: - 1) To get around this problem I added the capability to - override the local host name. - - 2) I would suggest using the GenAddress class to obtain the - IP address. - -Tue Jun 22 13:34:54 1999 David L. Levine - - * agent/Makefile: replaced rm -f with $(RM). - -Thu Apr 29 06:46:46 1999 David L. Levine - - * tests/Makefile: changed SRC to PSRC (for make depend). - Thanks to Sandeep Goyal for reporting - that the Makefile was broken. - -Mon Dec 28 22:03:57 1998 David L. Levine - - * agent/main.cpp: added #include "ace/inc_user_config.h", for - ACE_RCSID definition. Thanks to wym for - reporting that it won't compile without it. - -Tue Oct 27 08:52:05 1998 David L. Levine - - * asnmp/Makefile,tests/Makefile: added SRC definition for make depend, and updated dependencies. - -Mon Aug 3 17:50:08 1998 Gonzalo Diethelm - - * examples/get/get_async.cpp: - * examples/get/get.cpp: - Added ACE_RCSID to these files. - -Fri Jul 31 19:26:07 1998 Gonzalo Diethelm - - * examples/Makefile: - It had a missing info subdirectory. - - * agent/agent_impl.cpp: - * agent/main.cpp: - * agent/snmp_agent.cpp: - * asnmp/address.cpp: - * asnmp/asn1.cpp: - * asnmp/counter.cpp: - * asnmp/ctr64.cpp: - * asnmp/gauge.cpp: - * asnmp/integer.cpp: - * asnmp/octet.cpp: - * asnmp/oid.cpp: - * asnmp/pdu.cpp: - * asnmp/sagent.cpp: - * asnmp/snmp.cpp: - * asnmp/target.cpp: - * asnmp/timetick.cpp: - * asnmp/transaction.cpp: - * asnmp/vb.cpp: - * asnmp/wpdu.cpp: - * examples/get/get.cpp: - * examples/next/next.cpp: - * examples/set/set.cpp: - * examples/trap/trap.cpp: - * examples/walk/walk.cpp: - * tests/Address_Test.cpp: - * tests/Counter64_Test.cpp: - * tests/Counter_Test.cpp: - * tests/Gauge_Test.cpp: - * tests/Integer_Test.cpp: - * tests/Octet_Test.cpp: - * tests/Oid_Test.cpp: - * tests/Target_Test.cpp: - * tests/Varbind_Test.cpp: - Added ACE_RCSID to these files. - -Wed Jul 15 20:34:55 CDT 1998 - * general fixes for SNMPv1 trap generation code reported by - Hien Nguyen and Jeff Hall - Added Hien's fixes, plus fixed -c option - in examples/trap to properly set community string. - * release 2.0 - -Fri Jan 30 15:29:42 CST 1998 - * fix vb.cpp to handle Gauge/uInt the same way. While retrieving - ifTable found the bug. - -Wed Dec 10 12:09:36 CST 1997 - * sagent.cpp, Eric Newton fix. result not checked. v1.8 - -Mon Dec 8 14:33:59 CST 1997 - * Thanks to Eric Newton's continued patches - Version 1.7 has fixes for: agent, base library - Fix to the response type fixes the interoperability with CMU snmp on - linux. (and SNMP Research as well) - - Initialize member of Pdu: output_ - Send responses as response messages - Deallocate and reset the io_vec - - The transaction object didn't initialize the io_vec used to receive - a packet when it was used for an agent transaction. - - Cleans up a warning about using a const object from a previous - patch. - - Removes the transaction object from the Reactor. - - -Sun Nov 30 17:49:12 CST 1997 Mike MacFaden - * Thanks to Eric Newton's apply patches: - Removed G++ warnings: - Removed unused variables - Cleaned up unused args to functions - Initialized variables - Inserted casts in *printf* functions - Added int return types to function definitions - Converted some variables from int to size_t to cut down on - sign comparison warnings - Reordered constructor initializer lists - Added return statements to functions returning int - - Modified for G++ language differences: - Modified for loops for ANSI scoping rules - - Fixed Bugs: - Deleted incorrect (cut-n-pasted) header to transaction.h - Removed "assignment in if condition" error - Added missing "break;" in switch statement in wpdu - - Features: - Added async interface. - - Noise: - Modified makefiles for g++ on Linux RedHat 4.1 - - * The new async interface has a test example in examples/get/get_async.cpp - that is useful if you are extending the get application. - - * Fixed makefile to include -lasnmp when building tests/examples - - * Compile and test with ACE 4.4 on Solaris 2.5.1 using Sun CC 4.2 - no warnings/errors. get_async will sigbus however in destructors. - -Thu Sep 4 18:56:12 1997 Mike MacFaden - - * commit agent/ mibs/ and update asnmp/ with sagent.h, cpp - to implement a trivial SNMPv1 agent that hard codes support - for mib II system group only. - -Fri Aug 22 23:43:20 1997 Mike MacFaden - - * clean up two memory leaks in octet class and one umr - -Thu Aug 21 20:59:23 1997 Mike MacFaden - - * Added Netbios address support to GenAddress - and added DecNetAddress, AppleTalkAddress classes per CISCO-TC.my - (ftp://ftp.cisco.com/pub/mibs) - -Tue Aug 19 20:19:32 1997 Michael R. MacFaden - * change IpAddress::is_arpa() to is_private() and update the comments - per RFC 1597. Add new test routine to verify this function in - tests/Address_Test.cpp - - * add IpAddress::to_octet(OctetStr& val) which is useful when having to - send a network address as an Octet String as in CISCO-PING-MIB.my - -Tue Aug 5 12:12:39 1997 Mike MacFaden (mrm@mrm-ss20) - * Thanks to Amos Shapira apply patches - to support IRIX 6.3. Stated request for: - I think it would make things "righter" to make the code use C++ - strings (and maybe vectors?). - - * Begin testing on HP-UX 10.01 (missing ucontext.h) - -Sat Aug 2 12:07:43 1997 Douglas C. Schmidt - - * Started to integrate the code into a more ACE-like style, e.g., - added a the "asnmp/" prefix to all the header files so that we - don't need to play games with the -I flags and so we can always - know where we're getting the headers from. - -Fri Aug 1 19:23:52 1997 Mike MacFaden (mrm@mrm-ss20) - - * NOTES: This first version only tested on Solaris 2.5 - - * review classes for thread safety. Current thread design only - allows for one thread to safely access any ASNMP object created. - - * run purify test of get routine no -memory leaks. - - * verify both shared archive/static archive types work with - example programs - - * << Globals Changes >> - - * tested only archiver library version - - * reformat code to use one brace style. - - * changed all manifest constants defined as _XX to XX_ to stay out - of compiler namespace - - * change all OS calls to use ACE_OS:: portability layer, #include - - - * reformat code to use one consistent brace layout and redo - header using ACE - - * remove semicolons on member functions foo{}; - not necessary - - * make get() methods const member functions - - * removed unnecessary casts that looked like this: and revamped - all memory allocations via ACE_NEW macro - - new_oid = (SmiLPUINT32) new unsigned long [ smival.value.oid.len - - To - - ACE_NEW(new_oid, SmiUINT32[ smival.value.oid.len]) - - * Collapsed default constructors with constructors to constructors - with default arguments. - - * removed unused #include - - * Added ACE_TRACE() to classes - - * change get_printable() to to_string() - there will be more java - programmers in the future so this should be the first step... - - * removed ASYNC interface till it can be rebuilt using ACE patterns - - * Attempt to make interface more type strict but leaving generic - interfaces as escape hatch. Example: CTarget becomes UdpTarget - for UDP/IP based agents. - - * << Class Specific Changes >> - - * Oid class: - - remove char * routines, simplify class - - added suboid method and removed get_printable() overloads - - * CTarget class: - - renamed to UdpTarget. Stay out of Microsoft Namespace per MSJ - Article by Allen Hollub. - - * Varbind class: - - remove generic set_value for char,int, etc. Too easy to get - this wrong. Allow just types defined. - - added overload for equality operator (==) - - added new constructor to allow setting full vb state oid,value, exception - - add to_string() - - * Address class: - - change manifest constants to enums for address lengths, add IP V6 lens - - - add a netbios name class, still pretty worthless since I don't have spec - in front of me yet... - - - rewrite resolver calls to be thread safe and cleaner by moving to two - class (static) member functions: - - // thread safe routine to lookup ip address given hostname - // return <> 0 on error - static int resolve_to_addr(const char *hostname, in_addr& quad_addr); - - // thread safe routine to lookup name given ip address - // return <> 0 on error - static int resolve_to_hostname(const in_addr& quad_addr, char *hostname) - - * added some interrogation routines to class IpAddress: - is_loopback() const; - - * Ctr64 class: - - added constructor using long long datatype (needs to be made - portable to NT - - * Pdu class: add to_string() - - * Classes added wpdu class: - - a new adpater class between CMU and HP pdu, varbind data structures - - * transaction class: - - implement get/getnext timeout and retry logic using ACE - Reactor class, ACE_Time_Value - -Sat Jul 5 19:13:30 1997 Mike MacFaden (mrm@mrm-ss20) - - * unpacked snmp++.tar.Z into ACE_wrappers, remove X11 support. If - you need GUI support in a communications package, something's - wrong, very wrong.... - - * Change HP-UX Makefiles to use ACE makefile system - - * Change includes to use ACE OS Adaption Layer - - * change all OS calls to use ACE_OS:: versions - - * Add ACE_TRACE macros to all functions. - - * clean up the global namespace by puting all global functions - into C++ classes as static member functions and make public only - those that are used (uxsnmp.cpp, eventlist.cpp) - - * create README from readme.txt, COPYRIGHT files. - - * create tests/ directory rename ConsoleExamples to examples - - * cull out dead code modules and dump them into misc dir: - oidname.cpp, ipresolv.cpp - - * ipresolv.cpp had broken hostname buffer size (200), when DNS has - aways defined a max FQDN as 256...go figure. - - * add General Error handler since existing ones are not very - useful in and of themselves. - - * change all _DEF to DEF_ since _ANYTHING is reserved for compiler - writer namespace, NOT app writer - - * convert cmu code to use C++ new/delete from malloc/free so - entire library uses C++ new constructor diff --git a/ASNMP/Makefile b/ASNMP/Makefile deleted file mode 100644 index dfcb25362d9..00000000000 --- a/ASNMP/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the SNMP+ACE examples directory -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -INFO = README - -DIRS = asnmp \ - examples \ - tests -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nolocal.GNU - - -LDLIBS := -L$(ACE_ROOT)/ASNMP/asnmp -lasnmp $(LDLIBS:%=%$(VAR)) - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - - - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/ASNMP/README b/ASNMP/README deleted file mode 100644 index f07563c61a5..00000000000 --- a/ASNMP/README +++ /dev/null @@ -1,177 +0,0 @@ -Fri Dec 18 09:43:35 CST 1998 -==================================================================== -ASNMP = ACE+SNMP++ Version 2.1 -By Michael R. MacFaden mrm@acm.org, mrm@yagosys.com -==================================================================== - -What is ASNMP ? ==> ACE+SNMP! aka Another SNMP API - HP's SNMP++ 2.5 freely available C++ SNMP class library - has been adapted to the ACE 4.2 Framework. - -What is Simple Network Management Protocol(SNMP)? - See the FAQ: - http://www.snmp.com/FAQs/snmp-faq-part1.txt - http://www.snmp.com/FAQs/snmp-faq-part2.txt - - -What was changed from HP version? - See src/ChangeLog file. - -Is HP SNMP++ compatible with ASNMP? - It is neither source nor binary compatible. About 10% of the API has changed. - There have been API changes to make the interface more orthogonal - and to reduce implementation complexity such as consolidating constructors - with default formal values, and to remove some inconsistencies - with the HP interface as well as locking down valid() semantics, etc. - -What platforms have the test programs been verified on? - Solaris 2.4, 2.5.1 using SUN C++ 4.1,4.2 compiler. Linux/GCC - fixes are now in as well. - -Why use this version? - The SNMP++ version ships only for HP-UX and for Windows. - It is not very portable nor does it do a good job at checking - for out of memory exhaustion conditions (asn1.cpp). There is some great - code here. ACE needs an SNMP library to build NM type - communications applications. Hence ASNMP was born in my spare time. - -How does ASNMP differ from SNMP? - Current version uses ACE OS Adaption layer. All memory - allocation is now consistent, uses ACE_NEW(). - Standard ACE Debugging (ACE_TRACE) has been inserted. - ASNMP has less global namespace pollution by moving all non-class - functions into interface classes or made into static locals. - - An agent inteface has been added (asnmp/sagent.h) so both agents - and managers can use this class library. A trivial agent - exists in ASNMP/agent/ - - X11 GUI support removed from this version since this is - not the place to include GUI support in the new world of - multi-threaded apps. - - The async interface does not match the HP implementation. - -How to build this library - Set ACE_ROOT and platform_macros.GNU per ../INSTALL file. - create libasnmp.a, libasnmp.so and then run the tests - -Any Support for ASNMP? - As time permits from the mailing list. - -Where to ask questions? - Please use ace-users@cs.wustl.edu mailing list or mrm@acm.org - -NOTE: Please do not bother Eric Mellquist unless you are using - the original HP version of this library. - -Where can I get the original HP SNMP++? - From ftp://rosegarden.external.hp.com:/pub/snmp++ - -What version of SNMP is fully supported? - SNMP Version 1 (RFC 1155,1157, 1215) - -What about SNMP Version 2c? - V2c is defined in RFC 1901 - 1908 - These bits are added to v1 code in this library: GetBulk PDU, Counter64 - These bits are missing Inform (RFC 1905) - RFC 1903 defined new datatypes using existing SMI via macros. - These should be coded as if they were SMI datatypes to encapsulate - their behavior. V2c hasn't been deployed - -What about SNMP Version 3? - It is looking good for V3, but so far, we're just watching. - http://www.ietf.org/html.charters/snmpv3-charter.html - A C implemenation is now available from UC Davis. - -What copyrights/legal requirements are required when using this code? - See ./COPYRIGHT - -Does this really work? - See tests/ directory for the current test reports (purify/purecov/...). - -How does one Extend an SNMP Agent? - Extending an agent typically means updating the agent source or - using a dynamic link style API. RFC 2257 (AgentX) is the current design - for doing this in a standard way. This hasn't been well formalized yet - so extending an existing agent is still a vendor API thing. - - The agent provided here is a template. A mib compiler and agent - library typically provide better agent support. See the UC-Davis - SNMP software for an example Agent that is portable and can report - on many flavors of UNIX and Windows. - -Any Future Plans? - The ASNMP library will be improved for performance and made to use - higher level design patterns. Hopefully it will be used as a - vehicle for grad students to learn something about network mgmt - code work a related cousin of general distributed programming. - - -Regards, -Michael R. MacFaden -Member of the Technical Staff -Cabletron Systems, Inc. -215 Moffet Park Drive -Sunnyvale, CA 94089 -mrm@yagosys.com -http://www.yagosys.com - -==================================================================== -SNMP++ For UNIX Source Code and Examples: -==================================================================== -Included within this package can be found the source code and -examples for SNMP++. The following represents the directories which -are included within the compressed tar file and their contents. - -For more details on the API , please refer to the API specification. - -This library is a complete implementation of SNMP++ and does not -require other SNMP libraries to be present. - -Required Tools: ---------------------------------------------------------------------- - - -readme.txt ( this file) -| -| -|------ src ( .cpp files and Makefile for building libraries ) -| -|------ examples ( a variety of apps, .cpp and Makefile included ) -| -|------ tests - unit test routines - - -src Directory Contents: --------------------------------------------------------------------- -Makefile - make file for ACE/Solaris 2. build -target.cpp - Collection of attributes(address, timeout, etc) used - to define a command session -snmp.cpp - A logical session between NM app and agent -pdu.cpp - Pdu class source (vb list and API command) -wpdu.cpp - Adapter pattern based class between CMU and HP code -transaction.cpp - synchronous transaction clss -vb.cpp - Variable Binding class source (oid + value) - -<< SMI datatypes used to get/set values in SNMPv1 agents >> - -address.cpp - Address class source -gauge.cpp - Gauge32 class source -integer.cpp - Integer32 class source -counter.cpp - Counter32 class source -ctr64.cpp - Counter64 class source -timetick.cpp - TimeTicks class source -octet.cpp - Octet String class source -oid.cpp - Oid class source -asn1.cpp - ASN1 encoding and decoding code. CMU code. - -examples Directory Contents: ---------------------------------------------------------------------- -Makefile - make file for building console apps -get.cpp - source for SNMP get program -next.cpp - source for SNMP get Next program -set.cpp - source for SNMP set program -trap.cpp - source for SNMP trap send program -walk.cpp - source for SNMP walk program - diff --git a/ASNMP/TO-DO b/ASNMP/TO-DO deleted file mode 100644 index a05b7106f58..00000000000 --- a/ASNMP/TO-DO +++ /dev/null @@ -1,3 +0,0 @@ -TODO: - - Attempt to make all subroutines thread safe - - work on test suite - validate basic stuff doesn't leak diff --git a/ASNMP/agent/Makefile b/ASNMP/agent/Makefile deleted file mode 100644 index 18886acd2a7..00000000000 --- a/ASNMP/agent/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# Sample SNMPv1 Agent -# Makefile for Solaris 2.x -# $Id$ - -OBJS = main.o snmp_agent.o agent_impl.o -INCL = -I$(ACE_ROOT) -I$(ACE_ROOT)/ASNMP -CC=CC -SOL_FLAGS=-mt -R $(ACE_ROOT)/ASNMP/asnmp:$(ACE_ROOT)/ace -DEBUG = -g $(SOL_FLAGS) -CFLAGS =$(INCL) $(DEBUG) -RUNPATH = -LIBS = -L $(ACE_ROOT)/ASNMP/asnmp -lasnmp -L $(ACE_ROOT)/ace -lACE -ldl - -agent: $(OBJS) - $(CC) -o agent $(DEBUG) $(OBJS) $(LIBS) $(RUNPATH) - - -main.o: main.cpp - $(CC) -c $(CFLAGS) main.cpp - -snmp_agent.o: snmp_agent.cpp snmp_agent.h - $(CC) -c $(CFLAGS) snmp_agent.cpp - -agent_impl.o: agent_impl.cpp agent_impl.h - $(CC) -c $(CFLAGS) agent_impl.cpp - -clean: - -$(RM) *.o agent *~ diff --git a/ASNMP/agent/agent_impl.cpp b/ASNMP/agent/agent_impl.cpp deleted file mode 100644 index 0c3f8da4078..00000000000 --- a/ASNMP/agent/agent_impl.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// $Id$ - -// implement a prototype SNMP Agent using ASNMP and ACE - -#include -#include -#include - -#include "agent_impl.h" - -ACE_RCSID(agent, agent_impl, "$Id$") - -agent_impl::agent_impl(unsigned short port, const char *rd, const char *wr) : -sagent(port) -{ - ACE_TRACE("agent_impl::agent_impl"); - tgt_.set_read_community(rd); - tgt_.set_write_community(wr); - agent_clock_.start(); -} - -agent_impl::~agent_impl() -{ - ACE_TRACE("agent_impl::~agent_impl"); -} - -// callback : have received a Pdu from the target host with given read comm str -// this is really simplistic, but gives the general idea -int agent_impl::handle_get( Pdu &pdu, UdpTarget &target) -{ - ACE_TRACE("agent_impl::handle_get"); - OctetStr mgr_rd_str, agent_rd_str; - target.get_read_community(mgr_rd_str); // requster's read community string - tgt_.get_read_community(agent_rd_str); // this agent's read community string - - // 1. verify we have a valid read string else drop pdu (no response to caller) - if (mgr_rd_str != agent_rd_str) { - ACE_DEBUG((LM_DEBUG, "agent_impl::handle_get: invalid read community recvd\n")); - return 0; - } - - // 2. iterate over each varbind in the pdu, filling providing responses - int fdone = 0; - for (int i = 0; (i < pdu.get_vb_count()) && !fdone; i++) { - Vb vb; - pdu.get_vb(vb, i); - if (get_response(vb)) { // set a value for the oid if we can else - set_error_status(&pdu, SNMP_ERROR_NO_SUCH_NAME); // these ought to be member - set_error_index(&pdu, i); // functions but are not yet... - fdone++; // trigger flag to exit loop early - } - else // failed, return noSuch error - pdu.set_vb(vb, i); - } - - // 3. lastly, return the pkt to the caller - return respond(pdu, target); -} - -// this routine makes up the brains of the agent -// it knows only the MIB II system group set of variables for a get operation -int agent_impl::get_response(Vb& vb) -{ - // these objects represent the MIB II system group per RFC 1213 - static Oid sysDescr("1.3.6.1.2.1.1.1.0"), - sysObjectID("1.3.6.1.2.1.1.2.0"), sysUpTime("1.3.6.1.2.1.1.3.0"), - sysContact("1.3.6.1.2.1.1.4.0"), sysName("1.3.6.1.2.1.1.5.0"), - sysLocation("1.3.6.1.2.1.1.6.0"), sysServices("1.3.6.1.2.1.1.7.0"); - - Oid oid; - vb.get_oid(oid); - if (oid == sysDescr) { - OctetStr desc("ASNMP Prototype Agent 1.0"); - vb.set_value(desc); - } - else if (oid == sysObjectID) { // the IANA gives assigns Enterprise Numbers - // see ftp://ftp.isi.edu/in-notes/iana/assignments/enterprise-numbers - // for the official list of enterprise numbers. Then under this tree - // assign a unique subtree to identify this agent - Oid id("1.3.6.1.4.1.2533.9.1"); - vb.set_value(id); - } - else if (oid == sysUpTime) { - ACE_Time_Value tv; - agent_clock_.elapsed_time (tv); - TimeTicks tt(tv.msec()); - vb.set_value(tt); - } - else if (oid == sysContact) { - OctetStr contact("mrm@acm.org"); - vb.set_value(contact); - } - else if (oid == sysName) { - OctetStr fqdn("foo.org"); // extract this from the gethostbyname() TODO - vb.set_value(fqdn); - } - else if (oid == sysLocation) { - OctetStr loc(""); - vb.set_value(loc); - } - else if (oid == sysServices) { - SnmpInt32 svcs(72); - vb.set_value(svcs); - } - else - return 1; // noSuchName - - return 0; -} - -int agent_impl::handle_get_next( Pdu &pdu, UdpTarget &target) -{ - ACE_TRACE("agent_impl::handle_get_next -NI"); - return 0; -} - -int agent_impl::handle_set( Pdu &pdu, UdpTarget &target) -{ - ACE_TRACE("agent_impl::handle_set -NI"); - return 0; -} - -// stuff used by process_requests - -// called when SIGINT -static sig_atomic_t finished = 0; - -extern "C" void -sig_handler (int) -{ - ACE_TRACE("::sig_handler"); - finished = 1; -} - -int agent_impl::process_requests() -{ - ACE_TRACE("agent_impl::process_requests"); - ACE_Reactor reactor; - - ACE_Sig_Action sa ((ACE_SignalHandler) sig_handler, SIGINT); - ACE_UNUSED_ARG (sa); - - // Read data from other side. - if (reactor.register_handler (this, ACE_Event_Handler::READ_MASK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "ACE_Reactor::register_handler"), -1); - - // TODO: register signal handler to shut down gracefully here - - while (!finished) - { - reactor.handle_events (); - ACE_DEBUG ((LM_DEBUG, "return from handle events\n")); - } - - ACE_DEBUG ((LM_DEBUG, "return from handle events - normal shut down\n")); - return 0; -} diff --git a/ASNMP/agent/agent_impl.h b/ASNMP/agent/agent_impl.h deleted file mode 100644 index 60ee90034a2..00000000000 --- a/ASNMP/agent/agent_impl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ASNMP -// -// = FILENAME -// agent_impl.h -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ - -#ifndef AGENT_IMPL_H -#define AGENT_IMPL_H - -#include -#include -#include -#include -#include -#include - -class agent_impl : public sagent -{ -public: - agent_impl(unsigned short port, const char *rd, const char *wr); - virtual ~agent_impl(); - - virtual int handle_get( Pdu &pdu, UdpTarget &target); - // retrieve data from a peer agent for a given list of oid values - - virtual int handle_get_next( Pdu &pdu, UdpTarget &target); - // retrieve data lexically adjacent to the oids specified in the pdu - // from the peer agent - - virtual int handle_set( Pdu &pdu, UdpTarget &target); - // set data in the agent from the list of oids in the pdu - - int process_requests(); - // main loop here using a reactor object - -private: - UdpTarget tgt_; // this agent's read, write community strings - int get_response(Vb& vb); // set values for a "get" cmd - ACE_High_Res_Timer agent_clock_; // agent "uptime" ticks reported in 1/100 second -}; - -#endif /* AGENT_IMPL_H */ diff --git a/ASNMP/agent/main.cpp b/ASNMP/agent/main.cpp deleted file mode 100644 index 2aec17babbc..00000000000 --- a/ASNMP/agent/main.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// $Id$ - -// This server daemon processes SNMP Version 1 get, get-next, and set -// commands. over the MIB II "System" group only. - -#include "ace/config-all.h" -#include "snmp_agent.h" - -ACE_RCSID(agent, main, "$Id$") - -int main (int argc, char *argv[]) -{ - snmp_agent the_agent; - - if (the_agent.set_args(argc, argv)) { - return 1; - } - - if (!the_agent.valid()) { - return 1; - } - - the_agent.run(); // main loop - - return 0; -} diff --git a/ASNMP/agent/snmp_agent.cpp b/ASNMP/agent/snmp_agent.cpp deleted file mode 100644 index 43a5342a3ec..00000000000 --- a/ASNMP/agent/snmp_agent.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// $Id$ - -// This server daemon processes SNMPv1 requests over MIB II System group - -#include "snmp_agent.h" -#include "agent_impl.h" // actual implementation -#include "ace/Get_Opt.h" -#include "ace/Reactor.h" - -ACE_RCSID(agent, snmp_agent, "$Id$") - -// module globals -#define SNMP_AGENT_PORT (161) -#define WR_COM ("private") -#define RD_COM ("public") - -snmp_agent::snmp_agent() : agent_(0) -{ - ACE_TRACE("snmp_agent::snmp_agent"); -} - -snmp_agent::~snmp_agent() -{ - ACE_TRACE("snmp_agent::~snmp_agent"); - delete agent_; -} - - -int snmp_agent::valid() const -{ - ACE_TRACE("snmp_agent::valid"); - return (agent_ != 0); -} - -int snmp_agent::set_args(int argc, char *argv[]) -{ - ACE_TRACE("snmp_agent::set_args"); - unsigned short port = SNMP_AGENT_PORT; - char *rd = RD_COM, *wr = WR_COM; - - ACE_Get_Opt get_opt (argc, argv, "p:w:r:hv"); - for (int c; (c = get_opt ()) != -1; ) { - switch (c) - { - case 'p': - port = (ACE_OS::atoi (get_opt.optarg)); - break; - case 'w': // write community string - wr = get_opt.optarg; - break; - case 'r': // read community string - rd = get_opt.optarg; - break; - - case 'h': // help & version info - case 'v': - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Example SNMP Version 1 Agent - ASNMP/ACE\n")); - return -1; - break; - - default: - return -1; // invalid arg - } - } - - - agent_ = new agent_impl(port, rd, wr); // opens OS IO port - return 0; -} - -int snmp_agent::run() -{ - ACE_TRACE("snmp_agent::run"); - ACE_ASSERT(agent_); - - // open service port -#if 0 - if (agent_->open_port()) { - ACE_DEBUG((LM_DEBUG, "(%P|%t) open port %d failed\n", agent_->get_port())); - return -1; - } -#endif - - // Run forever, processing SNMP requests. - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) starting up snmp agent (server) daemon\n")); - - agent_->process_requests(); - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) shutting down snmp agent (server) daemon\n")); - return 0; -} - diff --git a/ASNMP/agent/snmp_agent.h b/ASNMP/agent/snmp_agent.h deleted file mode 100644 index a7fc4c42de8..00000000000 --- a/ASNMP/agent/snmp_agent.h +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -/* -*-C++-*- */ - -#ifndef SNMP_AGENT_ -#define SNMP_AGENT_ -// ============================================================================ -// -// = LIBRARY -// ASNMP -// -// = FILENAME -// snmp_agent.h -// -// = AUTHOR -// Michael R. MacFaden (mrm@cisco.com) -// -// ============================================================================ - -class agent_impl; - -class snmp_agent { - // = TITLE - // An SNMP v1 agent class - // - // = DESCRIPTION - // Contructs agents that are capable of processing SNMPv1 requests - // over the MIB II System group - - public: - snmp_agent(); // uses port 161, public, private - ~snmp_agent(); - - int valid() const; - // did object construct ok - - int set_args(int argc, char *argv[]); - // runtime arguments such as community strings, port to use - - int run(); - // begin processing requests - - private: - snmp_agent(const snmp_agent&); - agent_impl *agent_; -}; - -#endif // SNMP_AGENT_ diff --git a/ASNMP/asnmp-overview.html b/ASNMP/asnmp-overview.html deleted file mode 100644 index 6c119ba1323..00000000000 --- a/ASNMP/asnmp-overview.html +++ /dev/null @@ -1,133 +0,0 @@ - - -ASNMP Overview - -

ASNMP Overview

- -

The Another SNMP class library is an Object Oriented programming -toolkit for using IETF standard network management protocols in the -Internet. The SNMP protocol is perhaps the most ubiquitous management -protocol running on most very device or application deployed in the -modern network today. - -

ASNMP is targeted to programmers that want to write command and -control (C&C) applications. C&C Applications communicate with -a variety of objects: - -

  • network devices such as ATM switches, Internet routers, -LAN bridges and LAN printers -
  • Routing protocols such as OSPF -
  • database servers such as ORACLE or Informix. - -

    ASNMP Version 1 implements a blocking SNMP Version 1 with some -Version 2c additions (Counter32, Counter64 SMI values). See -SNMP Version 1 as defined in the IETF Request for Comments (RFC) - -

  • 1155 -
  • 1157 -
  • 1213 -
  • 1215 - -

    Also see the RFC 1902 spec for new SMI datatypes such as Counter64. - -

    ASNMP is built using the CMU SNMP and HP SNMP++ as the base -classes then modified for use in the ACE framework. About 10% of the API -changed during code rework. See ASNMP/asnmp/ChangeLog for details. - -

    ASNMP can be used for either manager applications or agent applications. -The Snmp class contains the interface for manager applications. The -sagent class contains the interface for agent applications. A -trivial agent that implements the mib II system group per rfc1213 is -in the agents/ directory. - -

    Class Heirarchy

    - -
    -UdpTarget - Defines a collection of attributes needed to define a 
    -             communications session with an SNMP agent 
    -            This includes  network address, response timeout, etc.
    -  
    -Snmp - A logical session between NM app and agent. Provides the
    -       commands get, get_next, trap. Manages transactions between app and 
    -       server.
    -
    -Pdu  - A container object that represents an SNMP Protocol Data Unit.
    -       A Pdu contains a command (get,getnext,trap) Varbind List list, 
    -       a community string.
    -
    -Vb   - Aka Varbind or Variable Binding.  A pdu can have zero, 
    -       one or more of these. A Vb consists of an Oid to identify 
    -       the variable and a value corresponding to  one of the SMI values. 
    -       The oid/value binding is defined in a MIB file (RFC 1155)
    -       Agents hava a MIB file that defines what each variable means.
    -       Most agents implement MIB II as defined in RFC 1156.        
    -
    -

    The Structure of Managment Information (SMI) datatypes -and related types are: -

      -
    • Address->IpAddress->UdpAddress as well as MAC, IPX, IPXSOCK, Netbios -
    • Unsigned Integer -
    • Gauge32 -
    • Integer32 -
    • Counter32 -
    • Counter64 -
    • TimeTicks -
    • OctetStr -
    • Oid -
    - -
    - -

    Sample program

    -

    A sample Object to get obtain an Agent's Systems' Description -given an network address and a community string. - -class system_id { - public: - system_id(UdpAddress addr, OctetStr read_community_string) - { - UdpTarget tgt; - Snmp snmp; - Pdu pdu; - Oid oid("1.3.6.1.2.1.1.1.0"); - Vb vb(oid); - tgt.set_address(addr); - tgt.set_read_community(read_community_string); - pdu += vb; - - if (snmp.get(pdu, tgt) == 0) { - pdu.get_vb(vb, 0); - vb.get_value(desc_); - } - else - desc_ = "" - } - - int get_description(OctetStr& description) { - description = desc_; - return 0; - } - -private: - OctetStr desc_; -}; - -

    Future Directions

    -

    Here are some areas for further work - -

  • Add OO mib parser and mib code generator -
  • Collapse the CMU/HP code into one set of classes. -
  • Add full V2c support. -
  • Size/Speed improvements - - -

    References

    - - diff --git a/ASNMP/asnmp/ChangeLog b/ASNMP/asnmp/ChangeLog deleted file mode 100644 index af4c2469745..00000000000 --- a/ASNMP/asnmp/ChangeLog +++ /dev/null @@ -1,161 +0,0 @@ -Tue Mar 16 16:28:14 1999 David L. Levine - - * address.cpp, address.h, asn1.cpp, asn1.h, counter.cpp, ctr64.cpp, - gauge.cpp, integer.cpp, octet.cpp, oid.cpp, pdu.cpp, sagent.cpp, - snmp.cpp, target.cpp, timetick.cpp, transaction.cpp, vb.cpp, - wpdu.cpp: - replaced TRUE with 1, and FALSE and NULL with 0. Thanks to - Achint Sandhu for reporting that - TRUE and FALSE weren't define on his Linux platform. - - * wpdu.cpp (set_trap_info): wrapped condition with () to - avoid g++ warning about using result of an assignment as - the condition. - - * ctr64.cpp: made MAX64 unsigned, to avoid warning about it - being to big to be signed. - -Wed Jul 15 20:27:23 1998 Mike MacFaden - * asn1.cpp - Hien Nguyen fixed these bugs: - - Problem: The V1 trap agent-addr field tag value is OCTET STRING - instead of IPADDRESS, and the time stamp field tag value is INTEGER - instead of TIME TICKS. - - Fix: Change cmu_snmp::build() to pass in the correct type for agent-addr - and time stamp. - - 2. Problem: The V1 trap enterprise OID is corrupted after is was set in - wpdu constructor. - - Fix: In wpdu::set_trap_info(), the raw_pdu enterprise OID pointer was - assigned to the raw data of an enterprise Oid object on the stack. - Changed to perform an ACE_NEW_RETURN on the raw_pdu->enterprise and - perform a memcpy to copy the OID. The allocated memory is freed in - cmu_snmp::free_pdu() as currently implemented. - - 3. The V1 trap agent-addr field is currently initialized to "0.0.0.0". - I changed wpdu::set_trap_info to initialize it to the local host IP - Address. - - 4. I noticed that the memory allocation for OID in asn1.cpp using - ACE_NEW consistently use (OID length * size(oid)) as the size. - Shouldn't it be simply OID length ? Since there are numerous instances - of this usage in asn1.cpp, I have not fixed those. If you can double - check and fix these, I appreciate it. - - -Wed Aug 20 15:11:23 1997 Mike MacFaden - - * rebuilt Makefile using g++dep - - * pdu.h pdu.cpp initialization errors fixed - - * address.h address.cpp IpAddress::to_octet() added - -Fri Aug 1 19:23:52 1997 Mike MacFaden (mrm@mrm-ss20) - - * NOTES: This first version only tested on Solaris 2.5 - - * review classes for thread safety. Current thread design only - allows for one thread to safely access any ASNMP object created. - - * run purify test of get routine no -memory leaks. - - * verify both shared archive/static archive types work with - example programs - - * << Globals Changes >> - - * tested only archiver library version - - * reformat code to use one brace style. - - * changed all manifest constants defined as _XX to XX_ to stay out - of compiler namespace - - * change all OS calls to use ACE_OS:: portability layer, #include - - - * reformat code to use one consistent brace layout and redo - header using ACE - - * remove semicolons on member functions foo{}; - not necessary - - * make get() methods const member functions - - * removed unnecessary casts that looked like this: and revamped - all memory allocations via ACE_NEW macro - - new_oid = (SmiLPUINT32) new unsigned long [ smival.value.oid.len - - To - - ACE_NEW(new_oid, SmiUINT32[ smival.value.oid.len]) - - * Collapsed default constructors with constructors to constructors - with default arguments. - - * removed unused #include - - * Added ACE_TRACE() to classes - - * change get_printable() to to_string() - there will be more java - programmers in the future so this should be the first step... - - * removed ASYNC interface till it can be rebuilt using ACE patterns - - * Attempt to make interface more type strict but leaving generic - interfaces as escape hatch. Example: CTarget becomes UdpTarget - for UDP/IP based agents. - - * << Class Specific Changes >> - - * Oid class: - - remove char * routines, simplify class - - added suboid method and removed get_printable() overloads - - * CTarget class: - - renamed to UdpTarget. Stay out of Microsoft Namespace per MSJ - Article by Allen Hollub. - - * Varbind class: - - remove generic set_value for char,int, etc. Too easy to get - this wrong. Allow just types defined. - - added overload for equality operator (==) - - added new constructor to allow setting full vb state oid,value, exception - - add to_string() - - * Address class: - - change manifest constants to enums for address lengths, add IP V6 lens - - - add a netbios name class, still pretty worthless since I don't have spec - in front of me yet... - - - rewrite resolver calls to be thread safe and cleaner by moving to two - class (static) member functions: - - // thread safe routine to lookup ip address given hostname - // return <> 0 on error - static int resolve_to_addr(const char *hostname, in_addr& quad_addr); - - // thread safe routine to lookup name given ip address - // return <> 0 on error - static int resolve_to_hostname(const in_addr& quad_addr, char *hostname) - - * added some interrogation routines to class IpAddress: - is_loopback() const; - - * Ctr64 class: - - added constructor using long long datatype (needs to be made - portable to NT - - * Pdu class: add to_string() - - * Classes added wpdu class: - - a new adpater class between CMU and HP pdu, varbind data structures - - * transaction class: - - implement get/getnext timeout and retry logic using ACE - Reactor class, ACE_Time_Value - diff --git a/ASNMP/asnmp/Makefile b/ASNMP/asnmp/Makefile deleted file mode 100644 index 21fb5b64acc..00000000000 --- a/ASNMP/asnmp/Makefile +++ /dev/null @@ -1,802 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id$ -# -# Makefile for the SNMP+ACE Release -#---------------------------------------------------------------------------- - -MAKEFILE = Makefile -LIB = libasnmp.a -SHLIB = libasnmp.$(SOEXT) - -FILES = address \ - asn1 \ - counter \ - ctr64 \ - gauge \ - integer \ - octet \ - oid \ - pdu \ - snmp \ - target \ - timetick \ - transaction \ - vb \ - wpdu \ - sagent - -TEMPLATE_FILES = - -DEFS = $(addsuffix .h,$(FILES)) -DEFS += $(addsuffix .i,$(FILES)) -LSRC = $(addsuffix .cpp,$(FILES)) -#LSRC2 = $(addsuffix .cpp,$(TEMPLATE_FILES)) - -#### Build the SNMP++ shared library _before_ the static library. -#### This works around an apparent problem with template -#### instantiation with Sun C++ 4.1 and 4.2 (the symptom is link -#### error due to ACE_TimeValue::normalize () not being found). -BUILD = $(VSHLIB) $(SHLIBA) $(VLIB) - -# For make depend: -SRC = -I.. - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -CCFLAGS += -I$(ACE_ROOT)/ASNMP/ - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - - -.obj/address.o .obj/address.so .shobj/address.o .shobj/address.so: address.cpp ../asnmp/address.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/smival.h ../asnmp/smi.h ../asnmp/octet.h - -.obj/asn1.o .obj/asn1.so .shobj/asn1.o .shobj/asn1.so: asn1.cpp ../asnmp/asn1.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/snmp.h \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers_T.h \ - $(ACE_ROOT)/ace/Containers_T.i \ - $(ACE_ROOT)/ace/Containers_T.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.i \ - $(ACE_ROOT)/ace/Based_Pointer_T.cpp \ - $(ACE_ROOT)/ace/Based_Pointer_Repository.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/SOCK_Dgram.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/QoS_Session.h \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ - ../asnmp/oid.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/vb.h \ - ../asnmp/snmperrs.h ../asnmp/timetick.h ../asnmp/integer.h \ - ../asnmp/counter.h ../asnmp/gauge.h ../asnmp/ctr64.h ../asnmp/octet.h \ - ../asnmp/address.h ../asnmp/target.h ../asnmp/pdu.h \ - ../asnmp/transaction_result.h - -.obj/counter.o .obj/counter.so .shobj/counter.o .shobj/counter.so: counter.cpp ../asnmp/counter.h ../asnmp/smival.h \ - ../asnmp/smi.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/integer.h - -.obj/ctr64.o .obj/ctr64.so .shobj/ctr64.o .shobj/ctr64.so: ctr64.cpp ../asnmp/ctr64.h ../asnmp/smival.h ../asnmp/smi.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i - -.obj/gauge.o .obj/gauge.so .shobj/gauge.o .shobj/gauge.so: gauge.cpp ../asnmp/gauge.h ../asnmp/integer.h \ - ../asnmp/smival.h ../asnmp/smi.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i - -.obj/integer.o .obj/integer.so .shobj/integer.o .shobj/integer.so: integer.cpp ../asnmp/integer.h ../asnmp/smival.h \ - ../asnmp/smi.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i - -.obj/octet.o .obj/octet.so .shobj/octet.o .shobj/octet.so: octet.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/octet.h ../asnmp/smival.h ../asnmp/smi.h - -.obj/oid.o .obj/oid.so .shobj/oid.o .shobj/oid.so: oid.cpp ../asnmp/oid.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/smival.h ../asnmp/smi.h - -.obj/pdu.o .obj/pdu.so .shobj/pdu.o .shobj/pdu.so: pdu.cpp ../asnmp/snmp.h \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers_T.h \ - $(ACE_ROOT)/ace/Containers_T.i \ - $(ACE_ROOT)/ace/Containers_T.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.i \ - $(ACE_ROOT)/ace/Based_Pointer_T.cpp \ - $(ACE_ROOT)/ace/Based_Pointer_Repository.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/SOCK_Dgram.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/QoS_Session.h \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ - ../asnmp/oid.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/vb.h \ - ../asnmp/snmperrs.h ../asnmp/timetick.h ../asnmp/integer.h \ - ../asnmp/counter.h ../asnmp/gauge.h ../asnmp/ctr64.h ../asnmp/octet.h \ - ../asnmp/address.h ../asnmp/target.h ../asnmp/pdu.h \ - ../asnmp/transaction_result.h - -.obj/snmp.o .obj/snmp.so .shobj/snmp.o .shobj/snmp.so: snmp.cpp ../asnmp/snmp.h \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers_T.h \ - $(ACE_ROOT)/ace/Containers_T.i \ - $(ACE_ROOT)/ace/Containers_T.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.i \ - $(ACE_ROOT)/ace/Based_Pointer_T.cpp \ - $(ACE_ROOT)/ace/Based_Pointer_Repository.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/SOCK_Dgram.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/QoS_Session.h \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ - ../asnmp/oid.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/vb.h \ - ../asnmp/snmperrs.h ../asnmp/timetick.h ../asnmp/integer.h \ - ../asnmp/counter.h ../asnmp/gauge.h ../asnmp/ctr64.h ../asnmp/octet.h \ - ../asnmp/address.h ../asnmp/target.h ../asnmp/pdu.h \ - ../asnmp/transaction_result.h ../asnmp/enttraps.h ../asnmp/asn1.h \ - ../asnmp/wpdu.h ../asnmp/transaction.h - -.obj/target.o .obj/target.so .shobj/target.o .shobj/target.so: target.cpp ../asnmp/target.h \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/INET_Addr.i \ - ../asnmp/address.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/octet.h \ - ../asnmp/oid.h - -.obj/timetick.o .obj/timetick.so .shobj/timetick.o .shobj/timetick.so: timetick.cpp ../asnmp/timetick.h ../asnmp/integer.h \ - ../asnmp/smival.h ../asnmp/smi.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i - -.obj/transaction.o .obj/transaction.so .shobj/transaction.o .shobj/transaction.so: transaction.cpp \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers_T.h \ - $(ACE_ROOT)/ace/Containers_T.i \ - $(ACE_ROOT)/ace/Containers_T.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.i \ - $(ACE_ROOT)/ace/Based_Pointer_T.cpp \ - $(ACE_ROOT)/ace/Based_Pointer_Repository.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - ../asnmp/transaction.h ../asnmp/target.h \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/INET_Addr.i \ - ../asnmp/address.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/octet.h \ - ../asnmp/oid.h ../asnmp/pdu.h ../asnmp/vb.h ../asnmp/snmperrs.h \ - ../asnmp/timetick.h ../asnmp/integer.h ../asnmp/counter.h \ - ../asnmp/gauge.h ../asnmp/ctr64.h ../asnmp/transaction_result.h \ - ../asnmp/wpdu.h ../asnmp/asn1.h ../asnmp/snmp.h \ - $(ACE_ROOT)/ace/SOCK_Dgram.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/QoS_Session.h \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i - -.obj/vb.o .obj/vb.so .shobj/vb.o .shobj/vb.so: vb.cpp ../asnmp/oid.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/smival.h ../asnmp/smi.h ../asnmp/vb.h ../asnmp/snmperrs.h \ - ../asnmp/timetick.h ../asnmp/integer.h ../asnmp/counter.h \ - ../asnmp/gauge.h ../asnmp/ctr64.h ../asnmp/octet.h ../asnmp/address.h - -.obj/wpdu.o .obj/wpdu.so .shobj/wpdu.o .shobj/wpdu.so: wpdu.cpp ../asnmp/wpdu.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/asn1.h ../asnmp/snmp.h \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers_T.h \ - $(ACE_ROOT)/ace/Containers_T.i \ - $(ACE_ROOT)/ace/Containers_T.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.i \ - $(ACE_ROOT)/ace/Based_Pointer_T.cpp \ - $(ACE_ROOT)/ace/Based_Pointer_Repository.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/SOCK_Dgram.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/QoS_Session.h \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ - ../asnmp/oid.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/vb.h \ - ../asnmp/snmperrs.h ../asnmp/timetick.h ../asnmp/integer.h \ - ../asnmp/counter.h ../asnmp/gauge.h ../asnmp/ctr64.h ../asnmp/octet.h \ - ../asnmp/address.h ../asnmp/target.h ../asnmp/pdu.h \ - ../asnmp/transaction_result.h ../asnmp/enttraps.h - -.obj/sagent.o .obj/sagent.so .shobj/sagent.o .shobj/sagent.so: sagent.cpp \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers_T.h \ - $(ACE_ROOT)/ace/Containers_T.i \ - $(ACE_ROOT)/ace/Containers_T.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.h \ - $(ACE_ROOT)/ace/Based_Pointer_T.i \ - $(ACE_ROOT)/ace/Based_Pointer_T.cpp \ - $(ACE_ROOT)/ace/Based_Pointer_Repository.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/SOCK_Dgram.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/QoS_Session.h \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_Dgram.i \ - ../asnmp/oid.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/vb.h \ - ../asnmp/snmperrs.h ../asnmp/timetick.h ../asnmp/integer.h \ - ../asnmp/counter.h ../asnmp/gauge.h ../asnmp/ctr64.h ../asnmp/octet.h \ - ../asnmp/address.h ../asnmp/target.h ../asnmp/pdu.h ../asnmp/snmp.h \ - ../asnmp/transaction_result.h ../asnmp/sagent.h \ - ../asnmp/transaction.h ../asnmp/wpdu.h ../asnmp/asn1.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/ASNMP/asnmp/TODO b/ASNMP/asnmp/TODO deleted file mode 100644 index 12beb91406b..00000000000 --- a/ASNMP/asnmp/TODO +++ /dev/null @@ -1,25 +0,0 @@ -This is the todo list aka wish list: feel free to add/implmement -Fri Aug 1 19:40:55 PDT 1997 - -0) collapse CMU and HP code - make this thing faster since it is really - slow and bulky... - -1) implement response time statistics collection so that timeout can vary based - on empirical response times - -2) Implement pdu fragmentation based on tooBig errors or app directed - Snmp::set_pdu_max_size() command - -3) implement async interface - -4) make templatized version to implement sync/nonsync (thread safe version) - -5) add V2c when a real agent is in the field that supports it - -6) Add DISMAN support when IETF approves the Expression Mib - -7) way too many procedural case stmts in the code... - -8) add compare_right() method to be orthogonal to oid class. - - diff --git a/ASNMP/asnmp/address.cpp b/ASNMP/asnmp/address.cpp deleted file mode 100644 index 230788e9f67..00000000000 --- a/ASNMP/asnmp/address.cpp +++ /dev/null @@ -1,2686 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// address.cpp -// -// = DESCRIPTION -// The Vb class is an encapsulation of the snmp variable binding. -// This module contains the class definition for the variable binding (VB) -// class. The VB class is an encapsulation of a SNMP VB. A VB object is -// composed of one SNMP++ Oid and one SMI value. The Vb class utilizes Oid -// objects and thus requires the Oid class. To use this class, -// set oid, value then call valid() to be sure object was constructed correctly. -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. - =====================================================================*/ - -#include "asnmp/address.h" - -ACE_RCSID(asnmp, address, "$Id$") - -//================================================================= -//======== Abstract Address Class Implementation ================== -//================================================================= - -// allow destruction of derived classes -Address::~Address() -{ -} - - -//----------------------------------------------------------------- -// is the address object valid? -int Address::valid() const -{ - return valid_flag; -} - -//------------[ Address::trim_white_space( char * ptr) ]------------ -// destructive trim white space -void Address::trim_white_space( char * ptr) -{ - char *tmp; - - tmp = ptr; - // skip leading white space - while (*tmp==' ')tmp++; - ACE_OS::strcpy(ptr,tmp); - - // find end of string - while ((*tmp!=' ') && (*tmp !=0)) tmp++; - if (*tmp!=0) *tmp=0; -} - -//TM: this is not used nor needed, remove? -//-----[ element access ]---------------------------------------------- -unsigned char& Address::operator[]( const int position) -{ - if ( position < MAX_ADDR_SZ) - return address_buffer[ position]; - else - return address_buffer[0]; -} - - -//----------------------------------------------------------------------- -// overloaded equivlence operator, are two addresses equal? -int operator==( const Address &lhs, const Address &rhs) -{ - if ( strcmp( (const char*) lhs, (const char*)rhs)==0) - return 1; - else - return 0; -} - -//----------------------------------------------------------------------- -// overloaded equivlence operator, are two addresses equal? -int operator!=( const Address &lhs, const Address &rhs) -{ - return (!( lhs == rhs)); -} - - -//------------------------------------------------------------------ -// overloaded > operator, is a1 > a2 -int operator>( const Address &lhs, const Address &rhs) -{ - if ( strcmp( (const char*) lhs, (const char*)rhs)>0) - return 1; - else - return 0; -} - -// overloaded >= operator, is a1 > a2 -int operator>=( const Address &lhs,const Address &rhs) -{ - if (( lhs > rhs) || ( lhs == rhs)) - return 1; - else - return 0; -} - -// overloaded < operator, is a1 <= a2 -int operator<=( const Address &lhs,const Address &rhs) -{ - if (( lhs < rhs) || ( lhs == rhs)) - return 1; - else - return 0; - -} - - -//----------------------------------------------------------------- -// overloaded < operator, is a1 < a2 -int operator<( const Address &lhs, const Address &rhs) -{ - if ( strcmp( (const char*) lhs, (const char*)rhs)<0) - return 1; - else - return 0; -} - -//------------------------------------------------------------------ -// equivlence operator overloaded, are an address and a string equal? -int operator==( const Address &lhs,const char *rhs) -{ - if (!rhs && !lhs.valid()) - return 1; - if (strcmp( (const char *) lhs, rhs)== 0) - return 1; - else - return 0; -} - -//------------------------------------------------------------------ -// not equal operator overloaded, are an address and a string not equal? -int operator!=( const Address &lhs,const char *rhs) -{ - return (!( lhs == rhs)); -} - -//------------------------------------------------------------------ -// overloaded > , is a > inaddr -int operator>( const Address &lhs,const char *rhs) -{ - if (!rhs) - return lhs.valid(); // if lhs valid then > 0, else invalid !> 0 - if (strcmp( (const char *) lhs, rhs)> 0) - return 1; - else - return 0; -} - -//------------------------------------------------------------------ -// overloaded >= , is a >= inaddr -int operator>=( const Address &lhs,const char *rhs) -{ - if (!rhs) - return 1; // always >= 0 - if (strcmp( (const char *) lhs, rhs)>= 0) - return 1; - else - return 0; -} - -//----------------------------------------------------------------- -// overloaded < , are an address and a string equal? -int operator<( const Address &lhs,const char *rhs) -{ - if (!rhs) - return 0; // always >= 0 - if (strcmp( (const char *) lhs, rhs)< 0) - return 1; - else - return 0; -} - -//----------------------------------------------------------------- -// overloaded <= , is a <= inaddr -int operator<=( const Address &lhs,const char *rhs) -{ - if (!rhs) - return !lhs.valid(); // invalid == 0, else valid > 0 - if (strcmp( (const char *) lhs, rhs)<= 0) - return 1; - else - return 0; -} - - -//===================================================================== -//============ IPAddress Implementation =============================== -//===================================================================== - -//-----------[ syntax type ]---------------------------------------------- -SmiUINT32 IpAddress::get_syntax() -{ - return sNMP_SYNTAX_IPADDR; -} - -//-----[ IP Address copy constructor ]--------------------------------- -IpAddress::IpAddress(const IpAddress &ipaddr) -{ - // always initialize what type this object is - smival.syntax = sNMP_SYNTAX_IPADDR; - smival.value.string.len =IPV4LEN; - smival.value.string.ptr = address_buffer; - - iv_friendly_name_[0] = 0; - iv_friendly_name_status_ = 0; - valid_flag = ipaddr.valid_flag; - if (valid_flag) { - ACE_OS::memcpy(address_buffer, ipaddr.address_buffer,IPV4LEN); - ACE_OS::strcpy( iv_friendly_name_, ipaddr.iv_friendly_name_); - } - - IpAddress::format_output(); -} - - -//-------[ default construct, an IP address with a string ]--------------------- -IpAddress::IpAddress( const char *inaddr): Address() -{ - // always initialize what type this object is - smival.syntax = sNMP_SYNTAX_IPADDR; - smival.value.string.len = IPV4LEN; - smival.value.string.ptr = address_buffer; - - if (ACE_OS::strlen(inaddr) == 0) { - - valid_flag = 0; - iv_friendly_name_[0] = 0; - iv_friendly_name_status_ = 0; - IpAddress::format_output(); - return; - } - - // parse_address initializes valid, address_buffer & iv_friendly_name_ - valid_flag = parse_address(inaddr); - IpAddress::format_output(); -} - - -//-----[ construct an IP address with a GenAddress ]--------------------- -IpAddress::IpAddress( const GenAddress &genaddr) -{ - // always initialize what type this object is - smival.syntax = sNMP_SYNTAX_IPADDR; - smival.value.string.len = IPV4LEN; - smival.value.string.ptr = address_buffer; - - valid_flag = 0; - iv_friendly_name_[0] = 0; - iv_friendly_name_status_ = 0; - // allow use of an ip or udp genaddress - if (genaddr.get_type() == type_ip) { - valid_flag = genaddr.valid(); - if ( valid_flag) { - // copy in the IP address data - IpAddress temp_ip( (const char *) genaddr); - *this = temp_ip; - } - } - else - if (genaddr.get_type() == type_udp) { - valid_flag = genaddr.valid(); - if ( valid_flag) { - // copy in the IP address data - UdpAddress temp_udp( (const char *) genaddr); - *this = temp_udp; - } - } - IpAddress::format_output(); -} - -//-----[ destructor ]-------------------------------------------------- -IpAddress::~IpAddress() -{ -} - -// assumes member data is word aligned to avoid sigbus -int IpAddress::is_loopback() const -{ - if (valid()) { - return (*(u_long *)&address_buffer == INADDR_LOOPBACK); - } - return 0; -} - -int IpAddress::is_multicast() const -{ - if (valid()) { - return (IN_MULTICAST(*(u_long *)&address_buffer)); - } - return 0; -} - -// Private addressess not are not assignable in the Internet, they are -// defined in RFC 1597 as: 10, 172.16, and 192.168.0 -// Some companies use them internally and apply NAT to allow translation -// instead of paying for ip networks. -// Cisco IOS devices can provide NAT aka Network Address Translation -// but don't expect SNMP based networks to handle cross-NAT address spaces. -// assumes storage in network byte order mrm@cisco.com 7/28/97 - -int IpAddress::is_private() const -{ - if (valid()) { - if (address_buffer[0] == 10) - return 1; - if (address_buffer[0] == 172 && address_buffer[1] == 16) - return 1; - if (address_buffer[0] == 192 && address_buffer[1] == 168 && - address_buffer[2] == 0) - return 1; - } - return 0; -} - - -// convert address into octet string format in network byte order -void IpAddress::to_octet(OctetStr& octet) const -{ - octet.set_data( smival.value.string.ptr, smival.value.string.len); -} - - -int IpAddress::is_broadcast() const -{ - if (valid()) { - return ( (*(u_long *)&address_buffer) & INADDR_BROADCAST); - } - return 0; -} - -//-----[ IP Address general = operator ]------------------------------- -SnmpSyntax& IpAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag = 0; // will get set 1 if really valid - iv_friendly_name_[0]=0; - - if (val.valid()) { - switch (val.get_syntax()) { - case sNMP_SYNTAX_IPADDR: - case sNMP_SYNTAX_OCTETS: - if (((IpAddress &)val).smival.value.string.len ==IPV4LEN) { - ACE_OS::memcpy(address_buffer, - ((IpAddress &)val).smival.value.string.ptr,IPV4LEN); - valid_flag = 1; - } - break; - - // NOTE: as a value add, other types could have "logical" - // mappings, i.e. integer32 and unsigned32 - } - } - IpAddress::format_output(); - return *this; -} - -//------[ assignment to another ipaddress object overloaded ]----------------- -IpAddress& IpAddress::operator=( const IpAddress &ipaddress) -{ - // protect against assignment from itself - if ( this == &ipaddress ) - return *this; - - valid_flag = ipaddress.valid_flag; - iv_friendly_name_[0]=0; - - if (valid_flag) { - ACE_OS::memcpy(address_buffer, ipaddress.address_buffer, IPV4LEN); - ACE_OS::strcpy(iv_friendly_name_, ipaddress.iv_friendly_name_); - } - IpAddress::format_output(); - return *this; -} - - -//--------[ create a new instance of this Value ]----------------------- -SnmpSyntax *IpAddress::clone() const -{ - return (SnmpSyntax *) new IpAddress(*this); -} - -//-------[ return the Fully Qualified Domain Name ]---------------------- -char *IpAddress::resolve_hostname(int &status) -{ - if ((iv_friendly_name_[0] == 0) && valid_flag) - addr_to_friendly(); - status = iv_friendly_name_status_; - return iv_friendly_name_; -} - -// parse a dotted string -int IpAddress::parse_dotted_ipstring( const char *inaddr) -{ - char *ip_token; - int token_count=0; - unsigned int value; - int error_status = 0; - char temp[MAXHOSTNAMELEN +1]; // temp buffer for destruction - int z,w; - - // check len, an ip can never be bigger than 15 - // 123456789012345 - // XXX.XXX.XXX.XXX - if ( !inaddr || (ACE_OS::strlen( inaddr) > 30)) - return 0; - ACE_OS::strcpy( temp, inaddr); - trim_white_space( temp); - if ( ACE_OS::strlen( temp) > 15) - return 0; - - // must only have three dots - // strtok will not catch this ! - char *ptr = temp; - int dot_count = 0; - while ( *ptr != 0) { - if ( *ptr == '.') dot_count++; - ptr++; - } - if ( dot_count != 3) - return 0; - - // look for dot token separator - ip_token = strtok( (char *) temp,"."); - - // while more tokens.. - while ( ip_token != 0) { - // verify that the token is all numerics - w = ACE_OS::strlen( ip_token); - if (w>3) - return 0; - for (z=0;z '9')) - return 0; - - value = ( unsigned int) strtod(ip_token,0); - if (( value > 0)&& ( value <=255)) - address_buffer[token_count] = (unsigned char) value; - else - if ( strcmp(ip_token,"0")==0) - address_buffer[token_count]= (unsigned char) 0; - else - error_status = 1; - token_count++; - ip_token = strtok( 0, "."); - } - - // gota be four in len - if ( token_count != 4) - return 0; - - // any parsing errors? - if ( error_status) - return 0; - - return 1; -} - -//-----[ IP Address parse Address ]--------------------------------- -int IpAddress::parse_address( const char *inaddr) -{ - // parse the input char array - // fill up internal buffer with four ip bytes - // set and return validity flag - - in_addr ipAddr; - char ds[MAXHOSTNAMELEN +1]; - - // intialize the friendly_name member variable - iv_friendly_name_[0] = 0; - iv_friendly_name_status_ = 0; - - // is this a dotted IP notation string or - // a friendly name - if ( parse_dotted_ipstring( inaddr)) { - - // since this is a valid dotted string - // don't do any DNS (Performance!) - return 1; - } - else { - int rc; - if ((rc = resolve_to_address(inaddr, ipAddr)) == 0) { - - // now lets check out the dotted string - ACE_OS::strncpy( ds, ACE_OS::inet_ntoa(ipAddr), MAXHOSTNAMELEN); - - if ( !parse_dotted_ipstring( ds)) - return 0; - - // save the friendly name - ACE_OS::strcpy( iv_friendly_name_, inaddr); - return 1; - - } // end if lookup result - else { - iv_friendly_name_status_ = rc; - return 0; - } - } // end else not a dotted string - return 1; -} - -// using the currently defined address, do a DNS -// and try to fill up the name -int IpAddress::addr_to_friendly() -{ - in_addr ipAddr; - long result = ACE_OS::inet_addr(to_string()); - if (result == -1) - return -1; // expected a dotted quad! - - ipAddr.s_addr = result; - - // set iv_friendly_name_ from ipAddr - if (resolve_to_hostname(ipAddr, iv_friendly_name_) == 0) { - return 0; - } - else { - iv_friendly_name_status_ = h_errno; - return iv_friendly_name_status_; - } -} - -// static aka class member function (1.2.3.4 -> foo.com) -int IpAddress::resolve_to_hostname(const in_addr& quad_addr, char *hostname) -{ - struct hostent lookupResult; - int loc_errno = 0; - ACE_HOSTENT_DATA buffer; - ACE_OS::memset(&lookupResult, 0, sizeof(struct hostent)); - ACE_OS::memset(&buffer, 0, sizeof(ACE_HOSTENT_DATA)); - - // reverse lookup (requires in-addr.arpa to be setup in DNS - if (ACE_OS::gethostbyaddr_r((const char *)&quad_addr.s_addr, IPV4LEN, - AF_INET, &lookupResult, buffer, &loc_errno)) { - - // verify right type of record - if (lookupResult.h_addrtype == AF_INET && - lookupResult.h_length == IPV4LEN) { - ACE_OS::strcpy( hostname, lookupResult.h_name); - // setup multiple entries - return 0; - } - else { - ACE_ASSERT(0); // todo add trace and debug and dump - return -1; // wrong resource record type - } - } - - return loc_errno; -} - -// static aka class member function (foo.com -> 1.2.3.4) -int IpAddress::resolve_to_address(const char *hostname, in_addr& quad_addr) -{ - struct hostent lookupResult; - ACE_HOSTENT_DATA buffer; - ACE_OS::memset(&buffer, 0, sizeof(ACE_HOSTENT_DATA)); - ACE_OS::memset(&lookupResult, 0, sizeof(struct hostent)); - int loc_errno = 0; - if (ACE_OS::gethostbyname_r( hostname, &lookupResult, buffer, &loc_errno)) { - if (lookupResult.h_length == sizeof(in_addr) && - lookupResult.h_addrtype == AF_INET) { - ACE_OS::memcpy((void *) &quad_addr, - (void *) lookupResult.h_addr_list[0], sizeof(in_addr)); - return 0; - } - else - return -1; // wrong address size - } - return loc_errno; -} - -//----[ IP address char * cast ]-------------------------------------- -IpAddress::operator const char *() const -{ - return (char *)output_buffer; -} - -//----[ IP address get char representation ]-------------------------- -char * IpAddress::to_string() -{ - return (char *)output_buffer; -} - -//----[ IP address format output ]------------------------------------ -void IpAddress::format_output() -{ - // if valid format else null it - if ( valid_flag) - ACE_OS::sprintf( (char *) output_buffer,"%d.%d.%d.%d",address_buffer[0], - address_buffer[1], address_buffer[2], address_buffer[3]); - else - output_buffer[0] = 0; -} - -//------[ return the type ]---------------------------------- -addr_type IpAddress::get_type() const -{ - return type_ip; -} - -//----------------------------------------------------------------- -// logically and two IPaddresses and -// return the new one -void IpAddress::mask( const IpAddress& ipaddr) -{ - if ( this->valid() && ipaddr.valid()) { - this->address_buffer[0] = this->address_buffer[0] & ipaddr.address_buffer[0]; - this->address_buffer[1] = this->address_buffer[1] & ipaddr.address_buffer[1]; - this->address_buffer[2] = this->address_buffer[2] & ipaddr.address_buffer[2]; - this->address_buffer[3] = this->address_buffer[3] & ipaddr.address_buffer[3]; - format_output(); - } - -} - -//======================================================================= -//========== DNS Iterator Implementation ================================ -//======================================================================= - - -Address_Iter::Address_Iter(const char *hostname): valid_(0), count_(0), - entry_(0) -{ - ACE_OS::memset(&buffer_, 0, sizeof(ACE_HOSTENT_DATA)); - ACE_OS::memset(&lookupResult_, 0, sizeof(struct hostent)); - if (ACE_OS::inet_addr(hostname) == -1) - valid_ = query_dns(hostname); - else { - ACE_ASSERT(0); // don't support dot-quad lookup yet - } - - // count number of hostnames - int n; - char **pc; - for (n = 0, pc = lookupResult_.h_addr_list; *pc != 0; ++n, ++pc); - count_ = n; // plus first one - entry_ = lookupResult_.h_addr_list; -} - -int Address_Iter::valid() const -{ - return (valid_ == 1); -} - -int Address_Iter::how_many_addresses() -{ - return count_; -} - -// return next entry, rc = 0, if entry is null return 0 -int Address_Iter::next(IpAddress& addr) -{ - if (!entry_ || *entry_ == 0) - return 1; - - IpAddress tmp(*entry_++); // return data - addr = tmp; - if (*entry_ == 0) - return 1; - return 0; -} - -// query DNS here -int Address_Iter::query_dns(const char *hostname) -{ - int loc_errno = 0; - if (ACE_OS::gethostbyname_r( hostname, &lookupResult_, buffer_, - &loc_errno)) { - if (lookupResult_.h_length == sizeof(IPV4LEN) && - lookupResult_.h_addrtype == AF_INET) { - return 0; - } - else - return -1; // wrong address size - } - return loc_errno; -} - -//======================================================================= -//========== Udp Address Implementation ================================= -//======================================================================= - -//-----------[ syntax type ]---------------------------------------------- -SmiUINT32 UdpAddress::get_syntax() -{ - return sNMP_SYNTAX_OCTETS; -} - -//-----------------[ construct an Udp address with another Udp address ]--- -UdpAddress::UdpAddress( const UdpAddress &udpaddr):IpAddress(udpaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = UDPIPV4LEN; - smival.value.string.ptr = address_buffer; - - // Copy the port value - set_port(udpaddr.get_port()); - format_output(); -} - -// default constructor with a dotted string -UdpAddress::UdpAddress( const char *inaddr):IpAddress() -{ - if (ACE_OS::strlen(inaddr) == 0) { - // Inherits IP Address attributes - // Always initialize (override) what type this object is - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = UDPIPV4LEN; - smival.value.string.ptr = address_buffer; - set_port(0); - format_output(); - return; - } - - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = UDPIPV4LEN; - smival.value.string.ptr = address_buffer; - - valid_flag = parse_address( (char *)inaddr); - format_output(); -} - -//-----------------[ construct a UdpAddress from a GenAddress ]-------------- -UdpAddress::UdpAddress( const GenAddress &genaddr):IpAddress() -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = UDPIPV4LEN; - smival.value.string.ptr = address_buffer; - - unsigned int port = 0; - valid_flag = 0; - - // allow use of an ip or udp genaddress - if (genaddr.get_type() == type_udp) - { - valid_flag = genaddr.valid(); - if ( valid_flag) - { - // copy in the IP address data - UdpAddress temp_udp( (const char *) genaddr); - *this = temp_udp; - - // port info since are making an UpAddress - port = temp_udp.get_port(); - } - } - else - if (genaddr.get_type() == type_ip) - { - valid_flag = genaddr.valid(); - if ( valid_flag) - { - // copy in the IP address data - IpAddress temp_ip( (const char *) genaddr); - *this = temp_ip; - } - } - set_port(port); - format_output(); -} - - -//--------[ construct a udp from an IpAddress ]-------------------------- -UdpAddress::UdpAddress( const IpAddress &ipaddr):IpAddress(ipaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = UDPIPV4LEN; - smival.value.string.ptr = address_buffer; - - set_port(0); - format_output(); -} - - -//-----[ destructor ]-------------------------------------------------- -UdpAddress::~UdpAddress() -{ -} - - - // copy an instance of this Value -SnmpSyntax& UdpAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag=0; // will get set 1 if really valid - if (val.valid()){ - switch (val.get_syntax()){ - case sNMP_SYNTAX_IPADDR: - { - UdpAddress temp_udp(val.to_string()); - *this = temp_udp; // valid_flag is set by the udp assignment - } - break; - - case sNMP_SYNTAX_OCTETS: - if (((UdpAddress &)val).smival.value.string.len == UDPIPV4LEN){ - ACE_OS::memcpy(address_buffer, - ((UdpAddress &)val).smival.value.string.ptr, UDPIPV4LEN); - iv_friendly_name_[0] = 0; - valid_flag = 1; - } - break; - - // NOTE: as a value add, other types could have "logical" - // mappings, i.e. integer32 and unsigned32 - } - } - format_output(); - return *this; -} - - // assignment to another UdpAddress object overloaded -UdpAddress& UdpAddress::operator=( const UdpAddress &udpaddr) -{ - // protect against assignment from itself - if ( this == &udpaddr ) - return *this; - - (IpAddress &)*this = udpaddr; // use ancestor assignment for ipaddr value - set_port(udpaddr.get_port()); // copy to port value - format_output(); - return *this; -} - - -//-----[ IP Address parse Address ]--------------------------------- -int UdpAddress::parse_address( const char *inaddr) -{ - char buffer[MAXHOSTNAMELEN +1]; - - unsigned short port = 0; - if (inaddr && (ACE_OS::strlen( inaddr)< MAXHOSTNAMELEN +1)) - ACE_OS::strcpy( buffer, inaddr); - else { - valid_flag = 0; - return 0; - } - // look for port info @ the end of the string - // port can be delineated by a ':' or a '/' - // if neither are present then just treat it - // like a normal IpAddress - char *tmp; - tmp = ACE_OS::strstr( buffer,":"); - if (tmp==0) - tmp = ACE_OS::strstr(buffer,"/"); - - if ( tmp != 0) { - *tmp=0; // null terminator - tmp++; - port = ACE_OS::atoi( tmp); - } - - set_port(port); - return IpAddress::parse_address( buffer); -} - - -//----------[ create a new instance of this Value ]------------------------ -SnmpSyntax *UdpAddress::clone() const -{ - return (SnmpSyntax *) new UdpAddress(*this); -} - -//--------[ set the port number ]--------------------------------------- -void UdpAddress::set_port( const unsigned short p) -{ - unsigned short port_nbo = htons(p); - ACE_OS::memcpy(&address_buffer[IPV4LEN], &port_nbo, 2); - format_output(); -} - -//---------[ get the port number ]-------------------------------------- -unsigned short UdpAddress::get_port() const -{ - if (valid_flag) { - unsigned short port_nbo; - ACE_OS::memcpy(&port_nbo, &address_buffer[IPV4LEN], 2); - return ntohs(port_nbo); - } - else - return 0; // don't use uninitialized memory -} - -//------[ return the type ]-------------------------------------------- -addr_type UdpAddress::get_type() const -{ - return type_udp; -} - -//----[ UDP address char * cast ]-------------------------------------- -UdpAddress::operator const char *() const -{ - return (char *)output_buffer; -} - -//----[ UDP address get char representation ]-------------------------- -char * UdpAddress::to_string() -{ - return (char *)output_buffer; -} - -// make format same as ACE_INET_Addr class (addr:port) -void UdpAddress::format_output() -{ - IpAddress::format_output(); // allow ancestors to format their buffers - - // if valid format else null it - if ( valid_flag) - ACE_OS::sprintf( (char *) output_buffer,"%s:%d", - IpAddress::to_string(), - get_port() ); - else - output_buffer[0] = 0; -} - - -//======================================================================= -//=========== Netbios Address Implementation ============================ -//======================================================================= - -void NetbiosAddress::format_output() -{ - if ( valid_flag) - ACE_OS::memcpy(output_buffer, address_buffer, NETBIOSLEN); - else - output_buffer[0] = 0; -} - -void NetbiosAddress::InitNBAddr(const char *inaddr) -{ - if (ACE_OS::strlen(inaddr) == 0) { - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = NETBIOSLEN; - smival.value.string.ptr = address_buffer; - - valid_flag=0; - NetbiosAddress::format_output(); - return; - } - - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = parse_address( (char *) inaddr); - NetbiosAddress::format_output(); -} - -// TODO: how to handle addresses < 15 chars (zero out or pad with ' ') -NetbiosAddress::NetbiosAddress( const char *inaddr) -{ - InitNBAddr(inaddr); - -} - -NetbiosAddress::NetbiosAddress( const char *inaddr, nb_service svc) -{ - InitNBAddr(inaddr); - address_buffer[15] = svc; -} - -// TODO: go back over ms/ibm specs and verify this -// 16 chars, 15 can be any character, 16th is service number between 0 and 20 -// names beginning with IBM are reserved, and hence invalid -// and doubt IBM would use this class anyway -int NetbiosAddress::parse_address(const char *address) -{ - if (ACE_OS::strlen(address) > NETBIOSLEN) - return 0; // invalid - - if (ACE_OS::strncmp(address, "IBM", 3) == 0) - return 0; // invalid - - // addresses are free form but this check may need to be expose to user - // - //if (address[15] < nb_workstation || address[15] > nb_server) - // return 0; //invalid service type - - ACE_OS::memset(address_buffer, 0, NETBIOSLEN); - ACE_OS::memcpy(address_buffer, address, NETBIOSLEN); - - return 1; // valid -} - -NetbiosAddress::NetbiosAddress( const NetbiosAddress& nbaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = NETBIOSLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = nbaddr.valid_flag; - if (valid_flag) - ACE_OS::memcpy(address_buffer, nbaddr.address_buffer, NETBIOSLEN); - NetbiosAddress::format_output(); -} - -NetbiosAddress::NetbiosAddress( const GenAddress& genaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = NETBIOSLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = 0; - // allow use of an ipx or ipxsock address - if ( (genaddr.get_type() == type_nb) ) { - valid_flag = genaddr.valid(); - if ( valid_flag) { - // copy in the Ipx address data - NetbiosAddress temp_nb( (const char *) genaddr); - *this = temp_nb; - } - } - NetbiosAddress::format_output(); -} - -NetbiosAddress::~NetbiosAddress() -{ -} - -char *NetbiosAddress::to_string() -{ - return (char *)output_buffer; -} - -void NetbiosAddress::to_octet(OctetStr& octet) const -{ - octet.set_data( smival.value.string.ptr, smival.value.string.len); -} - -NetbiosAddress& NetbiosAddress::operator=( const NetbiosAddress &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag = 0; // will set to 1 if really valid - if (val.valid()) { - switch (((NetbiosAddress *) &val)->get_syntax()) { - case sNMP_SYNTAX_OCTETS: - ACE_OS::memcpy(address_buffer, - ((NetbiosAddress &)val).smival.value.string.ptr, NETBIOSLEN); - valid_flag = 1; - break; - } - } - NetbiosAddress::format_output(); - return *this; -} - -nb_service NetbiosAddress::get_service_type() const -{ - return (nb_service) address_buffer[15]; -} - -void NetbiosAddress::set_service_type(nb_service nbservice) -{ - address_buffer[15] = nbservice; - NetbiosAddress::format_output(); -} - -NetbiosAddress::operator const char *() const -{ - return (char *)output_buffer; -} - -SnmpSyntax& NetbiosAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag = 0; // will set to 1 if really valid - if (val.valid()) { - switch (val.get_syntax()) { - case sNMP_SYNTAX_OCTETS: - if (((NetbiosAddress &)val).smival.value.string.len == NETBIOSLEN) { - ACE_OS::memcpy(address_buffer, - ((NetbiosAddress &)val).smival.value.string.ptr, NETBIOSLEN); - valid_flag=1; - } - break; - } - } - NetbiosAddress::format_output(); - return *this; -} - -SnmpSyntax *NetbiosAddress::clone() const -{ - return (SnmpSyntax *) new NetbiosAddress(*this); -} - -SmiUINT32 NetbiosAddress::get_syntax() -{ - return sNMP_SYNTAX_OCTETS; -} - -addr_type NetbiosAddress::get_type() const -{ - return type_nb; -} - -//======================================================================= -//=========== IPX Address Implementation ================================ -//======================================================================= - -//-----------[ syntax type ]---------------------------------------------- -SmiUINT32 IpxAddress::get_syntax() -{ - return sNMP_SYNTAX_OCTETS; -} - - -//----------[ default constructor with a string arg ]--------------------------- -IpxAddress::IpxAddress( const char *inaddr):Address( ) -{ - if (ACE_OS::strlen(inaddr) == 0) { - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXLEN; - smival.value.string.ptr = address_buffer; - - separator = '\0'; - valid_flag=0; - IpxAddress::format_output(); - return; - } - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXLEN; - smival.value.string.ptr = address_buffer; - - separator = '\0'; - valid_flag = parse_address( (char *) inaddr); - IpxAddress::format_output(); -} - - -//-----[ IPX Address copy constructor ]---------------------------------- -IpxAddress::IpxAddress(const IpxAddress &ipxaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXLEN; - smival.value.string.ptr = address_buffer; - - separator = '\0'; - valid_flag = ipxaddr.valid_flag; - if (valid_flag) - ACE_OS::memcpy(address_buffer, ipxaddr.address_buffer, IPXLEN); - IpxAddress::format_output(); -} - - -//----[ construct an IpxAddress from a GenAddress ]--------------------------- -IpxAddress::IpxAddress( const GenAddress &genaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = 0; - // allow use of an ipx or ipxsock address - if ( (genaddr.get_type() == type_ipx) ) { - valid_flag = genaddr.valid(); - if ( valid_flag) { - // copy in the Ipx address data - IpxAddress temp_ipx( (const char *) genaddr); - *this = temp_ipx; - } - } - else - if ( (genaddr.get_type() == type_ipxsock) ) { - valid_flag = genaddr.valid(); - if ( valid_flag) { - // copy in the Ipx address data - IpxSockAddress temp_ipxsock( (const char *) genaddr); - *this = temp_ipxsock; - } - } - IpxAddress::format_output(); -} - - -//-----[ destructor ]-------------------------------------------------- -IpxAddress::~IpxAddress() -{ -} - - -//-----[ IPX Address general = operator ]------------------------------- -SnmpSyntax& IpxAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag=0; // will set to 1 if really valid - if (val.valid()){ - switch (val.get_syntax()){ - case sNMP_SYNTAX_OCTETS: - if (((IpxAddress &)val).smival.value.string.len == IPXLEN){ - ACE_OS::memcpy(address_buffer, ((IpxAddress &)val).smival.value.string.ptr, IPXLEN); - valid_flag=1; - } - break; - } - } - IpxAddress::format_output(); - return *this; -} - -//--------[ assignment to another IpAddress object overloaded ]---------- -IpxAddress& IpxAddress::operator=( const IpxAddress &ipxaddress) -{ - // protect against assignment from itself - if ( this == &ipxaddress ) - return *this; - - valid_flag = ipxaddress.valid_flag; - if (valid_flag) - ACE_OS::memcpy(address_buffer, ipxaddress.address_buffer, IPXLEN); - IpxAddress::format_output(); - return *this; -} - - -// create a new instance of this Value -SnmpSyntax *IpxAddress::clone() const -{ - return (SnmpSyntax *) new IpxAddress(*this); -} - -//-----[ IPX Address parse Address ]----------------------------------- -// Convert a string to a ten byte ipx address -// On success sets validity 1 or 0 -// -// IPX address format -// -// NETWORK ID| MAC ADDRESS -// 01 02 03 04|05 06 07 08 09 10 -// XX XX XX XX|XX XX XX XX XX XX -// -// Valid input format -// -// XXXXXXXX.XXXXXXXXXXXX -// Total length must be 21 -// Must have a separator in it -// First string length must be 8 -// Second string length must be 12 -// Each char must take on value 0-F -// -// -// Input formats recognized -// -// XXXXXXXX.XXXXXXXXXXXX -// XXXXXXXX:XXXXXXXXXXXX -// XXXXXXXX-XXXXXXXXXXXX -// XXXXXXXX.XXXXXX-XXXXXX -// XXXXXXXX:XXXXXX-XXXXXX -// XXXXXXXX-XXXXXX-XXXXXX -int IpxAddress::parse_address( const char *inaddr) -{ - char unsigned *str1,*str2; - char temp[30]; // don't destroy original - char unsigned *tmp; - size_t z, tmplen; - - - // save the orginal source - if (!inaddr || (ACE_OS::strlen( inaddr) >(sizeof(temp)-1))) return 0; - ACE_OS::strcpy( temp, inaddr); - trim_white_space( temp); - tmplen = ACE_OS::strlen(temp); - - // bad total length check - // 123456789012345678901 - // XXXXXXXX-XXXXXXXXXXXX 21 len - // - // XXXXXXXX-XXXXXX-XXXXXX 22 len - // need at least 21 chars and no more than 22 - if ( (tmplen <21) || (tmplen >22)) - return 0; - - // convert the string to all lower case - // this allows hex values to be in upper or lower - for (z=0;z< tmplen;z++) - temp[z] = tolower(temp[z]); - - // check for separated nodeid - // if found remove it - if (temp[15] == '-') - { - for(z=16;z= '0') && (*tmp <= '9'))|| // good 0-9 - ((*tmp >= 'a') && (*tmp <= 'f'))) // or a-f - tmp++; - else - return 0; - - // check out the MAC address - tmp = str2; - while( *tmp != 0) - if (((*tmp >= '0') && (*tmp <= '9'))|| // good 0-9 - ((*tmp >= 'a') && (*tmp <= 'f'))) // or a-f - tmp++; - else - return 0; - - // convert to target string - tmp = str1; - while ( *tmp != 0) - { - if (( *tmp >= '0') && ( *tmp <= '9')) - *tmp = *tmp - (char unsigned )'0'; - else - *tmp = *tmp - (char unsigned) 'a' + (char unsigned) 10; - tmp++; - } - - // network id portion - address_buffer[0] = (str1[0]*16) + str1[1]; - address_buffer[1] = (str1[2]*16) + str1[3]; - address_buffer[2] = (str1[4]*16) + str1[5]; - address_buffer[3] = (str1[6]*16) + str1[7]; - - tmp = str2; - while ( *tmp != 0) - { - if (( *tmp >= '0') && ( *tmp <= '9')) - *tmp = *tmp - (char unsigned) '0'; - else - *tmp = *tmp - (char unsigned) 'a'+ (char unsigned) 10; - tmp++; - } - - address_buffer[4] = (str2[0]*16) + str2[1]; - address_buffer[5] = (str2[2]*16) + str2[3]; - address_buffer[6] = (str2[4]*16) + str2[5]; - address_buffer[7] = (str2[6]*16) + str2[7]; - address_buffer[8] = (str2[8]*16) + str2[9]; - address_buffer[9] = (str2[10]*16) + str2[11]; - - return 1; -} - -//----[ IPX address char * cast ]-------------------------------------- -IpxAddress::operator const char *() const -{ - return (char *)output_buffer; -} - -//----[ IPX address get char representation ]-------------------------- -char * IpxAddress::to_string() -{ - return (char *)output_buffer; -} - - -//----[ IPX address format output ]------------------------------------- -void IpxAddress::format_output() -{ - if ( valid_flag) - ACE_OS::sprintf((char *) output_buffer, - "%02x%02x%02x%02x%c%02x%02x%02x%02x%02x%02x", - address_buffer[0],address_buffer[1], - address_buffer[2],address_buffer[3],'-', - address_buffer[4],address_buffer[5], - address_buffer[6],address_buffer[7], - address_buffer[8],address_buffer[9]); - else - output_buffer[0] = 0; -} - - -// get the host id portion of an ipx address -int IpxAddress::get_hostid( MacAddress& mac) -{ - if ( valid_flag) - { - char buffer[18]; - ACE_OS::sprintf( buffer,"%02x:%02x:%02x:%02x:%02x:%02x", - address_buffer[4], - address_buffer[5], address_buffer[6], address_buffer[7], - address_buffer[8], address_buffer[9]); - MacAddress temp( buffer); - // mac = (SnmpSyntax&) temp; - mac = temp; - if ( mac.valid()) - return 1; - else - return 0; - } - else - return 0; -} - - -//------[ return the type ]---------------------------------- -addr_type IpxAddress::get_type() const -{ - return type_ipx; -} - -void IpxAddress::to_octet(OctetStr& octet) const -{ - octet.set_data( smival.value.string.ptr, smival.value.string.len); -} - - -//======================================================================== -//======== IpxSockAddress Implementation ================================= -//======================================================================== - -//-----------[ syntax type ]---------------------------------------------- -SmiUINT32 IpxSockAddress::get_syntax() -{ - return sNMP_SYNTAX_OCTETS; -} - -//-----------[ construct an IpxSockAddress with another IpxSockAddress]---- -IpxSockAddress::IpxSockAddress( const IpxSockAddress &ipxaddr):IpxAddress(ipxaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXSOCKLEN; - smival.value.string.ptr = address_buffer; - - // copy the socket value - set_socket(ipxaddr.get_socket()); - format_output(); -} - - -//---------------[ default construct a IpxSockAddress ]-------------- -IpxSockAddress::IpxSockAddress( const char *inaddr):IpxAddress() -{ - if (ACE_OS::strlen(inaddr) == 0) { - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXSOCKLEN; - smival.value.string.ptr = address_buffer; - - set_socket(0); - format_output(); - return; - } - - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXSOCKLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = parse_address( (char *) inaddr); - format_output(); -} - - -//---------------[ construct a IpxSockAddress from a GenAddress ]---------- -IpxSockAddress::IpxSockAddress( const GenAddress &genaddr):IpxAddress() -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXSOCKLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = 0; - unsigned short socketid = 0; - // allow use of an ipx or ipxsock address - if ( (genaddr.get_type() == type_ipx) ) - { - valid_flag = genaddr.valid(); - if ( valid_flag) - { - // copy in the Ipx address data - IpxAddress temp_ipx( (const char *) genaddr); - *this = temp_ipx; - } - } - else - if ( (genaddr.get_type() == type_ipxsock) ) - { - valid_flag = genaddr.valid(); - if ( valid_flag) - { - // copy in the Ipx address data - IpxSockAddress temp_ipxsock( (const char *) genaddr); - *this = temp_ipxsock; - // socketid info since are making an IpxSockAddress - socketid = temp_ipxsock.get_socket(); - } - } - set_socket(socketid); - format_output(); -} - - -//------------[ construct an IpxSockAddress from a IpxAddress ]-------------- -IpxSockAddress::IpxSockAddress( const IpxAddress &ipxaddr):IpxAddress(ipxaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = IPXSOCKLEN; - smival.value.string.ptr = address_buffer; - - set_socket(0); - format_output(); -} - -//-----[ destructor ]-------------------------------------------------- -IpxSockAddress::~IpxSockAddress() -{ -} - -// copy an instance of this Value -SnmpSyntax& IpxSockAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag=0; // will set to 1 if really valid - if (val.valid()){ - switch (val.get_syntax()){ - case sNMP_SYNTAX_OCTETS: - { - // See if it is of the Ipx address family - // This handles IpxSockAddress == IpxAddress - IpxSockAddress temp_ipx(val.to_string()); - if (temp_ipx.valid()){ - *this = temp_ipx; // ipxsock = ipxsock - } - // See if it is an OctetStr of appropriate length - else if (((IpxSockAddress &)val).smival.value.string.len == IPXSOCKLEN){ - ACE_OS::memcpy(address_buffer, - ((IpxSockAddress &)val).smival.value.string.ptr, - IPXSOCKLEN); - valid_flag=1; - } - } - break; - } - } - format_output(); - return *this; -} - -// assignment to another IpAddress object overloaded -IpxSockAddress& IpxSockAddress::operator=( const IpxSockAddress &ipxaddr) -{ - // protect against assignment from itself - if ( this == &ipxaddr ) - return *this; - - (IpxAddress&)*this = ipxaddr; // use ancestor assignment for ipx addr - set_socket(ipxaddr.get_socket()); // copy socket value - format_output(); - return *this; -} - - -//----------[ create a new instance of this Value ]------------------------ -SnmpSyntax *IpxSockAddress::clone() const -{ - return (SnmpSyntax *) new IpxSockAddress(*this); -} - -//----[ IPXSock address char * cast ]-------------------------------------- -IpxSockAddress::operator const char *() const -{ - return (char *)output_buffer; -} - -//----[ IPXSock address get char representation ]-------------------------- -char * IpxSockAddress::to_string() -{ - return (char *)output_buffer; -} - -//----[ IPX address format output ]------------------------------------- -void IpxSockAddress::format_output() -{ - IpxAddress::format_output(); // allow ancestors to format their buffers - - if ( valid_flag) - ACE_OS::sprintf((char *) output_buffer,"%s/%d", - IpxAddress::to_string(), get_socket()); - else - output_buffer[0] = 0; -} - -//-----[ IP Address parse Address ]--------------------------------- -int IpxSockAddress::parse_address( const char *inaddr) -{ - char buffer[MAXHOSTNAMELEN +1]; - unsigned short socketid=0; - - if (inaddr && (ACE_OS::strlen( inaddr)< MAXHOSTNAMELEN)) - ACE_OS::strcpy( buffer, inaddr); - else - { - valid_flag = 0; - return 0; - } - // look for port info @ the end of the string - // port can be delineated by a ':' or a '/' - // if neither are present then just treat it - // like a normal IpAddress - char *tmp; - tmp = ACE_OS::strstr( buffer,"/"); - - if (tmp != 0) - { - *tmp=0; // null terminator - tmp++; - socketid = ACE_OS::atoi( tmp); - } - set_socket(socketid); - return IpxAddress::parse_address( buffer); -} - - - -//-------------[ set the socket number ]---------------------------------- -void IpxSockAddress::set_socket( const unsigned short s) -{ - unsigned short sock_nbo = htons(s); - ACE_OS::memcpy(&address_buffer[IPXLEN], &sock_nbo, 2); -} - -//--------------[ get the socket number ]--------------------------------- -unsigned short IpxSockAddress::get_socket() const -{ - if (valid_flag) - { - unsigned short sock_nbo; - ACE_OS::memcpy(&sock_nbo, &address_buffer[IPXLEN], 2); - return ntohs(sock_nbo); - } - else - return 0; // don't use uninitialized memory -} - -//------[ return the type ]---------------------------------------------- -addr_type IpxSockAddress::get_type() const -{ - return type_ipxsock; -} - - -//======================================================================== -//======== MACAddress Implementation ===================================== -//======================================================================== - -//-----------[ syntax type ]---------------------------------------------- -SmiUINT32 MacAddress::get_syntax() -{ - return sNMP_SYNTAX_OCTETS; -} - -//-----[ MAC Address copy constructor ]--------------------------------- -MacAddress::MacAddress(const MacAddress &macaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = MACLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = macaddr.valid_flag; - if (valid_flag) - ACE_OS::memcpy(address_buffer, macaddr.address_buffer, MACLEN); - format_output(); -} - -//---------[ constructor with a string argument ]------------------------- -MacAddress::MacAddress( const char *inaddr):Address( ) -{ - if (ACE_OS::strlen(inaddr) == 0) { - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = MACLEN; - smival.value.string.ptr = address_buffer; - - valid_flag=0; - format_output(); - return; - } - - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = MACLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = parse_address( (char *) inaddr); - format_output(); -} - -//-----[ construct a MacAddress from a GenAddress ]------------------------ -MacAddress::MacAddress( const GenAddress &genaddr) -{ - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = MACLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = 0; - // allow use of mac address - if (genaddr.get_type() == type_mac) - { - valid_flag = genaddr.valid(); - if ( valid_flag) - { - // copy in the Mac address data - MacAddress temp_mac( (const char *) genaddr); - *this = temp_mac; - } - } - format_output(); -} - -//-----[ destructor ]-------------------------------------------------- -MacAddress::~MacAddress() -{ -} - -//---------[ MacAddress clone ]------------------------------------------- -SnmpSyntax *MacAddress::clone() const -{ - return (SnmpSyntax *) new MacAddress(*this); -} - -//------[ assignment to another ipaddress object overloaded ]-------------- -MacAddress& MacAddress::operator=( const MacAddress &macaddress) -{ - // protect against assignment from itself - if ( this == &macaddress ) - return *this; - - valid_flag = macaddress.valid_flag; - if (valid_flag) - ACE_OS::memcpy(address_buffer, macaddress.address_buffer, MACLEN); - format_output(); - return *this; -} - - - -//-----[ MAC Address general = operator ]--------------------------------- -SnmpSyntax& MacAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag=0; // will set to 1 if really valid - if (val.valid()){ - switch (val.get_syntax()){ - case sNMP_SYNTAX_OCTETS: - if (((MacAddress &)val).smival.value.string.len == MACLEN){ - ACE_OS::memcpy(address_buffer, - ((MacAddress &)val).smival.value.string.ptr, MACLEN); - valid_flag=1; - } - break; - } - } - format_output(); - return *this; -} - -//-----[ MAC Address parse Address ]-------------------------------------- -// Convert a string to a six byte MAC address -// On success sets validity 1 or 0 -// -// MAC address format -// -// MAC ADDRESS -// 01 02 03 04 05 06 -// XX:XX:XX:XX:XX:XX -// Valid input format -// -// XXXXXXXXXXXX -// Total length must be 17 -// Each char must take on value 0-F -// -// -int MacAddress::parse_address( const char *inaddr) -{ - char temp[MAXHOSTNAMELEN +1]; // don't destroy original - char unsigned *tmp; - size_t z; - - - // save the orginal source - if ( !inaddr || (ACE_OS::strlen( inaddr) > 30)) return 0; - ACE_OS::strcpy( temp, inaddr); - trim_white_space( temp); - - // bad total length check - if ( ACE_OS::strlen(temp) != 17) - return 0; - - // check for colons - if ((temp[2] != ':')||(temp[5] != ':')||(temp[8]!=':')||(temp[11]!=':') - ||(temp[14] !=':')) - return 0; - - // strip off the colons - tmp = ( unsigned char *) temp; - int i = 0; - while ( *tmp != 0) - { - if (*tmp != ':') - { - temp[i] = *tmp; - i++; - } - tmp++; - } - temp[i] = 0; - - // convert to lower - for(z=0;z= '0') && (*tmp <= '9'))|| // good 0-9 - ((*tmp >= 'a') && (*tmp <= 'f'))) // or a-f - tmp++; - else - return 0; - - // convert to target string - tmp = (unsigned char *) temp; - while ( *tmp != 0) - { - if (( *tmp >= '0') && ( *tmp <= '9')) - *tmp = *tmp - (char unsigned )'0'; - else - *tmp = *tmp - (char unsigned) 'a' + (char unsigned) 10; - tmp++; - } - - address_buffer[0] = (temp[0]*16) + temp[1]; - address_buffer[1] = (temp[2]*16) + temp[3]; - address_buffer[2] = (temp[4]*16) + temp[5]; - address_buffer[3] = (temp[6]*16) + temp[7]; - address_buffer[4] = (temp[8]*16) + temp[9]; - address_buffer[5] = (temp[10]*16) + temp[11]; - - return 1; -} - -//----[ MAC address char * cast ]-------------------------------------- -MacAddress::operator const char *() const -{ - return (char *)output_buffer; -} -//----[ MAC address get char representation ]-------------------------- -char * MacAddress::to_string() -{ - return (char *)output_buffer; -} - -//----[ MAC address format output ]--------------------------------- -void MacAddress::format_output() -{ - if ( valid_flag) - sprintf(output_buffer,"%02x:%02x:%02x:%02x:%02x:%02x",address_buffer[0], - address_buffer[1],address_buffer[2],address_buffer[3], - address_buffer[4],address_buffer[5]); - else - output_buffer[0] = 0; -} - -//------[ return the type ]---------------------------------- -addr_type MacAddress::get_type() const -{ - return type_mac; -} - - -unsigned int MacAddress::hashFunction() const -{ - return ((((address_buffer[0] << 8) + address_buffer[1]) * HASH0) - + (((address_buffer[2] << 8) + address_buffer[3]) * HASH1) - + (((address_buffer[4] << 8) + address_buffer[5]) * HASH2)); -} - -void MacAddress::to_octet(OctetStr& octet) const -{ - octet.set_data( smival.value.string.ptr, smival.value.string.len); -} - -//======================================================================== -//========== Generic Address Implementation ============================== -//======================================================================== - -//-----------[ get the syntax]---------------------------------------------- -SmiUINT32 GenAddress::get_syntax() -{ - if (address != 0) - return address->get_syntax(); - - return sNMP_SYNTAX_NULL; -} - -void GenAddress::init_smi() -{ - smival.syntax = sNMP_SYNTAX_NULL; // to be overridden - smival.value.string.len = 0; // to be overridden - smival.value.string.ptr = address_buffer; // constant -} - -//-----------[ constructor with a string argument ]---------------------- -GenAddress::GenAddress( const char *addr): address(0) -{ - valid_flag = 0; - // initialize SMI info - // BOK: smival is generally not used for GenAddress, but - // we need this to be a replica of the real address' - // smival info so that ::operator=SnmpSyntax - // will work. - init_smi(); - - if (addr && ACE_OS::strlen(addr) == 0) { - format_output(); - return; - } - - parse_address(addr); - - // Copy real address smival info into GenAddr smival - // BOK: smival is generally not used for GenAddress, but - // we need this to be a replica of the real address' - // smival info so that ::operator=SnmpSyntax - // will work. - if ( valid_flag ) { - smival.syntax = ((GenAddress *)address)->smival.syntax; - smival.value.string.len = - ((GenAddress *)address)->smival.value.string.len; - ACE_OS::memcpy(smival.value.string.ptr, - ((GenAddress *)address)->smival.value.string.ptr, - (size_t)smival.value.string.len); - } -} - -//-----------[ constructor with an Address argument ]-------------------- -GenAddress::GenAddress( const Address &addr): address(0) -{ - valid_flag = 0; - - // initialize SMI info - // BOK: this is generally not used for GenAddress, - // but we need this to be a replica of the real address' - // smival info so that operator=SnmpSyntax will work. - init_smi(); - // make sure that the object is valid - if (!addr.valid()) { - format_output(); - return; - } - - address = (Address*)addr.clone(); - if (address) - valid_flag = address->valid(); - - // Copy real address smival info into GenAddr smival - // BOK: smival is generally not used for GenAddress, but - // we need this to be a replica of the real address' - // smival info so that ::operator=SnmpSyntax - // will work. - if ( valid_flag ) { - smival.syntax = address->get_syntax(); - smival.value.string.len = - ((GenAddress *)address)->smival.value.string.len; - ACE_OS::memcpy(smival.value.string.ptr, - ((GenAddress *)address)->smival.value.string.ptr, - (size_t)smival.value.string.len); - } - - format_output(); -} - -//-----------------[ constructor with another GenAddress object ]------------- -GenAddress::GenAddress( const GenAddress &addr): address(0) -{ - valid_flag = 0; - - // initialize SMI info - // BOK: this is generally not used for GenAddress, - // but we need this to be a replica of the real address' - // smival info so that operator=SnmpSyntax will work. - init_smi(); - - // make sure that the object is valid - if (!addr.valid_flag) { - format_output(); - return; - } - - address = (Address *)addr.address->clone(); - if (address) - valid_flag = address->valid(); - - // Copy real address smival info into GenAddr smival - // BOK: smival is generally not used for GenAddress, but - // we need this to be a replica of the real address' - // smival info so that ::operator=SnmpSyntax - // will work. - if ( valid_flag ) { - smival.syntax = ((GenAddress *)address)->smival.syntax; - smival.value.string.len = - ((GenAddress *)address)->smival.value.string.len; - ACE_OS::memcpy(smival.value.string.ptr, - ((GenAddress *)address)->smival.value.string.ptr, - (size_t)smival.value.string.len); - } - - format_output(); -} - -//----------[ destructor ] ------------------------------------------------ -GenAddress::~GenAddress() -{ - if ( address != 0) - delete address; -} - -//----------[ create a new instance of this Value ]------------------------ -SnmpSyntax *GenAddress::clone() const -{ - return (SnmpSyntax *) new GenAddress(*this); -} - -//------[ assignment GenAddress = GenAddress ]----------------------------- -GenAddress& GenAddress::operator=( const GenAddress &addr) -{ - // protect against assignment from itself - if ( this == &addr ) - return *this; - - valid_flag = 0; - if (address) { - delete address; - address = 0; - } - - if (addr.address) - address = (Address *)(addr.address)->clone(); - - if (address) - valid_flag = address->valid(); - - // Copy real address smival info into GenAddr smival - // BOK: smival is generally not used for GenAddress, but - // we need this to be a replica of the real address' - // smival info so that ::operator=SnmpSyntax - // will work. - if ( valid_flag ) { - smival.syntax = ((GenAddress *)address)->smival.syntax; - smival.value.string.len = - ((GenAddress *)address)->smival.value.string.len; - ACE_OS::memcpy(smival.value.string.ptr, - ((GenAddress *)address)->smival.value.string.ptr, - (size_t)smival.value.string.len); - } - - format_output(); - return *this; -} - - -//------[ assignment GenAddress = any SnmpSyntax ]----------------------- -SnmpSyntax& GenAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag = 0; // will get set to 1 if really valid - if ( address != 0) { - delete address; - address = 0; - } - - if (val.valid()) { - switch ( val.get_syntax() ) { - //-----[ ip address case ]------------- - // BOK: this case shouldn't be needed since there is an explicit - // GenAddr=Address assignment that will override this assignment. - // Left here for posterity. - case sNMP_SYNTAX_IPADDR: - { - address = (Address *)val.clone(); - if (address) - valid_flag = address->valid(); - } - break; - - //-----[ udp address case ]------------ - //-----[ ipx address case ]------------ - //-----[ mac address case ]------------ - // BOK: This is here only to support GenAddr = primitive OctetStr. - // The explicit GenAddr=Address assignment will handle the cases - // GenAddr = [UdpAdd|IpxAddr|IpxSock|MacAddr|DecNetAddr|NetbiosAddr|AppleTlk]. - // Note, using the heuristic of octet str len to determine type of - // address to create is not accurate when address lengths are equal - // (e.g., UDPIPV4LEN == MACLEN). It gets worse if we add AppleTalk or - // OSI which use variable length addresses! assume AppleTalk as used in IOS Mibs - // is defined in CISCO-TC.my as fixed length of 3 octets - - case sNMP_SYNTAX_OCTETS: - { - unsigned long val_len; - val_len = ((GenAddress &)val).smival.value.string.len; - - if (val_len == UDPIPV4LEN) { - ACE_NEW_RETURN(address, UdpAddress, *this); - } - else if (val_len ==IPV4LEN) { - ACE_NEW_RETURN(address, IpAddress, *this); - } - else if (val_len == IPXLEN) { - ACE_NEW_RETURN(address, IpxAddress, *this); - } - else if (val_len == IPXSOCKLEN) { - ACE_NEW_RETURN(address, IpxSockAddress, *this); - } - else if (val_len == MACLEN) { - ACE_NEW_RETURN(address, MacAddress, *this); - } - else if (val_len == APPLETKLEN) { - ACE_NEW_RETURN(address, AppleTalkAddress, *this); - } - else if (val_len == DECNETLEN) { - ACE_NEW_RETURN(address, DecNetAddress, *this); - } - else if (val_len == NETBIOSLEN) { - ACE_NEW_RETURN(address, DecNetAddress, *this); - } - - if (address) { - *address = val; - valid_flag = address->valid(); - } - } - break; - } // end switch - } - - // Copy real address smival info into GenAddr smival - // BOK: smival is generally not used for GenAddress, but - // we need this to be a replica of the real address' - // smival info so that ::operator=SnmpSyntax - // will work. - if ( valid_flag ) { - smival.syntax = ((GenAddress *)address)->smival.syntax; - smival.value.string.len = - ((GenAddress *)address)->smival.value.string.len; - ACE_OS::memcpy(smival.value.string.ptr, - ((GenAddress *)address)->smival.value.string.ptr, - (size_t)smival.value.string.len); - } - - format_output(); - return *this; -} - - -// redefined parse address for macs -// TODO: Add netbios, appletalk, and decnet addresses here -int GenAddress::parse_address( const char *addr) -{ - if ( address != 0) - delete address; - - // try to create each of the addresses until the correct one - // is found - -//BOK: Need to try IPX Sock and IPX before UDP since on Win32, -// gethostbyname() seems to think the ipx network number -// portion is a valid ipaddress string... stupid WinSOCK! - - // ipxsock address - ACE_NEW_RETURN(address, IpxSockAddress( addr), -1); - valid_flag = address->valid(); - if ( valid_flag && ((IpxSockAddress*)address)->get_socket()) { - format_output(); - return 1; // ok its an ipxsock address - } - // otherwise delete it and try another - delete address; - - // ipx address - ACE_NEW_RETURN(address, IpxAddress( addr), -1); - valid_flag = address->valid(); - if ( valid_flag) { - format_output(); - return 1; // ok its an ipx address - } - // otherwise delete it and try another - delete address; - -//TM: Must try the derived classes first...one pitfall of the -//following solution is if someone creates with a port/socket of 0 the -//class will get demoted to ip/ipx. The only proper way to do this is -//to parse the strings ourselves. - - // udp address - ACE_NEW_RETURN(address, UdpAddress( addr), -1); - valid_flag = address->valid(); - if ( valid_flag && ((UdpAddress*)address)->get_port()) { - format_output(); - return 1; // ok its a udp address - } - - // otherwise delete it and try another - delete address; - - // ip address - ACE_NEW_RETURN(address, IpAddress( addr), -1); - valid_flag = address->valid(); - if ( valid_flag) - { - format_output(); - return 1; // ok its an ip address - } - // otherwise delete it and try another - delete address; - - // mac address - ACE_NEW_RETURN(address, MacAddress( addr), -1); - valid_flag = address->valid(); - if ( valid_flag) { - format_output(); - return 1; // ok, its a mac - } - - // guess by length of argument the type of address - switch (ACE_OS::strlen(addr)) { - case NETBIOSLEN: - ACE_NEW_RETURN(address, NetbiosAddress( addr), -1); - valid_flag = address->valid(); - if ( valid_flag) { - format_output(); - return 1; // ok, its a mac - } - break; - - case APPLETKLEN: - ACE_NEW_RETURN(address, AppleTalkAddress( addr), -1); - valid_flag = address->valid(); - if ( valid_flag) { - format_output(); - return 1; // ok, its a mac - } - break; - - case DECNETLEN: - ACE_NEW_RETURN(address, DecNetAddress( addr), -1); - valid_flag = address->valid(); - if ( valid_flag) { - format_output(); - return 1; // ok, its a mac - } - break; - - } - // otherwise its invalid - delete address; - address = 0; - format_output(); - return 0; -} - -GenAddress::operator const char *() const -{ - if ( address != 0) - return (const char *)*address; // pass thru - else - return (char *)output_buffer; -} - -// to_string form of the contained address -char * GenAddress::to_string() -{ - if ( address != 0) - return address->to_string(); // pass thru - else - return (char *)output_buffer; -} - -// format output -void GenAddress::format_output() -{ - output_buffer[0] = '\0'; -} - -//------[ return the type ]---------------------------------- -addr_type GenAddress::get_type() const -{ - if (!valid()) - return type_invalid; - else - return address->get_type(); -} - -// call the particular type class here -void GenAddress::to_octet(OctetStr& octet) const -{ - if (!valid()) - return; - - address->to_octet(octet); -} - -//------------------------------------------------------------------------ -//---------[ DecNet Address Class ]--------------------------------------- -//------------------------------------------------------------------------ - -DecNetAddress::DecNetAddress( const char *inaddr): Address() -{ - if (ACE_OS::strlen(inaddr) == 0) { - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = DECNETLEN; - smival.value.string.ptr = address_buffer; - - valid_flag=0; - DecNetAddress::format_output(); - return; - } - - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = DECNETLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = parse_address( (char *) inaddr); - DecNetAddress::format_output(); -} - -DecNetAddress::DecNetAddress( const DecNetAddress&) -{ -} - -DecNetAddress::DecNetAddress( const GenAddress& genaddr) -{ - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = DECNETLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = 0; - // allow use of an ipx or ipxsock address - if ( (genaddr.get_type() == type_decnet) ) { - valid_flag = genaddr.valid(); - if ( valid_flag) { - // copy in the Ipx address data - DecNetAddress temp_ipx( (const char *) genaddr); - *this = temp_ipx; - } - } - DecNetAddress::format_output(); -} - -DecNetAddress::~DecNetAddress() -{ -} - -char *DecNetAddress::to_string() -{ - return (char *)output_buffer; -} - -DecNetAddress& DecNetAddress::operator=( const DecNetAddress &decaddr) -{ - // protect against assignment from itself - if ( this == &decaddr ) - return *this; - valid_flag = decaddr.valid_flag; - if (valid_flag) - ACE_OS::memcpy(address_buffer, decaddr.address_buffer, DECNETLEN); - format_output(); - return *this; -} - -void DecNetAddress::to_octet(OctetStr& octet) const -{ - octet.set_data( smival.value.string.ptr, smival.value.string.len); -} - -DecNetAddress::operator const char *() const -{ - return (char *)output_buffer; -} - -SmiUINT32 DecNetAddress::get_syntax() -{ - return sNMP_SYNTAX_OCTETS; -} - -SnmpSyntax& DecNetAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag = 0; // will get set 1 if really valid - - if (val.valid()) { - if (((DecNetAddress &)val).smival.value.string.len ==DECNETLEN) { - ACE_OS::memcpy(address_buffer, - ((DecNetAddress &)val).smival.value.string.ptr, DECNETLEN); - valid_flag = 1; - } - } - DecNetAddress::format_output(); - return *this; -} - -SnmpSyntax *DecNetAddress::clone() const -{ - return (SnmpSyntax *) new DecNetAddress(*this); -} - -addr_type DecNetAddress::get_type() const -{ - return type_decnet; -} - -void DecNetAddress::format_output() -{ - // if valid format else null it - if ( valid_flag) - ACE_OS::sprintf( (char *) output_buffer,"%d.%d",address_buffer[0], - address_buffer[1]); - else - output_buffer[0] = 0; -} - -int DecNetAddress::parse_address( const char *address) -{ - if (ACE_OS::strlen(address) > DECNETLEN) - return 0; // invalid - - ACE_OS::memset(address_buffer, 0, DECNETLEN); - ACE_OS::memcpy(address_buffer, address, DECNETLEN); - - return 1; // valid -} - - -//------------------------------------------------------------------------ -//---------[ AppleTalk Address Class ]------------------------------------ -//------------------------------------------------------------------------ - -AppleTalkAddress::AppleTalkAddress( const char *inaddr): Address() -{ - if (ACE_OS::strlen(inaddr) == 0) { - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = APPLETKLEN; - smival.value.string.ptr = address_buffer; - - valid_flag=0; - AppleTalkAddress::format_output(); - return; - } - - // always initialize SMI info - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = APPLETKLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = parse_address( (char *) inaddr); - AppleTalkAddress::format_output(); -} -AppleTalkAddress::AppleTalkAddress( const AppleTalkAddress&) -{ -} - -AppleTalkAddress::AppleTalkAddress( const GenAddress& genaddr) -{ - smival.syntax = sNMP_SYNTAX_OCTETS; - smival.value.string.len = APPLETKLEN; - smival.value.string.ptr = address_buffer; - - valid_flag = 0; - // allow use of an ipx or ipxsock address - if ( (genaddr.get_type() == type_atk) ) { - valid_flag = genaddr.valid(); - if ( valid_flag) { - // copy in the Ipx address data - AppleTalkAddress temp_ipx( (const char *) genaddr); - *this = temp_ipx; - } - } - AppleTalkAddress::format_output(); -} - -AppleTalkAddress::~AppleTalkAddress() -{ -} - -char *AppleTalkAddress::to_string() -{ - return (char *)output_buffer; -} - -AppleTalkAddress& AppleTalkAddress::operator=( const AppleTalkAddress &ataddr) -{ - // protect against assignment from itself - if ( this == &ataddr ) - return *this; - valid_flag = ataddr.valid_flag; - if (valid_flag) - ACE_OS::memcpy(address_buffer, ataddr.address_buffer, APPLETKLEN); - format_output(); - return *this; -} - -void AppleTalkAddress::to_octet(OctetStr& octet) const -{ - octet.set_data( smival.value.string.ptr, smival.value.string.len); -} - -AppleTalkAddress::operator const char *() const -{ - return (char *)output_buffer; -} - -SmiUINT32 AppleTalkAddress::get_syntax() -{ - return sNMP_SYNTAX_OCTETS; -} - -SnmpSyntax& AppleTalkAddress::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - valid_flag = 0; // will get set 1 if really valid - - if (val.valid()) { - if (((AppleTalkAddress &)val).smival.value.string.len ==APPLETKLEN) { - ACE_OS::memcpy(address_buffer, - ((AppleTalkAddress &)val).smival.value.string.ptr,APPLETKLEN); - valid_flag = 1; - } - } - AppleTalkAddress::format_output(); - return *this; -} - -SnmpSyntax *AppleTalkAddress::clone() const -{ - return (SnmpSyntax *) new AppleTalkAddress(*this); -} - -addr_type AppleTalkAddress::get_type() const -{ - return type_atk; -} - -void AppleTalkAddress::format_output() -{ - // if valid format else null it - if ( valid_flag) - ACE_OS::sprintf( (char *) output_buffer,"%d.%d.%d", address_buffer[0], - address_buffer[1], address_buffer[3]); - else - output_buffer[0] = 0; -} - -int AppleTalkAddress::parse_address( const char *address) -{ - if (ACE_OS::strlen(address) > APPLETKLEN) - return 0; // invalid - - ACE_OS::memset(address_buffer, 0, APPLETKLEN); - ACE_OS::memcpy(address_buffer, address, APPLETKLEN); - - return 1; // valid -} - -char AppleTalkAddress::get_host_address() const -{ - return address_buffer[2]; -} - -void AppleTalkAddress::set_host_address(const char host) -{ - address_buffer[2] = host; -} - -short AppleTalkAddress::get_net_address() const -{ - short net; - ACE_OS::memcpy(&net, address_buffer, APPLETKLEN - 1); - return net; -} - -void AppleTalkAddress::set_net_address(const short atknet) -{ - ACE_OS::memcpy(address_buffer, &atknet, APPLETKLEN -1); -} diff --git a/ASNMP/asnmp/address.h b/ASNMP/asnmp/address.h deleted file mode 100644 index 5258304e109..00000000000 --- a/ASNMP/asnmp/address.h +++ /dev/null @@ -1,812 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef ADDRESS_ -#define ADDRESS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// address.h -// -// = DESCRIPTION -// Address class definition. Encapsulates various network -// addresses into easy to use, safe and portable classes. -// -// = AUTHOR -// Peter E Mellquist -// -// ============================================================================ - -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -//----[ includes ]----------------------------------------------------- -// ACE OS Adaption layer -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "asnmp/smival.h" -#include "asnmp/octet.h" - -//----[ enumerated types ] -------------------------------- -enum address_lengths { - IPV4LEN=4, - UDPIPV4LEN=6, - IPV6LEN=16, - UDPIPV6LEN=18, - IPXLEN=10, - IPXSOCKLEN=12, - NETBIOSLEN=16, - APPLETKLEN=3, - DECNETLEN=2, - MACLEN=6, - HASH0=19, - HASH1=13, - HASH2=7, - MAX_ADDR_SZ=20, - MAX_DISPLAY_SZ=MAXHOSTNAMELEN+1 -}; - -enum addr_type { - type_ip, - type_ipx, - type_udp, - type_ipxsock, - type_mac, - type_nb, - type_atk, - type_decnet, - type_e164, - type_sip, // IPv6 - type_invalid -}; - -// TODO: get rest of nb service types added here -enum nb_service { - nb_workstation = 0x0, nb_server = 0x20 -}; - -//---[ forward declarations ]----------------------------------------- -class GenAddress; -class UdpAddress; -class IpxSockAddress; -class NetbiosAddress; -class SIPAddress; // aka ipv6 - -// TODO: -// class AtmE164Address; - - -//-------------------------------------------------------------------- -//----[ Address class ]----------------------------------------------- -//-------------------------------------------------------------------- -class ACE_Export Address: public SnmpSyntax - // = TITLE - // Defines the member functions for the abstract base class - // Address. An Address is a unique network endpoint. -{ - -public: - virtual ~Address(); - // allow destruction of derived classes - - friend int operator==( const Address &lhs,const Address &rhs); - // overloaded equivlence operator, are two addresses equal? - - friend int operator!=( const Address &lhs,const Address &rhs); - // overloaded not equivlence operator, are two addresses not equal? - - friend int operator>( const Address &lhs,const Address &rhs); - // overloaded > operator, is a1 > a2 - - friend int operator>=( const Address &lhs,const Address &rhs); - // overloaded >= operator, is a1 >= a2 - - friend int operator<( const Address &lhs,const Address &rhs); - // overloaded < operator, is a1 < a2 - - friend int operator<=( const Address &lhs,const Address &rhs); - // overloaded <= operator, is a1 <= a2 - - friend int operator==( const Address &lhs,const char *rhs); - // equivlence operator overloaded, are an address and a string equal? - - friend int operator!=( const Address &lhs,const char *rhs); - // overloaded not equivlence operator, are an address and string not equal? - - friend int operator>( const Address &lhs,const char *rhs); - // overloaded < , is an address greater than a string? - - friend int operator>=( const Address &lhs,const char *rhs); - // overloaded >=, is an address greater than or equal to a string? - - friend int operator<( const Address &lhs,const char *rhs); - // overloaded < , is an address less than a string? - - friend int operator<=( const Address &lhs,const char *rhs); - // overloaded <=, is an address less than or equal to a string? - - virtual operator const char *() const = 0; - // overloaded const char * cast - - virtual int valid() const; - // verify the is the address object constructed ok - - virtual void to_octet(OctetStr& octet) const = 0; - // return a suitable buffer to contain the address - - virtual SmiUINT32 get_syntax() = 0; - // (pure virtual) syntax type - - unsigned char& operator[]( const int position); - // for non const [], allows reading and writing - - virtual char *to_string() = 0; - // get a printable ASCII value - - virtual SnmpSyntax *clone() const = 0; - // create a new instance of this Value - - virtual addr_type get_type() const = 0; - // return the type of address - - virtual SnmpSyntax& operator=( SnmpSyntax &val) = 0; - // overloaded assignment operator - - virtual unsigned int hashFunction() const { return 0;}; - // return a hash key - - -protected: - int valid_flag; - // state of constructed object (1/0) - unsigned char address_buffer[MAX_ADDR_SZ]; - // addr internal representation - - virtual int parse_address( const char * inaddr) =0; - // parse the address string - // redefined for each specific address subclass - - virtual void format_output() =0; - // format the output - // redefined for each specific address subclass - - void trim_white_space( char * ptr); - // a reused trimm white space method -}; - - -//----------------------------------------------------------------------- -//---------[ IPv4 Address Class ]---------------------------------------- -//----------------------------------------------------------------------- -class ACE_Export IpAddress : public Address - // = TITLE - // Defines the member functions for the concrete class IpAddress - // An IP Version 4 Address is 4 bytes long and consists of a - // Network, Sub Network, and host component. -{ -public: - IpAddress( const char *inaddr = ""); - // default construct an IP address with a string - - IpAddress( const IpAddress &ipaddr); - // construct an IP address with another IP address - - IpAddress( const GenAddress &genaddr); - // construct an IP address with a GenAddress - - ~IpAddress(); - // destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden) - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - IpAddress& operator=( const IpAddress &ipaddress); - // assignment to another IpAddress object overloaded - - // TODO: add ability to set addr given long - - SnmpSyntax *clone() const; - // create a new instance of this Value - - char *resolve_hostname(int& was_found); - // return the DNS Fully Qualified Domain Name (host.domain) - // on failure returns dotted_quad string - - virtual char *to_string() ; - // return string representation of object (dotted quad returned) - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - void mask( const IpAddress& ipaddr); - // logically AND two IPaddresses and - // return the new one - - virtual addr_type get_type() const; - // return the type - - virtual SmiUINT32 get_syntax(); - // syntax type - - int is_loopback() const; - // is this the loopback address? 127.0.0.1/loopback/1.0.0.127.in-addr.arpa - - int is_multicast() const; - // determine if this is a multicast address - - int is_broadcast() const; - // determine if this a broadcast address - - int is_private() const; - // per RFC 1597, private addresses are:: 10, 172.16, and 192.168.0 - - virtual void to_octet(OctetStr& octet) const; - // convert address into octet string format in network byte order - -protected: - char output_buffer[MAX_DISPLAY_SZ]; // output buffer - - char iv_friendly_name_[MAX_DISPLAY_SZ]; - // friendly name storage - - int iv_friendly_name_status_; - // did resolver call work? some addrs won't resolve - - virtual int parse_address( const char *inaddr); - // redefined parse address - // specific to IP addresses - - virtual void format_output(); - // redefined format output - // specific to IP addresses - - int parse_dotted_ipstring( const char *inaddr); - // parse a dotted string - - int addr_to_friendly(); - // using the currently defined address, do a gethostbyname() - // and try to fill up the name - - static int resolve_to_address(const char *hostname, in_addr& quad_addr); - // thread safe routine to lookup ip address given hostname - // return <> 0 on error - - static int resolve_to_hostname(const in_addr& quad_addr, char *hostname); - // thread safe routine to lookup name given ip address - // return <> 0 on error - -}; - -//------------------------------------------------------------------------ -//--------------[ DNS Iterator Class ]------------------------------------ -//------------------------------------------------------------------------ - -class ACE_Export Address_Iter - // = TITLE - // Defines routines to obtain information on a hostname/FQDN - // such as multiple addresses -{ -public: - Address_Iter(const char *hostname); // fully qualified domain name, hostname - - int valid() const; - // did hostname resolve via DNS? - - int how_many_addresses(); - // how many addresses associated with this hostname - - int next(IpAddress& addr); - // return next address - -private: - Address_Iter(const Address_Iter&); - int valid_; // ctor status - int count_; // number of addresses - char **entry_; // ptr to current address - struct hostent lookupResult_; - ACE_HOSTENT_DATA buffer_; - int query_dns(const char *hostname); -}; - -//------------------------------------------------------------------------ -//---------[ UDP/IPv4 Address Class ]------------------------------------- -//------------------------------------------------------------------------ -class ACE_Export UdpAddress : public IpAddress - // = TITLE - // Defines the member functions for the concrete class UdpAddress - // A Udp Address consists of an IP Version 4 Address (IpAddress) - // and a 2 byte unsigned port number. (see /etc/services file) - // User Datagram Protocol (UDP) is a best effort transport -{ -public: - UdpAddress( const char *inaddr = ""); - // default constructor with a dotted string in the form of addr:port - - UdpAddress( const UdpAddress &udpaddr); - // construct an Udp address with another Udp address - - UdpAddress( const GenAddress &genaddr); - // construct a Udp address with a GenAddress - - UdpAddress( const IpAddress &ipaddr); - // construct a Udp address with an IpAddress - // default port # to zero - - ~UdpAddress(); - // destructor - - SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - UdpAddress& operator=( const UdpAddress &udpaddr); - // assignment to another IpAddress object overloaded - - SnmpSyntax *clone() const; - // create a new instance of this Value - - virtual char *to_string() ; - // output in the form of address:port - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - void set_port( const unsigned short p); - // set the port number - - unsigned short get_port() const; - // get the port number - - virtual addr_type get_type() const; - // return the type - -protected: - char output_buffer[MAX_DISPLAY_SZ]; - // output buffer - - virtual int parse_address( const char *inaddr); - // redefined parse address - // specific to IP addresses - - virtual void format_output(); - // redefined format output - // specific to IP addresses -}; - - -//------------------------------------------------------------------------- -//---------[ 802.3 MAC Address Class ]------------------------------------- -//------------------------------------------------------------------------- -class ACE_Export MacAddress : public Address - // = TITLE - // Defines the member functions for the concrete class MacAddress. - // A Media Access Control Address consists of 48 bits as defined - // in IEEE 802.3 specifications. -{ -public: - MacAddress( const char *inaddr = ""); - // constructor with a string argument - - MacAddress( const MacAddress &macaddr); - // constructor with another MAC object - - MacAddress( const GenAddress &genaddr); - // construct a MacAddress with a GenAddress - - ~MacAddress(); - // destructor - - SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - MacAddress& operator=( const MacAddress &macaddress); - // assignment to another IpAddress object overloaded - - SnmpSyntax *clone() const; - // create a new instance of this Value - - virtual char *to_string(); - // create a string to internal class storage representing object - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - virtual addr_type get_type() const; - // return the type - - unsigned int hashFunction() const; - // return a hash key - - virtual void to_octet(OctetStr& octet) const; - // return byte array of the mac address - -protected: - char output_buffer[MAX_DISPLAY_SZ]; - // output buffer containing string representation of object - - virtual int parse_address( const char *inaddr); - // redefined parse address for macs - - virtual void format_output(); - // redefined format output for MACs -}; - -//------------------------------------------------------------------------ -//---------[ Netbios Address Class ]-------------------------------------- -//------------------------------------------------------------------------ -class ACE_Export NetbiosAddress : public Address - // = TITLE - // Defines the member functions for the concrete class NetbiosAddress. - // The IBM/Microsoft address for NETBIOS, NETBEUI protocol transport. -{ -public: - - NetbiosAddress( const char *inaddr = ""); - // default constructor with string arg - - NetbiosAddress( const char *inaddr, nb_service svc); - // set name and service type - - NetbiosAddress( const NetbiosAddress& nbaddr); - // copy constructor - - NetbiosAddress( const GenAddress& genaddr); - // construct with a GenAddress - - ~NetbiosAddress(); - - virtual char *to_string(); - - NetbiosAddress& operator=( const NetbiosAddress &nbaddr); - - nb_service get_service_type() const; - // retrieve the network service type - - void set_service_type(nb_service nbservice); - // set the service type (workstation, server, etc) - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - virtual SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - SnmpSyntax *clone() const; - // create a new instance of this Value - - virtual void to_octet(OctetStr& octet) const; - // output byte buffer containing netbios name - -protected: - void InitNBAddr(const char *inaddr); - char output_buffer[MAX_DISPLAY_SZ]; - - virtual void format_output(); - // output buffer to hold string representation - virtual int parse_address( const char *inaddr); - virtual addr_type get_type() const; -}; - -//------------------------------------------------------------------------ -//---------[ DecNet Address Class ]--------------------------------------- -//------------------------------------------------------------------------ -class ACE_Export DecNetAddress : public Address - // = TITLE - // Defines the member functions for the concrete class DecNetAddress. - // DecNet Phase ? address consists of two octets (CISCO-TC.my) -{ - public: - DecNetAddress( const char *inaddr = ""); - // default constructor with string arg - - DecNetAddress( const DecNetAddress& decaddr); - // copy constructor - - DecNetAddress( const GenAddress& genaddr); - // construct with a GenAddress - - ~DecNetAddress(); - - virtual char *to_string(); - - DecNetAddress& operator=( const DecNetAddress &decaddr); - - virtual void to_octet(OctetStr& octet) const; - // convert address into octet string format 2 bytes of decnet address - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - virtual SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - SnmpSyntax *clone() const; - // create a new instance of this Value - - protected: - virtual int parse_address( const char *inaddr); - virtual addr_type get_type() const; - virtual void format_output(); - char output_buffer[MAX_DISPLAY_SZ]; -}; - -//------------------------------------------------------------------------ -//---------[ AppleTalk Address Class ]------------------------------------ -//------------------------------------------------------------------------ -class ACE_Export AppleTalkAddress : public Address - // = TITLE - // Defines the member functions for the concrete class DecNetAddress. - // DecNet Phase ? address consists of two octets (CISCO-TC.my) -{ - public: - AppleTalkAddress( const char *inaddr = ""); - // default constructor with string arg - - AppleTalkAddress( const AppleTalkAddress& atkaddr); - // copy constructor - - AppleTalkAddress( const GenAddress& genaddr); - // construct with a GenAddress - - ~AppleTalkAddress(); - - virtual char *to_string(); - - AppleTalkAddress& operator=( const AppleTalkAddress &atkaddr); - - virtual void to_octet(OctetStr& octet) const; - // convert address into octet string format 3 bytes of atk address - - char get_host_address() const; - // get the host part of the address - - void set_host_address(const char); - // set the host part of the address - - short get_net_address() const; - // get the 2 byte atk network address - - void set_net_address(const short atknet); - // set the host 2 byte atk network address - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - virtual SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - SnmpSyntax *clone() const; - // create a new instance of this Value - - private: - virtual int parse_address( const char *inaddr); - virtual addr_type get_type() const; - virtual void format_output(); - char output_buffer[MAX_DISPLAY_SZ]; -}; - -//------------------------------------------------------------------------ -//---------[ IPX Address Class ]------------------------------------------ -//------------------------------------------------------------------------ -class ACE_Export IpxAddress : public Address - // = TITLE - // Defines the member functions for the concrete class IpxAddress. - // Novell's IPX (version ?) network protocol endpoint -{ -public: - IpxAddress( const char *inaddr = ""); - // default constructor with a string arg - - IpxAddress( const IpxAddress &ipxaddr); - // constructor with another ipx object - - IpxAddress( const GenAddress &genaddr); - // construct with a GenAddress - - ~IpxAddress(); - // destructor - - virtual SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - IpxAddress& operator=( const IpxAddress &ipxaddress); - // assignment to another IpxAddress object overloaded - - int get_hostid( MacAddress& mac); - // get the host id portion of an ipx address - - SnmpSyntax *clone() const; - // create a new instance of this Value - - virtual char *to_string(); - // create string represtation of object value - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - virtual addr_type get_type() const; - // return the type - - virtual void to_octet(OctetStr& octet) const; - // return byte sequence containing ipx address - -protected: - char separator; - // ipx format separator {:,/} - - char output_buffer[MAX_DISPLAY_SZ]; - // output buffer to hold string representation - - virtual int parse_address( const char *inaddr); - // redefined parse address for ipx strings - - virtual void format_output(); - // redefined format output for ipx strings - // uses same separator as when constructed -}; - - - -//------------------------------------------------------------------------ -//---------[ IpxSock Address Class ]-------------------------------------- -//------------------------------------------------------------------------ -class ACE_Export IpxSockAddress : public IpxAddress - // = TITLE - // Defines the member functions for the concrete class IpxAddress. - // Novell's IPX (version ?) network protocol endpoint -{ -public: - IpxSockAddress( const char *inaddr = ""); - // constructor with a dotted string - - IpxSockAddress( const IpxSockAddress &ipxaddr); - // construct an Udp address with another Udp address - - IpxSockAddress( const GenAddress &genaddr); - //constructor with a GenAddress - - IpxSockAddress( const IpxAddress &ipxaddr); - //constructor with a IpxAddress - // default socket # is 0 - - ~IpxSockAddress(); - // destructor - - virtual SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - IpxSockAddress& operator=( const IpxSockAddress &ipxaddr); - // assignment to another IpxAddress object overloaded - - SnmpSyntax *clone() const; - // create a new instance of this Value - - void set_socket( const unsigned short s); - // set the socket number - - unsigned short get_socket() const; - // get the socket number - - virtual char *to_string(); - // create string representation of object value - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - virtual addr_type get_type() const; - // return the type - -protected: - char output_buffer[MAX_DISPLAY_SZ]; - // output buffer to hold string representation of object - - virtual int parse_address( const char *inaddr); - // redefined parse address for ipx strings - - virtual void format_output(); - // redefined format output - // specific to IP addresses -}; - -//------------------------------------------------------------------------- -//--------[ Generic Address ]---------------------------------------------- -//------------------------------------------------------------------------- -class ACE_Export GenAddress : public Address - // = TITLE - // Defines the member functions for the concrete class GenAddress. - // This class attempts to determine an address type given a char string. -{ -public: - GenAddress( const char *addr = ""); - // constructor with a string argument - - GenAddress( const Address &addr); - // constructor with an Address - - GenAddress( const GenAddress &addr); - // constructor with another GenAddress - - ~GenAddress(); - // destructor - - SmiUINT32 get_syntax(); - // get the snmp syntax of the contained address - - SnmpSyntax *clone() const; - // create a new instance of this Value - - GenAddress& operator=( const GenAddress &addr); - // assignment of a GenAddress - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - virtual char *to_string(); - // string representation of object value - - virtual operator const char *() const; - // const char * operator overloaded for streaming output - - virtual addr_type get_type() const; - // return the type - - virtual void to_octet(OctetStr& octet) const; - // return the address as a octet sequence - -protected: - Address *address; - // pointer to a a concrete address - - char output_buffer[MAX_DISPLAY_SZ]; - // output buffer of objects value - - virtual int parse_address( const char *addr); - // redefined parse address for macs - - virtual void format_output(); - // format output for a generic address - - void init_smi(); - // initialize smi data structure -}; - -#endif //_ADDRESS diff --git a/ASNMP/asnmp/asn1.cpp b/ASNMP/asnmp/asn1.cpp deleted file mode 100644 index 77dc9baa5ec..00000000000 --- a/ASNMP/asnmp/asn1.cpp +++ /dev/null @@ -1,1728 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// asn1.cpp -// -// = DESCRIPTION -// The Vb class is an encapsulation of the snmp variable binding. -// This module contains the class definition for the variable binding (VB) -// class. The VB class is an encapsulation of a SNMP VB. A VB object is -// composed of one SNMP++ Oid and one SMI value. The Vb class utilizes Oid -// objects and thus requires the Oid class. To use this class, -// set oid, value then call valid() to be sure object was constructed correctly. -// -// = AUTHOR -// S. Waldbusser (assumed) -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/********************************************************************** -// * - * Abstract Syntax Notation One, ASN.1 - * As defined in ISO/IS 8824 and ISO/IS 8825 - * This implements a subset of the above International Standards that - * is sufficient to implement SNMP. - * - * Encodes abstract data types into a machine independent stream of bytes. - * - Copyright 1988, 1989, 1991, 1992 by Carnegie Mellon University - - All Rights Reserved - - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, - provided that the above copyright notice appear in all copies and that - both that copyright notice and this permission notice appear in - supporting documentation, and that the name of CMU not be - used in advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - SOFTWARE. - ******************************************************************/ - -#include "asnmp/asn1.h" -#include "asnmp/snmp.h" - -ACE_RCSID(asnmp, asn1, "$Id$") - -/* - * parse_int - pulls a long out of an ASN int type. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the end of this object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char * asn1::parse_int( u_char *data, - int *datalength, - u_char *type, - long int *intp, - int intsize) -{ - ACE_TRACE("asn1::parse_int"); - /* - * ASN.1 integer ::= 0x02 asnlength byte {byte}* - */ - u_char *bufp = data; - u_long asn_length; - long value = 0; - - if (intsize != sizeof (long)){ - ASNERROR("not long"); - return 0; - } - *type = *bufp++; - bufp =asn1::parse_length(bufp, &asn_length); - if (bufp == 0){ - ASNERROR("bad length"); - return 0; - } - if ((int)(asn_length + (bufp - data)) > *datalength){ - ASNERROR("overflow of message"); - return 0; - } - if ((int)asn_length > intsize){ - ASNERROR("I don't support such large integers"); - return 0; - } - *datalength -= (int)asn_length + (bufp - data); - if (*bufp & 0x80) - value = -1; /* integer is negative */ - while(asn_length--) - value = (value << 8) | *bufp++; - *intp = value; - return bufp; -}; - - -/* - * parse_unsigned_int - pulls an u_long out of an ASN int type. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the end of this object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char * asn1::parse_unsigned_int( u_char *data, - int *datalength, - u_char *type, - u_long *intp, - int intsize) -{ - ACE_TRACE("asn1::parse_unsigned_int"); - /* - * ASN.1 integer ::= 0x02 asnlength byte {byte}* - */ - u_char *bufp = data; - u_long asn_length; - u_long value = 0; - - if (intsize != sizeof (long)){ - ASNERROR("not long"); - return 0; - } - *type = *bufp++; - bufp = asn1::parse_length(bufp, &asn_length); - if (bufp == 0){ - ASNERROR("bad length"); - return 0; - } - if ((int)(asn_length + (bufp - data)) > *datalength){ - ASNERROR("overflow of message"); - return 0; - } - if (((int)asn_length > (intsize + 1)) || - (((int)asn_length == intsize + 1) && *bufp != 0x00)){ - ASNERROR("I don't support such large integers"); - return 0; - } - *datalength -= (int)asn_length + (bufp - data); - if (*bufp & 0x80) - value = (u_long) -1; - while(asn_length--) - value = (value << 8) | *bufp++; - *intp = value; - return bufp; -}; - - -/* - * build_int - builds an ASN object containing an integer. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the end of this object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char * asn1::build_int( u_char *data, - int *datalength, - u_char type, - long *intp, - int intsize) -{ - ACE_TRACE("asn1::build_int"); - /* - * ASN.1 integer ::= 0x02 asnlength byte {byte}* - */ - - long integer; - u_long mask; - - if (intsize != sizeof (long)) - return 0; - integer = *intp; - /* - * Truncate "unnecessary" bytes off of the most significant end of this - * 2's complement integer. There should be no sequence of 9 - * consecutive 1's or 0's at the most significant end of the - * integer. - */ - mask = 0x1FF << ((8 * (sizeof(long) - 1)) - 1); - /* mask is 0xFF800000 on a big-endian machine */ - while((((integer & mask) == 0) || ((integer & mask) == mask)) - && intsize > 1){ - intsize--; - integer <<= 8; - } - data = asn1::build_header(data, datalength, type, intsize); - if (data == 0) - return 0; - if (*datalength < intsize) - return 0; - *datalength -= intsize; - mask = 0xFF << (8 * (sizeof(long) - 1)); - /* mask is 0xFF000000 on a big-endian machine */ - while(intsize--){ - *data++ = (u_char)((integer & mask) >> (8 * (sizeof(long) - 1))); - integer <<= 8; - } - return data; -}; - - -/* - * build_unsigned_int - builds an ASN object containing an integer. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the end of this object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char * asn1::build_unsigned_int( u_char *data, - int *datalength, - u_char type, - u_long *intp, - int intsize) -{ - ACE_TRACE("asn1::build_unsigned_int"); - /* - * ASN.1 integer ::= 0x02 asnlength byte {byte}* - */ - - u_long integer; - u_long mask; - int add_null_byte = 0; - - if (intsize != sizeof (long)) - return 0; - integer = *intp; - mask = 0xFF << (8 * (sizeof(long) - 1)); - /* mask is 0xFF000000 on a big-endian machine */ - if ((u_char)((integer & mask) >> (8 * (sizeof(long) - 1))) & 0x80){ - /* if MSB is set */ - add_null_byte = 1; - intsize++; - } - /* - * Truncate "unnecessary" bytes off of the most significant end of this 2's complement integer. - * There should be no sequence of 9 consecutive 1's or 0's at the most significant end of the - * integer. - */ - mask = 0x1FF << ((8 * (sizeof(long) - 1)) - 1); - /* mask is 0xFF800000 on a big-endian machine */ - while((((integer & mask) == 0) || ((integer & mask) == mask)) && intsize > 1){ - intsize--; - integer <<= 8; - } - data = asn1::build_header(data, datalength, type, intsize); - if (data == 0) - return 0; - if (*datalength < intsize) - return 0; - *datalength -= intsize; - if (add_null_byte == 1){ - *data++ = '\0'; - intsize--; - } - mask = 0xFF << (8 * (sizeof(long) - 1)); - /* mask is 0xFF000000 on a big-endian machine */ - while(intsize--){ - *data++ = (u_char)((integer & mask) >> (8 * (sizeof(long) - 1))); - integer <<= 8; - } - return data; -}; - - -/* - * parse_string - pulls an octet string out of an ASN octet string type. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the beginning of the next object. - * - * "string" is filled with the octet string. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char * asn1::parse_string( u_char *data, - int *datalength, - u_char *type, - u_char *string, - int *strlength) -{ - ACE_TRACE("asn1::parse_string"); - /* - * ASN.1 octet string ::= primstring | cmpdstring - * primstring ::= 0x04 asnlength byte {byte}* - * cmpdstring ::= 0x24 asnlength string {string}* - */ - u_char *bufp = data; - u_long asn_length; - - *type = *bufp++; - bufp = asn1::parse_length(bufp, &asn_length); - if (bufp == 0) - return 0; - if ((int)(asn_length + (bufp - data)) > *datalength){ - ASNERROR("overflow of message"); - return 0; - } - if ((int)asn_length > *strlength){ - ASNERROR("I don't support such long strings"); - return 0; - } - // fixed - ACE_OS::memcpy((char *)string, (char *)bufp, (int)asn_length); - *strlength = (int)asn_length; - *datalength -= (int)asn_length + (bufp - data); - return bufp + asn_length; -}; - - -/* - * build_string - Builds an ASN octet string object containing the input string. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the beginning of the next object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char * asn1::build_string( u_char *data, - int *datalength, - u_char type, - u_char *string, - int strlength) -{ - ACE_TRACE("asn1::build_string"); - /* - * ASN.1 octet string ::= primstring | cmpdstring - * primstring ::= 0x04 asnlength byte {byte}* - * cmpdstring ::= 0x24 asnlength string {string}* - * This code will never send a compound string. - */ - data = asn1::build_header(data, datalength, type, strlength); - if (data == 0) - return 0; - if (*datalength < strlength) - return 0; - // fixed - ACE_OS::memcpy((u_char *)data,(u_char *)string, strlength); - *datalength -= strlength; - return data + strlength; -}; - - -/* - * parse_header - interprets the ID and length of the current object. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * in this object following the id and length. - * - * Returns a pointer to the first byte of the contents of this object. - * Returns 0 on any error. - */ -u_char *asn1::parse_header( u_char *data, - int *datalength, - u_char *type) -{ - ACE_TRACE("asn1::parse_header"); - u_char *bufp = data; - register int header_len; - u_long asn_length; - - /* this only works on data types < 30, i.e. no extension octets */ - if (IS_EXTENSION_ID(*bufp)){ - ASNERROR("can't process ID >= 30"); - return 0; - } - *type = *bufp; - bufp = asn1::parse_length(bufp + 1, &asn_length); - if (bufp == 0) - return 0; - header_len = bufp - data; - if ((int)(header_len + asn_length) > *datalength){ - ASNERROR("asn length too long"); - return 0; - } - *datalength = (int)asn_length; - return bufp; -} - -/* - * asn1::build_header - builds an ASN header for an object with the ID and - * length specified. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * in this object following the id and length. - * - * This only works on data types < 30, i.e. no extension octets. - * The maximum length is 0xFFFF; - * - * Returns a pointer to the first byte of the contents of this object. - * Returns 0 on any error. - */ -u_char * asn1::build_header( u_char *data, - int *datalength, - u_char type, - int length) -{ - ACE_TRACE("asn1::build_header"); - if (*datalength < 1) - return 0; - *data++ = type; - (*datalength)--; - return asn1::build_length(data, datalength, length); - -} - -/* - * asn_build_sequence - builds an ASN header for a sequence with the ID and - * length specified. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * in this object following the id and length. - * - * This only works on data types < 30, i.e. no extension octets. - * The maximum length is 0xFFFF; - * - * Returns a pointer to the first byte of the contents of this object. - * Returns 0 on any error. - */ -u_char * asn1::build_sequence( u_char *data, - int *datalength, - u_char type, - int length) -{ - ACE_TRACE("asn1::build_sequence"); - *datalength -= 4; - if (*datalength < 0){ - *datalength += 4; /* fix up before punting */ - return 0; - } - *data++ = type; - *data++ = (u_char)(0x02 | ASN_LONG_LEN); - *data++ = (u_char)((length >> 8) & 0xFF); - *data++ = (u_char)(length & 0xFF); - return data; -}; - -/* - * parse_length - interprets the length of the current object. - * On exit, length contains the value of this length field. - * - * Returns a pointer to the first byte after this length - * field (aka: the start of the data field). - * Returns 0 on any error. - */ -u_char * asn1::parse_length( u_char *data, - u_long *length) -{ - ACE_TRACE("asn1::parse_length"); - u_char lengthbyte = *data; - - if (lengthbyte & ASN_LONG_LEN){ - lengthbyte &= ~ASN_LONG_LEN; /* turn MSb off */ - if (lengthbyte == 0){ - ASNERROR("We don't support indefinite lengths"); - return 0; - } - if (lengthbyte > sizeof(long)){ - ASNERROR("we can't support data lengths that long"); - return 0; - } - // fixed - ACE_OS::memcpy((char *)length, (char *)data + 1, (int)lengthbyte); - *length = ntohl(*length); - *length >>= (8 * ((sizeof *length) - lengthbyte)); - return data + lengthbyte + 1; - } else { /* short asnlength */ - *length = (long)lengthbyte; - return data + 1; - } -}; - -u_char *asn1::build_length( u_char *data, - int *datalength, - int length) -{ - ACE_TRACE("asn1::build_length"); - u_char *start_data = data; - - /* no indefinite lengths sent */ - if (length < 0x80){ - if (*datalength < 1){ - ASNERROR("build_length"); - return 0; - } - *data++ = (u_char)length; - } else if (length <= 0xFF){ - if (*datalength < 2){ - ASNERROR("build_length"); - return 0; - } - *data++ = (u_char)(0x01 | ASN_LONG_LEN); - *data++ = (u_char)length; - } else { /* 0xFF < length <= 0xFFFF */ - if (*datalength < 3){ - ASNERROR("build_length"); - return 0; - } - *data++ = (u_char)(0x02 | ASN_LONG_LEN); - *data++ = (u_char)((length >> 8) & 0xFF); - *data++ = (u_char)(length & 0xFF); - } - *datalength -= (data - start_data); - return data; - -} - -/* - * parse_objid - pulls an object indentifier out of an ASN object identifier type. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the beginning of the next object. - * - * "objid" is filled with the object identifier. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char *asn1::parse_objid( u_char *data, - int *datalength, - u_char *type, - oid *objid, - int *objidlength) -{ - ACE_TRACE("asn1::parse_objid"); - /* - * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}* - * subidentifier ::= {leadingbyte}* lastbyte - * leadingbyte ::= 1 7bitvalue - * lastbyte ::= 0 7bitvalue - */ - u_char *bufp = data; - oid *oidp = objid + 1; - u_long subidentifier; - long length; - u_long asn_length; - - *type = *bufp++; - bufp = asn1::parse_length(bufp, &asn_length); - if (bufp == 0) - return 0; - if ((int)asn_length + (bufp - data) > *datalength){ - ASNERROR("overflow of message"); - return 0; - } - *datalength -= (int)asn_length + (bufp - data); - - /* Handle invalid object identifier encodings of the form 06 00 robustly */ - if (asn_length == 0) - objid[0] = objid[1] = 0; - - length = asn_length; - (*objidlength)--; /* account for expansion of first byte */ - while (length > 0 && (*objidlength)-- > 0){ - subidentifier = 0; - do { /* shift and add in low order 7 bits */ - subidentifier = (subidentifier << 7) + (*(u_char *)bufp & ~ASN_BIT8); - length--; - } while (*(u_char *)bufp++ & ASN_BIT8); /* last byte has high bit clear */ - if (subidentifier > (u_long)MAX_SUBID){ - ASNERROR("subidentifier too long"); - return 0; - } - *oidp++ = (oid)subidentifier; - } - - /* - * The first two subidentifiers are encoded into the first component - * with the value (X * 40) + Y, where: - * X is the value of the first subidentifier. - * Y is the value of the second subidentifier. - */ - subidentifier = (u_long)objid[1]; - if (subidentifier == 0x2B){ - objid[0] = 1; - objid[1] = 3; - } else { - objid[1] = (u_char)(subidentifier % 40); - objid[0] = (u_char)((subidentifier - objid[1]) / 40); - } - - *objidlength = (int)(oidp - objid); - return bufp; -} - -/* - * build_objid - Builds an ASN object identifier object containing the - * input string. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the beginning of the next object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char *asn1::build_objid( u_char *data, - int *datalength, - u_char type, - oid *objid, - int objidlength) -{ - ACE_TRACE("asn1::build_objid"); - /* - * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}* - * subidentifier ::= {leadingbyte}* lastbyte - * leadingbyte ::= 1 7bitvalue - * lastbyte ::= 0 7bitvalue - */ - u_char buf[MAX_OID_LEN]; - u_char *bp = buf; - oid *op = objid; - int asnlength; - u_long subid, mask, testmask; - int bits, testbits; - - if (objidlength < 2){ - *bp++ = 0; - objidlength = 0; - } else { - *bp++ = (u_char) (op[1] + (op[0] * 40)); - objidlength -= 2; - op += 2; - } - - while(objidlength-- > 0){ - subid = *op++; - if (subid < 127){ /* off by one? */ - *bp++ = (u_char )subid; - } else { - mask = 0x7F; /* handle subid == 0 case */ - bits = 0; - /* testmask *MUST* !!!! be of an u_type */ - for(testmask = 0x7F, testbits = 0; testmask != 0; - testmask <<= 7, testbits += 7){ - if (subid & testmask){ /* if any bits set */ - mask = testmask; - bits = testbits; - } - } - /* mask can't be zero here */ - for(;mask != 0x7F; mask >>= 7, bits -= 7){ - /* fix a mask that got truncated above */ - if (mask == 0x1E00000) - mask = 0xFE00000; - *bp++ = (u_char)(((subid & mask) >> bits) | ASN_BIT8); - } - *bp++ = (u_char)(subid & mask); - } - } - asnlength = bp - buf; - data = asn1::build_header(data, datalength, type, asnlength); - if (data == 0) - return 0; - if (*datalength < asnlength) - return 0; - // fixed - ACE_OS::memcpy((char *)data, (char *)buf, asnlength); - *datalength -= asnlength; - return data + asnlength; -} - -/* - * parse_null - Interprets an ASN null type. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the beginning of the next object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char *asn1::parse_null(u_char *data, - int *datalength, - u_char *type) -{ - ACE_TRACE("asn1::parse_null"); - /* - * ASN.1 null ::= 0x05 0x00 - */ - u_char *bufp = data; - u_long asn_length; - - *type = *bufp++; - bufp = asn1::parse_length(bufp, &asn_length); - if (bufp == 0) - return 0; - if (asn_length != 0){ - ASNERROR("Malformed 0"); - return 0; - } - *datalength -= (bufp - data); - return bufp + asn_length; -} - - -/* - * build_null - Builds an ASN null object. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the beginning of the next object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char *asn1::build_null( u_char *data, - int *datalength, - u_char type) -{ - ACE_TRACE("asn1::build_null"); - /* - * ASN.1 null ::= 0x05 0x00 - */ - return asn1::build_header(data, datalength, type, 0); -}; - -/* - * parse_bitstring - pulls a bitstring out of an ASN bitstring type. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the beginning of the next object. - * - * "string" is filled with the bit string. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char *asn1::parse_bitstring( u_char *data, - int *datalength, - u_char *type, - u_char *string, - int *strlength) -{ - ACE_TRACE("asn1::parse_bitstring"); - /* - * bitstring ::= 0x03 asnlength unused {byte}* - */ - u_char *bufp = data; - u_long asn_length; - - *type = *bufp++; - bufp = asn1::parse_length(bufp, &asn_length); - if (bufp == 0) - return 0; - if ((int)(asn_length + (bufp - data)) > *datalength){ - ASNERROR("overflow of message"); - return 0; - } - if ((int) asn_length > *strlength){ - ASNERROR("I don't support such long bitstrings"); - return 0; - } - if (asn_length < 1){ - ASNERROR("Invalid bitstring"); - return 0; - } - if (*bufp > 7){ - ASNERROR("Invalid bitstring"); - return 0; - } - // fixed - ACE_OS::memcpy((char *)string,(char *)bufp, (int)asn_length); - *strlength = (int)asn_length; - *datalength -= (int)asn_length + (bufp - data); - return bufp + asn_length; -} - - -/* - * build_bitstring - Builds an ASN bit string object containing the - * input string. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the beginning of the next object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char *asn1::build_bitstring( u_char *data, - int *datalength, - u_char type, - u_char *string, - int strlength) -{ - ACE_TRACE("asn1::build_bitstring"); - /* - * ASN.1 bit string ::= 0x03 asnlength unused {byte}* - */ - if (strlength < 1 || *string || *string > 7){ - ASNERROR("Building invalid bitstring"); - return 0; - } - data = asn1::build_header(data, datalength, type, strlength); - if (data == 0) - return 0; - if (*datalength < strlength) - return 0; - // fixed - ACE_OS::memcpy((char *)data,(char *)string, strlength); - *datalength -= strlength; - return data + strlength; -} - - -/* - * parse_unsigned_int64 - pulls a 64 bit u_long out of an ASN int - * type. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the end of this object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char * asn1::parse_unsigned_int64(u_char *data, - int *datalength, - u_char *type, - struct counter64 *cp, - int countersize) -{ - ACE_TRACE("asn1::parse_unsigned_int64"); - /* - * ASN.1 integer ::= 0x02 asnlength byte {byte}* - */ - u_char *bufp = data; - u_long asn_length; - u_long low = 0, high = 0; - int intsize = 4; - - if (countersize != sizeof(struct counter64)){ - ASNERROR("not right size"); - return 0; - } - *type = *bufp++; - bufp = asn1::parse_length(bufp, &asn_length); - if (bufp == 0){ - ASNERROR("bad length"); - return 0; - } - if ((int)(asn_length + (bufp - data)) > *datalength){ - ASNERROR("overflow of message"); - return 0; - } - if (((int)asn_length > (intsize * 2 + 1)) || - (((int)asn_length == (intsize * 2) + 1) && *bufp != 0x00)){ - ASNERROR("I don't support such large integers"); - return 0; - } - *datalength -= (int)asn_length + (bufp - data); - if (*bufp & 0x80){ - low = (u_long) -1; // integer is negative - high = (u_long) -1; - } - while(asn_length--){ - high = (high << 8) | ((low & 0xFF000000) >> 24); - low = (low << 8) | *bufp++; - } - cp->low = low; - cp->high = high; - return bufp; -} - - -/* - * build_unsigned_int64 - builds an ASN object containing a 64 bit integer. - * On entry, datalength is input as the number of valid bytes following - * "data". On exit, it is returned as the number of valid bytes - * following the end of this object. - * - * Returns a pointer to the first byte past the end - * of this object (i.e. the start of the next object). - * Returns 0 on any error. - */ -u_char * asn1::build_unsigned_int64( u_char *data, - int *datalength, - u_char type, - struct counter64 *cp, - int countersize) -{ - ACE_TRACE("asn1::build_unsigned_int64"); - /* - * ASN.1 integer ::= 0x02 asnlength byte {byte}* - */ - - u_long low, high; - u_long mask, mask2; - int add_null_byte = 0; - int intsize; - - if (countersize != sizeof (struct counter64)) - return 0; - intsize = 8; - low = cp->low; - high = cp->high; - mask = 0xFF << (8 * (sizeof(long) - 1)); - /* mask is 0xFF000000 on a big-endian machine */ - if ((u_char)((high & mask) >> (8 * (sizeof(long) - 1))) & 0x80){ - /* if MSB is set */ - add_null_byte = 1; - intsize++; - } - /* - * Truncate "unnecessary" bytes off of the most significant end of this 2's - * complement integer. - * There should be no sequence of 9 consecutive 1's or 0's at the most - * significant end of the integer. - */ - mask2 = 0x1FF << ((8 * (sizeof(long) - 1)) - 1); - /* mask2 is 0xFF800000 on a big-endian machine */ - while((((high & mask2) == 0) || ((high & mask2) == mask2)) - && intsize > 1){ - intsize--; - high = (high << 8) - | ((low & mask) >> (8 * (sizeof(long) - 1))); - low <<= 8; - } - data = asn1::build_header(data, datalength, type, intsize); - if (data == 0) - return 0; - if (*datalength < intsize) - return 0; - *datalength -= intsize; - if (add_null_byte == 1){ - *data++ = '\0'; - intsize--; - } - while(intsize--){ - *data++ = (u_char)((high & mask) >> (8 * (sizeof(long) - 1))); - high = (high << 8) - | ((low & mask) >> (8 * (sizeof(long) - 1))); - low <<= 8; - - } - return data; -} - - -// create a pdu -struct snmp_pdu * cmu_snmp::pdu_create( int command) -{ - ACE_TRACE("cmu_snmp::snmp_pdu_create"); - struct snmp_pdu *pdu; - - ACE_NEW_RETURN(pdu, snmp_pdu, 0); - ACE_OS::memset((char *)pdu, 0,sizeof(struct snmp_pdu)); - pdu->command = command; - pdu->errstat = 0; - pdu->errindex = 0; - pdu->enterprise = 0; - pdu->enterprise_length = 0; - pdu->variables = 0; - return pdu; -} - -// release a pdu from memory -void cmu_snmp::free_pdu( struct snmp_pdu *pdu) -{ - ACE_TRACE("cmu_snmp::free_pdu"); - struct variable_list *vp, *ovp; - - vp = pdu->variables; - while(vp){ - // release the oid part - if (vp->name) - delete [] vp->name; - // if deep data, then release as well - if (vp->val.string) - delete [] vp->val.string; - ovp = vp; - // go to the next one - vp = vp->next_variable; - // release up vb itself - delete ovp; - } - // if enterprise release it up - if (pdu->enterprise) - delete [] pdu->enterprise; - // release up pdu itself - delete pdu; -} - - -// add a null var to a pdu -void cmu_snmp::add_var(struct snmp_pdu *pdu, - oid *name, - int name_length, - SmiVALUE *smival) -{ - ACE_TRACE("cmu_snmp::add_var"); - - struct variable_list *vars; - - // if we don't have a vb list ,create one - if (pdu->variables == 0) { - ACE_NEW(pdu->variables, variable_list); - vars = pdu->variables; - } - else - { // we have one, find the end - for(vars = pdu->variables; vars->next_variable; vars = vars->next_variable); - // create one - ACE_NEW(vars->next_variable, variable_list); - // bump ptr - vars = vars->next_variable; - } - - // add the oid with no data - vars->next_variable = 0; - - // hook in the Oid portion - ACE_NEW(vars->name, oid[(name_length)]); - - // fixed - ACE_OS::memcpy((char *)vars->name,(char *)name, name_length * sizeof(oid)); - vars->name_length = name_length; - - // hook in the SMI value - switch( smival->syntax) - { - // null , do nothing - case sNMP_SYNTAX_NULL: - case sNMP_SYNTAX_NOSUCHOBJECT: - case sNMP_SYNTAX_NOSUCHINSTANCE: - case sNMP_SYNTAX_ENDOFMIBVIEW: - { - vars->type = (u_char) smival->syntax; - vars->val.string = 0; - vars->val_len = 0; - } - break; - - // octects - case sNMP_SYNTAX_OCTETS: - case sNMP_SYNTAX_OPAQUE: - case sNMP_SYNTAX_IPADDR: - { - vars->type = (u_char) smival->syntax; - ACE_NEW(vars->val.string, - u_char[(unsigned)smival->value.string.len]); - vars->val_len = (int) smival->value.string.len; - ACE_OS::memcpy( (u_char *) vars->val.string, - (u_char *) smival->value.string.ptr, - (unsigned) smival->value.string.len); - } - break; - - // oid - case sNMP_SYNTAX_OID: - { - vars->type = (u_char) smival->syntax; - vars->val_len = (int) smival->value.oid.len * sizeof(oid); - ACE_NEW(vars->val.objid, oid[(unsigned)vars->val_len]); - ACE_OS::memcpy((u_long *)vars->val.objid, - (u_long *)smival->value.oid.ptr, - (unsigned) vars->val_len); - } - break; - - - - case sNMP_SYNTAX_TIMETICKS: - case sNMP_SYNTAX_CNTR32: - case sNMP_SYNTAX_GAUGE32: - case sNMP_SYNTAX_UINT32: - { - long templong; - vars->type = (u_char) smival->syntax; - ACE_NEW(vars->val.integer, long); - vars->val_len = sizeof(long); - templong = (long) smival->value.uNumber; - ACE_OS::memcpy( (long*) vars->val.integer, - (long*) &templong, - sizeof(long)); - } - break; - - case sNMP_SYNTAX_INT32: - { - long templong; - vars->type = (u_char) smival->syntax; - ACE_NEW(vars->val.integer, long); - vars->val_len = sizeof(long); - templong = (long) smival->value.sNumber; - ACE_OS::memcpy( (long*) vars->val.integer, - (long*) &templong, - sizeof(long)); - } - break; - - // 64 bit counter - case sNMP_SYNTAX_CNTR64: - { - vars->type = ( u_char) smival->syntax; - ACE_NEW(vars->val.counter64, counter64); - vars->val_len = sizeof(struct counter64); - ACE_OS::memcpy( (struct counter64*) vars->val.counter64, - (SmiLPCNTR64) &(smival->value.hNumber), - sizeof( SmiCNTR64)); - } - break; - - } // end switch - -} - -// build the authentication -// works for v1 or v2c -u_char *cmu_snmp::auth_build( u_char *data, - int *length, - long int version, - u_char *community, - int community_len, - int messagelen) -{ - ACE_TRACE("cmu_snmp::auth_build"); - u_char *params; - int plen; - - params = community; - plen = community_len; - - data = asn1::build_sequence(data, - length, - (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), - messagelen + plen + 5); - if (data == 0){ - ASNERROR("buildheader"); - return 0; - } - data = asn1::build_int(data, - length, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - (long *)&version, - sizeof(version)); - if (data == 0){ - ASNERROR("buildint"); - return 0; - } - - data = asn1::build_string(data, - length, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR), - params, - plen ); - if (data == 0){ - ASNERROR("buildstring"); - return 0; - } - - return (u_char *)data; -}; - - -// build a variable binding -u_char * cmu_snmp::build_var_op(u_char *data, oid * var_name, - int *var_name_len, - u_char var_val_type, - int var_val_len, u_char *var_val, - int *listlength) - -{ - ACE_TRACE("cmu_snmp::build_var_op"); - int dummyLen, headerLen; - u_char *dataPtr; - - dummyLen = *listlength; - dataPtr = data; - - data += 4; - dummyLen -=4; - if (dummyLen < 0) - return 0; - - headerLen = data - dataPtr; - *listlength -= headerLen; - data = asn1::build_objid( data, listlength, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID), - var_name, *var_name_len); - if (data == 0) { - ASNERROR(""); - return 0; - } - - // based on the type... - switch(var_val_type) { - case ASN_INTEGER: - data = asn1::build_int( data, listlength, var_val_type, (long *)var_val, - var_val_len); - break; - - case SMI_GAUGE: - case SMI_COUNTER: - case SMI_TIMETICKS: - case SMI_UINTEGER: - data = asn1::build_unsigned_int( data, - listlength, - var_val_type, - (u_long *)var_val, - var_val_len); - break; - - case SMI_COUNTER64: - data = asn1::build_unsigned_int64(data, - listlength, - var_val_type, - (struct counter64 *)var_val, - var_val_len); - break; - - case ASN_OCTET_STR: - case SMI_IPADDRESS: - case SMI_OPAQUE: - case SMI_NSAP: - data = asn1::build_string(data, listlength, var_val_type, - var_val, var_val_len); - break; - - case ASN_OBJECT_ID: - data = asn1::build_objid(data, listlength, var_val_type, - (oid *)var_val, var_val_len / sizeof(oid)); - break; - - case ASN_NULL: - data = asn1::build_null(data, listlength, var_val_type); - break; - - case ASN_BIT_STR: - data = asn1::build_bitstring(data, listlength, var_val_type, - var_val, var_val_len); - break; - - case SNMP_NOSUCHOBJECT: - case SNMP_NOSUCHINSTANCE: - case SNMP_ENDOFMIBVIEW: - data = asn1::build_null(data, listlength, var_val_type); - break; - - default: - ASNERROR("wrong type"); - return 0; - } - if (data == 0) { - ASNERROR(""); - return 0; - } - dummyLen = (data - dataPtr) - headerLen; - - asn1::build_sequence(dataPtr, &dummyLen, - (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), - dummyLen); - return data; -} - - -// serialize the pdu -int cmu_snmp::build( struct snmp_pdu *pdu, u_char *packet, - int *out_length, long version, - u_char* community, int community_len) -{ - ACE_TRACE("cmu_snmp::build"); - u_char buf[SNMP_MSG_LENGTH]; - u_char *cp; - struct variable_list *vp; - int length; - int totallength; - - length = *out_length; - cp = packet; - for(vp = pdu->variables; vp; vp = vp->next_variable) { - cp = cmu_snmp::build_var_op( cp, vp->name, - &vp->name_length, vp->type, - vp->val_len, (u_char *)vp->val.string, - &length); - if (cp == 0) - return -1; - } - totallength = cp - packet; - - length = SNMP_MSG_LENGTH; - - // encode the total len - cp = asn1::build_header( buf, &length, - (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), - totallength); - if (cp == 0) - return -1; - ACE_OS::memcpy( (char *)cp, (char *)packet,totallength); - totallength += cp - buf; - - length = *out_length; - if (pdu->command != TRP_REQ_MSG) { - - // request id - cp = asn1::build_int( packet, - &length, - (u_char )(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - (long *)&pdu->reqid, - sizeof(pdu->reqid)); - if (cp == 0) - return -1; - - // error status - cp = asn1::build_int(cp, - &length, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - (long *)&pdu->errstat, sizeof(pdu->errstat)); - if (cp == 0) - return -1; - - // error index - cp = asn1::build_int(cp, - &length, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - (long *)&pdu->errindex, sizeof(pdu->errindex)); - if (cp == 0) - return -1; - } - else { // this is a trap message - - // enterprise - cp = asn1::build_objid( packet, - &length, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID), - (oid *)pdu->enterprise, - pdu->enterprise_length); - if (cp == 0) - return -1; - - // agent-addr - cp = asn1::build_string(cp, - &length, - // HDN Fixed to use correct tag - (u_char)SMI_IPADDRESS, - //(u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR), - (u_char *)&pdu->agent_addr.sin_addr.s_addr, - sizeof(pdu->agent_addr.sin_addr.s_addr)); - if (cp == 0) - return -1; - - // generic trap - cp = asn1::build_int(cp, - &length, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - (long *)&pdu->trap_type, - sizeof(pdu->trap_type)); - if (cp == 0) - return -1; - - // specific trap - cp = asn1::build_int( cp, - &length, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - (long *)&pdu->specific_type, - sizeof(pdu->specific_type)); - if (cp == 0) - return -1; - - // timestamp - cp = asn1::build_int(cp, - &length, - // HDN Fixed to use correct tag - (u_char)SMI_TIMETICKS, - //(u_char )(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - (long *)&pdu->time, - sizeof(pdu->time)); - if (cp == 0) - return -1; - } - - if (length < totallength) - return -1; - // fixed - ACE_OS::memcpy((char *)cp, (char *)buf, totallength); - totallength += cp - packet; - - length = SNMP_MSG_LENGTH; - cp = asn1::build_header(buf, - &length, - (u_char)pdu->command, - totallength); - if (cp == 0) - return -1; - if (length < totallength) - return -1; - // fixed - ACE_OS::memcpy((char *)cp, (char *)packet, totallength); - totallength += cp - buf; - - length = *out_length; - - cp = cmu_snmp::auth_build( packet, - &length, - version, - community, - community_len, - totallength ); - if (cp == 0) - return -1; - if ((*out_length - (cp - packet)) < totallength) - return -1; - // fixed - ACE_OS::memcpy((char *)cp, (char *)buf, totallength); - totallength += cp - packet; - *out_length = totallength; - - return 0; -} - -// parse the authentication header -u_char *cmu_snmp::auth_parse(u_char *data, - int *length, u_char *sid, - int *slen, long *version) -{ - ACE_TRACE("cmu_snmp::auth_parse"); - u_char type; - - // get the type - data = asn1::parse_header( data, length, &type); - if (data == 0){ - ASNERROR("bad header"); - return 0; - } - - if (type != (ASN_SEQUENCE | ASN_CONSTRUCTOR)) { - ASNERROR("wrong auth header type"); - return 0; - } - - // get the version - data = asn1::parse_int(data, length, &type, version, sizeof(*version)); - if (data == 0) { - ASNERROR("bad parse of version"); - return 0; - } - - // get the community name - data = asn1::parse_string(data, length, &type, sid, slen); - if (data == 0) { - ASNERROR("bad parse of community"); - return 0; - } - - return (u_char *)data; -} - -/* u_char *data, // IN - pointer to the start of object - oid *var_name, // OUT - object id of variable - int *var_name_len, // IN/OUT - length of variable name - u_char *var_val_type, // OUT - type of variable - (int or octet string) (one byte) - int *var_val_len, // OUT - length of variable - u_char **var_val, // OUT - pointer to ASN1 encoded value of variable -*/ - -u_char * -cmu_snmp::parse_var_op( u_char *data, oid *var_name, - int *var_name_len, u_char *var_val_type, - int *var_val_len, u_char **var_val, - int *listlength) -{ - ACE_TRACE("cmu_snmp::parse_var_op"); - u_char var_op_type; - int var_op_len = *listlength; - u_char *var_op_start = data; - - data = asn1::parse_header(data, &var_op_len, &var_op_type); - if (data == 0){ - ASNERROR(""); - return 0; - } - if (var_op_type != (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR)) - return 0; - data = asn1::parse_objid(data, &var_op_len, &var_op_type, var_name, var_name_len); - if (data == 0) { - ASNERROR(""); - return 0; - } - if (var_op_type != (u_char) - (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID)) - return 0; - *var_val = data; /* save pointer to this object */ - /* find out what type of object this is */ - data = asn1::parse_header(data, &var_op_len, var_val_type); - if (data == 0) { - ASNERROR(""); - return 0; - } - *var_val_len = var_op_len; - data += var_op_len; - *listlength -= (int)(data - var_op_start); - return data; -} - - - -// build a pdu from a data and length -int cmu_snmp::parse( struct snmp_pdu *pdu, - u_char *data, - u_char *community_name, - u_long &community_len, - snmp_version &spp_version, - int length) -{ - ACE_TRACE("cmu_snmp::parse"); - u_char msg_type; - u_char type; - u_char *var_val; - long version; - int len, four; - u_char community[256]; - int community_length = 256; - struct variable_list *vp = 0; - oid objid[MAX_NAME_LEN], *op; - - // authenticates message and returns length if valid - data = cmu_snmp::auth_parse(data, - &length, - community, - &community_length, - &version); - if (data == 0) - return -1; - - // copy the returned community name - ACE_OS::memcpy( (u_char *) community_name, - (u_char *) community, - community_length); - community_len = (long) community_length; - - if( version != SNMP_VERSION_1 && version != SNMP_VERSION_2C ) { - ASNERROR("Wrong version"); - return -1; - } - - spp_version = (snmp_version) version; - - data = asn1::parse_header(data, - &length, - &msg_type); - if (data == 0) - return -1; - pdu->command = msg_type; - - if (pdu->command != TRP_REQ_MSG){ - // get the rid - data = asn1::parse_int(data, - &length, &type, - (long *)&pdu->reqid, - sizeof(pdu->reqid)); - if (data == 0) - return -1; - // get the error status - data = asn1::parse_int(data, - &length, - &type, - (long *)&pdu->errstat, - sizeof(pdu->errstat)); - if (data == 0) - return -1; - // get the error index - data = asn1::parse_int(data, - &length, - &type, - (long *)&pdu->errindex, - sizeof(pdu->errindex)); - if (data == 0) - return -1; - } - else { // is a trap - - // get the enterprise - pdu->enterprise_length = MAX_NAME_LEN; - data = asn1::parse_objid(data, - &length, - &type, - objid, - &pdu->enterprise_length); - if (data == 0) - return -1; - - ACE_NEW_RETURN(pdu->enterprise, - oid[pdu->enterprise_length*sizeof(oid)],-1); - - // fixed - ACE_OS::memcpy((char *)pdu->enterprise,(char *)objid, - pdu->enterprise_length * sizeof(oid)); - - // get source address - four = 4; - data = asn1::parse_string(data, &length, &type, - (u_char *)&pdu->agent_addr.sin_addr.s_addr, - &four); - if (data == 0) - return -1; - - // get trap type - data = asn1::parse_int(data, &length, &type, (long *)&pdu->trap_type, - sizeof(pdu->trap_type)); - if (data == 0) - return -1; - - // trap type - data = asn1::parse_int(data, &length, &type, (long *)&pdu->specific_type, - sizeof(pdu->specific_type)); - if (data == 0) - return -1; - - // timestamp - data = asn1::parse_int(data, &length, &type, (long *)&pdu->time, - sizeof(pdu->time)); - if (data == 0) - return -1; - } - - // get the vb list - data = asn1::parse_header(data, &length, &type); - if (data == 0) - return -1; - - if (type != (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR)) - return -1; - - while((int)length > 0) { - if (pdu->variables == 0) { - ACE_NEW_RETURN(pdu->variables, variable_list, -1); - vp = pdu->variables; - } else { - ACE_NEW_RETURN(vp->next_variable, variable_list, -1); - vp = vp->next_variable; - } - vp->next_variable = 0; - vp->val.string = 0; - vp->name = 0; - vp->name_length = MAX_NAME_LEN; - data = cmu_snmp::parse_var_op( data, objid, - &vp->name_length, &vp->type, - &vp->val_len, &var_val, - (int *)&length); - if (data == 0) - return -1; - - ACE_NEW_RETURN(op, oid[(unsigned)vp->name_length * sizeof(oid)], -1); - - // fixed - ACE_OS::memcpy((char *)op, (char *)objid, vp->name_length * sizeof(oid)); - vp->name = op; - - len = SNMP_MSG_LENGTH; - switch((short)vp->type) { - case ASN_INTEGER: - case SMI_COUNTER: - case SMI_GAUGE: - case SMI_TIMETICKS: - case SMI_UINTEGER: - ACE_NEW_RETURN(vp->val.integer,long, -1); - vp->val_len = sizeof(long); - asn1::parse_int(var_val, &len, &vp->type, (long *)vp->val.integer, sizeof(vp->val.integer)); - break; - case SMI_COUNTER64: - ACE_NEW_RETURN(vp->val.counter64, counter64, -1); - vp->val_len = sizeof(struct counter64); - asn1::parse_unsigned_int64(var_val, &len, &vp->type, - (struct counter64 *)vp->val.counter64, - sizeof(*vp->val.counter64)); - break; - - case ASN_OCTET_STR: - case SMI_IPADDRESS: - case SMI_OPAQUE: - case SMI_NSAP: - ACE_NEW_RETURN(vp->val.string, u_char[(unsigned)vp->val_len + 1], -1); - asn1::parse_string(var_val, &len, &vp->type, vp->val.string, - &vp->val_len); - break; - - case ASN_OBJECT_ID: - vp->val_len = MAX_NAME_LEN; - asn1::parse_objid(var_val, &len, &vp->type, objid, &vp->val_len); - //vp->val_len *= sizeof(oid); - - ACE_NEW_RETURN(vp->val.objid, oid[(unsigned)vp->val_len*sizeof(oid)], -1); - - // fixed - ACE_OS::memcpy((char *)vp->val.objid, - (char *)objid, - vp->val_len * sizeof(oid)); - break; - - case SNMP_NOSUCHOBJECT: - case SNMP_NOSUCHINSTANCE: - case SNMP_ENDOFMIBVIEW: - case ASN_NULL: - break; - default: - ASNERROR("bad type returned "); - break; - } - } - return 0; -} diff --git a/ASNMP/asnmp/asn1.h b/ASNMP/asnmp/asn1.h deleted file mode 100644 index 82a81f4a561..00000000000 --- a/ASNMP/asnmp/asn1.h +++ /dev/null @@ -1,342 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef ASN1 -#define ASN1 -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// asn1.h -// -// = DESCRIPTION -// Abstract Syntax Notation One, ASN.1 -// As defined in ISO/IS 8824 and ISO/IS 8825 -// This implements a subset of the above International Standards that -// is sufficient to implement SNMP. -// -// = AUTHOR -// Steve Waldbusser/CMU ? -// -// ============================================================================ - -/********************************************************************** - Copyright 1988, 1989, 1991, 1992 by Carnegie Mellon University - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of CMU not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. -******************************************************************/ - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "asnmp/snmp.h" - -// CMU code to define "oid" typedef (old C style) -#ifndef EIGHTBIT_SUBIDS -typedef unsigned long oid; -#define MAX_SUBID 0xFFFFFFFF -#else -typedef unsigned char oid; -#define MAX_SUBID 0xFF -#endif - -#define MAX_OID_LEN 64 /* max subid's in an oid */ - - -// asn.1 values -#define ASN_BOOLEAN (0x01) -#define ASN_INTEGER (0x02) -#define ASN_BIT_STR (0x03) -#define ASN_OCTET_STR (0x04) -#define ASN_NULL (0x05) -#define ASN_OBJECT_ID (0x06) -#define ASN_SEQUENCE (0x10) -#define ASN_SET (0x11) -#define ASN_UNIVERSAL (0x00) -#define ASN_APPLICATION (0x40) -#define ASN_CONTEXT (0x80) -#define ASN_PRIVATE (0xC0) -#define ASN_PRIMITIVE (0x00) -#define ASN_CONSTRUCTOR (0x20) -#define ASN_LONG_LEN (0x80) -#define ASN_EXTENSION_ID (0x1F) -#define ASN_BIT8 (0x80) - -#define IS_CONSTRUCTOR(byte) ((byte) & ASN_CONSTRUCTOR) -#define IS_EXTENSION_ID(byte) (((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID) - -#define ASNERROR( string) -#define MAX_NAME_LEN 64 -#define SNMP_VERSION_1 0 -#define SNMP_VERSION_2C 1 - - -// defined types (from the SMI, RFC 1065) -#define SMI_IPADDRESS (ASN_APPLICATION | 0) -#define SMI_COUNTER (ASN_APPLICATION | 1) -#define SMI_GAUGE (ASN_APPLICATION | 2) -#define SMI_TIMETICKS (ASN_APPLICATION | 3) -#define SMI_OPAQUE (ASN_APPLICATION | 4) -#define SMI_NSAP (ASN_APPLICATION | 5) -#define SMI_COUNTER64 (ASN_APPLICATION | 6) -#define SMI_UINTEGER (ASN_APPLICATION | 7) - -#define GET_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) -#define GETNEXT_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) -#define GET_RSP_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) -#define SET_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3) -#define TRP_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4) - -#define GETBULK_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5) -#define INFORM_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6) -#define TRP2_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7) -#define REPORT_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8) - -#define SNMP_NOSUCHOBJECT (ASN_CONTEXT | ASN_PRIMITIVE | 0x0) -#define SNMP_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x1) -#define SNMP_ENDOFMIBVIEW (ASN_CONTEXT | ASN_PRIMITIVE | 0x2) - -#define SNMP_MSG_LENGTH 1500 - -typedef struct sockaddr_in ipaddr; - -// pdu -struct snmp_pdu { - int command; // pdu type - unsigned long reqid; // Request id - unsigned long errstat; // Error status - unsigned long errindex; // Error index - - // Trap information - oid *enterprise; // System OID - int enterprise_length; - ipaddr agent_addr; // address of object generating trap - int trap_type; // trap type - int specific_type; // specific type - unsigned long time; // Uptime - - // vb list - struct variable_list *variables; -}; - -// vb list -struct variable_list { - struct variable_list *next_variable; // 0 for last variable - oid *name; // Object identifier of variable - int name_length; // number of subid's in name - unsigned char type; // ASN type of variable - union { // value of variable - long *integer; - unsigned char *string; - oid *objid; - unsigned char *bitstring; - struct counter64 *counter64; - } val; - int val_len; -}; - -struct counter64 { - unsigned long high; - unsigned long low; -}; - -// CMU Interface class for ASN.1 routines -class ACE_Export asn1 - // = TITLE - // Defines the member functions for the asn1 concrete interface class - // CMU routines for performing ASN.1 data marshalling / representation - -{ -public: -static unsigned char *parse_int( unsigned char *data, - int *datalength, - unsigned char *type, - long int *intp, - int intsize); -static unsigned char *parse_unsigned_int( unsigned char *data, - int *datalength, - unsigned char *type, - unsigned long *intp, - int intsize); -static unsigned char *build_int( unsigned char *data, - int *datalength, - unsigned char type, - long *intp, - int intsize); - -static unsigned char *build_unsigned_int( unsigned char *data, - int *datalength, - unsigned char type, - unsigned long *intp, - int intsize); - -static unsigned char *parse_string( unsigned char *data, - int *datalength, - unsigned char *type, - unsigned char *string, - int *strlength); - -static unsigned char *build_string( unsigned char *data, - int *datalength, - unsigned char type, - unsigned char *string, - int strlength); - -static unsigned char *parse_header( unsigned char *data, - int *datalength, - unsigned char *type); - -static unsigned char * build_header( unsigned char *data, - int *datalength, - unsigned char type, - int length); - -static unsigned char * build_sequence( unsigned char *data, - int *datalength, - unsigned char type, - int length); - -static unsigned char * parse_length( unsigned char *data, - unsigned long *length); - -static unsigned char *build_length( unsigned char *data, - int *datalength, - int length); - -static unsigned char *build_objid( unsigned char *data, - int *datalength, - unsigned char type, - oid *objid, - int objidlength); - -static unsigned char *parse_objid( unsigned char *data, - int *datalength, - unsigned char *type, - oid *objid, - int *objidlength); - -static unsigned char *parse_null(unsigned char *data, - int *datalength, unsigned - char *type); - -static unsigned char *build_null( unsigned char *data, - int *datalength, - unsigned char type); - -static unsigned char *parse_bitstring( unsigned char *data, - int *datalength, - unsigned char *type, - unsigned char *string, - int *strlength); - -static unsigned char *build_bitstring( unsigned char *data, - int *datalength, - unsigned char type, - unsigned char *string, - int strlength); - -static unsigned char * parse_unsigned_int64(unsigned char *data, - int *datalength, - unsigned char *type, - struct counter64 *cp, - int countersize); - -static unsigned char * build_unsigned_int64( unsigned char *data, - int *datalength, - unsigned char type, - struct counter64 *cp, - int countersize); - -}; - - -// CMU Interface class for SNMPv1, SNMPv2c routines -class ACE_Export cmu_snmp - // = TITLE - // Defines the static functions for the cmu_snmp concrete class. - // These routine create cmu pdu's that can be sent/received on/from agents -{ - public: - static struct snmp_pdu *pdu_create( int command); - static void free_pdu( struct snmp_pdu *pdu); - static int build( struct snmp_pdu *pdu, - unsigned char *packet, - int *out_length, - long version, - unsigned char* community, - int community_len); - - static void add_var(struct snmp_pdu *pdu, - oid *name, - int name_length, - SmiVALUE *smival); - - static int parse( struct snmp_pdu *pdu, - unsigned char *data, - unsigned char *community_name, - unsigned long &community_len, - snmp_version &version, - int length); - static unsigned char *auth_build( unsigned char *data, - int *length, - long int version, - unsigned char *community, - int community_len, - int messagelen); - - static unsigned char *build_var_op(unsigned char *data, - oid * var_name, - int *var_name_len, - unsigned char var_val_type, - int var_val_len, - unsigned char *var_val, - int *listlength); - - -static unsigned char *auth_parse(unsigned char *data, - int *length, - unsigned char *sid, - int *slen, - long *version); - -/* - @params data, IN - pointer to the start of object - var_name OUT - object id of variable - var_name_len IN/OUT - length of variable name - var_val_type OUT - type of variable (int or octet string) (one byte) - var_val_len OUT - length of variable - var_val, OUT - pointer to ASN1 encoded value of variable - listlength IN/OUT - number of valid bytes left in var_op_list -*/ -static unsigned char *parse_var_op( unsigned char *data, - oid *var_name, - int *var_name_len, - unsigned char *var_val_type, - int *var_val_len, - unsigned char **var_val, - int *listlength); - -}; - -#endif // ASN1 - diff --git a/ASNMP/asnmp/counter.cpp b/ASNMP/asnmp/counter.cpp deleted file mode 100644 index 04c50dd6475..00000000000 --- a/ASNMP/asnmp/counter.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// counter.cpp -// -// = DESCRIPTION -// Class implementation for SMI Counter32 class. -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/counter.h" - -ACE_RCSID(asnmp, counter, "$Id$") - -// constructor with a value -Counter32::Counter32( const unsigned long i):SnmpUInt32(i) -{ - smival.syntax = sNMP_SYNTAX_CNTR32; -} - -// copy constructor -Counter32::Counter32( const Counter32 &c) -{ - this->smival.value.uNumber = c.smival.value.uNumber; - smival.syntax = sNMP_SYNTAX_CNTR32; - valid_flag = 1; -} - -// syntax type -SmiUINT32 Counter32::get_syntax() -{ - return sNMP_SYNTAX_CNTR32; -} - -// general assignment from any Value -SnmpSyntax& Counter32::operator=( SnmpSyntax &in_val){ - if ( this == &in_val ) // handle assignement from itself - return *this; - - valid_flag = 0; // will get set true if really valid - if (in_val.valid()) - { - switch (in_val.get_syntax()) - { - case sNMP_SYNTAX_UINT32: - // case sNMP_SYNTAX_GAUGE32: .. indistinquishable from UINT32 - case sNMP_SYNTAX_CNTR32: - case sNMP_SYNTAX_TIMETICKS: - case sNMP_SYNTAX_INT32: // implied cast int -> uint - this->smival.value.uNumber = - ((Counter32 &)in_val).smival.value.uNumber; - valid_flag = 1; - break; - } - } - return *this; -} - -// overloaded assignment -Counter32& Counter32::operator=( const unsigned long int i) -{ - this->smival.value.uNumber=i; - return *this; -} - -// overloaded assignment -Counter32& Counter32::operator=( const Counter32 &uli) -{ - this->smival.value.uNumber = uli.smival.value.uNumber; - return *this; -} - -// otherwise, behave like an unsigned long int -Counter32::operator unsigned long() -{ - return this->smival.value.uNumber; -} - -// clone -SnmpSyntax * Counter32::clone() const -{ - return ( SnmpSyntax *) new Counter32(*this); -} diff --git a/ASNMP/asnmp/counter.h b/ASNMP/asnmp/counter.h deleted file mode 100644 index 2b0f79807f3..00000000000 --- a/ASNMP/asnmp/counter.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef COUNTER_ -#define COUNTER_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// counter.h -// -// = DESCRIPTION -// Class definition for SMI Counter32 class. -// -// = AUTHOR -// Peter E Mellquist -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/smival.h" -#include "asnmp/integer.h" - -//------------[ Counter32 Class ]------------------------------------------ -// The counter class allows all the functionality of unsigned -// 32 bit integers but is recognized as a distinct SMI type. Counter32 -// class objects may be set or get into Vb objects. -// -// This class does not behave as defined by the abstract model -// in RFC 1155 section 3.2.3.3 - -class ACE_Export Counter32: public SnmpUInt32 - // = TITLE - // Defines the member functions for the Counter32 concrete class - // This class implements RFC 1155 Counter Object and is named - // Counter32 after the RFC1902 redefinition of V1 SMI datatypes -{ - public: - Counter32( const unsigned long i = 0); - // constructor with a value - - Counter32( const Counter32 &c); - // copy constructor - - SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax *clone() const; - // create a new instance of this Value - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - Counter32& operator=( const Counter32 &uli); - // overloaded assignment - - Counter32& operator=( const unsigned long i); - // overloaded assignment - - operator unsigned long(); - // otherwise, behave like an unsigned long int -}; - -#endif // COUNTER_ diff --git a/ASNMP/asnmp/ctr64.cpp b/ASNMP/asnmp/ctr64.cpp deleted file mode 100644 index 264c97a3ac2..00000000000 --- a/ASNMP/asnmp/ctr64.cpp +++ /dev/null @@ -1,211 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// ctr64.cpp -// -// = DESCRIPTION -// Implementation for Counter64 ( 64 bit counter class). -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/ctr64.h" - -ACE_RCSID(asnmp, ctr64, "$Id$") - -#define MAX32 4294967295u - -//-----------[ syntax type ]---------------------------------------------- -SmiUINT32 Counter64::get_syntax() -{ - return sNMP_SYNTAX_CNTR64; -} - -//------------------[ constructor with values ]-------------------------- -Counter64::Counter64( unsigned long hiparm, unsigned long loparm) -{ - smival.syntax = sNMP_SYNTAX_CNTR64; - smival.value.hNumber.hipart = hiparm; - smival.value.hNumber.lopart = loparm; -} - -//------------------[ constructor with low value only ]------------------ -Counter64::Counter64( unsigned long long llw ) -{ - smival.syntax = sNMP_SYNTAX_CNTR64; - smival.value.hNumber.hipart = (unsigned long) (llw >> 32); - smival.value.hNumber.lopart = (unsigned long) llw & 0xffffffff; -} - -//------------------[ copy constructor ]--------------------------------- -Counter64::Counter64( const Counter64 &ctr64 ) -{ - smival.syntax = sNMP_SYNTAX_CNTR64; - smival.value.hNumber.hipart = ctr64.high(); - smival.value.hNumber.lopart = ctr64.low(); -} - -//------------------[ destructor ]--------------------------------- -Counter64::~Counter64() -{ -} - - -//------------------[ Counter64::high() ]------------------------------ -// return the high part -unsigned long Counter64::high() const -{ - return smival.value.hNumber.hipart; -} - - -//------------------[ Counter64::low() ]------------------------------- -// return the low part -unsigned long Counter64::low() const -{ - return smival.value.hNumber.lopart; -} - -//------------------[ set_high( const unsigned long h) ]----------- -// set the high part -void Counter64::set_high( const unsigned long h) -{ - smival.value.hNumber.hipart = h; -} - -//------------------[ set_low( const unsigned long l) ]------------ -// set the low part -void Counter64::set_low( const unsigned long l) -{ - smival.value.hNumber.lopart = l; -} - - -//-----------[ to_long_double( Counter64 c64) ]----------------------------- -// convert a Counter 64 to a long double -long double Counter64::to_long_double() const -{ - long double ld = this->high(); - ld *= MAX32; - ld += this->low(); - return ld; -} - - -//-----------[ ld_to_c64( long double ld) ]---------------------------- -// convert a long double to a Counter64 -// semantics changed from prior version -Counter64& Counter64::assign( long double ld) -{ - smival.syntax = sNMP_SYNTAX_CNTR64; - unsigned long h = smival.value.hNumber.hipart = (unsigned long)(ld / MAX32); - smival.value.hNumber.lopart = (unsigned long)(ld - h); - return *this; -} - -//----------------[ general Value = operator ]--------------------- -SnmpSyntax& Counter64::operator=( SnmpSyntax &val) -{ - // protect against assignment from itself - if ( this == &val ) - return *this; - - smival.value.hNumber.lopart = 0; // pessimsitic - assume no mapping - smival.value.hNumber.hipart = 0; - - // try to make assignment valid - if (val.valid()){ - switch (val.get_syntax()){ - case sNMP_SYNTAX_CNTR64: - smival.value.hNumber.hipart = - ((Counter64 &)val).smival.value.hNumber.hipart; - smival.value.hNumber.lopart = - ((Counter64 &)val).smival.value.hNumber.lopart; - break; - - case sNMP_SYNTAX_CNTR32: - case sNMP_SYNTAX_TIMETICKS: - case sNMP_SYNTAX_GAUGE32: - // case sNMP_SYNTAX_UINT32: .. indistinguishable from GAUGE32 - case sNMP_SYNTAX_INT32: - // take advantage of union... - smival.value.hNumber.lopart = ((Counter64 &)val).smival.value.uNumber; - smival.value.hNumber.hipart = 0; - break; - } - } - return *this; -} - -// overloaded assignment -Counter64& Counter64::operator=( const unsigned long long rhs) -{ - smival.value.hNumber.hipart = (unsigned long) (rhs >> 32); - smival.value.hNumber.lopart = (unsigned long) rhs; - return *this; -} - -// overloaded assignment -Counter64& Counter64::operator=( const Counter64 &rhs) -{ - smival.value.hNumber.hipart = rhs.high(); - smival.value.hNumber.lopart = rhs.low(); - return *this; -} - -// otherwise, behave like an unsigned long int -Counter64::operator unsigned long long() -{ - unsigned long long val = smival.value.hNumber.hipart; - val = val << 32; // shift right 4 bytes - val |= smival.value.hNumber.lopart; - return val; -} - -//----------------[ Counter64::clone() ]----------------------------------- -// create a new instance of this Value -SnmpSyntax* Counter64::clone() const -{ - return ( SnmpSyntax *) new Counter64(*this); -} - -//----------------[ Counter64::valid() ]------------------------------------- -int Counter64::valid() const -{ - return 1; -} - -//----------[ return ASCII format ]------------------------- -// TODO: Fix up to do real 64bit decimal value printing... -// For now, print > 32-bit values in hex -char * Counter64::to_string() -{ - if ( high() != 0 ) - sprintf(output_buffer, "0x%X%08X", - (unsigned int)high(), (unsigned int)low()); - else - sprintf(output_buffer, "%d", (int) low()); - return output_buffer; -} diff --git a/ASNMP/asnmp/ctr64.h b/ASNMP/asnmp/ctr64.h deleted file mode 100644 index f9dc641a94a..00000000000 --- a/ASNMP/asnmp/ctr64.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef CTR64_ -#define CTR64_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// ctr64.h -// -// = DESCRIPTION -// SNMP Counter64 class definition. -// -// = AUTHOR -// Peter E Mellquist -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/smival.h" - -#define CTR64OUTBUF 30 // maximum ascii string for a 64-bit ctr - - -//---------[ 64 bit Counter Class ]-------------------------------- -// Counter64 Class encapsulates two unsigned integers into a -// a single entity. This type has is available in SNMPv2 but -// may be used anywhere where needed. -// -class ACE_Export Counter64: public SnmpSyntax - // = TITLE - // Defines the member functions for the Counter64 concrete class - // This class implements RFC 1902 64 bit Counter Object. -{ -public: - Counter64( unsigned long long llw = 0); - // default constructor - - Counter64( unsigned long hiparm, unsigned long loparm); - // constructor with values - - Counter64( const Counter64 &ctr64); - // copy constructor - - ~Counter64(); - // destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden) - - SmiUINT32 get_syntax(); - // syntax type - - long double to_long_double() const; - // return a long double representation - - Counter64& assign( long double ld); - // assign a long double to a counter64 - - unsigned long high() const; - // return the high part - - unsigned long low() const; - // return the low part - - void set_high( const unsigned long h); - // set the high part - - void set_low( const unsigned long l); - // set the low part - - Counter64& operator=( const unsigned long long rhs); - // overloaded assignment - - Counter64& operator=( const Counter64 &rhs); - // overloaded assignment - - char *to_string(); - // get a printable ASCII representation - - SnmpSyntax *clone() const; - // create a new instance of this Value - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - int valid() const; - // general validity test, always true - - operator unsigned long long(); - // otherwise, behave like an unsigned long long - -protected: - char output_buffer[CTR64OUTBUF]; -}; - -#endif // CTR64_ diff --git a/ASNMP/asnmp/enttraps.h b/ASNMP/asnmp/enttraps.h deleted file mode 100644 index d90a593a4e4..00000000000 --- a/ASNMP/asnmp/enttraps.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef ENTTRAPS_ -#define ENTTRAPS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// enttraps.cpp -// -// = DESCRIPTION -// constants for Enterprise Traps -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/asn1.h" // ASN.1 header file - -//--------------[ well known trap ids ]----------------------------------- -class ACE_Export snmpTrapsOid: public Oid - // = TITLE - // Defines the member functions for the snmpTrapsOid base class - // to implement the traps defined in RFC 1215 -{ - public: - snmpTrapsOid (void):Oid("1.3.6.1.6.3.1.1.5"){} -}; - -class ACE_Export snmpTrapEnterpriseOid: public Oid - // = TITLE - // Defines the default Enterprise Oid for this software package -{ - public: - snmpTrapEnterpriseOid(void): Oid("1.3.6.1.6.3.1.1.4.3.0") { } -}; - -class ACE_Export coldStartOid: public snmpTrapsOid - // = TITLE - // Defines the RFC 1215 agent cold start generic trap (system reboot) -{ - public: - coldStartOid( void){*this+=".1";} -}; - -class ACE_Export warmStartOid: public snmpTrapsOid - // = TITLE - // Defines the RFC 1215 agent warm start generic trap (agent reboot) -{ - public: - warmStartOid( void){*this+=".2";} -}; - -class ACE_Export linkDownOid: public snmpTrapsOid - // = TITLE - // Defines the RFC 1215 interface (link) down trap -{ - public: - linkDownOid( void){*this+=".3";} -}; - - -// SMI LinkUp Oid -class ACE_Export linkUpOid: public snmpTrapsOid - // = TITLE - // Defines the RFC 1215 interface (link) up trap -{ - public: - linkUpOid( void){*this+=".4";} -}; - -class ACE_Export authenticationFailureOid: public snmpTrapsOid - // = TITLE - // Defines the RFC 1215 device/agent invalid access trap -{ - public: - authenticationFailureOid( void){*this+=".5";} -}; - -class ACE_Export egpNeighborLossOid: public snmpTrapsOid - // = TITLE - // Defines the RFC 1215 Exterior Gateway Protocol neighbor loss trap -{ - public: - egpNeighborLossOid( void){*this+=".6";} -}; - -#ifdef DEFINE_TRAP_CONSTANTS_ - -const coldStartOid coldStart; -const warmStartOid warmStart; -const linkDownOid linkDown; -const linkUpOid linkUp; -const authenticationFailureOid authenticationFailure; -const egpNeighborLossOid egpNeighborLoss; -const snmpTrapEnterpriseOid snmpTrapEnterprise; - -#endif - -#endif // ENTTRAPS_ diff --git a/ASNMP/asnmp/gauge.cpp b/ASNMP/asnmp/gauge.cpp deleted file mode 100644 index aac715f2730..00000000000 --- a/ASNMP/asnmp/gauge.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// gauge.cpp -// -// = DESCRIPTION -// Class implemtation for SMI Gauge32 class. -// NOTES: This does not behave exactly as a Gauge described in RFC 1155 -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/gauge.h" // header file for gauge class - -ACE_RCSID(asnmp, gauge, "$Id$") - -// constructor with a value -Gauge32::Gauge32( const unsigned long i):SnmpUInt32(i) -{ - smival.syntax = sNMP_SYNTAX_GAUGE32; -} - -// copy constructor -Gauge32::Gauge32 ( const Gauge32 &g) -{ this->smival.value.uNumber = g.smival.value.uNumber; - smival.syntax = sNMP_SYNTAX_GAUGE32; - valid_flag = 1; -} - -// destructor -Gauge32::~Gauge32() -{ -} - -// syntax type -SmiUINT32 Gauge32::get_syntax() -{ - return sNMP_SYNTAX_GAUGE32; -} - -// overloaded assignment -Gauge32& Gauge32::operator=( const Gauge32 &uli) -{ - this->smival.value.uNumber = uli.smival.value.uNumber; - return *this; -} - -// overloaded assignment -Gauge32& Gauge32::operator=( const unsigned long int i) -{ - smival.value.uNumber=i; return *this; -} - -// general assignment from any Value -// TODO: this is broken if not inherited from UInt32 (see UInt32 code). -SnmpSyntax& Gauge32::operator=( SnmpSyntax &in_val) -{ - - if ( this == &in_val ) // handle assignement from itself - return *this; - - valid_flag = 0; // will get set true if really valid - if (in_val.valid()) - { - switch (in_val.get_syntax()) - { - case sNMP_SYNTAX_UINT32: - case sNMP_SYNTAX_GAUGE32: - case sNMP_SYNTAX_CNTR32: - case sNMP_SYNTAX_TIMETICKS: - case sNMP_SYNTAX_INT32: // implied cast int -> uint - this->smival.value.uNumber = - ((Gauge32 &)in_val).smival.value.uNumber; - valid_flag = 1; - break; - } - } - return *this; -} - -// otherwise, act as unsigned long -Gauge32::operator unsigned long() -{ - return smival.value.uNumber; -} - -// clone - create a new instance of this Value -SnmpSyntax* Gauge32::clone() const -{ - return ( SnmpSyntax *) new Gauge32(*this); -} diff --git a/ASNMP/asnmp/gauge.h b/ASNMP/asnmp/gauge.h deleted file mode 100644 index 765a713736c..00000000000 --- a/ASNMP/asnmp/gauge.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef GAUGE_ -#define GAUGE_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// gauge32.cpp -// -// = DESCRIPTION -// Class definition for SMI Gauge32 class. -// This class currently does not behave as defined by the abstract model -// in RFC 1155 section 3.2.3.4 (ie the value doesn't latch on the max value) -// -// = AUTHOR -// Peter E Mellquist -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/integer.h" - -//------------[ Gauge32 Class ]------------------------------------------ -// The gauge class allows all the functionality of unsigned -// integers but is recognized as a distinct SMI type. Gauge32 -// objects may be set or get into Vb objects. -// - -class ACE_Export Gauge32: public SnmpUInt32 - // = TITLE - // Define RFC1902 Gauge datatype from RFC 1155 section 3.2.3.4 - // Note that this datatype does not behave exactly (acts like a long) -{ - public: - Gauge32( const unsigned long i = 0); - // constructor with a value - - Gauge32 ( const Gauge32 &g); - // copy constructor - - ~Gauge32(); - // destructor for a Gauge32 (ensure that Value::~Value() is overridden) - - SmiUINT32 get_syntax(); - // syntax type - - SnmpSyntax *clone() const; - // create a new instance of this Value - - Gauge32& operator=( const Gauge32 &uli); - // overloaded assignment - - Gauge32& operator=( const unsigned long i); - // overloaded assignment - - operator unsigned long(); - // otherwise, behave like an unsigned int - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value -}; -#endif //GAUGE_ - diff --git a/ASNMP/asnmp/integer.cpp b/ASNMP/asnmp/integer.cpp deleted file mode 100644 index e0da5b6dfab..00000000000 --- a/ASNMP/asnmp/integer.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// integer.cpp -// -// = DESCRIPTION -// Class implemtation for SMI Integer classes. -// -// = AUTHOR -// Jeff Meyer -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/integer.h" // header file for gauge class - -ACE_RCSID(asnmp, integer, "$Id$") - -// constructor with value -SnmpUInt32::SnmpUInt32 (const u_long i) -{ - smival.value.uNumber=i; - smival.syntax = sNMP_SYNTAX_UINT32; - valid_flag = 1; -} - -// copy constructor -SnmpUInt32::SnmpUInt32( const SnmpUInt32 &c) -{ - smival.value.uNumber=c.smival.value.uNumber; - smival.syntax = sNMP_SYNTAX_UINT32; - valid_flag = 1; -} - -// destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden) -SnmpUInt32::~SnmpUInt32() -{ -} - -// syntax type -SmiUINT32 SnmpUInt32::get_syntax() -{ - return sNMP_SYNTAX_UINT32; -} - -// object validity -int SnmpUInt32::valid( void) const -{ - return valid_flag; -} - -// overloaded assignment -SnmpUInt32& SnmpUInt32::operator=( const unsigned long int i) -{ - smival.value.uNumber=i; - valid_flag = 1; - return *this; -} - -// general assignment from any Value -SnmpSyntax& SnmpUInt32::operator=( SnmpSyntax &in_val) -{ - if ( this == &in_val ) // handle assignement from itself - return *this; - - valid_flag = 0; // will get set true if really valid - if (in_val.valid()) - { - switch (in_val.get_syntax()) - { - case sNMP_SYNTAX_UINT32: - // case sNMP_SYNTAX_GAUGE32: .. indistinquishable from UINT32 - case sNMP_SYNTAX_CNTR32: - case sNMP_SYNTAX_TIMETICKS: - case sNMP_SYNTAX_INT32: // implied cast int -> uint - this->smival.value.uNumber = - ((SnmpUInt32 &)in_val).smival.value.uNumber; - valid_flag = 1; - break; - } - } - return *this; -} - -// overloaded assignment -SnmpUInt32& SnmpUInt32::operator=( const SnmpUInt32 &uli) -{ - this->smival.value.uNumber = uli.smival.value.uNumber; return *this; -} - -// otherwise, behave like an unsigned long int -SnmpUInt32::operator unsigned long() -{ - return smival.value.uNumber; -} - -// create a new instance of this Value -SnmpSyntax* SnmpUInt32::clone() const -{ - return (SnmpSyntax *) new SnmpUInt32(*this); -} - -// ASCII format return -char * SnmpUInt32::to_string() -{ - sprintf(output_buffer, "%d", (int) (this->smival.value.uNumber)); - return output_buffer; -} - - -//==================================================================== -// INT 32 Implementation -//==================================================================== - -// default constructor -SnmpInt32::SnmpInt32 (const long i) -{ - smival.value.sNumber=i; - smival.syntax = sNMP_SYNTAX_INT32; - valid_flag = 1; -} - -// constructor with value -SnmpInt32::SnmpInt32 (const SnmpInt32 &c) -{ - smival.value.sNumber=c.smival.value.sNumber; - smival.syntax = sNMP_SYNTAX_INT32; - valid_flag = 1; -} - -// destructor -SnmpInt32::~SnmpInt32() -{ -} - -// syntax type -SmiUINT32 SnmpInt32::get_syntax() -{ - return sNMP_SYNTAX_INT32; -} - -// object validity -int SnmpInt32::valid( void) const -{ - return valid_flag; -} - -// overloaded assignment -SnmpInt32& SnmpInt32::operator=( const long i) -{ - this->smival.value.sNumber = (unsigned long) i; - valid_flag = 1; - return *this; -} - -// overloaded assignment -SnmpInt32& SnmpInt32::operator=( const SnmpInt32 &uli) -{ - this->smival.value.sNumber = uli.smival.value.sNumber; - valid_flag = 1; - return *this; -} - -// general assignment from any Value -SnmpSyntax& SnmpInt32::operator=( SnmpSyntax &in_val) -{ - if ( this == &in_val ) // handle assignement from itself - return *this; - - valid_flag = 0; // will get set true if really valid - if (in_val.valid()) - { - switch (in_val.get_syntax()) - { - case sNMP_SYNTAX_INT32: - case sNMP_SYNTAX_UINT32: // implied cast uint -> int - // case sNMP_SYNTAX_GAUGE32: .. indistinquishable from UINT32 - case sNMP_SYNTAX_CNTR32: // implied cast uint -> int - case sNMP_SYNTAX_TIMETICKS: // implied cast uint -> int - this->smival.value.sNumber = - ((SnmpInt32 &)in_val).smival.value.sNumber; - valid_flag = 1; - break; - } - } - return *this; -} - -// otherwise, behave like a long int -SnmpInt32::operator long() -{ - return (long) smival.value.sNumber; -} - -// clone - create a new instance of this Value -SnmpSyntax* SnmpInt32::clone() const -{ - return ( SnmpSyntax *) new SnmpInt32(*this); -} - -// ASCII format return - -char *SnmpInt32::to_string() -{ - sprintf(output_buffer, "%d", (int) (long) this->smival.value.sNumber); - return output_buffer; -} diff --git a/ASNMP/asnmp/integer.h b/ASNMP/asnmp/integer.h deleted file mode 100644 index d0dc2972742..00000000000 --- a/ASNMP/asnmp/integer.h +++ /dev/null @@ -1,140 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef SNMPINTEGER_ -#define SNMPINTEGER_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// integer.cpp -// -// = DESCRIPTION -// Class definition for Integer classes convertable to SMI. -// -// = AUTHOR -// Jeff Meyer -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/smival.h" - -// TODO get rid of this constant -#define INTOUTBUF 15 // largest ASCII formatted integer - -//------------[ Integer Classes ]------------------------------------------ -// The integer class allows all the functionality of the various -// integers but is contained in a Value object for consistency -// among the various types. -// class objects may be set or get into Vb objects. -// - -// 32 bit unsigned integer class -class ACE_Export SnmpUInt32: public SnmpSyntax - // = TITLE - // Implement RFC 1920 Unsigned Integer SMI datatype -{ - - public: - SnmpUInt32 (const unsigned long i = 0); - // default constructor - - SnmpUInt32( const SnmpUInt32 &c); - // copy constructor - - virtual ~SnmpUInt32(); - // destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden) - - virtual SmiUINT32 get_syntax(); - // syntax type - - SnmpUInt32& operator=( const unsigned long i); - // overloaded assignment - - SnmpUInt32& operator=( const SnmpUInt32 &uli); - // overloaded assignment - - operator unsigned long(); - // otherwise, behave like an unsigned long int - - virtual char *to_string(); - // get a printable ASCII value - - virtual SnmpSyntax *clone() const; - // create a new instance of this Value - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - int valid() const; - // did object construct properly - - protected: - int valid_flag; - char output_buffer[INTOUTBUF]; - // contain string representation of object -}; - - -// 32 bit signed integer class -class ACE_Export SnmpInt32: public SnmpSyntax -{ - // = TITLE - // Implement RFC 1902 32 bit Integer SMI data object - public: - SnmpInt32 (const long i = 0); - // constructor with value - - SnmpInt32 (const SnmpInt32 &c); - // constructor with value - - virtual ~SnmpInt32(); - // destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden) - - virtual SmiUINT32 get_syntax(); - // syntax type - - SnmpInt32& operator=( const long i); - // overloaded assignment - - SnmpInt32& operator=( const SnmpInt32 &li); - // overloaded assignment - - operator long(); - // otherwise, behave like a long int - - SnmpSyntax *clone() const; - // create a new instance of this Value - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - - char *to_string(); - // get a printable ASCII value - - int valid() const; - // logical state of object - - protected: - int valid_flag; - char output_buffer[INTOUTBUF]; - // contain string representation of object -}; - -#endif diff --git a/ASNMP/asnmp/octet.cpp b/ASNMP/asnmp/octet.cpp deleted file mode 100644 index 2a422a5fe88..00000000000 --- a/ASNMP/asnmp/octet.cpp +++ /dev/null @@ -1,594 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// octet.cpp -// -// = DESCRIPTION -// Implements the SMI Octet datatype (RFC 1155) -// This class is fully contained and does not rely on or any other -// SNMP libraries. Ported to ACE by Michael MacFaden mrm@cisco.com -// -// = AUTHOR -// Peter E Mellquist -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "ace/OS.h" -#include "asnmp/octet.h" // include definition for octet class - -ACE_RCSID(asnmp, octet, "$Id$") - -//============[ syntax type ]========================================= -SmiUINT32 OctetStr::get_syntax() -{ - return sNMP_SYNTAX_OCTETS; -} - -inline -void init_octet_smi(SmiVALUE& smi) -{ - smi.syntax = sNMP_SYNTAX_OCTETS; - smi.value.string.ptr = 0; - smi.value.string.len = 0; -} - -inline -void reset_octet_smi(SmiVALUE& smi) -{ - delete [] smi.value.string.ptr; - smi.value.string.ptr = 0; - smi.value.string.len = 0; -} - -inline -int copy_octet_smi(SmiVALUE& smi, int size, const char *src, int& valid_flag) -{ - valid_flag = 0; - - if (smi.value.string.ptr) - delete [] smi.value.string.ptr; - - ACE_NEW_RETURN(smi.value.string.ptr, SmiBYTE[size], 1); - ACE_OS::memcpy( smi.value.string.ptr, src, size); - smi.value.string.len = size; - valid_flag = 1; - return 0; -} - -//============[ default constructor ]========================= -OctetStr::OctetStr( const char * string, long size): - output_buffer(0), validity(0) -{ - - size_t z; - init_octet_smi(smival); - - // check for null string - if ( !string) - return; - - if (size == -1) // calc if no length given - assume c style string - size = z = ACE_OS::strlen( string); - - copy_octet_smi(smival, size, string, validity); -} - - -//============[ set the data on an already constructed Octet ]============ -// TODO: should return status since it can fail in so many places -void OctetStr::set_data( const SmiBYTE* string, long size) -{ - size_t z; - - // invalid args, set octetStr to not valid - if ( !string || !size) { - validity = 0; - return; - } - - // assume non-zero terminated string - if (size == -1) // calc if no length given - assume c style string - size = z = ACE_OS::strlen( (char *)string); - - // free up already used space - if ( smival.value.string.ptr ) { - reset_octet_smi(smival); - } - smival.value.string.len = 0; - - - copy_octet_smi(smival, size, (const char *)string, validity); -} - -//============[ constructor using another octet object ]============== -OctetStr::OctetStr ( const OctetStr &octet): - output_buffer(0), validity(1) -{ - init_octet_smi(smival); - // check for zero len case - if ( octet.smival.value.string.len == 0) { - return; - } - - // must be a valid object - if ( octet.validity == 0) { - validity = 0; - return; - } - - // get the mem needed - copy_octet_smi(smival, octet.smival.value.string.len, - (const char *)octet.smival.value.string.ptr, validity); -} - -//=============[ destructor ]========================================= -OctetStr::~OctetStr() -{ - reset_octet_smi(smival); - delete [] output_buffer; -} - - -//=============[ assignment to a string operator overloaded ]========= -OctetStr& OctetStr::operator=( const char *string) -{ - // get the string size - size_t nz; - - // free up previous memory if needed - if ( smival.value.string.ptr ) { - reset_octet_smi(smival); - } - - // if empty then we are done - if (!string || !(nz = ACE_OS::strlen( string))) { - validity = 1; - return *this; - } - - // get memory needed - copy_octet_smi(smival, nz, string, validity); - return *this; -} - -//=============[ assignment to another oid object overloaded ]======== -OctetStr& OctetStr::operator=( const OctetStr &octet) -{ - // protect against assignment from self - if ( this == &octet ) - return *this; - - // don't assign from invalid objs - if (!octet.validity) { - return *this; - } - - // free up previous memory if needed - if ( smival.value.string.len ) { - reset_octet_smi(smival); - } - - if (!octet.smival.value.string.len) { - validity = 1; - return *this; - } - - // get some memory - copy_octet_smi(smival, octet.smival.value.string.len, - (const char*) octet.smival.value.string.ptr, validity); - return *this; // return self reference -} - -//==============[ equivlence operator overloaded ]==================== -int operator==( const OctetStr &lhs, const OctetStr &rhs) -{ - if( lhs.left_comparison( rhs.smival.value.string.len, rhs)==0) - return 1; - else - return 0; -} - -//==============[ not equivlence operator overloaded ]================ -int operator!=( const OctetStr &lhs, const OctetStr &rhs) -{ - if( lhs.left_comparison( rhs.smival.value.string.len, rhs)!=0) - return 1; - else - return 0; -} - -//==============[ less than < overloaded ]============================ -int operator<( const OctetStr &lhs, const OctetStr &rhs) -{ - if( lhs.left_comparison( rhs.smival.value.string.len, rhs)<0) - return 1; - else - return 0; -} - -//==============[ less than <= overloaded ]=========================== -int operator<=( const OctetStr &lhs, const OctetStr &rhs) -{ - if(( lhs.left_comparison( rhs.smival.value.string.len, rhs)<0) || - ( lhs.left_comparison( rhs.smival.value.string.len, rhs)==0)) - return 1; - else - return 0; -} - -//===============[ greater than > overloaded ]======================== -int operator>( const OctetStr &lhs, const OctetStr &rhs) -{ - if( lhs.left_comparison( rhs.smival.value.string.len, rhs)>0) - return 1; - else - return 0; -} - -//===============[ greater than >= overloaded ]======================= -int operator>=( const OctetStr &lhs, const OctetStr &rhs) -{ - if(( lhs.left_comparison( rhs.smival.value.string.len, rhs)>0) || - ( lhs.left_comparison( rhs.smival.value.string.len, rhs)==0)) - return 1; - else - return 0; -} - -//===============[ equivlence operator overloaded ]=================== -int operator==( const OctetStr &lhs,const char *rhs) -{ - OctetStr to( rhs); - if( lhs.left_comparison( to.smival.value.string.len,to)==0) - return 1; - else - return 0; -} - -//===============[ not equivlence operator overloaded ]=============== -int operator!=( const OctetStr &lhs,const char *rhs) -{ - OctetStr to( rhs); - if ( lhs.left_comparison( to.smival.value.string.len,to)!=0) - return 1; - else - return 0; -} - -//===============[ less than < operator overloaded ]================== -int operator<( const OctetStr &lhs,const char *rhs) -{ - OctetStr to( rhs); - if ( lhs.left_comparison( to.smival.value.string.len,to)<0) - return 1; - else - return 0; -} - -//===============[ less than <= operator overloaded ]================= -int operator<=( const OctetStr &lhs,char *rhs) -{ - OctetStr to( rhs); - if (( lhs.left_comparison( to.smival.value.string.len,to)<0) || - ( lhs.left_comparison( to.smival.value.string.len,to)==0)) - return 1; - else - return 0; -} - -//===============[ greater than > operator overloaded ]=============== -int operator>( const OctetStr &lhs,const char *rhs) -{ - OctetStr to( rhs); - if ( lhs.left_comparison( to.smival.value.string.len,to)>0) - return 1; - else - return 0; -} - -//===============[ greater than >= operator overloaded ]============== -int operator>=( const OctetStr &lhs,const char *rhs) -{ - OctetStr to( rhs); - if (( lhs.left_comparison( to.smival.value.string.len,to)>0) || - ( lhs.left_comparison( to.smival.value.string.len,to)==0)) - return 1; - else - return 0; -} - -//===============[ append operator, appends a string ]================ -OctetStr& OctetStr::operator+=( const char *a) -{ - SmiBYTE *tmp; // temp pointer - size_t slen,nlen; - - // get len of string - if ( !a || ((slen = ACE_OS::strlen( a)) == 0)) - return *this; - - // total len of octet - nlen = slen + (size_t) smival.value.string.len; - ACE_NEW_RETURN(tmp, SmiBYTE [ nlen], *this); - ACE_OS::memcpy ( tmp, smival.value.string.ptr, - (size_t) smival.value.string.len); - ACE_OS::memcpy( tmp + smival.value.string.len, a, (size_t) slen); - // delete the original - if ( smival.value.string.ptr ) - reset_octet_smi(smival); - smival.value.string.ptr = tmp; - smival.value.string.len = nlen; - return *this; -} - -//================[ append one OctetStr to another ]================== -OctetStr& OctetStr::operator+=( const OctetStr& octetstr) -{ - SmiBYTE *tmp; // temp pointer - size_t slen,nlen; - - if (!octetstr.validity || - !(slen = (size_t)octetstr.length())) - return *this; - - // total len of octet - nlen = slen + (size_t) smival.value.string.len; - // get mem needed - ACE_NEW_RETURN(tmp, SmiBYTE[ nlen], *this); - ACE_OS::memcpy ( tmp, smival.value.string.ptr, - (size_t) smival.value.string.len); - ACE_OS::memcpy( tmp + smival.value.string.len, octetstr.data(), - (size_t) slen); - if ( smival.value.string.ptr ) - reset_octet_smi(smival); - smival.value.string.ptr = tmp; - smival.value.string.len = nlen; - return *this; -} - -//================[ appends an int ]================================== -OctetStr& OctetStr::operator+=( const char c) -{ - SmiBYTE *tmp; - // get the memory needed plus one extra byte - ACE_NEW_RETURN(tmp, SmiBYTE[ smival.value.string.len + 1], *this); - ACE_OS::memcpy ( tmp, smival.value.string.ptr, - (size_t) smival.value.string.len); // len of original - tmp[ smival.value.string.len ] = c; // assign in byte - if ( smival.value.string.ptr ) // delete the original - reset_octet_smi(smival); - - smival.value.string.ptr = tmp; // point to one - smival.value.string.len++; // up the len - return *this; -} - - -//================[ compare n elements of an Octet ]================== -int OctetStr::left_comparison( const long n, const OctetStr &o) const -{ - long z, w; - - // both are empty, they are equal - if (( smival.value.string.len == 0) && - ( o.smival.value.string.len == 0)) - return 0; // equal - - // self is empty and param has something - if (( smival.value.string.len == 0) && - ( o.smival.value.string.len >0) && - (n>0)) - return -1; - - // self has something and param has nothing - if (( smival.value.string.len > 0) && - ( o.smival.value.string.len ==0) && - (n>0)) - return 1; - - // special case - if (( smival.value.string.len == 0) && - ( o.smival.value.string.len > 0) && - ( n == 0)) - return 0; - - // pick the Min of n, this and the param len - // this is the maximum # to iterate a search - w = smival.value.string.len < o.smival.value.string.len - ? smival.value.string.len : o.smival.value.string.len; - if (n o.smival.value.string.ptr[z]) - return 1; // greater than - z++; - } - - if (( z == 0) && - ( smival.value.string.len == 0) && - ( o.smival.value.string.len > 0)) - return -1; - - if (( z == 0) && - ( o.smival.value.string.len == 0) && - ( smival.value.string.len > 0)) - return 1; - - return 0; -} - -//================[ return the length of the oid ]======================= -size_t OctetStr::length() const -{ - return (size_t) smival.value.string.len; -} - -//================[ operator[]: access as if array ]================== -SmiBYTE& OctetStr::operator[]( int position) -{ - return smival.value.string.ptr[position]; -} - -//===============[ reuturns pointer to internal data ]=============== -SmiBYTE * OctetStr::data() const -{ - return smival.value.string.ptr; -} - -//================[ returns validity ]================================ -int OctetStr::valid() const -{ - return validity; -} - -//================[ clone() ]========================================= -SnmpSyntax * OctetStr::clone() const -{ - OctetStr *tmp = new OctetStr(*this); - return ( SnmpSyntax *) tmp; -} - -//================[ ASCII format return ]============================= -char * OctetStr::to_string() -{ - for ( unsigned long i=0; i < smival.value.string.len; i++) { - if (( smival.value.string.ptr[i] != '\r')&& - ( smival.value.string.ptr[i] != '\n')&& - (isprint((int) (smival.value.string.ptr[i]))==0)) - return(to_string_hex()); - } - - if ( output_buffer != 0) - delete [] output_buffer; - - ACE_NEW_RETURN(output_buffer, char[smival.value.string.len + 1], ""); - if (smival.value.string.len) - ACE_OS::memcpy(output_buffer, smival.value.string.ptr, - (int) smival.value.string.len); - output_buffer[smival.value.string.len] = '\0'; - return output_buffer; -} - - -//================[ general Value = operator ]======================== -SnmpSyntax& OctetStr::operator=( SnmpSyntax &val) -{ - // protect against assignment from self - if ( this == &val ) - return *this; - - // blow away the old value - validity=0; - if (smival.value.string.ptr) { - reset_octet_smi(smival); - } - smival.value.string.len = 0; - if (val.valid()){ - switch (val.get_syntax()) { - case sNMP_SYNTAX_OCTETS: - case sNMP_SYNTAX_IPADDR: - set_data( ((OctetStr &)val).smival.value.string.ptr, - ((OctetStr &)val).smival.value.string.len); - break; - } - } - return *this; -} - -//================[ format the output into hex ]======================== -char *OctetStr::to_string_hex() -{ - int cnt; - char char_buf[80]; // holds ASCII representation of data - char *buf_ptr; // pointer into ASCII listing - char *line_ptr; // pointer into Hex listing - int storageNeeded; // how much space do we need ? - int local_len = (int) smival.value.string.len; - SmiBYTE *bytes = smival.value.string.ptr; - - - storageNeeded = (int) ((smival.value.string.len/16)+1) * 72 + 1; - - if ( output_buffer != 0) - delete [] output_buffer; - - ACE_NEW_RETURN(output_buffer, char[storageNeeded], ""); - - line_ptr = output_buffer; - - /*----------------------------------------*/ - /* processing loop for entire data buffer */ - /*----------------------------------------*/ - while (local_len > 0) { - cnt = 16; /* print 16 bytes per line */ - buf_ptr = char_buf; - sprintf(line_ptr, " "); - line_ptr += 2; /* indent */ - - /*-----------------------*/ - /* process a single line */ - /*-----------------------*/ - while (cnt-- > 0 && local_len-- > 0) { - sprintf(line_ptr, "%2.2X ", *bytes); - - line_ptr +=3; /* the display of a byte always 3 chars long */ - if (isprint(*bytes)) - sprintf(buf_ptr, "%c", *bytes); - else - sprintf(buf_ptr, "."); - bytes++; - buf_ptr++; - } - cnt++; - - /*----------------------------------------------------------*/ - /* this is to make sure that the ASCII displays line up for */ - /* incomplete lines of hex */ - /*----------------------------------------------------------*/ - while (cnt-- > 0) { - sprintf(line_ptr," "); - line_ptr += 3; - } - - /*------------------------------------------*/ - /* append the ASCII display to the Hex line */ - /*------------------------------------------*/ - -// TODO: verify ACE_OS:: on NT works like this or not -#if defined(__unix) - char *fmt = " %s\n"; -#endif // __unix - -#if defined(_WIN32) - char *fmt = " %s\r\n"; -#endif // _WIN32 - - ACE_OS::sprintf(line_ptr, fmt, char_buf); - line_ptr += 3 + strlen(char_buf); - } - - return output_buffer; -} diff --git a/ASNMP/asnmp/octet.h b/ASNMP/asnmp/octet.h deleted file mode 100644 index 28b3d9fda21..00000000000 --- a/ASNMP/asnmp/octet.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef OCTET_CLS_ -#define OCTET_CLS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// octet.h -// -// = DESCRIPTION -// This class is fully contained and does not rely on or any other -// SNMP libraries. This class is portable across any platform -// which supports C++. -// -// = AUTHOR -// Peter E Mellquist / design/original code -// Michael R. MacFaden / modified for ACE, added suboid(),collapse ctor's -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -//------------------------------------------------------------------------ -#include "asnmp/smival.h" - -class ACE_Export OctetStr: public SnmpSyntax - // = TITLE - // Implement RFC1155 Octet SMI data object - -{ -public: - OctetStr( const char *string = "", long size = -1); - // construct octet from byte buffer, assume c style string if size == -1 - - OctetStr ( const OctetStr &octet); - // constructor using another octet object - - ~OctetStr(); - // destructor - - SmiUINT32 get_syntax(); - // syntax type - - void set_data( const SmiBYTE* string, long int size = -1); - // set octet from byte buffer, assume c style string if size == -1 - - OctetStr& operator=( const char *string); - // assignment to a string operator overloaded - - OctetStr& operator=( const OctetStr &octet); - // assignment to another oid object overloaded - - friend int operator==( const OctetStr &lhs, const OctetStr &rhs); - // equivlence operator overloaded - - friend int operator!=( const OctetStr &lhs, const OctetStr &rhs); - // not equivlence operator overloaded - - friend int operator<( const OctetStr &lhs, const OctetStr &rhs); - // less than < overloaded - - friend int operator<=( const OctetStr &lhs,const OctetStr &rhs); - // less than <= overloaded - - friend int operator>( const OctetStr &lhs, const OctetStr &rhs); - // greater than > overloaded - - friend int operator>=( const OctetStr &lhs, const OctetStr &rhs); - // greater than >= overloaded - - friend int operator==( const OctetStr &lhs,const char *rhs); - // equivlence operator overloaded - - friend int operator!=( const OctetStr &lhs,const char *rhs); - // not equivlence operator overloaded - - friend int operator<( const OctetStr &lhs,const char *rhs); - // less than < operator overloaded - - friend int operator<=( const OctetStr &lhs,char *rhs); - // less than <= operator overloaded - - friend int operator>( const OctetStr &lhs,const char *rhs); - // greater than > operator overloaded - - friend int operator>=( const OctetStr &lhs,const char *rhs); - // greater than >= operator overloaded - - OctetStr& operator+=( const char *a); - // append operator, appends a string - - OctetStr& operator+=( const char c); - // appends an int - - OctetStr& operator+=( const OctetStr& octetstr); - // append one octetStr to another - - SmiBYTE& operator[]( int position); - // for non const [], allows reading and writing - - int left_comparison( const long n, const OctetStr &o) const; - // compare the n leftmost bytes (left-to-right) - // returns 0, equal - // returns -1, < - // returns 1 , > - - size_t length() const ; - // return the len of the oid - - int valid() const; - // returns validity - - SmiBYTE *data() const; - // returns pointer to internal data - - char *to_string(); - // get a printable ASCII value - - char *to_string_hex(); - // get an ASCII formattted hex dump of the contents - - SnmpSyntax *clone() const; - // create a new instance of this Value - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - -protected: - //----[ instance variables ] - char *output_buffer; // formatted Octet value - int validity; // validity boolean -}; - -#endif // OCTET_CLS_ diff --git a/ASNMP/asnmp/oid.cpp b/ASNMP/asnmp/oid.cpp deleted file mode 100644 index d0bbcd3c4aa..00000000000 --- a/ASNMP/asnmp/oid.cpp +++ /dev/null @@ -1,800 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// oid.cpp -// -// = DESCRIPTION -// This module contains the implementation of the oid class. This -// includes all protected and public member functions. The oid class -// may be compiled stand alone without the use of any other library. -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS" without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -//---------[ external C libaries used ]-------------------------------- - -#include "asnmp/oid.h" // include def for oid class - -ACE_RCSID(asnmp, oid, "$Id$") - -enum Defs {SNMPBUFFSIZE=300, - SNMPCHARSIZE=15}; // max oid value (4294967295UL) - -#define NO_MEM_STR "ERROR: Oid::to_string: memory allocation failure" - -//=============[Oid::get_syntax(void)]==================================== -SmiUINT32 Oid::get_syntax() -{ - return sNMP_SYNTAX_OID; -} - - -//=============[Oid::Oid( const char *dotted_string ]===================== -// constructor using a dotted string -// -// do a string to oid using the string passed in -Oid::Oid( const char * dotted_oid_string, size_t size) -{ - // can't init enum SmiValue so just memset it clean - set_null(); - - size_t z; - if ((z = ACE_OS::strlen(dotted_oid_string)) == 0) { - set_invalid(); - return; - } - - if (size == (unsigned int)-1) - size = z; - if (size > z) - size = z; - - char *ptr = (char *)dotted_oid_string;; - if (size < z) { - // create new buffer if needed - ACE_NEW(ptr, char [size]); - - // sz should be in StrToOid? - ACE_OS::memcpy( (void *)ptr, dotted_oid_string, size); - } - - size_t byte_counter; - if (StrToOid( (char *) ptr, &smival.value.oid, byte_counter) < 0) - set_invalid(); - if (ptr != dotted_oid_string) - delete [] ptr; -} - - -//=============[Oid::Oid( const Oid &oid) ]================================ -// constructor using another oid object -// -// do an oid copy using the oid object passed in -Oid::Oid ( const Oid &oid) -{ - set_null(); - - // allocate some memory for the oid - // in this case the size to allocate is the same - // size as the source oid - if (oid.smival.value.oid.len) { - ACE_NEW(smival.value.oid.ptr, SmiUINT32[ oid.smival.value.oid.len]); - size_t byte_counter; - OidCopy( (SmiLPOID) &(oid.smival.value.oid),(SmiLPOID) - &smival.value.oid, byte_counter); - } -} - - -//=============[Oid::Oid( const unsigned long *raw_oid, int oid_len) ]==== -// constructor using raw numeric form -// -// copy the integer values into the private member -Oid::Oid(const unsigned long *raw_oid, size_t oid_len) -{ - set_null(); - - smival.syntax = sNMP_SYNTAX_OID; - set_invalid(); - - if (raw_oid && oid_len > 0) { - ACE_NEW(smival.value.oid.ptr, SmiUINT32[ oid_len]); - smival.value.oid.len = oid_len; - for (size_t i=0; i < oid_len; i++) - smival.value.oid.ptr[i] = raw_oid[i]; - } -} - -//=============[Oid::~Oid]============================================== -// destructor -// -// free up the descriptor space -Oid::~Oid() -{ - // free up the octet deep memory - if ( smival.value.oid.ptr ) { - set_invalid(); - } - - // free up the output string - if ( iv_str != 0) - delete [] iv_str; -} - - -//=============[Oid::operator = const char * dotted_string ]============== -// assignment to a string operator overloaded -// -// free the existing oid -// create the new oid from the string -// return this object -void Oid::set_data( const char *dotted_oid_string) -{ - // delete the old value - if ( smival.value.oid.ptr ) { - set_invalid(); - } - - // assign the new value - size_t byte_counter; - if (StrToOid( (char *) dotted_oid_string, &smival.value.oid, byte_counter) <0) - set_invalid(); -} - - -//=============[Oid:: operator = const Oid &oid ]========================== -// assignment to another oid object overloaded -// -// free the existing oid -// create a new one from the object passed in -// TODO: measure perf vs memory of no realloc in case where len >= oid.len -Oid& Oid::operator=( const Oid &oid) -{ - // protect against assignment from self - if ( this == &oid) - return *this; - - set_invalid(); - - // check for zero len on source - if ( oid.smival.value.oid.len == 0) - return *this; - - init_value((const SmiLPOID) &(oid.smival.value.oid), - oid.smival.value.oid.len); - return *this; -} - -// assign this object the oid, set to invalid if copy fails -void Oid::init_value(const SmiLPOID srcOid, size_t len) -{ - // allocate some memory for the oid - ACE_NEW(smival.value.oid.ptr, SmiUINT32[ len]); - size_t byte_counter; - OidCopy( srcOid, (SmiLPOID) &smival.value.oid, byte_counter); -} - -void Oid::init_value(const unsigned long *raw_oid, size_t oid_len) -{ - if (smival.value.oid.ptr) - delete [] smival.value.oid.ptr; - - ACE_NEW(smival.value.oid.ptr, SmiUINT32[ oid_len]); - ACE_OS::memcpy((SmiLPBYTE) smival.value.oid.ptr, - (SmiLPBYTE) raw_oid, - (size_t) (oid_len * sizeof(SmiUINT32))); - smival.value.oid.len = oid_len; -} - -//==============[Oid:: operator += const char *a ]========================= -// append operator, appends a string -// -// allocate some space for a max oid string -// extract current string into space -// concat new string -// free up existing oid -// make a new oid from string -// delete allocated space -Oid& Oid::operator+=( const char *a) -{ - unsigned long n; - - if (!a) - return *this; - - if ( *a=='.') - a++; - size_t sz = ACE_OS::strlen(a); - - if (valid()) { - n = (smival.value.oid.len *SNMPCHARSIZE) + smival.value.oid.len + 1 + sz; - char *ptr; - ACE_NEW_RETURN(ptr, char[ n], *this); - size_t byte_counter; - if (OidToStr(&smival.value.oid, n,ptr, byte_counter) > 0) { - delete [] ptr; - set_invalid(); - return *this; - } - - if (ACE_OS::strlen(ptr)) - ACE_OS::strcat(ptr,"."); - ACE_OS::strcat(ptr,a); - if ( smival.value.oid.len !=0) { - set_invalid(); - delete [] smival.value.oid.ptr; - smival.value.oid.len = 0; - } - - if (StrToOid( (char *) ptr, &smival.value.oid, byte_counter) < 0) { - set_invalid(); - } - delete [] ptr; - } - else { - size_t byte_counter; - if (StrToOid( (char *) a, &smival.value.oid, byte_counter) < 0) { - set_invalid(); - } - } - - return *this; -} - -//=============[ int operator == oid,oid ]================================= -// equivlence operator overloaded -int operator==( const Oid &lhs, const Oid &rhs) -{ - // ensure same len, then use left_comparison - if (rhs.length() != lhs.length()) - return 0; - if( lhs.left_comparison( rhs.length(), rhs) == 0) - return 1; - else - return 0; -} - -//==============[ operator!=( Oid &x,Oid &y) ]============================= -//not equivlence operator overloaded -int operator!=( const Oid &lhs,const Oid &rhs) -{ - return (!(lhs == rhs)); -} - -//==============[ operator<( Oid &x,Oid &y) ]============================= -// less than < overloaded -int operator<( const Oid &lhs,const Oid &rhs) -{ - int result; - - // call left_comparison with the current - // Oidx, Oidy and len of Oidx - if ((result = lhs.left_comparison( rhs.length(), rhs)) < 0) - return 1; - else if (result > 0) - return 0; - - else{ - // if here, equivalent substrings, call the shorter one < - if (lhs.length() < rhs.length()) - return 1; - else - return 0; - } -} - -//==============[ operator<=( Oid &x,Oid &y) ]============================= -// less than <= overloaded -int operator<=( const Oid &x,const Oid &y) -{ - if ( (x < y) || (x == y) ) - return 1; - else - return 0; -} - -//==============[ operator>( Oid &x,Oid &y) ]============================= -// greater than > overloaded -int operator>( const Oid &x,const Oid &y) -{ - // just invert existing <= - if (!(x<=y)) - return 1; - else - return 0; -} - -//==============[ operator>=( Oid &x,Oid &y) ]============================= -// greater than >= overloaded -int operator>=( const Oid &x,const Oid &y) -{ - // just invert existing < - if (!(x0)) { - smival.value.oid.len -= n; - - if (smival.value.oid.len == 0) { - set_invalid(); - } - } -} - -//===============[Oid::set_invalid() ]==================== -// make this object invalid by resetting all values -void Oid::set_invalid() { - delete [] smival.value.oid.ptr; - smival.value.oid.ptr = 0; - smival.value.oid.len = 0; - delete [] iv_str; - iv_str = 0; -} - -//===============[Oid::set_null() ]==================== -void Oid::set_null() { - smival.syntax = sNMP_SYNTAX_OID; - smival.value.oid.ptr = 0; - smival.value.oid.len = 0; - iv_str = 0; -} - -//===============[Oid::operator += const unsigned int) ]==================== -// append operator, appends an int -// -// allocate some space for a max oid string -// extract current string into space -// concat new string -// free up existing oid -// make a new oid from string -// delete allocated space -Oid& Oid::operator+=( const unsigned long i) -{ - unsigned long n = (smival.value.oid.len * SNMPCHARSIZE) - + ( smival.value.oid.len -1) + 1 + 4; - char buffer[SNMPBUFFSIZE]; - - // two cases: null oid, existing oid - if (valid()) { - // allocate some temporary space - char *ptr; - ACE_NEW_RETURN(ptr, char[ n], *this); - size_t byte_counter; - if (OidToStr(&smival.value.oid, n, ptr, byte_counter) < 0) { - set_invalid(); - delete [] ptr; - return *this; - } - - if (ACE_OS::strlen(ptr)) - ACE_OS::strcat(ptr,"."); - - if (ACE_OS::sprintf( buffer,"%u",i) != -1) { - ACE_OS::strcat(ptr, buffer); - if ( smival.value.oid.ptr ) { - set_invalid(); - } - if (StrToOid( (char *) ptr, &smival.value.oid, byte_counter) < 0) { - set_invalid(); - } - delete [] ptr; - } - } - else { - init_value((const unsigned long *)&i, (size_t)1); - } - - return *this; -} - -//===============[Oid::operator += const Oid) ]======================== -// append operator, appends an Oid -// -// allocate some space for a max oid string -// extract current string into space -// concat new string -// free up existing oid -// make a new oid from string -// delete allocated space -Oid& Oid::operator+=( const Oid &o) -{ - SmiLPUINT32 new_oid; - - if (o.smival.value.oid.len == 0) - return *this; - - ACE_NEW_RETURN(new_oid, - SmiUINT32[ smival.value.oid.len + o.smival.value.oid.len], *this); - if (smival.value.oid.ptr) { - ACE_OS::memcpy((SmiLPBYTE) new_oid, - (SmiLPBYTE) smival.value.oid.ptr, - (size_t) (smival.value.oid.len*sizeof(SmiUINT32))); - - delete [] smival.value.oid.ptr; - } - - // out with the old, in with the new... - smival.value.oid.ptr = new_oid; - - ACE_OS::memcpy((SmiLPBYTE) &new_oid[smival.value.oid.len], - (SmiLPBYTE) o.smival.value.oid.ptr, - (size_t) (o.smival.value.oid.len*sizeof(SmiUINT32))); - - smival.value.oid.len += o.smival.value.oid.len; - return *this; -} - -// return string portion of the oid -// -char * Oid::to_string() -{ - unsigned long n; - if (!valid()) - return ""; // be consistent with other classes - - // the worst case char len of an oid can be.. - // oid.len*3 + dots in between if each oid is XXXX - // so.. size = (len*4) + (len-1) + 1 , extra for a null - - n = (smival.value.oid.len *SNMPCHARSIZE) + ( smival.value.oid.len -1) + 1 ; - if (n == 0) - n = 1; // need at least 1 byte for a null string - - // adjust the len of output array in case size was adjusted - if ( iv_str != 0) - delete [] iv_str; - // allocate some space for the output string - ACE_NEW_RETURN(iv_str, char[ n], ""); - - // convert to an output string - size_t how_many; - if ( valid() && iv_str != 0) - if (OidToStr(&smival.value.oid,n,iv_str, how_many) < 0) - return "ERROR: Oid::OidToStr failed"; - return iv_str; -} - -//==============[Oid::suboid( unsigned int start, n) ]============= -int Oid::suboid(Oid& new_oid, size_t start, size_t how_many) -{ - if (how_many == 0) - return 0; - else - if (how_many == (size_t)-1) - how_many = length(); - else - if (how_many > length()) - how_many = length(); - - // reset new_oid - new_oid.set_invalid(); - - size_t new_size = how_many - start; - if (new_size == 0) - new_size++; - new_oid.smival.value.oid.len = new_size; - ACE_NEW_RETURN(new_oid.smival.value.oid.ptr, - SmiUINT32 [ new_oid.smival.value.oid.len], -1); - // copy source to destination - ACE_OS::memcpy( (SmiLPBYTE) new_oid.smival.value.oid.ptr, - (SmiLPBYTE) (smival.value.oid.ptr + start), - new_size * sizeof(SmiLPBYTE)); - return 0; -} - - -//=============[Oid::StrToOid( char *string, SmiLPOID dst) ]============== -// convert a string to an oid -int Oid::StrToOid( const char *string, SmiLPOID dstOid, size_t& how_many) -{ - size_t index = 0; - size_t number = 0; - - // make a temp buffer to copy the data into first - SmiLPUINT32 temp; - unsigned long nz; - - if (string && *string) { - nz = ACE_OS::strlen( string); - } - else { - dstOid->len = 0; - dstOid->ptr = 0; - return -1; - } - - ACE_NEW_RETURN(temp, SmiUINT32[ nz], -1); - while (*string!=0 && indexptr, SmiUINT32[ index], -1); - // TODO: make tmp autoptr type delete [] temp to prevent leak - - // copy in the temp data - ACE_OS::memcpy((SmiLPBYTE) dstOid->ptr, (SmiLPBYTE) temp, - (size_t) (index*sizeof(SmiUINT32))); - - // set the len of the oid - dstOid->len = index; - - // free up temp data - delete [] temp; - - how_many = index; - return 0; -} - - -//===============[Oid::OidCopy( source, destination) ]==================== -// Copy an oid, return bytes copied -int Oid::OidCopy( SmiLPOID srcOid, SmiLPOID dstOid, size_t& how_many_bytes) -{ - // check source len ! zero - if (srcOid->len == 0) - return -1; - - // copy source to destination - ACE_OS::memcpy((SmiLPBYTE) dstOid->ptr, - (SmiLPBYTE) srcOid->ptr, - (size_t) (srcOid->len * sizeof(SmiUINT32))); - - //set the new len - dstOid->len = srcOid->len; - how_many_bytes = srcOid->len; - - return 0; -} - - -//===============[Oid::left_comparison( n, Oid) ]================================= -// compare the n leftmost values of two oids ( left-to_right ) -// -// self == Oid then return 0, they are equal -// self < Oid then return -1, < -// self > Oid then return 1, > -int Oid::left_comparison( const unsigned long n, const Oid &o) const -{ - unsigned long z; - unsigned long len = n; - int reduced_len = 0; - - // 1st case they both are null - if (( len==0)&&( this->smival.value.oid.len==0)) - return 0; // equal - - // verify that n is valid, must be >= 0 - if ( len <=0) - return 1; // ! equal - - // only compare for the minimal length - if (len > this->smival.value.oid.len) { - len = this->smival.value.oid.len; - reduced_len = 1; - } - if (len > o.smival.value.oid.len) { - len = o.smival.value.oid.len; - reduced_len = 1; - } - - z = 0; - while(z < len) { - if ( this->smival.value.oid.ptr[z] < o.smival.value.oid.ptr[z]) - return -1; // less than - if ( this->smival.value.oid.ptr[z] > o.smival.value.oid.ptr[z]) - return 1; // greater than - z++; - } - - // if we truncated the len then these may not be equal - if (reduced_len) { - if (this->smival.value.oid.len < o.smival.value.oid.len) - return -1; - if (this->smival.value.oid.len > o.smival.value.oid.len) - return 1; - } - return 0; // equal - -} - - -//===============[Oid::left_comparison( n, Oid) ]================================= -// compare the n rightmost bytes (right-to-left) -// returns 0, equal -// returns -1, < -// returns 1 , > -int Oid::right_comparison( const unsigned long n, const Oid &o) const -{ - // oid to compare must have at least the same number - // of sub-ids to comparison else the argument Oid is - // less than THIS - if ( o.length() < n) - return -1; - - // also can't compare argument oid for sub-ids which - // THIS does not have - if ( this->length() < n) - return -1; - - int start = (int) this->length(); - int end = (int) start - (int) n; - for ( int z=start;z< end;z--) - { - if ( o.smival.value.oid.ptr[z] < this->smival.value.oid.ptr[z]) - return -1; - if ( o.smival.value.oid.ptr[z] > this->smival.value.oid.ptr[z]) - return 1; - } - - return 0; // they are equal - -} - - -//================[ Oid::valid() ]======================================== -// is the Oid object valid -// returns validity -int Oid::valid() const -{ - return ( smival.value.oid.ptr ? 1 : 0 ); -} - -//================[Oid::OidToStr ]========================================= -// convert an oid to a string -int Oid::OidToStr( SmiLPOID srcOid, unsigned long size, - char *string, size_t& how_many_bytes) -{ - unsigned long index = 0; - unsigned totLen = 0; - char szNumber[SNMPBUFFSIZE]; - - // init the string - string[totLen] = 0; - - // verify there is something to copy - if (srcOid->len == 0) - return -1; - - // loop through and build up a string - for (index=0; index < srcOid->len; index++) { - - // convert data element to a string - if (ACE_OS::sprintf( szNumber,"%u", srcOid->ptr[index]) == -1) - return -1; - - // verify len is not over - if (totLen + ACE_OS::strlen(szNumber) + 1 >= size) - return -2; - - // if not at end, pad with a dot - if (totLen!=0) - string[totLen++] = '.'; - - // copy the string token into the main string - ACE_OS::strcpy(string + totLen, szNumber); - - // adjust the total len - totLen += ACE_OS::strlen(szNumber); - } - - how_many_bytes = totLen + 1; - return 0; -} - - -//================[ general Value = operator ]======================== -SnmpSyntax& Oid::operator=( SnmpSyntax &val) -{ - // protect against assignment from self - if ( this == &val ) - return *this; - - // blow away old value - smival.value.oid.len = 0; - if (smival.value.oid.ptr) { - set_invalid(); - } - - // assign new value - if (val.valid()) { - switch (val.get_syntax()) { - case sNMP_SYNTAX_OID: - set_data( ((Oid &)val).smival.value.oid.ptr, - (unsigned int)((Oid &)val).smival.value.oid.len); - break; - } - } - return *this; -} - -//================[ [] operator ]===================================== -unsigned long& Oid::operator[](size_t position) -{ - return smival.value.oid.ptr[position]; -} - -//================[ clone ]=========================================== -SnmpSyntax *Oid::clone() const -{ - return (SnmpSyntax *) new Oid(*this); -} diff --git a/ASNMP/asnmp/oid.h b/ASNMP/asnmp/oid.h deleted file mode 100644 index 16020e374c0..00000000000 --- a/ASNMP/asnmp/oid.h +++ /dev/null @@ -1,170 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef OID_CLS_ -#define OID_CLS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// oid.h -// -// = DESCRIPTION -// This class is fully contained and does not rely on or any other -// SNMP libraries. This class is portable across any platform -// which supports C++. Ported to ACE by Mike MacFaden mrm@cisco.com -// and modified for MT. Some API cleanup: collapse constructors, -// add suboid() method remove unnecessary overload, and update a few -// names and types to improve clarity. -// -// = AUTHOR -// Peter E Mellquist -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -//----------[ extern C libraries Needed ]--------------------------------- -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "asnmp/smival.h" // derived class for all values - -class ACE_Export Oid: public SnmpSyntax - // = TITLE - // Implement RFC 1155 Object Identifier (OID) datatype -{ -public: - Oid( const char * dotted_oid_string = "", size_t size = unsigned(-1) ); - // constructor using a dotted string - - Oid ( const Oid &oid); - // constructor using another oid object - - Oid(const unsigned long *raw_oid, size_t oid_len); - // constructor from raw form - - ~Oid(); - // destructor - - SmiUINT32 get_syntax(); - // syntax type - - Oid& operator=( const Oid &oid); - // assignment to another oid object overloaded - - friend int operator==( const Oid &lhs,const Oid &rhs); - // equal operator overloaded - - friend int operator!=( const Oid &lhs,const Oid &rhs); - // not equal operator overloaded - - friend int operator<( const Oid &lhs,const Oid &rhs); - // less than < overloaded - - friend int operator<=( const Oid &lhs,const Oid &rhs); - // less than <= overloaded - - friend int operator>( const Oid &lhs,const Oid &rhs); - // greater than > overloaded - - friend int operator>=( const Oid &lhs,const Oid &rhs); - // greater than >= overloaded - - Oid& operator+=( const char *a); - // append operator, appends a string - - Oid& operator+=( const unsigned long i); - // appends an int - - Oid& operator+=( const Oid &o); - // appends an Oid - - unsigned long & operator[]( size_t position); - // allows element access - - SmiLPOID oidval(); - // return the WinSnmp oid part - - void set_data( const char *dotted_oid_string); - // reset the data from raw 1 byte format - - void set_data( const unsigned long *raw_oid, const size_t oid_len); - // reset the data from raw 4byte integer format - - size_t length() const; - // return the len of the oid - - void trim( const size_t how_many = 1); - // trim off the n rightmost values of an oid - - int suboid(Oid& oid, size_t start = 0, size_t how_many = -1); - // the equivalent of a substr(new_str, 0, 1) - - int left_comparison( const unsigned long n, const Oid &o) const; - // compare the n leftmost bytes (left-to-right) - // returns 0, equal - // returns -1, < - // returns 1 , > - - - int right_comparison( const unsigned long n, const Oid &o) const; - // compare the n rightmost bytes (right-to-left) - // returns 0, equal - // returns -1, < - // returns 1 , > - - int valid() const; - // is the Oid object valid - - char *to_string(); - // return dotted string value from the right - // where the user specifies how many positions to print - - SnmpSyntax *clone() const; - // create a new instance of this Value - - SnmpSyntax& operator=( SnmpSyntax &val); - // copy an instance of this Value - -protected: - char *iv_str; - // used for returning oid string - - int StrToOid( const char *string, SmiLPOID dstOid, size_t& how_many_bytes); - // convert a string to an smi oid - - int OidCopy( SmiLPOID srcOid, SmiLPOID dstOid, size_t& how_many_bytes); - // clone an smi oid - - int OidToStr(SmiLPOID srcOid, SmiUINT32 size, char *string, size_t& how_many_bytes); - // convert an smi oid to its string representation - - private: - void set_invalid(); - // release memory, re-init data members - - void set_null(); - // initialize object data members - void init_value( const SmiLPOID srcOid, size_t len); - void init_value(const unsigned long *raw_oid, size_t oid_len); -}; - -#endif //OID_CLS_ diff --git a/ASNMP/asnmp/oid_def.h b/ASNMP/asnmp/oid_def.h deleted file mode 100644 index bdf46ec4f88..00000000000 --- a/ASNMP/asnmp/oid_def.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef OID_DEF -#define OID_DEF -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// address.cpp -// -// = DESCRIPTION -// Well known Oids defined in RFC 1215 -// -// = AUTHOR -// Peter E Mellquist -// -// ============================================================================ -/*=================================================================== - - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -// SMI trap oid def -class snmpTrapsOid: public Oid { - public: - snmpTrapsOid (void):Oid("1.3.6.1.6.3.1.1.5"){}; -}; - -// SMI Enterprose Oid -class snmpTrapEnterpriseOid: public Oid { - public: - snmpTrapEnterpriseOid(void):Oid("1.3.6.1.6.3.1.1.4.3.0"){}; -}; - -// SMI Cold Start Oid -class coldStartOid: public snmpTrapsOid { - public: - coldStartOid( void){*this+=".1";}; -}; - -// SMI WarmStart Oid -class warmStartOid: public snmpTrapsOid { - public: - warmStartOid( void){*this+=".2";}; -}; - -// SMI LinkDown Oid -class linkDownOid: public snmpTrapsOid { - public: - linkDownOid( void){*this+=".3";}; -}; - - -// SMI LinkUp Oid -class linkUpOid: public snmpTrapsOid { - public: - linkUpOid( void){*this+=".4";}; -}; - -// SMI Authentication Failure Oid -class authenticationFailureOid: public snmpTrapsOid { - public: - authenticationFailureOid( void){*this+=".5";}; -}; - -// SMI egpneighborloss Oid -class egpNeighborLossOid: public snmpTrapsOid { - public: - egpNeighborLossOid( void){*this+=".6";}; -}; - - -#endif // OID_DEF diff --git a/ASNMP/asnmp/pdu.cpp b/ASNMP/asnmp/pdu.cpp deleted file mode 100644 index 6ac3acc04d5..00000000000 --- a/ASNMP/asnmp/pdu.cpp +++ /dev/null @@ -1,496 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// pdu.cpp -// -// = DESCRIPTION -// Pdu class implementation. Encapsulation of an SMI Protocol -// Data Unit (PDU) in C++. -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/snmp.h" -#include "asnmp/pdu.h" // include Pdu class definition - -ACE_RCSID(asnmp, pdu, "$Id$") - -//=====================[ constructor no args ]========================= -Pdu::Pdu( void): vb_count_(0), error_status_(0), error_index_(0), -validity_(0), request_id_(0), pdu_type_(0), notify_timestamp_(0), -output_(0) -{ -} - -//=====================[ constructor with vbs_ and count ]============== -Pdu::Pdu( Vb* pvbs, const int pvb_count): vb_count_(0), error_index_(0), -validity_(0), request_id_(0), pdu_type_(0), notify_timestamp_(0), -output_(0) -{ - int z; // looping variable - - // zero is ok - if ( pvb_count == 0) { - validity_ = 1; - return; - } - - // check for over then max - if ( pvb_count > MAX_VBS) { - validity_ = 0; - return; - } - - // loop through and assign internal vbs_ - for (z = 0;z < pvb_count; z++) { - validity_ = 0; - ACE_NEW(vbs_[z], Vb( pvbs[z])); - validity_ = 1; - } - - // assign the vb count - vb_count_ = pvb_count; - - validity_ = 1; -} - -//=====================[ constructor with another Pdu instance ]======== -Pdu::Pdu( const Pdu &pdu): vb_count_(0), -error_index_(0), validity_(0), request_id_(0), pdu_type_(0), -notify_timestamp_(0), output_(0) -{ - *this = pdu; - return; -} - -//=====================[ destructor ]==================================== -Pdu::~Pdu() -{ - delete_all_vbs(); - delete [] output_; -} - - -//=====================[ assignment to another Pdu object overloaded ]=== -Pdu& Pdu::operator=( const Pdu &pdu) -{ - int z; // looping variable - - // Initialize all mv's - error_status_ = pdu.error_status_; - error_index_ = pdu.error_index_; - request_id_ = pdu.request_id_; - pdu_type_ = pdu.pdu_type_; - notify_id_ = pdu.notify_id_; - notify_timestamp_ = pdu.notify_timestamp_; - notify_enterprise_ = pdu.notify_enterprise_; - validity_ = 1; - - // free up old vbs_ - for ( z = 0;z < vb_count_; z++) - delete vbs_[z]; - vb_count_ = 0; - - // check for zero case - if ( pdu.vb_count_ == 0) { - return *this; - } - - // loop through and fill em up - for (z = 0; z < pdu.vb_count_; z++) { - validity_ = 0; - ACE_NEW_RETURN(vbs_[z], Vb ( *(pdu.vbs_[z])), *this); - validity_ = 1; - } - - vb_count_ = pdu.vb_count_; - return *this; -} - -// append operator, appends a string -Pdu& Pdu::operator+=( Vb &vb) -{ - - // do we have room? - if ( vb_count_ + 1 > MAX_VBS) - return *this; - - // add the new one - validity_ = 0; - ACE_NEW_RETURN(vbs_[vb_count_], Vb (vb), *this); - // set up validity_ - validity_ = 1; - - // up the vb count - vb_count_++; - - // return self reference - return *this; - -} - -// return fomatted version of this object -char * Pdu::to_string() -{ - // determine how big a buffer and allocate it - const int HEADER_STR = 100; - unsigned size = HEADER_STR; // header takes up this much room - int z; - - for ( z = 0; z < vb_count_; z++) - size += ACE_OS::strlen(vbs_[z]->to_string()); - - ACE_NEW_RETURN(output_, char[size], ""); - - // print pdu header info - sprintf(output_, "pdu: valid: %d type:%d, req:%d, cnt: %d, err stat: %d \ - err idx: %d\n", validity_, pdu_type_, (int) request_id_, - vb_count_, error_status_, error_index_ ); - - // now append vb pairs in this object - for ( z = 0; z < vb_count_; z++) { - ACE_OS::strcat(output_, vbs_[z]->to_string()); - ACE_OS::strcat(output_, "\n\t"); - } - - return output_; -} - - -//=====================[ extract Vbs from Pdu ]========================== -// how do you know that the caler has enough memory??? -// should I self allocate this in here and require the -// caller then to free it up at soem later time -int Pdu::get_vblist( Vb* pvbs, const int pvb_count) -{ - if ((!pvbs) || ( pvb_count < 0) || ( pvb_count > vb_count_)) - return 0; - - // loop through all vbs_ and assign to params - int z; - for (z = 0; z < pvb_count; z++) - pvbs[z] = *vbs_[z]; - - return 1; - -} - -//=====================[ deposit Vbs ]=================================== -int Pdu::set_vblist( Vb* pvbs, const int pvb_count) -{ - - // if invalid then don't destroy - if ((!pvbs) || ( pvb_count < 0) || ( pvb_count > MAX_VBS)) - return 0; - - // free up current vbs_ - int z; - for ( z = 0; z < vb_count_; z++) - delete vbs_[z]; - vb_count_ = 0; - - // check for zero case - if ( pvb_count == 0) { - validity_ = 1; - error_status_ = 0; - error_index_ = 0; - request_id_ = 0; - return 0; - } - - - // loop through all vbs_ and reassign them - for ( z = 0; z < pvb_count; z++) { - validity_ = 0; - ACE_NEW_RETURN(vbs_[z], Vb (pvbs[z]), 0); - validity_ = 1; - } - - vb_count_ = pvb_count; - - // clear error status and index since no longer valid - // request id may still apply so don't reassign it - error_status_ = 0; - error_index_ = 0; - validity_ = 1; - - return 1; -} - -//===================[ get a particular vb ]============================= -// here the caller has already instantiated a vb object -// index is zero based -int Pdu::get_vb( Vb &vb, const int index) const -{ - // can't have an index less than 0 - if ( index < 0) - return 0; - - // can't ask for something not there - if ( index > (vb_count_ - 1)) - return 0; - - // asssign it - vb = *vbs_[index]; - - return 1; -} - -//===================[ set a particular vb ]============================= -int Pdu::set_vb( Vb &vb, const int index) -{ - // can't set a vb at index less than 0 - if ( index < 0) - return 0; - - // can't ask for something not there - if ( index > (vb_count_ - 1)) - return 0; - - // delete what is there - delete vbs_[index]; - - // assign it - validity_ = 0; - ACE_NEW_RETURN(vbs_[index], Vb (vb), 0); - validity_ = 1; - - return 1; - -} - -//=====================[ return number of vbs_ ]========================== -int Pdu::get_vb_count() const -{ - return vb_count_; -} - -//=====================[ return the error status ]======================= -int Pdu::get_error_status() const -{ - return error_status_; -} - -char *Pdu::agent_error_reason() -{ - int pdu_err = get_error_status(); - if (pdu_err == 0) // any real error? - return "not in error state"; - - int n_vbs = get_vb_count(); - Vb bad; - get_vb(bad, get_error_index() -1); // not zero based?? - char *pmsg = Snmp::error_string(get_error_status()); - char *id = bad.to_string_oid(); - char *val = bad.to_string_value(); - const int HDR_SZ = 100; - - if (!output_) { - int size = ACE_OS::strlen(pmsg) + ACE_OS::strlen(id) + - ACE_OS::strlen(val); - ACE_NEW_RETURN(output_, char[size + HDR_SZ], ""); - } - - ACE_OS::sprintf(output_, -"FAIL PDU REPORT: pdu id: %d vb cnt: %d vb idx: %d \n\ -msg: %s vb oid: %s value: %s", - get_request_id(), n_vbs, get_error_index(), pmsg, id, val); - - return output_; -} - -//=====================[ set the error status ]========================== -// friend -void set_error_status( Pdu *pdu, const int status) -{ - if (pdu) - pdu->error_status_ = status; -} - -//=====================[ return the error index ]======================== -int Pdu::get_error_index() const -{ - return error_index_; -} - -//=====================[ set the error index ]=========================== -// friend -void set_error_index( Pdu *pdu, const int index) -{ - if (pdu) - pdu->error_index_ = index; -} - -//=====================[ clear error status ]============================= -void clear_error_status( Pdu *pdu) -{ - if (pdu) - pdu->error_status_ = 0; -} - -//=====================[ clear error index ]============================== -void clear_error_index( Pdu *pdu) -{ - if (pdu) - pdu->error_index_ = 0; -} - -//=====================[ return the request id ]========================== -unsigned long Pdu::get_request_id() const -{ - return request_id_; -} - -//=====================[ set the request id ]============================= -// friend function -void set_request_id( Pdu *pdu, const unsigned long rid) -{ - if (pdu) - pdu->request_id_ = rid; -} - -//=====================[ returns validity_ of Pdu instance ]=============== -int Pdu::valid() const -{ - return validity_; -} - -//=====================[ get the pdu type ]=============================== -unsigned short Pdu::get_type()const -{ - return pdu_type_; -} - -// set the pdu type -void Pdu::set_type( unsigned short type) -{ - pdu_type_ = type; -} - - -// trim off the last vb -int Pdu::trim(const int p) -{ - int lp = p; - - // verify that lp is legal - if ( lp < 0 || lp > vb_count_) - return 0; - - while ( lp != 0) { - if ( vb_count_ > 0) { - delete vbs_[vb_count_ - 1]; - vb_count_--; - } - lp--; - } - return 1; -} - - - -// delete a Vb anywhere within the Pdu -int Pdu::delete_vb( const int p) -{ - // position has to be in range - if (( p < 0) || ( p > (vb_count_ - 1))) - return 0; - - // safe to remove it - delete vbs_[ p]; - - for ( int z=p;z < (vb_count_-1);z++) { - vbs_[z] = vbs_[z+1]; - } - vb_count_--; - - return 1; -} - -void Pdu::delete_all_vbs() -{ - for ( int z = 0; z < vb_count_; z++) - delete vbs_[z]; - vb_count_ = 0; -} - - -// set notify timestamp -void Pdu::set_notify_timestamp( const TimeTicks & timestamp) -{ - notify_timestamp_ = timestamp; -} - - -// get notify timestamp -void Pdu::get_notify_timestamp( TimeTicks & timestamp) const -{ - timestamp = notify_timestamp_; -} - -// set the notify id -void Pdu::set_notify_id( const Oid id) -{ - notify_id_ = id; -} - -// get the notify id -void Pdu::get_notify_id( Oid &id) const -{ - id = notify_id_; -} - -// set the notify enterprise -void Pdu::set_notify_enterprise( const Oid &enterprise) -{ - notify_enterprise_ = enterprise; -} - -// get the notify enterprise -void Pdu::get_notify_enterprise( Oid & enterprise) const -{ - enterprise = notify_enterprise_; -} - -// ------ class VbIter ------------------- -VbIter::VbIter(Pdu& pdu): idx_(-1), pdu_(&pdu) -{ -} - -// returns 1 if ok, else 0 if none left -int VbIter::next(Vb& vb) -{ - if (idx_ == -1) { - idx_ = 0; - pdu_->get_vb(vb, idx_++); - return 1; - } - else - if (idx_ < pdu_->get_vb_count()) { - pdu_->get_vb(vb, idx_++); - return 1; - } - return 0; // non left -} diff --git a/ASNMP/asnmp/pdu.h b/ASNMP/asnmp/pdu.h deleted file mode 100644 index e748ac5b528..00000000000 --- a/ASNMP/asnmp/pdu.h +++ /dev/null @@ -1,213 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef PDU_CLS_ -#define PDU_CLS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// pdu.h -// -// = DESCRIPTION -// Pdu class definition. Encapsulation of an SMI Protocol -// Data Unit (PDU) aka Packet in C++. -// -// = AUTHOR -// Peter E Mellquist original code -// Michael MacFaden mrm@cisco.com ACE port, add iterator class for pdus -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -// TODO: this needs to be moved into the CLASS and modifyable at runtime -// TODO: define an iterator object to traverse the vbs in a pdu - -#define MAX_VBS 25 -#include "asnmp/vb.h" // include Vb class definition - -class ACE_Export Pdu - // = TITLE - // Protocol Data Unit (PDU) concrete class. An abstraction of the - // data packet used to by two SNMP sessions to communicate. -{ -public: - Pdu( void); - // constructor no args - - Pdu( Vb* pvbs, const int pvb_count); - // constructor with vbs and count - - Pdu( const Pdu &pdu); - // constructor with another Pdu instance - - ~Pdu(); - // destructor - - Pdu& operator=( const Pdu &pdu); - // assignment to another Pdu object overloaded - - Pdu& operator+=( Vb &vb); - // append a vb to the pdu - - // TODO: add Pdu& operator-=(const Vb &vb); - - int get_vblist( Vb* pvbs, const int pvb_count); - // extract all Vbs from Pdu - - int set_vblist( Vb* pvbs, const int pvb_count); - // deposit all Vbs to Pdu - - int get_vb( Vb &vb, const int index = 0) const; - // get a particular vb - // where 0 is the first vb - - int set_vb( Vb &vb, const int index); - // set a particular vb - // where 0 is the first vb - - int get_vb_count() const; - // return number of vbs - - int get_error_status() const; - // return the error status - - char *agent_error_reason(); - // return the complete error info from this pdu - - friend void set_error_status( Pdu *pdu, const int status); - // set the error status - - int get_error_index() const; - // return the error index - - friend void set_error_index( Pdu *pdu, const int index); - // set the error index - - friend void clear_error_status( Pdu *pdu); - // clear error status - - friend void clear_error_index( Pdu *pdu); - // clear error index - - unsigned long get_request_id() const; - // return the request id - - friend void set_request_id( Pdu *pdu, const unsigned long rid); - // set the request id - - unsigned short get_type() const; - // get the pdu type - - void set_type( unsigned short type); - // set the pdu type - - int valid() const; - // returns validity of Pdu instance - - int trim(const int count=1); - // trim off count vbs from the end of the vb list - - int delete_vb( const int position); - // delete a Vb anywhere within the Pdu - - void delete_all_vbs(); - // delete_all vbs in pdu - - void set_notify_timestamp( const TimeTicks & timestamp); - // set notify timestamp - - void get_notify_timestamp( TimeTicks & timestamp) const; - // get notify timestamp - - void set_notify_id( const Oid id); - // set the notify id - - void get_notify_id( Oid &id) const; - // get the notify id - - void set_notify_enterprise( const Oid &enterprise); - // set the notify enterprise - - void get_notify_enterprise( Oid & enterprise) const; - // get the notify enterprise - - char *to_string(); - // return fomatted version of this object - - - protected: - Vb *vbs_[MAX_VBS]; - // pointer to array of Vbs - - int vb_count_; - // count of Vbs - - int error_status_; - // SMI error status - - int error_index_; - // SMI error index - - int validity_; - // valid boolean status of object construction - unsigned long request_id_; - // SMI request id - - unsigned short pdu_type_; - // derived at run time based on request type - - TimeTicks notify_timestamp_; - // a timestamp associated with an infor - // for notify Pdu objects only - // traps & notifies - - Oid notify_id_; - // an id - - Oid notify_enterprise_; - - private: - char *output_; - // buffer for to_string() -}; - - -class VbIter - // = TITLE - // Utility class to iterate once through a PDU varbind list -{ - public: - VbIter(Pdu& pdu); - // default constructor - - int next(Vb& vb); - // returns 1 if ok, else 0 if none left - - private: - VbIter(const VbIter&); - // disallow copy constructor use - - int idx_; - // current object in list - - Pdu *pdu_; - // ptr to pdu being interated over -}; - -#endif //PDU_CLS_ - diff --git a/ASNMP/asnmp/sagent.cpp b/ASNMP/asnmp/sagent.cpp deleted file mode 100644 index fc56a2c728f..00000000000 --- a/ASNMP/asnmp/sagent.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// sagent.cpp -// -// = DESCRIPTION -// SNMP agent class definition. The sagent class provides an object oriented -// approach for creating SNMP Agents. The sagent class is an encapsulation -// of SNMP sessions, gets, sets, etc. -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -#include "ace/Reactor.h" -#include "ace/SOCK_Dgram.h" - -#include "asnmp/oid.h" // snmp++ oid class -#include "asnmp/vb.h" // snbmp++ vb class -#include "asnmp/target.h" // snmp++ target class -#include "asnmp/pdu.h" // snmp++ pdu class -#include "asnmp/snmperrs.h" // error macros and strings -#include "asnmp/address.h" // snmp++ address class defs -#include "asnmp/snmp.h" // manager snmp interface -#include "asnmp/sagent.h" // agent interface -#include "asnmp/transaction.h" // convert from wire to API - -ACE_RCSID(asnmp, sagent, "$Id$") - -sagent::sagent(unsigned short port): Snmp(port) -{ - ACE_TRACE("sagent::sagent(short)"); -} - -sagent::~sagent() -{ - ACE_TRACE("sagent::~sagent"); -} - -int sagent::handle_input(ACE_HANDLE fd) -{ - ACE_TRACE("sagent::handle_input"); - - transaction tr(iv_snmp_session_); // this section needs a better design - tr.handle_input(fd); - char rcv_com_str[MAX_COMM_STR_LEN]; - if (tr.result(pdu_, rcv_com_str) < 0) - return 0; - OctetStr community(rcv_com_str); - const ACE_INET_Addr &ta = tr.get_from_addr(); - char buf_tmp[MAXHOSTNAMELEN + 1]; - ta.addr_to_string (buf_tmp, MAXHOSTNAMELEN); - UdpAddress ra(buf_tmp); - tgt_.set_address(ra); - - - // process msg here by calling subclass's implementation - switch (pdu_.get_type()){ - case sNMP_PDU_GET: - tgt_.set_read_community(community); - this->handle_get(pdu_, tgt_); - break; - - case sNMP_PDU_GETNEXT: - tgt_.set_read_community(community); - this->handle_get_next(pdu_, tgt_); - break; - - case sNMP_PDU_SET: - tgt_.set_write_community(community); - this->handle_set(pdu_, tgt_); - break; - - default: - ACE_ASSERT(0); - } - return 0; -} - -ACE_HANDLE sagent::get_handle() const -{ - ACE_TRACE("sagent::get_handle"); - return iv_snmp_session_.get_handle(); -} - -int sagent::respond(Pdu& pdu,UdpTarget& tgt) -{ - pdu.set_type(sNMP_PDU_RESPONSE); - transaction tr(pdu, tgt, iv_snmp_session_); - tr.send(); - return 0; -} diff --git a/ASNMP/asnmp/sagent.h b/ASNMP/asnmp/sagent.h deleted file mode 100644 index e97d7839be5..00000000000 --- a/ASNMP/asnmp/sagent.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef SAGENT_CLS_ -#define SAGENT_CLS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// sagent.h -// -// = DESCRIPTION -// SNMP agent class defintion. The sagent class provides an object oriented -// approach for creating SNMP Agents. The sagent class is an encapsulation of SNMP -// sessions, gets, sets, etc. -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -#include "ace/Reactor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SOCK_Dgram.h" - -#include "asnmp/oid.h" // snmp++ oid class -#include "asnmp/vb.h" // snbmp++ vb class -#include "asnmp/target.h" // snmp++ target class -#include "asnmp/pdu.h" // snmp++ pdu class -#include "asnmp/snmperrs.h" // error macros and strings -#include "asnmp/address.h" // snmp++ address class defs -#include "asnmp/snmp.h" // snmp interface - -// sagent - supports Version 1 operations in blocking mode - -#define DEF_AGENT_PORT (161) - -class ACE_Export sagent : public ACE_Event_Handler, Snmp - // = TITLE - // Concrete class sagent defines the session and interface to - // communicate with another SNMP Version 1 manager -{ - public: - - - // override the next three methods (callbacks) to implment your agent - // - - virtual int handle_get( Pdu &pdu, UdpTarget &target) = 0; - // retrieve data from a peer agent for a given list of oid values - - virtual int handle_get_next( Pdu &pdu, UdpTarget &target) = 0; - // retrieve data lexically adjacent to the oids specified in the pdu - // from the peer agent - - virtual int handle_set( Pdu &pdu, UdpTarget &target) = 0; - // set data in the agent from the list of oids in the pdu - - virtual int handle_input(ACE_HANDLE); - // new pdu received from mgr (reactor calls this) - - virtual ACE_HANDLE get_handle() const; - // retrieve io descriptor (reactor uses this) - - int respond(Pdu& pdu, UdpTarget& tgt); - // send a response pdu to the mgr - - protected: - sagent(unsigned short port = DEF_AGENT_PORT); - virtual ~sagent(); - -private: - sagent(const sagent&); - Pdu pdu_; // current input pdu - UdpTarget tgt_; // addr & com strs -}; - -#endif //SAGENT_CLS_ - diff --git a/ASNMP/asnmp/smi.h b/ASNMP/asnmp/smi.h deleted file mode 100644 index 09b3927b220..00000000000 --- a/ASNMP/asnmp/smi.h +++ /dev/null @@ -1,153 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef SMIDEF_ -#define SMIDEF_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// smi.h -// -// = DESCRIPTION -// Address class definition. Encapsulates various network -// addresses into easy to use, safe and portable classes. -// -// = AUTHOR -// ?? -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. - -=====================================================================*/ - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -//----------[ ASN/BER Base Types ]----------------------------------------- -// Basic Encoding Rules (BER) -// (used in forming SYNTAXes and certain SNMP types/values) -#define aSN_UNIVERSAL (0x00) -#define aSN_APPLICATION (0x40) -#define aSN_CONTEXT (0x80) -#define aSN_PRIVATE (0xC0) -#define aSN_PRIMITIVE (0x00) -#define aSN_CONSTRUCTOR (0x20) - -//------[ SNMP ObjectSyntax Values ]--------------------------------------- -#define sNMP_SYNTAX_SEQUENCE (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x10) - - -//------------------------------------------------------------------------- -// These values are used in the "syntax" member -// of the smiVALUE structure which follows. -// Note: UInt32 is indistinguishable from Gauge32 per SNMPv2 Draft Standard -// NsapAddr is obsoleted as unique SMI type per SNMPv2 Draft Standard -#define sNMP_SYNTAX_INT (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x02) -#define sNMP_SYNTAX_BITS (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x03) -#define sNMP_SYNTAX_OCTETS (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x04) -#define sNMP_SYNTAX_NULL (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x05) -#define sNMP_SYNTAX_OID (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x06) -#define sNMP_SYNTAX_INT32 sNMP_SYNTAX_INT -#define sNMP_SYNTAX_IPADDR (aSN_APPLICATION | aSN_PRIMITIVE | 0x00) -#define sNMP_SYNTAX_CNTR32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x01) -#define sNMP_SYNTAX_GAUGE32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x02) -#define sNMP_SYNTAX_TIMETICKS (aSN_APPLICATION | aSN_PRIMITIVE | 0x03) -#define sNMP_SYNTAX_OPAQUE (aSN_APPLICATION | aSN_PRIMITIVE | 0x04) -#define sNMP_SYNTAX_CNTR64 (aSN_APPLICATION | aSN_PRIMITIVE | 0x06) -#define sNMP_SYNTAX_UINT32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x07) - -//------------------------------------------------------------------------- - -//---------------[ Exception conditions for SNMPv2 ]----------------------- -// support SNMP v2 -#define sNMP_SYNTAX_NOSUCHOBJECT (aSN_CONTEXT | aSN_PRIMITIVE | 0x00) -#define sNMP_SYNTAX_NOSUCHINSTANCE (aSN_CONTEXT | aSN_PRIMITIVE | 0x01) -#define sNMP_SYNTAX_ENDOFMIBVIEW (aSN_CONTEXT | aSN_PRIMITIVE | 0x02) - - -//--------------[ different types of PDU's ]------------------------------- -#define sNMP_PDU_GET (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x0) -#define sNMP_PDU_GETNEXT (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x1) -#define sNMP_PDU_RESPONSE (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x2) -#define sNMP_PDU_SET (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x3) -#define sNMP_PDU_V1TRAP (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x4) -#define sNMP_PDU_GETBULK (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x5) -#define sNMP_PDU_INFORM (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x6) -#define sNMP_PDU_TRAP (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x7) - - -//------[ smi typedefs ]--------------------------------------------------- -// SNMP-related types from RFC1442 (SMI) - -typedef unsigned char SmiBYTE, *SmiLPBYTE; - -//------------------------------------------------------------------------- -// SNMP-related types from RFC1442 (SMI) - -// int -typedef long SmiINT, *SmiLPINT; - -// int 32 -typedef SmiINT SmiINT32, *SmiLPINT32; - -// unit32 -typedef unsigned long SmiUINT32, *SmiLPUINT32; - -// octet struct -typedef struct { - SmiUINT32 len; - SmiLPBYTE ptr;} SmiOCTETS, *SmiLPOCTETS; - -// bits -typedef SmiOCTETS SmiBITS, *SmiLPBITS; - -// SMI oid struct -typedef struct { - SmiUINT32 len; - SmiLPUINT32 ptr;} SmiOID, *SmiLPOID; - -// ipaddr -typedef SmiOCTETS SmiIPADDR, *SmiLPIPADDR; - -// 32bit counter -typedef SmiUINT32 SmiCNTR32, *SmiLPCNTR32; - -// gauge -typedef SmiUINT32 SmiGAUGE32, *SmiLPGAUGE32; - -// timeticks -typedef SmiUINT32 SmiTIMETICKS, *SmiLPTIMETICKS; - -// opaque -typedef SmiOCTETS SmiOPAQUE, *SmiLPOPAQUE; - -// nsapaddr -typedef SmiOCTETS SmiNSAPADDR, *SmiLPNSAPADDR; - -// 64 bit counter -typedef struct { - SmiUINT32 hipart; - SmiUINT32 lopart; -} SmiCNTR64, *SmiLPCNTR64; - -#endif // SMIDEF_ - - diff --git a/ASNMP/asnmp/smival.h b/ASNMP/asnmp/smival.h deleted file mode 100644 index 6e7c8c4c1b9..00000000000 --- a/ASNMP/asnmp/smival.h +++ /dev/null @@ -1,104 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef SMIVALUE_ -#define SMIVALUE_ -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// smival.h -// -// = DESCRIPTION -// SMIValue class definition. Superclass for the various types -// of SNMP values (Address, Oid, Octet, etc.). Provides -// only a few functions, most info is in subclass. -// -// = AUTHOR -// Jeff Meyer -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -//----[ includes ]----------------------------------------------------- -#include "asnmp/smi.h" - -//----[ macros ]------------------------------------------------------- - -//====================================================================== -// SMI value structure conforming with SMI RFC -// -typedef struct { /* smiVALUE portion of VarBind */ - SmiUINT32 syntax; /* Insert SNMP_SYNTAX_ */ - union { - SmiINT sNumber; /* SNMP_SYNTAX_INT - SNMP_SYNTAX_INT32 */ - SmiUINT32 uNumber; /* SNMP_SYNTAX_UINT32 - SNMP_SYNTAX_CNTR32 - SNMP_SYNTAX_GAUGE32 - SNMP_SYNTAX_TIMETICKS */ - SmiCNTR64 hNumber; /* SNMP_SYNTAX_CNTR64 */ - SmiOCTETS string; /* SNMP_SYNTAX_OCTETS - SNMP_SYNTAX_BITS - SNMP_SYNTAX_OPAQUE - SNMP_SYNTAX_IPADDR - SNMP_SYNTAX_NSAPADDR */ - SmiOID oid; /* SNMP_SYNTAX_OID */ - SmiBYTE empty; /* SNMP_SYNTAX_NULL - SNMP_SYNTAX_NOSUCHOBJECT - SNMP_SYNTAX_NOSUCHINSTANCE - SNMP_SYNTAX_ENDOFMIBVIEW */ - } value; -} SmiVALUE, *SmiLPVALUE; - -// An "abstract" (pure virtual) class that serves as the base class -// for all specific SNMP syntax types. -// -class ACE_Export SnmpSyntax { - -public: - virtual char * to_string() = 0; - // virtual function for getting a printable ASCII value for any SNMP Value - - virtual SmiUINT32 get_syntax() = 0; - // return the current syntax - - virtual SnmpSyntax * clone() const = 0; - // virtual clone operation for creating a new Value from an existing - // value. The caller MUST use the delete operation on the return - // value when done. - - virtual ~SnmpSyntax() {}; - // virtual destructor to ensure deletion of derived classes... - - virtual SnmpSyntax& operator=( SnmpSyntax &/*val*/) - { - return *this; - } - // overloaded assignment operator - // This should be pure virtual, but WinNT compiler - // complains about unresolved reference at link time. - - virtual int valid() const = 0; - // return validity of value object. - -protected: - SmiVALUE smival; -}; - -#endif // SMIVALUE_ diff --git a/ASNMP/asnmp/snmp.cpp b/ASNMP/asnmp/snmp.cpp deleted file mode 100644 index f6ad69fb25a..00000000000 --- a/ASNMP/asnmp/snmp.cpp +++ /dev/null @@ -1,283 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// snmp.cpp -// -// = DESCRIPTION -// The basic SNMPv1 API - blocking version using UDP/IPv4 transport -// and addressing. -// -// = AUTHOR -// Peter E Mellquist class design/orig code -// Michael R MacFaden mrm@cisco.com / rework API, use ACE facilities -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - - -#define INCLUDE_SNMP_ERR_STRINGS_ - -//----[ snmp++ includes ]---------------------------------------------- -#include "asnmp/snmp.h" // class def for this module -#include "asnmp/oid.h" // class def for oids -#include "asnmp/enttraps.h" // class def for well known trap oids -#include "asnmp/vb.h" // class def for vbs -#include "asnmp/address.h" // class def for addresses -#include "asnmp/wpdu.h" // adapter to cmu_library / wire protocol -#include "asnmp/transaction.h" // synchronous transaction processor - -ACE_RCSID(asnmp, snmp, "$Id$") - -const coldStartOid coldStart; -const warmStartOid warmStart; -const linkDownOid linkDown; -const linkUpOid linkUp; -const authenticationFailureOid authenticationFailure; -const egpNeighborLossOid egpNeighborLoss; -const snmpTrapEnterpriseOid snmpTrapEnterprise; - -char Snmp::host_name_[MAXHOSTNAMELEN] = ""; - -Snmp::Snmp(unsigned short port): result_(0), construct_status_(SNMP_CLASS_ERROR), last_transaction_status_(0) -{ - ACE_TRACE("Snmp::Snmp"); - - ACE_INET_Addr addr(port); // any port,address is ok - if (iv_snmp_session_.open(addr) < 0) { - last_transaction_status_ = errno; // open udp/ipv4 socket - ACE_DEBUG((LM_DEBUG, "Snmp::snmp::open port %d failed", port)); - return; - } - - // initial request id randomly generated then monotonically incremented - req_id_ = (unsigned) ACE_OS::time(0); - - construct_status_ = SNMP_CLASS_SUCCESS; - return; -} - -Snmp::~Snmp() -{ - ACE_TRACE("Snmp::~Snmp"); - iv_snmp_session_.close(); -} - -int Snmp::valid() const -{ - return construct_status_; -} - -// given error code, return string definition -// class version -// static -char * Snmp::error_string(int last_transaction_status_) -{ - ACE_TRACE("Snmp::error_string"); - - return ((last_transaction_status_ < 0) ? - ((last_transaction_status_ < MAX_NEG_ERROR)? - nErrs[ abs(MAX_NEG_ERROR) + 1] : nErrs[abs(last_transaction_status_)]): - ((last_transaction_status_ > MAX_POS_ERROR)? - pErrs[MAX_POS_ERROR+1] : pErrs[last_transaction_status_])); -} - -// instance version -char * Snmp::error_string() -{ - return Snmp::error_string(last_transaction_status_); -} - -void Snmp::check_default_port(UdpTarget& target, unsigned short port) -{ - UdpAddress tmp; - target.get_address(tmp); - if (tmp.get_port() == 0) { - tmp.set_port(port); - target.set_address(tmp); - } -} - -int Snmp::run_transaction(Pdu& pdu, UdpTarget& target) -{ - int rc, done = 0; - - // 1. set unique id to match this packet on return - size_t hold_req_id = req_id_++; - set_request_id(&pdu, hold_req_id); - - // 2. write request to agent - transaction trans(pdu, target, iv_snmp_session_); - - // this call blocks while it attempts to retrieve agent response - while (!done) { - if ((rc = trans.run()) < 0) { - last_transaction_status_ = rc; - return rc; - } - else { - trans.result(pdu); - // verify this is the pdu we are after - if (pdu.get_request_id() == hold_req_id) - done = 1 ; - } - } - return 0; -} - -int Snmp::run_transaction(Pdu& pdu, UdpTarget& target, Snmp_Result * cb) -{ - if (!cb) - return run_transaction(pdu, target); - - // 1. set unique id to match this packet on return - hold_req_id_ = req_id_++; - set_request_id(&pdu, hold_req_id_); - pdu_ = &pdu; - result_ = cb; - - // 2. write request to agent - transaction * trans = new transaction(pdu, target, iv_snmp_session_); - return trans->run(this); -} - -void Snmp::result(transaction *t, int rc) -{ - t->result(*pdu_); - // verify this is the pdu we are after - if (pdu_->get_request_id() == hold_req_id_) - { - last_transaction_status_ = rc; - delete t; - result_->result(this, rc); - } - else - { - rc = t->run(this); - if (rc < 0) - { - delete t; - result_->result(this, rc); - } - } -} - -int Snmp::validate_args(const Pdu& pdu, const UdpTarget& target) const -{ - // 0. check object status - if (construct_status_ != SNMP_CLASS_SUCCESS) - return construct_status_; - - // 1. check args passed - if ( !pdu.valid() || !target.valid() ) - return SNMP_INVALID_ARGS; - return 0; -} - -// SYNC API: write request to wire then wait for reply or timeout -int Snmp::get( Pdu &pdu, UdpTarget &target, Snmp_Result * cb) -{ - ACE_TRACE("Snmp::get"); - int rc; - if ((rc = validate_args(pdu, target)) != 0) - return rc; - - pdu.set_type( sNMP_PDU_GET); - check_default_port(target); - return run_transaction(pdu, target, cb); -} - -int Snmp::get_next( Pdu &pdu, UdpTarget &target, Snmp_Result * cb) -{ - ACE_TRACE("Snmp::get_next"); - int rc; - if ((rc = validate_args(pdu, target)) != 0) - return rc; - - pdu.set_type( sNMP_PDU_GETNEXT); - check_default_port(target); - return run_transaction(pdu, target, cb); -} - -int Snmp::set( Pdu &pdu, UdpTarget &target, Snmp_Result * cb) -{ - ACE_TRACE("Snmp::set"); - int rc; - if ((rc = validate_args(pdu, target)) != 0) - return rc; - - pdu.set_type( sNMP_PDU_SET); - check_default_port(target); - return run_transaction(pdu, target, cb); -} - -// one way, best of luck, non-confirmed alert -int Snmp::trap( Pdu &pdu, UdpTarget &target) -{ - ACE_TRACE("Snmp::trap"); - int rc; - if ((rc = validate_args(pdu, target)) != 0) - return rc; - - pdu.set_type( sNMP_PDU_V1TRAP); - check_default_port(target, DEF_TRAP_PORT); - - // 2. write request to agent - transaction trans(pdu, target, iv_snmp_session_); - if (trans.send() > 0) // expect number of bytes sent on - return 0; - - last_transaction_status_ = SNMP_CLASS_INTERNAL_ERROR; - return -1; -} - -// Allow host name to be overriden. Supplying a null pointer or zero -// length string removes the override. -void Snmp::override_host_name(const char* name) -{ - if (name) - { - ACE_OS::strncpy(host_name_, name, MAXHOSTNAMELEN); - host_name_[MAXHOSTNAMELEN-1] = 0; - } - else { - host_name_[0] = 0; - } -} - -// Returns the current host name in the supplied string. -void Snmp::get_host_name(char* name, int len) -{ - if (name) - { - if (ACE_OS::strlen(host_name_) > 0) - { - ACE_OS::strncpy(name, host_name_, len); - name[len-1] = 0; - } - else - { - if (ACE_OS::hostname(name, len-1) == -1) - name[0] = 0; - } - } -} - -Snmp_Result::~Snmp_Result() {} diff --git a/ASNMP/asnmp/snmp.h b/ASNMP/asnmp/snmp.h deleted file mode 100644 index d57a9711324..00000000000 --- a/ASNMP/asnmp/snmp.h +++ /dev/null @@ -1,134 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef SNMP_CLS_ -#define SNMP_CLS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// snmp.h -// -// = DESCRIPTION -// SNMP class defintion. The Snmp class provides an object oriented -// approach to SNMP. The SNMP class is an encapsulation of SNMP -// sessions, gets, sets, etc. The class manages all SNMP -// resources and provides complete retry and timeout capability. -// -// = AUTHOR -// Peter E Mellquist design, first implementation -// Michael R. MacFaden port to ACE / use Reactor pattern -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "ace/Reactor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SOCK_Dgram.h" - -#include "asnmp/oid.h" // snmp++ oid class -#include "asnmp/vb.h" // snbmp++ vb class -#include "asnmp/target.h" // snmp++ target class -#include "asnmp/pdu.h" // snmp++ pdu class -#include "asnmp/snmperrs.h" // error macros and strings -#include "asnmp/address.h" // snmp++ address class defs -#include "asnmp/transaction_result.h" - -class Snmp; -class ACE_Export Snmp_Result -{ - public: - virtual ~Snmp_Result(); - virtual void result(Snmp *snmp, int result) = 0; -}; - -// Snmp session class - supports Version 1 operations in blocking mode -class ACE_Export Snmp : public transaction_result - // = TITLE - // Concrete class Snmp defined the session and interface to - // communicate with another SNMP Version 1 agent -{ - Snmp_Result * result_; - Pdu * pdu_; - unsigned hold_req_id_; - public: - Snmp(unsigned short port = INADDR_ANY); - virtual ~Snmp(); - - int get( Pdu &pdu, UdpTarget &target, Snmp_Result * cb = 0); - // retrieve data from a peer agent for a given list of oid values - // default port 161 - - int get_next( Pdu &pdu, UdpTarget &target, Snmp_Result * cb = 0); - // retrieve data lexically adjacent to the oids specified in the pdu - // from the peer agent - // default port 161 - - int set( Pdu &pdu, UdpTarget &target, Snmp_Result * cb = 0); - // set data in the agent from the list of oids in the pdu - // default port 161 - - int trap( Pdu &pdu, UdpTarget &target); - // send an SNMPv1 trap (unreliable) to a remote system (def port 162) - - int valid() const; - // status of object after construction - - static char * error_string(int code); - // given error code, return string reason - - char * error_string(); - // retrieve a reason string if any of the above commands fail - - void result(transaction * t, int rc); - // for async transaction results - - static void override_host_name(const char* name); - // allow the host name to be overriden - - static void get_host_name(char* name, int len); - // returns the overriden host name - - protected: - void check_default_port(UdpTarget& target,unsigned short port=DEF_AGENT_PORT); - int run_transaction(Pdu& pdu, UdpTarget& target); - int run_transaction(Pdu& pdu, UdpTarget& target, Snmp_Result * cb); - int validate_args(const Pdu& pdu, const UdpTarget& target) const; - - Snmp(const Snmp&); - - ACE_SOCK_Dgram iv_snmp_session_; - // io object - - int construct_status_; - // status of construction - - int last_transaction_status_; - // result code from last transaction - - unsigned req_id_; - // transaction request id - - static char host_name_[MAXHOSTNAMELEN]; -}; - -#endif //SNMP_CLS_ diff --git a/ASNMP/asnmp/snmperrs.h b/ASNMP/asnmp/snmperrs.h deleted file mode 100644 index bd7a5e9df56..00000000000 --- a/ASNMP/asnmp/snmperrs.h +++ /dev/null @@ -1,214 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef SNMPERRS_H_ -#define SNMPERRS_H_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// snmperrs.h -// -// = DESCRIPTION -// Definition of error macros and error strings -// -// = AUTHOR -// Jeff Meyer -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -============================================================================*/ - - -//-------[ Positive ASNMP Error Return Codes ]------------------------------ -// These values are error status values from RFC 1905 -// -// The values can be returned via Pdu::get_error_status() -// -#define SNMP_ERROR_SUCCESS 0 // Success Status -#define SNMP_ERROR_TOO_BIG 1 // Pdu encoding too big -#define SNMP_ERROR_NO_SUCH_NAME 2 // No such VB name, see error index -#define SNMP_ERROR_BAD_VALUE 3 // Bad Vb -#define SNMP_ERROR_READ_ONLY 4 // VB is read only, see error index -#define SNMP_ERROR_GENERAL_VB_ERR 5 // General VB error, see error index -#define SNMP_ERROR_NO_ACCESS 6 // No access to MIBs data -#define SNMP_ERROR_WRONG_TYPE 7 // Requested type was incorrect -#define SNMP_ERROR_WRONG_LENGTH 8 // Request Pdu has inccorect length -#define SNMP_ERROR_WRONG_ENCODING 9 // Request Pdu has wrong encoding -#define SNMP_ERROR_WRONG_VALUE 10 // Request Pdu has wrong value -#define SNMP_ERROR_NO_CREATION 11 // Unable to create object specified -#define SNMP_ERROR_INCONSIST_VAL 12 // Inconsistent value in request -#define SNMP_ERROR_RESOURCE_UNAVAIL 13 // Resources unavailable -#define SNMP_ERROR_COMITFAIL 14 // Unable to comit -#define SNMP_ERROR_UNDO_FAIL 15 // Unable to undo -#define SNMP_ERROR_AUTH_ERR 16 // Authentication failure -#define SNMP_ERROR_NOT_WRITEABLE 17 // Mib Object not writeable -#define SNMP_ERROR_INCONSIS_NAME 18 // Inconsistent naming used - - -//-------[ Negative ASNMP Result/Error Return Codes ]------------------- - -// General -#define SNMP_CLASS_SUCCESS 0 // success -#define SNMP_CLASS_ERROR -1 // general error -#define SNMP_CLASS_RESOURCE_UNAVAIL -2 // e.g., malloc failed -#define SNMP_CLASS_INTERNAL_ERROR -3 // unexpected / internal error -#define SNMP_CLASS_UNSUPPORTED -4 // unsupported function - -// Callback reasons: -#define SNMP_CLASS_TIMEOUT -5 // outstanding request timed out -#define SNMP_CLASS_ASYNC_RESPONSE -6 // received response for outstd request -#define SNMP_CLASS_NOTIFICATION -7 // received notification (trap/inform) -#define SNMP_CLASS_SESSION_DESTROYED -8 // snmp::destroyed with oustanding reqs pending - -// Snmp Class: -#define SNMP_CLASS_INVALID -10 // snmp::mf called on invalid instance -#define SNMP_CLASS_INVALID_PDU -11 // invalid pdu passed to mf -#define SNMP_CLASS_INVALID_TARGET -12 // invalid target passed to mf -#define SNMP_CLASS_INVALID_CALLBACK -13 // invalid callback to mf -#define SNMP_CLASS_INVALID_REQID -14 // invalid request id to cancel -#define SNMP_CLASS_INVALID_NOTIFYID -15 // missing trap/inform oid -#define SNMP_CLASS_INVALID_OPERATION -16 // snmp operation not allowed for specified target -#define SNMP_CLASS_INVALID_OID -17 // invalid oid passed to mf -#define SNMP_CLASS_INVALID_ADDRESS -18 // invalid address passed to mf -#define SNMP_CLASS_ERR_STATUS_SET -19 // agent returned response pdu with error_status set - -// Transport Errors: -#define SNMP_CLASS_TL_UNSUPPORTED -20 // transport unsupported -#define SNMP_CLASS_TL_IN_USE -21 // transport in use -#define SNMP_CLASS_TL_FAILED -22 // transport operation failed - -// extras -#define SNMP_CLASS_SHUTDOWN -23 // used for back door shutdown -#define SNMP_INVALID_ARGS -24 // invalid args passed - -#ifdef INCLUDE_SNMP_ERR_STRINGS_ - -// ASCII strings returned through Snmp::error() function. NOTE: altering -// the strings in this header file will not affect the return values of -// Snmp::error(), unless you rebuild the ASNMP library from source. - -#define MAX_POS_ERROR SNMP_ERROR_INCONSIS_NAME -#define MAX_NEG_ERROR SNMP_CLASS_SHUTDOWN - -static char * pErrs[] = { - "Success", // 0 - "SNMP: Response PDU Too Big", // 1 - "SNMP: Variable does not exist", // 2 - "SNMP: Cannot modify variable: Bad Value", // 3 - "SNMP: Cannot modify object, Read Only", // 4 - "SNMP: Cannot perform operation, General Error", // 5 - "SNMP: Cannot access variable, No Access", // 6 - "SNMP: Cannot create/modify variable, Wrong Type", // 7 - "SNMP: Cannot create/set variable, Wrong Length", // 8 - "SNMP: Cannot create/set variable, Wrong Encoding", // 9 - "SNMP: Cannot create/set variable, Wrong Value", // 10 - "SNMP: Cannot create variable, Creation Not Allowed", // 11 - "SNMP: Cannot create/set variable, Inconsistent Value", // 12 - "SNMP: Cannot create/set variable, Resource Unavailable", // 13 - "SNMP: Cannot create/set variable, Commit Failed", // 14 - "SNMP: Cannot create/set variable, Undo Failed", // 15 - "SNMP: Cannot perform operation, Authorization Error", // 16 - "SNMP: Cannot create/set variable, Not Writable", // 17 - "SNMP: Cannot create variable, Inconsistent Name", // 18 -}; - - -static char * nErrs[] = { - // General: - // 0 SNMP_CLASS_SUCCESS - "ASNMP: Success", - - // 1 SNMP_CLASS_ERROR - "ASNMP: Operation failed", - - // 2 SNMP_CLASS_RESOURCE_UNAVAIL - "ASNMP: Resource unavailable", - - // 3 SNMP_CLASS_INTERNAL_ERROR - "ASNMP: Internal error", - - // 4 SNMP_CLASS_UNSUPPORTED - "ASNMP: Unsupported function", - - // Callback reasons: - // 5 SNMP_CLASS_TIMEOUT - "ASNMP: SNMP request timed out", - - // 6 SNMP_CLASS_ASYNC_RESPONSE - "ASNMP: Received SNMP Response", - - // 7 SNMP_CLASS_NOTIFICATION - "ASNMP: Received SNMP Notification (trap or inform)", - - // 8 SNMP_CLASS_SESSION_DESTROYED - "ASNMP: Closing session with outstanding requests", - - // 9 reserved for future - "Unknown error code", - - // Snmp Class errors: - // 10 SNMP_CLASS_INVALID - "ASNMP: Class not valid", - - // 11 SNMP_CLASS_INVALID_PDU - "ASNMP: Invalid Pdu", - - // 12 SNMP_CLASS_INVALID_TARGET - "ASNMP: Invalid Target", - - // 13 SNMP_CLASS_INVALID_CALLBACK - "ASNMP: Invalid (null) Callback Function", - - // 14 SNMP_CLASS_INVALID_REQID - "ASNMP: Invalid Request Id", - - // 15 SNMP_CLASS_INVALID_NOTIFYID - "ASNMP: Invalid Notification Id", - - // 16 SNMP_CLASS_INVALID_OPERATION - "ASNMP: SNMP Operation not supported on specified Target", - - // 17 SNMP_CLASS_INVALID_OID - "ASNMP: Invalid Object Identifier", - - // 18 SNMP_CLASS_INVALID_ADDRESS - "ASNMP: Invalid Address", - - // 19 SNMP_CLASS_ERR_STATUS_SET - "ASNMP: Agent indicates error in SNMP request", - - // Transport Errors: - // 20 SNMP_CLASS_TL_UNSUPPORTED - "ASNMP: Transport is not supported", - - // 21 SNMP_CLASS_TL_IN_USE - "ASNMP: Transport is in use", - - // 22 SNMP_CLASS_TL_FAILED - "ASNMP: Transport operation failed", - - // 23 SNMP_CLASS_SHUTDOWN - "ASNMP: Blocked Mode Shutdown", - - // unknown error code - "Unknown error code", -}; - -#endif //INCLUDE_SNMP_ERR_STRINGS_ - -#endif //SNMPERRS_H_ diff --git a/ASNMP/asnmp/target.cpp b/ASNMP/asnmp/target.cpp deleted file mode 100644 index c9e27865f31..00000000000 --- a/ASNMP/asnmp/target.cpp +++ /dev/null @@ -1,324 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// target.cpp -// -// = DESCRIPTION -// Target class defines target SNMP agents. -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. - =====================================================================*/ - -#include "asnmp/target.h" - -ACE_RCSID(asnmp, target, "$Id$") - -//---------------------------------------------------------------------- -//--------[ Class default values ]---------------------- -//---------------------------------------------------------------------- -u_long SnmpTarget::default_timeout_ = DEF_TIMEOUT; -int SnmpTarget::default_retries_ = DEF_RETRIES; -u_long SnmpTarget::default_max_pdu_size_ = DEF_MAX_SNMP_PACKET; -snmp_version SnmpTarget::default_version_ = version1; - -OctetStr UdpTarget::default_rd_community_(READ_COMM_STR); -OctetStr UdpTarget::default_wr_community_(WRITE_COMM_STR); - -//---------------------------------------------------------------------- -//--------[ Abstract SnmpTarget Member Functions ]---------------------- -//---------------------------------------------------------------------- -SnmpTarget::SnmpTarget(): - validity_(0), timeout_(default_timeout_), retries_(default_retries_), - max_pdu_size_(default_max_pdu_size_), version_(default_version_) -{ -} - -// return validity of target -int SnmpTarget::valid() const -{ - return validity_; -} - -// allow destruction of derived classes -SnmpTarget::~SnmpTarget() -{ -} - -// set the timeout -void SnmpTarget::set_timeout( const u_long t) -{ - timeout_ = t; -} - -// change the default timeout -void SnmpTarget::set_default_timeout( const u_long t) -{ - default_timeout_ = t; -} - -// set the retry value -void SnmpTarget::set_retry( const int r) -{ - retries_ = r; -} - -// change the default retries -void SnmpTarget::set_default_retry( const int r) -{ - default_retries_ = r; -} - -void SnmpTarget:: set_max_pdu_size(const u_long max_pdu_sz) -{ - max_pdu_size_ = max_pdu_sz; -} - - -void SnmpTarget::set_default_max_pdu_size(const u_long max_pdu_sz) -{ - default_max_pdu_size_ = max_pdu_sz; -} - -void SnmpTarget::set_version( const snmp_version v) -{ - version_ = v; -} - -void SnmpTarget::set_default_version( const snmp_version v) -{ - default_version_ = v; -} - -snmp_version SnmpTarget::get_version() const -{ - return version_; -} - -snmp_version SnmpTarget::get_default_version() const -{ - return default_version_; -} - -u_long SnmpTarget::get_max_pdu_size() const -{ - return max_pdu_size_; -} - -// get the retry value -int SnmpTarget::get_retry() const -{ - return retries_; -} - -// get the retry value -int SnmpTarget::get_default_retry() const -{ - return default_retries_; -} - -// get the timeout -u_long SnmpTarget::get_timeout() const -{ - return timeout_; -} - -SnmpTarget& SnmpTarget::operator=(const SnmpTarget& lhs) -{ - if (this == &lhs) - return *this; - - validity_ = lhs.validity_; - timeout_ = lhs.timeout_; - retries_ = lhs.retries_; - max_pdu_size_ =lhs.max_pdu_size_; - version_ = lhs.version_; - return *this; -} - -int operator==(const SnmpTarget& lhs, const SnmpTarget& rhs) -{ - if (lhs == rhs) - return 1; - - if (lhs.timeout_ != rhs.timeout_) - return 0; - - if (lhs.retries_ != rhs.retries_) - return 0; - - if (lhs.max_pdu_size_ != rhs.max_pdu_size_) - return 0; - - if (lhs.version_ != rhs.version_) - return 0; - - return 1; -} - - -//---------------------------------------------------------------------- -//--------[ IpTarget Member Functions ]---------------------------------- -//---------------------------------------------------------------------- - - -//---------[ UdpTarget::UdpTarget( void) ]---------------------------------- - -UdpTarget::UdpTarget() -{ - validity_ = 0; - read_community_ = default_rd_community_; // assign by init fails - write_community_ = default_wr_community_; -} - -UdpTarget::UdpTarget(const UdpAddress& udp) : udp_address_(udp) -{ - if (udp_address_.valid()) - validity_ = 1; - read_community_ = default_rd_community_; - write_community_ = default_wr_community_; -} - -// - copy constructor can be synthesised by compiler - -//-----------[ UdpTarget::~UdpTarget() ]-------------------------------- -UdpTarget::~UdpTarget() -{ -} - -//-----------[ UdpTarget::clone() ]-------------------------------- -SnmpTarget * UdpTarget::clone() const -{ - return (SnmpTarget *) new UdpTarget(*this); -} - - -void UdpTarget::set_default_read_community(const OctetStr& rd_community) -{ - default_rd_community_ = rd_community; -} - -void UdpTarget::set_default_write_community(const OctetStr& wr_community) -{ - default_wr_community_ = wr_community; -} - - -// get the read community name as an u_char and len -void UdpTarget::get_read_community( OctetStr& read_community_oct) const -{ - read_community_oct = read_community_; -} - -//---------[ UdpTarget::set_getcommunity ]--------------------------------- -// set the read community name -void UdpTarget::set_read_community( const OctetStr& new_read_community) -{ - read_community_ = new_read_community; -} - -//---------[ UdpTarget::get_writecommunity ]---------------------------- -// get the write community -void UdpTarget::get_write_community( OctetStr &write_community_oct) const -{ - write_community_oct = write_community_; -} - -//-----------[ UdpTarget::set_writecommunity ]--------------------------- -// set the write community -void UdpTarget::set_write_community( const OctetStr& write_community_oct) -{ - write_community_ = write_community_oct; -} - -//------------[ Address& UdpTarget::get_address() ]--------------------- -// get the address -void UdpTarget::get_address( UdpAddress &address) const -{ - address = udp_address_; - return; -} - -//-------------[ UdpTarget::set_address ]-------------------------------- -// set the address -int UdpTarget::set_address( UdpAddress &udp_address) -{ - udp_address_ = udp_address; - if ( udp_address_.valid()) - validity_ = 1; - else - validity_ = 0; - - return validity_; -} - -// overloaded assignment -UdpTarget& UdpTarget::operator=( const UdpTarget& lhs) -{ - if (this == &lhs) - return *this; - - // assign base part - *((SnmpTarget *) this) = *((SnmpTarget *)&lhs); - - udp_address_ = lhs.udp_address_; - read_community_ = lhs.read_community_; - write_community_ = lhs.write_community_; - validity_ = lhs.validity_; - - return *this; -} - -char *UdpTarget::to_string() -{ - sprintf(output_buffer_,"UdpTarget: [ valid: %d addr: %s rd: %s wr: %s \ -ver: %d, timeout: %d, retries: %d max_pdu_size: %d]", - valid(), udp_address_.to_string(), read_community_.to_string(), - write_community_.to_string(), version_, (int) timeout_, - retries_, max_pdu_size_); - return output_buffer_; -} - -//=============[ int operator == UdpTarget, UdpTarget ]=============== -// equivlence operator overloaded -int operator==( const UdpTarget &lhs,const UdpTarget &rhs) -{ - // need to compare all the members of a UdpTarget - if ( lhs.read_community_ != rhs.read_community_) - return 0; // != - - if ( lhs.write_community_ != rhs.write_community_) - return 0; // != - - if ( lhs.udp_address_ != rhs.udp_address_) - return 0; - - if ( lhs.timeout_ != rhs.timeout_) - return 0; - - if ( lhs.retries_ != rhs.retries_) - return 0; - - return 1; // they are equal -} diff --git a/ASNMP/asnmp/target.h b/ASNMP/asnmp/target.h deleted file mode 100644 index 7dfc14ab5d8..00000000000 --- a/ASNMP/asnmp/target.h +++ /dev/null @@ -1,252 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef TARGET_ -#define TARGET_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// target.h -// -// = DESCRIPTION -// -// = AUTHOR -// Peter E Mellquist -// Michael R. MacFaden (ported to ACE) -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS" without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -//----[ includes ]------------------------------------------------ -#include "ace/INET_Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "asnmp/address.h" -#include "asnmp/oid.h" -#include "asnmp/octet.h" - -//----[ enumerated types for SNMP versions ]------------------------- -enum snmp_version { - version1, // 0 - version2c, // 1 (Cisco IOS does not have IOS v2c agent available yet) - version3 // 2 (IETF working on this version) -}; - -// targets contain the following default properties -enum ASNMP_Defs { - DEF_TIMEOUT = 1, // unit: seconds - DEF_RETRIES = 1, // no retry default - DEF_MAX_SNMP_PACKET = 1430, // maximum pdu len on the wire (eth mtu-ip hdr) - // split bigger pdus (not implemented yet) - DEF_AGENT_PORT = 161, // port # for SNMP agent - DEF_TRAP_PORT = 162, // port # for SNMP trap receiver - DEF_VERSION = version1, // default SNMP version - MAX_COMM_STR_LEN = 255, // max value this impl will accept from client - MAX_TARGET_STRING_REP = 2048 // max value this impl will accept from client -}; - -#define READ_COMM_STR "public" -#define WRITE_COMM_STR "private" - -// Abstract class used to provide a virtual interface into Targets -// -class ACE_Export SnmpTarget - // = TITLE - // Abstract Base class SnmpTarget is used to Collect all transmission - // details to communicate with an SNMP -{ - public: - - virtual ~SnmpTarget(); - // allow destruction of derived classes - - int valid() const; - // return validity of target - - void set_retry( const int r); - // set the retry value - - void set_timeout( const unsigned long t); - // set the object's timeout (in seconds) - - void set_version( const snmp_version v); - // set the instance version - - void set_max_pdu_size(const unsigned long max_pdu_sz); - // all classes constructed will have this write community string - - void set_default_timeout( const unsigned long t); - // change the "class" default default timeout (in seconds) - - void set_default_retry( const int r); - // change the default send retries - - void set_default_max_pdu_size(const unsigned long max_pdu_sz); - // all classes constructed will have this write community string - - void set_default_version( const snmp_version v); - // change class default - - // *** get methods *** - - int get_default_retry() const; - // get the retry value - - unsigned long get_timeout() const; - // get the timeout (seconds) - - unsigned long get_max_pdu_size() const; - // get instance max buffer size - - void get_default_max_pdu_size(const unsigned long max_pdu_sz); - // all classes constructed will have this write community string - - snmp_version get_version() const; - // get the version - - snmp_version get_default_version() const; - - int get_retry() const; - // return send retry number for this instancd - - virtual SnmpTarget *clone() const = 0; - // virtual clone operation for creating a new SnmpTarget from an existing - // SnmpTarget. The caller MUST use the delete operation on the return - // value when done. - - friend int operator==(const SnmpTarget& lhs, const SnmpTarget& rhs); - // manipulate the base part - - SnmpTarget& operator=(const SnmpTarget& lhs); - - protected: - SnmpTarget(); - // SnmpTarget(const SnmpTarget &); - - int validity_; - // used by derived class instances - - unsigned long timeout_; - // instance value xmit timeout in milli secs - - int retries_; - // instance value number of retries - - unsigned max_pdu_size_; - // size of pdu - - snmp_version version_; - // instance value the snmp version - - // class wide default values - static unsigned long default_timeout_; - // xmit timeout in secs - - static int default_retries_; - // number of retries - - static unsigned long default_max_pdu_size_; - static snmp_version default_version_; - // snmp protocol version -}; - -//----[ UdpTarget class ]---------------------------------------------- -// UDP/IP transport using "community string" based agents (targets) -// -class ACE_Export UdpTarget: public SnmpTarget - // = TITLE - // Concrete class UdpTarget contains all Details for communicating - // with a SNMPv1 agent over UDP/IPv4 transport -{ - public: - UdpTarget(); - - UdpTarget( const UdpAddress& udp); - // constructor with only address - // assumes default as public, public - // can be constructed with IP address object - - UdpTarget( ACE_INET_Addr& ace_inet_addr); - // can be constructed with Udp address object TODO: merge addresses - - ~UdpTarget(); - // destructor - - // ** set *** - - void set_read_community( const OctetStr& new_read_community); - // set the read community using an OctetStr - - void set_write_community( const OctetStr& write_community); - // set the write community using an OctetStr - - int set_address( UdpAddress &udp_address); - // set the address - - // ** get *** - - void get_read_community( OctetStr& read_community_oct) const; - // get the read community as an Octet Str object - - void get_write_community( OctetStr &write_community_oct) const; - // get the write community as an OctetStr - - void get_address( UdpAddress& address) const; - // get the address - - void set_default_read_community(const OctetStr& rd_community); - // all classes constructed will have this read community string - - void set_default_write_community(const OctetStr& wr_community); - // all classes constructed will have this write community string - - void get_default_read_community(OctetStr& rd_community) const; - // all classes constructed will have this read community string - - void get_default_write_community(OctetStr& wr_community) const; - // all classes constructed will have this write community string - - UdpTarget& operator=( const UdpTarget& target); - // overloaded assignment - - friend int operator==( const UdpTarget &lhs, const UdpTarget &rhs); - // compare two C targets - - char *to_string(); - // string representation of object - - SnmpTarget *clone() const; - // clone from existing UdpTarget - - protected: - static OctetStr default_rd_community_; - static OctetStr default_wr_community_; - OctetStr read_community_; - OctetStr write_community_; - UdpAddress udp_address_; - snmp_version version_; - - char output_buffer_[MAX_TARGET_STRING_REP]; - // to_string() rep of data -}; - - -#endif //TARGET_ diff --git a/ASNMP/asnmp/timetick.cpp b/ASNMP/asnmp/timetick.cpp deleted file mode 100644 index 06fd025797f..00000000000 --- a/ASNMP/asnmp/timetick.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// timetick.cpp -// -// = DESCRIPTION -// Class implentation for SMI Timeticks class. -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/timetick.h" // include header file for timetick class - -ACE_RCSID(asnmp, timetick, "$Id$") - -// constructor with a value -TimeTicks::TimeTicks( const unsigned long i):SnmpUInt32(i) -{ - smival.syntax = sNMP_SYNTAX_TIMETICKS; -} - -// copy constructor -TimeTicks::TimeTicks( const TimeTicks &t) -{ - smival.value.uNumber = t.smival.value.uNumber; - smival.syntax = sNMP_SYNTAX_TIMETICKS; -} - -// destructor -TimeTicks::~TimeTicks() -{ -} - -// syntax type -SmiUINT32 TimeTicks::get_syntax() -{ - return sNMP_SYNTAX_TIMETICKS; -} - -// create a new instance of this Value -SnmpSyntax *TimeTicks::clone() const -{ - return (SnmpSyntax *) new TimeTicks(*this); -} - -// overloaded assignement from ulong -TimeTicks& TimeTicks::operator=( const unsigned long int i) -{ - smival.value.uNumber =i; return *this; -} - -// overloaded assignment from TimeTicks -TimeTicks& TimeTicks::operator=( const TimeTicks &uli) -{ - this->smival.value.uNumber = uli.smival.value.uNumber; return *this; -} - -// general assignment from any Value -SnmpSyntax& TimeTicks::operator=( SnmpSyntax &in_val) -{ - if ( this == &in_val ) // handle assignement from itself - return *this; - - valid_flag = 0; // will get set true if really valid - if (in_val.valid()) { - switch (in_val.get_syntax()) { - case sNMP_SYNTAX_UINT32: - // case sNMP_SYNTAX_GAUGE32: .. indistinquishable from UINT32 - case sNMP_SYNTAX_CNTR32: - case sNMP_SYNTAX_TIMETICKS: - case sNMP_SYNTAX_INT32: // implied cast int -> uint - this->smival.value.uNumber = - ((TimeTicks &)in_val).smival.value.uNumber; - valid_flag = 1; - break; - } - } - return *this; -} - -// otherwise, behave like an unsigned long -TimeTicks::operator unsigned long() -{ - return smival.value.uNumber; -} - - -// ASCII format return -char * TimeTicks::to_string() - /* Should do something nicer like days:hours:minutes... */ -{ - unsigned long tt, hseconds, seconds, minutes, hours, days; - tt = this->smival.value.uNumber; - - // days - days = tt / 8640000; - tt %= 8640000; - - // hours - hours = tt / 360000; - tt %= 360000; - - // minutes - minutes = tt / 6000; - tt %= 6000; - - seconds = tt / 100; - tt %= 100; - - hseconds = tt; - - if ( days ==0) - sprintf( output_buffer,"%ld:%02ld:%02ld.%02ld", hours, minutes,seconds,hseconds); - else if ( days==1) - sprintf( output_buffer,"1 day %ld:%02ld:%02ld.%02ld", hours, minutes,seconds,hseconds); - else - sprintf( output_buffer,"%ld days, %ld:%02ld:%02ld.%02ld", days,hours, minutes,seconds,hseconds); - - return output_buffer; -} diff --git a/ASNMP/asnmp/timetick.h b/ASNMP/asnmp/timetick.h deleted file mode 100644 index 8e4609c124b..00000000000 --- a/ASNMP/asnmp/timetick.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef TIMETICKS_ -#define TIMETICKS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// timetick.h -// -// = DESCRIPTION -// Class definition for SMI Timeticks class. -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/integer.h" - -#define TICKOUTBUF 30 // max formatted time string - -//------------[ TimeTicks Class ]----------------------------------- -// The timeticks class allows all the functionality of unsigned -// integers but is recognized as a distinct SMI type. TimeTicks -// objects may be get or set into Vb objects. -// -class ACE_Export TimeTicks: public SnmpUInt32 - // = TITLE - // Define RFC1155 TimeTicks Data object - -{ - - public: - TimeTicks( const unsigned long i = 0); - - TimeTicks( const TimeTicks &t); - // copy constructor - - ~TimeTicks(); - // destructor - - SmiUINT32 get_syntax(); - // syntax type - - char *to_string(); - // get a printable ASCII value - - SnmpSyntax *clone() const; - // create a new instance of this Value - - SnmpSyntax& operator=(SnmpSyntax &val); - // copy an instance of this Value - - TimeTicks& operator=( const TimeTicks &uli); - // overloaded assignment - - TimeTicks& operator=( const unsigned long int i); - // overloaded assignment - - operator unsigned long(); - // otherwise, behave like an unsigned long - - protected: - char output_buffer[TICKOUTBUF]; - // for storing printed form -}; -#endif // TIMETICKS_ diff --git a/ASNMP/asnmp/transaction.cpp b/ASNMP/asnmp/transaction.cpp deleted file mode 100644 index 4c22b0f51e4..00000000000 --- a/ASNMP/asnmp/transaction.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// transaction.cpp -// -// = DESCRIPTION -// implements blocking SNMPv1 API using a simple state machine -// transactions over UDP/IP networks -// -// = AUTHOR -// Michael R MacFaden mrm@cisco.com - remove v2c, async, rework for ACE -// ============================================================================ - -#include "ace/Reactor.h" -#include "asnmp/transaction.h" - -ACE_RCSID(asnmp, transaction, "$Id$") - -// pre: pdu, target report valid() == 1 -// post: pdu sent out over the wire -inline void reset_receive_buffer(iovec& io) -{ - io.iov_base = 0; - io.iov_len = 0; -} - -transaction::transaction(const Pdu& pdu, const UdpTarget& target, - ACE_SOCK_Dgram& io): - result_(0), - wp_(pdu,target), params_(target), session_(io) -{ - // last step, convert address (get ride of this once we have merged address - UdpAddress udp; - target.get_address(udp); - // via string conversion "dotted-quad:port" - ACE_INET_Addr tmp(udp); - addr_ = tmp; - reset_receive_buffer(receive_iovec_); -} - -transaction::~transaction() -{ - ACE_Reactor::instance()->remove_handler(this, READ_MASK | DONT_CALL); - ACE_Reactor::instance()->cancel_timer(this); - - delete [] receive_iovec_.iov_base; -} - -// implement state machine, send, wait (timeout/results) return -int transaction::run() -{ - int rc, done = 0; - int retry_counter = 0; - ACE_Time_Value to(params_.get_timeout(), 0); // seconds - ACE_Reactor reactor; - - // 1. register io port for read access - if (reactor.register_handler(session_.get_handle(), this, - ACE_Event_Handler::READ_MASK) == -1) - return SNMP_CLASS_INTERNAL_ERROR; - - // register a time handler and a socket with this - - while (!done) { - - if ((rc = send()) < 0) // send pkt to agent - return rc; - else { - if (retry_counter++ > params_.get_retry()) - return SNMP_CLASS_TIMEOUT; - } - - // 2. wait for events (timeout, returned msg) - if (( rc = reactor.handle_events (to)) == 1) // one handler registered - return 0; - else { - if (rc == 0) { - to.set(params_.get_timeout(), 0); - } - else - return SNMP_CLASS_INTERNAL_ERROR; - } - } - return SNMP_CLASS_INTERNAL_ERROR; -} - -// implement state machine, send, wait (timeout/results) return -int transaction::run(transaction_result * r) -{ - result_ = r; - int rc; - - // 1. register io port for read access - ACE_Reactor * reactor = ACE_Reactor::instance(); - if (reactor->register_handler(session_.get_handle(), - this, - READ_MASK) == -1) - return SNMP_CLASS_INTERNAL_ERROR; - - retry_counter_ = 0; - - // register a time handler and a socket with this - ACE_Time_Value to = params_.get_timeout(); - if (reactor->schedule_timer(this, 0, to, to) < 0) - return SNMP_CLASS_INTERNAL_ERROR; - - if ((rc = send()) < 0) // send pkt to agent - return rc; - return 0; -} - -// got back response from SNMPv1 agent - process it -int transaction::handle_input (ACE_HANDLE) -{ - // OS allocates iovec_.iov_base ptr and len - delete [] receive_iovec_.iov_base; - reset_receive_buffer(receive_iovec_); - int rc = session_.recv(&receive_iovec_, receive_addr_, 0); - if (rc == -1) { - delete [] receive_iovec_.iov_base; - reset_receive_buffer(receive_iovec_); - if (result_) - result_->result(this, SNMP_CLASS_RESOURCE_UNAVAIL); - return SNMP_CLASS_RESOURCE_UNAVAIL; - } - if (result_) - { - result_->result(this, rc); - return 0; - } - return rc; -} - -int transaction::handle_timeout(const ACE_Time_Value &, - const void *) -{ - int rc; - if ((rc = send()) < 0) // send pkt to agent - result_->result(this, 0); - else - if (retry_counter_++ > params_.get_retry()) - result_->result(this, SNMP_CLASS_TIMEOUT); - - return 0; -} - - -const ACE_INET_Addr& transaction::get_from_addr() const -{ - return receive_addr_; -} - - -// return pdu to caller -int transaction::result(Pdu& pdu, char *comm_str, ACE_INET_Addr *from) -{ - // TODO: check to see the sender matches the receiver address.. - - // remove any vbs existing in this pdu - pdu.delete_all_vbs(); - - // any data to return? - if (receive_iovec_.iov_len == 0) - return -1; - - wpdu tmp(receive_iovec_); - - snmp_version ver; - - // return comm str and from address of incomming pdu if requested - int rc = tmp.get_pdu(pdu, ver); - if (comm_str) - ACE_OS::strcpy(comm_str, (char *)tmp.get_community()); - if (from) - *from = receive_addr_; - return rc; -} - -transaction::transaction(ACE_SOCK_Dgram& io) -: result_(0), session_(io) -{ - reset_receive_buffer(receive_iovec_); -} - - -int transaction::send() -{ - iovec io = wp_.get_buffer(); - if (io.iov_len == 0) { - // NO DATA ? - return -1; - } - ssize_t rc = session_.send (io.iov_base, io.iov_len, addr_ , 0); - return rc; -} - -transaction_result::~transaction_result() {} diff --git a/ASNMP/asnmp/transaction.h b/ASNMP/asnmp/transaction.h deleted file mode 100644 index 4ded5f34e1b..00000000000 --- a/ASNMP/asnmp/transaction.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef TRANSACTION_ -#define TRANSACTION_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// transaction.h -// -// = DESCRIPTION -// -// = AUTHOR -// Michael R. MacFaden port to ACE / use Reactor pattern -// -// ============================================================================ - -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "asnmp/target.h" -#include "asnmp/pdu.h" -#include "asnmp/transaction_result.h" -#include "asnmp/wpdu.h" // cmu adapter class -#include "ace/SOCK_Dgram.h" - -class ACE_Export transaction : public ACE_Event_Handler - // = TITLE - // Used to manage the details of a particular transaction betwen - // two SNMP agents. Uses SnmpTarget class to implement retry/timeout - -{ - int retry_counter_; - transaction_result * result_; - - public: - transaction(const Pdu& pdu, const UdpTarget& target, ACE_SOCK_Dgram& io); - transaction(ACE_SOCK_Dgram& io); - // constructor - ~transaction(); - // destructor - - int run(); - int run(transaction_result *r); // Async interface, with callback object - // begin polling for values - - int result(Pdu& pdu, char *comm_str = 0, ACE_INET_Addr *from_addr = 0); - // return pdu with result from agent after run() is completed rc = 0 - // optionally get community str - - virtual int handle_input (ACE_HANDLE fd); - // called by reactor when data is ready to be read in from OS memory - virtual int handle_timeout (const ACE_Time_Value &, const void *); - // used for resend in asynchronous run() - - int send(); - // transmit buffer command to network... - - const ACE_INET_Addr& get_from_addr() const; - // pre: handle_input called - // retrieve the sender's from address from the last pkt - - private: - transaction(const transaction&); - // disallow copy construction - - wpdu wp_; // wire pdu - UdpTarget params_; // params - ACE_INET_Addr addr_; // to address - ACE_SOCK_Dgram session_; // io object - iovec receive_iovec_; // receive buffer - ACE_INET_Addr receive_addr_; // from address -}; - -#endif // TRANSACTION_ diff --git a/ASNMP/asnmp/transaction_result.h b/ASNMP/asnmp/transaction_result.h deleted file mode 100644 index 1c0472675ea..00000000000 --- a/ASNMP/asnmp/transaction_result.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef TRANSACTION_RESULT_H_ -#define TRANSACTION_RESULT_H_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// transaction_result.h -// -// = DESCRIPTION -// An object respresenting a request/reply operation between mgr/agent -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ - -class transaction; -class ACE_Export transaction_result -{ - public: - virtual ~transaction_result(); - virtual void result(transaction * trans, int) = 0; -}; - -#endif diff --git a/ASNMP/asnmp/vb.cpp b/ASNMP/asnmp/vb.cpp deleted file mode 100644 index ff9c22bb773..00000000000 --- a/ASNMP/asnmp/vb.cpp +++ /dev/null @@ -1,396 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// vb.h -// -// = DESCRIPTION -// The Vb class is an encapsulation of the snmp variable binding. -// This module contains the class definition for the variable binding (VB) -// class. The VB class is an encapsulation of a SNMP VB. A VB object is -// composed of one SNMP++ Oid and one SMI value. The Vb class utilizes Oid -// objects and thus requires the Oid class. To use this class, -// set oid, value then call valid() to be sure object was constructed correctly. -// -// = AUTHOR -// Peter E Mellquist -// Michael R MacFaden mrm@cisco.com - rework & ACE port -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/oid.h" // include oid class defs -#include "asnmp/vb.h" // include vb class defs -#include "asnmp/snmperrs.h" // error codes - -ACE_RCSID(asnmp, vb, "$Id$") - -//---------------[ Vb::Vb( void) ]-------------------------------------- -// constructor with no arguments -// makes an vb, unitialized -Vb::Vb( void): output_(0), iv_vb_value_(0), - exception_status_(SNMP_CLASS_SUCCESS) -{ -} - -//---------------[ Vb::Vb( const Oid &oid) ]----------------------------- -// constructor to initialize the oid -// makes a vb with oid portion initialized -Vb::Vb( const Oid &oid): output_(0), iv_vb_oid_(oid), iv_vb_value_(0), - exception_status_(SNMP_CLASS_SUCCESS) -{ -} - -//---------------[ Vb::Vb( const Oid &oid, const SmiSyntax &val) ]------- -Vb::Vb( const Oid &oid, const SnmpSyntax &val, const SmiUINT32 status): - output_(0), iv_vb_oid_(oid), iv_vb_value_(0), exception_status_(status) -{ - // iv_vb_value_ = recast_smi_object(val); // allocate and construct object - iv_vb_value_ = val.clone(); -} - -//---------------[ Vb::Vb( const Vb &vb) ]----------------------------- -// copy constructor -Vb::Vb( const Vb &vb): output_(0), iv_vb_value_(0) -{ - *this = vb; -} - -//---------------[ Vb::~Vb() ]------------------------------------------ -// destructor -// if the vb has a oid or an octect string then -// the associated memory needs to be freed -Vb::~Vb() -{ - free_vb(); - delete [] output_; // formatting buffer if it exists -} - - -//--------------[ Vb::valid() ]----------------------------------------- -// returns validity of a Vb object -// must have a valid oid and value -int Vb::valid() const -{ - if ( iv_vb_oid_.valid() && (iv_vb_value_ && iv_vb_value_->valid()) ) - return 1; - else - return 0; -} - - -//---------------[ Vb& Vb::operator=( const Vb &vb) ]-------------------- -// overloaded assignment allows assigning one Vb to another -// this involves deep memory thus target vb needs to be freed -// before assigning source -Vb& Vb::operator=( const Vb &vb) -{ - free_vb(); // free up target to begin with - - //-----[ reassign the Oid portion 1st ] - vb.get_oid( iv_vb_oid_); - - //-----[ next set the vb value portion ] - if (vb.iv_vb_value_ == 0) { - iv_vb_value_ = 0; - } - else { - iv_vb_value_ = vb.iv_vb_value_->clone(); - } - exception_status_ = vb.exception_status_; - - return *this; // return self reference -} - - // set a Vb null, if its not already -void Vb::set_null() -{ - free_vb(); -} - -//---------------[ Vb::set_oid( const Oid oid ) ]----------------------- -// set value oid only with another oid -void Vb::set_oid( const Oid& oid) -{ - iv_vb_oid_ = oid; -} - -//---------------[ Vb::get_oid( Oid &oid) ]----------------------------- -// get oid portion -void Vb::get_oid( Oid &oid) const -{ - oid = iv_vb_oid_; -} - -//----------------[ void Vb::free_vb() ]-------------------------------- -// protected method to free memory -// this methos is used to free memory when assigning new vbs -// or destructing -// in the case of oids and octets, we need to do a deep free -void Vb::free_vb() -{ - if (iv_vb_value_) - delete iv_vb_value_; - exception_status_ = SNMP_CLASS_SUCCESS; - iv_vb_value_ = 0; -} - -void Vb::set_value( const SnmpInt32& i) -{ - free_vb(); - iv_vb_value_ = (SnmpSyntax *)new SnmpInt32(i); -} - -void Vb::set_value( const SnmpUInt32& u) -{ - free_vb(); - iv_vb_value_ = (SnmpSyntax *)new SnmpUInt32(u); -} - -void Vb::set_value( const Gauge32& g) -{ - free_vb(); - iv_vb_value_ = (SnmpSyntax *)new Gauge32(g); -} - -void Vb::set_value( const Counter32& c) -{ - free_vb(); - iv_vb_value_ = (SnmpSyntax *)new Counter32(c); -} - -void Vb::set_value( const Counter64& c) -{ - free_vb(); - iv_vb_value_ = (SnmpSyntax *)new Counter64(c); -} - -void Vb::set_value( const TimeTicks& t) -{ - free_vb(); - iv_vb_value_ = (SnmpSyntax *)new TimeTicks(t); -} - -void Vb::set_value( const OctetStr& s) -{ - free_vb(); - iv_vb_value_ = (SnmpSyntax *)new OctetStr(s); -} - -void Vb::set_value( const Oid& o) -{ - free_vb(); - iv_vb_value_ = (SnmpSyntax *)new Oid(o); -} - -void Vb::set_value ( const SnmpSyntax &val) -{ - free_vb(); - iv_vb_value_ = val.clone(); -} - -int Vb::get_value( SnmpInt32 &i) -{ - if (iv_vb_value_ && - iv_vb_value_->valid() && - (iv_vb_value_->get_syntax() == sNMP_SYNTAX_INT32 )) { - i = *((SnmpInt32 *) iv_vb_value_); - return SNMP_CLASS_SUCCESS; - } - else - return SNMP_CLASS_INVALID; -} - -int Vb::get_value( SnmpUInt32 &u) -{ - if (iv_vb_value_ && iv_vb_value_->valid()) - { - SmiUINT32 syntax = iv_vb_value_->get_syntax(); - if (syntax == sNMP_SYNTAX_GAUGE32 || - syntax == sNMP_SYNTAX_CNTR32 || - syntax == sNMP_SYNTAX_TIMETICKS || - syntax == sNMP_SYNTAX_UINT32) - { - u = *((SnmpUInt32 *) iv_vb_value_); - return SNMP_CLASS_SUCCESS; - } - } - return SNMP_CLASS_INVALID; -} - -/* return a uint or a gauge. this is casting, but no semantic difference - * at this level - */ -int Vb::get_value( Gauge32 &g) -{ - if (iv_vb_value_ && - iv_vb_value_->valid() && - ((iv_vb_value_->get_syntax() == sNMP_SYNTAX_GAUGE32) || - iv_vb_value_->get_syntax() == sNMP_SYNTAX_UINT32) ) { - g = *((Gauge32 *) iv_vb_value_); - return SNMP_CLASS_SUCCESS; - } - else - return SNMP_CLASS_INVALID; -} - -int Vb::get_value( Counter32 &c) -{ - if (iv_vb_value_ && - iv_vb_value_->valid() && - (iv_vb_value_->get_syntax() == sNMP_SYNTAX_CNTR32 )) { - c = *((Counter32 *) iv_vb_value_); - return SNMP_CLASS_SUCCESS; - } - else - return SNMP_CLASS_INVALID; -} - -int Vb::get_value( Counter64 &c) -{ - if (iv_vb_value_ && - iv_vb_value_->valid() && - (iv_vb_value_->get_syntax() == sNMP_SYNTAX_CNTR64 )) { - c = *((Counter32 *) iv_vb_value_); - return SNMP_CLASS_SUCCESS; - } - else - return SNMP_CLASS_INVALID; -} - -int Vb::get_value( TimeTicks &t) -{ - if (iv_vb_value_ && - iv_vb_value_->valid() && - (iv_vb_value_->get_syntax() == sNMP_SYNTAX_TIMETICKS )) { - t = *((TimeTicks *) iv_vb_value_); - return SNMP_CLASS_SUCCESS; - } - else - return SNMP_CLASS_INVALID; -} - -int Vb::get_value( OctetStr &s) -{ - if (iv_vb_value_ && - iv_vb_value_->valid() && - (iv_vb_value_->get_syntax() == sNMP_SYNTAX_OCTETS )) { - s = *((OctetStr *) iv_vb_value_); - return SNMP_CLASS_SUCCESS; - } - else - return SNMP_CLASS_INVALID; -} - -int Vb::get_value( Oid &s) -{ - if (iv_vb_value_ && - iv_vb_value_->valid() && - (iv_vb_value_->get_syntax() == sNMP_SYNTAX_OID )) { - s = *((Oid *) iv_vb_value_); - return SNMP_CLASS_SUCCESS; - } - else - return SNMP_CLASS_INVALID; -} - - -//---------------[ Vb::get_value( Value &val) ]-------- -int Vb::get_value( SnmpSyntax &val) -{ - if (iv_vb_value_) { - val = *iv_vb_value_; - if (val.valid()) - return SNMP_CLASS_SUCCESS; - else - return SNMP_CLASS_INVALID; - } - else - { -//TM: should set val to be invalid - return SNMP_CLASS_INVALID; - } -} - - - -//-----[ misc]-------------------------------------------------------- - -// return the current syntax -// This method violates Object Orientation but may be useful if -// the caller has a vb object and does not know what it is. -// This would be useful in the implementation of a browser. -SmiUINT32 Vb::get_syntax() -{ - if ( exception_status_ != SNMP_CLASS_SUCCESS) - return exception_status_; - else - return ( iv_vb_value_ ? iv_vb_value_->get_syntax() : sNMP_SYNTAX_NULL); -} - -// return the printabel value -char *Vb::to_string_value() -{ - if (iv_vb_value_) - return iv_vb_value_->to_string(); - else - return ""; -} - -// return the printable oid -char *Vb::to_string_oid() -{ - return iv_vb_oid_.to_string(); -} - -// generate string with name/ value format -char *Vb::to_string() -{ - int len = ACE_OS::strlen(iv_vb_oid_.to_string()); - char *ptr = ""; - if (iv_vb_value_) - ptr = iv_vb_value_->to_string(); - len += ACE_OS::strlen(ptr) + 3 + 1; // " / " + null - ACE_NEW_RETURN(output_, char[len], ""); - ACE_OS::sprintf(output_, "%s / %s", iv_vb_oid_.to_string(), ptr); - return output_; -} - -// friend function to set exception status -void set_exception_status( Vb *vb, const SmiUINT32 status) -{ - vb->exception_status_ = status; -} - -// equivlence operator overloaded -// hack, by side effect, compare based on string formatting output_ -int operator==( const Vb &lhs, const Vb &rhs) -{ - if ( lhs.iv_vb_oid_ != rhs.iv_vb_oid_) - return 0; - - if (lhs.iv_vb_value_ != 0 && rhs.iv_vb_value_ != 0) { - int val = strcmp(lhs.iv_vb_value_->to_string(), - rhs.iv_vb_value_->to_string()); - return !val; - } - else - return 0; -} diff --git a/ASNMP/asnmp/vb.h b/ASNMP/asnmp/vb.h deleted file mode 100644 index dca6e7ae985..00000000000 --- a/ASNMP/asnmp/vb.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef VB_CLS_ -#define VB_CLS_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// vb.h -// -// = DESCRIPTION -// This module contains the class definition for the variable binding (VB) -// class. The VB class is an encapsulation of a SNMP VB. A VB object is -// composed of one SNMP++ Oid and one SMI value. The Vb class utilizes Oid -// objects and thus requires the Oid class. To use this class, -// set oid, value then call valid() to be sure object was constructed correctly. -// -// = AUTHOR -// Peter E Mellquist -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -//----[ external calls ]---------------------------------------------- -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "asnmp/smival.h" -#include "asnmp/snmperrs.h" // V2c error def -#include "asnmp/oid.h" // oid class def -#include "asnmp/timetick.h" // time ticks -#include "asnmp/counter.h" // counter -#include "asnmp/gauge.h" // gauge class -#include "asnmp/ctr64.h" // 64 bit counters -#include "asnmp/octet.h" // octet class -#include "asnmp/address.h" // address class def -#include "asnmp/integer.h" // integer class - - -//------------[ VB Class Def ]------------------------------------- -// The Vb class is the encapsulation of the SNMP variable binding. -// Variable binding lists in SNMP++ are represented as arrays of -// Vb objects. Vb objects are passed to and from SNMP objects to -// provide getting or setting MIB values. -// The vb class keeps its own memory for objects and does not -// utilize pointers to external data structures. -// -class ACE_Export Vb - // = TITLE - // Implement the concrete Variable Bindings aka Varbind - // composite type. Varbinds hold 1 Oid and 1 Value (Any SMI value) -{ -public: - Vb( void); - // constructor with no arguments - // makes an vb, unitialized (does not make object valid) - - Vb( const Oid &oid); - // constructor to initialize the oid - // makes a vb with oid portion initialized (does not make object valid) - - Vb( const Oid& vb, const SnmpSyntax &val, const SmiUINT32=SNMP_CLASS_SUCCESS); - // constructor to initialize the oid - // makes a vb with oid portion and value portion initialized, (valid) - - Vb( const Vb &vb); - // copy constructor - - ~Vb(); - // destructor - // if the vb has a oid or an octect string then - // the associated memory needs to be freed - - int valid() const; - // return validity of Vb object (both oid and value set return 1 else 0) - - Vb& operator=( const Vb &vb); - // assignment to another Vb object overloaded - - friend int operator==( const Vb &lhs, const Vb &rhs); - // equivlence operator overloaded - - //-----[ set oid / get oid part]------------------------------------------ - - void set_oid( const Oid& oid); - // set value oid only with another oid - - void get_oid( Oid &oid) const; - // get oid portion - - //-----[ set value part]-------------------------------------------------- - - void set_null(); - // set a Vb null, if its not already - - void set_value( const TimeTicks& ticks); - // returns 0 on success and a value - - void set_value( const Oid& oid); - // returns 0 on success and a value - - void set_value( const Counter32& ctr); - // returns 0 on success and a value - - void set_value( const Counter64& ctr); - // returns 0 on success and a value - - void set_value( const Gauge32& ctr); - // returns 0 on success and a value - - void set_value( const SnmpUInt32& ctr); - // returns 0 on success and a value - - void set_value( const SnmpInt32& ctr); - // returns 0 on success and a value - - void set_value( const OctetStr& oct_str); - // get an octet string object - - //----[ get value ]------------------------------------------------ - - int get_value( TimeTicks& ticks); - // returns 0 on success and a value - - int get_value( Oid& oid); - // returns 0 on success and a value - - int get_value( Counter32& ctr); - // returns 0 on success and a value - - int get_value( Counter64& ctr); - // returns 0 on success and a value - - int get_value( Gauge32& ctr); - // returns 0 on success and a value - - int get_value( SnmpUInt32& ctr); - // returns 0 on success and a value - - int get_value( SnmpInt32& ctr); - // returns 0 on success and a value - - int get_value( OctetStr& oct_str); - // get an octet string object - - // escape hatch - void set_value( const SnmpSyntax &val); - // for other derived types that can be casted - - int get_value( SnmpSyntax &val); - // gets a general value - - SmiUINT32 get_syntax(); - // return the current syntax - // Or.. if a V2 VB exception is present then return the exception value - - friend void set_exception_status( Vb *vb, const SmiUINT32 status); - // set the exception status - - char *to_string(); - // return fomatted version of this object - - char *to_string_value(); - // returns a formatted version of the value - - char *to_string_oid(); - // returns a formatted version of the value - -protected: - char *output_; - // display vb as [ oid / value ] - - Oid iv_vb_oid_; - // a vb is made up of a oid - - SnmpSyntax *iv_vb_value_; - // and a value... - - SmiUINT32 exception_status_; - // are there any vb exceptions?? - - void free_vb(); -}; - -#endif // VB_CLS_ - diff --git a/ASNMP/asnmp/wpdu.cpp b/ASNMP/asnmp/wpdu.cpp deleted file mode 100644 index 43c38d9a5e6..00000000000 --- a/ASNMP/asnmp/wpdu.cpp +++ /dev/null @@ -1,520 +0,0 @@ -// $Id$ - -// ============================================================================ -// = LIBRARY -// asnmp -// -// = FILENAME -// wpdu.cpp -// -// = DESCRIPTION -// Adapter class. Converts between raw wire format and Pdu objects -// that can be stuffed out a I/O port or reconstructed -// -// = AUTHOR -// Michael R. MacFaden rework the class api and impl using ACE -// Peter E Mellquist implementation/code from snmp++ snmpmsg class -// -// ============================================================================ - -#include "asnmp/wpdu.h" -#include - -#define DEFINE_TRAP_CONSTANTS_ -#include "asnmp/enttraps.h" - -ACE_RCSID(asnmp, wpdu, "$Id$") - -#define MAX_COMM_STR_LEN 255 -#define V1_COLD_START 0 -#define V1_WARM_START 1 -#define V1_LINK_DOWN 2 -#define V1_LINK_UP 3 -#define V1_AUTH_FAILURE 4 -#define V1_EGP_NEIGHBOR_LOSS 5 -#define V1_ENT_SPECIFIC 6 - -inline -void reset_iov(iovec& iov) -{ - iov.iov_base = 0; - iov.iov_len = 0; -} - -wpdu::wpdu(const Pdu& pdu, const UdpTarget& target): - valid_flag_(SNMP_CLASS_INVALID ), comm_len(MAX_COMM_STR_LEN) -{ - reset_iov(iovec_); - version_ = target.get_version(); - int status; - OctetStr comm_str; - - community_name[0] = 0; - - snmp_pdu *raw_pdu; // create a raw pdu - raw_pdu = cmu_snmp::pdu_create( (int) pdu.get_type()); - if (!raw_pdu) { - valid_flag_ = SNMP_CLASS_RESOURCE_UNAVAIL; - return; - } - - raw_pdu->reqid = pdu.get_request_id(); - raw_pdu->errstat= (unsigned long) pdu.get_error_status(); - raw_pdu->errindex= (unsigned long) pdu.get_error_index(); - - switch (raw_pdu->command) { - case sNMP_PDU_GET: - case sNMP_PDU_GETNEXT: - target.get_read_community(comm_str); - break; - - case sNMP_PDU_SET: - target.get_write_community(comm_str); - break; - - case sNMP_PDU_V1TRAP: - target.get_read_community(comm_str); - if (set_trap_info(raw_pdu, pdu)) // will free raw_pdu - return; - break; - case sNMP_PDU_RESPONSE: - break; - - default: - ACE_ASSERT(0); - return; - } - - if (load_vbs(raw_pdu, pdu)) { - cmu_snmp::free_pdu( raw_pdu); - valid_flag_ = SNMP_CLASS_RESOURCE_UNAVAIL; - return; - } - - // TODO: determine how big raw_pdu serializes out to - iovec_.iov_len = target.get_max_pdu_size(); - ACE_NEW(iovec_.iov_base, char [iovec_.iov_len]); - - // create raw byte stream - status = cmu_snmp::build( raw_pdu, - (unsigned char *)iovec_.iov_base, - (int *) &iovec_.iov_len, - target.get_version(), - comm_str.data(), comm_str.length()); - if ( status != 0) { - valid_flag_ = SNMP_ERROR_WRONG_ENCODING; - cmu_snmp::free_pdu( raw_pdu); - return; - } - - cmu_snmp::free_pdu( raw_pdu); - valid_flag_ = SNMP_CLASS_SUCCESS; -} - -int wpdu::set_trap_info(snmp_pdu *raw_pdu, const Pdu& pdu) const -{ - Oid enterprise; - Oid trapid; // validate caller has set this correctly - pdu.get_notify_id( trapid); - if ( !trapid.valid() || trapid.length() < 2 ) { - cmu_snmp::free_pdu( raw_pdu); - return SNMP_CLASS_INVALID_NOTIFYID; - } - - - raw_pdu->specific_type=0; - - // TODO: object should emit numeric instead of this kind of mess... - if ( trapid == coldStart) - raw_pdu->trap_type = V1_COLD_START; // cold start - else if ( trapid == warmStart) - raw_pdu->trap_type = V1_WARM_START; // warm start - else if( trapid == linkDown) - raw_pdu->trap_type = V1_LINK_DOWN; // link down - else if ( trapid == linkUp) - raw_pdu->trap_type = V1_LINK_UP; // link up - else if ( trapid == authenticationFailure ) - raw_pdu->trap_type = V1_AUTH_FAILURE; // authentication failure - else if ( trapid == egpNeighborLoss) - raw_pdu->trap_type = V1_EGP_NEIGHBOR_LOSS; // egp neighbor loss - else { - raw_pdu->trap_type = V1_ENT_SPECIFIC; // enterprise specific - // last oid subid is the specific value - // if 2nd to last subid is "0", remove it - // enterprise is always the notify oid prefix - raw_pdu->specific_type = (int) trapid[(int) (trapid.length() - 1)]; - trapid.trim(1); - if ( trapid[(int)(trapid.length() - 1)] == 0 ) - trapid.trim(1); - enterprise = trapid; - } - - if ( raw_pdu->trap_type != V1_ENT_SPECIFIC) - pdu.get_notify_enterprise( enterprise); - if ( enterprise.length() > 0) { - // note!! To the contrary, enterprise OID val is - // copied here and raw_pdu->enterprise is freed in free_pdu - // as it should be (HDN) - // these are hooks into an SNMP++ oid - // and therefor the raw_pdu enterprise - // should not free them. null them out!! - SmiLPOID rawOid; - rawOid = enterprise.oidval(); - // HDN - enterprise is a local object, cannot simply assign pointer - //raw_pdu->enterprise = rawOid->ptr; - raw_pdu->enterprise_length = (int) rawOid->len; - ACE_NEW_RETURN(raw_pdu->enterprise, - oid[raw_pdu->enterprise_length],-1); - ACE_OS::memcpy((char *)raw_pdu->enterprise,(char *)rawOid->ptr, - raw_pdu->enterprise_length * sizeof(oid)); - } - - TimeTicks timestamp; - pdu.get_notify_timestamp( timestamp); - raw_pdu->time = ( unsigned long) timestamp; - - // HDN - set agent addr using the local hostname if possible - char localHostName[MAXHOSTNAMELEN]; - Snmp::get_host_name(localHostName, MAXHOSTNAMELEN); - if (ACE_OS::strlen(localHostName) > 0) { - GenAddress addr(localHostName); - OctetStr octet; - addr.to_octet(octet); - ACE_OS::memcpy(&(raw_pdu->agent_addr.sin_addr), - octet.data(), - octet.length()); - } - - return 0; -} - -wpdu::wpdu(const iovec& iov): valid_flag_(0),comm_len(MAX_COMM_STR_LEN) -{ - community_name[0] = 0; - reset_iov(iovec_); - version_ = version1; // TODO: figure where this should come from - ACE_NEW(iovec_.iov_base, char[iov.iov_len]); - if (!iovec_.iov_base) { - valid_flag_ = SNMP_CLASS_RESOURCE_UNAVAIL; - return; - } - - copy_iovec(iovec_, iov); - valid_flag_ = SNMP_CLASS_SUCCESS; -} - -wpdu::wpdu(): valid_flag_(0), comm_len(MAX_COMM_STR_LEN) -{ - community_name[0] = 0; - reset_iov(iovec_); - version_ = version1; // TODO: figure where this should come from -} - -int wpdu::valid() const -{ - return (valid_flag_ == SNMP_CLASS_SUCCESS); -} - -int wpdu::load_vbs(snmp_pdu *raw_pdu, const Pdu& pdu) -{ - int status = 0; - - // load up the payload - // for all Vbs in list, add them to the pdu - int vb_count; - Vb tempvb; - Oid tempoid; - SmiLPOID smioid; - SmiVALUE smival; - - vb_count = pdu.get_vb_count(); - - for (int z = 0; z < vb_count; z++) { - pdu.get_vb( tempvb, z); - tempvb.get_oid( tempoid); - smioid = tempoid.oidval(); - // what are we trying to convert here (vb oid part or value part) - status = convert_vb_to_smival( tempvb, &smival ); - if ( status != SNMP_CLASS_SUCCESS) - return status; - - // add the var to the raw pdu - cmu_snmp::add_var(raw_pdu, smioid->ptr, (int) smioid->len, &smival); - free_smival_descriptor( &smival); - } - - return status; -} - -// supports overlapped copies -// static -void wpdu::copy_iovec(iovec& dest, const iovec& src) -{ - if (&dest == &src) - return; - - ACE_OS:: memmove( dest.iov_base, src.iov_base, src.iov_len); - dest.iov_len = src.iov_len; -} - -int wpdu::convert_vb_to_smival( Vb &tempvb, SmiVALUE *smival ) -{ - smival->syntax = tempvb.get_syntax(); - - switch ( smival->syntax ) { - - case sNMP_SYNTAX_NULL: - break; - - // case sNMP_SYNTAX_INT32: - case sNMP_SYNTAX_INT: - { - SnmpInt32 tmp; - tempvb.get_value(tmp); - smival->value.sNumber = tmp; - } - break; - - // case sNMP_SYNTAX_UINT32: - case sNMP_SYNTAX_GAUGE32: - case sNMP_SYNTAX_CNTR32: - case sNMP_SYNTAX_TIMETICKS: - { - SnmpUInt32 tmp; - tempvb.get_value(tmp); - smival->value.uNumber = tmp; - } - break; - - // case Counter64 - case sNMP_SYNTAX_CNTR64: - { - Counter64 c64; - tempvb.get_value(c64); - smival->value.hNumber.hipart = c64.high(); - smival->value.hNumber.lopart = c64.low(); - } - break; - - // OID syntax - case sNMP_SYNTAX_OID: - { - Oid tmpoid; - tmpoid.oidval(); - tempvb.get_value(tmpoid); - SmiLPOID smi = tmpoid.oidval(); - smival->value.oid.len = tmpoid.length(); - ACE_NEW_RETURN(smival->value.oid.ptr, - SmiUINT32 [smival->value.oid.len], 1); - ACE_OS::memcpy(smival->value.oid.ptr, smi->ptr, - smival->value.oid.len *sizeof(SmiUINT32)); - } - break; - - case sNMP_SYNTAX_BITS: - case sNMP_SYNTAX_OCTETS: - case sNMP_SYNTAX_IPADDR: - { - OctetStr os; - tempvb.get_value(os); - smival->value.string.ptr = 0; - smival->value.string.len = os.length(); - if ( smival->value.string.len > 0 ) { - ACE_NEW_RETURN(smival->value.string.ptr, - SmiBYTE [smival->value.string.len], 1); - if ( smival->value.string.ptr ) { - for (int i=0; i<(int) smival->value.string.len ; i++) - smival->value.string.ptr[i] = os[i]; - } - else { - smival->syntax = sNMP_SYNTAX_NULL; // invalidate the smival - return SNMP_CLASS_RESOURCE_UNAVAIL; - } - } - } - break; - - default: - ACE_DEBUG((LM_DEBUG, "wpdu::convert_vb_to_smival did not convert vb\n")); - // ACE_ASSERT(0); - } // switch - - return 0; -} - -// free a SMI value -void wpdu::free_smival_descriptor( SmiVALUE *smival ) -{ - switch ( smival->syntax ) { - case sNMP_SYNTAX_OCTETS: - case sNMP_SYNTAX_OPAQUE: - case sNMP_SYNTAX_IPADDR: - case sNMP_SYNTAX_BITS: // obsoleted in SNMPv2 Draft Std - delete [] smival->value.string.ptr; - break; - - case sNMP_SYNTAX_OID: - delete [] smival->value.oid.ptr; - break; - } - smival->syntax = sNMP_SYNTAX_NULL; -} - - -wpdu::~wpdu() -{ - delete [] iovec_.iov_base; -} - -const iovec& wpdu::get_buffer() const -{ - return iovec_; -} - -// return a pdu from a buffer -int wpdu::get_pdu(Pdu& pdu, snmp_version& version) -{ - if (iovec_.iov_len == 0) - return -1; // NO DATA - - snmp_pdu *raw_pdu; - raw_pdu = cmu_snmp::pdu_create(0); - if (!raw_pdu) { - return SNMP_CLASS_RESOURCE_UNAVAIL; - } - - // max value a client can send us - TODO: replace this with an - // api to get actual string length - int status = cmu_snmp::parse( raw_pdu, (unsigned char *)iovec_.iov_base, - community_name, comm_len, - version, iovec_.iov_len); - if (status != 0) - return SNMP_CLASS_INTERNAL_ERROR; - - community_name[comm_len] = 0; // set null based on returned length - set_request_id( &pdu, raw_pdu->reqid); - set_error_status( &pdu, (int) raw_pdu->errstat); - set_error_index( &pdu, (int) raw_pdu->errindex); - pdu.set_type( raw_pdu->command); - - if (restore_vbs(pdu, raw_pdu)) { - cmu_snmp::free_pdu(raw_pdu); - return SNMP_CLASS_INTERNAL_ERROR; - } - - cmu_snmp::free_pdu(raw_pdu); - return 0; -} - -int wpdu::restore_vbs(Pdu& pdu, const snmp_pdu *raw_pdu) const -{ - Vb tempvb; - Oid tempoid; - struct variable_list *vp; - - for(vp = raw_pdu->variables; vp; vp = vp->next_variable) { - - // extract the oid portion - tempoid.set_data( (unsigned long *)vp->name, - ( unsigned int) vp->name_length); - tempvb.set_oid( tempoid); - - // extract the value portion - switch(vp->type) { - - // octet string - case sNMP_SYNTAX_OCTETS: - case sNMP_SYNTAX_OPAQUE: - { - OctetStr octets( (char *) vp->val.string, - (long) vp->val_len); - tempvb.set_value( octets); - } - break; - - // object id - case sNMP_SYNTAX_OID: - { - Oid oid( (unsigned long*) vp->val.objid, - (int) vp->val_len); - tempvb.set_value( oid); - } - break; - - // timeticks - case sNMP_SYNTAX_TIMETICKS: - { - TimeTicks timeticks( (unsigned long) *(vp->val.integer)); - tempvb.set_value( timeticks); - } - break; - - // 32 bit counter - case sNMP_SYNTAX_CNTR32: - { - Counter32 counter32( (unsigned long) *(vp->val.integer)); - tempvb.set_value( counter32); - } - break; - - // ip address - case sNMP_SYNTAX_IPADDR: - { - char buffer[20]; - sprintf( buffer,"%d.%d.%d.%d", - vp->val.string[0], - vp->val.string[1], - vp->val.string[2], - vp->val.string[3]); - IpAddress ipaddress( buffer); - tempvb.set_value( ipaddress); - } - break; - - // 32 bit integer - case sNMP_SYNTAX_INT: - { - SnmpInt32 int32( (long) *(vp->val.integer)); - tempvb.set_value( int32); - } - break; - - // 32 bit unsigned integer - case sNMP_SYNTAX_UINT32: - { - SnmpUInt32 uint32( (unsigned long) *(vp->val.integer)); - tempvb.set_value( uint32); - } - break; - - // v2 counter 64's - case sNMP_SYNTAX_CNTR64: - break; - - case sNMP_SYNTAX_NULL: - tempvb.set_null(); - break; - - // v2 vb exceptions - case sNMP_SYNTAX_NOSUCHOBJECT: - case sNMP_SYNTAX_NOSUCHINSTANCE: - case sNMP_SYNTAX_ENDOFMIBVIEW: - set_exception_status( &tempvb, vp->type); - break; - - default: - tempvb.set_null(); - - } // end switch - - // append the vb to the pdu - pdu += tempvb; - } - - return 0; -} - -const unsigned char *wpdu::get_community() const -{ - return community_name; -} diff --git a/ASNMP/asnmp/wpdu.h b/ASNMP/asnmp/wpdu.h deleted file mode 100644 index a4d4bb1d0c1..00000000000 --- a/ASNMP/asnmp/wpdu.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -*-C++-*- */ -// $Id$ -#ifndef WPDU_H_ -#define WPDU_H_ -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// wpdu.h -// -// = DESCRIPTION -// Adapter class. Converts a Pdu and GenTarget into a format -// that can be stuffed out a I/O port -// -// = AUTHOR -// Michael R. MacFaden re-worked api, use ACE API -// Peter E Mellquist wrote original class snmpmsg -// -// ============================================================================ - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "asnmp/asn1.h" -#include "asnmp/pdu.h" -#include "asnmp/target.h" - -// this is an adapter class, it peforms the following transformations -// PDU / Target -> iovec buffer -// iovec buffer -> PDU / Target -struct snmp_pdu; -class ACE_Export wpdu - // = TITLE - // Implement an Adapter pattern between CMU SNMP and HP SNMP++ - // -{ -public: - - wpdu(const Pdu& pdu, const UdpTarget& target); - // construct CMU data from HP SNMP++ objects - wpdu(const iovec& buffer); - // construct HP SNMP++ objects from raw buffer via CMU SNMP datatypes - wpdu(); // same as using iovec? - - ~wpdu(); - - int valid() const; - // constructor completed ok? rc = 1 else 0 - - const iovec& get_buffer() const; - // return raw data stream via CMU code - - int get_pdu(Pdu& pdu, snmp_version& version); - // return HP SNMP++ pdu - - const unsigned char *get_community() const; - // return community strptr - -private: - int convert_vb_to_smival( Vb &tempvb, SmiVALUE *smival ); - int load_vbs(snmp_pdu *raw_pdu, const Pdu& pdu); - int restore_vbs(Pdu& pdu, const snmp_pdu *raw_pdu) const; - void free_smival_descriptor( SmiVALUE *smival ); - static void copy_iovec(iovec& dest, const iovec& src); - int set_trap_info(snmp_pdu *raw_pdu, const Pdu& pdu) const; - - iovec iovec_; - // raw format - - int valid_flag_; - // object construction state - - snmp_version version_; - // snmp version - - unsigned char community_name[MAX_COMM_STR_LEN]; - unsigned long comm_len; // = MAX_COMM_STR_LEN; -}; - -#endif // WPDU_H_ diff --git a/ASNMP/examples/Makefile b/ASNMP/examples/Makefile deleted file mode 100644 index 64ca08c687c..00000000000 --- a/ASNMP/examples/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -#---------------------------------------------------------------------------- -# -# $Id$ -# -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the ACE+SNMP examples directory -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -DIRS = get \ - next \ - set \ - trap \ - walk - -#---------------------------------------------------------------------------- -# macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nolocal.GNU diff --git a/ASNMP/examples/get/Makefile b/ASNMP/examples/get/Makefile deleted file mode 100644 index be0a6a633c7..00000000000 --- a/ASNMP/examples/get/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id$ -# -# Makefile for get application -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - - -# ACE+SNMP -BIN = get get_async -CCFLAGS = -I$(ACE_ROOT)/ASNMP/ -LSRC = $(addsuffix .cpp,$(BIN)) -LDLIBS := -L$(ACE_ROOT)/ASNMP/asnmp -lasnmp $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - - - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/ASNMP/examples/get/get.cpp b/ASNMP/examples/get/get.cpp deleted file mode 100644 index 5c05bd5eac5..00000000000 --- a/ASNMP/examples/get/get.cpp +++ /dev/null @@ -1,195 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// get.cpp -// -// = DESCRIPTION -// Sample application demonstrating synchronous Snmp::get API -// to access an SNMP Version 1 agent. -// -// = AUTHOR -// Peter E. Mellquist original code -// Michael R MacFaden mrm@cisco.com rework API/ACE integration -// -// ============================================================================ - -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/snmp.h" -#include "ace/Get_Opt.h" - -ACE_RCSID(get, get, "$Id$") - -// -// SNMPv1 Get Application -// -class getapp { - public: - getapp(int argc, char **argv); // process command line args - int valid() const; // verify transaction can proceed - int run(); // issue transaction - static void usage(); // operator help message - - private: - getapp(const getapp&); - - UdpAddress address_; - Pdu pdu_; // construct a request Pdu - Oid oid_; - OctetStr community_; - Snmp snmp_; - UdpTarget target_; - int valid_; -}; - - -// main entry point -int main( int argc, char *argv[]) -{ - getapp get(argc, argv); - if (get.valid()) - return get.run(); - else - getapp::usage(); - return 1; -} - -int getapp::valid() const -{ - return valid_; -} -getapp::getapp(int argc, char *argv[]): valid_(0) -{ - Oid req, def_oid("1.3.6.1.2.1.1.1.0"); // default is sysDescr - if ( argc < 2) - return; - - address_ = argv[argc - 1]; - if ( !address_.valid()) { - cout << "ERROR: Invalid IPv4 address or DNS hostname: " \ - << argv[argc] << "\n"; - return; - } - - ACE_Get_Opt get_opt (argc, argv, "o:c:r:t:p:"); - for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'o': - req = get_opt.optarg; - if (req.valid() == 0) - cout << "ERROR: oid value: " <run_event_loop(); - } - return 0; -} - -void getapp::result(Snmp *, int rc) -{ - Vb vb; - if (rc < 0) - { - char *ptr = snmp_.error_string(); - cout << "ASNMP:ERROR: get command failed reason: " << ptr << endl; - } else { - // check to see if there are any errors - if (pdu_.get_error_status()) { - cout << "ERROR: agent replied as follows\n"; - cout << pdu_.agent_error_reason() << endl; - } - else { - VbIter iter(pdu_); - while (iter.next(vb)) { - cout << "\tOid = " << vb.to_string_oid() << "\n"; - cout << "\tValue = " << vb.to_string_value() << "\n"; - } - } - } - cout << "\nASNMP:INFO: command completed normally.\n"<< endl; - ACE_Reactor::instance()->end_event_loop(); -} diff --git a/ASNMP/examples/next/Makefile b/ASNMP/examples/next/Makefile deleted file mode 100644 index 2d1aab308d6..00000000000 --- a/ASNMP/examples/next/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id$ -# -# Makefile for next sample application -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - - -# ACE+SNMP -BIN = next -CCFLAGS = -I$(ACE_ROOT)/ASNMP/ -LSRC = $(addsuffix .cpp,$(BIN)) - -LDLIBS := -L$(ACE_ROOT)/ASNMP/asnmp -lasnmp $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - - - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/ASNMP/examples/next/next.cpp b/ASNMP/examples/next/next.cpp deleted file mode 100644 index be550a567a9..00000000000 --- a/ASNMP/examples/next/next.cpp +++ /dev/null @@ -1,193 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// next.cpp -// -// = DESCRIPTION -// Sample application demonstrating synchronous Snmp::get_next API -// to access an SNMP Version 1 agent. -// -// = AUTHOR -// Peter E. Mellquist original code -// Michael R MacFaden mrm@cisco.com rework API/ACE integration -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/snmp.h" -#include "ace/Get_Opt.h" - -ACE_RCSID(next, next, "$Id$") - -// -// SNMPv1 Get Next Application -// -class nextapp { - public: - nextapp(int argc, char **argv); // process command line args - int valid() const; // verify transaction can proceed - int run(); // issue transaction - static void usage(); // operator help message - - private: - nextapp(const nextapp&); - - UdpAddress address_; - Pdu pdu_; // construct a request Pdu - Oid oid_; - OctetStr community_; - Snmp snmp_; - UdpTarget target_; - int valid_; -}; - - -// main entry point -int main( int argc, char *argv[]) -{ - nextapp get(argc, argv); - if (get.valid()) - return get.run(); - else - nextapp::usage(); - return 1; -} - -nextapp::valid() const -{ - return valid_; -} -nextapp::nextapp(int argc, char *argv[]): valid_(0) -{ - Oid req, def_oid("1.3.6.1.2.1.1.1.0"); // default is sysDescr - if ( argc < 2) - return; - - address_ = argv[argc - 1]; - if ( !address_.valid()) { - cout << "ERROR: Invalid IPv4 address or DNS hostname: " \ - << argv[argc] << "\n"; - return; - } - - ACE_Get_Opt get_opt (argc, argv, "o:c:r:t:"); - for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'o': - req = get_opt.optarg; - if (req.valid() == 0) - cout << "ERROR: oid value: " < - FIU: file descriptor 1: - FIU: file descriptor 2: - FIU: file descriptor 4: "/etc/.name_service_door", O_RDONLY - File info: ?r--r--r-- 1 root root 0 May 20 1997 - This file descriptor was allocated from: - _libc_open [libc.so.1] - _nsc_trydoorcall [libc.so.1] - _door_gethostbyname_r [gethostby_door.c] - _get_hostserv_inetnetdir_byname [netdir_inet.c] - gethostbyname_r [gethostbyname_r.c] - static ACE_OS::gethostbyname_r(const char*, hostent*, char*, int*) [OS.i:4634] - FIU: file descriptor 5: , O_RDWR - This file descriptor was allocated from: - pipe [rtlib.o] - static ACE_OS::pipe(int*) [OS.i:603] - ACE_Pipe::open(void) [Pipe.cpp:68] - ACE_Select_Reactor_Notify::open(ACE_Select_Reactor*) [Select_Reactor.cpp:648] - ACE_Select_Reactor::open(unsigned int, int, ACE_Sig_Handler*, ACE_Timer_Queue_T, ACE_Recursive_Thread_Mutex>*) [Select_Reactor.cpp:978] - ACE_Select_Reactor::ACE_Select_Reactor(ACE_Sig_Handler*, ACE_Timer_Queue_T, ACE_Recursive_Thread_Mutex>*) [Select_Reactor.cpp:1028] - FIU: file descriptor 6: , O_RDWR - This file descriptor was allocated from: - pipe [rtlib.o] - static ACE_OS::pipe(int*) [OS.i:603] - ACE_Pipe::open(void) [Pipe.cpp:68] - ACE_Select_Reactor_Notify::open(ACE_Select_Reactor*) [Select_Reactor.cpp:648] - ACE_Select_Reactor::open(unsigned int, int, ACE_Sig_Handler*, ACE_Timer_Queue_T, ACE_Recursive_Thread_Mutex>*) [Select_Reactor.cpp:978] - ACE_Select_Reactor::ACE_Select_Reactor(ACE_Sig_Handler*, ACE_Timer_Queue_T, ACE_Recursive_Thread_Mutex>*) [Select_Reactor.cpp:1028] - FIU: file descriptor 26: - FIU: file descriptor 27: - Memory leaked: 0 bytes (0%); potentially leaked: 0 bytes (0%) - Purify Heap Analysis (combining suppressed and unsuppressed blocks) - Blocks Bytes - Leaked 2 12 - Potentially Leaked 0 0 - In-Use 44 2237 - ---------------------------------------- - Total Allocated 46 2249 - Thread Summary : 4 threads in existence - Thread 0 [main thread] - Stack: (0xefe00000 0xf0000000), size = 0x200000 - Thread 1 - Stack: (0xee80fc70 0xee80fde4), size = 0x174 - Thread 2 - Stack: (0xef231a70 0xef231b14), size = 0xa4 - Thread 3 - Stack: (0xee70dba8 0xee70dde4), size = 0x23c - Program exited with status code 0. - * Basic memory usage (including Purify overhead): - 317744 code - 78528 data/bss - 66056 heap (peak use) - 2088 stack - * Shared library memory usage (including Purify overhead): - 356936 libasnmp.so_pure_p3_c0_410_551 (shared code) - 11488 libasnmp.so_pure_p3_c0_410_551 (private data) - 2632304 libACE.so_pure_p3_c0_410_551 (shared code) - 95524 libACE.so_pure_p3_c0_410_551 (private data) - 75058 libsocket.so.1_pure_p3_c0_410_551 (shared code) - 4092 libsocket.so.1_pure_p3_c0_410_551 (private data) - 1216 libdl.so.1_pure_p3_c0_410_551 (shared code) - 0 libdl.so.1_pure_p3_c0_410_551 (private data) - 611922 libnsl.so.1_pure_p3_c0_410_551 (shared code) - 115852 libnsl.so.1_pure_p3_c0_410_551 (private data) - 7628 libposix4.so.1_pure_p3_c0_410_551 (shared code) - 432 libposix4.so.1_pure_p3_c0_410_551 (private data) - 135301 libm.so.1_pure_p3_c0_410_551 (shared code) - 1332 libm.so.1_pure_p3_c0_410_551 (private data) - 278709 libC.so.5_pure_p3_c0_410_551 (shared code) - 59252 libC.so.5_pure_p3_c0_410_551 (private data) - 37893 libw.so.1_pure_p3_c0_410_551 (shared code) - 1628 libw.so.1_pure_p3_c0_410_551 (private data) - 2196 solaris2_threads.so_pure_p3_c0_410_551 (shared code) - 8556 solaris2_threads.so_pure_p3_c0_410_551 (private data) - 124186 libthread.so.1_pure_p3_c0_410_551 (shared code) - 100012 libthread.so.1_pure_p3_c0_410_551 (private data) - 799773 libc.so.1_pure_p3_c0_410_551 (shared code) - 34744 libc.so.1_pure_p3_c0_410_551 (private data) - 9576 libinternal_stubs.so.1 (shared code) - 324 libinternal_stubs.so.1 (private data) - 15117 libintl.so.1_pure_p3_c0_410_551 (shared code) - 1304 libintl.so.1_pure_p3_c0_410_551 (private data) - 16092 libmp.so.1_pure_p3_c0_410_551 (shared code) - 828 libmp.so.1_pure_p3_c0_410_551 (private data) - 14008 libc_psr.so.1_pure_p3_c0_410_551 (shared code) - 72 libc_psr.so.1_pure_p3_c0_410_551 (private data) - * Memory mapped usage: - 1048576 mmap'd at 0xee002000 - 1048576 mmap'd at 0xee104000 - 1048576 mmap'd at 0xee206000 - 1048576 mmap'd at 0xee308000 - 1048576 mmap'd at 0xee40a000 - 1048576 mmap'd at 0xee50c000 - 1048576 mmap'd at 0xee60e000 - 1048576 mmap'd at 0xee710000 - 8192 mmap'd PROT_NONE at 0xee000000 - 8192 mmap'd PROT_NONE at 0xee70e000 - 8192 mmap'd PROT_NONE at 0xee60c000 - 8192 mmap'd PROT_NONE at 0xee50a000 - 8192 mmap'd PROT_NONE at 0xee408000 - 8192 mmap'd PROT_NONE at 0xee306000 - 8192 mmap'd PROT_NONE at 0xee204000 - 8192 mmap'd PROT_NONE at 0xee102000 - diff --git a/ASNMP/examples/trap/trap.cpp b/ASNMP/examples/trap/trap.cpp deleted file mode 100644 index 13add3d4ea6..00000000000 --- a/ASNMP/examples/trap/trap.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// trap.cpp -// -// = DESCRIPTION -// Sample application demonstrating synchronous Snmp::trap API -// to send to an SNMP Version 1 trap listener app. -// -// = AUTHOR -// Peter E. Mellquist original code -// Michael R MacFaden mrm@cisco.com rework OO, API/ACE integration -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/snmp.h" -#define DEFINE_TRAP_CONSTANTS_ -#include "asnmp/enttraps.h" // enterprise standard traps -#include "ace/Get_Opt.h" - -ACE_RCSID(trap, trap, "$Id$") - -// -// SNMPv1 Trap Application -// -class trapapp { - public: - trapapp(int argc, char **argv); // process command line args - int valid() const; // verify transaction can proceed - int run(); // issue transaction - static void usage(); // operator help message - - private: - trapapp(const trapapp&); - - UdpAddress address_; - Pdu pdu_; // construct a request Pdu - Oid oid_; - OctetStr community_; - Snmp snmp_; - UdpTarget target_; - int valid_; -}; - - -// main entry point -int main( int argc, char *argv[]) -{ - trapapp get(argc, argv); - if (get.valid()) - return get.run(); - else - trapapp::usage(); - return 1; -} - -trapapp::valid() const -{ - return valid_; -} -trapapp::trapapp(int argc, char *argv[]): valid_(0) -{ - Oid def_ent_oid("1.3.6.1.2.1.1.1.2.0.1"); // def enterprise oid - Oid ent, trap; // user specified values - - if ( argc < 2) // hostname mandatory - return; - - address_ = argv[argc - 1]; - if ( !address_.valid()) { - cout << "ERROR: Invalid IPv4 address or DNS hostname: " \ - << argv[argc] << "\n"; - return; - } - - ACE_Get_Opt get_opt (argc, argv, "c:e:t:"); - for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'c': // community string - community_ = get_opt.optarg; - target_.set_read_community(community_); - break; - - case 'e': // trap oid to send - ent = get_opt.optarg; - break; - - case 't': // trap oid - trap = get_opt.optarg; - break;; - - default: - break; - } - - if (ent.valid()) - pdu_.set_notify_enterprise( ent); // set up the enterprise of the trap - else - pdu_.set_notify_enterprise( def_ent_oid); - - if (trap.valid()) - pdu_.set_notify_id( trap); // set the id of the trap - else - pdu_.set_notify_id( coldStart); // set the id of the trap - - Oid detail_oid("1.3.6.1.4.1.11.2.16.2"); - OctetStr detail_value("SNMP++ Trap Send Test"); - Vb vb(detail_oid, detail_value); - pdu_ += vb; - - pdu_.get_notify_id(oid_); // store for later use - valid_ = 1; -} - -void trapapp::usage() -{ - cout << "Usage:\n"; - cout << "trap [options] dotted-quad | DNSName[:port]\n"; - cout << " -c Community_name, default is 'public' \n"; - cout << " -r N retries default is N = 1 retry\n"; - cout << " -t N timeout in seconds default is 1 second" << endl; - cout << " -e oid enterprise oid default is 1.3.6.1.2.1.1.1.2.0.1\n"; - cout << " -O oid trap id default is coldStart 1.3.6.1.6.3.1.1.5.1\n"; -} - -int trapapp::run() -{ - if ( snmp_.valid() != SNMP_CLASS_SUCCESS) { - cout << "\nASNMP:ERROR:Create session failed: "<< - snmp_.error_string()<< "\n"; - return 1; - } - - if (address_.get_port() == 0) - address_.set_port(DEF_TRAP_PORT); - target_.set_address( address_); // make a target using the address - - //-------[ issue the request, blocked mode ]----------------------------- - cout << "\nASNMP:INFO:SNMP Version " << (target_.get_version()+ 1) << \ - " TRAP GENERATOR SAMPLE PROGRAM \nOID: " << oid_.to_string() << "\n"; - target_.get_address(address_); // target updates port used - int rc; - char *name = address_.resolve_hostname(rc); - if (rc) - name = "<< did not resolve via gethostbyname() >>"; - - cout << "Device: " << address_ << " " << name << "\n"; - cout << "[ Community=" << community_.to_string() << " ]"<< endl; - - if (snmp_.trap( pdu_, target_) == SNMP_CLASS_SUCCESS) { - cout << "Trap was written to network...\n"; - } - else { - char *ptr = snmp_.error_string(); - cout << "ASNMP:ERROR: trap command failed reason: " << ptr << endl; - } - - cout << "ASNMP:INFO:command completed normally.\n"<< endl; - return 0; -} - diff --git a/ASNMP/examples/walk/Makefile b/ASNMP/examples/walk/Makefile deleted file mode 100644 index 3251dcd9036..00000000000 --- a/ASNMP/examples/walk/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id$ -# -# Makefile for walk sample application -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - - -# ACE+SNMP -BIN = walk -CCFLAGS = -I$(ACE_ROOT)/ASNMP/ -LSRC = $(addsuffix .cpp,$(BIN)) - -LDLIBS := -L$(ACE_ROOT)/ASNMP/asnmp -lasnmp $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - - - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/ASNMP/examples/walk/walk.cpp b/ASNMP/examples/walk/walk.cpp deleted file mode 100644 index 0fa63f7f6ab..00000000000 --- a/ASNMP/examples/walk/walk.cpp +++ /dev/null @@ -1,260 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// walk.cpp -// -// = DESCRIPTION -// Sample application demonstrating synchronous Snmp::get, get_next API -// to access an SNMP Version 1 agent. -// -// = AUTHOR -// Peter E. Mellquist original code -// Michael R MacFaden mrm@cisco.com rework API/ACE integration -// -// ============================================================================ -/*=================================================================== - Copyright (c) 1996 - Hewlett-Packard Company - - ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. - Permission to use, copy, modify, distribute and/or sell this software - and/or its documentation is hereby granted without fee. User agrees - to display the above copyright notice and this license notice in all - copies of the software and any documentation of the software. User - agrees to assume all liability for the use of the software; Hewlett-Packard - makes no representations about the suitability of this software for any - purpose. It is provided "AS-IS without warranty of any kind,either express - or implied. User hereby grants a royalty-free license to any and all - derivatives based upon this software code base. -=====================================================================*/ - -#include "asnmp/snmp.h" -#include "ace/Get_Opt.h" - -ACE_RCSID(walk, walk, "$Id$") - -// -// SNMPv1 Walk Mib Application -// -class walkapp { - public: - walkapp(int argc, char **argv); // process command line args - int valid() const; // verify transaction can proceed - int run(); // issue transaction - static void usage(); // operator help message - - private: - walkapp(const walkapp&); - - UdpAddress address_; - Pdu pdu_; // construct a request Pdu - Oid oid_; - OctetStr community_; - Snmp snmp_; - UdpTarget target_; - int valid_; -}; - - -// main entry point -int main( int argc, char *argv[]) -{ - walkapp get(argc, argv); - if (get.valid()) - return get.run(); - else - walkapp::usage(); - return 1; -} - -walkapp::valid() const -{ - return valid_; -} - -walkapp::walkapp(int argc, char *argv[]): valid_(0) -{ - Oid req, def_oid("1.3.6.1.2.1.1.1.0"); // default begin walk with MIBII - if ( argc < 2) - return; - - address_ = argv[argc - 1]; - if ( !address_.valid()) { - cout << "ERROR: Invalid IPv4 address or DNS hostname: " \ - << argv[argc] << "\n"; - return; - } - - ACE_Get_Opt get_opt (argc, argv, "o:c:r:t:"); - for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'o': - req = get_opt.optarg; - if (req.valid() == 0) - cout << "ERROR: oid value: " <get( pdu_, *target_); - first_++; - } - else { - rc = snmp_->get_next( pdu_, *target_); - } - - if (rc != SNMP_CLASS_SUCCESS) { - reason = snmp_->error_string(); - return 0; - } - - // 2. check for problems - if (pdu_.get_error_status()) { - reason = pdu_.agent_error_reason(); - return 0; - } - - // 3. return vb to caller - pdu_.get_vb(vb, 0); - Oid nextoid; - vb.get_oid(nextoid); // and setup next oid to get - Vb nextvb(nextoid); - pdu_.delete_all_vbs(); - pdu_ += nextvb; // can't do set_vb as there are no entries to replace - - return 1; // ok -} - -int walkapp::run() -{ - - //----------[ create a ASNMP session ]----------------------------------- - if ( snmp_.valid() != SNMP_CLASS_SUCCESS) { - cout << "\nASNMP:ERROR:Create session failed: "<< - snmp_.error_string()<< "\n"; - return 1; - } - - //--------[ build up ASNMP object needed ]------------------------------- - if (address_.get_port() == 0) - address_.set_port(DEF_AGENT_PORT); - target_.set_address( address_); // make a target using the address - - //-------[ issue the request, blocked mode ]----------------------------- - cout << "\nASNMP:INFO:SNMP Version " << (target_.get_version()+ 1) << \ - " WALK SAMPLE PROGRAM \nOID: " << oid_.to_string() << "\n"; - target_.get_address(address_); // target updates port used - int rc; - char *name = address_.resolve_hostname(rc); - if (rc) - name = "<< did not resolve via gethostbyname() >>"; - - cout << "Device: " << address_ << " " << name << "\n"; - cout << "[ Retries=" << target_.get_retry() << " \ - Timeout=" << target_.get_timeout() <<" ms " << "Community=" << \ - community_.to_string() << " ]"<< endl; - - MibIter iter(&snmp_, pdu_, &target_); - char *err_str = 0; - Vb vb; - unsigned ctr = 0; - while (iter.next(vb, err_str)) { - cout << "\tOid = " << vb.to_string_oid() << "\n"; - cout << "\tValue = " << vb.to_string_value() << "\n"; - ctr++; - } - - if (!err_str) { - cout << "ERROR: walk: " << err_str << endl; - return 0; - } - - cout << "ASNMP:INFO:command completed normally. ACE Rocks...\n"<< endl; - return 0; -} - diff --git a/ASNMP/mibs/RFC1213-MIB.my b/ASNMP/mibs/RFC1213-MIB.my deleted file mode 100644 index f89f8bf125e..00000000000 --- a/ASNMP/mibs/RFC1213-MIB.my +++ /dev/null @@ -1,2618 +0,0 @@ --- ***************************************************************** --- RFC1213-MIB.my: MIB-II MIB file --- --- April 1994, Jeffrey T. Johnson --- --- Copyright (c) 1994-1996 by cisco Systems, Inc. --- All rights reserved. --- --- ***************************************************************** --- --- This mib was extracted from RFC 1213 --- The following changes have been applied: --- The enumerations unknown(4) and dormant(5) have been added to --- ifOperStatus to reflect a change to the ifTable introduced in --- RFC 1573 --- --- The SYNTAX of ifType has been changed to IANAifType, to reflect the --- change to the ifTable introduced in RFC1573. - - RFC1213-MIB DEFINITIONS ::= BEGIN - - IMPORTS - mgmt, NetworkAddress, IpAddress, Counter, Gauge, - TimeTicks - FROM RFC1155-SMI - OBJECT-TYPE - FROM RFC-1212 - TEXTUAL-CONVENTION - FROM SNMPv2-TC - IANAifType - FROM IANAifType-MIB; - - -- This MIB module uses the extended OBJECT-TYPE macro as - -- defined in [14]; - - - -- MIB-II (same prefix as MIB-I) - - mib-2 OBJECT IDENTIFIER ::= { mgmt 1 } - - -- textual conventions - - DisplayString ::= - OCTET STRING - -- This data type is used to model textual information taken - -- from the NVT ASCII character set. By convention, objects - -- with this syntax are declared as having - -- - -- SIZE (0..255) - - PhysAddress ::= - OCTET STRING - -- This data type is used to model media addresses. For many - -- types of media, this will be in a binary representation. - -- For example, an ethernet address would be represented as - -- a string of 6 octets. - - - -- groups in MIB-II - - system OBJECT IDENTIFIER ::= { mib-2 1 } - - interfaces OBJECT IDENTIFIER ::= { mib-2 2 } - - at OBJECT IDENTIFIER ::= { mib-2 3 } - - ip OBJECT IDENTIFIER ::= { mib-2 4 } - - icmp OBJECT IDENTIFIER ::= { mib-2 5 } - - tcp OBJECT IDENTIFIER ::= { mib-2 6 } - - udp OBJECT IDENTIFIER ::= { mib-2 7 } - - egp OBJECT IDENTIFIER ::= { mib-2 8 } - - -- historical (some say hysterical) - -- cmot OBJECT IDENTIFIER ::= { mib-2 9 } - - transmission OBJECT IDENTIFIER ::= { mib-2 10 } - - snmp OBJECT IDENTIFIER ::= { mib-2 11 } - - - -- the System group - - -- Implementation of the System group is mandatory for all - -- systems. If an agent is not configured to have a value - -- for any of these variables, a string of length 0 is - -- returned. - - sysDescr OBJECT-TYPE - SYNTAX DisplayString (SIZE (0..255)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A textual description of the entity. This value - should include the full name and version - identification of the system's hardware type, - software operating-system, and networking - software. It is mandatory that this only contain - printable ASCII characters." - ::= { system 1 } - - sysObjectID OBJECT-TYPE - SYNTAX OBJECT IDENTIFIER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The vendor's authoritative identification of the - network management subsystem contained in the - entity. This value is allocated within the SMI - enterprises subtree (1.3.6.1.4.1) and provides an - easy and unambiguous means for determining `what - kind of box' is being managed. For example, if - vendor `Flintstones, Inc.' was assigned the - subtree 1.3.6.1.4.1.4242, it could assign the - identifier 1.3.6.1.4.1.4242.1.1 to its `Fred - Router'." - ::= { system 2 } - - sysUpTime OBJECT-TYPE - SYNTAX TimeTicks - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The time (in hundredths of a second) since the - network management portion of the system was last - re-initialized." - ::= { system 3 } - - sysContact OBJECT-TYPE - SYNTAX DisplayString (SIZE (0..255)) - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The textual identification of the contact person - for this managed node, together with information - on how to contact this person." - ::= { system 4 } - - sysName OBJECT-TYPE - SYNTAX DisplayString (SIZE (0..255)) - ACCESS read-write - STATUS mandatory - DESCRIPTION - "An administratively-assigned name for this - managed node. By convention, this is the node's - fully-qualified domain name." - ::= { system 5 } - - sysLocation OBJECT-TYPE - SYNTAX DisplayString (SIZE (0..255)) - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The physical location of this node (e.g., - `telephone closet, 3rd floor')." - ::= { system 6 } - - sysServices OBJECT-TYPE - SYNTAX INTEGER (0..127) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A value which indicates the set of services that - this entity primarily offers. - - The value is a sum. This sum initially takes the - value zero, Then, for each layer, L, in the range - 1 through 7, that this node performs transactions - for, 2 raised to (L - 1) is added to the sum. For - example, a node which performs primarily routing - functions would have a value of 4 (2^(3-1)). In - contrast, a node which is a host offering - application services would have a value of 72 - (2^(4-1) + 2^(7-1)). Note that in the context of - the Internet suite of protocols, values should be - calculated accordingly: - - layer functionality - 1 physical (e.g., repeaters) - 2 datalink/subnetwork (e.g., bridges) - 3 internet (e.g., IP gateways) - 4 end-to-end (e.g., IP hosts) - 7 applications (e.g., mail relays) - - For systems including OSI protocols, layers 5 and - 6 may also be counted." - ::= { system 7 } - - -- the Interfaces group - - -- Implementation of the Interfaces group is mandatory for - -- all systems. - - ifNumber OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of network interfaces (regardless of - their current state) present on this system." - ::= { interfaces 1 } - - - -- the Interfaces table - - -- The Interfaces table contains information on the entity's - -- interfaces. Each interface is thought of as being - -- attached to a `subnetwork'. Note that this term should - -- not be confused with `subnet' which refers to an - -- addressing partitioning scheme used in the Internet suite - -- of protocols. - - ifTable OBJECT-TYPE - SYNTAX SEQUENCE OF IfEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A list of interface entries. The number of - entries is given by the value of ifNumber." - ::= { interfaces 2 } - - ifEntry OBJECT-TYPE - SYNTAX IfEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "An interface entry containing objects at the - subnetwork layer and below for a particular - interface." - INDEX { ifIndex } - ::= { ifTable 1 } - - IfEntry ::= - SEQUENCE { - ifIndex - INTEGER, - ifDescr - DisplayString, - ifType - IANAifType, - ifMtu - INTEGER, - ifSpeed - Gauge, - ifPhysAddress - PhysAddress, - ifAdminStatus - INTEGER, - ifOperStatus - INTEGER, - ifLastChange - TimeTicks, - ifInOctets - Counter, - ifInUcastPkts - Counter, - ifInNUcastPkts - Counter, - ifInDiscards - Counter, - ifInErrors - Counter, - ifInUnknownProtos - Counter, - ifOutOctets - Counter, - ifOutUcastPkts - Counter, - ifOutNUcastPkts - Counter, - ifOutDiscards - Counter, - ifOutErrors - Counter, - ifOutQLen - Gauge, - ifSpecific - OBJECT IDENTIFIER - } - - ifIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A unique value for each interface. Its value - ranges between 1 and the value of ifNumber. The - value for each interface must remain constant at - least from one re-initialization of the entity's - network management system to the next re- - initialization." - ::= { ifEntry 1 } - - ifDescr OBJECT-TYPE - SYNTAX DisplayString (SIZE (0..255)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A textual string containing information about the - interface. This string should include the name of - the manufacturer, the product name and the version - of the hardware interface." - ::= { ifEntry 2 } - - ifType OBJECT-TYPE - SYNTAX IANAifType - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The type of interface. Additional values for ifType - are assigned by the Internet Assigned Numbers - Authority (IANA), through updating the syntax of the - IANAifType textual convention." - ::= { ifEntry 3 } - - - ifMtu OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The size of the largest datagram which can be - sent/received on the interface, specified in - octets. For interfaces that are used for - transmitting network datagrams, this is the size - of the largest network datagram that can be sent - on the interface." - ::= { ifEntry 4 } - - ifSpeed OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS mandatory - DESCRIPTION - "An estimate of the interface's current bandwidth - in bits per second. For interfaces which do not - vary in bandwidth or for those where no accurate - estimation can be made, this object should contain - the nominal bandwidth." - ::= { ifEntry 5 } - - ifPhysAddress OBJECT-TYPE - SYNTAX PhysAddress - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The interface's address at the protocol layer - immediately `below' the network layer in the - protocol stack. For interfaces which do not have - such an address (e.g., a serial line), this object - should contain an octet string of zero length." - ::= { ifEntry 6 } - - ifAdminStatus OBJECT-TYPE - SYNTAX INTEGER { - up(1), -- ready to pass packets - down(2), - testing(3) -- in some test mode - } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The desired state of the interface. The - testing(3) state indicates that no operational - packets can be passed." - ::= { ifEntry 7 } - - ifOperStatus OBJECT-TYPE - SYNTAX INTEGER { - up(1), -- ready to pass packets - down(2), - testing(3), -- in some test mode - unknown(4), - dormant(5) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The current operational state of the interface. - The testing(3) state indicates that no operational - packets can be passed." - ::= { ifEntry 8 } - - ifLastChange OBJECT-TYPE - SYNTAX TimeTicks - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The value of sysUpTime at the time the interface - entered its current operational state. If the - current state was entered prior to the last re- - initialization of the local network management - subsystem, then this object contains a zero - value." - ::= { ifEntry 9 } - - ifInOctets OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of octets received on the - interface, including framing characters." - ::= { ifEntry 10 } - - ifInUcastPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of subnetwork-unicast packets - delivered to a higher-layer protocol." - ::= { ifEntry 11 } - - ifInNUcastPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of non-unicast (i.e., subnetwork- - broadcast or subnetwork-multicast) packets - delivered to a higher-layer protocol." - ::= { ifEntry 12 } - - ifInDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of inbound packets which were chosen - to be discarded even though no errors had been - detected to prevent their being deliverable to a - higher-layer protocol. One possible reason for - discarding such a packet could be to free up - buffer space." - ::= { ifEntry 13 } - - ifInErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of inbound packets that contained - errors preventing them from being deliverable to a - higher-layer protocol." - ::= { ifEntry 14 } - - ifInUnknownProtos OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of packets received via the interface - which were discarded because of an unknown or - unsupported protocol." - ::= { ifEntry 15 } - - ifOutOctets OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of octets transmitted out of the - interface, including framing characters." - ::= { ifEntry 16 } - - ifOutUcastPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of packets that higher-level - protocols requested be transmitted to a - subnetwork-unicast address, including those that - were discarded or not sent." - ::= { ifEntry 17 } - - ifOutNUcastPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of packets that higher-level - protocols requested be transmitted to a non- - unicast (i.e., a subnetwork-broadcast or - subnetwork-multicast) address, including those - that were discarded or not sent." - ::= { ifEntry 18 } - - ifOutDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of outbound packets which were chosen - to be discarded even though no errors had been - detected to prevent their being transmitted. One - possible reason for discarding such a packet could - be to free up buffer space." - ::= { ifEntry 19 } - - ifOutErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of outbound packets that could not be - transmitted because of errors." - ::= { ifEntry 20 } - - ifOutQLen OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The length of the output packet queue (in - packets)." - ::= { ifEntry 21 } - - ifSpecific OBJECT-TYPE - SYNTAX OBJECT IDENTIFIER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A reference to MIB definitions specific to the - particular media being used to realize the - interface. For example, if the interface is - realized by an ethernet, then the value of this - object refers to a document defining objects - specific to ethernet. If this information is not - present, its value should be set to the OBJECT - IDENTIFIER { 0 0 }, which is a syntactically valid - object identifier, and any conformant - implementation of ASN.1 and BER must be able to - generate and recognize this value." - ::= { ifEntry 22 } - - - -- the Address Translation group - - -- Implementation of the Address Translation group is - -- mandatory for all systems. Note however that this group - -- is deprecated by MIB-II. That is, it is being included - -- solely for compatibility with MIB-I nodes, and will most - -- likely be excluded from MIB-III nodes. From MIB-II and - -- onwards, each network protocol group contains its own - -- address translation tables. - - -- The Address Translation group contains one table which is - -- the union across all interfaces of the translation tables - -- for converting a NetworkAddress (e.g., an IP address) into - -- a subnetwork-specific address. For lack of a better term, - -- this document refers to such a subnetwork-specific address - -- as a `physical' address. - - -- Examples of such translation tables are: for broadcast - -- media where ARP is in use, the translation table is - -- equivalent to the ARP cache; or, on an X.25 network where - -- non-algorithmic translation to X.121 addresses is - -- required, the translation table contains the - -- NetworkAddress to X.121 address equivalences. - - atTable OBJECT-TYPE - SYNTAX SEQUENCE OF AtEntry - ACCESS not-accessible - STATUS deprecated - DESCRIPTION - "The Address Translation tables contain the - NetworkAddress to `physical' address equivalences. - Some interfaces do not use translation tables for - determining address equivalences (e.g., DDN-X.25 - has an algorithmic method); if all interfaces are - of this type, then the Address Translation table - is empty, i.e., has zero entries." - ::= { at 1 } - - atEntry OBJECT-TYPE - SYNTAX AtEntry - ACCESS not-accessible - STATUS deprecated - DESCRIPTION - "Each entry contains one NetworkAddress to - `physical' address equivalence." - INDEX { atIfIndex, - atNetAddress } - ::= { atTable 1 } - - AtEntry ::= - SEQUENCE { - atIfIndex - INTEGER, - atPhysAddress - PhysAddress, - atNetAddress - NetworkAddress - } - - atIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS deprecated - DESCRIPTION - "The interface on which this entry's equivalence - is effective. The interface identified by a - particular value of this index is the same - interface as identified by the same value of - ifIndex." - ::= { atEntry 1 } - - atPhysAddress OBJECT-TYPE - SYNTAX PhysAddress - ACCESS read-write - STATUS deprecated - DESCRIPTION - "The media-dependent `physical' address. - - Setting this object to a null string (one of zero - length) has the effect of invaliding the - corresponding entry in the atTable object. That - is, it effectively disassociates the interface - identified with said entry from the mapping - identified with said entry. It is an - implementation-specific matter as to whether the - agent removes an invalidated entry from the table. - Accordingly, management stations must be prepared - to receive tabular information from agents that - corresponds to entries not currently in use. - Proper interpretation of such entries requires - examination of the relevant atPhysAddress object." - ::= { atEntry 2 } - - atNetAddress OBJECT-TYPE - SYNTAX NetworkAddress - ACCESS read-write - STATUS deprecated - DESCRIPTION - "The NetworkAddress (e.g., the IP address) - corresponding to the media-dependent `physical' - address." - ::= { atEntry 3 } - - - -- the IP group - - -- Implementation of the IP group is mandatory for all - -- systems. - - ipForwarding OBJECT-TYPE - SYNTAX INTEGER { - forwarding(1), -- acting as a gateway - not-forwarding(2) -- NOT acting as a gateway - } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The indication of whether this entity is acting - as an IP gateway in respect to the forwarding of - datagrams received by, but not addressed to, this - entity. IP gateways forward datagrams. IP hosts - do not (except those source-routed via the host). - - Note that for some managed nodes, this object may - take on only a subset of the values possible. - Accordingly, it is appropriate for an agent to - return a `badValue' response if a management - station attempts to change this object to an - inappropriate value." - ::= { ip 1 } - - ipDefaultTTL OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The default value inserted into the Time-To-Live - field of the IP header of datagrams originated at - this entity, whenever a TTL value is not supplied - by the transport layer protocol." - ::= { ip 2 } - - ipInReceives OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of input datagrams received from - interfaces, including those received in error." - ::= { ip 3 } - - ipInHdrErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of input datagrams discarded due to - errors in their IP headers, including bad - checksums, version number mismatch, other format - errors, time-to-live exceeded, errors discovered - in processing their IP options, etc." - ::= { ip 4 } - - ipInAddrErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of input datagrams discarded because - the IP address in their IP header's destination - field was not a valid address to be received at - this entity. This count includes invalid - addresses (e.g., 0.0.0.0) and addresses of - unsupported Classes (e.g., Class E). For entities - which are not IP Gateways and therefore do not - forward datagrams, this counter includes datagrams - discarded because the destination address was not - a local address." - ::= { ip 5 } - - ipForwDatagrams OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of input datagrams for which this - entity was not their final IP destination, as a - result of which an attempt was made to find a - route to forward them to that final destination. - In entities which do not act as IP Gateways, this - counter will include only those packets which were - Source-Routed via this entity, and the Source- - Route option processing was successful." - ::= { ip 6 } - - ipInUnknownProtos OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of locally-addressed datagrams - received successfully but discarded because of an - unknown or unsupported protocol." - ::= { ip 7 } - - ipInDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of input IP datagrams for which no - problems were encountered to prevent their - continued processing, but which were discarded - (e.g., for lack of buffer space). Note that this - counter does not include any datagrams discarded - while awaiting re-assembly." - ::= { ip 8 } - - ipInDelivers OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of input datagrams successfully - delivered to IP user-protocols (including ICMP)." - ::= { ip 9 } - - ipOutRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of IP datagrams which local IP - user-protocols (including ICMP) supplied to IP in - requests for transmission. Note that this counter - does not include any datagrams counted in - ipForwDatagrams." - ::= { ip 10 } - - ipOutDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of output IP datagrams for which no - problem was encountered to prevent their - transmission to their destination, but which were - discarded (e.g., for lack of buffer space). Note - that this counter would include datagrams counted - in ipForwDatagrams if any such packets met this - (discretionary) discard criterion." - ::= { ip 11 } - - ipOutNoRoutes OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of IP datagrams discarded because no - route could be found to transmit them to their - destination. Note that this counter includes any - packets counted in ipForwDatagrams which meet this - `no-route' criterion. Note that this includes any - datagrams which a host cannot route because all of - its default gateways are down." - ::= { ip 12 } - - ipReasmTimeout OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The maximum number of seconds which received - fragments are held while they are awaiting - reassembly at this entity." - ::= { ip 13 } - - ipReasmReqds OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of IP fragments received which needed - to be reassembled at this entity." - ::= { ip 14 } - - ipReasmOKs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of IP datagrams successfully re- - assembled." - ::= { ip 15 } - - ipReasmFails OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of failures detected by the IP re- - assembly algorithm (for whatever reason: timed - out, errors, etc). Note that this is not - necessarily a count of discarded IP fragments - since some algorithms (notably the algorithm in - RFC 815) can lose track of the number of fragments - by combining them as they are received." - ::= { ip 16 } - - ipFragOKs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of IP datagrams that have been - successfully fragmented at this entity." - ::= { ip 17 } - - ipFragFails OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of IP datagrams that have been - discarded because they needed to be fragmented at - this entity but could not be, e.g., because their - Don't Fragment flag was set." - ::= { ip 18 } - - ipFragCreates OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of IP datagram fragments that have - been generated as a result of fragmentation at - this entity." - ::= { ip 19 } - - - - -- the IP address table - - -- The IP address table contains this entity's IP addressing - -- information. - - ipAddrTable OBJECT-TYPE - SYNTAX SEQUENCE OF IpAddrEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The table of addressing information relevant to - this entity's IP addresses." - ::= { ip 20 } - - ipAddrEntry OBJECT-TYPE - SYNTAX IpAddrEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The addressing information for one of this - entity's IP addresses." - INDEX { ipAdEntAddr } - ::= { ipAddrTable 1 } - - IpAddrEntry ::= - SEQUENCE { - ipAdEntAddr - IpAddress, - ipAdEntIfIndex - INTEGER, - ipAdEntNetMask - IpAddress, - ipAdEntBcastAddr - INTEGER, - ipAdEntReasmMaxSize - INTEGER (0..65535) - } - - ipAdEntAddr OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The IP address to which this entry's addressing - information pertains." - ::= { ipAddrEntry 1 } - - - ipAdEntIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The index value which uniquely identifies the - interface to which this entry is applicable. The - interface identified by a particular value of this - index is the same interface as identified by the - same value of ifIndex." - ::= { ipAddrEntry 2 } - - ipAdEntNetMask OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The subnet mask associated with the IP address of - this entry. The value of the mask is an IP - address with all the network bits set to 1 and all - the hosts bits set to 0." - ::= { ipAddrEntry 3 } - - ipAdEntBcastAddr OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The value of the least-significant bit in the IP - broadcast address used for sending datagrams on - the (logical) interface associated with the IP - address of this entry. For example, when the - Internet standard all-ones broadcast address is - used, the value will be 1. This value applies to - both the subnet and network broadcasts addresses - used by the entity on this (logical) interface." - ::= { ipAddrEntry 4 } - - ipAdEntReasmMaxSize OBJECT-TYPE - SYNTAX INTEGER (0..65535) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The size of the largest IP datagram which this - entity can re-assemble from incoming IP fragmented - datagrams received on this interface." - ::= { ipAddrEntry 5 } - - -- the IP routing table - - -- The IP routing table contains an entry for each route - -- presently known to this entity. - - ipRouteTable OBJECT-TYPE - SYNTAX SEQUENCE OF IpRouteEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "This entity's IP Routing table." - ::= { ip 21 } - - ipRouteEntry OBJECT-TYPE - SYNTAX IpRouteEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A route to a particular destination." - INDEX { ipRouteDest } - ::= { ipRouteTable 1 } - - IpRouteEntry ::= - SEQUENCE { - ipRouteDest - IpAddress, - ipRouteIfIndex - INTEGER, - ipRouteMetric1 - INTEGER, - ipRouteMetric2 - INTEGER, - ipRouteMetric3 - INTEGER, - ipRouteMetric4 - INTEGER, - ipRouteNextHop - IpAddress, - ipRouteType - INTEGER, - ipRouteProto - INTEGER, - ipRouteAge - INTEGER, - ipRouteMask - IpAddress, - ipRouteMetric5 - INTEGER, - ipRouteInfo - OBJECT IDENTIFIER - } - - ipRouteDest OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The destination IP address of this route. An - entry with a value of 0.0.0.0 is considered a - default route. Multiple routes to a single - destination can appear in the table, but access to - such multiple entries is dependent on the table- - access mechanisms defined by the network - management protocol in use." - ::= { ipRouteEntry 1 } - - ipRouteIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The index value which uniquely identifies the - local interface through which the next hop of this - route should be reached. The interface identified - by a particular value of this index is the same - interface as identified by the same value of - ifIndex." - ::= { ipRouteEntry 2 } - - ipRouteMetric1 OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The primary routing metric for this route. The - semantics of this metric are determined by the - routing-protocol specified in the route's - ipRouteProto value. If this metric is not used, - its value should be set to -1." - ::= { ipRouteEntry 3 } - - ipRouteMetric2 OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "An alternate routing metric for this route. The - semantics of this metric are determined by the - routing-protocol specified in the route's - ipRouteProto value. If this metric is not used, - its value should be set to -1." - ::= { ipRouteEntry 4 } - - ipRouteMetric3 OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "An alternate routing metric for this route. The - semantics of this metric are determined by the - routing-protocol specified in the route's - ipRouteProto value. If this metric is not used, - its value should be set to -1." - ::= { ipRouteEntry 5 } - - ipRouteMetric4 OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "An alternate routing metric for this route. The - semantics of this metric are determined by the - routing-protocol specified in the route's - ipRouteProto value. If this metric is not used, - its value should be set to -1." - ::= { ipRouteEntry 6 } - - ipRouteNextHop OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The IP address of the next hop of this route. - (In the case of a route bound to an interface - which is realized via a broadcast media, the value - of this field is the agent's IP address on that - interface.)" - ::= { ipRouteEntry 7 } - - ipRouteType OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - - invalid(2), -- an invalidated route - -- route to directly - direct(3), -- connected (sub-)network - - -- route to a non-local - indirect(4) -- host/network/sub-network - } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The type of route. Note that the values - direct(3) and indirect(4) refer to the notion of - direct and indirect routing in the IP - architecture. - - Setting this object to the value invalid(2) has - the effect of invalidating the corresponding entry - in the ipRouteTable object. That is, it - effectively disassociates the destination - identified with said entry from the route - identified with said entry. It is an - implementation-specific matter as to whether the - agent removes an invalidated entry from the table. - Accordingly, management stations must be prepared - to receive tabular information from agents that - corresponds to entries not currently in use. - Proper interpretation of such entries requires - examination of the relevant ipRouteType object." - ::= { ipRouteEntry 8 } - - ipRouteProto OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - - -- non-protocol information, - -- e.g., manually configured - local(2), -- entries - - -- set via a network - netmgmt(3), -- management protocol - - -- obtained via ICMP, - icmp(4), -- e.g., Redirect - - -- the remaining values are - -- all gateway routing - -- protocols - egp(5), - ggp(6), - hello(7), - rip(8), - is-is(9), - es-is(10), - ciscoIgrp(11), - bbnSpfIgp(12), - ospf(13), - bgp(14) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The routing mechanism via which this route was - learned. Inclusion of values for gateway routing - protocols is not intended to imply that hosts - should support those protocols." - ::= { ipRouteEntry 9 } - - ipRouteAge OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The number of seconds since this route was last - updated or otherwise determined to be correct. - Note that no semantics of `too old' can be implied - except through knowledge of the routing protocol - by which the route was learned." - ::= { ipRouteEntry 10 } - - ipRouteMask OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-write - STATUS mandatory - DESCRIPTION - "Indicate the mask to be logical-ANDed with the - destination address before being compared to the - value in the ipRouteDest field. For those systems - that do not support arbitrary subnet masks, an - agent constructs the value of the ipRouteMask by - determining whether the value of the correspondent - ipRouteDest field belong to a class-A, B, or C - network, and then using one of: - - mask network - 255.0.0.0 class-A - 255.255.0.0 class-B - 255.255.255.0 class-C - - If the value of the ipRouteDest is 0.0.0.0 (a - default route), then the mask value is also - 0.0.0.0. It should be noted that all IP routing - subsystems implicitly use this mechanism." - ::= { ipRouteEntry 11 } - - ipRouteMetric5 OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "An alternate routing metric for this route. The - semantics of this metric are determined by the - routing-protocol specified in the route's - ipRouteProto value. If this metric is not used, - its value should be set to -1." - ::= { ipRouteEntry 12 } - - ipRouteInfo OBJECT-TYPE - SYNTAX OBJECT IDENTIFIER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A reference to MIB definitions specific to the - particular routing protocol which is responsible - for this route, as determined by the value - specified in the route's ipRouteProto value. If - this information is not present, its value should - be set to the OBJECT IDENTIFIER { 0 0 }, which is - a syntactically valid object identifier, and any - conformant implementation of ASN.1 and BER must be - able to generate and recognize this value." - ::= { ipRouteEntry 13 } - - - -- the IP Address Translation table - - -- The IP address translation table contain the IpAddress to - -- `physical' address equivalences. Some interfaces do not - -- use translation tables for determining address - -- equivalences (e.g., DDN-X.25 has an algorithmic method); - -- if all interfaces are of this type, then the Address - -- Translation table is empty, i.e., has zero entries. - - ipNetToMediaTable OBJECT-TYPE - SYNTAX SEQUENCE OF IpNetToMediaEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The IP Address Translation table used for mapping - from IP addresses to physical addresses." - ::= { ip 22 } - - ipNetToMediaEntry OBJECT-TYPE - SYNTAX IpNetToMediaEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "Each entry contains one IpAddress to `physical' - address equivalence." - INDEX { ipNetToMediaIfIndex, - ipNetToMediaNetAddress } - ::= { ipNetToMediaTable 1 } - - IpNetToMediaEntry ::= - SEQUENCE { - ipNetToMediaIfIndex - INTEGER, - ipNetToMediaPhysAddress - PhysAddress, - ipNetToMediaNetAddress - IpAddress, - ipNetToMediaType - INTEGER - } - - ipNetToMediaIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The interface on which this entry's equivalence - is effective. The interface identified by a - particular value of this index is the same - interface as identified by the same value of - ifIndex." - ::= { ipNetToMediaEntry 1 } - - ipNetToMediaPhysAddress OBJECT-TYPE - SYNTAX PhysAddress - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The media-dependent `physical' address." - ::= { ipNetToMediaEntry 2 } - - ipNetToMediaNetAddress OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The IpAddress corresponding to the media- - dependent `physical' address." - ::= { ipNetToMediaEntry 3 } - - ipNetToMediaType OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - invalid(2), -- an invalidated mapping - dynamic(3), - static(4) - } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The type of mapping. - - Setting this object to the value invalid(2) has - the effect of invalidating the corresponding entry - in the ipNetToMediaTable. That is, it effectively - disassociates the interface identified with said - entry from the mapping identified with said entry. - It is an implementation-specific matter as to - whether the agent removes an invalidated entry - from the table. Accordingly, management stations - must be prepared to receive tabular information - from agents that corresponds to entries not - currently in use. Proper interpretation of such - entries requires examination of the relevant - ipNetToMediaType object." - ::= { ipNetToMediaEntry 4 } - - - -- additional IP objects - - ipRoutingDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of routing entries which were chosen - to be discarded even though they are valid. One - possible reason for discarding such an entry could - be to free-up buffer space for other routing - entries." - ::= { ip 23 } - - - -- the ICMP group - - -- Implementation of the ICMP group is mandatory for all - -- systems. - - icmpInMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of ICMP messages which the - entity received. Note that this counter includes - all those counted by icmpInErrors." - ::= { icmp 1 } - - icmpInErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP messages which the entity - received but determined as having ICMP-specific - errors (bad ICMP checksums, bad length, etc.)." - ::= { icmp 2 } - - icmpInDestUnreachs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Destination Unreachable - messages received." - ::= { icmp 3 } - - icmpInTimeExcds OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Time Exceeded messages - received." - ::= { icmp 4 } - - - icmpInParmProbs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Parameter Problem messages - received." - ::= { icmp 5 } - - icmpInSrcQuenchs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Source Quench messages - received." - ::= { icmp 6 } - - icmpInRedirects OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Redirect messages received." - ::= { icmp 7 } - - icmpInEchos OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Echo (request) messages - received." - ::= { icmp 8 } - - icmpInEchoReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Echo Reply messages received." - ::= { icmp 9 } - - icmpInTimestamps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Timestamp (request) messages - received." - ::= { icmp 10 } - - icmpInTimestampReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Timestamp Reply messages - received." - ::= { icmp 11 } - - icmpInAddrMasks OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Address Mask Request messages - received." - ::= { icmp 12 } - - icmpInAddrMaskReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Address Mask Reply messages - received." - ::= { icmp 13 } - - icmpOutMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of ICMP messages which this - entity attempted to send. Note that this counter - includes all those counted by icmpOutErrors." - ::= { icmp 14 } - - icmpOutErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP messages which this entity did - not send due to problems discovered within ICMP - such as a lack of buffers. This value should not - include errors discovered outside the ICMP layer - such as the inability of IP to route the resultant - datagram. In some implementations there may be no - types of error which contribute to this counter's - value." - ::= { icmp 15 } - - icmpOutDestUnreachs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Destination Unreachable - messages sent." - ::= { icmp 16 } - - icmpOutTimeExcds OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Time Exceeded messages sent." - ::= { icmp 17 } - - icmpOutParmProbs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Parameter Problem messages - sent." - ::= { icmp 18 } - - icmpOutSrcQuenchs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Source Quench messages sent." - ::= { icmp 19 } - - icmpOutRedirects OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Redirect messages sent. For a - host, this object will always be zero, since hosts - do not send redirects." - ::= { icmp 20 } - - icmpOutEchos OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Echo (request) messages sent." - ::= { icmp 21 } - - icmpOutEchoReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Echo Reply messages sent." - ::= { icmp 22 } - - icmpOutTimestamps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Timestamp (request) messages - sent." - ::= { icmp 23 } - - icmpOutTimestampReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Timestamp Reply messages - sent." - ::= { icmp 24 } - - icmpOutAddrMasks OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Address Mask Request messages - sent." - ::= { icmp 25 } - - - icmpOutAddrMaskReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of ICMP Address Mask Reply messages - sent." - ::= { icmp 26 } - - - -- the TCP group - - -- Implementation of the TCP group is mandatory for all - -- systems that implement the TCP. - - -- Note that instances of object types that represent - -- information about a particular TCP connection are - -- transient; they persist only as long as the connection - -- in question. - - tcpRtoAlgorithm OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - - constant(2), -- a constant rto - rsre(3), -- MIL-STD-1778, Appendix B - vanj(4) -- Van Jacobson's algorithm [10] - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The algorithm used to determine the timeout value - used for retransmitting unacknowledged octets." - ::= { tcp 1 } - - tcpRtoMin OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The minimum value permitted by a TCP - implementation for the retransmission timeout, - measured in milliseconds. More refined semantics - for objects of this type depend upon the algorithm - used to determine the retransmission timeout. In - particular, when the timeout algorithm is rsre(3), - an object of this type has the semantics of the - LBOUND quantity described in RFC 793." - ::= { tcp 2 } - - - tcpRtoMax OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The maximum value permitted by a TCP - implementation for the retransmission timeout, - measured in milliseconds. More refined semantics - for objects of this type depend upon the algorithm - used to determine the retransmission timeout. In - particular, when the timeout algorithm is rsre(3), - an object of this type has the semantics of the - UBOUND quantity described in RFC 793." - ::= { tcp 3 } - - tcpMaxConn OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The limit on the total number of TCP connections - the entity can support. In entities where the - maximum number of connections is dynamic, this - object should contain the value -1." - ::= { tcp 4 } - - tcpActiveOpens OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of times TCP connections have made a - direct transition to the SYN-SENT state from the - CLOSED state." - ::= { tcp 5 } - - tcpPassiveOpens OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of times TCP connections have made a - direct transition to the SYN-RCVD state from the - LISTEN state." - ::= { tcp 6 } - - tcpAttemptFails OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of times TCP connections have made a - direct transition to the CLOSED state from either - the SYN-SENT state or the SYN-RCVD state, plus the - number of times TCP connections have made a direct - transition to the LISTEN state from the SYN-RCVD - state." - ::= { tcp 7 } - - tcpEstabResets OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of times TCP connections have made a - direct transition to the CLOSED state from either - the ESTABLISHED state or the CLOSE-WAIT state." - ::= { tcp 8 } - - tcpCurrEstab OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of TCP connections for which the - current state is either ESTABLISHED or CLOSE- - WAIT." - ::= { tcp 9 } - - tcpInSegs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of segments received, including - those received in error. This count includes - segments received on currently established - connections." - ::= { tcp 10 } - - tcpOutSegs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of segments sent, including - those on current connections but excluding those - containing only retransmitted octets." - ::= { tcp 11 } - - tcpRetransSegs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of segments retransmitted - that - is, the number of TCP segments transmitted - containing one or more previously transmitted - octets." - ::= { tcp 12 } - - - -- the TCP Connection table - - -- The TCP connection table contains information about this - -- entity's existing TCP connections. - - tcpConnTable OBJECT-TYPE - SYNTAX SEQUENCE OF TcpConnEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A table containing TCP connection-specific - information." - ::= { tcp 13 } - - tcpConnEntry OBJECT-TYPE - SYNTAX TcpConnEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "Information about a particular current TCP - connection. An object of this type is transient, - in that it ceases to exist when (or soon after) - the connection makes the transition to the CLOSED - state." - INDEX { tcpConnLocalAddress, - tcpConnLocalPort, - tcpConnRemAddress, - tcpConnRemPort } - ::= { tcpConnTable 1 } - - TcpConnEntry ::= - SEQUENCE { - tcpConnState - INTEGER, - tcpConnLocalAddress - IpAddress, - tcpConnLocalPort - INTEGER (0..65535), - tcpConnRemAddress - IpAddress, - tcpConnRemPort - INTEGER (0..65535) - } - - tcpConnState OBJECT-TYPE - SYNTAX INTEGER { - closed(1), - listen(2), - synSent(3), - synReceived(4), - established(5), - finWait1(6), - finWait2(7), - closeWait(8), - lastAck(9), - closing(10), - timeWait(11), - deleteTCB(12) - } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The state of this TCP connection. - - The only value which may be set by a management - station is deleteTCB(12). Accordingly, it is - appropriate for an agent to return a `badValue' - response if a management station attempts to set - this object to any other value. - - If a management station sets this object to the - value deleteTCB(12), then this has the effect of - deleting the TCB (as defined in RFC 793) of the - corresponding connection on the managed node, - resulting in immediate termination of the - connection. - - As an implementation-specific option, a RST - segment may be sent from the managed node to the - other TCP endpoint (note however that RST segments - are not sent reliably)." - ::= { tcpConnEntry 1 } - - tcpConnLocalAddress OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The local IP address for this TCP connection. In - the case of a connection in the listen state which - is willing to accept connections for any IP - interface associated with the node, the value - 0.0.0.0 is used." - ::= { tcpConnEntry 2 } - - tcpConnLocalPort OBJECT-TYPE - SYNTAX INTEGER (0..65535) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The local port number for this TCP connection." - ::= { tcpConnEntry 3 } - - tcpConnRemAddress OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The remote IP address for this TCP connection." - ::= { tcpConnEntry 4 } - - tcpConnRemPort OBJECT-TYPE - SYNTAX INTEGER (0..65535) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The remote port number for this TCP connection." - ::= { tcpConnEntry 5 } - - - -- additional TCP objects - - tcpInErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of segments received in error - (e.g., bad TCP checksums)." - ::= { tcp 14 } - - tcpOutRsts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of TCP segments sent containing the - RST flag." - ::= { tcp 15 } - - - -- the UDP group - - -- Implementation of the UDP group is mandatory for all - -- systems which implement the UDP. - - udpInDatagrams OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of UDP datagrams delivered to - UDP users." - ::= { udp 1 } - - udpNoPorts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of received UDP datagrams for - which there was no application at the destination - port." - ::= { udp 2 } - - udpInErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of received UDP datagrams that could - not be delivered for reasons other than the lack - of an application at the destination port." - ::= { udp 3 } - - udpOutDatagrams OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of UDP datagrams sent from this - entity." - ::= { udp 4 } - - - -- the UDP Listener table - - -- The UDP listener table contains information about this - -- entity's UDP end-points on which a local application is - -- currently accepting datagrams. - - udpTable OBJECT-TYPE - SYNTAX SEQUENCE OF UdpEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A table containing UDP listener information." - ::= { udp 5 } - - udpEntry OBJECT-TYPE - SYNTAX UdpEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "Information about a particular current UDP - listener." - INDEX { udpLocalAddress, udpLocalPort } - ::= { udpTable 1 } - - UdpEntry ::= - SEQUENCE { - udpLocalAddress - IpAddress, - udpLocalPort - INTEGER (0..65535) - } - - udpLocalAddress OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The local IP address for this UDP listener. In - the case of a UDP listener which is willing to - accept datagrams for any IP interface associated - with the node, the value 0.0.0.0 is used." - ::= { udpEntry 1 } - - udpLocalPort OBJECT-TYPE - SYNTAX INTEGER (0..65535) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The local port number for this UDP listener." - ::= { udpEntry 2 } - - - -- the EGP group - - -- Implementation of the EGP group is mandatory for all - -- systems which implement the EGP. - - egpInMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of EGP messages received without - error." - ::= { egp 1 } - - egpInErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of EGP messages received that proved - to be in error." - ::= { egp 2 } - - egpOutMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of locally generated EGP - messages." - ::= { egp 3 } - - egpOutErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of locally generated EGP messages not - sent due to resource limitations within an EGP - entity." - ::= { egp 4 } - - - -- the EGP Neighbor table - - -- The EGP neighbor table contains information about this - -- entity's EGP neighbors. - - egpNeighTable OBJECT-TYPE - SYNTAX SEQUENCE OF EgpNeighEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The EGP neighbor table." - ::= { egp 5 } - - egpNeighEntry OBJECT-TYPE - SYNTAX EgpNeighEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "Information about this entity's relationship with - a particular EGP neighbor." - INDEX { egpNeighAddr } - ::= { egpNeighTable 1 } - - EgpNeighEntry ::= - SEQUENCE { - egpNeighState - INTEGER, - egpNeighAddr - IpAddress, - egpNeighAs - INTEGER, - egpNeighInMsgs - Counter, - egpNeighInErrs - Counter, - egpNeighOutMsgs - Counter, - egpNeighOutErrs - Counter, - egpNeighInErrMsgs - Counter, - egpNeighOutErrMsgs - Counter, - egpNeighStateUps - Counter, - egpNeighStateDowns - Counter, - egpNeighIntervalHello - INTEGER, - egpNeighIntervalPoll - INTEGER, - egpNeighMode - INTEGER, - egpNeighEventTrigger - INTEGER - } - - egpNeighState OBJECT-TYPE - SYNTAX INTEGER { - idle(1), - acquisition(2), - down(3), - up(4), - cease(5) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The EGP state of the local system with respect to - this entry's EGP neighbor. Each EGP state is - represented by a value that is one greater than - the numerical value associated with said state in - RFC 904." - ::= { egpNeighEntry 1 } - - egpNeighAddr OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The IP address of this entry's EGP neighbor." - ::= { egpNeighEntry 2 } - - egpNeighAs OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The autonomous system of this EGP peer. Zero - should be specified if the autonomous system - number of the neighbor is not yet known." - ::= { egpNeighEntry 3 } - - egpNeighInMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of EGP messages received without error - from this EGP peer." - ::= { egpNeighEntry 4 } - - egpNeighInErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of EGP messages received from this EGP - peer that proved to be in error (e.g., bad EGP - checksum)." - ::= { egpNeighEntry 5 } - - egpNeighOutMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of locally generated EGP messages to - this EGP peer." - ::= { egpNeighEntry 6 } - - egpNeighOutErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of locally generated EGP messages not - sent to this EGP peer due to resource limitations - within an EGP entity." - ::= { egpNeighEntry 7 } - - egpNeighInErrMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of EGP-defined error messages received - from this EGP peer." - ::= { egpNeighEntry 8 } - - egpNeighOutErrMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of EGP-defined error messages sent to - this EGP peer." - ::= { egpNeighEntry 9 } - - egpNeighStateUps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of EGP state transitions to the UP - state with this EGP peer." - ::= { egpNeighEntry 10 } - - egpNeighStateDowns OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of EGP state transitions from the UP - state to any other state with this EGP peer." - ::= { egpNeighEntry 11 } - - egpNeighIntervalHello OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The interval between EGP Hello command - retransmissions (in hundredths of a second). This - represents the t1 timer as defined in RFC 904." - ::= { egpNeighEntry 12 } - - egpNeighIntervalPoll OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The interval between EGP poll command - retransmissions (in hundredths of a second). This - represents the t3 timer as defined in RFC 904." - ::= { egpNeighEntry 13 } - - egpNeighMode OBJECT-TYPE - SYNTAX INTEGER { active(1), passive(2) } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The polling mode of this EGP entity, either - passive or active." - ::= { egpNeighEntry 14 } - - egpNeighEventTrigger OBJECT-TYPE - SYNTAX INTEGER { start(1), stop(2) } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "A control variable used to trigger operator- - initiated Start and Stop events. When read, this - variable always returns the most recent value that - egpNeighEventTrigger was set to. If it has not - been set since the last initialization of the - network management subsystem on the node, it - returns a value of `stop'. - - When set, this variable causes a Start or Stop - event on the specified neighbor, as specified on - pages 8-10 of RFC 904. Briefly, a Start event - causes an Idle peer to begin neighbor acquisition - and a non-Idle peer to reinitiate neighbor - acquisition. A stop event causes a non-Idle peer - to return to the Idle state until a Start event - occurs, either via egpNeighEventTrigger or - otherwise." - ::= { egpNeighEntry 15 } - - - -- additional EGP objects - - egpAs OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The autonomous system number of this EGP entity." - ::= { egp 6 } - - -- the Transmission group - - -- Based on the transmission media underlying each interface - -- on a system, the corresponding portion of the Transmission - -- group is mandatory for that system. - - -- When Internet-standard definitions for managing - -- transmission media are defined, the transmission group is - -- used to provide a prefix for the names of those objects. - - -- Typically, such definitions reside in the experimental - -- portion of the MIB until they are "proven", then as a - -- part of the Internet standardization process, the - -- definitions are accordingly elevated and a new object - -- identifier, under the transmission group is defined. By - -- convention, the name assigned is: - -- - -- type OBJECT IDENTIFIER ::= { transmission number } - -- - -- where "type" is the symbolic value used for the media in - -- the ifType column of the ifTable object, and "number" is - -- the actual integer value corresponding to the symbol. - - - -- the SNMP group - - -- Implementation of the SNMP group is mandatory for all - -- systems which support an SNMP protocol entity. Some of - -- the objects defined below will be zero-valued in those - -- SNMP implementations that are optimized to support only - -- those functions specific to either a management agent or - -- a management station. In particular, it should be - -- observed that the objects below refer to an SNMP entity, - -- and there may be several SNMP entities residing on a - -- managed node (e.g., if the node is hosting acting as - -- a management station). - - snmpInPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of Messages delivered to the - SNMP entity from the transport service." - ::= { snmp 1 } - - snmpOutPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Messages which were - passed from the SNMP protocol entity to the - transport service." - ::= { snmp 2 } - - snmpInBadVersions OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Messages which were - delivered to the SNMP protocol entity and were for - an unsupported SNMP version." - ::= { snmp 3 } - - snmpInBadCommunityNames OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Messages delivered to - the SNMP protocol entity which used a SNMP - community name not known to said entity." - ::= { snmp 4 } - - snmpInBadCommunityUses OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Messages delivered to - the SNMP protocol entity which represented an SNMP - operation which was not allowed by the SNMP - community named in the Message." - ::= { snmp 5 } - - snmpInASNParseErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of ASN.1 or BER errors - encountered by the SNMP protocol entity when - decoding received SNMP Messages." - ::= { snmp 6 } - - -- { snmp 7 } is not used - - snmpInTooBigs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `tooBig'." - ::= { snmp 8 } - - snmpInNoSuchNames OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `noSuchName'." - ::= { snmp 9 } - - snmpInBadValues OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `badValue'." - ::= { snmp 10 } - - snmpInReadOnlys OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number valid SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `readOnly'. It should be noted that it is a - protocol error to generate an SNMP PDU which - contains the value `readOnly' in the error-status - field, as such this object is provided as a means - of detecting incorrect implementations of the - SNMP." - ::= { snmp 11 } - - snmpInGenErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `genErr'." - ::= { snmp 12 } - - snmpInTotalReqVars OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of MIB objects which have been - retrieved successfully by the SNMP protocol entity - as the result of receiving valid SNMP Get-Request - and Get-Next PDUs." - ::= { snmp 13 } - - snmpInTotalSetVars OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of MIB objects which have been - altered successfully by the SNMP protocol entity - as the result of receiving valid SNMP Set-Request - PDUs." - ::= { snmp 14 } - - snmpInGetRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Request PDUs which - have been accepted and processed by the SNMP - protocol entity." - ::= { snmp 15 } - - snmpInGetNexts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Next PDUs which have - been accepted and processed by the SNMP protocol - entity." - ::= { snmp 16 } - - snmpInSetRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Set-Request PDUs which - have been accepted and processed by the SNMP - protocol entity." - ::= { snmp 17 } - - snmpInGetResponses OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Response PDUs which - have been accepted and processed by the SNMP - protocol entity." - ::= { snmp 18 } - - snmpInTraps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Trap PDUs which have - been accepted and processed by the SNMP protocol - entity." - ::= { snmp 19 } - - snmpOutTooBigs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - generated by the SNMP protocol entity and for - which the value of the error-status field is - `tooBig.'" - ::= { snmp 20 } - - snmpOutNoSuchNames OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - generated by the SNMP protocol entity and for - which the value of the error-status is - `noSuchName'." - ::= { snmp 21 } - - snmpOutBadValues OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - generated by the SNMP protocol entity and for - which the value of the error-status field is - `badValue'." - ::= { snmp 22 } - - -- { snmp 23 } is not used - - snmpOutGenErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - generated by the SNMP protocol entity and for - which the value of the error-status field is - `genErr'." - ::= { snmp 24 } - - snmpOutGetRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Request PDUs which - have been generated by the SNMP protocol entity." - ::= { snmp 25 } - - snmpOutGetNexts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Next PDUs which have - been generated by the SNMP protocol entity." - ::= { snmp 26 } - - snmpOutSetRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Set-Request PDUs which - have been generated by the SNMP protocol entity." - ::= { snmp 27 } - - snmpOutGetResponses OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Response PDUs which - have been generated by the SNMP protocol entity." - ::= { snmp 28 } - - snmpOutTraps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Trap PDUs which have - been generated by the SNMP protocol entity." - ::= { snmp 29 } - - snmpEnableAuthenTraps OBJECT-TYPE - SYNTAX INTEGER { enabled(1), disabled(2) } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "Indicates whether the SNMP agent process is - permitted to generate authentication-failure - traps. The value of this object overrides any - configuration information; as such, it provides a - means whereby all authentication-failure traps may - be disabled. - - Note that it is strongly recommended that this - object be stored in non-volatile memory so that it - remains constant between re-initializations of the - network management system." - ::= { snmp 30 } - -END diff --git a/ASNMP/tests/Address_Test.cpp b/ASNMP/tests/Address_Test.cpp deleted file mode 100644 index cadca2722dc..00000000000 --- a/ASNMP/tests/Address_Test.cpp +++ /dev/null @@ -1,549 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Address_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the Address family: -// GenAddress, MacAddress, IpxAddress, IpAddress, UdpAddress -// all which derive from abstract base class Address. -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - -#include "asnmp/address.h" -#include "test_config.h" - -ACE_RCSID(tests, Address_Test, "$Id$") - -// test the GenAddress interface -/* - */ -static void TestGenAddr() -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress: Tests: var(expected) [actual]\n")); - - // the constructors and destructors - GenAddress *ga1 = new GenAddress("1.2.3.4"); // use ipv4 address - ACE_ASSERT(ga1->valid() == 1); - GenAddress ga2(*ga1); // copy constructor; - ACE_ASSERT(ga2.valid() == 1); - GenAddress ga3("localhost"); - ACE_ASSERT(ga3.valid() == 1); - GenAddress ga4; // default constructor - ACE_ASSERT(ga4.valid() == 0); - GenAddress ga5; // default constructor - ACE_ASSERT(ga5.valid() == 0); - GenAddress ga6("127.0.0.1:7"); // udp address - ACE_ASSERT(ga6.valid() == 1); - GenAddress ga7("01234567.89ABcDeF0123"); // ipx address - ACE_ASSERT(ga7.valid() == 1); - IpAddress ip("1.2.3.4"); - ACE_ASSERT(ip.valid() == 1); - GenAddress ga8(ip); // Address conversion - ACE_ASSERT(ga8.valid() == 1); - - const char *ptr = (const char *)ga8; - - ACE_ASSERT(ga1 != 0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga1(\"1.2.3.4\") [%s]\n", - ga1->to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2(ga1) [%s]\n", - ga2.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga3(\"localhost\") [%s]\n", - ga3.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga4(\"\") [%s]\n", - ga4.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga6(\"127.0.0.1:7\") [%s]\n", - ga6.to_string())); - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga7(\"01234567.89ABcDeF0123\") [%s]\n", - ga7.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga8(\"1.2.3.4\") [%s]\n", - ga8.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga8(\"1.2.3.4\") [%s]\n", - ptr)); - - // Test Assignment x = y, y = x - ga5 = ga3; // regular assignment - ga3 = ga3; // self assignment - ACE_ASSERT(ga5 == ga3); - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga5=ga3(\"localhost\") [%s]\n", - ga5.to_string())); - - addr_type a = ga2.get_type(); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"0\") [%d]\n", - a)); - // udp address string - a = ga6.get_type(); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"2\") [%d]\n", - a)); - - // udp address string - a = ga7.get_type(); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) GenAddress:ga2.get_type(\"1\") [%d]\n", - a)); - - delete ga1, ga1 = 0; -} - -/* public methods - IpAddress( const char *inaddr = ""); - IpAddress( const IpAddress &ipaddr); - IpAddress( const GenAddress &genaddr); - ~IpAddress(); - SnmpSyntax& operator=( SnmpSyntax &val); - IpAddress& operator=( const IpAddress &ipaddress); - SnmpSyntax *clone() const; - char *resolve_hostname(int &status); - virtual char *to_string() ; - virtual operator const char *() const; - void mask( const IpAddress& ipaddr); - virtual addr_type get_type() const; - virtual SmiUINT32 get_syntax(); - int is_loopback() const; - int is_multicast() const; - int is_broadcast() const; - int is_arpanet() const; - */ -static void TestIpAddress() -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress: Tests\n")); - - // constructors - GenAddress ga("255.255.255.255"); - IpAddress ia1; - IpAddress ia2("224.2.3.4"); - ACE_ASSERT(ia2.is_multicast()); - ACE_ASSERT(!ia2.is_loopback()); - IpAddress ia3("localhost"); - ACE_ASSERT(ia3.is_loopback()); - ACE_ASSERT(!ia3.is_multicast()); - IpAddress ia4(ia3); - ACE_ASSERT(ia4.is_loopback()); - ACE_ASSERT(!ia4.is_multicast()); - IpAddress ia5(ga); - ACE_ASSERT(ia5.is_broadcast()); - IpAddress ia6 = IpAddress("10.0.0.2"); - ACE_ASSERT(ia6.is_private()); - ACE_ASSERT(!ia6.is_multicast()); - ACE_ASSERT(!ia6.is_loopback()); - - IpAddress ia7("172.16.0.1"); - ACE_ASSERT(ia7.is_private()); - - IpAddress ia8("192.168.0.1"); - ACE_ASSERT(ia8.is_private()); - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia1(\"\") [%s]\n", - ia1.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia2(\"1.2.3.4\") [%s]\n", - ia2.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia3(\"127.0.0.1\") [%s]\n", - ia3.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia4(\"ia3\") [%s]\n", - ia4.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia5(\"255.255.255.255\") [%s]\n", - ia5.to_string())); - - // other routines - int status = 1; - const char *ptr = ia5.resolve_hostname(status); - ACE_ASSERT(status == 0); - ACE_ASSERT(ptr != 0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia5.resolve_hostname():(\"\") [%s]\n", - ptr)); - - // now lets try one we setup with a hostname - ptr = ia3.resolve_hostname(status); - ACE_ASSERT(status == 0); - ACE_ASSERT(ptr != 0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:ia3.resolve_hostname()(\"localhost\") [%s]\n", - ptr)); - - ptr = (const char *)ia5; - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpAddress:(const char *)(\"255.255.255.255\") [%s]\n", - ptr)); - - ia2 = ia3; - ACE_ASSERT(ia2 == ia3); - - ia4.mask(ia3); // mask with equal value should return same - ACE_ASSERT(ia2 == ia3); - - ACE_ASSERT(ia1.get_type() == type_ip); - ACE_ASSERT(ia1.valid() == 0); - ACE_ASSERT(ia2.get_type() == type_ip); - ACE_ASSERT(ia2.valid() == 1); - ACE_ASSERT(ia3.get_type() == type_ip); - ACE_ASSERT(ia3.valid() == 1); - ACE_ASSERT(ia4.get_type() == type_ip); - ACE_ASSERT(ia4.valid() == 1); - ACE_ASSERT(ia5.get_type() == type_ip); - ACE_ASSERT(ia5.valid() == 1); -} - - -// --------------- Netbios --------------- -/* - NetbiosAddress( const char *inaddr = ""); - NetbiosAddress( const NetbiosAddress& nbaddr); - NetbiosAddress( const GenAddress& genaddr); - ~NetbiosAddress(); - virtual char *to_string(); - NetbiosAddress& operator=( const NetbiosAddress &nbaddr); - nb_service get_service_type() const; - void set_service_type(nb_service nbservice); - virtual operator const char *() const; - virtual SmiUINT32 get_syntax(); - SnmpSyntax& operator=( SnmpSyntax &val); - SnmpSyntax *clone() const; - */ -static void TestNetbiosAddress() -{ - NetbiosAddress n1; - ACE_ASSERT(n1.valid() == 0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n1(\"\") [%s]\n", - n1.to_string())); - - NetbiosAddress n2(n1); - ACE_ASSERT(n2.valid() == 0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n2(n1) [%s]\n", - n2.to_string())); - - NetbiosAddress n3("pcname"); - ACE_ASSERT(n3.valid() == 1); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n3(\"pcname\") [%s]\n", - n3.to_string())); - - NetbiosAddress n4("abcdefghigjklmn"); - n4.set_service_type(nb_workstation); - ACE_ASSERT(n4.valid() == 1); - ACE_ASSERT(n4.get_service_type() == nb_workstation); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n4(\"abcdefghigjklmn\") [%s]\n", - n4.to_string())); - - NetbiosAddress n5("abcdefghigjklmno0xx"); - ACE_ASSERT(n5.valid() == 0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) NetbiosAddress:n4(\"abcdefghigjklmno0xx\") [%s]\n", - n5.to_string())); - - n1 = n4; - ACE_ASSERT(n1 == n4); - ACE_ASSERT(strcmp((const char *)n1, (const char *)n4) == 0); - - n1.set_service_type(nb_server); - nb_service x = n1.get_service_type(); - ACE_ASSERT(x == nb_server); -} - -// --------------- IPX --------------- -/* - IpxAddress( void); - IpxAddress( const char *inaddr); - IpxAddress( const IpxAddress &ipxaddr); - IpxAddress( const GenAddress &genaddr); - ~IpxAddress(); - virtual SmiUINT32 get_syntax(); - SnmpSyntax& operator=( SnmpSyntax &val); - IpxAddress& operator=( const IpxAddress &ipxaddress); - int get_hostid( MacAddress& mac); - SnmpSyntax *clone() const; - virtual operator const char *() const; - virtual addr_type get_type() const; - -Ipx Address semantics: Total length must be 21 -// Must have a separator in it -// First string length must be 8 -// Second string length must be 12 -// Each char must take on value 0-F -// -// -// Input formats recognized -// -// XXXXXXXX.XXXXXXXXXXXX -// XXXXXXXX:XXXXXXXXXXXX -// XXXXXXXX-XXXXXXXXXXXX -// XXXXXXXX.XXXXXX-XXXXXX -// XXXXXXXX:XXXXXX-XXXXXX -// XXXXXXXX-XXXXXX-XXXXXX - - */ - -static void TestIpxAddress() -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress: Tests\n")); - IpxAddress xa1; - ACE_ASSERT(xa1.valid() == 0); - ACE_ASSERT(xa1.get_type() == type_ipx); - GenAddress gen("01234567.0123456789AB"); - ACE_ASSERT(gen.valid() == 1); - IpxAddress xa2("01234567.0123456789AB"); - ACE_ASSERT(xa2.get_type() == type_ipx); - ACE_ASSERT(xa2.valid() == 1); - IpxAddress xa3("01234567:0123456789AB"); - ACE_ASSERT(xa3.get_type() == type_ipx); - ACE_ASSERT(xa3.valid() == 1); - IpxAddress xa4("01234567-0123456789AB"); - ACE_ASSERT(xa4.get_type() == type_ipx); - ACE_ASSERT(xa4.valid() == 1); - IpxAddress xa5("01234567.012345-6789AB"); - ACE_ASSERT(xa5.get_type() == type_ipx); - ACE_ASSERT(xa5.valid() == 1); - IpxAddress xa6("01234567:012345-6789AB"); - ACE_ASSERT(xa6.get_type() == type_ipx); - ACE_ASSERT(xa6.valid() == 1); - IpxAddress xa7("01234567-012345-6789AB"); - ACE_ASSERT(xa7.get_type() == type_ipx); - ACE_ASSERT(xa7.valid() == 1); - IpxAddress xa8("01234567."); - ACE_ASSERT(xa8.get_type() == type_ipx); - ACE_ASSERT(xa8.valid() == 0); - IpxAddress xa9(gen); - ACE_ASSERT(xa9.valid() == 1); - IpxAddress *xa10 = new IpxAddress(xa9); - ACE_ASSERT(xa10->get_type() == type_ipx); - ACE_ASSERT(xa10->valid() == 1); - delete xa10; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa1(\"\") [%s]\n", - xa1.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa2(\"01234567.0123456789AB\") [%s]\n", - xa2.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa3(\"01234567:0123456789A\") [%s]\n", - xa3.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa4(\"01234567-0123456789AB\") [%s]\n", - xa4.to_string())); - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa5(\"01234567.012345-6789AB\") [%s]\n", - xa5.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa6(\"01234567:012345-6789AB\") [%s]\n", - xa6.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa7(\"01234567-012345-6789AB\") [%s]\n", - xa7.to_string())); - - // assignment - xa1 = xa3; - ACE_ASSERT(xa1 == xa3); - MacAddress mac; - ACE_ASSERT(xa4.get_hostid(mac) == 1); - ACE_ASSERT(mac.valid() == 1); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa4:get_hostid(\"01:23:45:67:89:ab\") [%s]\n", mac.to_string())); - - const char *ptr = (const char *)xa7; - ACE_DEBUG ((LM_DEBUG, "(%P|%t) IpxAddress:xa7-ptr(\"01234567-012345-6789AB\") [%s]\n", ptr)); - -} - -/* - MacAddress( void); - - MacAddress( const char *inaddr); - MacAddress( const MacAddress &macaddr); - MacAddress( const GenAddress &genaddr); - ~MacAddress(); -* SmiUINT32 get_syntax(); -* SnmpSyntax& operator=( SnmpSyntax &val); - MacAddress& operator=( const MacAddress &macaddress); -* SnmpSyntax *clone() const; - virtual char *to_string(); - virtual operator const char *() const; - virtual addr_type get_type() const; - unsigned int hashFunction() const; - -// MAC address format -// -// MAC ADDRESS -// 01 02 03 04 05 06 -// XX:XX:XX:XX:XX:XX -// Valid input format -// -// XXXXXXXXXXXX -// Total length must be 17 -// Each char must take on value 0-F -// - -*/ - -static void TestMacAddress() -{ - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) MacAddress: Tests\n")); - - MacAddress ma1; - ACE_ASSERT(ma1.valid() == 0); - ACE_ASSERT(ma1.get_type() == type_mac); - MacAddress ma2("01:23:45:67:89:AB"); - ACE_ASSERT(ma2.valid() == 1); - ACE_ASSERT(ma2.get_type() == type_mac); - MacAddress ma3("0123456789ABCEFGHI"); // invalid string - ACE_ASSERT(ma3.valid() == 0); - ACE_ASSERT(ma3.get_type() == type_mac); - GenAddress ga("01:23:45:67:89:AB"); // mac address - MacAddress ma4(ma2); - ACE_ASSERT(ma4.valid() == 1); - ACE_ASSERT(ma4.get_type() == type_mac); - MacAddress ma5(ga); - ACE_ASSERT(ma5.valid() == 0); - ACE_ASSERT(ma5.get_type() == type_mac); - - ma1 = ma2; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) MacAddress:ma1(\"01:23:45:67:89:AB\") [%s]\n", - ma1.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) MacAddress:ma2(\"01:23:45:67:89:AB\") [%s]\n", - ma2.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) MacAddress:ma3(\"\") [%s]\n", - ma3.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) MacAddress:ma4(\"01:23:45:67:89:AB\") [%s]\n", - ma4.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) MacAddress:ma5(\"\") [%s]\n", - ma5.to_string())); - const char * ptr = (const char *)ma5; - ACE_DEBUG ((LM_DEBUG, "(%P|%t) MacAddress:ma5(\"\") [%s]\n", - ptr)); - - // hashFunction crashes if not usedwith valid fn - int x = ma2.hashFunction(); - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) MacAddress:ma2.hashFunction(\"483201\") [%d]\n", - x)); -} - -/* - UdpAddress( void); - UdpAddress( const char *inaddr); - UdpAddress( const UdpAddress &udpaddr); - UdpAddress( const GenAddress &genaddr); - UdpAddress( const IpAddress &ipaddr); - ~UdpAddress(); - SmiUINT32 get_syntax(); - SnmpSyntax& operator=( SnmpSyntax &val); - UdpAddress& operator=( const UdpAddress &udpaddr); - SnmpSyntax *clone() const; - virtual char *to_string() ; - virtual operator const char *() const; - void set_port( const unsigned short p); - unsigned short get_port() const; - virtual addr_type get_type() const; - - // look for port info @ the end of the string - // port can be delineated by a ':' or a '/' - // if neither are present then just treat it - // like a normal IpAddress - - */ - -static void TestUdpAddress() -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress: Tests\n")); - - UdpAddress ua1; - ACE_ASSERT(ua1.valid() == 0); - ACE_ASSERT(ua1.get_type() == type_udp); - - // semantics of not setting the port here are bizzare? - UdpAddress ua2("127.0.0.1:161"); - ACE_ASSERT(ua2.valid() == 1); - ACE_ASSERT(ua2.get_type() == type_udp); - - UdpAddress ua3(ua2); - ACE_ASSERT(ua3.valid() == 1); - ACE_ASSERT(ua3.get_type() == type_udp); - - GenAddress ga("localhost"); - UdpAddress ua4(ga); - ACE_ASSERT(ua4.valid() == 1); - ACE_ASSERT(ua4.get_type() == type_udp); - - IpAddress ia("localhost"); - UdpAddress ua5(ga); - ACE_ASSERT(ua5.valid() == 1); - ACE_ASSERT(ua5.get_type() == type_udp); - - UdpAddress *ua6 = new UdpAddress("localhost:161"); - ACE_ASSERT(ua6->valid() == 1); - ACE_ASSERT(ua6->get_type() == type_udp); - - UdpAddress ua7 = UdpAddress("localhost/162"); - ACE_ASSERT(ua7.valid() == 1); - ACE_ASSERT(ua7.get_type() == type_udp); - - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua1(\"\") [%s]\n", - ua1.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua2(\"127.0.0.1:161\") [%s]\n", - ua2.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua3(ua2)(\"127.0.0.1:161\") [%s]\n", - ua3.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua4(GenAddress)(\"127.0.0.1\") [%s]\n", - ua4.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua5(IpAddress)(\"127.0.0.1\") [%s]\n", - ua5.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua6()(\"localhost:161\") [%s]\n", - ua6->to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua7()(\"localhost/162\") [%s]\n", - ua7.to_string())); - - delete ua6; // destructor - - // assignement tests. - ua1 = ua2; - ACE_ASSERT(ua1 == ua2); - ACE_ASSERT(ua1.valid() == 1); - ua1 = ua1; - ACE_ASSERT(ua1 == ua1); - ACE_ASSERT(ua1.valid() == 1); - - // set/get port - ua1.set_port(333); - ACE_ASSERT(ua1.get_port() == 333); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpAddress:ua1.set_port()(\"333\") [%s]\n", - (const char *)ua1)); - -} - -int -main (int, char *[]) -{ - ACE_START_TEST ("Address_Test"); - - TestGenAddr(); - TestIpAddress(); - TestUdpAddress(); - TestMacAddress(); - TestNetbiosAddress(); - TestIpxAddress(); - - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/Counter64_Test.cpp b/ASNMP/tests/Counter64_Test.cpp deleted file mode 100644 index cfb337409eb..00000000000 --- a/ASNMP/tests/Counter64_Test.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Counter64_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the Counter64 class. An Object -// representing an ASN.1 Counter64 SMI 64 bit Integer SYNTAX. -// (SNMPv2c) -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - - -#include "ace/OS.h" -#include "asnmp/ctr64.h" -#include "test_config.h" - -ACE_RCSID(tests, Counter64_Test, "$Id$") - -// TODO: verify this with ACE folks -#if defined(_WIN32) -#define LLONG __int64 -#else -#define LLONG long long -#define ULLONG unsigned long long -#endif - -/* - Counter64( unsigned long long llw = 0); - Counter64( unsigned long hiparm, unsigned long loparm); - Counter64( const Counter64 &ctr64); - ~Counter64(); - SmiUINT32 get_syntax(); - long double to_long_double() const; - Counter64& assign( long double ld); - unsigned long high() const; - unsigned long low() const; - void set_high( const unsigned long h); - void set_low( const unsigned long l); - Counter64& operator=( const unsigned long long rhs); - Counter64& operator=( const Counter64 &rhs); - char *to_string(); - SnmpSyntax *clone() const; - SnmpSyntax& operator=( SnmpSyntax &val); - int valid() const; - operator unsigned long long(); - */ - -static void TestCounter64() -{ - static unsigned long ul = ULONG_MAX; - LLONG ll = (LLONG) 0x7fffffffffffffff; - LLONG mll = (LLONG) ((-ll) - 1); - ULLONG ull = (ULLONG) 0xffffffffffffffff; - long double ld = (LLONG) ll; - - cerr << "max unsigned long long is " << ull << endl; - cerr << "max long long is " << ll << endl; - cerr << "min long long is " << mll << endl; - - Counter64 c1; - ACE_ASSERT(c1.valid() == 1); - Counter64 c2(ul, ul); - ACE_ASSERT(c2.valid() == 1); - ACE_ASSERT(c2.high() == ul); - ACE_ASSERT(c2.low() == ul); - - Counter64 c3(ul); - ACE_ASSERT(c3.valid() == 1); - ACE_ASSERT(c3.low() == ul); - - Counter64 c4(c2); - ACE_ASSERT(c4.valid() == 1); - ACE_ASSERT(c4.high() == ul); - ACE_ASSERT(c4.low() == ul); - - Counter64 c5(0); - ACE_ASSERT(c5.valid() == 1); - - Counter64 c6; - c6.assign(ld); - ACE_ASSERT(c6.to_long_double() == ld); - - Counter64 c7(ull); - ACE_ASSERT(c7 == ull); - - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c1(\"\") [%s]\n", - c1.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c2(LONG_MAX,LONG_MAX) [%s]\n", - c2.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c3(LONG_MAX) [%s]\n", - c3.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c4(c2) [%s]\n", - c4.to_string())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c5(0) [%s]\n", - c5.to_string())); - - // misc routines - c1.set_low(1); - c1.set_high(2); - ACE_ASSERT(c1.low() == 1); - ACE_ASSERT(c1.high() == 2); - // assignment - c5 = c4; - ACE_ASSERT(c5 == c4); - c4 = c4; - ACE_ASSERT(c5 == c4); - c5 = ll; - ACE_ASSERT(c5 == ll); - // try simple arithmetic (needs more test cases) - c5 = mll; - c5 = c5 + (ULLONG) 10; - ACE_ASSERT(c5 == (mll + 10)); -} - -int -main (int, char *[]) -{ - ACE_START_TEST ("Counter64_Test"); - - TestCounter64(); - - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/Counter_Test.cpp b/ASNMP/tests/Counter_Test.cpp deleted file mode 100644 index 0538261cb8d..00000000000 --- a/ASNMP/tests/Counter_Test.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Counter_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the Counter class. An Object -// representing an ASN.1 Counter SMI COUNTER SYNTAX. -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - - -#include "ace/OS.h" -#include "asnmp/counter.h" -#include "test_config.h" - -ACE_RCSID(tests, Counter_Test, "$Id$") - -/* - Counter32( void); - Counter32( const unsigned long i); - Counter32( const Counter32 &c); -* SmiUINT32 get_syntax(); -* SnmpSyntax *clone() const; -* SnmpSyntax& operator=( SnmpSyntax &val); - Counter32& operator=( const Counter32 &uli); - Counter32& operator=( const unsigned long i); - operator unsigned long(); - - -- comments tyis type appears to be a wrapper class and not - a true SNMP counter. Practical for nms side,yet may lead to - some confusion if implementing an agent with this class. - - Per RFC 1155 sec 3.2.3.3 - This application-wide type represents a non-negative integer which - monotonically increases until it reaches a maximum value, when it - wraps around and starts increasing again from zero. This memo - specifies a maximum value of 2^32-1 for counters -*/ - -static void TestCounter() -{ - long l = LONG_MAX, nl = LONG_MIN; // limits.h - unsigned long ul = ULONG_MAX, def = 0; - int i = INT_MAX, ni = INT_MIN; - unsigned int ui = UINT_MAX; - unsigned short us = 10; - short si = 65535; - - // constructors - Counter32 c1; - ACE_ASSERT(c1 == def); - Counter32 c2(l); - ACE_ASSERT(c2 == l); - Counter32 c3(nl); - ACE_ASSERT(c3 == nl); - Counter32 c4(ul); - ACE_ASSERT(c4 == ul); - Counter32 c5(i); - ACE_ASSERT(c5 == i); - Counter32 c6(ni); - ACE_ASSERT(c6 == ni); - Counter32 c7(ui); - ACE_ASSERT(c7 == ui); - Counter32 *c8 = new Counter32(c5); - ACE_ASSERT(c8 != 0); - delete c8; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c1(\"\") [%u]\n", - (unsigned long)c1)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c2(\"%u\") [%u]\n", - l, (unsigned long)c2)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c3(\"%u\") [%u]\n", - nl, (unsigned long)c3)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c4(\"%u\") [%u]\n", - ul, (unsigned long)c4)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c5(\"%u\") [%u]\n", - i, (unsigned long)c5)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c6(\"%u\") [%u]\n", - ni, (unsigned long)c6)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) c7(\"%u\") [%u]\n", - ui, (unsigned long)c7)); - - // assignent - c1 = c2; // obj - ACE_ASSERT(c1 == c2); - c1 = c1; // self - ACE_ASSERT(c1 == c1); - c1 = def; // unsigned long - ACE_ASSERT(c1 == def); - c1 = us; // unsigned short - ACE_ASSERT(c1 == us); - c1 = si; // unsigned short - ACE_ASSERT(c1 == si); - -} - - -int -main (int, char *[]) -{ - ACE_START_TEST ("Counter_Test"); - - TestCounter(); - - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/Gauge_Test.cpp b/ASNMP/tests/Gauge_Test.cpp deleted file mode 100644 index a607d58c1b7..00000000000 --- a/ASNMP/tests/Gauge_Test.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Guage_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the Guage class. An Object -// representing an ASN.1 Counter SMI GUAGE SYNTAX. -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - -#include "ace/OS.h" -#include "asnmp/gauge.h" -#include "test_config.h" - -ACE_RCSID(tests, Gauge_Test, "$Id$") - -/* - Gauge32( void); - Gauge32( const unsigned long i); - Gauge32 ( const Gauge32 &g); - ~Gauge32(); - SmiUINT32 get_syntax(); - SnmpSyntax *clone() const; - Gauge32& operator=( const Gauge32 &uli); - Gauge32& operator=( const unsigned long i); - operator unsigned long(); - SnmpSyntax& operator=( SnmpSyntax &val); - --- What is a Gauge? According to RFC 1155 section: 3.2.3.4 - This application-wide type represents a non-negative integer - which may increase or decreae, but which latches at a maximum - value of 2^32-1 (4294967295 dec) for gauges. - */ -static void TestGuage() -{ - long l = LONG_MAX, nl = LONG_MIN; // limits.h - unsigned long ul = ULONG_MAX, def = 0; - int i = INT_MAX, ni = INT_MIN; - unsigned int ui = UINT_MAX; - unsigned short us = 10; - short si = 65535; - - // constructors - Gauge32 g1; - ACE_ASSERT(g1 == def); - Gauge32 g2(l); - ACE_ASSERT(g2 == l); - Gauge32 g3(nl); - ACE_ASSERT(g3 == nl); - Gauge32 g4(ul); - ACE_ASSERT(g4 == ul); - Gauge32 g5(i); - ACE_ASSERT(g5 == i); - Gauge32 g6(ni); - ACE_ASSERT(g6 == ni); - Gauge32 g7(ui); - ACE_ASSERT(g7 == ui); - Gauge32 *g8 = new Gauge32(g5); - ACE_ASSERT(g8 != 0); - delete g8; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) g1(\"\") [%u]\n", - (unsigned long)g1)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) g2(\"%u\") [%u]\n", - l, (unsigned long)g2)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) g3(\"%u\") [%u]\n", - nl, (unsigned long)g3)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) g4(\"%u\") [%u]\n", - ul, (unsigned long)g4)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) g5(\"%u\") [%u]\n", - i, (unsigned long)g5)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) g6(\"%u\") [%u]\n", - ni, (unsigned long)g6)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) g7(\"%u\") [%u]\n", - ui, (unsigned long)g7)); - - // assignent - g1 = g2; // obj - ACE_ASSERT(g1 == g2); - g1 = g1; // self - ACE_ASSERT(g1 == g1); - g1 = def; // unsigned long - ACE_ASSERT(g1 == def); - g1 = us; // unsigned short - ACE_ASSERT(g1 == us); - g1 = si; // unsigned short - ACE_ASSERT(g1 == si); -} - -int -main (int, char *[]) -{ - ACE_START_TEST ("Guage_Test"); - - TestGuage(); - - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/Integer_Test.cpp b/ASNMP/tests/Integer_Test.cpp deleted file mode 100644 index c289425d8ea..00000000000 --- a/ASNMP/tests/Integer_Test.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Integer_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the Integer class. An Object -// representing an ASN.1 Integer64 SMI 32 bit Integer SYNTAX. -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - - -#include "ace/OS.h" -#include "asnmp/integer.h" -#include "test_config.h" - -ACE_RCSID(tests, Integer_Test, "$Id$") - -static long l = LONG_MAX, nl = LONG_MIN; // limits.h -static unsigned long ul = ULONG_MAX, def = 0; -static int i = INT_MAX, ni = INT_MIN; -static unsigned int ui = UINT_MAX; -static unsigned short us = 10; -static short si = 65535; - -/* - SnmpInt32( void); - SnmpInt32 (const long i); - SnmpInt32 (const SnmpInt32 &c); - virtual ~SnmpInt32(); - virtual SmiUINT32 get_syntax(); - SnmpInt32& operator=( const long i); - SnmpInt32& operator=( const SnmpInt32 &li); - operator long(); - char *to_string(); - SnmpSyntax *clone() const; - SnmpSyntax& operator=( SnmpSyntax &val); - int valid() const; - */ - -static void TestInteger32() -{ - - // constructors - SnmpInt32 i1; - ACE_ASSERT(i1 == def); - SnmpInt32 i2(l); - ACE_ASSERT(i2 == l); - SnmpInt32 i3(nl); - ACE_ASSERT(i3 == nl); - SnmpInt32 i4(ul); - ACE_ASSERT(i4 == ul); - SnmpInt32 i5(i); - ACE_ASSERT(i5 == i); - SnmpInt32 i6(ni); - ACE_ASSERT(i6 == ni); - SnmpInt32 i7(ui); - ACE_ASSERT(i7 == ui); - SnmpInt32 *i8 = new SnmpInt32(i5); - ACE_ASSERT(i8 != 0); - delete i8; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) i1(\"\") [%u]\n", - (unsigned long)i1)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) i2(\"%u\") [%u]\n", - l, (unsigned long)i2)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) i3(\"%u\") [%u]\n", - nl, (unsigned long)i3)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) i4(\"%u\") [%u]\n", - ul, (unsigned long)i4)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) i5(\"%u\") [%u]\n", - i, (unsigned long)i5)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) i6(\"%u\") [%u]\n", - ni, (unsigned long)i6)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) i7(\"%u\") [%u]\n", - ui, (unsigned long)i7)); - - // assignent - i1 = i2; // obj - ACE_ASSERT(i1 == i2); - i1 = i1; // self - ACE_ASSERT(i1 == i1); - i1 = def; // unsigned long - ACE_ASSERT(i1 == def); - i1 = us; // unsigned short - ACE_ASSERT(i1 == us); - i1 = si; // unsigned short - ACE_ASSERT(i1 == si); -} - -/* - SnmpUInt32( void); - SnmpUInt32 (const unsigned long i); - SnmpUInt32( const SnmpUInt32 &c); - virtual ~SnmpUInt32(); - virtual SmiUINT32 get_syntax(); - SnmpUInt32& operator=( const unsigned long i); - SnmpUInt32& operator=( const SnmpUInt32 &uli); - operator unsigned long(); - virtual char *to_string(); - virtual SnmpSyntax *clone() const; - SnmpSyntax& operator=( SnmpSyntax &val); - int valid() const; - */ -static void TestUnsignedInteger32() -{ - // constructors - SnmpUInt32 u1; - ACE_ASSERT(u1 == def); - SnmpUInt32 u2(l); - ACE_ASSERT(u2 == l); - SnmpUInt32 u3(nl); - ACE_ASSERT(u3 == nl); - SnmpUInt32 u4(ul); - ACE_ASSERT(u4 == ul); - SnmpUInt32 u5(i); - ACE_ASSERT(u5 == i); - SnmpUInt32 u6(ni); - ACE_ASSERT(u6 == ni); - SnmpUInt32 u7(ui); - ACE_ASSERT(u7 == ui); - SnmpUInt32 *u8 = new SnmpUInt32(u5); - ACE_ASSERT(u8 != 0); - delete u8; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) u1(\"\") [%u]\n", - (unsigned long)u1)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) u2(\"%u\") [%u]\n", - l, (unsigned long)u2)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) u3(\"%u\") [%u]\n", - nl, (unsigned long)u3)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) u4(\"%u\") [%u]\n", - ul, (unsigned long)u4)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) u5(\"%u\") [%u]\n", - i, (unsigned long)u5)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) u6(\"%u\") [%u]\n", - ni, (unsigned long)u6)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) u7(\"%u\") [%u]\n", - ui, (unsigned long)u7)); - - // assignent - u1 = u2; // obj - ACE_ASSERT(u1 == u2); - u1 = u1; // self - ACE_ASSERT(u1 == u1); - u1 = def; // unsigned long - ACE_ASSERT(u1 == def); - u1 = us; // unsigned short - ACE_ASSERT(u1 == us); - u1 = si; // unsigned short - ACE_ASSERT(u1 == si); -} - -int -main (int, char *[]) -{ - ACE_START_TEST ("Integer_Test"); - - TestInteger32(); - - TestUnsignedInteger32(); - - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/Makefile b/ASNMP/tests/Makefile deleted file mode 100644 index 3fc2c93f85f..00000000000 --- a/ASNMP/tests/Makefile +++ /dev/null @@ -1,242 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id$ -# -# Makefile for all the ACE+SNMP ``one-button' tests -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -# ACE+SNMP before -lACE - -BIN = Oid_Test \ - Counter_Test \ - Counter64_Test \ - Integer_Test \ - Octet_Test \ - Gauge_Test \ - Address_Test \ - Target_Test \ - Varbind_Test -CCFLAGS = -I$(ACE_ROOT)/ASNMP/ - -LSRC = $(addsuffix .cpp,$(BIN)) -LDLIBS := -L$(ACE_ROOT)/ASNMP/asnmp -lasnmp $(LDLIBS:%=%$(VAR)) - -# For make depend: -PSRC = -I.. - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - - -.obj/Oid_Test.o .obj/Oid_Test.so .shobj/Oid_Test.o .shobj/Oid_Test.so: Oid_Test.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/oid.h ../asnmp/smival.h ../asnmp/smi.h test_config.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i - -.obj/Counter_Test.o .obj/Counter_Test.so .shobj/Counter_Test.o .shobj/Counter_Test.so: Counter_Test.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/counter.h ../asnmp/smival.h ../asnmp/smi.h \ - ../asnmp/integer.h test_config.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i - -.obj/Counter64_Test.o .obj/Counter64_Test.so .shobj/Counter64_Test.o .shobj/Counter64_Test.so: Counter64_Test.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/ctr64.h ../asnmp/smival.h ../asnmp/smi.h test_config.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i - -.obj/Integer_Test.o .obj/Integer_Test.so .shobj/Integer_Test.o .shobj/Integer_Test.so: Integer_Test.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/integer.h ../asnmp/smival.h ../asnmp/smi.h test_config.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i - -.obj/Octet_Test.o .obj/Octet_Test.so .shobj/Octet_Test.o .shobj/Octet_Test.so: Octet_Test.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/octet.h ../asnmp/smival.h ../asnmp/smi.h test_config.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i - -.obj/Gauge_Test.o .obj/Gauge_Test.so .shobj/Gauge_Test.o .shobj/Gauge_Test.so: Gauge_Test.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/gauge.h ../asnmp/integer.h ../asnmp/smival.h ../asnmp/smi.h \ - test_config.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i - -.obj/Address_Test.o .obj/Address_Test.so .shobj/Address_Test.o .shobj/Address_Test.so: Address_Test.cpp ../asnmp/address.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/smival.h ../asnmp/smi.h ../asnmp/octet.h test_config.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i - -.obj/Target_Test.o .obj/Target_Test.so .shobj/Target_Test.o .shobj/Target_Test.so: Target_Test.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/octet.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/target.h \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/INET_Addr.i \ - ../asnmp/address.h ../asnmp/oid.h test_config.h - -.obj/Varbind_Test.o .obj/Varbind_Test.so .shobj/Varbind_Test.o .shobj/Varbind_Test.so: Varbind_Test.cpp \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/pre.h \ - $(ACE_ROOT)/ace/post.h \ - $(ACE_ROOT)/ace/ACE_export.h \ - $(ACE_ROOT)/ace/svc_export.h \ - $(ACE_ROOT)/ace/Min_Max.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - ../asnmp/oid.h ../asnmp/smival.h ../asnmp/smi.h ../asnmp/vb.h \ - ../asnmp/snmperrs.h ../asnmp/timetick.h ../asnmp/integer.h \ - ../asnmp/counter.h ../asnmp/gauge.h ../asnmp/ctr64.h ../asnmp/octet.h \ - ../asnmp/address.h test_config.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/ASNMP/tests/Octet_Test.cpp b/ASNMP/tests/Octet_Test.cpp deleted file mode 100644 index 7aa032b5223..00000000000 --- a/ASNMP/tests/Octet_Test.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Octet_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the OCTET class. An Object -// representing an ASN.1 Integer64 SMI OCTET STRING SYNTAX. -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ - -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - - -#include "ace/OS.h" -#include "asnmp/octet.h" -#include "test_config.h" - -ACE_RCSID(tests, Octet_Test, "$Id$") - -/* - OctetStr( const char *string, long size = -1); - OctetStr ( const OctetStr &octet); - ~OctetStr(); - - SmiUINT32 get_syntax(); - void set_data( const SmiBYTE* string, long int size = -1); - OctetStr& operator=( const char *string); - OctetStr& operator=( const OctetStr &octet); - - int operator==( const OctetStr &lhs, const OctetStr &rhs); - int operator!=( const OctetStr &lhs, const OctetStr &rhs); - int operator<( const OctetStr &lhs, const OctetStr &rhs); - int operator<=( const OctetStr &lhs,const OctetStr &rhs); - int operator>( const OctetStr &lhs, const OctetStr &rhs); - int operator>=( const OctetStr &lhs, const OctetStr &rhs); - int operator==( const OctetStr &lhs,const char *rhs); - int operator!=( const OctetStr &lhs,const char *rhs); - int operator<( const OctetStr &lhs,const char *rhs); - int operator<=( const OctetStr &lhs,char *rhs); - int operator>( const OctetStr &lhs,const char *rhs); - int operator>=( const OctetStr &lhs,const char *rhs); - OctetStr& operator+=( const SmiBYTE *a); - OctetStr& operator+=( const char c); - OctetStr& operator+=( const OctetStr& octetstr); - SmiBYTE& operator[]( int position); - int nCompare( const long n, const OctetStr &o) const; - size_t length() const ; - int valid() const; - SmiBYTE *data() const; - char *to_string(); - char *to_string_hex(); - SnmpSyntax *clone() const; - SnmpSyntax& operator=( SnmpSyntax &val); - */ - -static void TestOctet() -{ - char *str = "A test of octet strings...!@@#$%^&*()_+|~{}:,./<>?"; - OctetStr o1; - ACE_ASSERT(o1.valid() == 1); - ACE_ASSERT(o1.length() == 0); - ACE_ASSERT(o1.data() != (unsigned char *)0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Octet:o1(\"\") [%s]\n", - o1.to_string())); - o1.set_data((SmiBYTE *)str); - ACE_ASSERT(!ACE_OS::strcmp(str, (char *)o1.data())); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Octet:o1(\"str\") [%s]\n", - o1.to_string())); - - OctetStr o2(str); - ACE_ASSERT(o2.valid() == 1); - ACE_ASSERT(o2.data() != (unsigned char *)0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Octet:o2(\"str\") [%s]\n", - o2.to_string())); - - OctetStr o3(str, 4); // test setting less than full string length - ACE_ASSERT(o3.valid() == 1); - ACE_ASSERT(o3.length() == 4); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Octet:o3(\"A te\") [%s]\n", - o3.to_string())); - - OctetStr o4(o3); // test setting less than full string length - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Octet:o4(\"A te\") [%s]\n", - o4.to_string())); - ACE_ASSERT(o4.valid() == 1); - ACE_ASSERT(o4.length() == 4); - - OctetStr o5; - o5 = str; - ACE_ASSERT(o5.valid() == 1); - ACE_ASSERT(o5.length() == ACE_OS::strlen(str)); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Octet:o5(\"str\") [%s]\n", - o5.to_string())); - - OctetStr o6; - o6 = o5; - ACE_ASSERT(o6.valid() == 1); - ACE_ASSERT(o5.length() == o6.length()); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Octet:o6(\"str\") [%s]\n", - o6.to_string())); - - o6 += o3; - o6 = ""; - o6 += str; - o6 += '#'; - ACE_ASSERT(o6[0] == (SmiBYTE) 'A'); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Octet:o6(\"str\") [%s]\n", - o6.to_string())); - - ACE_ASSERT(!(o3 < o3)); - ACE_ASSERT(!(o3 > o3)); - ACE_ASSERT(o3 >= o3); - ACE_ASSERT(o3 <= o3); - ACE_ASSERT(o3 == o3); - ACE_ASSERT(!(o3 != o3)); - -} - -int -main (int, char *[]) -{ - ACE_START_TEST ("Octet_Test"); - - TestOctet(); - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/Oid_Test.cpp b/ASNMP/tests/Oid_Test.cpp deleted file mode 100644 index c195b0a7105..00000000000 --- a/ASNMP/tests/Oid_Test.cpp +++ /dev/null @@ -1,181 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// Oid_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the Oid class. An Object -// representing an ASN.1 Integer64 SMI OID SYNTAX. -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - -#include "ace/OS.h" -#include "asnmp/oid.h" -#include "test_config.h" - -ACE_RCSID(tests, Oid_Test, "$Id$") - -/* - Oid( const char * dotted_oid_string = "", size_t size = -1); - Oid ( const Oid &oid); - Oid(const unsigned long *raw_oid, size_t oid_len); - ~Oid(); - - SmiUINT32 get_syntax(); - Oid& operator=( const Oid &oid); - int operator==( const Oid &lhs,const Oid &rhs); - int operator!=( const Oid &lhs,const Oid &rhs); - int operator<( const Oid &lhs,const Oid &rhs); - int operator<=( const Oid &lhs,const Oid &rhs); - int operator>( const Oid &lhs,const Oid &rhs); - int operator>=( const Oid &lhs,const Oid &rhs); - Oid& operator+=( const char *a); - Oid& operator+=( const unsigned long i); - Oid& operator+=( const Oid &o); - unsigned long & operator[]( size_t position); - SmiLPOID oidval(); - void set_data( const char *dotted_oid_string); - void set_data( const unsigned long *raw_oid, const size_t oid_len); - size_t length() const; - void trim( const size_t how_many = 1); - int suboid( const size_t start, const size_t end, Oid& new_oid); - int left_comparison( const unsigned long n, const Oid &o) const; - int right_comparison( const unsigned long n, const Oid &o) const; - int valid() const; - char *to_string(); - SnmpSyntax *clone() const; - SnmpSyntax& operator=( SnmpSyntax &val); - */ - -static void OidTest() -{ - Oid d1; - ACE_ASSERT(d1.valid() == 0); - ACE_ASSERT(d1.length() == 0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:d1(\"\") [%s]\n", - d1.to_string())); - - Oid d2("1.2.3"); - ACE_ASSERT(d2.valid() == 1); - ACE_ASSERT(d2.length() == 3); - ACE_ASSERT(d2[0] == (unsigned long) 1); - ACE_ASSERT(d2[1] == (unsigned long) 2); - ACE_ASSERT(d2[2] == (unsigned long) 3); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:d2(\"1.2.3\") [%s]\n", - d2.to_string())); - - Oid d3(d2); - ACE_ASSERT(d3.valid() == 1); - ACE_ASSERT(d3.length() == 3); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:d3(\"d2\") [%s]\n", - d3.to_string())); - - unsigned long t[3] = {2,3,4}; - Oid d4((unsigned long *)&t, sizeof(t)/sizeof(long)); - ACE_ASSERT(d4.valid() == 1); - ACE_ASSERT(d4.length() == 3); - ACE_ASSERT(d4[0] == (unsigned long) 2); - ACE_ASSERT(d4[1] == (unsigned long) 3); - ACE_ASSERT(d4[2] == (unsigned long) 4); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:d4(\"long(2.3.4)\") [%s]\n", - d4.to_string())); - - // suboid - Oid d5; - ACE_ASSERT(d4.suboid(d5, 1,1) == 0); // 2,3,4, 1,1 == 3 - ACE_ASSERT(d5.length() == 1); - ACE_ASSERT(d5.valid() == 1); - ACE_ASSERT(d5[0] == 3); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:d6::suboid(d5,1,1) [%s]\n", - d5.to_string())); - - // trim - Oid d7(d4); - ACE_ASSERT(d7.valid() == 1); - d7.trim(); - ACE_ASSERT(d7.length() == d4.length() -1); - - // compare methods - ACE_ASSERT(d7.left_comparison( d7.length(), d7) == 0); - ACE_ASSERT(d4.right_comparison( d4.length(), d4) == 0); - - // assignment - d1 = d4; - ACE_ASSERT(d1.valid() == 1); - ACE_ASSERT(d1 == d4); - d2 = "5.6.7"; - ACE_ASSERT(d2.valid() == 1); - ACE_ASSERT(d2[2] == (unsigned long) 7); - d1 = "8.9.10"; - ACE_ASSERT(d1.valid() == 1); - - // concat - unsigned long ll = ULONG_MAX; - d1 = ""; - d1 += (unsigned long)0; - d1 += ll; - d1 += ll; - d1 += "0"; - ACE_ASSERT(d1.valid() == 1); - ACE_ASSERT(d1.length() == 4); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:d1(0,max,max,0) [%s]\n", - d1.to_string())); - ACE_ASSERT(d1[0] == (unsigned long)0); - ACE_ASSERT(d1[1] == ll); - ACE_ASSERT(d1[2] == ll); - ACE_ASSERT(d1[3] == (unsigned long)0); - - d2 += d1; - ACE_ASSERT(d2.valid() == 1); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Oid:(5.6.7.8.9.10) [%s]\n", - d2.to_string())); - - // test out max Oid string... - - // relational operators oid,oid - ACE_ASSERT(d2 == d2); - ACE_ASSERT(!(d2 != d2)); - ACE_ASSERT(!(d2 < d2)); - ACE_ASSERT(!(d2 > d2)); - ACE_ASSERT(d2 >= d2); - ACE_ASSERT(d2 <= d2); - -} - -int -main (int, char *[]) -{ - ACE_START_TEST ("Oid_Test"); - OidTest(); - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/Target_Test.cpp b/ASNMP/tests/Target_Test.cpp deleted file mode 100644 index dbbc848e401..00000000000 --- a/ASNMP/tests/Target_Test.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Target_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the Target class. -// Not sure if this object is really required or not in the new framework -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ - -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - - -#include "ace/OS.h" -#include "asnmp/octet.h" -#include "asnmp/target.h" -#include "test_config.h" - -ACE_RCSID(tests, Target_Test, "$Id$") - -/* - Percieved Problems with this CTarget aka UdpTarget Interface: - - 1) can't set snmp version during constructor (default value?) - 2) doesn't use ANSI C++ String class (still uses char *) - 3) Makes it easy to mix up read and write comm strs (could be diff types) - 3) so many get/set's, leads one to rethink the design/use of UdpTarget - 4) Use of resolve_to_C smells like a HACK... - 5) No valid() member function returns 1 even if no address given.. - 6) No to_string()?! (Fixed) - 7) can't access retry, timeout parameters... - 8) can't assign or equate two UdpTargets - - UdpTarget( void); - UdpTarget( const Address &address); - UdpTarget( const UdpTarget &target); - UdpTarget( const Address &address, // address - const char *read_community_name, // read community name - const char *write_community_name); // write community name - UdpTarget( const Address &address, // address - const OctetStr &read_community_name, // read community - const OctetStr &write_community_name); // write community - ~UdpTarget(); - - SnmpTarget *clone() const; - void get_readcommunity( OctetStr& read_community_oct); - void set_readcommunity( const OctetStr& read_community); - void get_writecommunity( OctetStr &write_community_oct); - void set_writecommunity( const OctetStr& write_community); - void get_address( UdpAddress & address); - int set_address( Address &address); - snmp_version get_version(); - void set_version( const snmp_version v); - - UdpTarget& operator=( const UdpTarget& target); - friend int operator==( const UdpTarget &lhs, const UdpTarget &rhs); - - */ - -static void TestSnmpTarget() -{ - OctetStr rd("rd_comm"), wr("wr_comm"); - ACE_ASSERT(rd.valid() == 1); - ACE_ASSERT(wr.valid() == 1); - char *crd = "rd_comm", *cwr = "wr_comm"; - - // constructor and get tests - UdpAddress ga; - ACE_ASSERT(ga.valid() == 0); - - UdpTarget c1; - ACE_ASSERT(c1.valid() == 0); - OctetStr a, b("public"), c("private"); - c1.get_read_community(a); - ACE_ASSERT(a == b); - c1.get_write_community(a); - ACE_ASSERT(a == c); - c1.get_address (ga); - ACE_ASSERT(c1.get_version() == version1); - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpTarget:c1(\"\") [%s]\n", - c1.to_string())); - - IpAddress ip("127.0.0.1"); - UdpTarget c2(ip); - ACE_ASSERT(c2.valid() == 1); - c2.get_address (ga); - ACE_ASSERT(ga.valid() == 1); - ACE_ASSERT(c2.get_version() == version1); - ACE_ASSERT(ga.valid() == 1); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpTarget:c2(\"\") [%s]\n", - c2.to_string())); - - UdpTarget *c5 = new UdpTarget(c2); - ACE_ASSERT(c5 != 0); - ACE_ASSERT(c5->valid() == 1); - c5->get_address (ga); - ACE_ASSERT(ga.valid() == 1); - ACE_ASSERT(c5->get_version() == version1); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) UdpTarget:c5(\"\") [%s]\n", - c5->to_string())); - delete c5; - -// these are not supported yet -// ACE_ASSERT(c5 == c5); -// c5 = c2; -// ACE_ASSERT(c5 == c2); -} - -int -main (int, char *[]) -{ - ACE_START_TEST ("Target_Test"); - TestSnmpTarget(); - - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/Varbind_Test.cpp b/ASNMP/tests/Varbind_Test.cpp deleted file mode 100644 index cb2ecaa415f..00000000000 --- a/ASNMP/tests/Varbind_Test.cpp +++ /dev/null @@ -1,195 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// asnmp -// -// = FILENAME -// Varbind_Test.cpp -// -// = DESCRIPTION -// Test all the member functions of the Varbind class. -// A varbind is a list of { oids and associated values } -// -// = AUTHOR -// Michael R. MacFaden -// -// ============================================================================ - -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Copyright 1997 Cisco Systems, Inc. - -Permission to use, copy, modify, and distribute this software for any -purpose and without fee is hereby granted, provided that this -copyright and permission notice appear on all copies of the software and -supporting documentation, the name of Cisco Systems, Inc. not be used -in advertising or publicity pertaining to distribution of the -program without specific prior permission, and notice be given -in supporting documentation that modification, copying and distribution is by -permission of Cisco Systems, Inc. - -Cisco Systems, Inc. makes no representations about the suitability of this -software for any purpose. THIS SOFTWARE IS PROVIDED ``AS IS'' -AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT AND -FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL CISCO SYSTEMS, INC. BE -LIABLE FOR ANY DAMAGES ARISING OUT OF THIS LICENSE OR YOUR USE OF THE -SOFTWARE INCLUDING WITHOUT LIMITATION, DIRECT, INDIRECT OR CONSEQUENTIAL -DAMAGES. --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ - - -#include "ace/OS.h" -#include "asnmp/oid.h" -#include "asnmp/vb.h" -#include "test_config.h" - -ACE_RCSID(tests, Varbind_Test, "$Id$") - -/* - Vb( void); - Vb( const Oid &oid); - Vb( const Vb &vb); - Vb( const Oid& vb, const SnmpSyntax &val, const SmiUINT32=SNMP_CLASS_SUCCESS); - ~Vb(); - int valid() const; - Vb& operator=( const Vb &vb); - void set_oid( const Oid& oid); - void get_oid( Oid &oid) const; - void set_null(); - void set_value( const TimeTicks& ticks); - void set_value( const Oid& oid); - void set_value( const Counter32& ctr); - void set_value( const Counter64& ctr); - void set_value( const Gauge32& ctr); - void set_value( const SnmpUInt32& ctr); - void set_value( const SnmpInt32& ctr); - void set_value( const OctetStr& oct_str); - int get_value( TimeTicks& ticks); - int get_value( Oid& oid); - int get_value( Counter32& ctr); - int get_value( Counter64& ctr); - int get_value( Gauge32& ctr); - int get_value( SnmpUInt32& ctr); - int get_value( SnmpInt32& ctr); - int get_value( OctetStr& oct_str); - int get_value( SnmpSyntax &val); - void set_value( const SnmpSyntax &val); - int get_value( const SnmpSyntax &val); - SmiUINT32 get_syntax(); - friend void set_exception_status( Vb *vb, const SmiUINT32 status); - char *to_string(); - char *to_string_value(); - char *to_string_oid(); - */ - -static void VbTest() -{ - Vb v1; - ACE_ASSERT(v1.valid() == 0); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) VarBinad:v1(\"/\") [%s]\n", - v1.to_string())); - - // purpose of this routine?? - set_exception_status( &v1, 10); - - Vb v2(v1); - ACE_ASSERT(v2.valid() == 0); - Oid o1("1.2.3"), o2; - v2.set_oid(o1); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) VarBinad:v2(\"1.2.3/\") [%s]\n", - v2.to_string())); - - v2.get_oid(o2); - ACE_ASSERT(o2 == o1); - ACE_ASSERT(v2.valid() == 0); - v2.set_null(); - ACE_ASSERT(v2.valid() == 0); - v2.get_oid(o2); - - Vb v3; - TimeTicks t(0), t1; - v3.set_oid(o1); - v3.set_value(t); - ACE_ASSERT(v3.valid() == 1); - v3.get_value(t1); - ACE_ASSERT(t == t1); - - Vb v4; - v4.set_oid(o1); - v4.set_value(o1); - ACE_ASSERT(v4.valid() == 1); - v4.get_value(o2); - ACE_ASSERT(o1 == o2); - - Vb v5; - Counter32 c1(12), c2; - v5.set_oid(o1); - v5.set_value(c1); - ACE_ASSERT(v5.valid() == 1); - v5.get_value(c2); - ACE_ASSERT(c1 == c2); - - Vb v6; - Counter64 c3(12345678901234), c4; - v6.set_oid(o1); - v6.set_value(c3); - ACE_ASSERT(v6.valid() == 1); - v6.get_value(c4); - ACE_ASSERT(c3 == c4); - - Vb v7; - Gauge32 g1(0123456), g2; - v7.set_oid(o1); - v7.set_value(g1); - ACE_ASSERT(v7.valid() == 1); - v7.get_value(g2); - ACE_ASSERT(g1 == g2); - - Vb v8; - SnmpInt32 i1(0123456), i2; - v8.set_oid(o1); - v8.set_value(i1); - ACE_ASSERT(v8.valid() == 1); - v8.get_value(i2); - ACE_ASSERT(i1 == i2); - - Vb v9; - SnmpUInt32 u1(0123456), u2; - v9.set_oid(o1); - v9.set_value(u1); - ACE_ASSERT(v9.valid() == 1); - v9.get_value(u2); - ACE_ASSERT(u1 == u2); - - Vb v10; - OctetStr s1(" abcdefghighlmnopqrstuvwxyz!@#$%^&*()"), s2; - v10.set_oid(o1); - v10.set_value(s1); - ACE_ASSERT(v10.valid() == 1); - v10.get_value(s2); - ACE_ASSERT(s1 == s2); - ACE_ASSERT(s1.length() == s2.length()); - - // test assignment over all datatypes - v10 = v5; - ACE_ASSERT(v10 == v5); - - - Vb v11(o1, s1, SNMP_CLASS_SUCCESS); - ACE_ASSERT(v11.valid() == 1); - v11.get_oid(o2); - ACE_ASSERT(o1 == o2); - v11.get_value(s2); - ACE_ASSERT(s1 == s2); -} - -int -main (int, char *[]) -{ - ACE_START_TEST ("VbTest"); - VbTest(); - ACE_END_TEST; - return 0; -} diff --git a/ASNMP/tests/run_tests.bat b/ASNMP/tests/run_tests.bat deleted file mode 100644 index 985f88b51db..00000000000 --- a/ASNMP/tests/run_tests.bat +++ /dev/null @@ -1,44 +0,0 @@ -@echo off -rem To use this either give it no arguments to run all the tests or -rem pass it the test name (without the extention) to run only one -rem test - -if not "%1" == "" goto runtest - -call run_tests - -call run_tests Address_Test -call run_tests Counter64_Test -call run_tests Counter_Test -call run_tests Gauge_Test -call run_tests Integer_Test -call run_tests Octet_Test -call run_tests Oid_Test -call run_tests Target_Test -call run_tests Varbind_Test - -goto done - -:runtest - -echo Running %1 -%1.exe -if errorlevel 0 goto fine -echo. -echo %1 has FAILED!!! -echo. -type %temp%\log\%1.log | find /I "assertion failed" -type %temp%\log\%1.log | find /I "not supported" -type %temp%\log\%1.log | find /I "no such file or directory" -type %temp%\log\%1.log | find /I "invalid argument" -type %temp%\log\%1.log | find /I "timeout" -type %temp%\log\%1.log | find /I "bad file number" -echo. - -goto done -:fine - -rem We should check the log files here to make sure the test ended correctly -rem type %temp%\log\%1.log | find "Ending" - -:done diff --git a/ASNMP/tests/run_tests.sh b/ASNMP/tests/run_tests.sh deleted file mode 100755 index f8ebb06fdd4..00000000000 --- a/ASNMP/tests/run_tests.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -f -# This is the UNIX version of the one-button ACE tests. -# Contributed by Michael Rueger -# mrm@cisco.com - Change to for loop script could be more generic if we put -# this in the bin dir and fed it a file to read from - -IFS="|" -tmp=/tmp - -# these patterns should not be included in log file -ERROR_MSGS="assertion failed|not supported|No such file or directory|Invalid argument|timeout|Bad file number" - -# these patterns must be included in log file -SUCCESS_MSGS="starting|Ending" - -run() -{ - echo running $1 - /bin/rm -f core - - ./$1 - status=$? - - if [ $status -ne 0 ]; then - echo \"$1\" FAILED with exit status $status!!!! - fi - - if [ -f core ]; then - echo \"$1\" dumped core!!!! - fi - - for i in $SUCCESS_MSGS; do - grep $i log/$1.log >/dev/null - if [ $? -eq 1 ]; then - echo Error in log file no line with $i - fi - done - - for i in $ERROR_MSGS; do - grep $i log/$1.log - done -} - -echo "Starting tests..." -FILES=`ls *_Test 2>/dev/null` -if [ "$FILES" = "" ]; then - echo "ERROR: no test programs generated matching pattern *_Test." - echo "ERROR: Try compiling the test programs first." - exit 1 -fi - -for i in *_Test -do - run $i -done - -echo "Tests complete..." - - -# EOF diff --git a/ASNMP/tests/test_config.h b/ASNMP/tests/test_config.h deleted file mode 100644 index 4f18d05d7cd..00000000000 --- a/ASNMP/tests/test_config.h +++ /dev/null @@ -1,195 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// = FILENAME -// test_config.h -// -// = AUTHOR -// Prashant Jain , Tim Harrison -// , and David Levine -// -// ============================================================================ - -#ifndef ACE_TEST_CONFIG_H -#define ACE_TEST_CONFIG_H - -#include "ace/ACE.h" -#include -#include - -#if !defined (ACE_HAS_TEMPLATE_SPECIALIZATION) -class KEY -// ============================================================================ -// = TITLE -// Define a key for use with the Map_Manager_Test. -// -// = DESCRIPTION -// This class is put into the test_config.h header file to work -// around AIX C++ compiler "features" related to template -// instantiation... It is only used by Map_Manager_Test.cpp -// ============================================================================ -{ -public: - KEY (size_t v = 0): value_ (v) - { } - - size_t hash (void) const { return this->value_; } - operator size_t () const { return this->value_; } - -private: - size_t value_; -}; -#else -typedef size_t KEY; -#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ - -#if defined (ACE_WIN32) - -#define ACE_DEFAULT_TEST_FILE ACE_TEXT ("C:\\temp\\ace_test_file") -#define ACE_TEMP_FILE_NAME ACE_TEXT ("C:\\temp\\ace_temp_file") -#define ACE_LOG_DIRECTORY ACE_TEXT ("C:\\temp\\log\\") -#define MAKE_PIPE_NAME(X) ACE_TEXT ("\\\\.\\pipe\\"#X) - -#else - -#define ACE_DEFAULT_TEST_FILE ACE_TEXT ("/tmp/ace_test_file") -#define ACE_TEMP_FILE_NAME ACE_TEXT ("/tmp/ace_temp_file") -#define ACE_LOG_DIRECTORY ACE_TEXT ("log/") -#define MAKE_PIPE_NAME(X) ACE_TEXT (X) - -#endif /* ACE_WIN32 */ - -#define ACE_START_TEST(NAME) \ - const char *program = NAME; \ - ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM); \ - if (ace_file_stream.set_output (program) != 0) \ - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "set_output failed"), -1); \ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) starting %s test at %T\n", program)); - -#define ACE_END_TEST \ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Ending %s test at %T\n", program)); \ - ace_file_stream.close (); - -#define ACE_NEW_THREAD \ -do {\ - ACE_LOG_MSG->msg_ostream (ace_file_stream.output_file ()); \ - ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER ); \ - ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM); \ -} while (0) - -#define ACE_APPEND_LOG(NAME) \ - const char *program = NAME; \ - ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM); \ - if (ace_file_stream.set_output (program, 1) != 0) \ - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "set_output failed"), -1); \ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting %s test at %T\n", program)); - -#define ACE_END_LOG \ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Ending %s test at %T\n\n", program)); \ - ace_file_stream.close (); - -#define ACE_INIT_LOG(NAME) \ - char temp[BUFSIZ]; \ - ACE_OS::sprintf (temp, "%s%s%s", \ - ACE_LOG_DIRECTORY, \ - ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \ - ".log"); \ - ACE_DEBUG ((LM_DEBUG, "Deleting old log file %s (if any)\n\n", temp)); \ - ACE_OS::unlink (temp); - - -const int ACE_NS_MAX_ENTRIES = 1000; -const int ACE_MAX_TIMERS = 4; -const int ACE_MAX_THREADS = 4; -const int ACE_MAX_DELAY = 10; -const int ACE_MAX_INTERVAL = 0; -const int ACE_MAX_ITERATIONS = 10; -const int ACE_MAX_PROCESSES = 10; - -char ACE_ALPHABET[] = "abcdefghijklmnopqrstuvwxyz"; - -class ACE_Test_Output -{ -public: - ACE_Test_Output (void); - ~ACE_Test_Output (void); - int set_output (const char *filename, int append = 0); - ofstream *output_file (void); - void close (void); - -private: - ofstream output_file_; -}; - -static ACE_Test_Output ace_file_stream; - -ACE_Test_Output::ACE_Test_Output (void) -{ -} - -ACE_Test_Output::~ACE_Test_Output (void) -{ -} - -int -ACE_Test_Output::set_output (const char *filename, int append) -{ - char temp[BUFSIZ]; - // Ignore the error value since the directory may already exist. - ACE_OS::mkdir (ACE_LOG_DIRECTORY); - ACE_OS::sprintf (temp, "%s%s%s", - ACE_LOG_DIRECTORY, - ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR), - ".log"); - - int flags = ios::out; - if (append) - flags |= ios::app; - - this->output_file_.open (temp, flags); - if (this->output_file_.bad ()) - return -1; - - ACE_LOG_MSG->msg_ostream (ace_file_stream.output_file ()); - ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER ); - ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM); - - return 0; -} - -ofstream * -ACE_Test_Output::output_file (void) -{ - return &this->output_file_; -} - -void -ACE_Test_Output::close (void) -{ - this->output_file_.flush (); - this->output_file_.close (); -} - -void -randomize (int array[], size_t size) -{ - size_t i; - - for (i = 0; i < size; i++) - array [i] = i; - - ACE_OS::srand (ACE_OS::time (0L)); - - // Generate an array of random numbers from 0 .. size - 1. - - for (i = 0; i < size; i++) - { - int index = ACE_OS::rand() % size--; - int temp = array [index]; - array [index] = array [size]; - array [size] = temp; - } -} - -#endif /* ACE_TEST_CONFIG_H */ diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 67d624b93aa..00000000000 --- a/AUTHORS +++ /dev/null @@ -1,7 +0,0 @@ -Douglas C. Schmidt -Director of the Center for Distributed Object Computing - -The Center for Distributed Object Computing -One Brookings Drive -St. Louis, Missouri 63130-4899 -http://www.cs.wustl.edu/~schmidt/doc-center.html diff --git a/BIBLIOGRAPHY b/BIBLIOGRAPHY deleted file mode 100644 index 6ee6da4dd94..00000000000 --- a/BIBLIOGRAPHY +++ /dev/null @@ -1,752 +0,0 @@ -The following articles document and describe various aspects of the -object-oriented network programming components and the underlying -design patterns included in ACE, TAO, and JAWS. A complete list of -publications is available at - -http://www.cs.wustl.edu/~schmidt/resume.html - -======================================== - -@article{Schmidt:97r, - AUTHOR = {Douglas C. Schmidt and Chris Cleeland}, - TITLE = "{Applying Patterns to Develop Extensible and Maintainable ORB Middleware}", - JOURNAL = "Communications of the ACM (Special Issue on - Software Maintenance)", - EDITORS={W. Tsai}, - VOLUME = 40, - NUMBER = 12, - YEAR = 1997, - MONTH = "December" -} - -@article{Schmidt:97q, - AUTHOR = {Douglas C. Schmidt and David L. Levine and Sumedh Mungee}, - TITLE = "{The Design and Performance of Real-Time Object Request Brokers}", - JOURNAL = "Computer Communications", - YEAR = 1997, -} - -@incollection{Schmidt:97n, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Applying Design Patterns and Frameworks to Develop - Object-Oriented Communication Software}", - BOOKTITLE = "Handbook of Programming Languages", - EDITOR="Peter Salus", - PUBLISHER = "MacMillan Computer Publishing", - YEAR = 1997 -} - -@inproceedings{Schmidt:97m, - AUTHOR = "Douglas C. Schmidt and Tim Harrison and Nat Pryce", - TITLE = "{Thread-Specific Storage -- An Object Behavioral - Pattern for Accessing per-Thread State Efficiently}", - BOOKTITLE = "Submitted to the $4^{th}$ Pattern - Languages of Programming Conference", - LOCATION="Allerton Park, IL", - YEAR = 1997, - MONTH = "September", -} - -@inproceedings{Schmidt:97l, - AUTHOR = "Tim Harrison and Irfan Pyrarli and Douglas C. Schmidt and Thomas Jordan", - TITLE = "{Proactor -- An Object Behavioral Pattern for - Dispatching Asynchronous Event Handlers}", - BOOKTITLE="The $4^{th}$ Pattern Languages of Programming Conference", - YEAR = 1997, - MONTH = "September", - ABSTRACT = "" -} - -@inproceedings{Schmidt:97k, - AUTHOR = "James Hu and Irfan Pyrarli and Douglas C. Schmidt", - TITLE = "{Measuring the Impact of Event Dispatching and Concurrency Models on Web - Server Performance Over High-speed Networks}", - BOOKTITLE="Proceedings of the $2^{nd}$ Global Internet Conference", - ORGANIZATION={IEEE}, - YEAR = 1997, - MONTH = "November", - ABSTRACT = "", -} - -@inproceedings{Schmidt:97j, - AUTHOR = "Aniruddha Gokhale and Douglas C. Schmidt", - TITLE = "{Evaluating the Performance of Demultiplexing Strategies for Real-time CORBA}", - BOOKTITLE="Proceedings of GLOBECOM '97", - ADDRESS={Phoenix, AZ}, - ORGANIZATION="IEEE", - YEAR = 1997, - MONTH = "November", - ABSTRACT = "" -} - -@inproceedings{Schmidt:97i, - AUTHOR = "Timothy H. Harrison and David L. Levine and Douglas C. Schmidt", - TITLE = "{The Design and Performance of a Real-time CORBA Event Service}", - BOOKTITLE="Proceedings of OOPSLA '97", - ADDRESS={Atlanta, GA}, - ORGANIZATION="ACM", - YEAR = 1997, - MONTH = "October", - ABSTRACT = "", -} - -@inproceedings{Schmidt:97g, - AUTHOR = "James Hu and Sumedh Mungee and Douglas C. Schmidt", - TITLE = "{Principles for Developing and Measuring - High-performance Web Servers over ATM}", - BOOKTITLE="Submitted to INFOCOM '97 (Washington University Technical Report \#WUCS-97-10)", - YEAR = 1997, - MONTH = "February", - ABSTRACT = "" -} - -@inproceedings{Schmidt:97f, - AUTHOR = "Aniruddha Gokhale and Douglas C. Schmidt", - TITLE = "{Principles for Optimizing CORBA Internet - Inter-ORB Protocol Performance}", - BOOKTITLE="Submitted to the Hawaiian International Conference on System Sciences (Washington University Technical Report \#WUCS-97-10)", - YEAR = 1998, - MONTH = "January", - ABSTRACT = "" -} - -@incollection{Schmidt:97e, - AUTHOR = "Chris Cleeland and Tim Harrison and Douglas C. Schmidt", - TITLE = "{External Polymorphism -- An - Object Structural Pattern for Transparently Extending Concrete - Data Types}", - BOOKTITLE = "Pattern Languages of Program Design", - EDITOR="Robert Martin and Frank Buschmann and Dirk Riehle", - PUBLISHER = "Addison-Wesley", - ADDRESS={Reading, MA}, - YEAR = 1997, -} - -@incollection{Schmidt:97d, - AUTHOR = "Douglas C. Schmidt and Tim Harrison", - TITLE = "{Double-Checked Locking -- An Object Behavioral - Pattern for Initializing and Accessing Thread-safe Objects - Efficiently}", - BOOKTITLE = "Pattern Languages of Program Design", - EDITOR="Robert Martin and Frank Buschmann and Dirk Riehle", - PUBLISHER = "Addison-Wesley", - ADDRESS={Reading, MA}, - YEAR = 1997, -} - -@incollection{Schmidt:97c, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Acceptor and Connector: - Design Patterns for Initializing Communication Services}", - BOOKTITLE = "Pattern Languages of Program Design", - EDITOR="Robert Martin and Frank Buschmann and Dirk Riehle", - PUBLISHER = "Addison-Wesley", - ADDRESS={Reading, MA}, - YEAR = 1997, - ANNOTE = http://www.cs.wustl.edu/~schmidt/, -} - -@inproceedings{Schmidt:97b, - AUTHOR = "Prashant Jain and Douglas C. Schmidt", - TITLE = "{Service Configurator: - A Pattern for Dynamic Configuration of Services}", - BOOKTITLE="Proceedings of the $3^{rd}$ Conference on - Object-Oriented Technologies and Systems", - PUBLISHER = "USENIX", - LOCATION="Portland, OR", - YEAR = 1997, - MONTH = "June", -} - -@incollection{Schmidt:97a, - AUTHOR = "Irfan Pyarali and Timothy H. Harrison and Douglas C. Schmidt", - TITLE = "{Asynchronous Completion Token: an Object Behavioral Pattern for - Efficient Asynchronous Event Handling}", - BOOKTITLE = "Pattern Languages of Program Design", - EDITOR="Robert Martin and Frank Buschmann and Dirk Riehle", - PUBLISHER = "Addison-Wesley", - ADDRESS={Reading, MA}, - YEAR = 1997, -} - -@article{Schmidt:96v, - AUTHOR = "Prashant Jain and Douglas Schmidt", - TITLE = "{Experiences Converting a C++ Communication Software - Framework to Java}", - JOURNAL = "C++ Report", - YEAR = 1997, - VOLUME = 9, - NUMBER = 1, - MONTH = "January", - ABSTRACT = "" -} - -@incollection{Schmidt:96n, - AUTHOR = "Irfan Pyarali and Timothy H. Harrison and Douglas C. Schmidt", - TITLE="{Design and Performance of an Object-Oriented Framework - for High-Performance Electronic Medical Imaging}", - BOOKTITLE="USENIX Computing Systems", - PUBLISHER="MIT Press", - YEAR = 1996, - MONTH = "November/December", - EDITOR={Douglas C. Schmidt}, - ABSTRACT = "" -} - -@inproceedings{Schmidt:96g, - AUTHOR = "Aniruddha Gokhale and Douglas C. Schmidt", - TITLE = "{Performance of the CORBA Dynamic Invocation Interface and - Internet Inter-ORB Protocol over High-Speed ATM Networks}", - BOOKTITLE="Proceedings of GLOBECOM '96", - ADDRESS={London, England}, - ORGANIZATION="IEEE", - YEAR = 1996, - MONTH = "November", - ABSTRACT = "" -} - -@inproceedings{Schmidt:96f, - AUTHOR = "Aniruddha Gokhale and Douglas C. Schmidt", - TITLE = "{Measuring the Performance of Communication Middleware on - High-Speed Networks}", - BOOKTITLE="Proceedings of SIGCOMM '96", - ADDRESS={Stanford, CA}, - ORGANIZATION="ACM", - YEAR = 1996, - MONTH = "August", - ABSTRACT = "" -} - -@inproceedings{Schmidt:96e, - AUTHOR = "Irfan Pyarali and Timothy H. Harrison and Douglas C. Schmidt", - TITLE="{Design and Performance of an Object-Oriented Framework - for High-Performance Electronic Medical Imaging}", - BOOKTITLE="Proceedings of the $2^{nd}$ Conference on - Object-Oriented Technologies and Systems", - ADDRESS={Toronto, Canada}, - ORGANIZATION="USENIX", - YEAR = 1996, - MONTH = "June", - ABSTRACT = "" -} - -@inproceedings{Schmidt:96d, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{A Family of Design Patterns For Flexibly - Configuring Network Services in Distributed Systems}", - BOOKTITLE = "International Conference on Configurable - Distributed Systems", - LOCATION="Annapolis, Maryland", - YEAR = 1996, - MONTH = "May 6--8", -} - -@inproceedings{Schmidt:96c, - AUTHOR = "Tim Harrison and Douglas C. Schmidt", - TITLE = "{Thread-Specific Storage -- An Object Behavioral - Pattern for Accessing per-Thread State Efficiently}", - BOOKTITLE = "Submitted to the $3^{rd}$ Pattern Languages of Programming - Conference", - LOCATION="Allerton Park, Illinois", - YEAR = 1996, - MONTH = "September", - ABSTRACT = "http://www.cs.wustl.edu/~schmidt/TSS-pattern.ps.gz" -} - -@inproceedings{Schmidt:96b, - AUTHOR = "R. Greg Lavender and Douglas C. Schmidt", - TITLE = "{Active Object: an Object Behavioral Pattern for - Concurrent Programming}", - BOOKTITLE = "Pattern Languages of Program Design", - EDITOR="James O. Coplien and John Vlissides and Norm Kerth", - PUBLISHER = "Addison-Wesley", - ADDRESS={Reading, MA}, - YEAR = 1996, -} - -@inproceedings{Schmidt:96a, - AUTHOR = "Douglas C. Schmidt and Charles D. Cranor", - TITLE = "{Half-Sync/Half-Async: an Architectural Pattern for - Efficient and Well-structured Concurrent I/O}", - BOOKTITLE = "Pattern Languages of Program Design", - EDITOR="James O. Coplien and John Vlissides and Norm Kerth", - PUBLISHER = "Addison-Wesley", - ADDRESS={Reading, MA}, - YEAR = 1996, -} - -@article{Schmidt:95p, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Connector: a Design Pattern for Actively - Initializing Network Services}", - JOURNAL = "C++ Report", - YEAR = 1996, - VOLUME = 8, - NUMBER = 1, - MONTH = "January" -} - -@inproceedings{Schmidt:95o, - AUTHOR = "Douglas C. Schmidt and Timothy H. Harrison and Irfan Pyarali", - TITLE = "{Experience Developing an Object-Oriented Framework - for High-Performance Electronic Medical Imaging using CORBA - and C++}", - BOOKTITLE = "Proceedings of the ``Software Technology Applied to Imaging and Multimedia - Applications mini-conference'' at the Symposium on Electronic - Imaging in the International Symposia Photonics West", - ORGANIZATION={SPIE}, - LOCATION="San Jose, CA", - YEAR = 1996, - MONTH = "January" -} - -@article{Schmidt:95m, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Design Patterns for Initializing Network Services: - Introducing the Acceptor and Connector Patterns}", - JOURNAL = "C++ Report", - YEAR = 1995, - VOLUME = 7, - NUMBER = 9, - MONTH = "November/December" -} - -@inproceedings{Schmidt:95k, - AUTHOR = "Tim Harrison and Douglas C. Schmidt", - TITLE = "{Thread-Specific Storage: A Pattern for Reducing Locking Overhead in Concurrent Programs}", - BOOKTITLE = "OOPSLA Workshop on Design Patterns for Concurrent, Parallel, and Distributed Systems", - ORGANIZATION={ACM}, - LOCATION="Austin, TX", - YEAR = 1995, - MONTH = "October" -} - -@article{Schmidt:95j, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Experience Using Design Patterns to Develop - Reuseable Object-Oriented Communication Software}", - BOOKTITLE = "Communications of the ACM (Special Issue on - Object-Oriented Experiences)", - VOLUME = 38, - NUMBER = 10, - YEAR = 1995, - MONTH = "October" -} - -@inproceedings{Schmidt:95h, - AUTHOR = "Douglas C. Schmidt and Charles D. Cranor", - TITLE = "{Half-Sync/Half-Async: an Architectural Pattern for - Efficient and Well-structured Concurrent I/O}", - BOOKTITLE = "Proceedings of the $2^{nd}$ Annual Conference on - the Pattern Languages of Programs", - ADDRESS={Monticello, Illinois}, - PAGES="1--10", - YEAR = 1995, - MONTH = "September" -} - -@inproceedings{Schmidt:95i, - AUTHOR = "R. Greg Lavender and Douglas C. Schmidt", - TITLE = "{Active Object: an Object Behavioral Pattern for - Concurrent Programming}", - BOOKTITLE = "Proceedings of the $2^{nd}$ - Annual Conference on the Pattern Languages of Programs", - ADDRESS={Monticello, Illinois}, - PAGES="1--7", - YEAR = 1995, - MONTH = "September" -} - -@article{Schmidt:95g, - AUTHOR = "Douglas C. Schmidt", - TITLE="{A Family of Design Patterns for - Application-level Gateways}", - JOURNAL="The Theory and Practice of - Object Systems (Special Issue on Patterns and Pattern Languages)", - EDITOR={Stephen P. Berczuk}, - PUBLISHER="Wiley and Sons", - YEAR = 1996, - VOLUME = 2, - NUMBER = 1, - ABSTRACT = "" -} - -@book{Schmidt:95f, - TITLE = "{Pattern Languages of Program Design}", - EDITOR="James O. Coplien and Douglas C. Schmidt", - PUBLISHER = "Addison-Wesley", - ADDRESS={Reading, MA}, - YEAR = 1995, -} - -@inproceedings{Schmidt:95e, - AUTHOR = "Douglas C. Schmidt and Tim Harrison and Ehab Al-Shaer", - TITLE="{Object-Oriented Components for High-speed Network Programming}", - BOOKTITLE="Proceedings of the Conference on Object-Oriented Technologies", - ADDRESS={Monterey, CA}, - ORGANIZATION="USENIX", - YEAR = 1995, - MONTH = "June", -} - -@inproceedings{Schmidt:95d, - AUTHOR = "Douglas C. Schmidt", - TITLE="{Acceptor and Connector: Design Patterns for Active and Passive Establishment - of Network Connections}", - BOOKTITLE=" Workshop on Pattern Languages of Object-Oriented - Programs at ECOOP '95", - MONTH={August}, - YEAR=1995, - ADDRESS={Aarhus, Denmark}, - ABSTRACT = "" -} - -@article{Schmidt:95c, - AUTHOR = "Douglas C. Schmidt and Paul Stephenson", - TITLE="{Using Design Patterns to Evolve System Software from - UNIX to Windows NT}", - JOURNAL = "C++ Report", - YEAR = 1995, - VOLUME = 7, - NUMBER = 3, - MONTH = "March/April", - ABSTRACT = "This is a different version of the ECOOP paper that - goes into a lot more gory details about how the - Reactor and Acceptor patterns were implemented - on Windows NT and UNIX." -} - -@inproceedings{Schmidt:95b, - AUTHOR = "Douglas C. Schmidt and Paul Stephenson", - TITLE="{Experiences Using Design Patterns to - Evolve System Software Across Diverse OS Platforms}", - BOOKTITLE="Proceedings of the $9^{th}$ European Conference on - Object-Oriented Programming", - ADDRESS={Aarhus, Denmark}, - MONTH={August}, - YEAR=1995 -} - -@incollection{Schmidt:95a, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Reactor: An Object Behavioral Pattern for Concurrent - Event Demultiplexing and Event Handler Dispatching}", - BOOKTITLE = "Pattern Languages of Program Design", - EDITOR="James O. Coplien and Douglas C. Schmidt", - PUBLISHER = "Addison-Wesley", - ADDRESS={Reading, MA}, - YEAR = 1995, - MONTH = "June" - ABSTRACT = "This is a polished up version of the PLoP paper" -} - -@inproceedings{Schmidt:94l, - AUTHOR = "Douglas C. Schmidt and Paul Stephenson", - TITLE="{Achieving Reuse Through Design Patterns}", - BOOKTITLE="Proceedings of the Third C++ World Conference", - ORGANIZATION="SIGS", - ADDRESS={Austin, Texas}, - MONTH=Nov, - YEAR=1994 -} - -@inproceedings{Schmidt:94i, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Reactor: An Object Behavioral Pattern for Concurrent - Event Demultiplexing and Dispatching}", - BOOKTITLE = "Proceedings of the $1^{st}$ Annual Conference on the - Pattern Languages of Programs (PLoP)", - ADDRESS={Monticello, Illinois}, - YEAR = 1994, - MONTH = "August" -} - -@inproceedings{Schmidt:94j, - AUTHOR = "Douglas C. Schmidt", - TITLE="{The ADAPTIVE Communication Environment: - An Object-Oriented Network Programming Toolkit for Developing - Communication Software}", - BOOKTITLE="Proceedings of the $12^{th}$ Annual Sun Users Group - Conference", - ORGANIZATION="SUG", - ADDRESS={San Francisco, CA}, - PAGES="214-225", - MONTH={June}, - YEAR=1994, -} - -@article{Schmidt:94g, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Transparently Parameterizing Synchronization into a - Concurrent Distributed Application}", - JOURNAL = "C++ Report", - YEAR = 1994, - VOLUME = July/August, - NUMBER = 6, - MONTH = "March/April", -} - -@article{Schmidt:94d, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{A Domain Analysis of Network Daemon Design Dimensions}", - JOURNAL = "C++ Report", - YEAR = 1994, - VOLUME = 6, - NUMBER = 3, - MONTH = "March/April", -} - -@inproceedings{Schmidt:94a, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{ASX: an Object-Oriented Framework for Developing - Distributed Applications}", - BOOKTITLE = "Proceedings of the $6^{th}$ USENIX C++ Technical Conference", - ORGANIZATION="USENIX", - ADDRESS={Cambridge, Massachusetts}, - MONTH = "April", - YEAR = {1994} -} - -@inproceedings{Schmidt:93i, - AUTHOR = "Douglas C. Schmidt and Tatsuya Suda", - TITLE="{The Service Configurator Framework: An Extensible - Architecture for Dynamically Configuring Concurrent, Multi-Service - Network Daemons}", - BOOKTITLE="The Proceedings of the Second International Workshop on - Configurable Distributed Systems", - ORGANIZATION="IEEE", - ADDRESS={Pittsburgh, PA}, - MONTH=mar, - YEAR=1994, -} - -@inproceedings{Schmidt:93k, - AUTHOR = "Douglas C. Schmidt", - TITLE="{The ADAPTIVE Communication Environment: - Object-Oriented Network Programming Components for Developing - Client/Server Applications}", - BOOKTITLE="Proceedings of the $11^{th}$ Annual Sun Users Group Conference", - ORGANIZATION="SUG", - ADDRESS={San Jose, CA}, - MONTH=Dec, - YEAR=1993, -} - -@inproceedings{Schmidt:93j, - AUTHOR = "Douglas C. Schmidt", - TITLE="{Object-Oriented Techniques for Developing Extensible - Network Servers}", - BOOKTITLE="Proceedings of the Second C++ World Conference", - ORGANIZATION="SIGS", - ADDRESS={Dallas, Texas}, - MONTH=Oct, - YEAR=1993, -} - -@inproceedings{Schmidt:93h, - AUTHOR = "Douglas C. Schmidt and Paul Stephenson", - TITLE="{An Object-Oriented Framework for Developing - Network Server Daemons}", - BOOKTITLE="Proceedings of the Second C++ World Conference", - ORGANIZATION="SIGS", - ADDRESS={Dallas, Texas}, - MONTH=Oct, - YEAR=1993, -} - -@article{Schmidt:93c, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{The Object-Oriented Design and Implementation of the - Reactor: A C++ Wrapper for UNIX I/O Multiplexing (Part 2 of 2)}", - JOURNAL = "C++ Report", - YEAR = 1993, - MONTH = "September/October", - ABSTRACT = "" -} - -@article{Schmidt:93b, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{The Reactor: An Object-Oriented Interface for - Event-Driven UNIX I/O Multiplexing (Part 1 of 2)}", - JOURNAL = "C++ Report", - YEAR = 1993, - MONTH = "February", - ABSTRACT = "" -} - -@article{Schmidt:92e, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{IPC_SAP: An Object-Oriented Interface to - Interprocess Communication Services}", - JOURNAL = "C++ Report", - YEAR = 1992, - MONTH = "November/December", - ABSTRACT = "" -} - -@article{Schmidt:92d, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Systems Programming with C++ Wrappers: Encapsulating - Interprocess Communication Services with Object-Oriented Interfaces}", - JOURNAL = "C++ Report", - YEAR = 1992, - MONTH = "September/October", - ABSTRACT = "" -} - ----------------------------------------- -In addition, here are some articles that discuss various aspects of -the ADAPTIVE project. - -@inproceedings{Schmidt:94r, - AUTHOR = {Douglas C. Schmidt}, - TITLE = "{High-Performance Event Filtering for Dynamic Multi-point Applications}", - BOOKTITLE= "$1^{st}$ Workshop on High Performance Protocol - Architectures (HIPPARCH)", - MONTH={December}, - YEAR = {1994}, - ADDRESS={Sophia Antipolis, France}, - ORGANIZATION = {INRIA} -} - -@inproceedings{Schmidt:94p, - AUTHOR = "Douglas C. Schmidt and Tatsuya Suda", - TITLE = "Measuring the Performance of Parallel Message-based - Process Architectures," - BOOKTITLE = "{\em Proceedings of the INFOCOM Conference on Computer Communications}", - ORGANIZATION= "IEEE", - ADDRESS="Boston, MA", - MONTH = "April", - YEAR = {1995} -} - -@article{Schmidt:94k, - AUTHOR = "Douglas C. Schmidt and Tatsuya Suda", - TITLE = "{An Object-Oriented Framework for Dynamically - Configuring Extensible Distributed Communication Systems}", - JOURNAL = "IEE Distributed Systems Engineering Journal - (Special Issue on Configurable Distributed Systems)", - YEAR = 1994, - MONTH = "December" -} - -@inproceedings{Schmidt:94e, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Experiences with an Object-Oriented Architecture for - Developing Extensible Network Management Software}", - BOOKTITLE = "Globecom Conference", - ORGANIZATION="IEEE", - ADDRESS={San Francisco, CA}, - MONTH = "November", - YEAR = {1994} -} - -@inproceedings{Schmidt:94h, - AUTHOR = "Douglas C. Schmidt and Tatsuya Suda", - TITLE = "{Measuring the Impact of Alternative Parallel Process - Architectures on Communication Subsystem Performance}", - BOOKTITLE = "Proceedings of the $4^{th}$ International Workshop - on Protocols for High-Speed Networks", - ORGANIZATION="IFIP", - ADDRESS={Vancouver, British Columbia}, - YEAR = 1994, - MONTH = "August" -} - -@inproceedings{Schmidt:94b, - AUTHOR = "Douglas C. Schmidt and Tatsuya Suda", - TITLE = "{The ADAPTIVE Service eXecutive: an Object-Oriented - Architecture for Configuring Concurrent Distributed Applications}", - BOOKTITLE = "The proceedings of the $8^{th}$ International Working - Conference on Upper Layer Protocols, Architectures, and - Applications", - ORGANIZATION="IFIP", - ADDRESS={Barcelona, Spain}, - MONTH = "June", - YEAR = {1994} -} - -@inproceedings{Schmidt:93g, - AUTHOR = "Douglas C. Schmidt and Tatsuya Suda", - TITLE="{A Framework for Developing and Experimenting with - Parallel Process Architectures to Support High-Performance - Transport Systems}", - ORGANIZATION="IEEE", - BOOKTITLE="Proceedings of the Second Workshop on the - Architecture and Implementation of High Performance - Communication Subsystems", - ADDRESS={Williamsburg, Virgina}, - MONTH={September}, - YEAR=1993, -} - -@inproceedings{Schmidt:93f, - AUTHOR = "Douglas C. Schmidt and Tatsuya Suda", - TITLE = "{ADAPTIVE: A Framework for Experimenting with - High-Performance Transport System Process Architectures}", - BOOKTITLE="{Proceedings of the $2^{\rm nd}$ International - Conference on Computer Communication Networks}", - ORGANIZATION="ISCA", - ADDRESS={San Diego, California}, - YEAR=1993, - MONTH=jun, - PAGES="", - ABSTRACT="" -} - -@article{Schmidt:93a, - AUTHOR = "Douglas C. Schmidt and Donald F. Box and Tatsuya Suda", - TITLE = "{ADAPTIVE: A Dynamically Assembled Protocol - Transformation, Integration, and eValuation Environment}", - JOURNAL="Journal of Concurrency: Practice and - Experience", - YEAR = 1993, - MONTH=jun, - ABSTRACT = "" -} - -@inproceedings{Box:93a, - AUTHOR="Donald F. Box and Douglas C. Schmidt and Tatsuya Suda", - TITLE="{ADAPTIVE: An Object-Oriented Framework for Flexible - and Adaptive Communication Protocols}", - BOOKTITLE="{Proceedings of the 4$^{th}$ IFIP Conference on High - Performance Networking}", - ORGANIZATION="IFIP", - ADDRESS="Liege, Belgium", - YEAR=1993, - ABSTRACT = "" -} - -@inproceedings{Schmidt:92f, - AUTHOR = "Douglas C. Schmidt", - TITLE = "{Hosting the ADAPTIVE System in the {\em - x}-Kernel and System V STREAMS}", - BOOKTITLE = "Proceedings of the {\em x}-kernel Workshop", - MONTH = {November}, - ADDRESS = {Tucson, Arizona}, - YEAR = 1992, -} - -@inproceedings{Schmidt:92c, - AUTHOR = "Douglas C. Schmidt and Donald F. Box and Tatsuya - Suda", - TITLE = "{ADAPTIVE: A Flexible and Adaptive Transport System - Architecture to Support Lightweight Protocols for Multimedia - Applications on High-Speed Networks}", - BOOKTITLE = "Proceedings of the First Symposium on High Performance - Distributed Computing", - MONTH = {September}, - ORGANIZATION = {IEEE}, - ADDRESS = {Syracuse, New York}, - YEAR = 1992, -} - -@article{Schmidt:92a, - AUTHOR = "Douglas C. Schmidt and Tatsuya Suda", - TITLE = "{Transport System Architecture Services for - High-Speed Communications Systems}", - JOURNAL="IEEE Journal on Selected Areas in Communication", - MONTH=may, - YEAR = 1993, -} - diff --git a/COPYING b/COPYING deleted file mode 100644 index a8f89534e82..00000000000 --- a/COPYING +++ /dev/null @@ -1,90 +0,0 @@ - - _________________________________________________________________ - - Copyright and Licensing Information for ACE(TM) and TAO(TM) - - [1]ACE(TM) and [2]TAO(TM) are copyrighted by [3]Douglas C. Schmidt and - his [4]research group at [5]Washington University, Copyright (c) - 1993-1999, all rights reserved. Since ACE and TAO are [6]open source, - [7]free software, you are free to use, modify, and distribute the ACE - and TAO source code and object code produced from the source, as long - as you include this copyright statement along with code built using - ACE and TAO. - - In particular, you can use ACE and TAO in proprietary software and are - under no obligation to redistribute any of your source code that is - built using ACE and TAO. Note, however, that you may not do anything - to the ACE and TAO code, such as copyrighting it yourself or claiming - authorship of the ACE and TAO code, that will prevent ACE and TAO from - being distributed freely using an open source development model. - - ACE and TAO are provided as is with no warranties of any kind, - including the warranties of design, merchantibility and fitness for a - particular purpose, noninfringement, or arising from a course of - dealing, usage or trade practice. Moreover, ACE and TAO are provided - with no support and without any obligation on the part of Washington - University, its employees, or students to assist in its use, - correction, modification, or enhancement. However, commercial support - for ACE and TAO are available from [8]Riverace and [9]OCI, - respectively. Moreover, both ACE and TAO are Y2K-compliant, as long as - the underlying OS platform is Y2K-compliant. - - Washington University, its employees, and students shall have no - liability with respect to the infringement of copyrights, trade - secrets or any patents by ACE and TAO or any part thereof. Moreover, - in no event will Washington University, its employees, or students be - liable for any lost revenue or profits or other special, indirect and - consequential damages. - - The [10]ACE and [11]TAO web sites are maintained by the [12]Center for - Distributed Object Computing of Washington University for the - development of open source software as part of the [13]open source - software community. By submitting comments, suggestions, code, code - snippets, techniques (including that of usage), and algorithms, - submitters acknowledge that they have the right to do so, that any - such submissions are given freely and unreservedly, and that they - waive any claims to copyright or ownership. In addition, submitters - acknowledge that any such submission might become part of the - copyright maintained on the overall body of code, which comprises the - [14]ACE and [15]TAO software. By making a submission, submitter agree - to these terms. Furthermore, submitters acknowledge that the - incorporation or modification of such submissions is entirely at the - discretion of the moderators of the open source ACE and TAO projects - or their designees. - - The names ACE - (TM), TAO(TM), and Washington University may not be used to endorse or - promote products or services derived from this source without express - written permission from Washington University. Further, products or - services derived from this source may not be called ACE(TM) or - TAO(TM), nor may the name Washington University appear in their names, - without express written permission from Washington University. - - If you have any suggestions, additions, comments, or questions, please - let [16]me know. - - [17]Douglas C. Schmidt - _________________________________________________________________ - - Back to the [18]ACE home page. - -References - - 1. http://www.cs.wustl.edu/~schmidt/ACE.html - 2. http://www.cs.wustl.edu/~schmidt/TAO.html - 3. http://www.cs.wustl.edu/~schmidt/ - 4. http://www.cs.wustl.edu/~schmidt/ACE-members.html - 5. http://www.wustl.edu/ - 6. http://www.opensource.org/ - 7. http://www.gnu.org/ - 8. http://www.riverace.com/ - 9. file://localhost/home/cs/faculty/schmidt/.www-docs/www.ociweb.com - 10. http://www.cs.wustl.edu/~schmidt/ACE.html - 11. http://www.cs.wustl.edu/~schmidt/TAO.html - 12. http://www.cs.wustl.edu/~schmidt/doc-center.html - 13. http://www.opensource.org/ - 14. http://www.cs.wustl.edu/~schmidt/ACE-obtain.html - 15. http://www.cs.wustl.edu/~schmidt/TAO-obtain.html - 16. mailto:schmidt@cs.wustl.edu - 17. http://www.cs.wustl.edu/~schmidt/ - 18. file://localhost/home/cs/faculty/schmidt/.www-docs/ACE.html diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 7566a55bd8e..00000000000 --- a/ChangeLog +++ /dev/null @@ -1,5197 +0,0 @@ -Fri Apr 28 13:11:20 2000 Ossama Othman - - * include/makeinclude/platform_linux_lxpthread.GNU: - * include/makeinclude/platform_linux_lxpthreads.GNU: - - Renamed `platform_linux_lxpthread.GNU' to - platform_linux_lxpthreads.GNU to be consistent with the name of - its corresponding config header `config-linux-lxpthreads.h'. - Thanks to Ken Weinert for reporting this. - - `platform_linux_lxpthread.GNU' now includes the newly renamed - file for backward compatibility. - -Fri Apr 28 11:54:21 2000 Douglas C. Schmidt - - * ace/SString.cpp: Fixed the delimiter_replace() method so that - it actually does what it's comment implies... Thanks to Martin - Krumpolec for reporting this. - -Thu Apr 27 18:19:19 2000 James Hu - - * ace/Dirent.i: Added checks to see if dirp_ is initialized - before calling into ACE_OS. - -Thu Apr 27 16:53:49 2000 Irfan Pyarali - - * ace/Hash_Map_Manager_T.cpp (unbind_all_i): Added new method - unbind_all() for removing all the entries in one shot. Thanks - to Boris Sukholitko for providing this - enhancement. - - * tests/Hash_Map_Manager_Test.cpp: Added test for unbind_all(). - -Thu Apr 27 14:17:52 2000 Darrell Brunsch - - * ace/OS.i: - - isatty (): Messed up on my CE change, so the version that - takes an int was hidden by a ACE_WIN32 block. This has been - moved outside again. - - * ace/OS.cpp: - - Weird, somehow part of a section that should have been removed - with the CE changes was still present. Removed again. - -Thu Apr 27 13:08:00 2000 Darrell Brunsch - - * bin/msvc_auto_compile.pl: - - Changed the code style and made it consistent. - - Also changed the core build to build all of the orbsvcs and - do the static builds in the right order. - - * ace/OS.cpp: - * ace/OS.i: - - For some reason, I had trouble with the libraries when the - ACE_Cleanup destructor was in the .i file. So I moved it to - the .cpp file instead. - - * ace/ace_dll.dsp: - - Was defining ACE_ACE_HAS_DLL=1, which is #1, not needed and, - #2, the wrong macro name. - - * ace/ace_lib.dsp: - - Changed the static configs to be of type Win32 Static Release/ - Debug instead of Win32 Release/Debug. - - * apps/gperf/src/gperf.dsp: - * apps/gperf/src/gperf_lib.dsp: - - Added Win32 Static Release/Debug configs. - -Thu Apr 27 14:32:45 2000 Douglas C. Schmidt - - * ACE-INSTALL (make): Updated the documentation. Thanks to - Ken Weinert for reporting this. - -Thu Apr 27 12:41:42 2000 James C. Hu - - * ace/OS.i: - * ace/OS.cpp: - * ace/config-freebsd-pthread.h: - * ace/README: - - Removed ACE_HAS_TIME_R in favor of using existing - mechanism of ACE_HAS_REENTRANT_FUNCTIONS, and then - adding ACE_LACKS_NETDB_REENTRANT_FUNCTIONS and - also ACE_LACKS_PWD_REENTRANT_FUNCTIONS. Created a - new lacks called ACE_LACKS_RAND_REENTRANT_FUNCTIONS - to match the previous two. FreeBSD can now use its - native *time_r functions. - -Thu Apr 27 10:55:11 2000 Darrell Brunsch - - These changes bring the Windows CE port up to date. It currently - supports Windows CE 2.11 on the H/PC Pro. I am looking into the 2.11 - P/PC port, but there are other problems with it still. Hopefully - the WinCE 3.0 SDK will be more mature. - - * ace/ace_dll_ce.dsp: (added) - * ace/ace_ce_dll.dsp: (removed) - * ace/ace_ce.dsw: - - Created a new dsp file from scratch from CE to see how the - toolkit sets up the projects. Removed the old one. - - * ace/ACE.cpp: - - format_hexdump (): Changed usage of isprint to ACE_OS::ace_isprint. - - get_ip_interfaces (): Changed use of deprecated ACE_TEXT_STRING to - ACE_TString. Also added an ACE_TEXT_CHAR_TO_TCHAR to a use - of the ACE_INET_Addr constructor. - - * ace/ARGV.cpp: - - create_buf_from_queue (): We were not adjusting the size of a - ACE_TCHAR buffer by sizeof ACE_TCHAR when we did a memcopy. - Thanks to Valery Arkhangorodsky - for reporting this. - - * ace/Memory_Pool.cpp: - - seh_selector (): Changed use of LPEXCEPTION_POINTERS to - EXCEPTION_POINTERS * since it seems like that definition is - missing in some WinCE configs. - - * ace/ace_wchar.h: - - Added deprecated definition of ACE_TEXT_STRING. - - convert (): Changed the conversions from CharToOem to - MultiByteToWideChar, since it is more widely supported in Win32. - Also removed the loading of user32.lib since it was only needed - for CharToOem. - - * ace/config-win32-common.h: - - Changed the _MT check so it doesn't do anything on CE. Some - CE targets do not have the Multithreaded DLL generation option. - - * ace/config-WinCE.h: - - Changed ACE_DEFAULT_LD_SEARCH_PATH to use ACE_TEXT. - - Added a define for ACE_HAS_WCHAR and a check to always define - ACE_USES_WCHAR. - - Commented out the ACE_HAS_MFC check. - - Defined FILE, since it seems to be missing from CE 2.11 H/PC Pro. - - Added a definition for EXCEPTION_ACCESS_VIOLATION that was in - older SDK's. - - Removed some UNDER_CE < 2.11 defines. < 2.11 CE will not be - supported anymore. - - Removed definition of is_print, since it was moved into ACE_OS. - - Added a definition for the operator placement new, which is - missing when MFC isn't used. - - * ace/OS.h: - - Enabled is_atty for Windows CE. Added ace_isprint and made - ace_isspace an ACE_TCHAR method. - - * ace/OS.i: - - chdir (): NOTSUP on CE 2.11 - - tempnam (): Also NOTSUP on CE 2.11 - - abort (): changed ::exit to exit to get it to compile. - - ace_isspace (): Changed to use ACE_TCHAR, but also made it - NOTSUP on CE 2.11. - - ace_isprint (): Added, but NOTSUP on CE 2.11. - - sema_init (): Needed to cast an void *arg to ACE_mutexattr_t. - - dlsym (): Changed the way ACE declares symbolname so it uses the - right one on Win32 (WinNT always uses char *, CE always uses - wchar_t *). The function still takes in ACE_TCHAR * though. - Thanks to Jeff Greif for reporting this. - - Removed a few global function definitions that were just for - CE (like fwrite, fread, getc, etc.). These are either supported - in newer CE's or is disabled in the ACE_OS methods. - - is_atty (): Enabled on CE. - - * ace/OS.cpp: - - Enabled fopen on CE by using _wfopen (but not sure if this will - work correctly, since on other Win32 platforms we have a lot more - stuff. - - Enabled several printf methods on CE. - - open (): Removed the use of FILE_SHARE_DELETE on CE. - - * ace/Service_Config.i: - - initialize (): Added an ACE_TEXT_CHAR_TO_TCHAR and replaced - an ACE_WIDE_STRING with it also. - - * ace/Svc_Conf.h: - * ace/Svc_Conf.y: - * ace/Svc_Conf_y.cpp: - - ace_yyerror (): Takes an ACE_TCHAR * instead of char * now. - Thanks to Valery Arkhangorodsky - for also reporting this. - - * ace/Svc_Conf.l: - * ace/Svc_Conf_l.cpp: - - Changed to use ACE_OS::isatty () and ACE_OS::ace_isprint. - -Thu Apr 27 11:49:52 2000 Douglas C. Schmidt - - * ace/OS.i (memchr): Do not cast away constness when emulating - memchr(). Thanks to Rick Ohnemus - for reporting this. - - * ace/Select_Reactor_Base.cpp (open): The notification pipe handlers - created by the ACE_Select_Reactor_Notify::open were being left - open after fork() and exec(). Thanks to Rick Ohnemus - for reporting this. - -Wed Apr 26 23:47:31 2000 Douglas C. Schmidt - - * ace/Process_Manager.cpp (open): Make sure that the dummy I/O - handle is not inherited by child processes. Thanks to Rick - Ohnemus for reporting this. - -Wed Apr 26 20:32:59 2000 James C. Hu - - * ace/OS.cpp: - * ace/OS.i: - * ace/README: - * ace/config-freebsd-pthread.h: - Added a new define ACE_HAS_TIME_R. FreeBSD supports - *time_r() calls, but not gethostbyname_r, so a new feature - specification was needed to get these functions into - ACE_OS. - -Wed Apr 26 12:21:16 2000 Steve Huston - - * ace/ACE.cpp (send_n_i (ACE_HANDLE, const void *, size_t, int) and - send_n_i (ACE_HANDLE, const void *, size_t): If the send fails - with EWOULDBLOCK, wait for the handle to become writeable again - before retrying the send. Thanks to Edan Ayal - for reporting this. - - * tests/SOCK_Send_Recv_Test.cpp: Added test 3 for send_n to verify - fix for writing to nonblocking handle. - -Wed Apr 26 08:43:21 2000 Darrell Brunsch - - * apps/drwho/PMC_Flo.cpp: - * apps/drwho/PMC_Usr.cpp: - * apps/drwho/PMS_All.cpp: - * apps/drwho/PMS_Flo.cpp: - * apps/drwho/PMS_Ruser.cpp: - * apps/drwho/PMS_Usr.cpp: - - Was still using ACE::strecpy, changed to ACE_OS::strecpy. - -Tue Apr 25 15:11:41 2000 Carlos O'Ryan - - * THANKS: - Add new member to the list. - -Tue Apr 25 11:35:07 2000 Darrell Brunsch - - * ace/Local_Name_Space.cpp: - - The hash function was using the wrong length of the USHORT16 - string representation. The len_ actually is the length in bytes, - not characters. - -Tue Apr 25 08:57:59 2000 Darrell Brunsch - - * ASNMP/tests/test_config.h: - - Was using XXX_A and XXX_W macros which really do not make sense - anymore. Removed them and replaced with just the XXX macro which - uses ACE_TEXT. - - * examples/Naming/test_multiple_contexts.cpp: - * examples/Naming/test_non_existent.cpp: - * examples/Naming/test_writers.cpp: - * performance-tests/Misc/test_naming.cpp: - * tests/Naming_Test.cpp: - * tests/SString_Test.cpp: - - All of these were still being disabled when ACE_HAS_WCHAR wasn't - defined. Since the naming stuff was changed to work without - ACE_HAS_WCHAR, these were reenabled. - -Tue Apr 25 00:02:08 2000 Douglas C. Schmidt - - * ace/Log_Msg.h (ACE_Log_Msg): Split msg_ostream() into two functions, - one of which allows the delete_ostream_ flag to be reset and the - other that doesn't. Thanks to Boris Sukholitko - for reporting this. - - * ace/Message_Block.i (replace_data_block): If a data block is replaced - with a NULL pointer then don't bother doing certain operations! - Thanks to Boris Sukholitko for - reporting this. - - * ace/OS.i (dlerror): Changed sizeof buf to sizeof buf / sizeof buf[0] - to avoid over-allocating a buffer in the - ACE_TEXT_FormateMessage() function. Thanks to Valery - Arkhangorodsky for reporting this. - - * ace/Service_Repository.cpp: The fini() method was claiming - it was the close() method. Likewise, changed the close() method - so that it keeps decrementing the current_size each time through - the look to allow checking the respository size or doing other - work from inside the fini() call. Thanks to Valery - Arkhangorodsky for reporting this. - -Mon Apr 24 17:44:21 2000 Darrell Brunsch - - * ace/Object_Manager.cpp: - - Ai Carumba! I disabled some stuff here a while back when - I first disabled the Naming Service, but forgot to enable - it again once I fixed that. - -Mon Apr 24 16:44:22 2000 Darrell Brunsch - - * ace/SString.i: - - A couple of compilers were having problems with some - casting I was doing in a const hash method. Changed the - types of casts to hopefully make the compilers happy. - -Mon Apr 24 10:04:51 2000 Darrell Brunsch - - * ace/OS.cpp: - - Another problem with a missing parenthesis. - -Mon Apr 24 09:15:03 2000 Darrell Brunsch - - * ace/OS.i: - - Forgot a couple of ')'s that showed up on Lynx builds. - - Also, ACE_const_char doesn't exist, ACE_const_cast does. - -Sun Apr 23 19:51:41 2000 Darrell Brunsch - - * ace/ACE.cpp: - * ace/Naming_Context.cpp: - * ace/SOCK_Dgram_Mcast_QoS.cpp: - - Just tried the ACE_USES_WCHAR build and there were a couple - of things that needed updating. Mainly some missing ACE_TEXT's - or char's used instead of ACE_TCHAR's. - - * tests/Process_Mutex_Test.cpp: - - Was still using an old ACE_DEFAULT_MUTEX_A macro (updated to - ACE_DEFAULT_MUTEX). - - * ace/ace_lib.dsp: - - Added "static" to the config names (Win32 Debug => Win32 Static - Debug) so it is easier for the msvc_auto_compile.pl script to - figure out which is which. - -Sun Apr 23 18:14:33 2000 Darrell Brunsch - - * ace/ace_wchar.h: - - Added compatibility for all the old ASYS_* macros by default. - But no part of ACE/TAO should still use them anymore. This - compatibility can be turned off by defining - ACE_ONLY_LATEST_AND_GREATEST. - - * ace/SString.cpp: - * ace/SString.h: - * ace/SString.i: - * ace/Local_Name_Space.cpp: - * ace/Local_Name_Space.h: - * ace/Local_Name_Space_T.h: - * ace/Name_Space.cpp: - * ace/Name_Space.h: - * ace/Naming_Context.cpp: - * ace/Naming_Context.h: - * ace/Remote_Name_Space.cpp: - * ace/Remote_Name_Space.h: - - Found a better way of support for the ACE_Name_Space classes when - there isn't a wchar_t. We now define the ACE_WString to internally - use a type called ACE_WSTRING_TYPE, which is defined to wchar_t - unless ACE_USES_WCHAR is not defined (in which case it is defined - to ACE_USHORT16). - -Sun Apr 23 14:27:11 2000 Darrell Brunsch - - * ace/CLASSIX/CLASSIX_Port.cpp: - * tests/IOStream_Test.cpp: - * tests/SOCK_Connector_Test.cpp: - - Found some old ASYS macros still hanging around in code that wasn't - enabled on NT. - -Sat Apr 22 22:01:15 2000 Darrell Brunsch - - * ace/Local_Name_Space_T.cpp: - * ace/Naming_Context.cpp: - - Fixed some wchar related changes. - -Sat Apr 22 20:53:11 2000 Darrell Brunsch - - This is my first checkin of my Unicode changes. They should be - mostly harmless, since most platforms and build do not use Unicode - stuff, in which these changes *should* result in the exact same - behavior as before. - - But, if Unicode was being used, then chances are it is not going - to work without a few changes. A summary of the changes are: - - - Standardized wide char support to the following macros: - - ACE_HAS_WCHAR - if not defined, ACE will not use the type wchar_t - or provide any of the functions that use it. - ACE_USES_WCHAR - if defined, ACE will use wchar_t instead of char - for its strings (but not its buffers). - - This support has been mostly completed, but there are still some - loose ends that need to be cleaned up. - - Note also that even if ACE_USES_WCHAR is defined or not, both - wide and narrow versions of the string operations will be - available. - - - Removed all the ASYS_* macros (besides ASYS_INLINE). So all code - using ASYS_TEXT and ASYS_TCHAR should now use ACE_TEXT and - ACE_TCHAR. And unlike their predecessers, these *will* turn into - wide character versions when ACE_USES_WCHAR is defined. - - - Removed the macros ACE_HAS_WCHAR_TYPEDEFS_USHORT and - ACE_HAS_WCHAR_TYPEDEFS_CHAR since ACE will not depend on what - wchar_t defaults to. - - - Messed around with Windows CE support, most likely it broke it - even more. I've halted my work on Windows CE until after this - change, so I'll be fixing it up in upcoming checkins. - - - Since ACE_WString was changed, everything using it will now - not be available when ACE_HAS_WCHAR is not defined. - - The motivation for this change was that the Unicode support was - a mess and was very unintuitive. Since I was given the job of - maintaining it (since I'm doing Windows CE stuff now), I decided - to fix it instead of try to figure out what was currently - happening. A consistent design is much easier to explain and - maintain. - - * ace/ACE.h: - * ace/ACE.i: - * ace/ACE.cpp: - * ace/ARGV.cpp: - - Removed ACE's strecpy since all it did was call ACE_OS's strecpy. - - * ace/ace_wchar.h: (added) - - Moved all the unicode specific stuff here. - - * ace/SString.cpp: - * ace/SString.h: - * ace/SString.i: - - ACE_WString used to use ACE_USHORT16 instead of wchar_t. I - changed it so it does, since it will be more useful and intuitive - this way. - - * ace/Log_Record.cpp: - - We were using ACE_OS::fwrite to print the string. This didn't work - when the string was wchar_t, so this was changed to ACE_OS::fprintf - instead. - - * TODO: - * acconfig.h: - * configure.in: - * ace/ACE.cpp: - * ace/ACE.h: - * ace/ACE.i: - * ace/ARGV.cpp: - * ace/ARGV.h: - * ace/ARGV.i: - * ace/ATM_Addr.cpp: - * ace/ATM_Addr.h: - * ace/ATM_Connector.i: - * ace/ATM_QoS.cpp: - * ace/Acceptor.cpp: - * ace/Acceptor.h: - * ace/Activation_Queue.cpp: - * ace/Addr.cpp: - * ace/Arg_Shifter.cpp: - * ace/Arg_Shifter.h: - * ace/Asynch_Acceptor.cpp: - * ace/Asynch_IO.cpp: - * ace/Based_Pointer_T.cpp: - * ace/Basic_Types.h: - * ace/CORBA_Handler.cpp: - * ace/Cache_Map_Manager_T.cpp: - * ace/Cached_Connect_Strategy_T.cpp: - * ace/Caching_Strategies_T.i: - * ace/Capabilities.cpp: - * ace/Capabilities.h: - * ace/Capabilities.i: - * ace/Configuration.cpp: - * ace/Configuration.h: - * ace/Connector.cpp: - * ace/Connector.h: - * ace/Containers_T.cpp: - * ace/DEV_Addr.cpp: - * ace/DEV_Addr.h: - * ace/DEV_Addr.i: - * ace/DEV_Connector.i: - * ace/DLL.cpp: - * ace/DLL.h: - * ace/Dirent.h: - * ace/Dirent.i: - * ace/Dynamic_Service.cpp: - * ace/Dynamic_Service.h: - * ace/Env_Value_T.h: - * ace/Env_Value_T.i: - * ace/FIFO.cpp: - * ace/FIFO.h: - * ace/FIFO.i: - * ace/FIFO_Recv.cpp: - * ace/FIFO_Recv.h: - * ace/FIFO_Recv_Msg.cpp: - * ace/FIFO_Recv_Msg.h: - * ace/FIFO_Send.cpp: - * ace/FIFO_Send.h: - * ace/FIFO_Send_Msg.cpp: - * ace/FIFO_Send_Msg.h: - * ace/FILE_Addr.cpp: - * ace/FILE_Addr.h: - * ace/FILE_Addr.i: - * ace/FILE_Connector.cpp: - * ace/FILE_Connector.i: - * ace/Filecache.cpp: - * ace/Filecache.h: - * ace/Functor.h: - * ace/Functor.i: - * ace/Future.cpp: - * ace/Get_Opt.cpp: - * ace/Get_Opt.h: - * ace/Handle_Set.cpp: - * ace/Hash_Map_Manager_T.cpp: - * ace/Hash_Map_Manager_T.i: - * ace/High_Res_Timer.cpp: - * ace/High_Res_Timer.h: - * ace/INET_Addr.cpp: - * ace/INET_Addr.h: - * ace/INET_Addr.i: - * ace/IO_SAP.cpp: - * ace/IPC_SAP.cpp: - * ace/LSOCK.cpp: - * ace/LSOCK_CODgram.cpp: - * ace/LSOCK_Connector.cpp: - * ace/LSOCK_Dgram.cpp: - * ace/Local_Name_Space.cpp: - * ace/Local_Name_Space.h: - * ace/Local_Name_Space_T.cpp: - * ace/Local_Name_Space_T.h: - * ace/Local_Tokens.cpp: - * ace/Local_Tokens.h: - * ace/Local_Tokens.i: - * ace/Log_Msg.cpp: - * ace/Log_Msg.h: - * ace/Log_Record.cpp: - * ace/Log_Record.h: - * ace/Log_Record.i: - * ace/MEM_Acceptor.cpp: - * ace/MEM_Acceptor.h: - * ace/MEM_Acceptor.i: - * ace/MEM_Addr.cpp: - * ace/MEM_Addr.h: - * ace/MEM_Addr.i: - * ace/MEM_Connector.cpp: - * ace/MEM_SAP.cpp: - * ace/MEM_SAP.h: - * ace/Malloc.cpp: - * ace/Malloc_T.cpp: - * ace/Malloc_T.h: - * ace/Malloc_T.i: - * ace/Map_Manager.cpp: - * ace/Map_Manager.i: - * ace/Mem_Map.cpp: - * ace/Mem_Map.h: - * ace/Mem_Map.i: - * ace/Memory_Pool.cpp: - * ace/Memory_Pool.h: - * ace/Message_Block.cpp: - * ace/Message_Queue.cpp: - * ace/Message_Queue_T.cpp: - * ace/Module.cpp: - * ace/Module.h: - * ace/Module.i: - * ace/NT_Service.cpp: - * ace/NT_Service.h: - * ace/NT_Service.i: - * ace/Name_Proxy.cpp: - * ace/Name_Request_Reply.cpp: - * ace/Name_Space.cpp: - * ace/Name_Space.h: - * ace/Naming_Context.cpp: - * ace/Naming_Context.h: - * ace/OS.cpp: - * ace/OS.h: - * ace/OS.i: - * ace/Object_Manager.cpp: - * ace/Obstack.cpp: - * ace/Obstack.h: - * ace/POSIX_Asynch_IO.cpp: - * ace/Parse_Node.cpp: - * ace/Parse_Node.h: - * ace/Pipe.cpp: - * ace/Proactor.cpp: - * ace/Process.cpp: - * ace/Process.h: - * ace/Process.i: - * ace/Process_Manager.cpp: - * ace/QoS_Manager.cpp: - * ace/QoS_Session_Factory.cpp: - * ace/QoS_Session_Impl.cpp: - * ace/RB_Tree.cpp: - * ace/RB_Tree.i: - * ace/README: - * ace/Read_Buffer.cpp: - * ace/Registry.cpp: - * ace/Registry.h: - * ace/Registry_Name_Space.cpp: - * ace/Remote_Name_Space.cpp: - * ace/Remote_Name_Space.h: - * ace/Remote_Tokens.cpp: - * ace/Remote_Tokens.h: - * ace/Remote_Tokens.i: - * ace/SOCK.cpp: - * ace/SOCK_Acceptor.cpp: - * ace/SOCK_CODgram.cpp: - * ace/SOCK_Connector.cpp: - * ace/SOCK_Dgram.cpp: - * ace/SOCK_Dgram_Bcast.cpp: - * ace/SOCK_Dgram_Bcast.h: - * ace/SOCK_Dgram_Mcast.cpp: - * ace/SOCK_Dgram_Mcast.h: - * ace/SOCK_Dgram_Mcast_QoS.cpp: - * ace/SOCK_Dgram_Mcast_QoS.h: - * ace/SPIPE_Acceptor.cpp: - * ace/SPIPE_Addr.cpp: - * ace/SPIPE_Addr.h: - * ace/SPIPE_Addr.i: - * ace/SPIPE_Connector.cpp: - * ace/SString.cpp: - * ace/SString.h: - * ace/SString.i: - * ace/SV_Message_Queue.cpp: - * ace/SV_Semaphore_Complex.cpp: - * ace/SV_Semaphore_Simple.cpp: - * ace/SV_Shared_Memory.cpp: - * ace/Select_Reactor_Base.cpp: - * ace/Select_Reactor_T.cpp: - * ace/Service_Config.cpp: - * ace/Service_Config.h: - * ace/Service_Config.i: - * ace/Service_Manager.cpp: - * ace/Service_Manager.h: - * ace/Service_Object.cpp: - * ace/Service_Object.h: - * ace/Service_Object.i: - * ace/Service_Repository.cpp: - * ace/Service_Repository.h: - * ace/Service_Types.cpp: - * ace/Service_Types.h: - * ace/Service_Types.i: - * ace/Shared_Memory_MM.cpp: - * ace/Shared_Memory_MM.h: - * ace/Shared_Memory_MM.i: - * ace/Shared_Object.cpp: - * ace/Shared_Object.h: - * ace/Singleton.cpp: - * ace/Stats.cpp: - * ace/Stats.h: - * ace/Stats.i: - * ace/Strategies_T.cpp: - * ace/Strategies_T.i: - * ace/Stream.cpp: - * ace/Stream.h: - * ace/Stream_Modules.cpp: - * ace/Stream_Modules.h: - * ace/Svc_Conf.h: - * ace/Svc_Conf.l: - * ace/Svc_Conf.y: - * ace/Svc_Conf_l.cpp: - * ace/Svc_Conf_y.cpp: - * ace/Svc_Handler.cpp: - * ace/Svc_Handler.h: - * ace/Synch.cpp: - * ace/Synch.h: - * ace/Synch.i: - * ace/Synch_T.cpp: - * ace/Synch_T.h: - * ace/Synch_T.i: - * ace/System_Time.cpp: - * ace/System_Time.h: - * ace/TLI.cpp: - * ace/TLI_Acceptor.cpp: - * ace/TLI_Connector.i: - * ace/TP_Reactor.cpp: - * ace/TP_Reactor.i: - * ace/Task_T.cpp: - * ace/Task_T.h: - * ace/Template_Instantiations.cpp: - * ace/Thread_Manager.cpp: - * ace/Time_Request_Reply.cpp: - * ace/Timeprobe_T.cpp: - * ace/Timer_Hash_T.cpp: - * ace/Timer_Heap_T.cpp: - * ace/Timer_List_T.cpp: - * ace/Timer_Queue_Adapters.cpp: - * ace/Timer_Queue_T.cpp: - * ace/Timer_Wheel_T.cpp: - * ace/Token.cpp: - * ace/Token.h: - * ace/Token_Collection.cpp: - * ace/Token_Collection.h: - * ace/Token_Collection.i: - * ace/Token_Invariants.cpp: - * ace/Token_Invariants.h: - * ace/Token_Manager.cpp: - * ace/Token_Manager.h: - * ace/Token_Request_Reply.cpp: - * ace/Token_Request_Reply.h: - * ace/Token_Request_Reply.i: - * ace/Trace.cpp: - * ace/Trace.h: - * ace/UPIPE_Acceptor.cpp: - * ace/UPIPE_Connector.cpp: - * ace/UPIPE_Connector.i: - * ace/WFMO_Reactor.cpp: - * ace/WFMO_Reactor.i: - * ace/WIN32_Asynch_IO.cpp: - * ace/WIN32_Proactor.cpp: - * ace/XTI_ATM_Mcast.i: - * ace/config-WinCE.h: - * ace/config-all.h: - * ace/config-ghs-common.h: - * ace/config-tandem.h: - * ace/config-win32-borland.h: - * ace/config-win32-common.h: - * ace/config-win32-msvc.h: - * ace/config-win32-visualage.h: - * ace/CLASSIX/CLASSIX_CLD_Connector.cpp: - * ace/CLASSIX/CLASSIX_CO_Acceptor.cpp: - * ace/CLASSIX/CLASSIX_Port.cpp: - * ace/CLASSIX/CLASSIX_Port.h: - * ace/CLASSIX/CLASSIX_Select_Reactor.cpp: - * apps/Gateway/Gateway/Options.cpp: - * apps/JAWS/PROTOTYPE/JAWS/JAWS.h: - * bin/envinfo.cpp: - * docs/ACE-guidelines.html: - * docs/tutorials/Chap_3/mm.cpp: - * examples/Connection/blocking/SPIPE-acceptor.cpp: - * examples/Connection/blocking/SPIPE-acceptor.h: - * examples/Connection/blocking/SPIPE-connector.cpp: - * examples/Connection/blocking/SPIPE-connector.h: - * examples/Connection/non_blocking/test_lsock_acceptor.cpp: - * examples/Connection/non_blocking/test_lsock_connector.cpp: - * examples/IPC_SAP/ATM_SAP/CPP-client.cpp: - * examples/IPC_SAP/ATM_SAP/CPP-server.cpp: - * examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp: - * examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp: - * examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp: - * examples/IPC_SAP/UPIPE_SAP/ex3.cpp: - * examples/Naming/test_multiple_contexts.cpp: - * examples/Naming/test_non_existent.cpp: - * examples/Naming/test_writers.cpp: - * examples/Reactor/WFMO_Reactor/test_console_input.cpp: - * examples/Reactor/WFMO_Reactor/test_directory_changes.cpp: - * examples/Reactor/WFMO_Reactor/test_handle_close.cpp: - * examples/Reactor/WFMO_Reactor/test_registry_changes.cpp: - * examples/Registry/test_registry_iterator.cpp: - * examples/Service_Configurator/Misc/Timer_Service.cpp: - * examples/Service_Configurator/Misc/Timer_Service.h: - * examples/Service_Configurator/Misc/main.cpp: - * examples/Service_Configurator/Misc/main.dsp: - * examples/Web_Crawler/Options.cpp: - * examples/Web_Crawler/Options.h: - * examples/Web_Crawler/URL_Addr.cpp: - * examples/Web_Crawler/URL_Addr.h: - * netsvcs/clients/Logger/indirect_logging.cpp: - * netsvcs/clients/Naming/Client/main.cpp: - * netsvcs/lib/Logging_Strategy.cpp: - * netsvcs/lib/TS_Clerk_Handler.cpp: - * netsvcs/lib/TS_Clerk_Handler.h: - * performance-tests/Misc/test_naming.cpp: - * performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp: - * performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp: - * performance-tests/TCP/tcp_test.cpp: - * tests/ACE_Init_Test.dsp: - * tests/ARGV_Test.cpp: - * tests/Atomic_Op_Test.cpp: - * tests/Auto_IncDec_Test.cpp: - * tests/Barrier_Test.cpp: - * tests/Basic_Types_Test.cpp: - * tests/Buffer_Stream_Test.cpp: - * tests/CDR_File_Test.cpp: - * tests/CDR_Test.cpp: - * tests/Cache_Map_Manager_Test.cpp: - * tests/Cached_Accept_Conn_Test.cpp: - * tests/Cached_Conn_Test.cpp: - * tests/Capabilities_Test.cpp: - * tests/Collection_Test.cpp: - * tests/Conn_Test.cpp: - * tests/DLL_Test.cpp: - * tests/DLL_Test.h: - * tests/DLList_Test.cpp: - * tests/Dynamic_Priority_Test.cpp: - * tests/Enum_Interfaces_Test.cpp: - * tests/Env_Value_Test.cpp: - * tests/FlReactor_Test.cpp: - * tests/Future_Set_Test.cpp: - * tests/Future_Test.cpp: - * tests/Handle_Set_Test.cpp: - * tests/Hash_Map_Bucket_Iterator_Test.cpp: - * tests/Hash_Map_Manager_Test.cpp: - * tests/High_Res_Timer_Test.cpp: - * tests/IOStream_Test.cpp: - * tests/Lazy_Map_Manager_Test.cpp: - * tests/Log_Msg_Test.cpp: - * tests/MM_Shared_Memory_Test.cpp: - * tests/MT_Reactor_Timer_Test.cpp: - * tests/MT_SOCK_Test.cpp: - * tests/Malloc_Test.cpp: - * tests/Map_Manager_Test.cpp: - * tests/Map_Test.cpp: - * tests/Mem_Map_Test.cpp: - * tests/Message_Block_Test.cpp: - * tests/Message_Queue_Notifications_Test.cpp: - * tests/Message_Queue_Test.cpp: - * tests/Naming_Test.cpp: - * tests/New_Fail_Test.cpp: - * tests/Notify_Performance_Test.cpp: - * tests/Object_Manager_Test.cpp: - * tests/OrdMultiSet_Test.cpp: - * tests/Pipe_Test.cpp: - * tests/Priority_Buffer_Test.cpp: - * tests/Priority_Reactor_Test.cpp: - * tests/Priority_Task_Test.cpp: - * tests/Process_Manager_Test.cpp: - * tests/Process_Mutex_Test.cpp: - * tests/Process_Strategy_Test.cpp: - * tests/Process_Strategy_Test.h: - * tests/RB_Tree_Test.cpp: - * tests/Reactor_Exceptions_Test.cpp: - * tests/Reactor_Notify_Test.cpp: - * tests/Reactor_Performance_Test.cpp: - * tests/Reactor_Timer_Test.cpp: - * tests/Reactors_Test.cpp: - * tests/Reader_Writer_Test.cpp: - * tests/Recursive_Mutex_Test.cpp: - * tests/Reverse_Lock_Test.cpp: - * tests/SOCK_Connector_Test.cpp: - * tests/SOCK_Send_Recv_Test.cpp: - * tests/SOCK_Test.cpp: - * tests/SPIPE_Test.cpp: - * tests/SString_Test.cpp: - * tests/SV_Shared_Memory_Test.cpp: - * tests/Semaphore_Test.cpp: - * tests/Service_Config_Test.cpp: - * tests/Signal_Test.cpp: - * tests/Sigset_Ops_Test.cpp: - * tests/Simple_Message_Block_Test.cpp: - * tests/Svc_Handler_Test.cpp: - * tests/TSS_Test.cpp: - * tests/Task_Test.cpp: - * tests/Thread_Manager_Test.cpp: - * tests/Thread_Mutex_Test.cpp: - * tests/Thread_Pool_Reactor_Test.cpp: - * tests/Thread_Pool_Test.cpp: - * tests/Time_Service_Test.cpp: - * tests/Time_Value_Test.cpp: - * tests/Timeprobe_Test.cpp: - * tests/Timer_Queue_Test.cpp: - * tests/TkReactor_Test.cpp: - * tests/Tokens_Test.cpp: - * tests/UPIPE_SAP_Test.cpp: - * tests/Upgradable_RW_Test.cpp: - * tests/XtReactor_Test.cpp: - * tests/test_config.h: - * websvcs/lib/URL_Addr.cpp: - * websvcs/lib/URL_Addr.h: - * websvcs/lib/URL_Addr.i: - * websvcs/tests/Test_URL_Addr.cpp: - - Made all the appropriate changes to support the new wide char - policy. Most changes were macro changes, changing ASYS_* to - ACE_*, changing char's to ACE_TCHAR's, adding in ACE_TEXT ()'s - when necessary, etc. - -Sat Apr 22 18:41:06 2000 Vishal Kachroo - - * ace/SOCK_Dgram_Mcast.h: - * ace/SOCK_Dgram_Mcast.cpp: - * ace/SOCK_Dgram_Mcast.i: Removed the QoS enabled overloaded - methods. - - * ace/SOCK_Dgram_Mcast_QoS.h: - * ace/SOCK_Dgram_Mcast_QoS.cpp: - * ace/SOCK_Dgram_Mcast_QoS.i: Added this new class that derives from - ACE_SOCK_Dgram_Mcast and handles all the QoS functionality that - was being done by the latter. - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: Added the ace/SOCK_Dgram_Mcast_QoS.{cpp,i,h} - -Fri Apr 21 10:23:19 2000 Darrell Brunsch - - * bin/msvc_auto_compile.pl: - - Removed all chdir's and fixed a bug with specifying multiple -dir's. - -Fri Apr 21 09:13:20 2000 Carlos O'Ryan - - * websvcs/lib/URL_Addr.cpp: - The URL schemes are supposed to be case insensitive, thanks to - Paul Carreiro for pointing this out. - -Thu Apr 20 21:05:42 2000 Darrell Brunsch - - * bin/msvc_auto_compile.pl: - - Added a -core for only the core libraries. Also fixed a problem - with specifying incorrect directories and the -DLL/-Debug/etc. - macros. - -Thu Apr 20 18:11:48 2000 Darrell Brunsch - - * examples/DLL/Main.dsp: - * examples/DLL/Newsweek.dsp: - * examples/DLL/Today.dsp - * examples/Configuration/Configuration.dsw: - * examples/Bounded_Packet_Relay/Bounded_Packet_Relay.dsp: - * examples/Configuration/Test.dsp: - * examples/IPC_SAP/ATM_SAP/ATM_SAP.dsw: - * examples/IPC_SAP/ATM_SAP/CPP_client.dsp: - * examples/IPC_SAP/ATM_SAP/CPP_server.dsp: - * examples/IPC_SAP/SOCK_SAP/CPP_memclient.dsp: - * examples/Mem_Map/file-reverse/file_reverse.dsp: - * examples/NT_Service/NT_Service.dsp: - * examples/NT_Service/NT_Service.dsw: - * examples/OS/Process/Process.dsp: - * examples/OS/Process/imore.dsp: - * examples/QOS/client.dsp: - * examples/QOS/server.dsp: - * examples/Reactor/Misc/demuxing.dsp: - * examples/Reactor/Multicast/client.dsp: - * examples/Reactor/Multicast/server.dsp: - * examples/Service_Configurator/Misc/Timer.dsp: - * examples/Service_Configurator/Misc/main.dsp: - * examples/Timer_Queue/Async_Timer_Queue_Test.dsp: - * examples/Timer_Queue/Reactor_Timer_Queue_Test.dsp: - * examples/Timer_Queue/Thread_Timer_Queue_Test.dsp: - * examples/Timer_Queue/Timer_Queue.dsw: - * examples/Web_Crawler/Web_Crawler.dsp: - - Fixed miscellaneous problems with these projects and workspaces. - Some projects were missing from workspaces or listed incorrectly. - Many project didn't have the correct include paths or definitions. - - * examples/Reactor/Proactor/post_completion.dsp: (removed) - - There was already a post_completions.dsp that was being used. - - * examples/OS/Process/imore.cpp: - * examples/OS/Process/process.cpp: - - Changed the type of the variables used with Process::wait from - int to ACE_exitcode. - - * examples/Reactor/WFMO_Reactor/test_abandoned.cpp: - * examples/Reactor/WFMO_Reactor/test_apc.cpp: - - Missing parentheses. - - * Synch-Benchmarks/Synch_Lib/Synch_Lib.dsp: - - Changed the name of the project so win32_auto_compile.pl works - with it properly. - - * bin/msvc_auto_compile.pl: (added) - - This is a new script for autocompiling with MSVC 6. - Eventually this should replace auto_compile_win32.pl. It still - needs more directories added to it and tested before we put it - into production - - * bin/vc_filter.pl: - - Updated to properly color code output from msvc_auto_compile.pl - also. - -Thu Apr 20 09:50:49 2000 Carlos O'Ryan - - * ace/RB_Tree.h: - * ace/RB_Tree.i: - Fixed implementation of the end() method. It should return a - singular iterator that is different from all valid iterator, not - an iterator pointing to the last element in the collection. - -Thu Apr 20 08:53:31 2000 Carlos O'Ryan - - * ace/CDR_Stream.i: - Fixed problem in the align_write_ptr() method. It was optimized - for the case where there was enough room in the current buffer, - but the optimization broke with a previous fix from Feb 29. - -Thu Apr 20 08:40:00 2000 Chris Gill - - * examples/Bounded_Packet_Relay/BPR_Drivers_T.h, - examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp: - Fixed warnings from g++ - -Wed Apr 19 21:53:52 2000 Douglas C. Schmidt - - * examples/Bounded_Packet_Relay: Added some missing template - instantiations and other assorted problems. Thanks to Aoxiang - Xu for reporting these. - -Wed Apr 19 07:04:13 2000 Douglas C. Schmidt - - * ace/Containers_T.cpp (copy_nodes): insert_head() should have - been insert_tail(). Thanks to Umar Syyid for clarifying this. - Also, added some comments to explain what's going on in - insert_tail() since the code was somewhat non-intuitive ;-). - -Wed Apr 19 15:00:44 2000 Carlos O'Ryan - - * apps/Makefile: - * apps/drwho/Makefile: - * performance-tests/Makefile: - * performance-tests/Server_Concurrency/Leader_Follower/Makefile: - * performance-tests/Server_Concurrency/Queue_Based_Workers/Makefile: - More Makefiles that were not in the default compilation path, - added them and update dependencies. - - * bin/Makefile: - * examples/Bounded_Packet_Relay/Makefile: - * examples/QOS/Makefile: - * performance-tests/RPC/Makefile: - * performance-tests/Synch-Benchmarks/Base_Test/Makefile: - * performance-tests/Synch-Benchmarks/Perf_Test/Makefile: - * performance-tests/Synch-Benchmarks/Synch_Lib/Makefile: - * ASNMP/asnmp/Makefile: - * ASNMP/examples/get/Makefile: - * ASNMP/examples/next/Makefile: - * ASNMP/examples/set/Makefile: - * ASNMP/examples/trap/Makefile: - * ASNMP/examples/walk/Makefile: - * ASNMP/tests/Makefile: - Just updated dependencies. More fixes are needed to put them in - the normal compilation path. - - * performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp: - * performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp: - They wouldn't compile on platforms that lack context switch - counters in rusage. Conditionally compile that code to avoid - the problem. - -Wed Apr 19 14:09:29 2000 Darrell Brunsch - - * etc/Svc_Conf_l.cpp.diff: Fixed the diff so it generates - the correct Svc_Conf_l.cpp. - -Wed Apr 19 12:48:21 2000 Balachandran Natarajan - - * ace/ACE.cpp: Added a missing pointer in the signature of - ACE::t_rcv_n_i (). - -Wed Apr 19 10:11:23 2000 Darrell Brunsch - - * tests/Atomic_Op_Test.dsp: - * tests/Auto_IncDec_Test.dsp: - * tests/Barrier_Test.dsp: - * tests/Basic_Types_Test.dsp: - * tests/Buffer_Stream_Test.dsp: - * tests/CDR_File_Test.dsp: - * tests/CDR_Test.dsp: - * tests/Cache_Map_Manager_Test.dsp: - * tests/Cached_Accept_Conn_Test.dsp: - * tests/Cached_Conn_Test.dsp: - * tests/Capabilities_Test.dsp: - * tests/Collection_Test.dsp: - * tests/Conn_Test.dsp: - * tests/DLList_Test.dsp: - * tests/Dynamic_Priority_Test.dsp: - * tests/Enum_Interfaces_Test.dsp: - * tests/Env_Value_Test.dsp: - * tests/Future_Set_Test.dsp: - * tests/Future_Test.dsp: - * tests/Handle_Set_Test.dsp: - * tests/Hash_Map_Bucket_Iterator_Test.dsp: - * tests/Hash_Map_Manager_Test.dsp: - * tests/High_Res_Timer_Test.dsp: - * tests/IOStream_Test.dsp: - * tests/Lazy_Map_Manager_Test.dsp: - * tests/MM_Shared_Memory_Test.dsp: - * tests/MT_Reactor_Timer_Test.dsp: - * tests/MT_SOCK_Test.dsp: - * tests/Malloc_Test.dsp: - * tests/Map_Manager_Test.dsp: - * tests/Map_Test.dsp: - * tests/Mem_Map_Test.dsp: - * tests/Message_Block_Test.dsp: - * tests/Message_Queue_Notifications_Test.dsp: - * tests/Message_Queue_Test.dsp: - * tests/Naming_Test.dsp: - * tests/New_Fail_Test.dsp: - * tests/Notify_Performance_Test.dsp: - * tests/Object_Manager_Test.dsp: - * tests/OrdMultiSet_Test.dsp: - * tests/Pipe_Test.dsp: - * tests/Priority_Buffer_Test.dsp: - * tests/Priority_Reactor_Test.dsp: - * tests/Priority_Task_Test.dsp: - * tests/Process_Manager_Test.dsp: - * tests/Process_Mutex_Test.dsp: - * tests/Process_Strategy_Test.dsp: - * tests/RB_Tree_Test.dsp: - * tests/Reactor_Exceptions_Test.dsp: - * tests/Reactor_Notify_Test.dsp: - * tests/Reactor_Performance_Test.dsp: - * tests/Reactor_Timer_Test.dsp: - * tests/Reactors_Test.dsp: - * tests/Reader_Writer_Test.dsp: - * tests/Recursive_Mutex_Test.dsp: - * tests/Reverse_Lock_Test.dsp: - * tests/SOCK_Connector_Test.dsp: - * tests/SOCK_Send_Recv_Test.dsp: - * tests/SOCK_Test.dsp: - * tests/SPIPE_Test.dsp: - * tests/SString_Test.dsp: - * tests/SV_Shared_Memory_Test.dsp: - * tests/Semaphore_Test.dsp: - * tests/Service_Config_Test.dsp: - * tests/Sigset_Ops_Test.dsp: - * tests/Simple_Message_Block_Test.dsp: - * tests/Svc_Handler_Test.dsp: - * tests/TSS_Test.dsp: - * tests/Task_Test.dsp: - * tests/Thread_Manager_Test.dsp: - * tests/Thread_Mutex_Test.dsp: - * tests/Thread_Pool_Reactor_Test.dsp: - * tests/Thread_Pool_Test.dsp: - * tests/Time_Service_Test.dsp: - * tests/Time_Value_Test.dsp: - * tests/Timeprobe_Test.dsp: - * tests/Timer_Queue_Test.dsp: - * tests/Tokens_Test.dsp: - * tests/UPIPE_SAP_Test.dsp: - * tests/Upgradable_RW_Test.dsp: - * tests/pharlap/Atomic_Op_Test.dsp: (added) - * tests/pharlap/Auto_IncDec_Test.dsp: (added) - * tests/pharlap/Barrier_Test.dsp: (added) - * tests/pharlap/Basic_Types_Test.dsp: (added) - * tests/pharlap/Buffer_Stream_Test.dsp: (added) - * tests/pharlap/CDR_File_Test.dsp: (added) - * tests/pharlap/CDR_Test.dsp: (added) - * tests/pharlap/Cache_Map_Manager_Test.dsp: (added) - * tests/pharlap/Cached_Accept_Conn_Test.dsp: (added) - * tests/pharlap/Cached_Conn_Test.dsp: (added) - * tests/pharlap/Capabilities_Test.dsp: (added) - * tests/pharlap/Collection_Test.dsp: (added) - * tests/pharlap/Conn_Test.dsp: (added) - * tests/pharlap/DLList_Test.dsp: (added) - * tests/pharlap/Dynamic_Priority_Test.dsp: (added) - * tests/pharlap/Enum_Interfaces_Test.dsp: (added) - * tests/pharlap/Env_Value_Test.dsp: (added) - * tests/pharlap/Future_Set_Test.dsp: (added) - * tests/pharlap/Future_Test.dsp: (added) - * tests/pharlap/Handle_Set_Test.dsp: (added) - * tests/pharlap/Hash_Map_Bucket_Iterator_Test.dsp: (added) - * tests/pharlap/Hash_Map_Manager_Test.dsp: (added) - * tests/pharlap/High_Res_Timer_Test.dsp: (added) - * tests/pharlap/IOStream_Test.dsp: (added) - * tests/pharlap/Lazy_Map_Manager_Test.dsp: (added) - * tests/pharlap/MM_Shared_Memory_Test.dsp: (added) - * tests/pharlap/MT_Reactor_Timer_Test.dsp: (added) - * tests/pharlap/MT_SOCK_Test.dsp: (added) - * tests/pharlap/Malloc_Test.dsp: (added) - * tests/pharlap/Map_Manager_Test.dsp: (added) - * tests/pharlap/Map_Test.dsp: (added) - * tests/pharlap/Mem_Map_Test.dsp: (added) - * tests/pharlap/Message_Block_Test.dsp: (added) - * tests/pharlap/Message_Queue_Notifications_Test.dsp: (added) - * tests/pharlap/Message_Queue_Test.dsp: (added) - * tests/pharlap/Naming_Test.dsp: (added) - * tests/pharlap/New_Fail_Test.dsp: (added) - * tests/pharlap/Notify_Performance_Test.dsp: (added) - * tests/pharlap/Object_Manager_Test.dsp: (added) - * tests/pharlap/OrdMultiSet_Test.dsp: (added) - * tests/pharlap/Pipe_Test.dsp: (added) - * tests/pharlap/Priority_Buffer_Test.dsp: (added) - * tests/pharlap/Priority_Reactor_Test.dsp: (added) - * tests/pharlap/Priority_Task_Test.dsp: (added) - * tests/pharlap/Process_Manager_Test.dsp: (added) - * tests/pharlap/Process_Mutex_Test.dsp: (added) - * tests/pharlap/Process_Strategy_Test.dsp: (added) - * tests/pharlap/RB_Tree_Test.dsp: (added) - * tests/pharlap/Reactor_Exceptions_Test.dsp: (added) - * tests/pharlap/Reactor_Notify_Test.dsp: (added) - * tests/pharlap/Reactor_Performance_Test.dsp: (added) - * tests/pharlap/Reactor_Timer_Test.dsp: (added) - * tests/pharlap/Reactors_Test.dsp: (added) - * tests/pharlap/Reader_Writer_Test.dsp: (added) - * tests/pharlap/Recursive_Mutex_Test.dsp: (added) - * tests/pharlap/Reverse_Lock_Test.dsp: (added) - * tests/pharlap/SOCK_Connector_Test.dsp: (added) - * tests/pharlap/SOCK_Send_Recv_Test.dsp: (added) - * tests/pharlap/SOCK_Test.dsp: (added) - * tests/pharlap/SPIPE_Test.dsp: (added) - * tests/pharlap/SString_Test.dsp: (added) - * tests/pharlap/SV_Shared_Memory_Test.dsp: (added) - * tests/pharlap/Semaphore_Test.dsp: (added) - * tests/pharlap/Service_Config_Test.dsp: (added) - * tests/pharlap/Sigset_Ops_Test.dsp: (added) - * tests/pharlap/Simple_Message_Block_Test.dsp: (added) - * tests/pharlap/Svc_Handler_Test.dsp: (added) - * tests/pharlap/TSS_Test.dsp: (added) - * tests/pharlap/Task_Test.dsp: (added) - * tests/pharlap/Thread_Manager_Test.dsp: (added) - * tests/pharlap/Thread_Mutex_Test.dsp: (added) - * tests/pharlap/Thread_Pool_Reactor_Test.dsp: (added) - * tests/pharlap/Thread_Pool_Test.dsp: (added) - * tests/pharlap/Time_Service_Test.dsp: (added) - * tests/pharlap/Time_Value_Test.dsp: (added) - * tests/pharlap/Timeprobe_Test.dsp: (added) - * tests/pharlap/Timer_Queue_Test.dsp: (added) - * tests/pharlap/Tokens_Test.dsp: (added) - * tests/pharlap/UPIPE_SAP_Test.dsp: (added) - * tests/pharlap/Upgradable_RW_Test.dsp: (added) - * tests/pharlap/pharlap_tests.dsw: (added) - - Moved all the pharlap configurations to their own dsp files in - their own subdirectory. This was done so those of us who don't - have pharlap can load tests.dsw and do a select all in the Build - All window and only get the relavant builds. - - * tests/run_pharlap_tests.bat: (removed) - * tests/pharlap/run_pharlap_tests.bat: (added) - - Moved this file to the pharlap directory also. - -Wed Apr 19 10:03:10 2000 Carlos O'Ryan - - * ace/SOCK_Stream.i: - The new flag was present but not used in several - methods, just forward them to the ACE::xxx() operation. - -Wed Apr 19 08:18:30 2000 Carlos O'Ryan - - * */Makefile: - Updated all the dependencies - -Wed Apr 19 09:44:14 2000 Jeff Parsons - - * ace/Log_Msg.cpp: - Changed the signature of a (WIN32-specific) call to - send_n, to resolve a function overload ambiguity on NT. - -Wed Apr 19 00:00:29 2000 Irfan Pyarali - - * ace: There are two general use cases of the _n() methods: - - (1) The method keeps looping, until all the data has been - transmitted, or until timeout occurs, or until the handle is - closed. This use case occurs when one does not know how much - data is coming across in the case of a recv(), or one wants to - know exactly how much data was sent in the case of a send(). - And one don't want to treat a premature eof as an error but - wants to know the exact number of bytes that have been - transferred so far. - - (2) In other cases when one knows exactly how much data is - coming across in the case of recv(), or how much data needs to - be transmitted in the case of a send(). Premature closing of the - handle is usually an error. - - By adding an additional parameter to all the _n() - methods, the above two use cases can be distinguished. The - following files were modified: - - - OS - - ACE - - SOCK_Stream - - TLI_Stream - - The other IO classes such as FIFO, MEM_IO, PIPE, etc., should - also include this change. However, they should first get fixed - with respect to timeouts. If comes before - timeouts, ordering of the parameters will get messed up. - - Thanks to Steffen Winther Sorensen for - reporting this second use of the _n() methods. - - * ace/OS.h: t_snd() interface was fixed. The buffer parameter - should be const. - - * ace/ACE: Added support for TLI I/O functions to the ACE class. - -Tue Apr 18 19:08:37 2000 Darrell Brunsch - - * ace/config-all.h: (added) - * ace/inc_user_config.h: (removed) - * ace/Codeset_IBM1047.h: - * ace/NT_Service.h: - * ace/config-win32-common.h: - * ace/OS.h: - - Started moving several of the macros from OS.h to config-all.h. - The plan is to eventually split up OS.h, and config-all is a - place where the macros (which are not specific to any part of - ACE_OS) can go. config-all.h also ate inc_user_config.h. - - * ASNMP/agent/main.cpp: - * ace/iosfwd.h: - * ace/streams.h: - * apps/JAWS/PROTOTYPE/JAWS/Assoc_Array.cpp: - * tests/OrdMultiSet_Test.cpp: - * tests/Time_Value_Test.cpp: - * tests/test_config.h: - - Since inc_user_config.h was eaten, needed to change includes of - it to config-all.h. - - * bin/generate_export_file.pl: (added) - * bin/GenExportH.BAT: (removed) - - Replaced the batch file with a perl file so - - people can generate on other platforms - - it can generate Word_export and WORD_BUILD_DLL - (the batch file couldn't change the case of the key) - - * ace/ACE_export.h: (added) - * ace/svc_export.h: (added) - - Took the existing ACE_Export and ACE_Svc_Export macro and - moved them to separate files. Also tested out the new - generate_export_file.pl. - - * ace/ACE.cpp: - * ace/ARGV.cpp: - * ace/ATM_Acceptor.cpp: - * ace/ATM_Addr.cpp: - * ace/ATM_Connector.cpp: - * ace/ATM_Params.cpp: - * ace/ATM_QoS.cpp: - * ace/ATM_Stream.cpp: - * ace/Acceptor.cpp: - * ace/Activation_Queue.cpp: - * ace/Active_Map_Manager.cpp: - * ace/Addr.cpp: - * ace/Arg_Shifter.cpp: - * ace/Asynch_Acceptor.cpp: - * ace/Asynch_IO.cpp: - * ace/Asynch_IO_Impl.cpp: - * ace/Auto_IncDec_T.cpp: - * ace/Auto_Ptr.cpp: - * ace/Based_Pointer_Repository.cpp: - * ace/Based_Pointer_T.cpp: - * ace/Basic_Types.cpp: - * ace/CDR_Stream.cpp: - * ace/CORBA_Handler.cpp: - * ace/CORBA_Ref.cpp: - * ace/Cache_Map_Manager_T.cpp: - * ace/Cached_Connect_Strategy_T.cpp: - * ace/Capabilities.cpp: - * ace/Cleanup_Strategies_T.cpp: - * ace/Configuration.cpp: - * ace/Connector.cpp: - * ace/Containers.cpp: - * ace/Containers_T.cpp: - * ace/DEV.cpp: - * ace/DEV_Addr.cpp: - * ace/DEV_Connector.cpp: - * ace/DEV_IO.cpp: - * ace/DLL.cpp: - * ace/Date_Time.cpp: - * ace/Dirent.cpp: - * ace/Dump.cpp: - * ace/Dynamic.cpp: - * ace/Dynamic_Service.cpp: - * ace/Event_Handler.cpp: - * ace/Event_Handler_T.cpp: - * ace/FIFO.cpp: - * ace/FIFO_Recv.cpp: - * ace/FIFO_Recv_Msg.cpp: - * ace/FIFO_Send.cpp: - * ace/FIFO_Send_Msg.cpp: - * ace/FILE.cpp: - * ace/FILE_Addr.cpp: - * ace/FILE_Connector.cpp: - * ace/FILE_IO.cpp: - * ace/Filecache.cpp: - * ace/FlReactor.cpp: - * ace/Functor.cpp: - * ace/Functor_T.cpp: - * ace/Future.cpp: - * ace/Future_Set.cpp: - * ace/Get_Opt.cpp: - * ace/Handle_Set.cpp: - * ace/Hash_Cache_Map_Manager_T.cpp: - * ace/Hash_Map_Manager.cpp: - * ace/High_Res_Timer.cpp: - * ace/INET_Addr.cpp: - * ace/IOStream.cpp: - * ace/IOStream_T.cpp: - * ace/IO_SAP.cpp: - * ace/IPC_SAP.cpp: - * ace/LSOCK.cpp: - * ace/LSOCK_Acceptor.cpp: - * ace/LSOCK_CODgram.cpp: - * ace/LSOCK_Connector.cpp: - * ace/LSOCK_Dgram.cpp: - * ace/LSOCK_Stream.cpp: - * ace/Local_Name_Space.cpp: - * ace/Local_Name_Space_T.cpp: - * ace/Local_Tokens.cpp: - * ace/Log_Msg.cpp: - * ace/Log_Record.cpp: - * ace/MEM_Acceptor.cpp: - * ace/MEM_Addr.cpp: - * ace/MEM_Connector.cpp: - * ace/MEM_IO.cpp: - * ace/MEM_SAP.cpp: - * ace/MEM_Stream.cpp: - * ace/Malloc.cpp: - * ace/Malloc_T.cpp: - * ace/Managed_Object.cpp: - * ace/Map.cpp: - * ace/Map_Manager.cpp: - * ace/Mem_Map.cpp: - * ace/Memory_Pool.cpp: - * ace/Message_Block.cpp: - * ace/Message_Block_T.cpp: - * ace/Message_Queue.cpp: - * ace/Message_Queue_T.cpp: - * ace/Method_Request.cpp: - * ace/Module.cpp: - * ace/Msg_WFMO_Reactor.cpp: - * ace/Multiplexor.cpp: - * ace/NT_Service.cpp: - * ace/Name_Proxy.cpp: - * ace/Name_Request_Reply.cpp: - * ace/Name_Space.cpp: - * ace/Naming_Context.cpp: - * ace/OS.cpp: - * ace/Object_Manager.cpp: - * ace/Obstack.cpp: - * ace/POSIX_Proactor.cpp: - * ace/Pair.cpp: - * ace/Parse_Node.cpp: - * ace/Pipe.cpp: - * ace/Priority_Reactor.cpp: - * ace/Proactor.cpp: - * ace/Process.cpp: - * ace/Process_Manager.cpp: - * ace/Profile_Timer.cpp: - * ace/QoS_Manager.cpp: - * ace/QoS_Session_Factory.cpp: - * ace/QoS_Session_Impl.cpp: - * ace/Reactor.cpp: - * ace/Read_Buffer.cpp: - * ace/Registry.cpp: - * ace/Registry_Name_Space.cpp: - * ace/Remote_Name_Space.cpp: - * ace/Remote_Tokens.cpp: - * ace/SOCK.cpp: - * ace/SOCK_Acceptor.cpp: - * ace/SOCK_CODgram.cpp: - * ace/SOCK_Connector.cpp: - * ace/SOCK_Dgram.cpp: - * ace/SOCK_Dgram_Bcast.cpp: - * ace/SOCK_Dgram_Mcast.cpp: - * ace/SOCK_IO.cpp: - * ace/SOCK_Stream.cpp: - * ace/SPIPE.cpp: - * ace/SPIPE_Acceptor.cpp: - * ace/SPIPE_Addr.cpp: - * ace/SPIPE_Connector.cpp: - * ace/SPIPE_Stream.cpp: - * ace/SString.cpp: - * ace/SV_Message.cpp: - * ace/SV_Message_Queue.cpp: - * ace/SV_Semaphore_Complex.cpp: - * ace/SV_Semaphore_Simple.cpp: - * ace/SV_Shared_Memory.cpp: - * ace/Sched_Params.cpp: - * ace/Select_Reactor.cpp: - * ace/Select_Reactor_Base.cpp: - * ace/Select_Reactor_T.cpp: - * ace/Service_Config.cpp: - * ace/Service_Manager.cpp: - * ace/Service_Object.cpp: - * ace/Service_Repository.cpp: - * ace/Service_Types.cpp: - * ace/Shared_Memory.cpp: - * ace/Shared_Memory_MM.cpp: - * ace/Shared_Memory_SV.cpp: - * ace/Shared_Object.cpp: - * ace/Signal.cpp: - * ace/Singleton.cpp: - * ace/Stats.cpp: - * ace/Strategies.cpp: - * ace/Strategies_T.cpp: - * ace/Stream.cpp: - * ace/Stream_Modules.cpp: - * ace/Svc_Conf.y: - * ace/Svc_Conf_l.cpp: - * ace/Svc_Conf_y.cpp: - * ace/Svc_Handler.cpp: - * ace/Synch.cpp: - * ace/Synch_Options.cpp: - * ace/Synch_T.cpp: - * ace/System_Time.cpp: - * ace/TLI.cpp: - * ace/TLI_Acceptor.cpp: - * ace/TLI_Connector.cpp: - * ace/TLI_Stream.cpp: - * ace/TP_Reactor.cpp: - * ace/TTY_IO.cpp: - * ace/Task.cpp: - * ace/Task_T.cpp: - * ace/Thread.cpp: - * ace/Thread_Manager.cpp: - * ace/Time_Request_Reply.cpp: - * ace/Timeprobe.cpp: - * ace/Timer_Hash.cpp: - * ace/Timer_Hash_T.cpp: - * ace/Timer_Heap.cpp: - * ace/Timer_Heap_T.cpp: - * ace/Timer_List.cpp: - * ace/Timer_List_T.cpp: - * ace/Timer_Queue.cpp: - * ace/Timer_Queue_Adapters.cpp: - * ace/Timer_Queue_T.cpp: - * ace/Timer_Wheel.cpp: - * ace/Timer_Wheel_T.cpp: - * ace/TkReactor.cpp: - * ace/Token.cpp: - * ace/Token_Collection.cpp: - * ace/Token_Invariants.cpp: - * ace/Token_Manager.cpp: - * ace/Token_Request_Reply.cpp: - * ace/Trace.cpp: - * ace/Typed_SV_Message.cpp: - * ace/Typed_SV_Message_Queue.cpp: - * ace/UNIX_Addr.cpp: - * ace/UPIPE_Acceptor.cpp: - * ace/UPIPE_Connector.cpp: - * ace/UPIPE_Stream.cpp: - * ace/WFMO_Reactor.cpp: - * ace/WIN32_Asynch_IO.cpp: - * ace/WIN32_Proactor.cpp: - * ace/XTI_ATM_Mcast.cpp: - * ace/XtReactor.cpp: - * include/makeinclude/ace_flags.bor: - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: - - The definition of ACE_BUILD_DLL was moved from the .cpp files - to the project files - so it is now handled like most of the - other libraries in ACE and TAO. - -Tue Apr 18 21:32:21 2000 Douglas C. Schmidt - - * ace/OS.i (sema_init): Fixed another problem that required - a cast to ACE_mutexattr_t *. Thanks to Priyanka for - reporting this. - -Tue Apr 18 19:39:41 2000 Douglas C. Schmidt - - * ace/Synch.cpp, - * ace/OS.cpp: Added a cast to ACE_mutexattr_t *. Thanks to - Darrell for pointing this out. - -Tue Apr 18 15:18:53 2000 Douglas C. Schmidt - - * ace/OS.h, - * ace/OS.i, - * ace/Synch.h, - * ace/Synch.cpp: Updated the ACE_OS::*mutex_init() methods (and the - corresponding ACE_Thread_Mutex, ACE_Mutex, and - ACE_Recursive_Thread_Mutex classes) so that they now take an - optional ACE_mutexattr_t * rather than just a void *. This is - nice because it makes it possible to pass in special attributes, - such as the mutex prioceiling attribute, to the underlying - pthreads mutex (assuming we're running on pthreads, of course). - Thanks to lafortg@res.raytheon.com for motivating this. - - * ace/Containers_T.cpp (copy_nodes): Added a call to the - allocator->malloc() rather than new. Thanks to Umar Syyid - for reporting this. - -Tue Apr 18 14:06:32 2000 Jeff Parsons - - * ace/CDR_Stream.cpp: - Patch to ACE_CDR::consolidate() sent in by Carlos, that - fixes a bug reported by Harald Finster , - and an added check for 0 value of the 'length' arg in - read_array() and write_array(), that fixes [Bug 540], - reported by Mathew Samuel . - -Tue Apr 18 11:47:57 2000 Ossama Othman - - * ace/SOCK_Connector.cpp: - - Removed inclusion of `ace/Handle_Set.h'. The ACE_SOCK_Connector - doesn't directly use an ACE_Handle_Set. - - * ace/Makefile: - - Updated dependencies. - -Tue Apr 18 08:54:04 2000 Darrell Brunsch - - * bin/vc_filter.pl: - - Brand spankin' new filter script for Win32 auto build results. - -Sun Apr 16 22:24:34 2000 Douglas C. Schmidt - - * ACE-INSTALL.html: Updated the link for GNU make to be more - specific. Thanks to Xiaojun Wu for - reporting this. BTW, Xiaojun was the 900th contributor to - ACE+TAO, so he gets a free copy of ACE+TAO! - -Mon Apr 17 20:10:18 2000 Vishal - - * ACE version 5.1.1 released. - -Mon Apr 17 16:33:17 2000 Ossama Othman - - * acconfig.h (ACE_LACKS_ACE_OTHER, ACE_LACKS_ACE_SVCCONF, - ACE_LACKS_ACE_TOKEN): - - Added support for these macros. They are used when enabling - subsetting. - - * configure.in: - - lseek64() and llseek() test has been moved to - `m4/acinclude.m4'. - - Include `sys/types.h' when running the TLI/XTI tests. Some - platforms use typedefs such as "ulong" but such typedefs may not - be defined in the TLI/XTI headers. - - (ACE_HAS_BROKEN_T_ERROR): - - Corrected test for broken t_error(). A variable, "errmsg" was - being passed to the t_error() call in the test, but the variable - was declared as "ace_errmsg." Thanks to Roland Gigler - for pointing this out. - - (ACE_MAJOR, ACE_MINOR, ACE_BETA): - - If any of these variables is evaluates to the empty string, then - set it to zero. This fixes a problem that was occuring when the - the ACE version contained no beta number (e.g. "5.1" instead - "5.1.0"). Libtool didn't like the fact that one of the numbers - was an empty string. - - * ace/Makefile.am (libACE_IPC_la_SOURCES, libACE_Other_la_SOURCES, - HEADER_FILES, INLINE_FILES): - - Synchronized the sources associated with these Makefile - variables with those in the classical ACE Makefile. - - * m4/acinclude.m4 (ACE_CHECK_LSEEK64): - - Moved checks for lseek64() and llseek() from configure.in to - this file. The beginnings of a test for a 64 bit offset type - have also been added, but that test is currently not in use. - - * m4/ace.m4 (ACE_COMPILATION_OPTIONS): - - Removed check for exception support in C compiler. It didn't - make too much sense to check for exception support in a C - compiler. - - Since exception support is disabled by default, make sure - "-fno-exceptions" is set when using g++ with the default ACE - exception configuration value. - - * m4/compiler.m4 (ACE_SET_COMPILER_FLAGS): - - Fixed typos where "$GXX" was used instead of "$CXX." "$GXX" is - set to yes when GNU C++ is being used, and "$CXX" is set to the - compiler being used (e.g. "c++"). Thanks to Rich Seibel - for pointing this out. - - This also fixes a problem where "-fcheck-new" wasn't being added - to the C++ flags ($CXXFLAGS). - - * m4/subsets.m4 (ACE_LACKS_ACE_OTHER, ACE_LACKS_ACE_SVCCONF, - ACE_LACKS_ACE_TOKEN): - - When disabling the "Other," "SvcConf" and/or the "Token" subset, - then define the corresponding preprocessor macro. - -Sat Apr 15 21:49:04 2000 Darrell Brunsch - - * ace/ACE.cpp: - * apps/Gateway/Gateway/Options.cpp: - - Nick Pratt reported two cases where - we were using sizeof some_string to figure out its length. This - of course doesn't work when the string is a wide string, so they - have been changed to account for the character size. - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: - * apps/gperf/src/gperf.dsp: - * apps/gperf/src/gperf_lib.dsp: - - Changed around the order of the configurations so that in the - default case (such as out of the box) the regular Debug version - will be the current configuration. - -Sat Apr 15 19:35:57 2000 Darrell Brunsch - - (On behalf of Christopher Kohlhoff ) - - * ace/Makefile.bor: - - Added new file QoS_Manager.cpp. - - * ace/Basic_Types.h: - * ace/Timer_Queue_Adapters.h: - - Added missing pre/post includes. - - * include/makeinclude/ace_flags.bor: - * include/makeinclude/build_example.bor: - - Updated for new orbsvcs libraries. - -Sat Apr 15 18:17:02 2000 Douglas C. Schmidt - - * apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp: - Fixed the handle_output() function so that it does the "Right - Thing"[TM] on Windows NT. Win32 Winsock doesn't trigger - multiple "You can write now" signals, so we have to assume that - we can continue to write until we get another EWOULDBLOCK. - Thanks to Nick Pratt - -Thu Apr 13 16:30:01 2000 David L. Levine - - * ace/config-sunos5.7.h: added #undef ACE_NEEDS_LWP_PRIO_SET. - SunOS 5.7 no longer needs it, as shown by - performance-tests/Misc/preempt (run as superuser). Thanks - to John Foresteire - for reporting this. - -Tue Apr 11 21:41:20 2000 Nanbor Wang - - * bin/auto_compile_win32.pl: Updated the lists of - workspaces/projects to build. - -Tue Apr 11 16:15:31 2000 David L. Levine - - * ace/OS.cpp: moved ACE_Thread_Exit::is_constructed_ - definition so that it's seen on all platforms, not just - those that are ACE_MT_SAFE. Fixes: - Mon Apr 10 07:30:22 2000 John Rodgers - Thanks to Vishal for reporting it. - -Tue Apr 11 13:57:11 2000 Douglas C. Schmidt - - * ace/Synch_T.cpp: Make sure to cast the "type" argument to - "short" to avoid overload confusions by certain compilers. - Thanks to Charles Taurines for reporting - this. - -Tue Apr 11 12:52:04 2000 Vishal Kachroo - - * ace/SOCK_Dgram_Mcast.cpp (subscribe): Removed the #ifdef - for template instantiation. - -Tue Apr 11 11:32:03 2000 Chad Elliott - * bin/ACEutils.pm - - Refactored duplicate test code into ACEutils.pm - -Mon Apr 10 19:45:32 2000 Vishal Kachroo - - * ace/SOCK_Dgram_Mcast.cpp (subscribe): Added a #ifdef to - get past a g++ error. I am looking into the right way to - do this. - -Mon Apr 10 17:37:53 2000 Nanbor Wang - - * ace/config-freebsd-pthread.h: Addplied John Aughey - 's patch for FreeBSD 4.0. - -Mon Apr 10 07:30:22 2000 John Rodgers - - * ace/OS.{h,cpp},Thread_Manager.cpp (instance,~ACE_Thread_Exit): - added a state variable, is_constructed_, to ACE_Thread_Exit. - instance () sets it, ~ACE_Thread_Exit () clears it. This - allows ACE::init () to be called after ACE::fini (), because - a new ACE_Thread_Exit instance will be created. [Bug 526] - -Sun Apr 9 14:16:23 2000 James CE Johnson - - * docs/tutorials/015/page01.html : Thanks to Conrad Hughes for - pointing out that a real implementation would compress before - encrypting since encrypted data shouldn't really be compressible - anyway. - - * docs/tutorials/015/Protocol_Stream.cpp (open): Reorder the - module pushing so that encryption happens before compression. - - * docs/tutorials/015/Crypt.cpp : - * docs/tutorials/015/Compressor.cpp : - Add a few extra bytes when creating the new message blocks. A - real implementation would probably need that. - -Sun Apr 09 00:04:25 2000 Nanbor Wang - - * ace/Malloc_T.cpp (remove): Removed invocation of destructor to - . It is a member of Control_Block and does not - require explicit initialization/destruction. This was causing - ACE not to compile when ACE_HAS_MALLOC_STATS was defined. - Thanks to John Smyder for reporting the - problem. - - * ace/Malloc_T.cpp (open): Removed invocation of contructor to - for the same reason. - -Fri Apr 07 23:32:16 2000 Nanbor Wang - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: Added QoS_Manager.* into project files. - -Thu Apr 6 07:29:48 2000 Douglas C. Schmidt - - * ace/Token.h (ACE_Token): Clarified the recursive semantics of - ACE_Token. Thanks to Antti Valtokari - for reporting this. - -Wed Apr 5 22:59:58 2000 Douglas C. Schmidt - - * ace/config-sunos5.5.h: Moved the ACE_HAS_USING_KEYWORD into - the part of this header file that's enabled when - __SUNPRO_CC_COMPAT >= 5 is defined. Thanks to Susan Liebeskind - for reporting this. - -Tue Apr 4 23:50:02 2000 Douglas C. Schmidt - - * ace/ACE.cpp (sock_error): Changed "int error" to "ssize_t error" - to be consistent... - -Tue Apr 4 20:19:36 2000 - - * ace/Acceptor.cpp: Modified the implementation of - ACE_Acceptor::open() and ACE_Acceptor::accept_svc_handler() so - that the peer acceptor's handle is set into non-blocking mode. - This is a safe-guard against the race condition that can - otherwise occur between the time when indicates that a - passive-mode socket handle is "ready" and when we call . - During this interval, the client can shutdown the connection, in - which case, the call can hang! - -Mon Apr 3 11:09:26 2000 Vishal Kachroo - - * ace/QoS_Manager.cpp: Added the #if defined - (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION). - -Mon Apr 3 08:00:00 2000 Kirthika Parameswaran - - * bin/auto_compile: Added flag. - -Mon Apr 3 04:07:47 2000 Douglas C. Schmidt - - * ace/config-freebsd-pthread.h: Added a #define for - ACE_HAS_ALT_CUSERID so that ACE will build on recent FreeBSD - releases. Thanks to Raymond Wiker for - reporting this. - -Sun Apr 2 21:32:20 2000 Vishal Kachroo - - * ace/SOCK.cpp: removed the extra #ifdef - ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA - * ace/QoS_Manager.{h,cpp}: removed the obsolete #pragma once. - * ace/QoS_Session_Impl.i: fully qualified the ACE_End_Point_Type. - * ace/Makefile: Added the QoS_Manager. - -Sun Apr 2 20:19:36 2000 Vishal Kachroo - - * ace/QoS_Manager.{h,cpp}: Added these two files. They define - a QoS Manager that manages the QoS for a socket. This was being - done earlier by the ACE_SOCK classes. - - Changed the following files to accomodate the new classes added - above. - * ace/SOCK.{h,cpp}: Removed the heavy container from ACE_SOCK. - * ace/SOCK_Dgram_Mcast.{h,cpp}: Changed the QoS management from - ACE_SOCK to ACE_QoS_Manager. - - * ace/QoS_Session_Impl.{h,cpp}: - * ace/QoS_Session.h: Changed the interface to use the - ACE_QoS_Manager class - -Sun Apr 2 05:36:04 2000 Douglas C. Schmidt - - * ace/Containers_T.cpp: There were a number of incorrect uses - of ACE_NEW_MALLOC that I replaced with ACE_ALLOCATOR. Thanks to - Francisco Bravo and Chris - Uzdavinis for clarifying the error of my - ways! - -Thu Mar 30 19:25:14 2000 Irfan Pyarali - - * ace/WFMO_Reactor.cpp (suspend_handler_i and resume_handler_i): - - If a handle is resumed, then: - - - check current handles to undo suspension (*) - - check suspended handles to resume - - check to_be_added handles to undo suspension - - If a handle is suspended, then: - - - check current handles to suspend - - check suspended handles to undo resumption (*) - - check to_be_added handles to suspend - - (*) were missing. Thanks to Ji Wuliu - for pointing this out! - -Thu Mar 30 15:54:23 2000 Steve Huston - - * ace/config-aix-4.x.h: Only set ACE_HAS_SIGTIMEDWAIT for AIX - 4.3.x. 4.2.x doesn't have it. Thanks to Johnny Chen - for reporting this. - - * THANKS: Added Johnny Chen to the Hall of Fame. - -Wed Mar 29 00:01:39 2000 Douglas C. Schmidt - - * netsvcs/lib/Client_Logging_Handler.cpp (handle_input): - ACE_OS::closesocket() was being used to do some very "low-level" - closing of handles without assigning a handle to - ACE_INVALID_HANDLE. This was causing problems. Therefore, we - now try to use this->peer ().close () if it's different from - handle. Thanks to Alexander Dergatch for - reporting this. This fixes [BUGID 520]. - -Tue Mar 28 12:13:12 2000 Nanbor Wang - - * ace/Containers_T.h: Fixed the mismatching filename in preamble. - -Tue Mar 28 12:06:31 2000 Nanbor Wang - - * ace/Array.h: Simply include "ace/Containers_T.h" would work. - Removed all other template kludge since they should be handled - in Containers_T.h. Thanks to Airat A. Sadreev - for report this problem. - -Tue Mar 28 11:56:56 2000 Nanbor Wang - - * ace/Dirent.h" - * ace/Dirent.cpp: The meaning of __ACE_INLINE__ is just the - opposite of ACE_LACKS_INLINE_FUNCTIONS (my fault.) Rearrange - the logic for checking __ACE_INLINE__ and include "ace/Dirent.h" - in Dirent.cpp. - -Tue Mar 28 06:00:00 2000 Michael Kircher - - * Dirent.cpp, - * Dirent.h: Renamed ACE_LACKS_INLINE_FUNCTIONS into __ACE_INLINE__ which - is the correct way of handling inlining differences. - - * ace/OS.h, - ace/OS.i: Win32 does not support a set of functions to - retrieve the content of a directory. However, the Win32 functions - FindFirstFile and FindNextFile provide similar behavior. This change - added an emulation of dirent based on these functions. Changes were - made to ACE_OS::opendir, ACE_OS::readdir, and ACE_OS::closedir. - - * ace/config-win32-common.h: Added the defines ACE_HAS_DIRENT, - ACE_LACKS_TELLDIR, ACE_LACKS_SEEKDIR, ACE_LACKS_REWINDDIR and - ACE_LACKS_READDIR_R. - This was necessary to enable the above mentioned emulation. - -Mon Mar 27 16:58:03 2000 Yamuna Krishnamurthy - - * ace/TkReactor.cpp: - Fixed the unused variable warning and ACE_Select_Reactor_Token - undeclared error. - -Fri Mar 24 10:30:44 2000 Douglas C. Schmidt - - * ace/LSOCK.cpp (recv_handle): For some reason, Linux allocates an extra - handle when doing a recvmsg() with the MSG_PEEK flag set. - Therefore, we need to close this. Thanks to Rick Ohnemus - for reporting this. Fixed [BUGID - 511]. - - * examples/IPC_SAP/FILE_SAP/client.cpp. Fixed the formatting - to conform to ACE guidelines. Thanks to Steve Luoma - for motivating this. - -Thu Mar 23 20:37:19 2000 David L. Levine - - * bin/check_build_logs: removed leading "./" from log file names. - -Thu Mar 23 17:38:34 2000 Nanbor Wang - - * ace/MEM_SAP.cpp: Removed a redundant "defined". Thanks to David - Wicks for noticing this. - -Thu Mar 23 15:26:52 2000 Carlos O'Ryan - - * PROBLEM-REPORT-FORM: - Modified the text to encourage users to report real bugs to - Bugzilla, that way we don't have to enter them ourselves. Only - dubious stuff should be reported to the mailing list. - -Thu Mar 23 14:34:26 2000 Nanbor Wang - - * ace/*.h: Moved the inclusion of down after the - definition of header guard macro. The original order violated - the ACE programming guideline. Thanks to Carlos for catching - this. - -Wed Mar 23 15:10:01 2000 Chad Elliott - - * tests/run_tests.sh - Fixed my fix for Chorus. It, again, supports FOR_TAO subset. - -Thu Mar 23 15:09:22 2000 Jody Hagins - - * ace/Object_Manager.cpp (ACE_Static_Object_Lock::instance): - with ACE_SHOULD_MALLOC_STATIC_OBJECT_LOCK #defined, - use ACE_RETURN_NEW instead of ACE_RETURN so that a value - is returned by the function. - -Thu Mar 23 10:39:23 2000 Carlos O'Ryan - - * bin/g++dep: - Changed the script to generate relative paths for local - dependencies. In other words if .obj/foo.o in the foo/bar - directory depends on $(ACE_ROOT)/foo/bar/foo.h we just generate - .obj/foo.o: foo.h - instead of the full path. This solves some problems with - parallel builds and IDL generated files. - -Thu Mar 23 04:31:50 2000 Irfan Pyarali - - * ace/Reactor.i (register_handler): There was a very subtle bug in - all versions of . The problem was that once - the has been successfully registered with the - Reactor, it is available for processing events. In the problem - case, input arrived from the client, the handler handled it, and - eventually closed down. All this happened in the other thread - running the Reactor, and all before this line got executed: - - event_handler->reactor (this); - - By the time this thread came around to set the , the - had packed up and gone home. The fix is to set - the before registering the with the - . Thanks to Steve Huston for report this bug. - -Wed Mar 22 12:01:22 2000 Steve Huston - - * ace/NT_Service.{h i cpp}: Added support for operating on services - on a host other than the local host. Thanks to Stephen Moon - for adding this new functionality! - -Wed Mar 22 10:19:47 2000 Douglas C. Schmidt - - * ace/Thread.i: In ACE_Thread::setcancelstate() the code is - checking to see if thr_setcancelstate and thr_setcanceltype - return 0 and if so returning an error condition to the user. - Instead, both of these routines should be checked to see if they - return -1 on failure. Thanks to Umar Syyid for reporting this. - -Wed Mar 22 09:29:09 2000 Chad Elliott - - * ace/config-chorus.h, ace/ACE.cpp - Correction for Chorus 4.0 support on the Ultra-SPARC. - -Wed Mar 22 09:24:12 2000 Balachandran Natarajan - - * ace/Configuration.cpp: Fixed a link error with SunCC5. This - error only shows up when ACE is built with debug=0 and - exceptions=1. The fix was to move all the template - instantiations from the end of the file to the top of the - file. Thanks to Dr.Levine for helping me fix this and thanks to - Manuel Benche for reporting this - problem. - -Wed Mar 22 09:16:48 2000 Jeff Parsons - - * ace/CDR_Stream.i: - Initialized a local variable inside the << operator - for wstring. It was producing a warning on Linux g++ - (charanga). - -Tue Mar 21 14:24:07 2000 Chad Elliott - - * ace/config-chorus.h, - include/makeinclude/platform_chorus.GNU, - include/makeinclude/platform_chorus4.x_g++.GNU, - tests/run_tests.sh: - Expected ACE tests work. Added support for Chorus 4.0 - on the Ultra-SPARC. - -Tue Mar 21 10:37:17 2000 Carlos O'Ryan - - * Merged the non_interpretive branch. - This fixes [BUGID:135] - - Fri Mar 10 11:27:04 2000 Carlos O'Ryan - - * ace/CDR_Stream.i: - Fixed the << operators for ACE_OutputCDR::from_string and - ACE_OutputCDR::from_wstring. They did not work with null - strings. - -Mon Mar 20 17:54:15 2000 Darrell Brunsch - - * ace/ACE.cpp: - - The ascii version of get_temp_dir () was calling the wchar_t - version, which doesn't work on Win95/98 since the GetTempPathW - isn't supported. So I just called GetTempPathA directly. - - Thanks to David Hauck for first pointing - this out, Shalabh Bhatnagar for informing - me that it doesn't work on Win95, and Torsten Pfuetzenreuter - for pointing out this doesn't work on - Win98 either. - - [BUG 499] - -Mon Mar 20 12:45:17 2000 Carlos O'Ryan - - * include/makeinclude/platform_linux_lxpthread.GNU: - Updated support for X11 and GL - - * ace/CDR_Stream.i: - A small performance improvement for ACE_InputCDR. If the - current message block in not writable we call grow_and_adjust - immediately. - -Sun Mar 19 22:11:47 2000 Ossama Othman - - * ace/ACE.cpp (recv_n_i, send_n_i, recvv_n_i, sendv_n_i): - - Loop should continue if EWOULDBLOCK is set. Previously, calls - to these methods returned right away on error, even if errno was - set to EWOULDBLOCK, instead of continuing until all of the data - was received or sent. - - If the number of bytes received/transfered during the current - iteration of the loop is zero, then break out of the loop so - that the actual number of bytes received/transfered is used as - the return value. Prior to this change, a value of zero was - returned, which may not always be the number of bytes - received/transfered. - -Sun Mar 19 23:52:33 2000 Douglas C. Schmidt - - * ace/ACE.cpp: Reformatted some code. - -Sun Mar 19 14:30:56 2000 James CE Johnson - - * docs/tutorials/002/handler.h: - * docs/tutorials/008/broadcast_client.cpp: - * docs/tutorials/015/Compressor.cpp: - * docs/tutorials/006/server.cpp: - * docs/tutorials/005/server.cpp: - * docs/tutorials/007/server.cpp: - * docs/tutorials/009/server.cpp: - * docs/tutorials/015/Protocol_Task.h: - * docs/tutorials/015/Protocol_Task.cpp: - * docs/tutorials/015/Crypt.cpp: - * docs/tutorials/015/Handler.cpp: - A whole batch of ACE_UNUSED_ARGs were applied keep the compiler - quiet. - - * docs/tutorials/018/Test_T.cpp (send): - Explicit creating of MB_HANGUP instance to avoid casting - confustion on the ACE_Message_Block constructor. - - * docs/tutorials/005/client_handler.cpp: - * docs/tutorials/006/client_handler.cpp: - * docs/tutorials/007/client_handler.cpp: - Added a null-terminator to the strings received from the client - so that they look reasonable when printed. Thanks to Steven - Boelens for catching this. - - * docs/tutorials/*/hdr: - * docs/tutorials/*/*.pre: - * docs/tutorials/*/*.pst: - * docs/tutorials/*/*.cpp: - Eliminating trailing whitespace and \r to make CVS happy. The - relevant combine.shar files were also rebuilt. - - * docs/tutorials/combine: Mutated to include CVS Id tag in every - page. - - * docs/tutorials/*/*.html: Everything rebuilt due to changes - above. - -Sat Mar 18 20:51:06 2000 David L. Levine - - * bin/check_build_logs: added -u option, to provide a - URL prefix. If enabled, it will print the URL of - each log file, prepending the URL prefix. - -Sat Mar 18 18:37:19 2000 Nanbor Wang - - * ace/OS.h: Added inclusion of pre.h and post.h. It got left out - by the script. Thanks to Christopher Kohlhoff - for noticing this. - -Sat Mar 18 05:42:06 2000 Nanbor Wang - - * ace/pre.h: - * ace/post.h: Added two new file. preserves the current - alignment setting of the compiler and restores the - alignment setting. They are used to make ACE a better team - player with other library on NT platforms. - - * include/makeinclude/compiler.bor: - * include/makeinclude/make_flags.bor: Applied the changes for the - updated Borland makefiles. - - When using ACE+TAO on Win32 (using either MSVC or BCB) you - currently must ensure that your application's compiler options - are set to be the same as those used to build ACE+TAO. For - example, since ACE+TAO is built using 8-byte alignment, your - application must also use this alignment otherwise bad things - can happen. - - Other libraries on Win32 free the developer from this burden by - explicitly setting these options in the source code. For - example, the Windows SDK header files contain things like - - #include - ... - #include - - where these header files contain the appropriate #pragmas for - setting alignment options. (BTW, structure alignment is not the - only option that may be set, I'm just using it as an - example. Warnings could be disabled, and - my ulterior motive - - I have a few problematic BCB compiler options that I would like - to control.) - - This sort of thing helps a library to play nicely with any other - libraries or source code someone may be using. It somewhat - simplifies the instructions for setting up project that uses - ACE+TAO, and it lets developers change their compiler options - with abandon without breaking ACE+TAO. - - Thanks to Christopher Kohlhoff for - providing the patches. - -Fri Mar 17 23:28:20 2000 Douglas C. Schmidt - - * examples/OS/Process/process.cpp (tokenize): Fixed a typo in the - code. Thanks to Byron Harris for noticing - this. - -Fri Mar 17 20:43:20 2000 Sangwoo Jin - - * ace/Makefile,Reactor.cpp,Object_Manager.{h,cpp}: - Added ACE_LACKS_ACE_SVCCONF support. - -Fri Mar 17 09:39:52 2000 Steve Huston - - * Makefile.am: Added ChangeLog-99b to the EXTRA_DIST list. - -Fri Mar 17 00:18:40 2000 Douglas C. Schmidt - - * examples/QOS/Sender_QOS_Event_Handler.cpp (handle_qos): - Make sure to cast the const char* to void* to avoid compiler - warnings. Thanks to Craig Rodrigues for - reporting this. - -Thu Mar 16 11:51:49 2000 Darrell Brunsch - - * ace/MEM_SAP.i: - * ace/Malloc_T.cpp: - - The ACE_TRACE macros were incompatible with SEH. Conditionally - compiled the ACE_TRACE statements in places where this was a - problem. Thanks to Edan Ayal for reporting - this. - -Thu Mar 16 13:40:53 2000 David L. Levine - - * ace/config-sunos5.5.h: just #define ACE_USES_OLD_IOSTREAMS, - don't #define it explicitly to 1. This removes a source - of confusion: changing the 1 to 0 didn't disable the feature. - Thanks to Charles Scott for - reporting this. - -Thu Mar 16 13:01:02 2000 Douglas C. Schmidt - - * ACE-INSTALL.html: Clarified some of the installation instructions for - building ACE. Thanks to Jeff Graham for - contributing these. - - * ace/Event_Handler.h: Clarified the comments for handle_timeout(). - Thanks to Jonathan Reis for this - suggestion. - -Thu Mar 16 12:47:01 2000 David L. Levine - - * ace/OS.cpp (thr_create): check for stacksize < - ACE_HAS_HUGE_THREAD_STACKSIZE on all platforms, - not just those with PTHREADS. Thanks to - Richard L. Johnson - for reporting this. - -Wed Mar 15 23:21:04 2000 Nanbor Wang - - * ace/Configuration.cpp: Changed from using ACE_TString::rep() to - ACE_TString::fast_rep() to avoid memory leaks. Thanks to for - reporting this and suggesting the fix. - - Also removed a call to add_ref() from the constructor of - ACE_Section_Key_Win32. It was causing another memory leak. - -Wed Mar 15 21:18:19 2000 David L. Levine - - * include/makeinclude/platform_lynxos.GNU: set - ACE_HAS_GNUG_PRE_2_8 to 1 for LynxOS 2.5.0, because - its g++ doesn't support -fno-exceptions. - -Wed Mar 15 20:51:21 2000 Chad Elliott - - * ace/OS.h,ace/ACE.cpp,ace/config-chorus.h, - include/makeinclude/platform_chorus4.x_g++.GNU: - added Chorus 4.0 support. - -Wed Mar 15 20:47:12 2000 David L. Levine - - * ace/ACE.h: moved #include of OS.h inside the #ifndef ACE_ACE_H - protection. OS.h no longer depends on ACE.h, so there's no - circular include problem. Thanks to Espen Harlinn - for reporting this. - -Wed Mar 15 20:43:14 2000 David L. Levine - - * ace/OS.cpp (thr_keycreate): rearranged ::pthread_keycreate () - calls so that ACE_HAS_STDARG_THR_DEST is only used with - ACE_HAS_PTHREADS_DRAFT4. - -Wed Mar 15 17:30:57 2000 Balachandran - - * ACE version 5.1 released. - -Wed Mar 15 15:17:19 2000 Charles Scott - - * include/makeinclude/platform_vxworks5.x_ghs.GNU: added - --stdle --exceptions to CCFLAGS if exceptions are enabled. - -Tue Mar 14 15:01:46 2000 Steve Huston - - * tests/Malloc_Test.cpp: Disable mapping the file into different - address ranges for HP-UX because the PA-RISC architecture does not - allow it. See the DEPENDENCIES section of the mmap man page for - all the details. - -Mon Mar 13 22:18:20 2000 David L. Levine - - * bin/create_ace_build: default $directory_mode to 0777, - because it gets modified by the umask anyways. Thanks - to Dave Meyer for suggesting this. - -Mon Mar 13 10:16:53 2000 Bala - - * ACE version 5.0.16 released. - -Sun Mar 12 21:10:13 2000 David L. Levine - - * many Makefiles: updated dependencies. - -Fri Mar 10 00:17:37 2000 Douglas C. Schmidt - - * netsvcs/ACE-netsvcs.html: Updated this document. Thanks to - Charles Meier for contributing this. - - * ace/WIN32_Proactor.cpp (ACE_WIN32_Proactor): Replaced - this->completion_port_ with 0 in the call to - CreateIoCompletionPort() to make it more clear what's going on. - - * ace/SPIPE_Acceptor.cpp: Very minor reformatting of the code to - conform to ACE guidelines. - -Thu Mar 09 23:12:39 2000 Nanbor Wang - - * ace/OS.i (flock_init): On Win32, the hEvent in strut overlapped - should initialized to NULL. This was causing Naming_Test to - fail on Windows 2000. Thanks to for - pointing this out. [Bug 485] - -Thu Mar 9 19:49:00 2000 Douglas C. Schmidt - - * ace/Reactor.h: Clarified that ACE_Reactor::end_event_loop() should - only be used for the "singleton reactor" and not for user defined - reactors. Thanks to Adrian Miranda for motivating - this. - -Thu Mar 09 18:20:00 2000 Angelo Corsaro - - * ace/Asynch_IO.h: - * ace/Asynch_IO_Impl.h: - * ace/POSIX_Asynch_IO.h: - * ace/POSIX_Proactor.h: - * ace/Proactor.h: - * ace/Proactor_Impl.h: - * ace/WIN32_Asynch_IO.h: - * ace/WIN32_Proactor.h: - * ace/config-aix-4.1.x.h: - * ace/config-aix-4.2.x.h: - * ace/config-aix-4.3.x.h: - - These files were using the #if !defined (WHATEVER) as multiple - inclusion guard instead of #ifndef WHATEVER. Thanks to Paul - Calabrese for reporting that. - - * ace/config-visualage.h: - * ace/CLASSIX/CLASSIX_Port_Default.h: - * ace/Svc_Conf_Tokens.h: - - While this file were missing multiple inclusion guard. Thanks to - Paul Calabrese for reporting that. - -Thu Mar 09 18:06:52 2000 Steve Huston - - * ace/config-hpux-11.00.h: Added ACE_HAS_SIGTIMEDWAIT and the - ACE_PI_CONTROL_BLOCK_ALIGN_LONGS that Nanbor did for - config-hpux-10.x.h Wed Mar 8. There is still an assert failure - in Malloc_Test, so something is wrong there. - -Thu Mar 09 17:47:41 2000 Steve Huston - - * ace/config-aix-4.x.h: Added ACE_HAS_SIGTIMEDWAIT. - -Thu Mar 09 17:35:31 2000 Steve Huston - - * ace/Log_Msg.cpp (log): Related to Tue Mar 7 and Wed Mar 8; change the - static cast to a C-style cast and put in comments explaining that - depending on the underlying type of thread ID, sometimes a static - cast is needed, and sometimes a reinterpret cast, so we dropped - back and punted to a C-style cast. Thanks to Loren Rittle and - Bala for working this stuff out. - -Thu Mar 09 17:01:23 2000 Steve Huston - - * ace/Naming_Context.cpp (ACE_Name_Options ctor): When allocating - space for the temp dir path, take the size of a char into account - to get enough for Unicode characters. Fixes Bugzilla #480. - -Thu Mar 09 15:30:41 2000 David L. Levine - - * ace/ACE.h (init, fini): added comments that these methods - can only be called once per program invocation. Thanks to - Chris Hafey for reporting that an - init ()/fini ()/init () sequence fails. - -Thu Mar 09 12:57:14 2000 Nanbor Wang - - * tests/Time_Service_Test.cpp (main): Fixed several UNICODE - related problems. Thanks to Steve H. for reporting this. - -Thu Mar 9 09:23:10 2000 Ossama Othman - - * bin/make_release (create_kit): - - Change to the destination directory prior to invoking `md5sum' - on the file for which an MD5 checksum is being generated. This - was necessary to prevent the absolute path of the file from - being used as part of the checksum. - - In any case, MD5 checksum generation is now working. [Bug 48] - - (tag): - - Confirmed that the missing Makefile templates now get installed - in the ACE betas/releases (no changes, just confirmation). - [Bug 408] - -Thu Mar 9 11:01:34 2000 Douglas C. Schmidt - - * ace/Configuration.h: Changed export_config()/import_config() to - be virtual methods so users can change how the config files are - implemented. Thanks to Damien Dufour - for reporting this. - -Thu Mar 09 10:41:24 2000 Steve Huston - - * ace/NT_Service.(h cpp): Added !defined(ACE_HAS_PHARLAP) to the - if defined (ACE_HAS_WIN32) to prevent this feature from being - built on PharLap. Thanks to David Hauck - for reporting this and suggesting a fix. - -Wed Mar 08 22:19:26 2000 David L. Levine - - * include/makeinclude/platform_vxworks5.x_g++.GNU: - moved VxWorks 5.4 (Tornado II) auto detection to - before CCFLAGS definition, so that it gets set - properly. Thanks to Thomas Lockhart - for reporting this. [Bug 481] - -Wed Mar 8 19:16:56 2000 Douglas C. Schmidt - - * tests/Time_Service_Test.cpp (main): Added the ASYS_TEXT macro - to the "ace-malloc-XXXXXX" string to avoid an error when - compiled with Unicode. Thanks to Steve Huston - for reporting this. This fixes BUGID - 479. - -Wed Mar 8 19:19:46 2000 Nanbor Wang - - * ace/config-irix6.x-common.h: Defined ACE_PI_CONTROL_BLOCK_ALIGN_LONGS - to 2. - -Wed Mar 8 15:59:26 2000 Nanbor Wang - - * ace/config-hpux-10.x.h: Defined ACE_PI_CONTROL_BLOCK_ALIGN_LONGS - to 2. The alignment computing macros didn't work in this case. - Thanks to Steve H. for reporting this. - -Wed Mar 08 15:26:31 2000 Steve Huston - - * ace/ace-dll.icc: On AIX, the shared lib is now libACE.o and the - associated archive is libACE.a. Attempting to unify ACE with the - screwy way AIX does libraries. When the static library gets built, - it'll be called libACEns.a. - - * tests/vacpp_setup.icc: On AIX, link libACE.a, not libACEshr.a - - * tests/libDLL_Test.icc: New file to build the library required for - DLL_Test. Can't be built from DLL_Test.icc because the codestore - will complain that main() is already defined. - -Wed Mar 08 14:46:52 2000 Steve Huston - - * ace/config-aix-4.x.h: - * include/makeinclude/platform_aix4_cset++.GNU: Allow building w/o - threads by including threads=0 on build command line. Include - -O2 compile option when optimize=1 is set on build command line. - -Wed Mar 8 11:13:04 2000 Balachandran Natarajan - - * ace/Log_Msg.cpp (log): Reverted this change. - Tue Mar 7 14:21:12 CST 2000 Loren Rittle - . The change gave compile errors on - EGCS. - -Wed Mar 8 01:33:21 2000 Christopher Kohlhoff - - * tests/Makefile.bor: Added new test Process_Manager_Test. - - * include/makeinclude/compiler.bor, make_flags.bor: Added support - for BCB's codeguard memory checking tool. - - * include/makeinclude/outputdir.bor: Allow a different directory - creation tool to be substituted for "mkdir" on Win9x. - -Tue Mar 07 18:37:26 2000 Tom Ziomek - - * ace/Singleton.h: added comment to ACE_Unmanaged_Singleton - description to clarify that friend declaration must be - be for ACE_Unmanaged_Singleton. - -Tue Mar 7 14:21:12 CST 2000 Loren Rittle - - * ace/Log_Msg.cpp (log): Correct cast usage, a reinterpret - cast was needed. - -Tue Mar 07 11:00:10 2000 Douglas C. Schmidt - - * examples/Reactor/Proactor/test_proactor.cpp: Updated the comments - to make it clear how the ACE_Message_Block buffers are reused. - Thanks to Dong-Yueh Liu for suggesting - this. - -Tue Mar 07 10:28:16 2000 bala - - * ACE version 5.0.15 released. - -Mon Mar 6 17:56:56 2000 Ossama Othman - - * bin/make_release (release_tag_files): - - Added missing declaration of this variable. - -Mon Mar 6 13:30:00 2000 Kirthika Parameswaran - - * tests/run_tests.vxworks: Removed Cached_Conn_Test from the - list as this test fails for the current configuration. Until - researched completely, it has been disabled on vxworks. - Thanks to David Hall for reporting - this bug. - -Sun Mar 5 21:32:45 2000 Carlos O'Ryan - - * ace/CDR_Stream.cpp: - When allocating a new buffer in ACE_CDR::grow() we must leave - enough room for the buffer required by the user *and* space to - adjust the alignment. Thanks to Bala and Jeff for tracking this - down. - -Fri Mar 03 17:01:54 2000 Steve Huston - - * tests/Malloc_Test.cpp: Changed a couple of straggling - ACE_HAS_POSITION_INDEPENDENT_MALLOC to - ACE_HAS_POSITION_INDEPENDENT_POINTERS. - -Fri Mar 03 11:52:10 2000 David L. Levine - - * include/makeinclude/rules.nested.GNU: added -f $(MAKEFILE) - to $(MAKE) invocation, to support overriding of the default - Makefile name. Added definition of MAKEFILE, if it is null. - Thanks to Wei Chiang for suggesting this. - - * include/makeinclude/rules.local.GNU: changed test to see if - MAKEFILE macro isn't set from ifndef to ifeq null, for consistency - with above addition to rules.nested.GNU. - -Thu Mar 2 13:23:39 2000 Douglas C. Schmidt - - * ace/TLI.cpp, TLI_Connector.cpp, TLI_Stream.cpp: Removed comments - regarding the quality of SunOS 4... Thanks to Malcolm Spence - for reporting this! - -Wed Mar 1 22:39:04 2000 Darrell Brunsch - - * ace/Log_Record.cpp: - - Thanks to Valery Arkhangorodsky , - who took the time to figure out the code in round_up () and - spotted a mistake in it. - - * examples/Shared_Malloc/test_persistence.cpp: - - The last bug in my changes. Changing a pointer to an array - is not something to be done on a whim. Needed to change a - couple of "== 0" to strcpy's, etc. - -Wed Mar 01 19:25:39 2000 Nanbor Wang - - * ace/Based_Pointer_T.cpp: - * ace/Malloc.cpp: Replaced ACE_ASSERT (!"A STRING") with - ACE_ASSERT (0). Some brain-damaged compilers (i.e., Diab DCC - 4.2b) can't handle this. Thanks to Bob Bouterse - for reporting and fixing this. - -Wed Mar 1 16:29:55 2000 Ossama Othman - - * configure.in (ACE_HAS_ALT_CUSERID): - - Wrapped the test for this macro with - ACE_CONVERT_WARNINGS_TO_ERRORS to cause implicit prototype - declaration warnings to be converted to errors when using - gcc < 2.95.2 (including egcs <= 1.1.x). This fixes a warning on - Red Hat 6.1 systems. Thanks to Rich Seibel - for providing a fix. - -Tue Feb 29 23:36:29 2000 Nanbor Wang - - * ace/README: - * ace/Thread_Manager.h: - * ace/Thread_Manager.i: - * ace/Thread_Manager.cpp (append_thr): Moved thread descriptor - reset statement into reset. - - (reset): Added reset methods to - ACE_Thread_Descriptor and ACE_Thread_Descriptor_Base to reset - Thread_Descriptor back to its initialized state. - - (ACE_Thread_Descriptor): Removed reset statements for - cleanup_info_. They are handle by ACE_Cleanup_Info's contructor - already. - - (acquire_release): Added a macro - ACE_THREAD_MANAGER_USES_SAFE_SPAWN to disable double-checked - locking. When this macro is defined, a spawned thread will - always acquire the release the lock before starting any - other initialization. This should avoid a potential race - condition on some platforms (i.e., DEC Alpha, Marced) using - aggressive read/write reordering strategies. - - (spawn_i): Call method on the "new" thread descriptor - after acquiring a thread descriptor from the freelist. This - change moved most of the thread descriptor initialization code - from append_thr into , before spawning the thread. - - Thanks to John Hickin for motivating - these changes. - -Tue Feb 29 21:18:12 2000 Darrell Brunsch - - * ace/ACE.cpp: - - One more warning cleaned up from my get_temp_dir () change. - Hopefully the last (crossing my fingers). - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: - - Missing some header files, thanks to Andres Kruse - for noticing. - - * ace/OS.h: - - Even when ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS was not defined, - ACE_SEH_TRY and family was still being defined to the seh - commands (like __try) on Win32. When the above macro is not - defined, they are now noops. Thanks to Natarajan Kalpathy - for reporting this. - -Tue Feb 29 16:40:43 2000 Carlos O'Ryan - - * ace/CDR_Stream.h: - * ace/CDR_Stream.i: - * ace/CDR_Stream.cpp: - Fixed alignment problems when inserting message blocks without - copying. The same fix was a good excuse to optimize the - OutputCDR class, as described in bug #160. - - * ace/OS.h: - Use the ACE_ prefix in a couple of naked macros. - - * ace/ACE.cpp: - Fixed the crc32 routine, it seems we inherited a bug from the - FreeBSD code. Thanks to Jonathan Reis - for finding the bug and providing a patch for it. - -Tue Feb 29 16:23:41 2000 Steve Huston - - * ace/Handle_Set.h: Added some explanation to a few ACE_Handle_Set - member functions to clarify their purpose and use. - -Tue Feb 29 13:48:24 2000 Douglas C. Schmidt - - * ace/OS.h: Updated a comment about using ACE_Malloc for class-specific - allocations. Thanks to Boris Sukholitko - for reporting this. - -Tue Feb 29 08:48:28 2000 Darrell Brunsch - - * tests/Time_Service_Test.cpp: Enabled the test on Win32 and removed - a use of ACE_DEFAULT_BACKING_STORE. - -Tue Feb 29 08:56:51 2000 David L. Levine - - * include/makeinclude/platform_vxworks5.x_g++.GNU: - reverted this change: - - Mon Feb 28 20:42:17 2000 David L. Levine - - because it caused static constructors not to be called. - Thanks to Elias Sreih for - reporting this. - -Mon Feb 28 20:04:23 2000 Darrell Brunsch - - * tests/Time_Service_Test.cpp: Missed a semicolon. - -Mon Feb 28 20:42:17 2000 David L. Levine - - * include/makeinclude/platform_vxworks5.x_g++.GNU: - with Tornado 2 (VxWorks 5.4) and later, use - ld$(TOOLENV) instead of ace_ld. Apparently, munch - is no longer required. Thanks to Elias Sreih - for reporting that - ace_ld/munch caused undefined symbols for calls to - global ctors with Tornado 2. - -Mon Feb 28 17:34:00 2000 Darrell Brunsch - - * ace/ACE.h: - * ace/ACE.cpp: - - The Unix and Win32 behavior for get_temp_dir () wasn't consistent. - Now both will return -1 if there is any problem such as the buffer - not being long enough. - -Mon Feb 28 09:20:27 2000 Darrell Brunsch - - * ace/ACE.h: - * ace/ACE.cpp: - - Added get_temp_dir () method that fills a buffer with the path - for the temporary directory. ACE has previously hardcoded the - path. The right way is to find the path at runtime, especially on - Win32 where the TEMP directory can be different from machine to - machine (or even different for each user). - - * ace/OS.h: - * ace/FILE_Addr.cpp: - * ace/MEM_Acceptor.cpp: - * ace/Memory_Pool.cpp: - * ace/Naming_Context.cpp: - * ace/Naming_Context.h: - * ace/System_Time.cpp: - * ace/System_Time.h: - * examples/Shared_Malloc/test_persistence.cpp: - * netsvcs/lib/Logging_Strategy.cpp: - * netsvcs/lib/Logging_Strategy.h: - * netsvcs/lib/TS_Clerk_Handler.cpp: - * tests/Time_Service_Test.cpp: - - Removed the macro definitions that used C:\\temp: - ACE_DEFAULT_BACKING_STORE - ACE_DEFAULT_TEMP_FILE - ACE_DEFAULT_LOGFILE - ACE_DEFAULT_NAMESPACE - - The default path in these cases are now found by using the - ACE::get_temp_dir method. The macros are still supported in - that they can still be used to override the default case. - - * tests/test_config.h: - * tests/MM_Shared_Memory_Test.cpp: - * tests/Mem_Map_Test.cpp: - * tests/Process_Strategy_Test.cpp: - * tests/Process_Strategy_Test.h: - - Removed the macro definitions for: - ACE_DEFAULT_TEST_FILE - ACE_TEMP_FILE_NAME - ACE_LOG_DIRECTORY - - and replaced with ACE::get_temp_dir. - - Also changed the default log file directory on Win32 to be in - the log subdirectory. So now both Unix and NT have the same - behavior, the logs will be written to $ACE_ROOT/tests/log. - - * tests/ACE_Init_Test.res: (removed) - - This file was giving me warnings when I built, and since it - should be generated from the .rc file, I don't think it should - be in the repository. - - * tests/Process_Manager_Test.cpp: - * tests/Process_Manager_Test.dsp: (added) - * tests/version_tests/Process_Manager_Test.dsp: (added) - * tests/tests.dsw: - * tests/version_tests/version_tests.dsw: - - Enabled the Process_Manager_Test on NT and created a MSVC - workspace for it. Also fixed some miscellaneous UNICODE issues. - - * tests/run_tests.bat: - - Added the Process_Manager_Test and changed the location of the - log files. - - * tests/README: - - Changed the location of the output of the log files. - -Mon Feb 28 09:16:40 2000 Ossama Othman - - * ace/Local_Tokens.cpp (ACE_TPQ_Entry): - - Removed cast of ACE_thread_t to long unsigned int since some - platforms (e.g. HPUX) declare the underlying thread type as a - structure. This change reverts back to the version prior to - Steve's change. - -Mon Feb 28 08:33:43 2000 Zoran Ivanovic - - * docs/ACE-guidelines.html: fixed typo, in example - #include directive (Foo_T.i instead of Active_Map_Manager_T.i). - -Sun Feb 27 16:20:43 2000 Douglas C. Schmidt - - * ace/Synch_T.h: Made the ACE_TSS_Type_Adapter operator TYPE() a const - to avoid overloading ambiguities. Thanks to Bruce McIntosh - for reporting this. - - * ace/TP_Reactor.h: Improved the comments. - -Sat Feb 26 19:52:01 2000 Carlos O'Ryan - - * ace/CDR_Stream.cpp: - The grow() function was re-allocating the buffer even when there - was just enough memory, i.e. this was an off-by-one error, in - the form of a < instead of <= comparison. When it finally - decided to grow the buffer it was using the global heap instead - of the allocators in the message block, which may be more - efficient. - -Sat Feb 26 19:47:05 2000 Ossama Othman - - * ace/Local_Tokens.cpp (ACE_TPQ_Entry): - - Needed to go a step further. Taking the jackhammer approach by - switching to a C style cast until a better solution presents - itself. - -Sat Feb 26 13:40:57 2000 Ossama Othman - - * ace/Local_Tokens.cpp (ACE_TPQ_Entry): - - Compaq C++ doesn't like the static cast from ACE_thread_t to - long unsigned int. Take the sledgehammer approach and use a - reinterpret cast instead. - -Sat Feb 26 13:20:13 2000 Ossama Othman - - * ace/OS.h (INADDR_LOOPBACK): - - Define this macro to hexidecimal value of the loopback address - 127.0.0.1 (0x7f000001). LynxOS doesn't define this constant. - -Fri Feb 25 16:50:37 2000 Steve Huston - - * ace/Profile_Timer.cpp (ACE_Profile_Timer ctor): - * ace/Log_Msg.cpp (format_msg): - * ace/Local_Tokens.cpp (ACE_TPQ_Entry::ACE_TPQ_Entry): - Fixed to avoid a gcc 2.95 warning about mismatch format/arg types. - -Fri Feb 25 14:56:41 2000 Steve Huston - - * include/makeinclude/platform_aix_vacpp.GNU: New file for use - with Visual Age C++ on AIX. It isn't really needed for much at this - point except building the tests via Makefile. If you like doing - everything directly with vacbld without the aid of ACE's make - scheme, you don't need to use this. - -Fri Feb 25 14:48:31 2000 Steve Huston - - * include/makeinclude/rules.bin.GNU: Add a rule to build a binary - based on a Visual Age C++ configuration (.icc file) and sources. - This allows building using Makefile, but defers all the real work - to Visual Age C++ builder (vacbld). Useful for building the ACE - tests especially. - -Fri Feb 25 14:44:37 2000 Steve Huston - - * include/makeinclude/rules.local.GNU: Add *.ics to files deleted - in cleanup. This cleans up Visual Age C++ codestores. - -Fri Feb 25 13:06:14 2000 David L. Levine - - * include/makeinclude/platform_vxworks5.x_{ghs,g++}.GNU: - updated platform information to reflect that these - files are intended for VxWorks 5.3.1 and later. - -Fri Feb 25 13:03:35 2000 Fernando D. Mato Mira - - * include/makeinclude/platform_vxworks5.x_{diab,g++}.GNU: - added PPC603 support. - -Fri Feb 25 10:47:33 2000 Douglas C. Schmidt - - * ace/config-win32-msvc.h, - * ace/config-win32-borland.h: Added ACE_INT64_FORMAT_SPECIFIER - for both platforms. Thanks to Christopher - Kohlhoff for providing the fix. - -Thu Feb 24 15:55:16 2000 Steve Huston - - * ace/Timer_Heap_T.cpp: Added "&& defined (_WINDOWS)" to all the places - where memory alloc sizes had been faked out on conditionals selecting - Visual Age C++. The reported issues that originated the conditions - are not problems for AIX; with the conditional code in, tests - failed due to memory corruptions. - -Thu Feb 24 15:44:42 2000 Steve Huston - - * ace/ace-dll.icc: Added Capabilities.h and Capabilities.cpp. - -Thu Feb 24 12:35:31 2000 Steve Huston - - * tests/ARGV_Test.icc: - * tests/Auto_IncDec_Test.icc: - * tests/CDR_File_Test.icc: - * tests/Cache_Map_Manager_Test.icc: - * tests/Cached_Accept_Conn_Test.icc: - * tests/Cached_Conn_Test.icc: - * tests/Capabilities_Test.icc: - * tests/FlReactor_Test.icc: - * tests/Future_Set_Test.icc: - * tests/Hash_Map_Bucket_Iterator_Test.icc: - * tests/Lazy_Map_Manager_Test.icc: - * tests/Log_Msg_Test.icc: - * tests/Malloc_Test.icc: - * tests/New_Fail_Test.icc: - * tests/Object_Manager_Test.icc: - * tests/Process_Manager_Test.icc: - * tests/Reverse_Lock_Test.icc: - * tests/SOCK_Send_Recv_Test.icc: - * tests/Signal_Test.icc: - * tests/Svc_Handler_Test.icc: - * tests/TkReactor_Test.icc: - New test configuration files for use w/ Visual Age C++, NT and AIX. - - * tests/Aio_Platform_Test.icc: - * tests/Atomic_Op_Test.icc: - * tests/Barrier_Test.icc: - * tests/Basic_Types_Test.icc: - * tests/Buffer_Stream_Test.icc: - * tests/CDR_Test.icc: - * tests/Collection_Test.icc: - * tests/Conn_Test.icc: - * tests/DLL_Test.icc: - * tests/DLList_Test.icc: - * tests/Dynamic_Priority_Test.icc: - * tests/Enum_Interfaces_Test.icc: - * tests/Env_Value_Test.icc: - * tests/Future_Test.icc: - * tests/Handle_Set_Test.icc: - * tests/Hash_Map_Manager_Test.icc: - * tests/High_Res_Timer_Test.icc: - * tests/IOStream_Test.icc: - * tests/MM_Shared_Memory_Test.icc: - * tests/MT_Reactor_Timer_Test.icc: - * tests/MT_SOCK_Test.icc: - * tests/Map_Manager_Test.icc: - * tests/Map_Test.icc: - * tests/Mem_Map_Test.icc: - * tests/Message_Block_Test.icc: - * tests/Message_Queue_Notifications_Test.icc: - * tests/Message_Queue_Test.icc: - * tests/Naming_Test.icc: - * tests/Notify_Performance_Test.icc: - * tests/OrdMultiSet_Test.icc: - * tests/Pipe_Test.icc: - * tests/Priority_Buffer_Test.icc: - * tests/Priority_Reactor_Test.icc: - * tests/Priority_Task_Test.icc: - * tests/Process_Mutex_Test.icc: - * tests/Process_Strategy_Test.icc: - * tests/Purgable_Map_Manager_Test.icc: - * tests/RB_Tree_Test.icc: - * tests/Reactor_Exceptions_Test.icc: - * tests/Reactor_Notify_Test.icc: - * tests/Reactor_Performance_Test.icc: - * tests/Reactor_Timer_Test.icc: - * tests/Reactors_Test.icc: - * tests/Reader_Writer_Test.icc: - * tests/Recursive_Mutex_Test.icc: - * tests/SOCK_Connector_Test.icc: - * tests/SOCK_Test.icc: - * tests/SPIPE_Test.icc: - * tests/SString_Test.icc: - * tests/SV_Shared_Memory_Test.icc: - * tests/Semaphore_Test.icc: - * tests/Service_Config_Test.icc: - * tests/Sigset_Ops_Test.icc: - * tests/Simple_Message_Block_Test.icc: - * tests/TSS_Test.icc: - * tests/Task_Test.icc: - * tests/Thread_Manager_Test.icc: - * tests/Thread_Mutex_Test.icc: - * tests/Thread_Pool_Reactor_Test.icc: - * tests/Thread_Pool_Test.icc: - * tests/Time_Service_Test.icc: - * tests/Time_Value_Test.icc: - * tests/Timeprobe_Test.icc: - * tests/Timer_Queue_Test.icc: - * tests/Tokens_Test.icc: - * tests/UPIPE_SAP_Test.icc: - * tests/Upgradable_RW_Test.icc: - * tests/XtReactor_Test.icc: - Changed to work for both NT and AIX Visual Age C++, using new - vacpp_setup.icc file, added below. - -Thu Feb 24 12:15:46 2000 Steve Huston - - * tests/makeicc.pl: Corrected to write Id variable in new .icc - file properly. - -Thu Feb 24 01:52:51 2000 Nanbor Wang - - * ace/Thread_Manager.cpp (append_thr): Moved the setting of - THR_SPAWNED state down to right before releasing the thread - creation lock. Hopefully, this will eliminate a warning about a - non-existing race condition from KAI Assure. Thanks to John - Hickin for reporting this. - -Wed Feb 23 23:52:15 2000 Douglas C. Schmidt - - * ace/Log_Msg.h: Added a hack to work around nasty libraries - that #define THREAD 1. Thanks to Pierre Oberson - for reporting this. - -Wed Feb 23 19:37:29 2000 Carlos O'Ryan - - * tests/Dynamic_Priority_Test.cpp: - More stuff that is not used unless ACE_HAS_TIMED_MESSAGE_BLOCKS - is defined. - -Wed Feb 23 18:58:06 2000 Douglas C. Schmidt - - * ace/Synch.i (lock): Make sure that ACE_File_Lock::set_handle() - sets this->removed_ = 0. Thanks to Sanwoo Jin - for reporting this. - - * tests/FlReactor_Test.cpp (main): Minor reformatting. - - * ace/config-win32-borland.h: When you define _DEBUG the orbsvcs - dll exports all "inline" functions, and this seems to be too - much for BCB4 linker. Thaddeus L. Olczyk - reported this problem and Christopher - Kohlhoff provided the fix. - - * ace/OS, - ace/Synch: Added a new parameter to flock_destroy() and - ACE_File_Lock::remove() that controls whether the lockfile is - removed when the filelock is destroyed. By default, this is - "enabled" so the existing semantics don't change. Thanks to - Sanwoo Jin for suggesting this. - -Wed Feb 23 17:02:34 2000 Steve Huston - - * tests/vacpp_setup.icc: Settings for Visual Age C++ which are included - in the individual tests' VAC++ configurations. Captures all of the - platform (AIX vs. NT) differences in one place. - - * tests/makeicc.pl: Changed to generate .icc files that work on either - NT or AIX, using the above vacpp_setup.icc. - -Wed Feb 23 16:54:31 2000 Steve Huston - - * ace/Based_Pointer_Repository.cpp (ACE_Based_Pointer_Repository_Rep): - Moved typedefs for MAP_MANAGER, MAP_ITERATOR, MAP_ENTRY inside - the class definition so they don't conflict with other types of - the same name (Visual Age C++ sees all of them at once, even if - other compilers may never see those two definitions in the same - compilation unit ever). - -Wed Feb 23 14:48:52 2000 Steve Huston - - * ace/ace-dll.icc: Platform-specifics further segmented out to make - Visual Age C++ builds work for both NT and AIX. Removed Multiplexor.h - and Multiplexor.cpp since those files are not used. Added - Based_Pointer_Repository.(cpp h). - - * ace/OS.i (getpwnam_r): Add a condition for the Visual Age C++ on - AIX compiler - it can't correctly handle the ::getpwnam_r call. - -Wed Feb 23 14:45:21 2000 Carlos O'Ryan - - * ace/Message_Block.cpp: - * tests/Dynamic_Priority_Test.cpp: - Fixed warnings when compiling without - ACE_HAS_TIMED_MESSAGE_BLOCKS defined. - -Wed Feb 23 12:19:51 2000 Ossama Othman - - * ace/OS.i (ACE_LACKS_SETREUID_PROTOTYPE, - ACE_LACKS_SETREGID_PROTOTYPE): - - If either _BSD_SOURCE, _XOPEN_SOURCE or _XOPEN_SOURCE_EXTENEDED - is defined then do not allow the prototypes corresponding to - these macros to become visible since defining any of these - macros may make the real prototypes in the system headers - visible. Thanks to Rich Seibel for - pointing this out. - -Tue Feb 22 21:11:03 2000 Ossama Othman - - * configure.in (ACE_HAS_XPG4_MULTIBYTE_CHAR): - - Added test for wcslen(). Only define this macro if both the - wchar_t type and the wcslen() function exist. This fixes a link - problem on a ACE+autoconf QNX build. - -Tue Feb 22 20:56:51 2000 Ossama Othman - - * config.guess: - - Updated to latest version from the GNU CVS repository. - - * config.sub: - - Merged my QNX Neutrino patches into the latest version from the - GNU CVS repository. - -Tue Feb 22 20:09:14 2000 Ossama Othman - - * config.sub: - - Added support for QNX Neutrino. Hosts specifications such as - "i386-nto," "i386-qnx," "i386-qnx-nto," etc, will now be - accepted by the configure script's "--host" command line - option. A patch has been sent to the upstream maintainers of - this script. - - * ace/OS.cpp (unique_name): - - Fixed warning about mismatched format specifier by explicitly - casting the result of ACE_OS::getpid(), a "pid_t," to an "int." - - * ace/OS.h (ACE_LOFF_T): - - QNX Nuetrino has a 64-bit offset type, "off64_t." - - * m4/platform.m4 (ACE_SET_PLATFORM_MACROS): - - Added support for QNX Neutrino. - -Tue Feb 22 17:42:09 2000 Douglas C. Schmidt - - * ace/Synch.cpp: Reset the ACE_File_Lock::remove_ data member to - 0 in the open() method so that it can be reused. Thanks to - Sanwoo Jin for reporting this. - -Tue Feb 22 13:57:32 2000 Irfan Pyarali - - * ace/ACE.cpp (send_n and recv_n): Reduced the number of calls to - message_block->length () by caching the value. Also inlined - some of the smaller functions. - -Tue Feb 22 12:29:44 2000 Ossama Othman - - * m4/threads.m4 (ACE_CHECK_THREAD_FLAGS): - - Added run-time tests to this M4 macro to get around the annoying - fact that some platforms implement no-op thread function stubs, - which cause link-time tests to pass. The run-time tests check - the return value of pthread_create() and/or thr_create() to - determine if the function is working or not. The cross-compiled - case falls back on the link-time test. This fixes a problem on - Solaris with both Sun C++ and g++. - -Tue Feb 22 14:00:38 2000 David L. Levine - - * ace/OS.i (cond_timedwait): added pSOS support. Thanks - to Sarmeesha Reddy for the - implementation. - -Tue Feb 22 09:52:50 2000 Ossama Othman - - * ace/config-linux-common.h (ACE_HAS_PROC_FS): - - A conflict appears when including both and - with recent glibc headers, so don't define it. - However, at some point we should redefine this macro since the - latest glibc fixes this problem. - -Tue Feb 22 09:16:29 2000 Balachandran Natarajan - - * ace/streams.h: Commented out an inclusion of the file - as this was causing problems with Qt. - - * ace/Signal.h: One of the variables for the constructors of - ACE_Sig_Action was named as "signals". This apparently causes - conflict with the Qt library as the library has a macro by that - name. So it was changed as "signalss". Thanks to James Briggs - for reporting this. - -Tue Feb 22 01:52:09 2000 Douglas C. Schmidt - - * ace/Message_Block.cpp: Refactored the code in duplicate() - and clone() so that it doesn't have macro within macros. - Thanks to Nanbor for reporting this. - -Tue Feb 22 01:19:40 2000 Nanbor Wang - - * ace/MEM_IO.h: Added more comments. - -Tue Feb 22 00:39:03 2000 Nanbor Wang - - * ace/MEM_IO.h: Changed method fetch_recv_buf as protected and - added some missing comments. - - * ace/MEM_Acceptor.h: - * ace/MEM_Connector.h: Added some missing comments. - -Mon Feb 21 20:40:37 2000 Douglas C. Schmidt - - * ace/MEM_*: Minor modifications to formatting here. - - * tests/Dynamic_Priority_Test.cpp: Only run this test if - ACE_HAS_TIMED_MESSAGE_BLOCKS is enabled. - - * ace/Message_Block: By default, the deadline_time_ and execution_time_ - data members are now omitted and their accessor/mutator - operations rendered "no-op"s unless ACE_HAS_TIMED_MESSAGE_BLOCKS - is enabled. This is necessary to avoid an unnecessary 16 bytes - per-Message_Block. Thanks to Irfan for pointing this out. - -Mon Feb 21 17:22:33 2000 Ossama Othman - - * configure.in (ACE_LACKS_SETREUID): - - Fixed typo. - - (ACE_HAS_SOCKADDR_MSG_NAME): - - Fixed broken test. A `struct sockaddr' was being cast to a - `struct sockaddr *', which is obviously broken. This fix has - the side effect of causing ACE_HAS_SOCKADDR_MSG_NAME to be - defined on platforms where the "msg_name" field of the "msghdr" - structure is a `void*', such as Linux and Solaris. This isn't - necessarily a bad thing since it is perfectly valid. - - (ACE_HAS_VOIDPTR_SOCKOPT, ACE_HAS_CHARPTR_SOCKOPT): - - Fixed the tests for these two macros. The fifth "optlen" - argument to setsockopt() was being passed in as a pointer to - some integral type. The "optlen" argument to setsockopt() is - not a pointer. Rather, it should be one of the following: - socklen_t, size_t or int. The appropriate type for "optlen" - will be determined from previous tests, such as the test for - socklen_t. - - The test for ACE_HAS_CHARPTR_SOCKOPT will now only be run if the - test for ACE_HAS_VOIDPTR_SOCKOPT fails. - -Mon Feb 21 16:23:03 2000 Ossama Othman - - Thanks to Rich Seibel for providing the - highly detailed feedback that led to the following changes/fixes: - - * THANKS: - - Added Rich Seibel to the list of - contributors. - - * acconfig.h (ACE_HAS_IOMANIP_NO_H): - - Removed this macro since it isn't used anywhere. - - (ACE_LACKS_SETREGID_PROTO, ACE_LACKS_SETREUID_PROTO): - - These should have been ACE_LACKS_SETREGID_PROTOTYPE, and - ACE_LACKS_SETREUID_PROTOTYPE, respectively. - - * configure.in (ACE_HAS_IOMANIP_NO_H): - - Removed the test for this macro. It isn't used anywhere. - - (ACE_HAS_SIZET_SOCKET_LEN): - - Only test for this macro if ACE_HAS_SOCKLEN_T isn't defined. - - (ACE_LACKS_SETREGID_PROTO, ACE_LACKS_SETREUID_PROTO): - - These should have been ACE_LACKS_SETREGID_PROTOTYPE, and - ACE_LACKS_SETREUID_PROTOTYPE, respectively. - - Added "-U_BSD_SOURCE" to list of macros to undefine for each of - the tests for these macros. Defining "_BSD_SOURCE" on some - platforms may make the prototypes corresponding to the above - macros visible, so we need to explicitly undefine it. - - * ace/config-linux-common.h (ACE_HAS_PROCFS): - - Corrected typo. This macro should have been ACE_HAS_PROC_FS. - -Mon Feb 21 16:19:36 2000 Carlos O'Ryan - - * ace/OS.h: - Protect the definitions of the CDR macros, so users can override - them in their config.h file. Thanks to Jim Scheller - for pointing this out. - - * ace/CDR_Stream.h: - * ace/CDR_Stream.i: - * ace/CDR_Stream.cpp: - Fixed the algorithm to allocate new CDR blocks in the chain. In - all but a few weird cases it was allocating fixed sized blocks, - while the intention was to grow the size of the blocks to - minimize the number of allocations. Thanks to Jim Scheller - for finding this problem. - Also added a new ACE_CDR::consolidate() method to reduce a - message block chain into a single message block (with proper - alignment). This is useful in the implementation of the CDR - streams and Anys. - -Mon Feb 21 14:35:39 2000 Christopher Kohlhoff - - * ace/Makefile.bor: Added new files. - - * tests/*.cpp, tests/test_config.h: Removed macros that had been - used by C++Builder 3. - - * include/makeinclude/compiler.bor: Added support for C++Builder 5 - VCL libs. - - * include/makeinclude/recurse.bor, lots of Makefile.bor files: - Added support for makefile recursion. - -Mon Feb 21 14:35:39 2000 Douglas C. Schmidt - - * include/makeinclude/compiler.bor: Increased the limit of - LIB_LFLAGS from 2048 to 4096. Thanks to Mogens Hansen - for reporting this. - -Mon Feb 21 15:43:01 2000 Nanbor Wang - - * ace/MEM_SAP.h: - * ace/MEM_SAP.cpp (create_shm_malloc): Renamed the typedef - to to avoid name clashing problem on GHS - cross compilers. Thanks to Bill Tovrea - for reporting this and the help in - tracking this down. - -Mon Feb 21 12:51:52 2000 Ossama Othman - - * Makefile (RELEASE_TAG_FILES): - - Added `man/Makefile.am' to the list of files to be tagged at - release time. - -Mon Feb 21 08:35:58 2000 Chad Elliott - - * ace/config-hpux-11.00.h - Corrected a build problem with KCC. Things were lost in the - transition to the new header file. - -Sun Feb 20 18:31:46 2000 Douglas C. Schmidt - - * ace: Removed ACED.cpp and ACER.cpp. These were only - needed by Borland C++Builder 3.0, which is not supported by ACE - (i.e., you need to upgrade to BCB 4.0 or later). Thanks to - Christopher Kohlhoff for this fix. - -Sun Feb 20 23:43:22 2000 Darrell Brunsch - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: - Changed Base_Pointer_T.cpp to Based_Pointer_T.cpp. - Also synced ace_lib with ace_dll to bring up to date. - -Sun Feb 20 11:33:09 2000 Ossama Othman - - * THANKS: - - Added Todd Gruhn to the list of - contributors. - - * ace/config-netbsd.h: - - Defined ACE_HAS_DIRENT, and undefined ACE_LACKS_SIGSET. Thanks - to Todd Gruhn for confirming that these - changes were necessary. - -Sat Feb 19 17:53:47 2000 Ossama Othman - - * bin/make_release (create_kit): - - Another attempt to fix MD5 checksum generation at release time: - The problem was that an attempt to get the MD5 checksum for a - file in the current directory was being made, but that file had - already been moved to the destination FTP directory. Prepending - the destination directory to the filename should correct the - problem. MD5 checksum generation has been re-enabled. - -Sat Feb 19 17:32:28 2000 Ossama Othman - - * Makefile (RELEASE_TAG_FILES): - - Added this new variable. It contains a list of files that - should be tagged at release time, but shouldn't be listed in any - of the release/controlled file lists. This is necessary to - prevent multiple instances of the same file from being passed to - the `.zip' file creation command line. For example, - ACE_wrappers/man, ACE_wrappers/man/man3/Makefile.am and - ACE_wrappers/man/html/Makefile.am were all being passed to the - `.zip' file creation command line, resulting in duplicate file - names on that command line. Thanks to David for pointing this - out. - - The `bin/make_release' script will use this new list of files - when tagging a release. - - (show_release_tag_files): - - Makefile target that lists files that should be tagged at - release time. - - * bin/make_release: - - Invoke "$make show_release_tag_files" to determine if there are - any additional files to tag at release time. - - (tag): - - Added "$release_tag_files" to list of files to be tagged by CVS - at release time. This fixes a problem where the man page - Makefile.am files were not being tagged, which also prevented - them from being distributed with the ACE distribution. [Bug 408] - -Sat Feb 19 15:33:05 2000 David L. Levine - - * ACE version 5.0.14 released. - -Fri Feb 18 20:58:08 2000 Carlos O'Ryan - - * bin/auto_compile: - Do not send email if the build completed without errors. - -Fri Feb 18 17:30:26 2000 Steve Huston - - * ace/config-hpux-11.00.h: Filled out with the known compiler settings - for g++, KCC, HP CC, and HP aC++. This is now the official HP-UX 11 - config.h file for all compilers. - - * ace/config-hpux-11.x-hpc++.h: This file is no longer in use. It - generates a compiler error if used. It is planned to go away - for ACE 5.1. - -Fri Feb 18 10:25:45 2000 Carlos O'Ryan - - * ace/OS.h: - Workaround MSVC5 bug when invoking explicit destructors. Thanks - to Achim Stindt for this fix. - -Thu Feb 17 18:32:05 2000 Jeff Parsons - - * OS.h: - Removed the ACE_GLOBAL_COLONS macro I added yesterday. - Found another way to generate code with the IDL compiler - that doesn't need it. - -Thu Feb 17 09:38:06 2000 David L. Levine - - * tests/Reader_Writer_Test.cpp: use default n_iterations - of 25 and n_loops of 10 on VxWorks. With the old defaults, - the test took too long, e.g., 7 minutes on a 450 MHz - Pentium. With the new defaults, it takes about 20 seconds. - Thanks to Dave Hall for reporting this. - -Thu Feb 17 08:10:08 2000 Douglas C. Schmidt - - * ace/Service_Config.cpp (close_singletons): Don't bother calling - ACE_Proactor::close_singleton() on WinCE, Win95/98, or if - these's no support for AIO calls. Thanks to Sanwoo Jin - for reporting this. - -Wed Feb 16 17:03:31 2000 Steve Huston - - * tests/version_tests/version_tests.dsw: Add Capabilities_Test.dsp. - -Wed Feb 16 14:53:05 2000 Jeff Parsons - - * ace/OS.h: - Added ACE_GLOBAL_COLONS macro. In certain cases in IDL files - where nested scoped names repeat (after skipping a scope so - it's legal), all comilers except SucCC 5.0 need the fully - scoped name with the global double colon in order to resolve - the name. SunCC 5.0, on the other hand, not only doesn't - need it, but outputs an error whenever it sees these global - double colons just inside an open paranthesis, for example, - (::foo::...). This macro is used in generating code in - just these instances so all comilers can be happy. - -Tue Feb 15 22:57:59 2000 Nanbor Wang - - * ace/MEM_IO.h: - * ace/MEM_IO.cpp (send): Added a new method that sends a chain of - Message_Block. This function aggregates the data in - Message_Block and copies them directly into shared memory. - -Tue Feb 15 21:26:00 2000 David L. Levine - - * examples/IPC_SAP/SOCK_SAP/FD-unserver.cpp,CPP-unserver.cpp (main), - examples/Reactor/Multicast/server.cpp (main), - examples/System_V_IPC/SV_Message_Queues/MQ_Server.cpp (main), - examples/System_V_IPC/SV_Message_Queues/TMQ_Server.cpp (main), - wrapped final return with ACE_NOTREACHED to please cxx T6.3-003. - -Mon Feb 14 16:52:24 2000 David L. Levine - - * include/makeinclude/platform_linux_cxx.GNU: - no longer need to explicitly link all of the - template instantiation files into shared libs. - -shared works properly with T6.3-003. - -Mon Feb 14 12:21:01 2000 Chad Elliott - - * ace/config-hpux-11.x-hpc++.h - - Added a conditional include for the KCC common include file. - Modified the values of ACE_HAS_EXCEPTIONS and - ACE_LACKS_LINEBUFFERED_STREAMBUF to match those of the KCC - common header. This will not affect non-KCC builds on HP. - - * include/makeinclude/platform_hpux_kcc.GNU - - Added this file for building on HPUX with KCC. - - * include/makeinclude/platform_sunos5_kcc.GNU - - Modified to allow building static libraries. - - * include/makeinclude/platform_linux_kcc.GNU - - Modified to allow building static libraries. - -Mon Feb 14 08:43:31 2000 Ossama Othman - - * acconfig.h: - - Changed ACE_HAS_POSITION_INDEPENDENT_MALLOC macro to - ACE_HAS_POSITION_INDEPENDENT_POINTERS since the name changed in - ACE as well. - - * configure.in (AC_LANG_CPLUSPLUS): - - Set the test language to C++ earlier in the configure script to - make sure all tests are done using the C++ compiler. - - (ACE_CONFIGURATION_OPTIONS, ACE_COMPILATION_OPTIONS): - - Moved configure script option macros to new `m4/ace.m4' M4 - macros file. - - (ACE_TEMPLATES_REQUIRE_SOURCE, - ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION, - ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA): - - Overhauled the tests for these macros. Since there may be a - tight dependency between some of these macros, the - ACE_TEMPLATES_REQUIRE_SOURCE test also tests if either of the - other two macros are required. This fixes a problem that was - occurring with Sun C++ 5.0. - - Corrected a syntax error in the previous - ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA test, which is now part of - the ACE_TEMPLATES_REQUIRE_SOURCE test. - - (ACE_TEMPLATES_REQUIRE_PRAGMA): - - Added a test for this macro. It is only run if the - ACE_TEMPLATES_REQUIRE_SOURCE test failed. This should improve - AIX support. - - * m4/ace.m4 (ACE_CONFIGURATION_OPTIONS, ACE_COMPILATION_OPTIONS): - - Moved all configure script command line option macros to this - file and placed them in the above M4 macros. This makes things - a bit cleaner, and it also allows other macros to AC_REQUIRE the - above macros. - - * m4/compiler.m4 (ACE_SET_COMPILER_FLAGS): - - Made this macro depend on ACE_COMPILATION_OPTIONS - (i.e. AC_REQUIRE it). - - Moved more compiler specific variable settings from configure.in - to this macro. - -Sun Feb 13 11:17:33 2000 Nanbor Wang - - * examples/Shared_Malloc/test_multiple_mallocs.cpp: - * examples/Shared_Malloc/test_position_independent_malloc.cpp: - * tests/Malloc_Test.cpp: Changed - ACE_HAS_POSITION_INDEPENDENT_MALLOC to - ACE_HAS_POSITION_INDEPENDENT_POINTERS. - -Sat Feb 12 20:35:23 2000 Douglas C. Schmidt - - * examples/Shared_Malloc/test_position_independent_malloc.cpp (initialize): - Zapped several temporary variables that were causing warnings - when ACE_ASSERT is disabled. Thanks to David Levine for - reporting this. - -Sat Feb 12 17:06:20 2000 Nanbor Wang - - * ace/OS.h: - * ace/Thread_Manager.cpp (ACE_Thread_Exit): Removed member - and its accessors. They don't seem to be used - anywhere in ACE and can't be accessed by users. Thanks to - "Elias Sreih" for noticing this. - -Sat Feb 12 15:15:01 2000 Nanbor Wang - - * ace/README (ACE_HAS_POSITION_INDEPENDENT_POINTERS): Renamed - the depricated ACE_HAS_POSITION_INDEPENDENT_MALLOC to - ACE_HAS_POSITION_INDEPENDENT_POINTERS. - - * ace/OS.h: Made ACE_HAS_POSITION_INDEPENDENT_POINTERS=1 the default - if it is not defined already. If you don't want the support of - position independent pointers (which means you don't care about - position independent malloc,) define - ACE_HAS_POSITION_INDEPENDENT_POINTERS to 0. - - * ace/MEM_SAP.h: - * ace/MEM_SAP.cpp: - * ace/Malloc.h: - * ace/Malloc.cpp: - * ace/Malloc.i: - * ace/Malloc_T.i: - * ace/Memory_Pool.cpp: Changed ACE_HAS_POSITION_INDEPENDENT_MALLOC - to ACE_HAS_POSITION_INDEPENDENT_POINTERS. - - * ace/config-sunos5.5.h: - * ace/config-win32-common.h: Removed depricated - ACE_HAS_POSITION_INDEPENDENT_MALLOC. - -Sat Feb 12 14:40:20 2000 David L. Levine - - * examples/Connection/misc/Connection_Handler.cpp, - examples/Logger/Acceptor-server/server_loggerd.cpp, - examples/Logger/simple-server/Logging_Handler.cpp (handle_timeout): - added ACE_UNUSED_ARG (arg), only with ACE_NDEBUG. - -Sat Feb 12 00:27:45 2000 Nanbor Wang - - * ace/OS.h: Changed to conditionally define - ACE_DEFAULT_TEMP_DIR_ENV according to whether the unicode is - supported or not. - - * ace/MEM_SAP.h: - * ace/MEM_SAP.cpp: - * ace/MEM_Acceptor.cpp (accept): - * ace/MEM_Connector.cpp (connect): Made UNICODE friendly. Thanks - to Steve for reporting the problem. - -Fri Feb 11 13:26:49 2000 Nanbor Wang - - * ace/MEM_Acceptor.cpp (accept): Changed to use - ACE_reinterpret_cast to cast (sockaddr *) to (sockaddr_in *). - This eliminate the warning on HPUX aCC compiler. - -Fri Feb 11 01:16:15 2000 Nanbor Wang - - * ace/MEM_Acceptor.cpp: - * ace/MEM_Acceptor.h: Changed to use ACE_LACKS_INLINE_FUNCTIONS to - determine where to include MEM_Acceptor.i file as ASYS_INLINE is - used. Thanks to Marina and SunCC 5 for reporting the problem. - -Thu Feb 10 21:57:04 2000 Nanbor Wang - - * ace/MEM_SAP.h - * ace/MEM_SAP.i (set_buf_len): Removed the const'ness of argument - . - -Thu Feb 10 14:09:56 2000 Nanbor Wang - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: Added MEM_* files. - -Thu Feb 10 13:49:34 2000 Nanbor Wang - - * ace/MEM_SAP.h: - * ace/MEM_SAP.i: - * ace/MEM_SAP.cpp: Implemented the adaptation layer for managing - shared memory in shared memory transport. - - * ace/MEM_Addr.h: - * ace/MEM_Addr.i: - * ace/MEM_Addr.cpp: Implemented the "endpoint" addressing - mechanism for shared memory transport. The ACE_MEM_Addr make - sure the "endpoint" is not on an interface that is accessable - outside of the running host. It also serves as endpoint - identification and provides the checking method. - - * ace/MEM_IO.h: - * ace/MEM_IO.i: - * ace/MEM_IO.cpp: Implemented the IO routines for shared memory - transport. Currently, these IO routines treat shared memory - transport as a streaming devide and copy the data into its own - buffer before sending the data over. We'll add method for - acquiring and sending the internal buffer later. - - * ace/MEM_Acceptor.h: - * ace/MEM_Acceptor.i: - * ace/MEM_Acceptor.cpp: - * ace/MEM_Connector.h: - * ace/MEM_Connector.i: - * ace/MEM_Connector.cpp: - * ace/MEM_Stream.h: - * ace/MEM_Stream.i: - * ace/MEM_Stream.cpp: These classes emulate SOCK_* classes but use - shared memory as their transport mechanism. - - * ace/Malloc_T.cpp: Fixed a mis-matched ACE_TRACE message. - - * ace/OS.h: Added definitions of ACE_MEM_ACCEPTOR, - ACE_MEM_CONNECTOR and, ACE_MEM_STREAM. - - * ace/Makefile: Aded MEM_* files and updated dependencies. - - * tests/Malloc_Test.cpp: Removed explicit template instantiations - for ACE_Malloc[_T] as they are taken care of in MEM_SAP.cpp - now. - - * examples/IPC_SAP/SOCK_SAP/CPP-memclient.cpp: - * examples/IPC_SAP/SOCK_SAP/CPP-memserver.cpp: - * examples/IPC_SAP/SOCK_SAP/CPP_memclient.dsp: - * examples/IPC_SAP/SOCK_SAP/CPP_memserver.dsp: - * examples/IPC_SAP/SOCK_SAP/SOCK_SAP.dsw: Added a simple example - on how to use the shared-memory transport. - -Thu Feb 10 10:18:00 2000 Ossama Othman - - * THANKS: - - Added Hajdukiewicz Markus and Gerwin - Robert to the list of fame. - - * configure.in (ACE_LACKS_SETSCHED): - - Fixed test so that it defines ACE_LACKS_SETSCHED when - sched_setscheduler() isn't found. This was the intended - behavior. Thanks to Hajdukiewicz Markus - and Gerwin Robert for providing a patch for - this problem. - - (ace_cv_feature_cxx_std_template_specialization): - - It appears that this variable had to be quoted when testing if - it was set to "yes" on AIX. Thanks again to Markus and Robert - for providing a patch. - -Wed Feb 09 00:41:36 2000 Irfan Pyarali - - * tests/Pipe_Test.cpp (main): Spawn command should be - "./Pipe_Test" and not "Pipe_Test". Otherwise the test will fail - if the user does not have "." in his/her PATH. Thanks to Ossama - for reporting this problem. - -Tue Feb 08 21:22:45 2000 Irfan Pyarali - - * ace/Token: Yesterday's change caused one problem. There was no - way to distinguish which thread was going to be the next owner. - So the following happened: - - Thread A had a read lock and was waiting in select(). Thread B - wanted a write lock, therefore it executed the sleep hook, and - then waited on the condition. Thread A got up through the sleep - hook, signaled thread B, released the lock and went back to grab - the read lock. Even though thread B was runnable, it hadn't - gotten a chance to become the owner and was still - zero. When thread A tried to reacquire the read lock, it - succeeded. Thread B finally ran to find out that the token was - in use and went back to sleep, and hence got starved in the - process. - - Therefore, the following changes were made to fix the above: - - - wakeup_next_waiter() always reset and . If - there is a waiter, it sets and for the next - owner. - - - release() doesn't reset and since - wakeup_next_waiter() now does. - - - renew() doesn't set or reset and since - wakeup_next_waiter() now does. - - - shared_acquire() doesn't set and since - wakeup_next_waiter() now does. - - - The while loops in shared_acquire() and renew() now loop until - the calling thread becomes the owner. - - Note that this version of the Token implementation is still - better than the previous one since it does not double delete on - timeouts and wakes up the next waiter if it timed out and became - the owner simultaneously. - -Tue Feb 08 21:46:51 2000 Girish Birajdar - - * include/makeinclude/platform_vxworks5.x_g++.GNU: - added SIMSPARCSOLARIS support. - -Tue Feb 8 16:29:38 2000 Ossama Othman - - * ltcf-cxx.sh: - * ltconfig: - * ltmain.sh: - - Updated from latest libtool multi-language branch versions. - -Tue Feb 8 14:25:46 2000 Ossama Othman - - * ace/config-sunos5.5.h (ACE_HAS_TYPENAME_KEYWORD): - - According to ACE's configure script, Sun C++ 5.0 also supports - the typename keyword. - -Tue Feb 8 16:17:21 2000 Steve Huston - - * ace/Thread_Manager.h: Added comment text to ACE_Thread_Manager::wait - noting that it doesn't wait during ACE_Object_Manager rundown. - -Tue Feb 8 14:16:50 2000 Ossama Othman - - * ace/config-sunos5.5.h (ACE_HAS_USING_KEYWORD): - - Sun C++ 5.0 supports the `using' keyword. Thanks to David Wicks - for pointing this out. - -Mon Feb 07 21:11:32 2000 Irfan Pyarali - - * ace/Token: Bug 416 - (http://ace.cs.wustl.edu/bugs/show_bug.cgi?id=416) was causing - problems for TAO/tests/Leader_Followers. The current owner of - the token was in the process of waking up the next thread. In - the meantime, the thread that was going to be woken up next - timed out. This lead to double deletes from queues and double - decrements of counters: one by the thread doing the signaling - and the other by the thread timing out. In addition, the other - threads waiting for token never woke up since there was nobody - to wake them up. - - The following changes were made to rectify this problem: - - - ACE_Token::ACE_Token_Queue::insert_entry() factored out common - code for adding followers to the queue. - - - The thread adding itself to the waiter queue and changing the - counters is the one responsible for undoing the state - changes. The thread doing to wake up is only responsible for - the signaling. - - - When a thread timeouts, it must check if it was also selected - as the next owner. If it was, it must wakeup another waiter. - - - renew() was simplified and made consistent with - shared_acquire() and release(). - - - wakeup_next_waiter() abstracted out the code for the selection - of the next owner. - - - Improved state management including values for owner_> - and in_use_>. - - - The wait() loop was not correct. We now loop until the token - is no longer in use. This way if the token ownership was taken - by another (new) waiter thread by the time we wake up, we simply - go back to sleep. - -Mon Feb 7 17:54:06 2000 Jeff Parsons - - * bin/run_all_list.pm: - Added TAO/tests/DynAny_Test/run_test.pl to the general - and single-threaded test groups. - -Mon Feb 7 17:30:00 2000 Kirthika Parameswaran - - * ace/ACE.cpp (out_of_handles): Added ENOTSUP (Operation not - supported) check for SunOS. This helped in solving a bug when - the Cached_Conn_Test was executed using a single-threaded build. - Thanks to Steve Huston for reporting this - bug. - -Mon Feb 7 17:28:40 2000 Douglas C. Schmidt - - * netsvcs/clients/Naming/Client/main.cpp (main): Removed two - warnings that crept in recently. Thanks to David Levine - for reporting this. - -Mon Feb 7 08:34:26 2000 Darrell Brunsch - - * docs/ACE-subsets.html: - Removed the instructions for subsets on Win32. Subsets are not - supported under MSVC Project files. - -Sun Feb 6 20:44:26 2000 Ossama Othman - - * ace-config.1.in: - - Updated e-mail address of author (me). - - * configure.in: - - Updated e-mail address of configure script maintainer (me again). - - (PURE_CACHE_DIR): - - Fixed syntax of shell script variables. This fixes a problem - that occurred on FreeBSD. - - (LIBS): - - Removed manual addition of some thread related libraries. They - are now in the auto-detection list in threads.m4. - - * m4/compiler.m4 (ACE_SET_COMPILER_FLAGS): - - Improved support for HP aCC, and corrections. Set WERROR to - "+We67" to cause use of "#pragma once" to be an error instead of - a warning. - - * m4/features.m4 (ACE_CHECK_ASYNCH_IO): - - Reduce timeout value in test program from INT_MAX to 5 seconds. - - * m4/threads.m4 (ACE_CHECK_THREADS): - - Add "-xnolib" to CXXFLAGS when testing thread flag support using - Sun C++. Sun C++ links a thread function stub library in the - single-threaded case. The stubs are no-ops but they exist, - nonetheless. This causes the link tests used to determine if a - thread flag is needed to incorrectly pass. - -Sun Feb 6 14:52:28 2000 Ossama Othman - - * ace/Makefile.am (libACE_Demux_la_SOURCES): - - Added `QtReactor.cpp' to list of sources. - - (libACE_Other_la_SOURCES): - - Added `QoS_Session_Impl.cpp' and `QoS_Session_Factory.cpp' to - the list of sources. - - (HEADER_FILES): - - Added `Min_Max.h', `QoS_Session_Impl.h' and - `QoS_Session_Factory.h' to the list of headers. - - (INLINE_FILES): - - Added `QoS_Session_Impl.i' to the list of inline files. - - * ace/OS.h (ACE_LOFF_T): - - HP-UX has a 64 bit offset type "off64_t." - -Sat Feb 5 20:49:50 2000 Ossama Othman - - * ltcf-c.sh: - * ltcf-cxx.sh: - * ltconfig: - * ltmain.sh: - - Updated from latest libtool multi-language CVS branch. - - * m4/compiler.m4 (LDFLAGS): - - Remove "-xildoff" from the Sun C++ linker flags. It doesn't - seem to be needed since the compiler is smart enough to know - when to use it. - -Fri Feb 4 23:12:36 2000 Douglas C. Schmidt - - * netsvcs/lib/Client_Logging_Handler.cpp (handle_input): Added code to - handle the case where all the data isn't available when we do a - "recv()" from the socket. Thanks to David X. Callaway - for reporting this. - - * ace/Log_Msg.cpp (open): Add a special-purpose case for NT to make sure - that handles are reused in the client logging daemon. Thanks to - David X. Callaway for reporting - this. - -Fri Feb 4 19:29:31 2000 Darrell Brunsch - - * ace/Process.h: - * ace/Process.cpp: - The method command_line_argv () now returns a LPTSTR const * - instead of a char * const *. This enables it to compile under - UNICODE. Thanks to Steve Huston for pointing this out. - -Fri Feb 4 16:46:42 2000 Steve Huston - - * tests/run_tests.sh: Added . to PATH to be sure that tests which - fork/exec and rely on PATH to find the program (like Pipe_Test) - run correctly. - -Fri Feb 4 16:31:22 2000 Steve Huston - - * tests/Message_Queue_Notifications_Test.cpp: Use ACE_HAS_THREADS - rather than ACE_MT to leave out the ACE_Barriers in Watermark_Test - class when building without threads to avoid compile errors on - Sun C++ 4.2. - -Fri Feb 4 15:11:53 2000 Steve Huston - - * ace/config-hpux-11.00.h: New config file to handle building on - HP-UX 11.00 with aCC, CC, or g++ (tested on 2.95.2). This file - will be the new file for this platform when autoconf is not used. - The other config-hpux-11* files will go away soon (maybe before - ACE 5.1 is released). - -Fri Feb 4 15:56:31 2000 Steve Huston - - * include/makeinclude/platform_hpux_gcc.GNU: Added -fstrict-prototype - for HP-UX 11 - it resolves a pthread_atfork dispute between two - slightly different declarations in pthread.h and unistd.h. - -Thu Feb 3 11:38:15 2000 Douglas C. Schmidt - - * ace/Malloc_T.cpp (unbind): Removed the != 0 test since it was - causing ambiguity problems for G++. Thanks to David Levine for - reporting this. - - * ace/Malloc_T.cpp (unbind): Make sure to update the prev_ pointer - so that we don't end up with an improperly linked list. Thanks - to Sandro Doro for reporting this. - - * examples/Shared_Malloc/test_position_independent_malloc.cpp: Only - explicitly instantiate a template for ACE_Malloc_T if we've got - ACE_HAS_POSITION_INDEPEDENT_MALLOC enabled. Thanks to David - Levine for reporting this. - -Thu Feb 3 11:40:27 2000 Ossama Othman - - * docs/ACE-subsets.html: - - Added some notes about building ACE subsets using MSVC++. - Thanks to Paul von Behren for providing - the tips. - -Thu Feb 3 11:38:15 2000 Douglas C. Schmidt - - * ace/OS.i, - * ace/Synch.cpp: Added a cast of (short) to the use of USYNC_THREAD - in order to prevent ambiguity problems for KAI C++. Thanks to - Chad Elliott for reporting this. This - fixes bugid 418. - - * ace/OS.cpp (thr_create): Added yet another cast to (long) for - PRIORITY_MAX so that the types will be consistent for the - ace_min() function. Thanks to Stephen Moon - for reporting this. - -Thu Feb 3 08:38:22 2000 Carlos O'Ryan - - * bin/run_all_list.pm: - Disable the $TAO_ROOT/orbsvcs/tests/Event/* tests under single - threaded builds because the tests do indeed use threads. - -Wed Feb 2 23:35:19 2000 Douglas C. Schmidt - - * ace/OS.cpp (thr_create): Added a cast to (long) for - PRIORITY_MAX so that the types will be consistent for the - ace_min() function. Thanks to James Briggs - for reporting this. - -Wed Feb 02 21:56:32 2000 David L. Levine - - * bin/check_build_logs: added -p option to check Purify - output for anomaly and leak reports. - -Wed Feb 02 16:29:19 2000 David L. Levine - - * ace/OS.cpp (lwp_getparam): if the LWP is in the TS - class, set the policy to ACE_SCHED_OTHER instead of - ACE_SCHED_RR. That's the only thread scheduling policy - that's supported in TS class on Solaris, where this function - can be used. Thanks to Chris Gill for tracking this bug down. - -Wed Feb 02 12:46:53 2000 Nanbor Wang - - * ace/OS.cpp (open): Changed to determine whether files should be - opened using FILE_SHARE_DELETE flag on Win32 at runtime. This - allows ace libraries built for Win95/98 work correctly on NT. - Thanks to Alex Chachanashvili for reporting - this. [Bug 419] - - * ace/OS.{h,i,cpp}: Added a static data member of type - OSVERSIONINFO on win32 and initialize it in - ACE_OS_Object_Manager::init to cache the OS version - informaiton. - -Wed Feb 2 11:08:33 2000 Douglas C. Schmidt - - * ace/Thread.h: Clarified that cancel() is only portable - on platforms that support cancellation. Thanks to Jason - Czavislak for motivating this. - -Wed Feb 2 08:43:29 2000 Carlos O'Ryan - - * include/makeinclude/platform_linux_lxpthread.GNU: - Add support for gprof, not very useful when compared to - Quantify, but helps. - - * bin/auto_compile: - Some tests print ERROR to indicate a failure. - -Tue Feb 1 12:59:28 2000 Ossama Othman - - * ltcf-cxx.sh: - - Added HPUX shared library support for the aCC C++ compiler. - -Tue Feb 1 09:40:50 2000 Ossama Othman - - * tests/Pipe_Test.cpp (main): - - Exit with error if child exited with error. Previously, the - test returned successfully which was misleading. - - * ltcf-cxx.sh: - * ltconfig: - * ltmain.sh: - - Updated from latest libtool multi-language branch sources. - -Mon Jan 31 00:09:11 2000 Douglas C. Schmidt - - * Added the following changes for Borland C++Builder 4: - - ace/OS.cpp: Removed processor architecture "hack" since - Borland C++Builder 4 supports the required structure definition, - and earlier versions are no longer supported. - - ace/OS.h: Do not define the ACE_No_Heap_Check class when - building with Borland C++Builder. - - ace/OS.h, OS.i, config-win32-borland.h: Updated compiler version - numbers for macro definitions. - - ace/Thread_Manager.h: ACE_Thread_Descriptor_Base class needs to - be exported when building a DLL. - - include/makeinclude/build_dll.bor, build_exe.bor, build_lib.bor: - Added makefile target for "clean". - - include/makeinclude/compiler.bor: Added -D_DEBUG compiler flag - when building debug configuration. - - include/makeinclude/outputdir.bor: Allow object directory to be - overridden. - - Thanks to Christopher Kohlhoff for - contributing these. - - * ace/OS.i: Minor reformatting. - - * ace/SOCK_Dgram_Mcast: Updated the implementation comments related to - the subscribe_ifs() return value of 1 to indicate why this is - needed. Also, updated the documentation to indicate to check - for -1 on failure. Thanks to Mark Boriac for motivating this. - - * etc/Svc_Conf_l.cpp.diff: The context diff was incorrectly - written, therefore, the wrong ACE_YY_BREAK was being commented - out. This is now fixed. Thanks to David Levine for reporting - this. - - * examples/Shared_Malloc/test_position_independent_malloc.cpp: - Added a typedef to handle cases where - ACE_HAS_POSITION_INDEPENDENT_MALLOC is not set. Thanks to David - Levine for reporting this. - - * examples/Service_Configurator/Misc/main.cpp (main): Changed - int i to size_t i to avoid complaint about signed/unsigned - mismatch. Thanks to David Levine for reporting this. - -Sun Jan 30 12:35:20 2000 Nanbor Wang - - * ace/Token.cpp (remove_entry): should point to - entry if we are removing the last entry in the queue. Thanks to - Irfan for pointing this out. - -Sat Jan 29 12:56:16 2000 bala - - * ACE version 5.0.13 released. - -Fri Jan 28 20:14:20 2000 Carlos O'Ryan - - * ace/RB_Tree.h: - * ace/RB_Tree.i: - current_size() was not const. - -Fri Jan 28 13:57:37 2000 Fred Kuhns - - * fixed QoS realted bugs in QoS_Session_Impl.cpp QoS_Session_Impl.h - SOCK_Dgram_Mcast.cpp. Just added some error checking and - check errno after call to join_leaf. - -Thu Jan 27 20:25:37 2000 Irfan Pyarali - - * ace/Token.cpp (shared_acquire and renew): Must decrement - in case of condition variable wait errors and - timeouts. - - * ace/TP_Reactor.cpp (handle_events): If the user gives us a - timeout, we must call with that timeout. - Also, we must be more careful when dealing with the return value - from to distinguish timeouts from errors. - -Thu Jan 27 16:52:40 2000 James Hu - - * ace/Message_Block.*: - Added a ACE_Message_Block::reset() method that puts the - rd_ptr() and wr_ptr() back to the beginning of the message - block. - -Thu Jan 27 16:38:03 2000 Steve Huston - - * ace/Asynch_IO.h: Updated comments for ACE_Asynch_Read_Stream::read - and ACE_Asynch_Write_Stream::write to state that the affected - message block's wr_ptr and rd_ptr, respectively, are updated upon - successful completion of the operation. - -Thu Jan 27 11:06:22 2000 Nanbor Wang - - * ace/Parse_Node.cpp: Strings duplicated using ACE::strnew() must - be deleted using delete[] instead of delete. Thanks to - Christopher Kohlhoff for catching this. - -Thu Jan 27 09:11:52 2000 Steve Huston - - * ace/Message_Block.h: Tried to clarify the comments regarding the - handling of the data block pointer in the - manipulating functions. Thanks to Defang Zhou - for pointing out the lack of documentation regarding this. - - * THANKS: Added Defang Zhou to the Hall of Fame. - -Thu Jan 27 00:15:08 2000 Irfan Pyarali - - * ace/ACE.cpp (recv_n and send_n): There was a bug in these - methods introduced by the double while loops and the use of a - single break ;-) Changed break to a return. Thanks to the - HPUX_aCC auto compile build for leading me to this bug! - -Wed Jan 26 21:49:16 2000 James Hu - - * ace/Message_Block.*: - Added new methods mark(), capacity(), and ::total_capacity(). - mark() points at base_ + cur_size_, capacity_ returns - max_size_, and total_capacity_ sums all capcity()'s for all - MBs in the continuation. Changed space() to return - mark() - wr_ptr(). - -Wed Jan 26 21:03:43 2000 Darrell Brunsch - - * ace/High_Res_Timer.cpp: Thanks to Adamo, Vince - who noticed that global_scale_factor_ wasn't being set on ACE_WIN32 - when QueryPerformanceFrequency () worked. Now the code sets it - to one when that happens. - -Wed Jan 26 17:04:24 2000 Steve Huston - - * ace/Proactor.h: Changed some comments to work better with the - HTML man page generator. - -Tue Jan 25 16:23:52 2000 Douglas C. Schmidt - - * examples/Shared_Malloc/test_position_independent_malloc.cpp: Updated - this example to use the ACE_Malloc_T<> template with the - ACE_PI_Control_Block so that we get true "position-independent" - malloc behavior. Thanks to Rick Ohnemus - for reporting this. - -Tue Jan 25 14:05:42 2000 Irfan Pyarali - - * ace/Connector.cpp (connect_i): In addition to checking - for a zero value, <*sh_copy> should also be checked for a zero - value. - -Mon Jan 24 12:09:14 2000 Irfan Pyarali - - * ace/Connector.cpp (connect_i): - * ace/Strategies_T.cpp (ACE_Cached_Connect_Strategy::connect_svc_handler): - - Cannot use after the connector lock has been released since - other threads now have access to and can reset it. We must - use instead (even when activating the newly connected - svc_handler). This should help with TAO/tests/MT_Client - crashes. - -Sun Jan 23 14:08:12 2000 Ossama Othman - - * ace/OS.h (setgid): - - Added prototype for ACE_OS::setgid() method. - - * ace/OS.i (setgid): - - Added wrapper for setgid() system call. - - (getgid): - - Removed duplicate getgid() wrapper, and fixed it so that it - returns with ENOTSUP on Win32 platforms, just like the getuid() - wrapper. - -Sat Jan 22 21:10:49 2000 Ossama Othman - - * configure.in: - - Moved check for old GNU C++ to m4/compilers.m4. - - * m4/acinclude.m4 (ACE_CONVERT_WARNINGS_TO_ERRORS): - - This macro depends on the compiler settings performed by the - ACE_SET_COMPILER_FLAGS macro, so added an - AC_REQUIRE([ACE_SET_COMPILER_FLAGS]). - - * m4/compiler.m4 (ACE_SET_COMPILER_FLAGS): - - Moved check for old GNU C++ from configure.in to here. - -Sat Jan 22 15:27:39 2000 Douglas C. Schmidt - - * ace/Svc_Conf_l.cpp: Updated this file to use the new - "warning-free" generated file. - - * etc/Svc_Conf_l.cpp.diff: Commented out a YY_BREAK macro that was - causing an "unreached statement" warning on some C++ compilers. - Thanks to David Levine for reporting this. - - * tests/Thread_Pool_Test.cpp: In the method - test_empty_message_shutdown() we don't need to allocate a new - message block when sending a "null" message. This removes - another memory leak. Thanks to David Levine for reporting this. - -Sat Jan 21 12:30:33 2000 Ossama Othman - - * ace/ACE.cpp: - * ace/Service_Config.cpp: - * ace/Template_Instantiations.cpp: - - Moved ACE_LOCAL_MEMORY_POOL/ACE_Null_Mutex related template - instantions to ACE.cpp. This fixes a single threaded build - problem. - -Thu Jan 20 09:15:50 2000 Ossama Othman - - * bin/bootstrap: - - Create NEWS file before automake is run. Automake complains - about missing NEWS file. - -Thu Jan 20 09:03:37 2000 Ossama Othman - - * NEWS: - - This file is currently generated during the autoconf support - bootstrapping process. As such, it shouldn't be placed under - version control. Removed this file from the repository. - - * configure.in: - - Added thread related preprocessor flags to CPPFLAGS prior to - running the tests that check for the pthread_cancel() strtok_r() - prototypes in case such flags are needed on some platforms. - - If the configure script determines that no usable thread library - was found it then removes any thread related preprocessor flags - from the CPPFLAGS preprocessor flags variable. - - * ace/README: - - Added description of ACE_HAS_ALT_CUSERID. - - * m4/threads.m4 (ACE_CHECK_THREADS): - - Remove any definitions of _REENTRANT and _THREAD_SAFE from the - preprocessor flags prior to checking if the compiler defines - either one, and prior to searching for compiler thread flags by - using the sed stream editor. This is done instead of using the - "-U" preproccesor flag since using that flag may undefine the - same preprocessor macros potentially defined by the thread flag - being tested. - - Added "kthread" to the list of thread flags to be searched. - FreeBSD uses "-kthread" to enable support for kernel threads. - - (ACE_CHECK_THREAD_FLAGS): - - Relaxed criteria used to determine if compiler provides thread - support by removing requirement that either _REENTRANT or - _THREAD_SAFE should be defined. - - (ACE_CHECK_THREAD_CPPFLAGS): - - Added this test. It checks if the compiler defines thread - related preprocessor flags, such as _REENTRANT and - _THREAD_SAFE. The test is a compile-time test that is performed - after the thread flag search test so that the thread flag (if - any) is used during this test in case it defines any - preprocessor flags. - -Wed Jan 19 23:21:07 2000 Douglas C. Schmidt - - * tests/Thread_Pool_Test.cpp (test_queue_deactivation_shutdown): Make - sure to release the message block once we've decided to shutdown - the message queue to avoid a memory leak. Thanks to David - Levine for reporting this. - -Tue Jan 19 13:33:08 2000 Joe Hoffert - - * ace/ATM_Addr.cpp, ATM_QoS.cpp: - Fixing format characters for ACE_Log_Msg::log() method. - -Tue Jan 18 20:56:58 2000 Ossama Othman - - * THANKS: - - Added Daniel Lang to the list of contributors. - - * acconfig.h (ACE_HAS_ALT_CUSERID): - - Added this ACE macro to the list of macros. - - * configure.in: - - Thanks to Daniel Lang for motivating the following - ACE+autoconf related FreeBSD 3.4 fixes. - - (ACE_LACKS_SEMBUF_T): - - Improved the test for this macro by including and - prior to . It incorrectly failed on - FreeBSD. Presumably this change should correct the problem. - - (ACE_HAS_ALT_CUSERID): - - Added test for this macro. It should get defined for platforms - that lack support for or have deprecated support for the - cuserid() function, and have POSIX password file functions. - - (ACE_LACKS_PWD_FUNCTIONS): - - Added getpwuid() to list of functions necessary for - ACE_LACKS_PWD_FUNCTIONS to *not* be defined. - - (ACE_LACKS_PTHREAD_CANCEL): - - Added check for the pthread_cancel() prototype. If it doesn't - exist then don't use pthread_cancel(), i.e. define - ACE_LACKS_PTHREAD_CANCEL. It it probably a bad idea to create a - prototype for pthread_cancel in ACE, so just don't use - pthread_cancel(). FreeBSD 3.4 appears to have the - pthread_cancel() function but no prototype for it. - - * ace/OS.i (cuserid): - - Changed Linux implementation so that it can be used for other - platforms by simply defining ACE_HAS_ALT_CUSERID. - - Added preprocessor error if ACE_HAS_ALT_CUSERID and - ACE_LACKS_PWD_FUNCTIONS are both defined. ACE's alternate - cuserid() implementation requires that password file related - functions exist. - - * ace/config-linux-common.h: - - Define ACE_HAS_ALT_CUSERID on glibc 2.1.x since the use of the - system cuserid() is discouraged. - - * m4/acinclude.m4: - - Cosmetic updates. - -Tue Jan 18 22:53:18 2000 Toshio HORI - - * include/makeinclude/platform_vxworks_5.x_g++.GNU: - added support for compiling ACE for VxWorks/SPARC target. - -Tue Jan 18 15:55:54 2000 Douglas C. Schmidt - - * netsvcs/ACE-netsvcs.html: Fixed a typo. Thanks to - Brian Jones for reporting this. - - * ACE-INSTALL.html: Updated the text from - Dr. Toshio HORI . - -Tue Jan 18 15:37:25 2000 Joe Hoffert - - * ace/ATM_Connector.{cpp,h,i}, ATM_QoS.{cpp,h}, ATM_Stream.{cpp,i}: - Adding changes to support FORE's latest WinSock2 ATM support. - -Tue Jan 18 13:44:34 2000 Douglas C. Schmidt - - * tests/Thread_Pool_Test.cpp: Replaced int with size_t to - prevent compiler warnings comparing signed and unsigned - quantities. - -Tue Jan 18 09:13:43 2000 David L. Levine - - * ACE-INSTALL.html: ACE works just fine on RedHat 5.1 and - later, not just 5.1 through 6.1. Thanks to Raj Narayanaswamy - for asking about this. - -Mon Jan 17 18:03:17 2000 Douglas C. Schmidt - - * ace/Process_Manager.cpp: Under WIN32, the ACE_Process_Manager - registered itself as an event handler with ACE_Reactor, but did - not properly unregister itself when it closed. For error to be - noticed, you must instantiate ACE_Process_Manager with an - ACE_Reactor. ACE_Process_Manager should *not* be run as a - singleton. It must be instantiated such that it will be - destroyed *before* the ACE_Reactor is destroyed. - - When you call ACE_Process_Manager::spawn, the newly created - process is added to the ACE_Process_Manager's process table and - (under WIN32) the ACE_Process_Manager is registered as an event - handler for the new process (ace/Process_Manager.cpp, line 523) - using this call: - - r->register_handler (this, proc->gethandle ()); - - This will happen for every process spawned. Thus, - ACE_Process_Manager will potentially be associated with more - than one WIN32 process handle. - - When the ACE_Process_Manager was destroyed, the dtor calls - ACE_Process_Manager::close which (for WIN32) attempts to remove - ACE_Process_Manager as an Event_Handler from the ACE_Reactor - using the following code (ace/Process_Manager.cpp, line 256) - - this->reactor ()->remove_handler (this, 0); - - This version of ACE_Reactor::remove_handler is: - - int ACE_Reactor::remove_handler - ( - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask - ); - - It calls event_handler->get_handle() to obtain the handle to - which 'event_handler' is associated. The problem is that - ACE_Process_Manager::get_handle returns ACE_INVALID_HANDLE, so - the ACE_Reactor never properly unregistered the - ACE_Process_Manager. This is now fixed and should work correctly - on Win32 and other platforms. - - Thanks to Greg Gallant for tracking all this - down and providing the fix. - - * ace/Process_Manager.cpp (open): Wrapped the setpgid() call with a - #if !defined (ACE_LACKS_SETPGID) to remove spurious run-time - warnings on platforms that don't support setpgid(). Thanks to - Craig Perras for reporting this. - - * ace/NT_Service: Reformatted this header to conform to the ACE - programming guidelines. Also, replaced - - #if defined (ACE_HAS_WINNT4) && ACE_HAS_WINNT4 != 0) - - with - - #if defined (ACE_WIN32) - - This change allows a single dll to be built that supports both - NT and Win9x. The app can use GetVersionEx() to check whether - the platform is NT or not dynamically, or it can just call the - various service functions, which will return a function not - supported error. Thanks to Craig Perras - for reporting this. - - * tests/Thread_Pool_Test.cpp: Enhanced this test to illustrate how - to shut down Tasks using either the "empty message" strategy or - the "queue deactivation" strategy. - - * ace/Message_Queue.h: Updated the documentation of the enqueue*() - and dequeue*() methods to clarify which errno values are set - when the calls return -1. - - * examples/Threads/thread_pool.cpp: Updated this example to - remove the use of the now-defunct "wait_for_threads_to_shutdown" - feature of ACE_Task. - - * ace/Task_T: Removed the recent feature added on - - Sat Jan 8 09:44:51 2000 Douglas C. Schmidt - - - that allowed to an ACE_Task's destructor to wait for threads in - a task to exit. It turns out this is practically impossible to - use correctly because of the way that destructors are destroyed - from the "top down". However, it's trivial to get the same - behavior by simply calling the Tasks's wait() method whenever - you want to implement barrier synchronization on a Task's thread - exits. - - * tests/Thread_Pool_Test.cpp: Updated this test to illustrate - various strategies to wait for threads to exit. Thanks to Mark - C. Barnes for motivating this example. - -Mon Jan 17 14:20:17 2000 Nanbor Wang - - * ace/OS.h: - * ace/OS.i: Changed the signature of isatty to (int) and added a - (ACE_HANDLE) version for Win32. - - * ace/Makefile: - * ace/Svc_Conf_l.cpp: Removed the explicit casting of fileno() - from int to ACE_HANDLE. - - * ace/config-WinCE.h: Added ACE_LACKS_ISATTY. - - * ace/OS.i (isatty): Removed WinCE specific section. - -Mon Jan 17 00:53:37 2000 Douglas C. Schmidt - - * ace/OS.h: Added a cast to (long) for ACE_THR_PRI_FIFO_MIN, - ACE_THR_PRI_FIFO_MAX ACE_THR_PRI_RR_MIN, ACE_THR_PRI_RR_MAX, - ACE_THR_PRI_OTHER_MIN, ACE_THR_PRI_OTHER_MAX since these are all - used as priority values, which is defined as a long. This - should solve a problem with the ACE_MAX()/ACE_MIN() templates on - Linux with G++. Thanks to Bala for reporting this problem. - - * netsvcs/lib/Logging_Strategy: Added a new '-w' option that - instructs the logging strategy to "wipeout", rather than append - to, an existing logfile. Thanks to David X. Callaway - for reporting this. - -Sun Jan 16 21:32:18 2000 Douglas C. Schmidt - - * ace/OS.h: Moved the #defines for ACE_MIN and ACE_MAX into the - new $ACE_ROOT/Min_Max.h file, along with their template function - definitions. - - * ace: Added a new file called Min_Max.h that uses templates, rather - than macros, to implement the ACE_MIN and ACE_MAX macros. This - is a "Good Thing" because the use of macros has undesirable - side-effects due to the "call-by-name" semantics of macro - paramter expansion... If for some reason your compiler can't - handle this, please #define ACE_LACKS_MIN_MAX_TEMPLATES in your - config.h file. Thanks to Derek Dominish - for contributing this. - -Sun Jan 16 16:43:10 2000 Ossama Othman - - * ace/config.h.in: - - Removed this file from the repository. It is automatically - generated when autoconf support is bootstrapped into a - workspace. - -Sun Jan 16 16:13:00 2000 Ossama Othman - - * acconfig.h: - * configure.in: - - Added support/tests for: - - ACE_LACKS_SETREGID - ACE_LACKS_SETREUID - ACE_LACKS_SETREGID_PROTO - ACE_LACKS_SETREUID_PROTO - - * ace/ACE.cpp: - * ace/Configuration.cpp: - - Moved template instantiations related to ACE_LOCAL_MEMORY_POOL - to ACE.cpp, and fixed them so that they work in the single - threaded case. The idea is to place this set of template - instantiations in a "common" area, since TAO also needs these - templates instantations. - -Sun Jan 16 10:49:26 2000 Douglas C. Schmidt - - * ace/Makefile (Svc_Conf_l.cpp): Fixed the "isatty()" sed hack to - use fileno and then add a cast to (ACE_HANDLE) since this is - what the ACE_OS::isatty() wrapper expects Thanks to Nanbor and - Bala for reporting this. - - * etc/Svc_Conf_l.cpp.diff: Added a #define for ACE_YY_NO_UNPUT - to supress an unnecessary warning. - - * tests/ARGV_Test.cpp (main): Fixed several warnings. - - * ace/Process.i: Rearranged the order of the process_name() methods - so they are defined before being used/inlined. - -Sat Jan 15 19:59:00 2000 Douglas C. Schmidt - - * ace: Reran flex on Svc_Conf.y to generate the Svc_Conf_l.cpp file - with Darrell's fixes. - -Sat Jan 15 15:49:28 2000 Darrell Brunsch - - * ace/config-win32-common.h: - Readded the ACE_LACKS_FCNTL macro, since it seems to have been - missed in the latest changes to the config-win32 files. - - * ace/Makefile: - With Doug's help, added a couple of new commands to the generation - of the Svc_Conf_l.cpp, because the generated files were causing - a warning on NT. - -Sat Jan 15 00:41:12 2000 Douglas C. Schmidt - - * ace/ARGV: Added a new add() method that adds an entire argv - array in one fell swoop. - - * netsvcs/clients/Naming/Client/main.cpp (main): Replaced - the ad hoc use of argc/argv processing with the ACE_ARGV - approach. - - * examples/Service_Configurator/Misc/main.cpp (main): Replaced - the ad hoc use of argc/argv processing with the ACE_ARGV - approach. Note that this required the enhancement shown in the - following bullet. - - * ace/Svc_Conf.l: Updated the Service Configurator lexer so that - it will also accept strings that are delimited by single quotes, - as well as double quotes. This helps to simplify the use of - ACE_ARGV to create svc.conf entries "on-the-fly". - - * tests: Added a new test ARGV_Test.cpp that illustrates how to - use advanced features of . Thanks to Suresh Kannan - for contributing this. - - * ace/config-win32-common.h: Added - - #define ACE_LACKS_SETREGID - #define ACE_LACKS_SETREUID - - Thanks to Christopher Kohlhoff for - reporting this. - - * ace/Task.h: Added a comment to the suspend() and resume() methods - encouraging developers not to use these methods unless - absolutely necessary. Thanks to Mark C. Barnes - for motivating this. - - * ace: Reorganized the config-win32*.h files - to insulate the different compiler configurations from each - other. The changes are as follows: - - * Concatenated config-win32.h and config-win32-common.h to form - the new config-win32-common.h. - - * Moved MSVC-specific language defines from config-win32-common.h - into config-win32-msvc.h - - * Updated the other compilers' files to add required language - defines originally in config-win32-common.h. - - Thanks to Christopher Kohlhoff for - contributing this. - -Fri Jan 14 15:42:28 2000 Irfan Pyarali - - * ace/Select_Reactor_T.cpp (work_pending): Made the code more - general such that any thread can call it, i.e., it is not - limited to the owner thread. This change alleviated the need - for the specialization in TP_Reactor. - -Fri Jan 14 01:48:26 2000 Douglas C. Schmidt - - * ace/Process: Moved the command_line_argv() from the - non-Win32 part of the ACE_Process class to the generic - part since it shouldn't depend on the platform. Thanks - to Michael Kircher for reporting this. - - * ace/Process: Consider a process that spawns a number of - processes using a same executable name but with different - arguments . Depending on the arguments, - each process does different things. Currently - calls with argv[0] as the - exeutable name. Therefore, if you do a command now, all - these processes will look the same, since they are all launched - with the same command. - - But for call, you could actually give a different - executable name and a different argv[0]. This helps us to have - the name for a process to be different from the executable - name. In this case, command will show the processes with - different argv[0] names. - - Therefore, we added a method called to - ACE_Process_Options to specify the executable name. If you do - not call method, argv[0] is taken as the - executable name. Thanks to Alex Arulanthu - for these enhancements. - -Thu Jan 13 20:11:55 2000 Irfan Pyarali - - * ace/TP_Reactor.cpp (work_pending): This version is similar to - the select reactor except there is no owner check. - - * ace/Select_Reactor_T.cpp (work_pending): The handle set must be - copied before calling select(). - -Thu Jan 13 16:06:19 2000 Balachandran Natarajan - - * bin/auto_compile: - * bin/run_all.pl: - * bin/run_all_list.pm: Added an AMI test case for testing in the - nightly builds. - -Wed Jan 12 23:46:36 2000 Douglas C. Schmidt - - * ace/Service_Config.h: Updated the - ACE_Service_Config::close_singletons() method documentation to - reflect the fact that it no longer deletes the Allocator, which - is deleted by the ACE_Object_Manager now. Thanks to Craig - Perras for reporting this. - -Wed Jan 12 09:49:57 2000 David L. Levine - - * bin/make_release: don't create diffs if not installing - the kit. - -Wed Jan 12 07:22:42 2000 David L. Levine - - * Makefile (CONTROLLED_FILES): removed - man/man3/Makefile.am and man/html/Makefile.am. There - addition in - Tue Jan 4 12:58:54 2000 Ossama Othman - caused creation of .zip files to break. zip doesn't like - multiple occurrences of a file, apparently. [Bug 408] - -Tue Jan 11 21:59:34 2000 David L. Levine - - * bin/make_release (create_kit): disable creation of - md5 files, because it didn't work: just empty files - were created. I think that it was looking in the wrong - directory. - -Tue Jan 11 21:26:14 2000 David L. Levine - - * bin/make_release (check_workspace): removed the bootstrap - invocation. That is done in create_kit (), and should only - be done once. (create_kit): set umask to 2, so that the - kits will have group write permission. - -Tue Jan 11 17:39:10 2000 Douglas C. Schmidt - - * ace/Service_Config.h: Updated the ACE_Service_Config::close() - method documentation to reflect the fact that it no longer - closes the singletons (these are closed by the - ACE_Object_Manager now). Thanks to Craig Perras - for reporting this. - -Tue Jan 11 17:22:21 2000 bala - - * ACE version 5.0.12 released. - -Mon Jan 10 12:50:10 2000 Douglas C. Schmidt - - * ace/Select_Reactor_T.h (class ACE_Select_Reactor_T): Reformatted the - documentation a bit... - -Mon Jan 10 15:37:22 2000 Irfan Pyarali - - * ace/Pair_T: Added const accessors to the pair class. Also, - changed the Reference_Pair accessors to be const. Thanks to - Serge Kolgan for reporting this. - -Sun Jan 9 00:25:58 2000 Douglas C. Schmidt - - * ace/Process.i (setreugid): Added an ACE_UNUSED_ARG for the - ACE_LACKS_PWD_FUNCTIONS case. Thanks to David for catching - this! - - * ace/Process.i (setreugid): Guard against the case where - ACE_LACKS_PWD_FUNCTIONS. Thanks to David Levine for - reporting this problem with VxWorks. - - * ace/Pair_T.h: Reformatted to conform to the ACE style. - -Sat Jan 8 09:44:51 2000 Douglas C. Schmidt - - * examples/Threads/thread_pool.cpp: Revised the example to - illustrate the new "wait_for_threads_in_destructor" feature of - ACE_Task. - - * examples/Threads/task_four.cpp: Reformatted the code. - - * ace/Task_T: Added a new flag to the constructor that enables - applications to request that an ACE_Task will wait in its - destructor for any and all threads in the task to exit before - returning. Thanks to Valery Arkhangorodsky - for suggesting this. - - * ace/OS.i: Needed to add an extern "C" {} block around the - setregid() and setreuid() functions. Thanks to David Levine - for reporting this. - -Fri Jan 7 20:01:48 2000 Douglas C. Schmidt - - * ace/OS.i, - ace/config-sunos5.5.h: Some platforms seem to lack function - prototypes for setreuid() and setregid(), even though they are - in the library. Therefore, I've added - - #define ACE_LACKS_SETREGID_PROTOTYPE - - and - - #define ACE_LACKS_SETREUID_PROTOTYPE - - macros to handle this case. - - * ace/Process: Added support to allow UNIX applications to - automagically set the real and effective user/group ids when - ACE_Process::spawn() is called. Thanks to Craig Perras - for contributing this. - - * ace: Updated the following files to include - - #define ACE_LACKS_SETREGID - #define ACE_LACKS_SETREUID - - config-chorus.h - config-cray.h:168 - config-cygwin32-common.h - config-freebsd-pthread.h - config-freebsd.h:33 - config-hpux-9.x.h - config-lynxos.h - config-netbsd.h - config-sunos4-g++.h - config-sunos4-sun4.1.4.h - config-win32-common.h - - Ideally, Ossama's autoconf stuff will auto-detect anything that - I'm missing. - - * ace/OS: Added wrapper facade methods for setregid() and - setregid(). - -Fri Jan 7 16:05:32 2000 Ossama Othman - - * configure.in: - - Only define ACE_HAS_XT if both the Xt headers and libraries are - available. Previously, the existence of the Xt libraries was - not part of the XtReactor enable criterion. - - * m4/compiler.m4 (ACE_SET_COMPILER_FLAGS): - - Added C++ preprocessor flag documentation and trivial support. - - Many AIX related compiler flag updates. - - * m4/platform.m4 (ACE_SET_PLATFORM_MACROS): - - Moved/consolidated platform-specific settings from configure.in - to here. - - Improved AIX support (updates, fixes, etc). - -Fri Jan 7 10:48:55 2000 Nanbor Wang - - * bin/run_all_list.pm: Added missing commas. - -Thu Jan 06 22:26:42 2000 Irfan Pyarali - - * ace/OS.i (fcntl): There was a special fcntl() for Win32. - Removed that special version and added ACE_LACKS_FCNTL to - config-win32-common.h. - - * ace/ACE.cpp: Removed the non-"_n" versions of send/recv - functions that deal with message blocks. Since we deal with - continuation chains and linked messages, we are essentially - dealing with "_n" style functions. Also, improved the error - handling in case of timeouts. - - * ace/Strategies_T.cpp - (ACE_Cached_Connect_Strategy::connect_svc_handler): If an error - occurs while activating the handler, the - method will close the handler. We must set the handler to zero - to make sure that the higher layer doesn't try to close the - handler again! - -Thu Jan 6 15:00:56 2000 Ossama Othman - - * aclocal.m4: - * configure: - * All Makefile.in: - - Removed these files. They are automatically generated, so they - should not be in the repository. Thanks to David for pointing - out that my ACE+autoconf updates caused CVS conflicts when - updating existing workspaces. - -Wed Jan 5 10:09:35 2000 Douglas C. Schmidt - - * ace/Dirent.h: Added an ACE_Export on the ACE_Dirent class. I'm - surprised this hasn't been a problem before... Thanks to - Dominic Williams for indirectly - motivating this change. - - * ace/SString.h: Updated the documentation for the various string - wrapper facades to clarify that they don't perform any locking. - Thanks to Jerry Jiang for motivating this. - -Wed Jan 05 09:53:04 2000 David L. Levine - - * ace/SOCK_Stream.[hi] (sendv_n): added const to iov[] - argument declaration. Thanks to Rob Ruff - for reporting that TAO's AV service failed to compile - with Sun CC 5.0 because of this. - -Tue Jan 4 15:06:41 2000 Ossama Othman - - * configure.in: - - Added note that asks user to use stock ACE build procedure - detailed in ACE-INSTALL.html in the event that the configure - script fails. - -Tue Jan 4 14:40:17 2000 Ossama Othman - - * ace/OS.h: - - AIX defines "off64_t" as its 64 bit offset type. Typedef - ACE_LOFF_T as that type if ACE_HAS_LLSEEK or ACE_HAS_LSEEK64 is - defined. This should correct a problem that occurred during an - AIX configure script run. Thanks to Mike Winter for pointing - this out. - -Tue Jan 4 14:09:51 2000 Ossama Othman - - * configure.in: - - Fixed test that checks if sched.h is needed for thread - scheduling definitions. This should correct problems discovered - on RedHat 6.1 installations. Thanks to - - Improved sys_nerr and sys_errlist[] tests by checking for - external global variables in libraries. This should correct a - problem discovered in an AIX configure script run. Thanks to - Mike Winter for providing feedback. - -Tue Jan 4 13:23:26 2000 Douglas C. Schmidt - - * ace/Service_Config: Updated the documentation for the various - open() methods and the constructors. Thanks to Christopher - Kohlhoff for reporting this. - -Tue Jan 4 12:58:54 2000 Ossama Othman - - * Makefile (CONTROLLED_FILES): - - man/man3/Makefile.am and man/html/Makefile.am previously weren't - being labelled. Thanks to David for pointing this out. - -Mon Jan 3 21:01:53 2000 Douglas C. Schmidt - - * examples/Service_Configurator/IPC-tests: Updated the - README file so it'll point to the right documentation! Thanks - to John Buttitto for reporting this. - -Tue Jan 04 07:26:24 2000 David L. Levine - - * ACE version 5.0.11 released. - -Mon Jan 03 07:34:38 2000 David L. Levine - - * ace/OS.i (gmtime_r): return res instead of *res, because - the function returns a struct tm *, not a struct tm. - -Sun Jan 2 11:02:54 2000 Douglas C. Schmidt - - * ace/OS.i (gmtime_r): We should return *res rather than - *result to make the behavior correct for Win32. Thanks to - J. Afshar for reporting this. - -Sun Jan 02 00:50:00 2000 Chris Gill - - * ace/OS.{cpp, h, i} - ace/Signal.cpp - ace/Synch.cpp - ace/config-psos-diab-ppc.h: Added support for native mutexs, - condition variables, and thread-specific storage in pSOS. Native - pSOS mutexes, where available, support several cool features, - including lock recursion and priority inheritance protocol and - priority ceiling protocol support. - -Sat Jan 01 09:16:39 2000 David L. Levine - - * ChangeLog,Makefile: moved to ChangeLog-99b. diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a deleted file mode 100644 index 7566a55bd8e..00000000000 --- a/ChangeLogs/ChangeLog-03a +++ /dev/null @@ -1,5197 +0,0 @@ -Fri Apr 28 13:11:20 2000 Ossama Othman - - * include/makeinclude/platform_linux_lxpthread.GNU: - * include/makeinclude/platform_linux_lxpthreads.GNU: - - Renamed `platform_linux_lxpthread.GNU' to - platform_linux_lxpthreads.GNU to be consistent with the name of - its corresponding config header `config-linux-lxpthreads.h'. - Thanks to Ken Weinert for reporting this. - - `platform_linux_lxpthread.GNU' now includes the newly renamed - file for backward compatibility. - -Fri Apr 28 11:54:21 2000 Douglas C. Schmidt - - * ace/SString.cpp: Fixed the delimiter_replace() method so that - it actually does what it's comment implies... Thanks to Martin - Krumpolec for reporting this. - -Thu Apr 27 18:19:19 2000 James Hu - - * ace/Dirent.i: Added checks to see if dirp_ is initialized - before calling into ACE_OS. - -Thu Apr 27 16:53:49 2000 Irfan Pyarali - - * ace/Hash_Map_Manager_T.cpp (unbind_all_i): Added new method - unbind_all() for removing all the entries in one shot. Thanks - to Boris Sukholitko for providing this - enhancement. - - * tests/Hash_Map_Manager_Test.cpp: Added test for unbind_all(). - -Thu Apr 27 14:17:52 2000 Darrell Brunsch - - * ace/OS.i: - - isatty (): Messed up on my CE change, so the version that - takes an int was hidden by a ACE_WIN32 block. This has been - moved outside again. - - * ace/OS.cpp: - - Weird, somehow part of a section that should have been removed - with the CE changes was still present. Removed again. - -Thu Apr 27 13:08:00 2000 Darrell Brunsch - - * bin/msvc_auto_compile.pl: - - Changed the code style and made it consistent. - - Also changed the core build to build all of the orbsvcs and - do the static builds in the right order. - - * ace/OS.cpp: - * ace/OS.i: - - For some reason, I had trouble with the libraries when the - ACE_Cleanup destructor was in the .i file. So I moved it to - the .cpp file instead. - - * ace/ace_dll.dsp: - - Was defining ACE_ACE_HAS_DLL=1, which is #1, not needed and, - #2, the wrong macro name. - - * ace/ace_lib.dsp: - - Changed the static configs to be of type Win32 Static Release/ - Debug instead of Win32 Release/Debug. - - * apps/gperf/src/gperf.dsp: - * apps/gperf/src/gperf_lib.dsp: - - Added Win32 Static Release/Debug configs. - -Thu Apr 27 14:32:45 2000 Douglas C. Schmidt - - * ACE-INSTALL (make): Updated the documentation. Thanks to - Ken Weinert for reporting this. - -Thu Apr 27 12:41:42 2000 James C. Hu - - * ace/OS.i: - * ace/OS.cpp: - * ace/config-freebsd-pthread.h: - * ace/README: - - Removed ACE_HAS_TIME_R in favor of using existing - mechanism of ACE_HAS_REENTRANT_FUNCTIONS, and then - adding ACE_LACKS_NETDB_REENTRANT_FUNCTIONS and - also ACE_LACKS_PWD_REENTRANT_FUNCTIONS. Created a - new lacks called ACE_LACKS_RAND_REENTRANT_FUNCTIONS - to match the previous two. FreeBSD can now use its - native *time_r functions. - -Thu Apr 27 10:55:11 2000 Darrell Brunsch - - These changes bring the Windows CE port up to date. It currently - supports Windows CE 2.11 on the H/PC Pro. I am looking into the 2.11 - P/PC port, but there are other problems with it still. Hopefully - the WinCE 3.0 SDK will be more mature. - - * ace/ace_dll_ce.dsp: (added) - * ace/ace_ce_dll.dsp: (removed) - * ace/ace_ce.dsw: - - Created a new dsp file from scratch from CE to see how the - toolkit sets up the projects. Removed the old one. - - * ace/ACE.cpp: - - format_hexdump (): Changed usage of isprint to ACE_OS::ace_isprint. - - get_ip_interfaces (): Changed use of deprecated ACE_TEXT_STRING to - ACE_TString. Also added an ACE_TEXT_CHAR_TO_TCHAR to a use - of the ACE_INET_Addr constructor. - - * ace/ARGV.cpp: - - create_buf_from_queue (): We were not adjusting the size of a - ACE_TCHAR buffer by sizeof ACE_TCHAR when we did a memcopy. - Thanks to Valery Arkhangorodsky - for reporting this. - - * ace/Memory_Pool.cpp: - - seh_selector (): Changed use of LPEXCEPTION_POINTERS to - EXCEPTION_POINTERS * since it seems like that definition is - missing in some WinCE configs. - - * ace/ace_wchar.h: - - Added deprecated definition of ACE_TEXT_STRING. - - convert (): Changed the conversions from CharToOem to - MultiByteToWideChar, since it is more widely supported in Win32. - Also removed the loading of user32.lib since it was only needed - for CharToOem. - - * ace/config-win32-common.h: - - Changed the _MT check so it doesn't do anything on CE. Some - CE targets do not have the Multithreaded DLL generation option. - - * ace/config-WinCE.h: - - Changed ACE_DEFAULT_LD_SEARCH_PATH to use ACE_TEXT. - - Added a define for ACE_HAS_WCHAR and a check to always define - ACE_USES_WCHAR. - - Commented out the ACE_HAS_MFC check. - - Defined FILE, since it seems to be missing from CE 2.11 H/PC Pro. - - Added a definition for EXCEPTION_ACCESS_VIOLATION that was in - older SDK's. - - Removed some UNDER_CE < 2.11 defines. < 2.11 CE will not be - supported anymore. - - Removed definition of is_print, since it was moved into ACE_OS. - - Added a definition for the operator placement new, which is - missing when MFC isn't used. - - * ace/OS.h: - - Enabled is_atty for Windows CE. Added ace_isprint and made - ace_isspace an ACE_TCHAR method. - - * ace/OS.i: - - chdir (): NOTSUP on CE 2.11 - - tempnam (): Also NOTSUP on CE 2.11 - - abort (): changed ::exit to exit to get it to compile. - - ace_isspace (): Changed to use ACE_TCHAR, but also made it - NOTSUP on CE 2.11. - - ace_isprint (): Added, but NOTSUP on CE 2.11. - - sema_init (): Needed to cast an void *arg to ACE_mutexattr_t. - - dlsym (): Changed the way ACE declares symbolname so it uses the - right one on Win32 (WinNT always uses char *, CE always uses - wchar_t *). The function still takes in ACE_TCHAR * though. - Thanks to Jeff Greif for reporting this. - - Removed a few global function definitions that were just for - CE (like fwrite, fread, getc, etc.). These are either supported - in newer CE's or is disabled in the ACE_OS methods. - - is_atty (): Enabled on CE. - - * ace/OS.cpp: - - Enabled fopen on CE by using _wfopen (but not sure if this will - work correctly, since on other Win32 platforms we have a lot more - stuff. - - Enabled several printf methods on CE. - - open (): Removed the use of FILE_SHARE_DELETE on CE. - - * ace/Service_Config.i: - - initialize (): Added an ACE_TEXT_CHAR_TO_TCHAR and replaced - an ACE_WIDE_STRING with it also. - - * ace/Svc_Conf.h: - * ace/Svc_Conf.y: - * ace/Svc_Conf_y.cpp: - - ace_yyerror (): Takes an ACE_TCHAR * instead of char * now. - Thanks to Valery Arkhangorodsky - for also reporting this. - - * ace/Svc_Conf.l: - * ace/Svc_Conf_l.cpp: - - Changed to use ACE_OS::isatty () and ACE_OS::ace_isprint. - -Thu Apr 27 11:49:52 2000 Douglas C. Schmidt - - * ace/OS.i (memchr): Do not cast away constness when emulating - memchr(). Thanks to Rick Ohnemus - for reporting this. - - * ace/Select_Reactor_Base.cpp (open): The notification pipe handlers - created by the ACE_Select_Reactor_Notify::open were being left - open after fork() and exec(). Thanks to Rick Ohnemus - for reporting this. - -Wed Apr 26 23:47:31 2000 Douglas C. Schmidt - - * ace/Process_Manager.cpp (open): Make sure that the dummy I/O - handle is not inherited by child processes. Thanks to Rick - Ohnemus for reporting this. - -Wed Apr 26 20:32:59 2000 James C. Hu - - * ace/OS.cpp: - * ace/OS.i: - * ace/README: - * ace/config-freebsd-pthread.h: - Added a new define ACE_HAS_TIME_R. FreeBSD supports - *time_r() calls, but not gethostbyname_r, so a new feature - specification was needed to get these functions into - ACE_OS. - -Wed Apr 26 12:21:16 2000 Steve Huston - - * ace/ACE.cpp (send_n_i (ACE_HANDLE, const void *, size_t, int) and - send_n_i (ACE_HANDLE, const void *, size_t): If the send fails - with EWOULDBLOCK, wait for the handle to become writeable again - before retrying the send. Thanks to Edan Ayal - for reporting this. - - * tests/SOCK_Send_Recv_Test.cpp: Added test 3 for send_n to verify - fix for writing to nonblocking handle. - -Wed Apr 26 08:43:21 2000 Darrell Brunsch - - * apps/drwho/PMC_Flo.cpp: - * apps/drwho/PMC_Usr.cpp: - * apps/drwho/PMS_All.cpp: - * apps/drwho/PMS_Flo.cpp: - * apps/drwho/PMS_Ruser.cpp: - * apps/drwho/PMS_Usr.cpp: - - Was still using ACE::strecpy, changed to ACE_OS::strecpy. - -Tue Apr 25 15:11:41 2000 Carlos O'Ryan - - * THANKS: - Add new member to the list. - -Tue Apr 25 11:35:07 2000 Darrell Brunsch - - * ace/Local_Name_Space.cpp: - - The hash function was using the wrong length of the USHORT16 - string representation. The len_ actually is the length in bytes, - not characters. - -Tue Apr 25 08:57:59 2000 Darrell Brunsch - - * ASNMP/tests/test_config.h: - - Was using XXX_A and XXX_W macros which really do not make sense - anymore. Removed them and replaced with just the XXX macro which - uses ACE_TEXT. - - * examples/Naming/test_multiple_contexts.cpp: - * examples/Naming/test_non_existent.cpp: - * examples/Naming/test_writers.cpp: - * performance-tests/Misc/test_naming.cpp: - * tests/Naming_Test.cpp: - * tests/SString_Test.cpp: - - All of these were still being disabled when ACE_HAS_WCHAR wasn't - defined. Since the naming stuff was changed to work without - ACE_HAS_WCHAR, these were reenabled. - -Tue Apr 25 00:02:08 2000 Douglas C. Schmidt - - * ace/Log_Msg.h (ACE_Log_Msg): Split msg_ostream() into two functions, - one of which allows the delete_ostream_ flag to be reset and the - other that doesn't. Thanks to Boris Sukholitko - for reporting this. - - * ace/Message_Block.i (replace_data_block): If a data block is replaced - with a NULL pointer then don't bother doing certain operations! - Thanks to Boris Sukholitko for - reporting this. - - * ace/OS.i (dlerror): Changed sizeof buf to sizeof buf / sizeof buf[0] - to avoid over-allocating a buffer in the - ACE_TEXT_FormateMessage() function. Thanks to Valery - Arkhangorodsky for reporting this. - - * ace/Service_Repository.cpp: The fini() method was claiming - it was the close() method. Likewise, changed the close() method - so that it keeps decrementing the current_size each time through - the look to allow checking the respository size or doing other - work from inside the fini() call. Thanks to Valery - Arkhangorodsky for reporting this. - -Mon Apr 24 17:44:21 2000 Darrell Brunsch - - * ace/Object_Manager.cpp: - - Ai Carumba! I disabled some stuff here a while back when - I first disabled the Naming Service, but forgot to enable - it again once I fixed that. - -Mon Apr 24 16:44:22 2000 Darrell Brunsch - - * ace/SString.i: - - A couple of compilers were having problems with some - casting I was doing in a const hash method. Changed the - types of casts to hopefully make the compilers happy. - -Mon Apr 24 10:04:51 2000 Darrell Brunsch - - * ace/OS.cpp: - - Another problem with a missing parenthesis. - -Mon Apr 24 09:15:03 2000 Darrell Brunsch - - * ace/OS.i: - - Forgot a couple of ')'s that showed up on Lynx builds. - - Also, ACE_const_char doesn't exist, ACE_const_cast does. - -Sun Apr 23 19:51:41 2000 Darrell Brunsch - - * ace/ACE.cpp: - * ace/Naming_Context.cpp: - * ace/SOCK_Dgram_Mcast_QoS.cpp: - - Just tried the ACE_USES_WCHAR build and there were a couple - of things that needed updating. Mainly some missing ACE_TEXT's - or char's used instead of ACE_TCHAR's. - - * tests/Process_Mutex_Test.cpp: - - Was still using an old ACE_DEFAULT_MUTEX_A macro (updated to - ACE_DEFAULT_MUTEX). - - * ace/ace_lib.dsp: - - Added "static" to the config names (Win32 Debug => Win32 Static - Debug) so it is easier for the msvc_auto_compile.pl script to - figure out which is which. - -Sun Apr 23 18:14:33 2000 Darrell Brunsch - - * ace/ace_wchar.h: - - Added compatibility for all the old ASYS_* macros by default. - But no part of ACE/TAO should still use them anymore. This - compatibility can be turned off by defining - ACE_ONLY_LATEST_AND_GREATEST. - - * ace/SString.cpp: - * ace/SString.h: - * ace/SString.i: - * ace/Local_Name_Space.cpp: - * ace/Local_Name_Space.h: - * ace/Local_Name_Space_T.h: - * ace/Name_Space.cpp: - * ace/Name_Space.h: - * ace/Naming_Context.cpp: - * ace/Naming_Context.h: - * ace/Remote_Name_Space.cpp: - * ace/Remote_Name_Space.h: - - Found a better way of support for the ACE_Name_Space classes when - there isn't a wchar_t. We now define the ACE_WString to internally - use a type called ACE_WSTRING_TYPE, which is defined to wchar_t - unless ACE_USES_WCHAR is not defined (in which case it is defined - to ACE_USHORT16). - -Sun Apr 23 14:27:11 2000 Darrell Brunsch - - * ace/CLASSIX/CLASSIX_Port.cpp: - * tests/IOStream_Test.cpp: - * tests/SOCK_Connector_Test.cpp: - - Found some old ASYS macros still hanging around in code that wasn't - enabled on NT. - -Sat Apr 22 22:01:15 2000 Darrell Brunsch - - * ace/Local_Name_Space_T.cpp: - * ace/Naming_Context.cpp: - - Fixed some wchar related changes. - -Sat Apr 22 20:53:11 2000 Darrell Brunsch - - This is my first checkin of my Unicode changes. They should be - mostly harmless, since most platforms and build do not use Unicode - stuff, in which these changes *should* result in the exact same - behavior as before. - - But, if Unicode was being used, then chances are it is not going - to work without a few changes. A summary of the changes are: - - - Standardized wide char support to the following macros: - - ACE_HAS_WCHAR - if not defined, ACE will not use the type wchar_t - or provide any of the functions that use it. - ACE_USES_WCHAR - if defined, ACE will use wchar_t instead of char - for its strings (but not its buffers). - - This support has been mostly completed, but there are still some - loose ends that need to be cleaned up. - - Note also that even if ACE_USES_WCHAR is defined or not, both - wide and narrow versions of the string operations will be - available. - - - Removed all the ASYS_* macros (besides ASYS_INLINE). So all code - using ASYS_TEXT and ASYS_TCHAR should now use ACE_TEXT and - ACE_TCHAR. And unlike their predecessers, these *will* turn into - wide character versions when ACE_USES_WCHAR is defined. - - - Removed the macros ACE_HAS_WCHAR_TYPEDEFS_USHORT and - ACE_HAS_WCHAR_TYPEDEFS_CHAR since ACE will not depend on what - wchar_t defaults to. - - - Messed around with Windows CE support, most likely it broke it - even more. I've halted my work on Windows CE until after this - change, so I'll be fixing it up in upcoming checkins. - - - Since ACE_WString was changed, everything using it will now - not be available when ACE_HAS_WCHAR is not defined. - - The motivation for this change was that the Unicode support was - a mess and was very unintuitive. Since I was given the job of - maintaining it (since I'm doing Windows CE stuff now), I decided - to fix it instead of try to figure out what was currently - happening. A consistent design is much easier to explain and - maintain. - - * ace/ACE.h: - * ace/ACE.i: - * ace/ACE.cpp: - * ace/ARGV.cpp: - - Removed ACE's strecpy since all it did was call ACE_OS's strecpy. - - * ace/ace_wchar.h: (added) - - Moved all the unicode specific stuff here. - - * ace/SString.cpp: - * ace/SString.h: - * ace/SString.i: - - ACE_WString used to use ACE_USHORT16 instead of wchar_t. I - changed it so it does, since it will be more useful and intuitive - this way. - - * ace/Log_Record.cpp: - - We were using ACE_OS::fwrite to print the string. This didn't work - when the string was wchar_t, so this was changed to ACE_OS::fprintf - instead. - - * TODO: - * acconfig.h: - * configure.in: - * ace/ACE.cpp: - * ace/ACE.h: - * ace/ACE.i: - * ace/ARGV.cpp: - * ace/ARGV.h: - * ace/ARGV.i: - * ace/ATM_Addr.cpp: - * ace/ATM_Addr.h: - * ace/ATM_Connector.i: - * ace/ATM_QoS.cpp: - * ace/Acceptor.cpp: - * ace/Acceptor.h: - * ace/Activation_Queue.cpp: - * ace/Addr.cpp: - * ace/Arg_Shifter.cpp: - * ace/Arg_Shifter.h: - * ace/Asynch_Acceptor.cpp: - * ace/Asynch_IO.cpp: - * ace/Based_Pointer_T.cpp: - * ace/Basic_Types.h: - * ace/CORBA_Handler.cpp: - * ace/Cache_Map_Manager_T.cpp: - * ace/Cached_Connect_Strategy_T.cpp: - * ace/Caching_Strategies_T.i: - * ace/Capabilities.cpp: - * ace/Capabilities.h: - * ace/Capabilities.i: - * ace/Configuration.cpp: - * ace/Configuration.h: - * ace/Connector.cpp: - * ace/Connector.h: - * ace/Containers_T.cpp: - * ace/DEV_Addr.cpp: - * ace/DEV_Addr.h: - * ace/DEV_Addr.i: - * ace/DEV_Connector.i: - * ace/DLL.cpp: - * ace/DLL.h: - * ace/Dirent.h: - * ace/Dirent.i: - * ace/Dynamic_Service.cpp: - * ace/Dynamic_Service.h: - * ace/Env_Value_T.h: - * ace/Env_Value_T.i: - * ace/FIFO.cpp: - * ace/FIFO.h: - * ace/FIFO.i: - * ace/FIFO_Recv.cpp: - * ace/FIFO_Recv.h: - * ace/FIFO_Recv_Msg.cpp: - * ace/FIFO_Recv_Msg.h: - * ace/FIFO_Send.cpp: - * ace/FIFO_Send.h: - * ace/FIFO_Send_Msg.cpp: - * ace/FIFO_Send_Msg.h: - * ace/FILE_Addr.cpp: - * ace/FILE_Addr.h: - * ace/FILE_Addr.i: - * ace/FILE_Connector.cpp: - * ace/FILE_Connector.i: - * ace/Filecache.cpp: - * ace/Filecache.h: - * ace/Functor.h: - * ace/Functor.i: - * ace/Future.cpp: - * ace/Get_Opt.cpp: - * ace/Get_Opt.h: - * ace/Handle_Set.cpp: - * ace/Hash_Map_Manager_T.cpp: - * ace/Hash_Map_Manager_T.i: - * ace/High_Res_Timer.cpp: - * ace/High_Res_Timer.h: - * ace/INET_Addr.cpp: - * ace/INET_Addr.h: - * ace/INET_Addr.i: - * ace/IO_SAP.cpp: - * ace/IPC_SAP.cpp: - * ace/LSOCK.cpp: - * ace/LSOCK_CODgram.cpp: - * ace/LSOCK_Connector.cpp: - * ace/LSOCK_Dgram.cpp: - * ace/Local_Name_Space.cpp: - * ace/Local_Name_Space.h: - * ace/Local_Name_Space_T.cpp: - * ace/Local_Name_Space_T.h: - * ace/Local_Tokens.cpp: - * ace/Local_Tokens.h: - * ace/Local_Tokens.i: - * ace/Log_Msg.cpp: - * ace/Log_Msg.h: - * ace/Log_Record.cpp: - * ace/Log_Record.h: - * ace/Log_Record.i: - * ace/MEM_Acceptor.cpp: - * ace/MEM_Acceptor.h: - * ace/MEM_Acceptor.i: - * ace/MEM_Addr.cpp: - * ace/MEM_Addr.h: - * ace/MEM_Addr.i: - * ace/MEM_Connector.cpp: - * ace/MEM_SAP.cpp: - * ace/MEM_SAP.h: - * ace/Malloc.cpp: - * ace/Malloc_T.cpp: - * ace/Malloc_T.h: - * ace/Malloc_T.i: - * ace/Map_Manager.cpp: - * ace/Map_Manager.i: - * ace/Mem_Map.cpp: - * ace/Mem_Map.h: - * ace/Mem_Map.i: - * ace/Memory_Pool.cpp: - * ace/Memory_Pool.h: - * ace/Message_Block.cpp: - * ace/Message_Queue.cpp: - * ace/Message_Queue_T.cpp: - * ace/Module.cpp: - * ace/Module.h: - * ace/Module.i: - * ace/NT_Service.cpp: - * ace/NT_Service.h: - * ace/NT_Service.i: - * ace/Name_Proxy.cpp: - * ace/Name_Request_Reply.cpp: - * ace/Name_Space.cpp: - * ace/Name_Space.h: - * ace/Naming_Context.cpp: - * ace/Naming_Context.h: - * ace/OS.cpp: - * ace/OS.h: - * ace/OS.i: - * ace/Object_Manager.cpp: - * ace/Obstack.cpp: - * ace/Obstack.h: - * ace/POSIX_Asynch_IO.cpp: - * ace/Parse_Node.cpp: - * ace/Parse_Node.h: - * ace/Pipe.cpp: - * ace/Proactor.cpp: - * ace/Process.cpp: - * ace/Process.h: - * ace/Process.i: - * ace/Process_Manager.cpp: - * ace/QoS_Manager.cpp: - * ace/QoS_Session_Factory.cpp: - * ace/QoS_Session_Impl.cpp: - * ace/RB_Tree.cpp: - * ace/RB_Tree.i: - * ace/README: - * ace/Read_Buffer.cpp: - * ace/Registry.cpp: - * ace/Registry.h: - * ace/Registry_Name_Space.cpp: - * ace/Remote_Name_Space.cpp: - * ace/Remote_Name_Space.h: - * ace/Remote_Tokens.cpp: - * ace/Remote_Tokens.h: - * ace/Remote_Tokens.i: - * ace/SOCK.cpp: - * ace/SOCK_Acceptor.cpp: - * ace/SOCK_CODgram.cpp: - * ace/SOCK_Connector.cpp: - * ace/SOCK_Dgram.cpp: - * ace/SOCK_Dgram_Bcast.cpp: - * ace/SOCK_Dgram_Bcast.h: - * ace/SOCK_Dgram_Mcast.cpp: - * ace/SOCK_Dgram_Mcast.h: - * ace/SOCK_Dgram_Mcast_QoS.cpp: - * ace/SOCK_Dgram_Mcast_QoS.h: - * ace/SPIPE_Acceptor.cpp: - * ace/SPIPE_Addr.cpp: - * ace/SPIPE_Addr.h: - * ace/SPIPE_Addr.i: - * ace/SPIPE_Connector.cpp: - * ace/SString.cpp: - * ace/SString.h: - * ace/SString.i: - * ace/SV_Message_Queue.cpp: - * ace/SV_Semaphore_Complex.cpp: - * ace/SV_Semaphore_Simple.cpp: - * ace/SV_Shared_Memory.cpp: - * ace/Select_Reactor_Base.cpp: - * ace/Select_Reactor_T.cpp: - * ace/Service_Config.cpp: - * ace/Service_Config.h: - * ace/Service_Config.i: - * ace/Service_Manager.cpp: - * ace/Service_Manager.h: - * ace/Service_Object.cpp: - * ace/Service_Object.h: - * ace/Service_Object.i: - * ace/Service_Repository.cpp: - * ace/Service_Repository.h: - * ace/Service_Types.cpp: - * ace/Service_Types.h: - * ace/Service_Types.i: - * ace/Shared_Memory_MM.cpp: - * ace/Shared_Memory_MM.h: - * ace/Shared_Memory_MM.i: - * ace/Shared_Object.cpp: - * ace/Shared_Object.h: - * ace/Singleton.cpp: - * ace/Stats.cpp: - * ace/Stats.h: - * ace/Stats.i: - * ace/Strategies_T.cpp: - * ace/Strategies_T.i: - * ace/Stream.cpp: - * ace/Stream.h: - * ace/Stream_Modules.cpp: - * ace/Stream_Modules.h: - * ace/Svc_Conf.h: - * ace/Svc_Conf.l: - * ace/Svc_Conf.y: - * ace/Svc_Conf_l.cpp: - * ace/Svc_Conf_y.cpp: - * ace/Svc_Handler.cpp: - * ace/Svc_Handler.h: - * ace/Synch.cpp: - * ace/Synch.h: - * ace/Synch.i: - * ace/Synch_T.cpp: - * ace/Synch_T.h: - * ace/Synch_T.i: - * ace/System_Time.cpp: - * ace/System_Time.h: - * ace/TLI.cpp: - * ace/TLI_Acceptor.cpp: - * ace/TLI_Connector.i: - * ace/TP_Reactor.cpp: - * ace/TP_Reactor.i: - * ace/Task_T.cpp: - * ace/Task_T.h: - * ace/Template_Instantiations.cpp: - * ace/Thread_Manager.cpp: - * ace/Time_Request_Reply.cpp: - * ace/Timeprobe_T.cpp: - * ace/Timer_Hash_T.cpp: - * ace/Timer_Heap_T.cpp: - * ace/Timer_List_T.cpp: - * ace/Timer_Queue_Adapters.cpp: - * ace/Timer_Queue_T.cpp: - * ace/Timer_Wheel_T.cpp: - * ace/Token.cpp: - * ace/Token.h: - * ace/Token_Collection.cpp: - * ace/Token_Collection.h: - * ace/Token_Collection.i: - * ace/Token_Invariants.cpp: - * ace/Token_Invariants.h: - * ace/Token_Manager.cpp: - * ace/Token_Manager.h: - * ace/Token_Request_Reply.cpp: - * ace/Token_Request_Reply.h: - * ace/Token_Request_Reply.i: - * ace/Trace.cpp: - * ace/Trace.h: - * ace/UPIPE_Acceptor.cpp: - * ace/UPIPE_Connector.cpp: - * ace/UPIPE_Connector.i: - * ace/WFMO_Reactor.cpp: - * ace/WFMO_Reactor.i: - * ace/WIN32_Asynch_IO.cpp: - * ace/WIN32_Proactor.cpp: - * ace/XTI_ATM_Mcast.i: - * ace/config-WinCE.h: - * ace/config-all.h: - * ace/config-ghs-common.h: - * ace/config-tandem.h: - * ace/config-win32-borland.h: - * ace/config-win32-common.h: - * ace/config-win32-msvc.h: - * ace/config-win32-visualage.h: - * ace/CLASSIX/CLASSIX_CLD_Connector.cpp: - * ace/CLASSIX/CLASSIX_CO_Acceptor.cpp: - * ace/CLASSIX/CLASSIX_Port.cpp: - * ace/CLASSIX/CLASSIX_Port.h: - * ace/CLASSIX/CLASSIX_Select_Reactor.cpp: - * apps/Gateway/Gateway/Options.cpp: - * apps/JAWS/PROTOTYPE/JAWS/JAWS.h: - * bin/envinfo.cpp: - * docs/ACE-guidelines.html: - * docs/tutorials/Chap_3/mm.cpp: - * examples/Connection/blocking/SPIPE-acceptor.cpp: - * examples/Connection/blocking/SPIPE-acceptor.h: - * examples/Connection/blocking/SPIPE-connector.cpp: - * examples/Connection/blocking/SPIPE-connector.h: - * examples/Connection/non_blocking/test_lsock_acceptor.cpp: - * examples/Connection/non_blocking/test_lsock_connector.cpp: - * examples/IPC_SAP/ATM_SAP/CPP-client.cpp: - * examples/IPC_SAP/ATM_SAP/CPP-server.cpp: - * examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp: - * examples/IPC_SAP/SOCK_SAP/CPP-inserver-fancy.cpp: - * examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp: - * examples/IPC_SAP/UPIPE_SAP/ex3.cpp: - * examples/Naming/test_multiple_contexts.cpp: - * examples/Naming/test_non_existent.cpp: - * examples/Naming/test_writers.cpp: - * examples/Reactor/WFMO_Reactor/test_console_input.cpp: - * examples/Reactor/WFMO_Reactor/test_directory_changes.cpp: - * examples/Reactor/WFMO_Reactor/test_handle_close.cpp: - * examples/Reactor/WFMO_Reactor/test_registry_changes.cpp: - * examples/Registry/test_registry_iterator.cpp: - * examples/Service_Configurator/Misc/Timer_Service.cpp: - * examples/Service_Configurator/Misc/Timer_Service.h: - * examples/Service_Configurator/Misc/main.cpp: - * examples/Service_Configurator/Misc/main.dsp: - * examples/Web_Crawler/Options.cpp: - * examples/Web_Crawler/Options.h: - * examples/Web_Crawler/URL_Addr.cpp: - * examples/Web_Crawler/URL_Addr.h: - * netsvcs/clients/Logger/indirect_logging.cpp: - * netsvcs/clients/Naming/Client/main.cpp: - * netsvcs/lib/Logging_Strategy.cpp: - * netsvcs/lib/TS_Clerk_Handler.cpp: - * netsvcs/lib/TS_Clerk_Handler.h: - * performance-tests/Misc/test_naming.cpp: - * performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp: - * performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp: - * performance-tests/TCP/tcp_test.cpp: - * tests/ACE_Init_Test.dsp: - * tests/ARGV_Test.cpp: - * tests/Atomic_Op_Test.cpp: - * tests/Auto_IncDec_Test.cpp: - * tests/Barrier_Test.cpp: - * tests/Basic_Types_Test.cpp: - * tests/Buffer_Stream_Test.cpp: - * tests/CDR_File_Test.cpp: - * tests/CDR_Test.cpp: - * tests/Cache_Map_Manager_Test.cpp: - * tests/Cached_Accept_Conn_Test.cpp: - * tests/Cached_Conn_Test.cpp: - * tests/Capabilities_Test.cpp: - * tests/Collection_Test.cpp: - * tests/Conn_Test.cpp: - * tests/DLL_Test.cpp: - * tests/DLL_Test.h: - * tests/DLList_Test.cpp: - * tests/Dynamic_Priority_Test.cpp: - * tests/Enum_Interfaces_Test.cpp: - * tests/Env_Value_Test.cpp: - * tests/FlReactor_Test.cpp: - * tests/Future_Set_Test.cpp: - * tests/Future_Test.cpp: - * tests/Handle_Set_Test.cpp: - * tests/Hash_Map_Bucket_Iterator_Test.cpp: - * tests/Hash_Map_Manager_Test.cpp: - * tests/High_Res_Timer_Test.cpp: - * tests/IOStream_Test.cpp: - * tests/Lazy_Map_Manager_Test.cpp: - * tests/Log_Msg_Test.cpp: - * tests/MM_Shared_Memory_Test.cpp: - * tests/MT_Reactor_Timer_Test.cpp: - * tests/MT_SOCK_Test.cpp: - * tests/Malloc_Test.cpp: - * tests/Map_Manager_Test.cpp: - * tests/Map_Test.cpp: - * tests/Mem_Map_Test.cpp: - * tests/Message_Block_Test.cpp: - * tests/Message_Queue_Notifications_Test.cpp: - * tests/Message_Queue_Test.cpp: - * tests/Naming_Test.cpp: - * tests/New_Fail_Test.cpp: - * tests/Notify_Performance_Test.cpp: - * tests/Object_Manager_Test.cpp: - * tests/OrdMultiSet_Test.cpp: - * tests/Pipe_Test.cpp: - * tests/Priority_Buffer_Test.cpp: - * tests/Priority_Reactor_Test.cpp: - * tests/Priority_Task_Test.cpp: - * tests/Process_Manager_Test.cpp: - * tests/Process_Mutex_Test.cpp: - * tests/Process_Strategy_Test.cpp: - * tests/Process_Strategy_Test.h: - * tests/RB_Tree_Test.cpp: - * tests/Reactor_Exceptions_Test.cpp: - * tests/Reactor_Notify_Test.cpp: - * tests/Reactor_Performance_Test.cpp: - * tests/Reactor_Timer_Test.cpp: - * tests/Reactors_Test.cpp: - * tests/Reader_Writer_Test.cpp: - * tests/Recursive_Mutex_Test.cpp: - * tests/Reverse_Lock_Test.cpp: - * tests/SOCK_Connector_Test.cpp: - * tests/SOCK_Send_Recv_Test.cpp: - * tests/SOCK_Test.cpp: - * tests/SPIPE_Test.cpp: - * tests/SString_Test.cpp: - * tests/SV_Shared_Memory_Test.cpp: - * tests/Semaphore_Test.cpp: - * tests/Service_Config_Test.cpp: - * tests/Signal_Test.cpp: - * tests/Sigset_Ops_Test.cpp: - * tests/Simple_Message_Block_Test.cpp: - * tests/Svc_Handler_Test.cpp: - * tests/TSS_Test.cpp: - * tests/Task_Test.cpp: - * tests/Thread_Manager_Test.cpp: - * tests/Thread_Mutex_Test.cpp: - * tests/Thread_Pool_Reactor_Test.cpp: - * tests/Thread_Pool_Test.cpp: - * tests/Time_Service_Test.cpp: - * tests/Time_Value_Test.cpp: - * tests/Timeprobe_Test.cpp: - * tests/Timer_Queue_Test.cpp: - * tests/TkReactor_Test.cpp: - * tests/Tokens_Test.cpp: - * tests/UPIPE_SAP_Test.cpp: - * tests/Upgradable_RW_Test.cpp: - * tests/XtReactor_Test.cpp: - * tests/test_config.h: - * websvcs/lib/URL_Addr.cpp: - * websvcs/lib/URL_Addr.h: - * websvcs/lib/URL_Addr.i: - * websvcs/tests/Test_URL_Addr.cpp: - - Made all the appropriate changes to support the new wide char - policy. Most changes were macro changes, changing ASYS_* to - ACE_*, changing char's to ACE_TCHAR's, adding in ACE_TEXT ()'s - when necessary, etc. - -Sat Apr 22 18:41:06 2000 Vishal Kachroo - - * ace/SOCK_Dgram_Mcast.h: - * ace/SOCK_Dgram_Mcast.cpp: - * ace/SOCK_Dgram_Mcast.i: Removed the QoS enabled overloaded - methods. - - * ace/SOCK_Dgram_Mcast_QoS.h: - * ace/SOCK_Dgram_Mcast_QoS.cpp: - * ace/SOCK_Dgram_Mcast_QoS.i: Added this new class that derives from - ACE_SOCK_Dgram_Mcast and handles all the QoS functionality that - was being done by the latter. - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: Added the ace/SOCK_Dgram_Mcast_QoS.{cpp,i,h} - -Fri Apr 21 10:23:19 2000 Darrell Brunsch - - * bin/msvc_auto_compile.pl: - - Removed all chdir's and fixed a bug with specifying multiple -dir's. - -Fri Apr 21 09:13:20 2000 Carlos O'Ryan - - * websvcs/lib/URL_Addr.cpp: - The URL schemes are supposed to be case insensitive, thanks to - Paul Carreiro for pointing this out. - -Thu Apr 20 21:05:42 2000 Darrell Brunsch - - * bin/msvc_auto_compile.pl: - - Added a -core for only the core libraries. Also fixed a problem - with specifying incorrect directories and the -DLL/-Debug/etc. - macros. - -Thu Apr 20 18:11:48 2000 Darrell Brunsch - - * examples/DLL/Main.dsp: - * examples/DLL/Newsweek.dsp: - * examples/DLL/Today.dsp - * examples/Configuration/Configuration.dsw: - * examples/Bounded_Packet_Relay/Bounded_Packet_Relay.dsp: - * examples/Configuration/Test.dsp: - * examples/IPC_SAP/ATM_SAP/ATM_SAP.dsw: - * examples/IPC_SAP/ATM_SAP/CPP_client.dsp: - * examples/IPC_SAP/ATM_SAP/CPP_server.dsp: - * examples/IPC_SAP/SOCK_SAP/CPP_memclient.dsp: - * examples/Mem_Map/file-reverse/file_reverse.dsp: - * examples/NT_Service/NT_Service.dsp: - * examples/NT_Service/NT_Service.dsw: - * examples/OS/Process/Process.dsp: - * examples/OS/Process/imore.dsp: - * examples/QOS/client.dsp: - * examples/QOS/server.dsp: - * examples/Reactor/Misc/demuxing.dsp: - * examples/Reactor/Multicast/client.dsp: - * examples/Reactor/Multicast/server.dsp: - * examples/Service_Configurator/Misc/Timer.dsp: - * examples/Service_Configurator/Misc/main.dsp: - * examples/Timer_Queue/Async_Timer_Queue_Test.dsp: - * examples/Timer_Queue/Reactor_Timer_Queue_Test.dsp: - * examples/Timer_Queue/Thread_Timer_Queue_Test.dsp: - * examples/Timer_Queue/Timer_Queue.dsw: - * examples/Web_Crawler/Web_Crawler.dsp: - - Fixed miscellaneous problems with these projects and workspaces. - Some projects were missing from workspaces or listed incorrectly. - Many project didn't have the correct include paths or definitions. - - * examples/Reactor/Proactor/post_completion.dsp: (removed) - - There was already a post_completions.dsp that was being used. - - * examples/OS/Process/imore.cpp: - * examples/OS/Process/process.cpp: - - Changed the type of the variables used with Process::wait from - int to ACE_exitcode. - - * examples/Reactor/WFMO_Reactor/test_abandoned.cpp: - * examples/Reactor/WFMO_Reactor/test_apc.cpp: - - Missing parentheses. - - * Synch-Benchmarks/Synch_Lib/Synch_Lib.dsp: - - Changed the name of the project so win32_auto_compile.pl works - with it properly. - - * bin/msvc_auto_compile.pl: (added) - - This is a new script for autocompiling with MSVC 6. - Eventually this should replace auto_compile_win32.pl. It still - needs more directories added to it and tested before we put it - into production - - * bin/vc_filter.pl: - - Updated to properly color code output from msvc_auto_compile.pl - also. - -Thu Apr 20 09:50:49 2000 Carlos O'Ryan - - * ace/RB_Tree.h: - * ace/RB_Tree.i: - Fixed implementation of the end() method. It should return a - singular iterator that is different from all valid iterator, not - an iterator pointing to the last element in the collection. - -Thu Apr 20 08:53:31 2000 Carlos O'Ryan - - * ace/CDR_Stream.i: - Fixed problem in the align_write_ptr() method. It was optimized - for the case where there was enough room in the current buffer, - but the optimization broke with a previous fix from Feb 29. - -Thu Apr 20 08:40:00 2000 Chris Gill - - * examples/Bounded_Packet_Relay/BPR_Drivers_T.h, - examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp: - Fixed warnings from g++ - -Wed Apr 19 21:53:52 2000 Douglas C. Schmidt - - * examples/Bounded_Packet_Relay: Added some missing template - instantiations and other assorted problems. Thanks to Aoxiang - Xu for reporting these. - -Wed Apr 19 07:04:13 2000 Douglas C. Schmidt - - * ace/Containers_T.cpp (copy_nodes): insert_head() should have - been insert_tail(). Thanks to Umar Syyid for clarifying this. - Also, added some comments to explain what's going on in - insert_tail() since the code was somewhat non-intuitive ;-). - -Wed Apr 19 15:00:44 2000 Carlos O'Ryan - - * apps/Makefile: - * apps/drwho/Makefile: - * performance-tests/Makefile: - * performance-tests/Server_Concurrency/Leader_Follower/Makefile: - * performance-tests/Server_Concurrency/Queue_Based_Workers/Makefile: - More Makefiles that were not in the default compilation path, - added them and update dependencies. - - * bin/Makefile: - * examples/Bounded_Packet_Relay/Makefile: - * examples/QOS/Makefile: - * performance-tests/RPC/Makefile: - * performance-tests/Synch-Benchmarks/Base_Test/Makefile: - * performance-tests/Synch-Benchmarks/Perf_Test/Makefile: - * performance-tests/Synch-Benchmarks/Synch_Lib/Makefile: - * ASNMP/asnmp/Makefile: - * ASNMP/examples/get/Makefile: - * ASNMP/examples/next/Makefile: - * ASNMP/examples/set/Makefile: - * ASNMP/examples/trap/Makefile: - * ASNMP/examples/walk/Makefile: - * ASNMP/tests/Makefile: - Just updated dependencies. More fixes are needed to put them in - the normal compilation path. - - * performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp: - * performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp: - They wouldn't compile on platforms that lack context switch - counters in rusage. Conditionally compile that code to avoid - the problem. - -Wed Apr 19 14:09:29 2000 Darrell Brunsch - - * etc/Svc_Conf_l.cpp.diff: Fixed the diff so it generates - the correct Svc_Conf_l.cpp. - -Wed Apr 19 12:48:21 2000 Balachandran Natarajan - - * ace/ACE.cpp: Added a missing pointer in the signature of - ACE::t_rcv_n_i (). - -Wed Apr 19 10:11:23 2000 Darrell Brunsch - - * tests/Atomic_Op_Test.dsp: - * tests/Auto_IncDec_Test.dsp: - * tests/Barrier_Test.dsp: - * tests/Basic_Types_Test.dsp: - * tests/Buffer_Stream_Test.dsp: - * tests/CDR_File_Test.dsp: - * tests/CDR_Test.dsp: - * tests/Cache_Map_Manager_Test.dsp: - * tests/Cached_Accept_Conn_Test.dsp: - * tests/Cached_Conn_Test.dsp: - * tests/Capabilities_Test.dsp: - * tests/Collection_Test.dsp: - * tests/Conn_Test.dsp: - * tests/DLList_Test.dsp: - * tests/Dynamic_Priority_Test.dsp: - * tests/Enum_Interfaces_Test.dsp: - * tests/Env_Value_Test.dsp: - * tests/Future_Set_Test.dsp: - * tests/Future_Test.dsp: - * tests/Handle_Set_Test.dsp: - * tests/Hash_Map_Bucket_Iterator_Test.dsp: - * tests/Hash_Map_Manager_Test.dsp: - * tests/High_Res_Timer_Test.dsp: - * tests/IOStream_Test.dsp: - * tests/Lazy_Map_Manager_Test.dsp: - * tests/MM_Shared_Memory_Test.dsp: - * tests/MT_Reactor_Timer_Test.dsp: - * tests/MT_SOCK_Test.dsp: - * tests/Malloc_Test.dsp: - * tests/Map_Manager_Test.dsp: - * tests/Map_Test.dsp: - * tests/Mem_Map_Test.dsp: - * tests/Message_Block_Test.dsp: - * tests/Message_Queue_Notifications_Test.dsp: - * tests/Message_Queue_Test.dsp: - * tests/Naming_Test.dsp: - * tests/New_Fail_Test.dsp: - * tests/Notify_Performance_Test.dsp: - * tests/Object_Manager_Test.dsp: - * tests/OrdMultiSet_Test.dsp: - * tests/Pipe_Test.dsp: - * tests/Priority_Buffer_Test.dsp: - * tests/Priority_Reactor_Test.dsp: - * tests/Priority_Task_Test.dsp: - * tests/Process_Manager_Test.dsp: - * tests/Process_Mutex_Test.dsp: - * tests/Process_Strategy_Test.dsp: - * tests/RB_Tree_Test.dsp: - * tests/Reactor_Exceptions_Test.dsp: - * tests/Reactor_Notify_Test.dsp: - * tests/Reactor_Performance_Test.dsp: - * tests/Reactor_Timer_Test.dsp: - * tests/Reactors_Test.dsp: - * tests/Reader_Writer_Test.dsp: - * tests/Recursive_Mutex_Test.dsp: - * tests/Reverse_Lock_Test.dsp: - * tests/SOCK_Connector_Test.dsp: - * tests/SOCK_Send_Recv_Test.dsp: - * tests/SOCK_Test.dsp: - * tests/SPIPE_Test.dsp: - * tests/SString_Test.dsp: - * tests/SV_Shared_Memory_Test.dsp: - * tests/Semaphore_Test.dsp: - * tests/Service_Config_Test.dsp: - * tests/Sigset_Ops_Test.dsp: - * tests/Simple_Message_Block_Test.dsp: - * tests/Svc_Handler_Test.dsp: - * tests/TSS_Test.dsp: - * tests/Task_Test.dsp: - * tests/Thread_Manager_Test.dsp: - * tests/Thread_Mutex_Test.dsp: - * tests/Thread_Pool_Reactor_Test.dsp: - * tests/Thread_Pool_Test.dsp: - * tests/Time_Service_Test.dsp: - * tests/Time_Value_Test.dsp: - * tests/Timeprobe_Test.dsp: - * tests/Timer_Queue_Test.dsp: - * tests/Tokens_Test.dsp: - * tests/UPIPE_SAP_Test.dsp: - * tests/Upgradable_RW_Test.dsp: - * tests/pharlap/Atomic_Op_Test.dsp: (added) - * tests/pharlap/Auto_IncDec_Test.dsp: (added) - * tests/pharlap/Barrier_Test.dsp: (added) - * tests/pharlap/Basic_Types_Test.dsp: (added) - * tests/pharlap/Buffer_Stream_Test.dsp: (added) - * tests/pharlap/CDR_File_Test.dsp: (added) - * tests/pharlap/CDR_Test.dsp: (added) - * tests/pharlap/Cache_Map_Manager_Test.dsp: (added) - * tests/pharlap/Cached_Accept_Conn_Test.dsp: (added) - * tests/pharlap/Cached_Conn_Test.dsp: (added) - * tests/pharlap/Capabilities_Test.dsp: (added) - * tests/pharlap/Collection_Test.dsp: (added) - * tests/pharlap/Conn_Test.dsp: (added) - * tests/pharlap/DLList_Test.dsp: (added) - * tests/pharlap/Dynamic_Priority_Test.dsp: (added) - * tests/pharlap/Enum_Interfaces_Test.dsp: (added) - * tests/pharlap/Env_Value_Test.dsp: (added) - * tests/pharlap/Future_Set_Test.dsp: (added) - * tests/pharlap/Future_Test.dsp: (added) - * tests/pharlap/Handle_Set_Test.dsp: (added) - * tests/pharlap/Hash_Map_Bucket_Iterator_Test.dsp: (added) - * tests/pharlap/Hash_Map_Manager_Test.dsp: (added) - * tests/pharlap/High_Res_Timer_Test.dsp: (added) - * tests/pharlap/IOStream_Test.dsp: (added) - * tests/pharlap/Lazy_Map_Manager_Test.dsp: (added) - * tests/pharlap/MM_Shared_Memory_Test.dsp: (added) - * tests/pharlap/MT_Reactor_Timer_Test.dsp: (added) - * tests/pharlap/MT_SOCK_Test.dsp: (added) - * tests/pharlap/Malloc_Test.dsp: (added) - * tests/pharlap/Map_Manager_Test.dsp: (added) - * tests/pharlap/Map_Test.dsp: (added) - * tests/pharlap/Mem_Map_Test.dsp: (added) - * tests/pharlap/Message_Block_Test.dsp: (added) - * tests/pharlap/Message_Queue_Notifications_Test.dsp: (added) - * tests/pharlap/Message_Queue_Test.dsp: (added) - * tests/pharlap/Naming_Test.dsp: (added) - * tests/pharlap/New_Fail_Test.dsp: (added) - * tests/pharlap/Notify_Performance_Test.dsp: (added) - * tests/pharlap/Object_Manager_Test.dsp: (added) - * tests/pharlap/OrdMultiSet_Test.dsp: (added) - * tests/pharlap/Pipe_Test.dsp: (added) - * tests/pharlap/Priority_Buffer_Test.dsp: (added) - * tests/pharlap/Priority_Reactor_Test.dsp: (added) - * tests/pharlap/Priority_Task_Test.dsp: (added) - * tests/pharlap/Process_Manager_Test.dsp: (added) - * tests/pharlap/Process_Mutex_Test.dsp: (added) - * tests/pharlap/Process_Strategy_Test.dsp: (added) - * tests/pharlap/RB_Tree_Test.dsp: (added) - * tests/pharlap/Reactor_Exceptions_Test.dsp: (added) - * tests/pharlap/Reactor_Notify_Test.dsp: (added) - * tests/pharlap/Reactor_Performance_Test.dsp: (added) - * tests/pharlap/Reactor_Timer_Test.dsp: (added) - * tests/pharlap/Reactors_Test.dsp: (added) - * tests/pharlap/Reader_Writer_Test.dsp: (added) - * tests/pharlap/Recursive_Mutex_Test.dsp: (added) - * tests/pharlap/Reverse_Lock_Test.dsp: (added) - * tests/pharlap/SOCK_Connector_Test.dsp: (added) - * tests/pharlap/SOCK_Send_Recv_Test.dsp: (added) - * tests/pharlap/SOCK_Test.dsp: (added) - * tests/pharlap/SPIPE_Test.dsp: (added) - * tests/pharlap/SString_Test.dsp: (added) - * tests/pharlap/SV_Shared_Memory_Test.dsp: (added) - * tests/pharlap/Semaphore_Test.dsp: (added) - * tests/pharlap/Service_Config_Test.dsp: (added) - * tests/pharlap/Sigset_Ops_Test.dsp: (added) - * tests/pharlap/Simple_Message_Block_Test.dsp: (added) - * tests/pharlap/Svc_Handler_Test.dsp: (added) - * tests/pharlap/TSS_Test.dsp: (added) - * tests/pharlap/Task_Test.dsp: (added) - * tests/pharlap/Thread_Manager_Test.dsp: (added) - * tests/pharlap/Thread_Mutex_Test.dsp: (added) - * tests/pharlap/Thread_Pool_Reactor_Test.dsp: (added) - * tests/pharlap/Thread_Pool_Test.dsp: (added) - * tests/pharlap/Time_Service_Test.dsp: (added) - * tests/pharlap/Time_Value_Test.dsp: (added) - * tests/pharlap/Timeprobe_Test.dsp: (added) - * tests/pharlap/Timer_Queue_Test.dsp: (added) - * tests/pharlap/Tokens_Test.dsp: (added) - * tests/pharlap/UPIPE_SAP_Test.dsp: (added) - * tests/pharlap/Upgradable_RW_Test.dsp: (added) - * tests/pharlap/pharlap_tests.dsw: (added) - - Moved all the pharlap configurations to their own dsp files in - their own subdirectory. This was done so those of us who don't - have pharlap can load tests.dsw and do a select all in the Build - All window and only get the relavant builds. - - * tests/run_pharlap_tests.bat: (removed) - * tests/pharlap/run_pharlap_tests.bat: (added) - - Moved this file to the pharlap directory also. - -Wed Apr 19 10:03:10 2000 Carlos O'Ryan - - * ace/SOCK_Stream.i: - The new flag was present but not used in several - methods, just forward them to the ACE::xxx() operation. - -Wed Apr 19 08:18:30 2000 Carlos O'Ryan - - * */Makefile: - Updated all the dependencies - -Wed Apr 19 09:44:14 2000 Jeff Parsons - - * ace/Log_Msg.cpp: - Changed the signature of a (WIN32-specific) call to - send_n, to resolve a function overload ambiguity on NT. - -Wed Apr 19 00:00:29 2000 Irfan Pyarali - - * ace: There are two general use cases of the _n() methods: - - (1) The method keeps looping, until all the data has been - transmitted, or until timeout occurs, or until the handle is - closed. This use case occurs when one does not know how much - data is coming across in the case of a recv(), or one wants to - know exactly how much data was sent in the case of a send(). - And one don't want to treat a premature eof as an error but - wants to know the exact number of bytes that have been - transferred so far. - - (2) In other cases when one knows exactly how much data is - coming across in the case of recv(), or how much data needs to - be transmitted in the case of a send(). Premature closing of the - handle is usually an error. - - By adding an additional parameter to all the _n() - methods, the above two use cases can be distinguished. The - following files were modified: - - - OS - - ACE - - SOCK_Stream - - TLI_Stream - - The other IO classes such as FIFO, MEM_IO, PIPE, etc., should - also include this change. However, they should first get fixed - with respect to timeouts. If comes before - timeouts, ordering of the parameters will get messed up. - - Thanks to Steffen Winther Sorensen for - reporting this second use of the _n() methods. - - * ace/OS.h: t_snd() interface was fixed. The buffer parameter - should be const. - - * ace/ACE: Added support for TLI I/O functions to the ACE class. - -Tue Apr 18 19:08:37 2000 Darrell Brunsch - - * ace/config-all.h: (added) - * ace/inc_user_config.h: (removed) - * ace/Codeset_IBM1047.h: - * ace/NT_Service.h: - * ace/config-win32-common.h: - * ace/OS.h: - - Started moving several of the macros from OS.h to config-all.h. - The plan is to eventually split up OS.h, and config-all is a - place where the macros (which are not specific to any part of - ACE_OS) can go. config-all.h also ate inc_user_config.h. - - * ASNMP/agent/main.cpp: - * ace/iosfwd.h: - * ace/streams.h: - * apps/JAWS/PROTOTYPE/JAWS/Assoc_Array.cpp: - * tests/OrdMultiSet_Test.cpp: - * tests/Time_Value_Test.cpp: - * tests/test_config.h: - - Since inc_user_config.h was eaten, needed to change includes of - it to config-all.h. - - * bin/generate_export_file.pl: (added) - * bin/GenExportH.BAT: (removed) - - Replaced the batch file with a perl file so - - people can generate on other platforms - - it can generate Word_export and WORD_BUILD_DLL - (the batch file couldn't change the case of the key) - - * ace/ACE_export.h: (added) - * ace/svc_export.h: (added) - - Took the existing ACE_Export and ACE_Svc_Export macro and - moved them to separate files. Also tested out the new - generate_export_file.pl. - - * ace/ACE.cpp: - * ace/ARGV.cpp: - * ace/ATM_Acceptor.cpp: - * ace/ATM_Addr.cpp: - * ace/ATM_Connector.cpp: - * ace/ATM_Params.cpp: - * ace/ATM_QoS.cpp: - * ace/ATM_Stream.cpp: - * ace/Acceptor.cpp: - * ace/Activation_Queue.cpp: - * ace/Active_Map_Manager.cpp: - * ace/Addr.cpp: - * ace/Arg_Shifter.cpp: - * ace/Asynch_Acceptor.cpp: - * ace/Asynch_IO.cpp: - * ace/Asynch_IO_Impl.cpp: - * ace/Auto_IncDec_T.cpp: - * ace/Auto_Ptr.cpp: - * ace/Based_Pointer_Repository.cpp: - * ace/Based_Pointer_T.cpp: - * ace/Basic_Types.cpp: - * ace/CDR_Stream.cpp: - * ace/CORBA_Handler.cpp: - * ace/CORBA_Ref.cpp: - * ace/Cache_Map_Manager_T.cpp: - * ace/Cached_Connect_Strategy_T.cpp: - * ace/Capabilities.cpp: - * ace/Cleanup_Strategies_T.cpp: - * ace/Configuration.cpp: - * ace/Connector.cpp: - * ace/Containers.cpp: - * ace/Containers_T.cpp: - * ace/DEV.cpp: - * ace/DEV_Addr.cpp: - * ace/DEV_Connector.cpp: - * ace/DEV_IO.cpp: - * ace/DLL.cpp: - * ace/Date_Time.cpp: - * ace/Dirent.cpp: - * ace/Dump.cpp: - * ace/Dynamic.cpp: - * ace/Dynamic_Service.cpp: - * ace/Event_Handler.cpp: - * ace/Event_Handler_T.cpp: - * ace/FIFO.cpp: - * ace/FIFO_Recv.cpp: - * ace/FIFO_Recv_Msg.cpp: - * ace/FIFO_Send.cpp: - * ace/FIFO_Send_Msg.cpp: - * ace/FILE.cpp: - * ace/FILE_Addr.cpp: - * ace/FILE_Connector.cpp: - * ace/FILE_IO.cpp: - * ace/Filecache.cpp: - * ace/FlReactor.cpp: - * ace/Functor.cpp: - * ace/Functor_T.cpp: - * ace/Future.cpp: - * ace/Future_Set.cpp: - * ace/Get_Opt.cpp: - * ace/Handle_Set.cpp: - * ace/Hash_Cache_Map_Manager_T.cpp: - * ace/Hash_Map_Manager.cpp: - * ace/High_Res_Timer.cpp: - * ace/INET_Addr.cpp: - * ace/IOStream.cpp: - * ace/IOStream_T.cpp: - * ace/IO_SAP.cpp: - * ace/IPC_SAP.cpp: - * ace/LSOCK.cpp: - * ace/LSOCK_Acceptor.cpp: - * ace/LSOCK_CODgram.cpp: - * ace/LSOCK_Connector.cpp: - * ace/LSOCK_Dgram.cpp: - * ace/LSOCK_Stream.cpp: - * ace/Local_Name_Space.cpp: - * ace/Local_Name_Space_T.cpp: - * ace/Local_Tokens.cpp: - * ace/Log_Msg.cpp: - * ace/Log_Record.cpp: - * ace/MEM_Acceptor.cpp: - * ace/MEM_Addr.cpp: - * ace/MEM_Connector.cpp: - * ace/MEM_IO.cpp: - * ace/MEM_SAP.cpp: - * ace/MEM_Stream.cpp: - * ace/Malloc.cpp: - * ace/Malloc_T.cpp: - * ace/Managed_Object.cpp: - * ace/Map.cpp: - * ace/Map_Manager.cpp: - * ace/Mem_Map.cpp: - * ace/Memory_Pool.cpp: - * ace/Message_Block.cpp: - * ace/Message_Block_T.cpp: - * ace/Message_Queue.cpp: - * ace/Message_Queue_T.cpp: - * ace/Method_Request.cpp: - * ace/Module.cpp: - * ace/Msg_WFMO_Reactor.cpp: - * ace/Multiplexor.cpp: - * ace/NT_Service.cpp: - * ace/Name_Proxy.cpp: - * ace/Name_Request_Reply.cpp: - * ace/Name_Space.cpp: - * ace/Naming_Context.cpp: - * ace/OS.cpp: - * ace/Object_Manager.cpp: - * ace/Obstack.cpp: - * ace/POSIX_Proactor.cpp: - * ace/Pair.cpp: - * ace/Parse_Node.cpp: - * ace/Pipe.cpp: - * ace/Priority_Reactor.cpp: - * ace/Proactor.cpp: - * ace/Process.cpp: - * ace/Process_Manager.cpp: - * ace/Profile_Timer.cpp: - * ace/QoS_Manager.cpp: - * ace/QoS_Session_Factory.cpp: - * ace/QoS_Session_Impl.cpp: - * ace/Reactor.cpp: - * ace/Read_Buffer.cpp: - * ace/Registry.cpp: - * ace/Registry_Name_Space.cpp: - * ace/Remote_Name_Space.cpp: - * ace/Remote_Tokens.cpp: - * ace/SOCK.cpp: - * ace/SOCK_Acceptor.cpp: - * ace/SOCK_CODgram.cpp: - * ace/SOCK_Connector.cpp: - * ace/SOCK_Dgram.cpp: - * ace/SOCK_Dgram_Bcast.cpp: - * ace/SOCK_Dgram_Mcast.cpp: - * ace/SOCK_IO.cpp: - * ace/SOCK_Stream.cpp: - * ace/SPIPE.cpp: - * ace/SPIPE_Acceptor.cpp: - * ace/SPIPE_Addr.cpp: - * ace/SPIPE_Connector.cpp: - * ace/SPIPE_Stream.cpp: - * ace/SString.cpp: - * ace/SV_Message.cpp: - * ace/SV_Message_Queue.cpp: - * ace/SV_Semaphore_Complex.cpp: - * ace/SV_Semaphore_Simple.cpp: - * ace/SV_Shared_Memory.cpp: - * ace/Sched_Params.cpp: - * ace/Select_Reactor.cpp: - * ace/Select_Reactor_Base.cpp: - * ace/Select_Reactor_T.cpp: - * ace/Service_Config.cpp: - * ace/Service_Manager.cpp: - * ace/Service_Object.cpp: - * ace/Service_Repository.cpp: - * ace/Service_Types.cpp: - * ace/Shared_Memory.cpp: - * ace/Shared_Memory_MM.cpp: - * ace/Shared_Memory_SV.cpp: - * ace/Shared_Object.cpp: - * ace/Signal.cpp: - * ace/Singleton.cpp: - * ace/Stats.cpp: - * ace/Strategies.cpp: - * ace/Strategies_T.cpp: - * ace/Stream.cpp: - * ace/Stream_Modules.cpp: - * ace/Svc_Conf.y: - * ace/Svc_Conf_l.cpp: - * ace/Svc_Conf_y.cpp: - * ace/Svc_Handler.cpp: - * ace/Synch.cpp: - * ace/Synch_Options.cpp: - * ace/Synch_T.cpp: - * ace/System_Time.cpp: - * ace/TLI.cpp: - * ace/TLI_Acceptor.cpp: - * ace/TLI_Connector.cpp: - * ace/TLI_Stream.cpp: - * ace/TP_Reactor.cpp: - * ace/TTY_IO.cpp: - * ace/Task.cpp: - * ace/Task_T.cpp: - * ace/Thread.cpp: - * ace/Thread_Manager.cpp: - * ace/Time_Request_Reply.cpp: - * ace/Timeprobe.cpp: - * ace/Timer_Hash.cpp: - * ace/Timer_Hash_T.cpp: - * ace/Timer_Heap.cpp: - * ace/Timer_Heap_T.cpp: - * ace/Timer_List.cpp: - * ace/Timer_List_T.cpp: - * ace/Timer_Queue.cpp: - * ace/Timer_Queue_Adapters.cpp: - * ace/Timer_Queue_T.cpp: - * ace/Timer_Wheel.cpp: - * ace/Timer_Wheel_T.cpp: - * ace/TkReactor.cpp: - * ace/Token.cpp: - * ace/Token_Collection.cpp: - * ace/Token_Invariants.cpp: - * ace/Token_Manager.cpp: - * ace/Token_Request_Reply.cpp: - * ace/Trace.cpp: - * ace/Typed_SV_Message.cpp: - * ace/Typed_SV_Message_Queue.cpp: - * ace/UNIX_Addr.cpp: - * ace/UPIPE_Acceptor.cpp: - * ace/UPIPE_Connector.cpp: - * ace/UPIPE_Stream.cpp: - * ace/WFMO_Reactor.cpp: - * ace/WIN32_Asynch_IO.cpp: - * ace/WIN32_Proactor.cpp: - * ace/XTI_ATM_Mcast.cpp: - * ace/XtReactor.cpp: - * include/makeinclude/ace_flags.bor: - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: - - The definition of ACE_BUILD_DLL was moved from the .cpp files - to the project files - so it is now handled like most of the - other libraries in ACE and TAO. - -Tue Apr 18 21:32:21 2000 Douglas C. Schmidt - - * ace/OS.i (sema_init): Fixed another problem that required - a cast to ACE_mutexattr_t *. Thanks to Priyanka for - reporting this. - -Tue Apr 18 19:39:41 2000 Douglas C. Schmidt - - * ace/Synch.cpp, - * ace/OS.cpp: Added a cast to ACE_mutexattr_t *. Thanks to - Darrell for pointing this out. - -Tue Apr 18 15:18:53 2000 Douglas C. Schmidt - - * ace/OS.h, - * ace/OS.i, - * ace/Synch.h, - * ace/Synch.cpp: Updated the ACE_OS::*mutex_init() methods (and the - corresponding ACE_Thread_Mutex, ACE_Mutex, and - ACE_Recursive_Thread_Mutex classes) so that they now take an - optional ACE_mutexattr_t * rather than just a void *. This is - nice because it makes it possible to pass in special attributes, - such as the mutex prioceiling attribute, to the underlying - pthreads mutex (assuming we're running on pthreads, of course). - Thanks to lafortg@res.raytheon.com for motivating this. - - * ace/Containers_T.cpp (copy_nodes): Added a call to the - allocator->malloc() rather than new. Thanks to Umar Syyid - for reporting this. - -Tue Apr 18 14:06:32 2000 Jeff Parsons - - * ace/CDR_Stream.cpp: - Patch to ACE_CDR::consolidate() sent in by Carlos, that - fixes a bug reported by Harald Finster , - and an added check for 0 value of the 'length' arg in - read_array() and write_array(), that fixes [Bug 540], - reported by Mathew Samuel . - -Tue Apr 18 11:47:57 2000 Ossama Othman - - * ace/SOCK_Connector.cpp: - - Removed inclusion of `ace/Handle_Set.h'. The ACE_SOCK_Connector - doesn't directly use an ACE_Handle_Set. - - * ace/Makefile: - - Updated dependencies. - -Tue Apr 18 08:54:04 2000 Darrell Brunsch - - * bin/vc_filter.pl: - - Brand spankin' new filter script for Win32 auto build results. - -Sun Apr 16 22:24:34 2000 Douglas C. Schmidt - - * ACE-INSTALL.html: Updated the link for GNU make to be more - specific. Thanks to Xiaojun Wu for - reporting this. BTW, Xiaojun was the 900th contributor to - ACE+TAO, so he gets a free copy of ACE+TAO! - -Mon Apr 17 20:10:18 2000 Vishal - - * ACE version 5.1.1 released. - -Mon Apr 17 16:33:17 2000 Ossama Othman - - * acconfig.h (ACE_LACKS_ACE_OTHER, ACE_LACKS_ACE_SVCCONF, - ACE_LACKS_ACE_TOKEN): - - Added support for these macros. They are used when enabling - subsetting. - - * configure.in: - - lseek64() and llseek() test has been moved to - `m4/acinclude.m4'. - - Include `sys/types.h' when running the TLI/XTI tests. Some - platforms use typedefs such as "ulong" but such typedefs may not - be defined in the TLI/XTI headers. - - (ACE_HAS_BROKEN_T_ERROR): - - Corrected test for broken t_error(). A variable, "errmsg" was - being passed to the t_error() call in the test, but the variable - was declared as "ace_errmsg." Thanks to Roland Gigler - for pointing this out. - - (ACE_MAJOR, ACE_MINOR, ACE_BETA): - - If any of these variables is evaluates to the empty string, then - set it to zero. This fixes a problem that was occuring when the - the ACE version contained no beta number (e.g. "5.1" instead - "5.1.0"). Libtool didn't like the fact that one of the numbers - was an empty string. - - * ace/Makefile.am (libACE_IPC_la_SOURCES, libACE_Other_la_SOURCES, - HEADER_FILES, INLINE_FILES): - - Synchronized the sources associated with these Makefile - variables with those in the classical ACE Makefile. - - * m4/acinclude.m4 (ACE_CHECK_LSEEK64): - - Moved checks for lseek64() and llseek() from configure.in to - this file. The beginnings of a test for a 64 bit offset type - have also been added, but that test is currently not in use. - - * m4/ace.m4 (ACE_COMPILATION_OPTIONS): - - Removed check for exception support in C compiler. It didn't - make too much sense to check for exception support in a C - compiler. - - Since exception support is disabled by default, make sure - "-fno-exceptions" is set when using g++ with the default ACE - exception configuration value. - - * m4/compiler.m4 (ACE_SET_COMPILER_FLAGS): - - Fixed typos where "$GXX" was used instead of "$CXX." "$GXX" is - set to yes when GNU C++ is being used, and "$CXX" is set to the - compiler being used (e.g. "c++"). Thanks to Rich Seibel - for pointing this out. - - This also fixes a problem where "-fcheck-new" wasn't being added - to the C++ flags ($CXXFLAGS). - - * m4/subsets.m4 (ACE_LACKS_ACE_OTHER, ACE_LACKS_ACE_SVCCONF, - ACE_LACKS_ACE_TOKEN): - - When disabling the "Other," "SvcConf" and/or the "Token" subset, - then define the corresponding preprocessor macro. - -Sat Apr 15 21:49:04 2000 Darrell Brunsch - - * ace/ACE.cpp: - * apps/Gateway/Gateway/Options.cpp: - - Nick Pratt reported two cases where - we were using sizeof some_string to figure out its length. This - of course doesn't work when the string is a wide string, so they - have been changed to account for the character size. - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: - * apps/gperf/src/gperf.dsp: - * apps/gperf/src/gperf_lib.dsp: - - Changed around the order of the configurations so that in the - default case (such as out of the box) the regular Debug version - will be the current configuration. - -Sat Apr 15 19:35:57 2000 Darrell Brunsch - - (On behalf of Christopher Kohlhoff ) - - * ace/Makefile.bor: - - Added new file QoS_Manager.cpp. - - * ace/Basic_Types.h: - * ace/Timer_Queue_Adapters.h: - - Added missing pre/post includes. - - * include/makeinclude/ace_flags.bor: - * include/makeinclude/build_example.bor: - - Updated for new orbsvcs libraries. - -Sat Apr 15 18:17:02 2000 Douglas C. Schmidt - - * apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp: - Fixed the handle_output() function so that it does the "Right - Thing"[TM] on Windows NT. Win32 Winsock doesn't trigger - multiple "You can write now" signals, so we have to assume that - we can continue to write until we get another EWOULDBLOCK. - Thanks to Nick Pratt - -Thu Apr 13 16:30:01 2000 David L. Levine - - * ace/config-sunos5.7.h: added #undef ACE_NEEDS_LWP_PRIO_SET. - SunOS 5.7 no longer needs it, as shown by - performance-tests/Misc/preempt (run as superuser). Thanks - to John Foresteire - for reporting this. - -Tue Apr 11 21:41:20 2000 Nanbor Wang - - * bin/auto_compile_win32.pl: Updated the lists of - workspaces/projects to build. - -Tue Apr 11 16:15:31 2000 David L. Levine - - * ace/OS.cpp: moved ACE_Thread_Exit::is_constructed_ - definition so that it's seen on all platforms, not just - those that are ACE_MT_SAFE. Fixes: - Mon Apr 10 07:30:22 2000 John Rodgers - Thanks to Vishal for reporting it. - -Tue Apr 11 13:57:11 2000 Douglas C. Schmidt - - * ace/Synch_T.cpp: Make sure to cast the "type" argument to - "short" to avoid overload confusions by certain compilers. - Thanks to Charles Taurines for reporting - this. - -Tue Apr 11 12:52:04 2000 Vishal Kachroo - - * ace/SOCK_Dgram_Mcast.cpp (subscribe): Removed the #ifdef - for template instantiation. - -Tue Apr 11 11:32:03 2000 Chad Elliott - * bin/ACEutils.pm - - Refactored duplicate test code into ACEutils.pm - -Mon Apr 10 19:45:32 2000 Vishal Kachroo - - * ace/SOCK_Dgram_Mcast.cpp (subscribe): Added a #ifdef to - get past a g++ error. I am looking into the right way to - do this. - -Mon Apr 10 17:37:53 2000 Nanbor Wang - - * ace/config-freebsd-pthread.h: Addplied John Aughey - 's patch for FreeBSD 4.0. - -Mon Apr 10 07:30:22 2000 John Rodgers - - * ace/OS.{h,cpp},Thread_Manager.cpp (instance,~ACE_Thread_Exit): - added a state variable, is_constructed_, to ACE_Thread_Exit. - instance () sets it, ~ACE_Thread_Exit () clears it. This - allows ACE::init () to be called after ACE::fini (), because - a new ACE_Thread_Exit instance will be created. [Bug 526] - -Sun Apr 9 14:16:23 2000 James CE Johnson - - * docs/tutorials/015/page01.html : Thanks to Conrad Hughes for - pointing out that a real implementation would compress before - encrypting since encrypted data shouldn't really be compressible - anyway. - - * docs/tutorials/015/Protocol_Stream.cpp (open): Reorder the - module pushing so that encryption happens before compression. - - * docs/tutorials/015/Crypt.cpp : - * docs/tutorials/015/Compressor.cpp : - Add a few extra bytes when creating the new message blocks. A - real implementation would probably need that. - -Sun Apr 09 00:04:25 2000 Nanbor Wang - - * ace/Malloc_T.cpp (remove): Removed invocation of destructor to - . It is a member of Control_Block and does not - require explicit initialization/destruction. This was causing - ACE not to compile when ACE_HAS_MALLOC_STATS was defined. - Thanks to John Smyder for reporting the - problem. - - * ace/Malloc_T.cpp (open): Removed invocation of contructor to - for the same reason. - -Fri Apr 07 23:32:16 2000 Nanbor Wang - - * ace/ace_dll.dsp: - * ace/ace_lib.dsp: Added QoS_Manager.* into project files. - -Thu Apr 6 07:29:48 2000 Douglas C. Schmidt - - * ace/Token.h (ACE_Token): Clarified the recursive semantics of - ACE_Token. Thanks to Antti Valtokari - for reporting this. - -Wed Apr 5 22:59:58 2000 Douglas C. Schmidt - - * ace/config-sunos5.5.h: Moved the ACE_HAS_USING_KEYWORD into - the part of this header file that's enabled when - __SUNPRO_CC_COMPAT >= 5 is defined. Thanks to Susan Liebeskind - for reporting this. - -Tue Apr 4 23:50:02 2000 Douglas C. Schmidt - - * ace/ACE.cpp (sock_error): Changed "int error" to "ssize_t error" - to be consistent... - -Tue Apr 4 20:19:36 2000 - - * ace/Acceptor.cpp: Modified the implementation of - ACE_Acceptor::open() and ACE_Acceptor::accept_svc_handler() so - that the peer acceptor's handle is set into non-blocking mode. - This is a safe-guard against the race condition that can - otherwise occur between the time when indicates that a passive-mode - // socket handle is "ready" and when we call . During this - // interval, the client can shutdown the connection, in which case, - // the call can hang! - this->peer_acceptor_.enable (ACE_NONBLOCK); - - int result = reactor->register_handler - (this, - ACE_Event_Handler::ACCEPT_MASK); - if (result != -1) - this->reactor (reactor); - - return result; -} - -// Simple constructor. - -template -ACE_Acceptor::ACE_Acceptor (ACE_Reactor *reactor, - int use_select) - : use_select_ (use_select) -{ - ACE_TRACE ("ACE_Acceptor::ACE_Acceptor"); - - this->reactor (reactor); -} - -template -ACE_Acceptor::ACE_Acceptor - (const ACE_PEER_ACCEPTOR_ADDR &addr, - ACE_Reactor *reactor, - int flags, - int use_select, - int reuse_addr) -{ - ACE_TRACE ("ACE_Acceptor::ACE_Acceptor"); - - if (this->open (addr, - reactor, - flags, - use_select, - reuse_addr) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Acceptor::ACE_Acceptor"))); -} - -template -ACE_Acceptor::~ACE_Acceptor (void) -{ - ACE_TRACE ("ACE_Acceptor::~ACE_Acceptor"); - this->handle_close (); -} - -template int -ACE_Acceptor::fini (void) -{ - ACE_TRACE ("ACE_Acceptor::fini"); - return ACE_Acceptor::handle_close (); -} - -// Hook called by the explicit dynamic linking facility. - -template int -ACE_Acceptor::init (int, ACE_TCHAR *[]) -{ - ACE_TRACE ("ACE_Acceptor::init"); - return -1; -} - -template int -ACE_Acceptor::info (ACE_TCHAR **strp, - size_t length) const -{ - ACE_TRACE ("ACE_Acceptor::info"); - ACE_TCHAR buf[BUFSIZ]; - ACE_TCHAR addr_str[BUFSIZ]; - ACE_PEER_ACCEPTOR_ADDR addr; - - if (this->acceptor ().get_local_addr (addr) == -1) - return -1; - else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) - return -1; - - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s %s"), - ACE_TEXT ("ACE_Acceptor"), - addr_str, - ACE_TEXT ("# acceptor factory\n")); - - if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) - return -1; - else - ACE_OS::strncpy (*strp, buf, length); - return ACE_OS::strlen (buf); -} - -template int -ACE_Acceptor::suspend (void) -{ - ACE_TRACE ("ACE_Acceptor::suspend"); - return this->reactor ()->suspend_handler (this); -} - -template int -ACE_Acceptor::resume (void) -{ - ACE_TRACE ("ACE_Acceptor::resume"); - return this->reactor ()->resume_handler (this); -} - -// Perform termination activities when is removed from the -// . - -template int -ACE_Acceptor::close (void) -{ - ACE_TRACE ("ACE_Acceptor::close"); - return this->handle_close (); -} - -template int -ACE_Acceptor::handle_close (ACE_HANDLE, - ACE_Reactor_Mask) -{ - ACE_TRACE ("ACE_Acceptor::handle_close"); - // Guard against multiple closes. - if (this->reactor () != 0) - { - ACE_HANDLE handle = this->get_handle (); - - this->reactor ()->remove_handler - (handle, - // We must pass the DONT_CALL flag here to avoid infinite - // recursion. - ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL); - - // Shut down the listen socket to recycle the handles. - if (this->peer_acceptor_.close () == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("close\n"))); - // Set the Reactor to 0 so that we don't try to close down - // again. - this->reactor (0); - } - return 0; -} - -// Bridge method for creating a SVC_HANDLER. The strategy for -// creating a SVC_HANDLER are configured into the Acceptor via it's -// . The default is to create a new SVC_HANDLER. -// However, subclasses can override this strategy to perform -// SVC_HANDLER creation in any way that they like (such as creating -// subclass instances of SVC_HANDLER, using a singleton, dynamically -// linking the handler, etc.). - -template int -ACE_Acceptor::make_svc_handler (SVC_HANDLER *&sh) -{ - ACE_TRACE ("ACE_Acceptor::make_svc_handler"); - - if (sh == 0) - ACE_NEW_RETURN (sh, - SVC_HANDLER, - -1); - - // Set the reactor of the newly created to the same - // reactor that this is using. - if (this->reactor ()) - sh->reactor (this->reactor ()); - - return 0; -} - -// Bridge method for accepting the new connection into the -// . The default behavior delegates to the -// in the Acceptor_Strategy. - -template int -ACE_Acceptor::accept_svc_handler - (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Acceptor::accept_svc_handler"); - - // Try to find out if the implementation of the reactor that we are - // using requires us to reset the event association for the newly - // created handle. This is because the newly created handle will - // inherit the properties of the listen handle, including its event - // associations. - int reset_new_handle = this->reactor ()->uses_event_associations (); - - // Note that it's not really an error if returns -1 and - // == EWOULDBLOCK because we have set the peer acceptor's - // handle into non-blocking mode to prevent the call from - // "hanging" if the connection has been shutdown. - if (this->peer_acceptor_.accept (svc_handler->peer (), // stream - 0, // remote address - 0, // timeout - 1, // restart - reset_new_handle // reset new handler - ) == -1 && errno != EWOULDBLOCK) - { - // Close down handler to avoid memory leaks. - svc_handler->close (0); - return -1; - } - else - return 0; -} - -// Bridge method for activating a with the appropriate -// concurrency strategy. The default behavior of this method is to -// activate the SVC_HANDLER by calling its open() method (which allows -// the SVC_HANDLER to define its own concurrency strategy). However, -// subclasses can override this strategy to do more sophisticated -// concurrency activations (such as creating the SVC_HANDLER as an -// "active object" via multi-threading or multi-processing). - -template int -ACE_Acceptor::activate_svc_handler - (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Acceptor::activate_svc_handler"); - - int result = 0; - - // See if we should enable non-blocking I/O on the 's - // peer. - if (ACE_BIT_ENABLED (this->flags_, - ACE_NONBLOCK)) - { - if (svc_handler->peer ().enable (ACE_NONBLOCK) == -1) - result = -1; - } - // Otherwise, make sure it's disabled by default. - else if (svc_handler->peer ().disable (ACE_NONBLOCK) == -1) - result = -1; - - if (result == 0 && svc_handler->open ((void *) this) == -1) - result = -1; - - if (result == -1) - svc_handler->close (0); - - return result; -} - -// Template Method that makes a SVC_HANDLER (using the appropriate -// creation strategy), accept the connection into the SVC_HANDLER, and -// then activate the SVC_HANDLER. - -template int -ACE_Acceptor::handle_input (ACE_HANDLE listener) -{ - ACE_TRACE ("ACE_Acceptor::handle_input"); - ACE_Handle_Set conn_handle; - - // Default is "timeout (0, 0)," which means "poll." - ACE_Time_Value timeout; - - // Accept connections from clients. Note that a loop is used for two - // reasons: - // - // 1. It allows us to accept all pending connections without an - // extra trip through the ACE_Reactor and without having to use - // non-blocking I/O... - // - // 2. It allows the TLI_SAP::ACE_Acceptor class to work correctly (don't - // ask -- TLI is *horrible*...). - - // @@ What should we do if any of the substrategies fail? Right - // now, we just print out a diagnostic message if - // returns > 0 and return 0 (which means that the Acceptor remains - // registered with the Reactor)... - do - { - // Create a service handler, using the appropriate creation - // strategy. - - SVC_HANDLER *svc_handler = 0; - - if (this->make_svc_handler (svc_handler) == -1) - { - if (ACE::debug () > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%p\n"), - ACE_TEXT ("make_svc_handler"))); - return 0; - } - // Accept connection into the Svc_Handler. - - else if (this->accept_svc_handler (svc_handler) == -1) - { - if (ACE::debug () > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%p\n"), - ACE_TEXT ("accept_svc_handler"))); - return 0; - } - - // Activate the using the designated concurrency - // strategy (note that this method becomes responsible for - // handling errors and freeing up the memory if things go - // awry...). - else if (this->activate_svc_handler (svc_handler) == -1) - { - if (ACE::debug () > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%p\n"), - ACE_TEXT ("activate_svc_handler"))); - return 0; - } - - conn_handle.set_bit (listener); - } - - // Now, check to see if there is another connection pending and - // break out of the loop if there is none. - while (this->use_select_ - && ACE_OS::select (int (listener) + 1, - conn_handle, - 0, - 0, - &timeout) == 1); - return 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Strategy_Acceptor) - -template int -ACE_Strategy_Acceptor::suspend (void) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::suspend"); - - // First suspend the SVC_HANDLER's we've created. - if (this->scheduling_strategy_->suspend () == -1) - return -1; - else // Then suspend ourselves. - return ACE_Acceptor::suspend (); -} - -template int -ACE_Strategy_Acceptor::resume (void) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::resume"); - - // First resume ourselves. - if (ACE_Acceptor::resume () == -1) - return -1; - else // Then resume the SVC_HANDLER's we've created. - return this->scheduling_strategy_->resume (); -} - -template void -ACE_Strategy_Acceptor::dump (void) const -{ - ACE_TRACE ("ACE_Strategy_Acceptor::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_Acceptor::dump (); - this->creation_strategy_->dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_creation_strategy_ = %d"), delete_creation_strategy_)); - this->accept_strategy_->dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_accept_strategy_ = %d"), delete_accept_strategy_)); - this->concurrency_strategy_->dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_concurrency_strategy_ = %d"), delete_concurrency_strategy_)); - this->scheduling_strategy_->dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_scheduling_strategy_ = %d"), delete_scheduling_strategy_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nservice_name_ = %s"), - this->service_name_ == 0 ? ACE_TEXT ("") : this->service_name_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nservice_description_ = %s"), - this->service_description_ == 0 ? ACE_TEXT ("") : this->service_description_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nservice_port_ = %d"), this->service_port_)); - this->service_addr_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template ACE_PEER_ACCEPTOR & -ACE_Strategy_Acceptor::acceptor (void) const -{ - ACE_TRACE ("ACE_Strategy_Acceptor::acceptor"); - return this->accept_strategy_->acceptor (); -} - -template -ACE_Strategy_Acceptor::operator ACE_PEER_ACCEPTOR & () const -{ - ACE_TRACE ("ACE_Strategy_Acceptor::operator ACE_PEER_ACCEPTOR &"); - return this->accept_strategy_->acceptor (); -} - -// Returns ACE_HANDLE of the underlying Acceptor_Strategy. - -template ACE_HANDLE -ACE_Strategy_Acceptor::get_handle (void) const -{ - ACE_TRACE ("ACE_Strategy_Acceptor::get_handle"); - return this->accept_strategy_->get_handle (); -} - -// Initialize the appropriate strategies for creation, passive -// connection acceptance, and concurrency, and then register -// with the Reactor and listen for connection requests at the -// designated . - -template int -ACE_Strategy_Acceptor::open - (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor, - ACE_Creation_Strategy *cre_s, - ACE_Accept_Strategy *acc_s, - ACE_Concurrency_Strategy *con_s, - ACE_Scheduling_Strategy *sch_s, - const ACE_TCHAR *service_name, - const ACE_TCHAR *service_description, - int use_select) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::open"); - - if (this->service_name_ == 0 && service_name != 0) - ACE_ALLOCATOR_RETURN (this->service_name_, - ACE_OS::strdup (service_name), - -1); - if (this->service_description_ == 0 && service_description != 0) - ACE_ALLOCATOR_RETURN (this->service_description_, - ACE_OS::strdup (service_description), - -1); - this->reactor (reactor); - - // Must supply a valid Reactor to Acceptor::open()... - if (reactor == 0) - { - errno = EINVAL; - return -1; - } - - // Initialize the creation strategy. - - if (cre_s == 0) - { - ACE_NEW_RETURN (cre_s, - CREATION_STRATEGY, - -1); - this->delete_creation_strategy_ = 1; - } - this->creation_strategy_ = cre_s; - - // Initialize the accept strategy. - - if (acc_s == 0) - { - ACE_NEW_RETURN (acc_s, - ACCEPT_STRATEGY (this->reactor ()), - -1); - this->delete_accept_strategy_ = 1; - } - this->accept_strategy_ = acc_s; - - if (this->accept_strategy_->open (local_addr, 1) == -1) - return -1; - - // Initialize the concurrency strategy. - - if (con_s == 0) - { - ACE_NEW_RETURN (con_s, - CONCURRENCY_STRATEGY, - -1); - this->delete_concurrency_strategy_ = 1; - } - this->concurrency_strategy_ = con_s; - - // Initialize the scheduling strategy. - - if (sch_s == 0) - { - ACE_NEW_RETURN (sch_s, - SCHEDULING_STRATEGY, - -1); - this->delete_scheduling_strategy_ = 1; - } - this->scheduling_strategy_ = sch_s; - - this->use_select_ = use_select; - - return this->reactor ()->register_handler - (this, - ACE_Event_Handler::ACCEPT_MASK); -} - -// Simple constructor. - -template -ACE_Strategy_Acceptor::ACE_Strategy_Acceptor - (const ACE_TCHAR service_name[], - const ACE_TCHAR service_description[], - int use_select) - : creation_strategy_ (0), - delete_creation_strategy_ (0), - accept_strategy_ (0), - delete_accept_strategy_ (0), - concurrency_strategy_ (0), - delete_concurrency_strategy_ (0), - scheduling_strategy_ (0), - delete_scheduling_strategy_ (0), - service_name_ (0), - service_description_ (0), - service_port_ (0) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::ACE_Strategy_Acceptor"); - - if (service_name != 0) - ACE_ALLOCATOR (this->service_name_, - ACE_OS::strdup (service_name)); - if (service_description != 0) - ACE_ALLOCATOR (this->service_description_, - ACE_OS::strdup (service_description)); - this->use_select_ = use_select; -} - -template -ACE_Strategy_Acceptor::ACE_Strategy_Acceptor - (const ACE_PEER_ACCEPTOR_ADDR &addr, - ACE_Reactor *reactor, - ACE_Creation_Strategy *cre_s, - ACE_Accept_Strategy *acc_s, - ACE_Concurrency_Strategy *con_s, - ACE_Scheduling_Strategy *sch_s, - const ACE_TCHAR service_name[], - const ACE_TCHAR service_description[], - int use_select) - : creation_strategy_ (0), - delete_creation_strategy_ (0), - accept_strategy_ (0), - delete_accept_strategy_ (0), - concurrency_strategy_ (0), - delete_concurrency_strategy_ (0), - scheduling_strategy_ (0), - delete_scheduling_strategy_ (0), - service_name_ (0), - service_description_ (0), - service_port_ (0) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::ACE_Strategy_Acceptor"); - - if (this->open (addr, - reactor, - cre_s, - acc_s, - con_s, - sch_s, - service_name, - service_description, - use_select) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Strategy_Acceptor::ACE_Strategy_Acceptor"))); -} - -// Perform termination activities when is removed from the -// . - -template int -ACE_Strategy_Acceptor::handle_close (ACE_HANDLE, - ACE_Reactor_Mask) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::handle_close"); - // Guard against multiple closes. - if (this->reactor () != 0) - { - ACE_HANDLE handle = this->get_handle (); - - if (this->delete_creation_strategy_) - delete this->creation_strategy_; - this->delete_creation_strategy_ = 0; - this->creation_strategy_ = 0; - - if (this->delete_accept_strategy_) - delete this->accept_strategy_; - this->delete_accept_strategy_ = 0; - this->accept_strategy_ = 0; - - if (this->delete_concurrency_strategy_) - delete this->concurrency_strategy_; - this->delete_concurrency_strategy_ = 0; - this->concurrency_strategy_ = 0; - - if (this->delete_scheduling_strategy_) - delete this->scheduling_strategy_; - this->delete_scheduling_strategy_ = 0; - this->scheduling_strategy_ = 0; - - // We must use the obtained *before* we deleted the - // accept_strategy_... - - this->reactor ()->remove_handler - (handle, - ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL); - - // Set the Reactor to 0 so that we don't try to close down - // again. - this->reactor (0); - } - return 0; -} - -// Bridge method for creating a . The strategy for -// creating a are configured into the Acceptor via it's -// . The default is to create a new -// . However, subclasses can override this strategy to -// perform creation in any way that they like (such as -// creating subclass instances of , using a singleton, -// dynamically linking the handler, etc.). - -template int -ACE_Strategy_Acceptor::make_svc_handler (SVC_HANDLER *&sh) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::make_svc_handler"); - return this->creation_strategy_->make_svc_handler (sh); -} - -// Bridge method for accepting the new connection into the -// . The default behavior delegates to the -// in the Acceptor_Strategy. - -template int -ACE_Strategy_Acceptor::accept_svc_handler - (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::accept_svc_handler"); - return this->accept_strategy_->accept_svc_handler (svc_handler); -} - -// Bridge method for activating a with the appropriate -// concurrency strategy. The default behavior of this method is to -// activate the SVC_HANDLER by calling its open() method (which allows -// the SVC_HANDLER to define its own concurrency strategy). However, -// subclasses can override this strategy to do more sophisticated -// concurrency activations (such as creating the SVC_HANDLER as an -// "active object" via multi-threading or multi-processing). - -template int -ACE_Strategy_Acceptor::activate_svc_handler - (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::activate_svc_handler"); - return this->concurrency_strategy_->activate_svc_handler - (svc_handler, - (void *) this); -} - -template -ACE_Strategy_Acceptor::~ACE_Strategy_Acceptor (void) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::~ACE_Strategy_Acceptor"); - ACE_OS::free ((void *) this->service_name_); - ACE_OS::free ((void *) this->service_description_); - this->handle_close (); -} - -// Signal the server to shutdown gracefully. - -template int -ACE_Strategy_Acceptor::handle_signal (int, siginfo_t *, ucontext_t *) -{ - ACE_Reactor::end_event_loop (); - return 0; -} - -template int -ACE_Strategy_Acceptor::info (ACE_TCHAR **strp, - size_t length) const -{ - ACE_TRACE ("ACE_Strategy_Acceptor::info"); - - ACE_TCHAR buf[BUFSIZ]; - ACE_TCHAR service_addr_str[BUFSIZ]; - ACE_PEER_ACCEPTOR_ADDR addr; - - if (this->acceptor ().get_local_addr (addr) == -1) - return -1; - else if (addr.addr_to_string (service_addr_str, - sizeof service_addr_str) == -1) - return -1; - - // @@ Should add the protocol in... - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s #%s\n"), - this->service_name_ == 0 - ? ACE_TEXT ("") - : this->service_name_, - service_addr_str, - this->service_description_ == 0 - ? ACE_TEXT ("") - : this->service_description_); - - if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) - return -1; - else - ACE_OS::strncpy (*strp, buf, length); - return ACE_OS::strlen (buf); -} - -template int -ACE_Strategy_Acceptor::fini (void) -{ - ACE_TRACE ("ACE_Strategy_Acceptor::fini"); - return this->ACE_Strategy_Acceptor::handle_close (); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Oneshot_Acceptor) - -template void -ACE_Oneshot_Acceptor::dump (void) const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nsvc_handler_ = %x"), this->svc_handler_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nrestart_ = %d"), this->restart_)); - this->peer_acceptor_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_concurrency_strategy_ = %d"), - delete_concurrency_strategy_)); - this->concurrency_strategy_->dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template int -ACE_Oneshot_Acceptor::open - (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor, - ACE_Concurrency_Strategy *con_s) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::open"); - this->reactor (reactor); - - // Initialize the concurrency strategy. - - if (con_s == 0) - { - ACE_NEW_RETURN (con_s, - ACE_Concurrency_Strategy, - -1); - this->delete_concurrency_strategy_ = 1; - } - this->concurrency_strategy_ = con_s; - - // Reuse the addr, even if it is already in use...! - return this->peer_acceptor_.open (local_addr, 1); -} - -template -ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor (void) - : delete_concurrency_strategy_ (0) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor"); - this->reactor (0); -} - -template -ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor - (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor *reactor, - ACE_Concurrency_Strategy *cs) - : delete_concurrency_strategy_ (0) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor"); - if (this->open (local_addr, reactor, cs) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Oneshot_Acceptor::ACE_Oneshot_Acceptor"))); -} - -template -ACE_Oneshot_Acceptor::~ACE_Oneshot_Acceptor (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::~ACE_Oneshot_Acceptor"); - this->handle_close (); -} - -template int -ACE_Oneshot_Acceptor::close (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::close"); - return this->handle_close (); -} - -template int -ACE_Oneshot_Acceptor::handle_close (ACE_HANDLE, - ACE_Reactor_Mask) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::handle_close"); - - // Guard against multiple closes. - if (this->delete_concurrency_strategy_) - { - delete this->concurrency_strategy_; - this->delete_concurrency_strategy_ = 0; - this->concurrency_strategy_ = 0; - - // Note that if we aren't actually registered with the - // ACE_Reactor then it's ok for this call to fail... - - if (this->reactor ()) - this->reactor ()->remove_handler - (this, - ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL); - - if (this->peer_acceptor_.close () == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("close\n"))); - } - return 0; -} - -template int -ACE_Oneshot_Acceptor::handle_timeout - (const ACE_Time_Value &tv, - const void *arg) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::handle_timeout"); - errno = ETIME; - - if (this->svc_handler_->handle_timeout (tv, arg) == -1) - this->svc_handler_->handle_close (this->svc_handler_->get_handle (), - ACE_Event_Handler::TIMER_MASK); - - // Since we aren't necessarily registered with the Reactor, don't - // bother to check the return value here... - if (this->reactor ()) - this->reactor ()->remove_handler (this, - ACE_Event_Handler::ACCEPT_MASK); - return 0; -} - -template int -ACE_Oneshot_Acceptor::cancel (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::cancel"); - return this->reactor () && this->reactor ()->cancel_timer (this); -} - -template int -ACE_Oneshot_Acceptor::register_handler - (SVC_HANDLER *svc_handler, - const ACE_Synch_Options &synch_options, - int restart) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::register_handler"); - // Can't do this if we don't have a Reactor. - if (this->reactor () == 0) - { - errno = EINVAL; - return -1; - } - else - { - this->svc_handler_ = svc_handler; - this->restart_ = restart; - ACE_Time_Value *tv = (ACE_Time_Value *) synch_options.time_value (); - - if (tv != 0 - && this->reactor ()->schedule_timer (this, - synch_options.arg (), - *tv) == 0) - return -1; - else - return this->reactor ()->register_handler - (this, - ACE_Event_Handler::ACCEPT_MASK); - } -} - -// Bridge method for activating a with the appropriate -// concurrency strategy. The default behavior of this method is to -// activate the SVC_HANDLER by calling its open() method (which allows -// the SVC_HANDLER to define its own concurrency strategy). However, -// subclasses can override this strategy to do more sophisticated -// concurrency activations (such as creating the SVC_HANDLER as an -// "active object" via multi-threading or multi-processing). - -template int -ACE_Oneshot_Acceptor::activate_svc_handler - (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::activate_svc_handler"); - return this->concurrency_strategy_->activate_svc_handler - (svc_handler, - (void *) this); -} - -// Factors out the code shared between the and -// methods. - -template int -ACE_Oneshot_Acceptor::shared_accept - (SVC_HANDLER *svc_handler, - ACE_PEER_ACCEPTOR_ADDR *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::shared_accept"); - if (svc_handler == 0) - return -1; - - // Accept connection into the Svc_Handler. - else if (this->peer_acceptor_.accept (svc_handler->peer (), // stream - remote_addr, // remote address - timeout, // timeout - restart, // restart - reset_new_handle // reset new handle - ) == -1) - { - // Check whether we just timed out or whether we failed... - if (!(errno == EWOULDBLOCK || errno == ETIME)) - // Close down handler to avoid memory leaks. - svc_handler->close (0); - return -1; - } - // Activate the using the designated concurrency - // strategy (note that this method becomes responsible for handling - // errors and freeing up the memory if things go awry...) - else - return this->activate_svc_handler (svc_handler); -} - -// Make a SVC_HANDLER, accept the connection into the SVC_HANDLER, and -// then activate the SVC_HANDLER. Note that SVC_HANDLER::open() -// decides what type of concurrency strategy to use. - -template int -ACE_Oneshot_Acceptor::accept - (SVC_HANDLER *svc_handler, - ACE_PEER_ACCEPTOR_ADDR *remote_addr, - const ACE_Synch_Options &synch_options, - int restart, - int reset_new_handle) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::accept"); - // Note that if timeout == ACE_Time_Value (x, y) where (x > 0 || y > - // 0) then this->connector_.connect() will block synchronously. If - // is set then we don't want this to happen (since we - // want the ACE_Reactor to do the timeout asynchronously). - // Therefore, we'll force this->connector_ to use ACE_Time_Value (0, - // 0) in this case... - - ACE_Time_Value *timeout; - int use_reactor = synch_options[ACE_Synch_Options::USE_REACTOR]; - - if (use_reactor) - timeout = (ACE_Time_Value *) &ACE_Time_Value::zero; - else - timeout = (ACE_Time_Value *) synch_options.time_value (); - - if (this->shared_accept (svc_handler, // stream - remote_addr, // remote address - timeout, // timeout - restart, // restart - reset_new_handle // reset new handler - ) == -1) - { - if (use_reactor && errno == EWOULDBLOCK) - // We couldn't accept right away, so let's wait in the - // . - this->register_handler (svc_handler, - synch_options, - restart); - return -1; - } - return 0; -} - -// Accepts one pending connection from a client (since we're the -// "oneshot" Acceptor). - -template int -ACE_Oneshot_Acceptor::handle_input (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::handle_input"); - int result = 0; - - // Cancel any timer that might be pending. - this->cancel (); - - // Try to find out if the implementation of the reactor that we are - // using requires us to reset the event association for the newly - // created handle. This is because the newly created handle will - // inherit the properties of the listen handle, including its event - // associations. - int reset_new_handle = this->reactor ()->uses_event_associations (); - - if (this->shared_accept (this->svc_handler_, // stream - 0, // remote address - 0, // timeout - this->restart_, // restart - reset_new_handle // reset new handle - ) == -1) - result = -1; - if (this->reactor () - && this->reactor ()->remove_handler - (this, - ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL) == -1) - result = -1; - return result; -} - -// Hook called by the explicit dynamic linking facility. - -template int -ACE_Oneshot_Acceptor::init (int, ACE_TCHAR *[]) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::init"); - return -1; -} - -template int -ACE_Oneshot_Acceptor::fini (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::fini"); - return this->handle_close (); -} - -template int -ACE_Oneshot_Acceptor::info (ACE_TCHAR **strp, - size_t length) const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::info"); - ACE_TCHAR buf[BUFSIZ]; - ACE_TCHAR addr_str[BUFSIZ]; - ACE_PEER_ACCEPTOR_ADDR addr; - - if (this->peer_acceptor_.get_local_addr (addr) == -1) - return -1; - else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) - return -1; - - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s %s"), - ACE_TEXT ("ACE_Oneshot_Acceptor"), - addr_str, - ACE_TEXT ("#oneshot acceptor factory\n")); - - if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) - return -1; - else - ACE_OS::strncpy (*strp, buf, length); - return ACE_OS::strlen (buf); -} - -template int -ACE_Oneshot_Acceptor::suspend (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::suspend"); - return this->reactor () && this->reactor ()->suspend_handler (this); -} - -template int -ACE_Oneshot_Acceptor::resume (void) -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::resume"); - return this->reactor () && this->reactor ()->resume_handler (this); -} - -// Returns ACE_HANDLE of the underlying peer_acceptor. - -template ACE_HANDLE -ACE_Oneshot_Acceptor::get_handle (void) const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::get_handle"); - return this->peer_acceptor_.get_handle (); -} - -template ACE_PEER_ACCEPTOR & -ACE_Oneshot_Acceptor::acceptor (void) const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::acceptor"); - return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_; -} - -template -ACE_Oneshot_Acceptor::operator ACE_PEER_ACCEPTOR & () const -{ - ACE_TRACE ("ACE_Oneshot_Acceptor::operator ACE_PEER_ACCEPTOR &"); - return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_; -} - -#endif /* ACE_ACCEPTOR_C */ diff --git a/ace/Acceptor.h b/ace/Acceptor.h deleted file mode 100644 index cb2caa01717..00000000000 --- a/ace/Acceptor.h +++ /dev/null @@ -1,532 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Acceptor.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_ACCEPTOR_H -#define ACE_ACCEPTOR_H -#include "ace/pre.h" - -#include "ace/Service_Config.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Object.h" -#include "ace/Svc_Handler.h" -#include "ace/Strategies.h" - -template -class ACE_Acceptor : public ACE_Service_Object -{ - // = TITLE - // Abstract factory for creating a service handler - // (SVC_HANDLER), accepting into the SVC_HANDLER, and - // activating the SVC_HANDLER. - // - // = DESCRIPTION - // Implements the basic strategy for passively establishing - // connections with clients. An ACE_Acceptor is parameterized - // by concrete types that conform to the interfaces of - // PEER_ACCEPTOR and SVC_HANDLER. The PEER_ACCEPTOR is - // instantiated with a transport mechanism that passively - // establishes connections. The SVC_HANDLER is instantiated - // with a concrete type that performs the application-specific - // service. An ACE_Acceptor inherits from ACE_Service_Object, - // which in turn inherits from ACE_Event_Handler. This enables - // the ACE_Reactor to dispatch the ACE_Acceptor's handle_input - // method when connection events occur. The handle_input method - // performs the ACE_Acceptor's default creation, connection - // establishment, and service activation strategies. These - // strategies can be overridden by subclasses individually or as - // a group. -public: - // = Initialization and termination methods. - ACE_Acceptor (ACE_Reactor * = 0, - int use_select = 1); - // "Do-nothing" constructor. - - ACE_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr, - ACE_Reactor * = ACE_Reactor::instance (), - int flags = 0, - int use_select = 1, - int reuse_addr = 1); - // Initialize and register with the Reactor and listen for - // connection requests at the designated . - // indicates how 's should be initialized prior to - // being activated. Right now, the only flag that is processed is - // , which enabled non-blocking I/O on the - // when it is opened. If is non-zero - // then is used to determine when to break out of the - // loop. is passed down to the - // . If it is non-zero this will allow the OS to - // reuse this listen port. - - virtual ~ACE_Acceptor (void); - // Close down the Acceptor's resources. - - virtual operator ACE_PEER_ACCEPTOR &() const; - // Return the underlying PEER_ACCEPTOR object. - - virtual ACE_PEER_ACCEPTOR &acceptor (void) const; - // Return the underlying PEER_ACCEPTOR object. - - virtual ACE_HANDLE get_handle (void) const; - // Returns the listening acceptor's . - - virtual int close (void); - // Close down the Acceptor - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - // = The following three methods define the Acceptor's strategies - // for creating, accepting, and activating SVC_HANDLER's, - // respectively. - - virtual int make_svc_handler (SVC_HANDLER *&sh); - // Bridge method for creating a SVC_HANDLER. The default is to - // create a new if == 0, else is unchanged. - // However, subclasses can override this policy to perform - // SVC_HANDLER creation in any way that they like (such as creating - // subclass instances of SVC_HANDLER, using a singleton, dynamically - // linking the handler, etc.). Returns -1 on failure, else 0. - - virtual int accept_svc_handler (SVC_HANDLER *svc_handler); - // Bridge method for accepting the new connection into the - // . The default behavior delegates to the - // PEER_ACCEPTOR::accept. - - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - // Bridge method for activating a with the appropriate - // concurrency strategy. The default behavior of this method is to - // activate the SVC_HANDLER by calling its method (which - // allows the SVC_HANDLER to define its own concurrency strategy). - // However, subclasses can override this strategy to do more - // sophisticated concurrency activations (such as making the - // SVC_HANDLER as an "active object" via multi-threading or - // multi-processing). - - // = Demultiplexing hooks. - virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - // Perform termination activities when is removed from the - // . - - virtual int handle_input (ACE_HANDLE); - // Accepts all pending connections from clients, and creates and - // activates SVC_HANDLERs. - - // = Dynamic linking hooks. - virtual int init (int argc, ACE_TCHAR *argv[]); - // Default version does no work and returns -1. Must be overloaded - // by application developer to do anything meaningful. - - virtual int fini (void); - // Calls . - - virtual int info (ACE_TCHAR **buf, size_t) const; - // Default version returns address info in . - - // = Service management hooks. - virtual int suspend (void); - // This method calls . - - virtual int resume (void); - // This method calls . - -protected: - ACE_PEER_ACCEPTOR peer_acceptor_; - // Concrete factory for accepting connections from clients... - - int flags_; - // Flags that indicate how 's should be initialized - // prior to being activated. Right now, the only flag that is - // processed is , which enabled non-blocking I/O on - // the when it is opened. - - int use_select_; - // Flag that indicates whether it shall use into ; the data must be aligned to . - - ACE_CDR::Boolean write_array (ACE_OutputCDR& output, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length); - // Efficiently write elements of size from into - // . Before inserting the elements enough padding is added - // to ensure that the elements will be aligned to in the - // stream. - - int adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf); - // Exposes the stream implementation of , this is useful in - // many cases to minimize memory allocations during marshaling. - // On success will contain a contiguous area in the CDR stream - // that can hold bytes aligned to . - // Results - - void good_bit (ACE_OutputCDR& out, int bit); - // Used by derived classes to set errors in the CDR stream. -}; - -// **************************************************************** - -class ACE_Export ACE_WChar_Codeset_Translator -{ - // = TITLE - // Codeset translation routines common to both Output and Input - // CDR streams. - // - // = DESCRIPTION - // This class is a base class for defining codeset translation - // routines to handle the character set translations required by - // both CDR Input streams and CDR Output streams. - // -public: - virtual ACE_CDR::Boolean read_wchar (ACE_InputCDR&, - ACE_CDR::WChar&) = 0; - virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR&, - ACE_CDR::WChar *&) = 0; - virtual ACE_CDR::Boolean read_wchar_array (ACE_InputCDR&, - ACE_CDR::WChar*, - ACE_CDR::ULong) = 0; - virtual ACE_CDR::Boolean write_wchar (ACE_OutputCDR&, - ACE_CDR::WChar) = 0; - virtual ACE_CDR::Boolean write_wstring (ACE_OutputCDR&, - ACE_CDR::ULong, - const ACE_CDR::WChar*) = 0; - virtual ACE_CDR::Boolean write_wchar_array (ACE_OutputCDR&, - const ACE_CDR::WChar*, - ACE_CDR::ULong) = 0; - -protected: - ACE_CDR::Boolean read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x); - ACE_CDR::Boolean read_2 (ACE_InputCDR& input, - ACE_CDR::UShort *x); - ACE_CDR::Boolean read_4 (ACE_InputCDR& input, - ACE_CDR::ULong *x); - ACE_CDR::Boolean write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x); - ACE_CDR::Boolean write_2 (ACE_OutputCDR& output, - const ACE_CDR::UShort *x); - ACE_CDR::Boolean write_4 (ACE_OutputCDR& output, - const ACE_CDR::ULong *x); - // Children have access to low-level routines because they cannot - // use read_char or something similar (it would recurse). - - ACE_CDR::Boolean read_array (ACE_InputCDR& input, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length); - // Efficiently read elements of size each from - // into ; the data must be aligned to . - - ACE_CDR::Boolean write_array (ACE_OutputCDR& output, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length); - // Efficiently write elements of size from into - // . Before inserting the elements enough padding is added - // to ensure that the elements will be aligned to in the - // stream. - - int adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf); - // Exposes the stream implementation of , this is useful in - // many cases to minimize memory allocations during marshaling. - // On success will contain a contiguous area in the CDR stream - // that can hold bytes aligned to . - // Results - - void good_bit (ACE_OutputCDR& out, int bit); - // Used by derived classes to set errors in the CDR stream. -}; - -#if defined (__ACE_INLINE__) -# include "ace/CDR_Stream.i" -#else /* __ACE_INLINE__ */ - -// Not used by CORBA or TAO -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Char x); -// CDR output operators for primitive types - -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Short x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::UShort x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Long x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::ULong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::LongLong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::ULongLong x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR& os, - ACE_CDR::LongDouble x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Float x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_CDR::Double x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - const ACE_CString &x); - -// CDR output operator from helper classes - -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_boolean x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_char x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_wchar x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_octet x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_string x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - ACE_OutputCDR::from_wstring x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - const ACE_CDR::Char* x); -extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, - const ACE_CDR::WChar* x); - -// Not used by CORBA or TAO -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Char &x); -// CDR input operators for primitive types - -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Short &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::UShort &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Long &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::ULong &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::LongLong &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::ULongLong &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::LongDouble &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Float &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Double &x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CString &x); - -// CDR input operator from helper classes - -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_boolean x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_char x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_wchar x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_octet x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_string x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_InputCDR::to_wstring x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::Char*& x); -extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, - ACE_CDR::WChar*& x); - -#endif /* __ACE_INLINE */ - -#include "ace/post.h" -#endif /* ACE_CDR_H */ diff --git a/ace/CDR_Stream.i b/ace/CDR_Stream.i deleted file mode 100644 index 9fd0c6c142a..00000000000 --- a/ace/CDR_Stream.i +++ /dev/null @@ -1,1528 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// **************************************************************** - -ACE_INLINE void -ACE_CDR::swap_2 (const char *orig, char* target) -{ - target[1] = *orig++; - target[0] = *orig++; -} - -ACE_INLINE void -ACE_CDR::swap_4 (const char *orig, char* target) -{ - target [3] = *orig++; - target [2] = *orig++; - target [1] = *orig++; - target [0] = *orig++; -} - -ACE_INLINE void -ACE_CDR::swap_8 (const char *orig, char* target) -{ - target [7] = *orig++; - target [6] = *orig++; - target [5] = *orig++; - target [4] = *orig++; - target [3] = *orig++; - target [2] = *orig++; - target [1] = *orig++; - target [0] = *orig++; -} - -ACE_INLINE void -ACE_CDR::swap_16 (const char *orig, char* target) -{ - target [15] = *orig++; - target [14] = *orig++; - target [13] = *orig++; - target [12] = *orig++; - target [11] = *orig++; - target [10] = *orig++; - target [9] = *orig++; - target [8] = *orig++; - target [7] = *orig++; - target [6] = *orig++; - target [5] = *orig++; - target [4] = *orig++; - target [3] = *orig++; - target [2] = *orig++; - target [1] = *orig++; - target [0] = *orig++; -} - -ACE_INLINE void -ACE_CDR::mb_align (ACE_Message_Block *mb) -{ - char *start = ACE_ptr_align_binary (mb->base (), - ACE_CDR::MAX_ALIGNMENT); - mb->rd_ptr (start); - mb->wr_ptr (start); - -#if defined (ACE_HAS_PURIFY) - // This is a good place to zero the buffer; this is not needed - // by IIOP, but makes Purify happy. - if (mb->base () != 0) - { - (void) ACE_OS::memset (mb->base (), 0, mb->size ()); - } -#endif /* ACE_HAS_PURIFY */ -} - -ACE_INLINE size_t -ACE_CDR::first_size (size_t minsize) -{ - if (minsize == 0) - return ACE_CDR::DEFAULT_BUFSIZE; - - size_t newsize = ACE_CDR::DEFAULT_BUFSIZE; - while (newsize < minsize) - { - if (newsize < ACE_CDR::EXP_GROWTH_MAX) - { - // We grow exponentially at the beginning, this is fast and - // reduces the number of allocations. - newsize *= 2; - } - else - { - // but continuing with exponential growth can result in over - // allocations and easily yield an allocation failure. - // So we grow linearly when the buffer is too big. - newsize += ACE_CDR::LINEAR_GROWTH_CHUNK; - } - } - return newsize; -} - -ACE_INLINE size_t -ACE_CDR::next_size (size_t minsize) -{ - size_t newsize = - ACE_CDR::first_size (minsize); - - if (newsize == minsize) - { - // If necessary increment the size - if (newsize < ACE_CDR::EXP_GROWTH_MAX) - newsize *= 2; - else - newsize += ACE_CDR::LINEAR_GROWTH_CHUNK; - } - - return newsize; -} - -// **************************************************************** - -// implementing the special types -ACE_INLINE -ACE_OutputCDR::from_boolean::from_boolean (ACE_CDR::Boolean b) - : val_ (b) -{ -} - -ACE_INLINE -ACE_InputCDR::to_boolean::to_boolean (ACE_CDR::Boolean &b) - : ref_ (b) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_octet::from_octet (ACE_CDR::Octet o) - : val_ (o) -{ -} - -ACE_INLINE -ACE_InputCDR::to_octet::to_octet (ACE_CDR::Octet &o) - : ref_ (o) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_char::from_char (ACE_CDR::Char c) - : val_ (c) -{ -} - -ACE_INLINE -ACE_InputCDR::to_char::to_char (ACE_CDR::Char &c) - : ref_ (c) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_wchar::from_wchar (ACE_CDR::WChar wc) - : val_ (wc) -{ -} - -ACE_INLINE -ACE_InputCDR::to_wchar::to_wchar (ACE_CDR::WChar &wc) - : ref_ (wc) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_string::from_string (ACE_CDR::Char *s, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) - : val_ (s), - bound_ (b), - nocopy_ (nocopy) -{ -} - -ACE_INLINE -ACE_InputCDR::to_string::to_string (ACE_CDR::Char *&s, - ACE_CDR::ULong b) - : val_ (s), - bound_ (b) -{ -} - -ACE_INLINE -ACE_OutputCDR::from_wstring::from_wstring (ACE_CDR::WChar *ws, - ACE_CDR::ULong b, - ACE_CDR::Boolean nocopy) - : val_ (ws), - bound_ (b), - nocopy_ (nocopy) -{ -} - -ACE_INLINE -ACE_InputCDR::to_wstring::to_wstring (ACE_CDR::WChar *&ws, - ACE_CDR::ULong b) - : val_ (ws), - bound_ (b) -{ -} - -ACE_INLINE -ACE_InputCDR::Transfer_Contents::Transfer_Contents (ACE_InputCDR &rhs) - : rhs_ (rhs) -{ -} - -// **************************************************************** - -ACE_INLINE -ACE_OutputCDR::~ACE_OutputCDR (void) -{ - if (this->start_.cont () != 0) - { - ACE_Message_Block::release (this->start_.cont ()); - this->start_.cont (0); - } - this->current_ = 0; -} - -ACE_INLINE void -ACE_OutputCDR::reset (void) -{ - this->current_ = &this->start_; - this->current_is_writable_ = 1; - ACE_CDR::mb_align (&this->start_); - this->current_alignment_ = 0; - - // It is tempting not to remove the memory, but we need to do so to - // release any potential user buffers chained in the continuation - // field. - ACE_Message_Block *cont = this->start_.cont (); - if (cont != 0) - { - ACE_Message_Block::release (cont); - this->start_.cont (0); - } - -} - -// Decode the CDR stream. - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_octet (ACE_CDR::Octet x) -{ - return this->write_1 (ACE_reinterpret_cast (const ACE_CDR::Octet*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_boolean (ACE_CDR::Boolean x) -{ - return (ACE_CDR::Boolean) this->write_octet (x ? 1 : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_char (ACE_CDR::Char x) -{ - if (this->char_translator_ == 0) - return this->write_1 (ACE_reinterpret_cast (const ACE_CDR::Octet*, &x)); - return this->char_translator_->write_char (*this, x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_wchar (ACE_CDR::WChar x) -{ - if (this->wchar_translator_ == 0) - return this->write_2 (ACE_reinterpret_cast (const ACE_CDR::UShort*, &x)); - return this->wchar_translator_->write_wchar (*this, x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_short (ACE_CDR::Short x) -{ - return this->write_2 (ACE_reinterpret_cast (const ACE_CDR::UShort*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ushort (ACE_CDR::UShort x) -{ - return this->write_2 (ACE_reinterpret_cast (const ACE_CDR::UShort*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_long (ACE_CDR::Long x) -{ - return this->write_4 (ACE_reinterpret_cast (const ACE_CDR::ULong*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ulong (ACE_CDR::ULong x) -{ - return this->write_4 (ACE_reinterpret_cast (const ACE_CDR::ULong*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_longlong (const ACE_CDR::LongLong &x) -{ - return this->write_8 (ACE_reinterpret_cast (const ACE_CDR::ULongLong*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ulonglong (const ACE_CDR::ULongLong &x) -{ - return this->write_8 (ACE_reinterpret_cast (const ACE_CDR::ULongLong*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_float (ACE_CDR::Float x) -{ - return this->write_4 (ACE_reinterpret_cast (const ACE_CDR::ULong*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_double (const ACE_CDR::Double &x) -{ - return this->write_8 (ACE_reinterpret_cast (const ACE_CDR::ULongLong*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_longdouble (const ACE_CDR::LongDouble &x) -{ - return this->write_16 (ACE_reinterpret_cast (const ACE_CDR::LongDouble*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_string (const ACE_CDR::Char *x) -{ - if (x != 0) - return this->write_string (ACE_OS::strlen(x), x); - return this->write_string (0, 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_string (const ACE_CString &x) -{ - return this->write_string (x.length(), x.c_str()); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_wstring (const ACE_CDR::WChar *x) -{ - if (x != 0) - return this->write_wstring (ACE_OS::wslen (x), x); - return this->write_wstring (0, 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_char_array (const ACE_CDR::Char *x, - ACE_CDR::ULong length) -{ - if (this->char_translator_ == 0) - return this->write_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); - return this->char_translator_->write_char_array (*this, x, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_wchar_array (const ACE_CDR::WChar* x, - ACE_CDR::ULong length) -{ - if (this->wchar_translator_ == 0) - return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); - return this->wchar_translator_->write_wchar_array (*this, x, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_octet_array (const ACE_CDR::Octet* x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_short_array (const ACE_CDR::Short *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ushort_array (const ACE_CDR::UShort *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_long_array (const ACE_CDR::Long *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ulong_array (const ACE_CDR::ULong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_longlong_array (const ACE_CDR::LongLong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_ulonglong_array (const ACE_CDR::ULongLong *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_float_array (const ACE_CDR::Float *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_double_array (const ACE_CDR::Double *x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::write_longdouble_array (const ACE_CDR::LongDouble* x, - ACE_CDR::ULong length) -{ - return this->write_array (x, - ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - length); -} - -ACE_INLINE int -ACE_OutputCDR::good_bit (void) const -{ - return this->good_bit_; -} - -ACE_INLINE int -ACE_OutputCDR::adjust (size_t size, - size_t align, - char*& buf) -{ - if (!this->current_is_writable_) - return this->grow_and_adjust (size, align, buf); - - size_t offset = - ACE_align_binary (this->current_alignment_, align) - - this->current_alignment_; - - buf = this->current_->wr_ptr () + offset; - char *end = buf + size; - - if (end <= this->current_->end ()) - { - this->current_alignment_ += offset + size; - this->current_->wr_ptr (end); - return 0; - } - - return this->grow_and_adjust (size, align, buf); -} - -ACE_INLINE int -ACE_OutputCDR::adjust (size_t size, char*& buf) -{ - return this->adjust (size, size, buf); -} - -ACE_INLINE const ACE_Message_Block* -ACE_OutputCDR::begin (void) const -{ - return &this->start_; -} - -ACE_INLINE const ACE_Message_Block* -ACE_OutputCDR::end (void) const -{ - return this->current_->cont (); -} - -ACE_INLINE const ACE_Message_Block* -ACE_OutputCDR::current (void) const -{ - return this->current_; -} - -ACE_INLINE size_t -ACE_OutputCDR::total_length (void) const -{ - return ACE_CDR::total_length (this->begin (), this->end ()); -} - -ACE_INLINE const char* -ACE_OutputCDR::buffer (void) const -{ - return this->start_.rd_ptr (); -} - -ACE_INLINE size_t -ACE_OutputCDR::length (void) const -{ - return this->start_.length (); -} - -ACE_INLINE int -ACE_OutputCDR::do_byte_swap (void) const -{ - return this->do_byte_swap_; -} - -ACE_INLINE size_t -ACE_OutputCDR::current_alignment (void) const -{ - return this->current_alignment_; -} - -ACE_INLINE int -ACE_OutputCDR::align_write_ptr (size_t alignment) -{ - char *dummy; - return this->grow_and_adjust (0, alignment, dummy); -} - -ACE_INLINE ACE_Char_Codeset_Translator * -ACE_OutputCDR::char_translator (void) const -{ - return this->char_translator_; -} - -ACE_INLINE ACE_WChar_Codeset_Translator * -ACE_OutputCDR::wchar_translator (void) const -{ - return this->wchar_translator_; -} - -// **************************************************************** - -ACE_INLINE -ACE_InputCDR::~ACE_InputCDR (void) -{ -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_octet (ACE_CDR::Octet& x) -{ - return this->read_1 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_boolean (ACE_CDR::Boolean& x) -{ - ACE_CDR::Octet tmp; - this->read_octet (tmp); - x = tmp ? 1 : 0; - return (ACE_CDR::Boolean) this->good_bit_; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_char (ACE_CDR::Char &x) -{ - if (this->char_translator_ == 0) - return this->read_1 (ACE_reinterpret_cast (ACE_CDR::Octet*, &x)); - return this->char_translator_->read_char (*this, x); -} - - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_wchar (ACE_CDR::WChar& x) -{ - if (this->wchar_translator_ == 0) - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*,&x)); - return this->wchar_translator_->read_wchar (*this, x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_short (ACE_CDR::Short &x) -{ - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ushort (ACE_CDR::UShort &x) -{ - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*, &x)); -} - - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_long (ACE_CDR::Long &x) -{ - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*, &x)); -} - - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ulong (ACE_CDR::ULong &x) -{ - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*, &x)); -} - - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_longlong (ACE_CDR::LongLong &x) -{ - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ulonglong (ACE_CDR::ULongLong &x) -{ - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_float (ACE_CDR::Float &x) -{ - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*, &x)); -} - - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_double (ACE_CDR::Double &x) -{ - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*, &x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_longdouble (ACE_CDR::LongDouble &x) -{ - return this->read_16 (ACE_reinterpret_cast (ACE_CDR::LongDouble*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_char_array (ACE_CDR::Char* x, - ACE_CDR::ULong length) -{ - if (this->char_translator_ == 0) - return this->read_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); - return this->char_translator_->read_char_array (*this, x, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_wchar_array (ACE_CDR::WChar* x, - ACE_CDR::ULong length) -{ - if (this->wchar_translator_ == 0) - return this->read_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); - return this->wchar_translator_->read_wchar_array (*this, x, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_octet_array (ACE_CDR::Octet* x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_short_array (ACE_CDR::Short *x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ushort_array (ACE_CDR::UShort *x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::SHORT_SIZE, - ACE_CDR::SHORT_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_long_array (ACE_CDR::Long *x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ulong_array (ACE_CDR::ULong *x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_longlong_array (ACE_CDR::LongLong *x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_ulonglong_array (ACE_CDR::ULongLong *x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_float_array (ACE_CDR::Float *x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::LONG_SIZE, - ACE_CDR::LONG_ALIGN, - length); -} - - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_double_array (ACE_CDR::Double *x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::LONGLONG_SIZE, - ACE_CDR::LONGLONG_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::read_longdouble_array (ACE_CDR::LongDouble* x, - ACE_CDR::ULong length) -{ - return this->read_array (x, - ACE_CDR::LONGDOUBLE_SIZE, - ACE_CDR::LONGDOUBLE_ALIGN, - length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_char (void) -{ - ACE_CDR::Char x; - return this->read_1 (ACE_reinterpret_cast (ACE_CDR::Octet*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_wchar (void) -{ - ACE_CDR::WChar x; - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_octet (void) -{ - ACE_CDR::Octet x; - return this->read_1 (&x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_boolean (void) -{ - ACE_CDR::Octet tmp; - this->read_octet (tmp); - return this->good_bit_; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_short (void) -{ - ACE_CDR::Short x; - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_ushort (void) -{ - ACE_CDR::UShort x; - return this->read_2 (ACE_reinterpret_cast (ACE_CDR::UShort*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_long (void) -{ - ACE_CDR::Long x; - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_ulong (void) -{ - ACE_CDR::ULong x; - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_longlong (void) -{ - ACE_CDR::LongLong x; - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_ulonglong (void) -{ - ACE_CDR::ULongLong x; - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_float (void) -{ - float x; - return this->read_4 (ACE_reinterpret_cast (ACE_CDR::ULong*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_double (void) -{ - double x; - return this->read_8 (ACE_reinterpret_cast (ACE_CDR::ULongLong*,&x)); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_InputCDR::skip_longdouble (void) -{ - ACE_CDR::LongDouble x; - return this->read_16 (ACE_reinterpret_cast (ACE_CDR::LongDouble*,&x)); -} - -ACE_INLINE char* -ACE_InputCDR::end (void) -{ - return this->start_.end (); -} - -ACE_INLINE void -ACE_InputCDR::rd_ptr (size_t offset) -{ - this->start_.rd_ptr (offset); -} - -ACE_INLINE char* -ACE_InputCDR::rd_ptr (void) -{ - return this->start_.rd_ptr (); -} - -ACE_INLINE int -ACE_InputCDR::adjust (size_t size, - size_t align, - char*& buf) -{ - buf = ACE_ptr_align_binary (this->rd_ptr (), align); - char *end = buf + size; - if (end <= this->end ()) - { - this->start_.rd_ptr (end); - return 0; - } - - this->good_bit_ = 0; - return -1; -} - -ACE_INLINE int -ACE_InputCDR::adjust (size_t size, - char*& buf) -{ - return this->adjust (size, size, buf); -} - -ACE_INLINE size_t -ACE_InputCDR::length (void) const -{ - return this->start_.length (); -} - -ACE_INLINE const ACE_Message_Block* -ACE_InputCDR::start (void) const -{ - return &this->start_; -} - -ACE_INLINE int -ACE_InputCDR::good_bit (void) const -{ - return this->good_bit_; -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Char x) -{ - os.write_char (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Short x) -{ - os.write_short (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::UShort x) -{ - os.write_ushort (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Long x) -{ - os.write_long (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::ULong x) -{ - os.write_ulong (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::LongLong x) -{ - os.write_longlong (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::ULongLong x) -{ - os.write_ulonglong (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::LongDouble x) -{ - os.write_longdouble (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Float x) -{ - os.write_float (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_CDR::Double x) -{ - os.write_double (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, const ACE_CDR::Char *x) -{ - os.write_string (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, const ACE_CDR::WChar *x) -{ - os.write_wstring (x); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, const ACE_CString &x) -{ - os.write_string (x); - return os.good_bit (); -} - -// The following use the helper classes -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_boolean x) -{ - os.write_boolean (x.val_); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_char x) -{ - os.write_char (x.val_); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wchar x) -{ - os.write_wchar (x.val_); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_octet x) -{ - os.write_octet (x.val_); - return os.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_string x) -{ - ACE_CDR::ULong len = 0; - if (x.val_ != 0) - len = ACE_OS::strlen (x.val_); - os.write_string (len, x.val_); - return os.good_bit () && (len <= x.bound_); -} - -ACE_INLINE ACE_CDR::Boolean -operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wstring x) -{ - ACE_CDR::ULong len = 0;; - if (x.val_ != 0) - len = ACE_OS::wslen (x.val_); - os.write_wstring (len, x.val_); - return os.good_bit () && (len <= x.bound_); -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Char &x) -{ - is.read_char (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Short &x) -{ - is.read_short (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::UShort &x) -{ - is.read_ushort (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>>(ACE_InputCDR &is, ACE_CDR::Long &x) -{ - is.read_long (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::ULong &x) -{ - is.read_ulong (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR& is, ACE_CDR::LongLong &x) -{ - is.read_longlong (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR& is, ACE_CDR::ULongLong &x) -{ - is.read_ulonglong (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR& is, ACE_CDR::LongDouble &x) -{ - is.read_longdouble (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Float &x) -{ - is.read_float (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Double &x) -{ - is.read_double (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::Char *&x) -{ - is.read_string (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CDR::WChar *&x) -{ - is.read_wstring (x); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_CString &x) -{ - is.read_string (x); - return is.good_bit (); -} - -// The following use the helper classes -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_boolean x) -{ - is.read_boolean (x.ref_); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_char x) -{ - is.read_char (x.ref_); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wchar x) -{ - is.read_wchar (x.ref_); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_octet x) -{ - is.read_octet (x.ref_); - return is.good_bit (); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_string x) -{ - is.read_string (x.val_); - // check if the bounds are satisfied - return (is.good_bit () && - (ACE_OS::strlen (x.val_) <= x.bound_)); -} - -ACE_INLINE ACE_CDR::Boolean -operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wstring x) -{ - is.read_wstring (x.val_); - // check if the bounds are satisfied - return (is.good_bit () && - (ACE_OS::wslen (x.val_) <= x.bound_)); -} - -// *************************************************************************** -// We must define these methods here because they use the "read_*" inlined -// methods of the ACE_InputCDR class -// *************************************************************************** - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_boolean (ACE_InputCDR &stream) -{ - ACE_CDR::Boolean x; - return (stream.read_boolean (x) ? this->write_boolean (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_char (ACE_InputCDR &stream) -{ - ACE_CDR::Char x; - return (stream.read_char (x) ? this->write_char (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_wchar (ACE_InputCDR &stream) -{ - ACE_CDR::WChar x; - return (stream.read_wchar (x) ? this->write_wchar (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_octet (ACE_InputCDR &stream) -{ - ACE_CDR::Octet x; - return (stream.read_octet (x) ? this->write_octet (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_short (ACE_InputCDR &stream) -{ - ACE_CDR::Short x; - return (stream.read_short (x) ? this->write_short (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_ushort (ACE_InputCDR &stream) -{ - ACE_CDR::UShort x; - return (stream.read_ushort (x) ? this->write_ushort (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_long (ACE_InputCDR &stream) -{ - ACE_CDR::Long x; - return (stream.read_long (x) ? this->write_long (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_ulong (ACE_InputCDR &stream) -{ - ACE_CDR::ULong x; - return (stream.read_ulong (x) ? this->write_ulong (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_longlong (ACE_InputCDR &stream) -{ - ACE_CDR::LongLong x; - return (stream.read_longlong (x) ? this->write_longlong (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_ulonglong (ACE_InputCDR &stream) -{ - ACE_CDR::ULongLong x; - return (stream.read_ulonglong (x) ? this->write_ulonglong (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_float (ACE_InputCDR &stream) -{ - ACE_CDR::Float x; - return (stream.read_float (x) ? this->write_float (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_double (ACE_InputCDR &stream) -{ - ACE_CDR::Double x; - return (stream.read_double (x) ? this->write_double (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_longdouble (ACE_InputCDR &stream) -{ - ACE_CDR::LongDouble x; - return (stream.read_longdouble (x) ? this->write_longdouble (x) : 0); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_string (ACE_InputCDR &stream) -{ - ACE_CDR::Char *x; - ACE_CDR::Boolean flag = - (stream.read_string (x) ? this->write_string (x) : 0); - delete [] x; - return flag; -} - -ACE_INLINE ACE_CDR::Boolean -ACE_OutputCDR::append_wstring (ACE_InputCDR &stream) -{ - ACE_CDR::WChar *x; - ACE_CDR::Boolean flag = - (stream.read_wstring (x) ? this->write_wstring (x) : 0); - delete [] x; - return flag; -} - -ACE_INLINE void -ACE_InputCDR::reset_byte_order (int byte_order) -{ - this->do_byte_swap_ = (byte_order != ACE_CDR_BYTE_ORDER); -} - -ACE_INLINE int -ACE_InputCDR::do_byte_swap (void) const -{ - return this->do_byte_swap_; -} - -ACE_INLINE int -ACE_InputCDR::byte_order (void) const -{ - if (this->do_byte_swap ()) - return !ACE_CDR_BYTE_ORDER; - else - return ACE_CDR_BYTE_ORDER; -} - -ACE_INLINE int -ACE_InputCDR::align_read_ptr (size_t alignment) -{ - char *buf = ACE_ptr_align_binary (this->rd_ptr (), - alignment); - - if (buf <= this->end ()) - { - this->start_.rd_ptr (buf); - return 0; - } - - this->good_bit_ = 0; - return -1; -} - -ACE_INLINE ACE_Char_Codeset_Translator * -ACE_InputCDR::char_translator (void) const -{ - return this->char_translator_; -} - -ACE_INLINE ACE_WChar_Codeset_Translator * -ACE_InputCDR::wchar_translator (void) const -{ - return this->wchar_translator_; -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -ACE_Char_Codeset_Translator::read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x) -{ - return input.read_1 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_Char_Codeset_Translator::write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x) -{ - return output.write_1 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_Char_Codeset_Translator::read_array (ACE_InputCDR& in, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - return in.read_array (x, size, align, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_Char_Codeset_Translator::write_array (ACE_OutputCDR& out, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - return out.write_array(x, size, align, length); -} - -ACE_INLINE int -ACE_Char_Codeset_Translator::adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf) -{ - return out.adjust(size, align, buf); -} - -ACE_INLINE void -ACE_Char_Codeset_Translator::good_bit (ACE_OutputCDR& out, int bit) -{ - out.good_bit_ = bit; -} - -// **************************************************************** - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::read_1 (ACE_InputCDR& input, - ACE_CDR::Octet *x) -{ - return input.read_1 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::read_2 (ACE_InputCDR& input, - ACE_CDR::UShort *x) -{ - return input.read_2 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::read_4 (ACE_InputCDR& input, - ACE_CDR::ULong *x) -{ - return input.read_4 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::write_1 (ACE_OutputCDR& output, - const ACE_CDR::Octet *x) -{ - return output.write_1 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::write_2 (ACE_OutputCDR& output, - const ACE_CDR::UShort *x) -{ - return output.write_2 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::write_4 (ACE_OutputCDR& output, - const ACE_CDR::ULong *x) -{ - return output.write_4 (x); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::read_array (ACE_InputCDR& in, - void* x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - return in.read_array (x, size, align, length); -} - -ACE_INLINE ACE_CDR::Boolean -ACE_WChar_Codeset_Translator::write_array (ACE_OutputCDR& out, - const void *x, - size_t size, - size_t align, - ACE_CDR::ULong length) -{ - return out.write_array(x, size, align, length); -} - -ACE_INLINE int -ACE_WChar_Codeset_Translator::adjust (ACE_OutputCDR& out, - size_t size, - size_t align, - char *&buf) -{ - return out.adjust(size, align, buf); -} - -ACE_INLINE void -ACE_WChar_Codeset_Translator::good_bit (ACE_OutputCDR& out, int bit) -{ - out.good_bit_ = bit; -} diff --git a/ace/CLASSIX/CLASSIX_Addr.cpp b/ace/CLASSIX/CLASSIX_Addr.cpp deleted file mode 100644 index faafc29109d..00000000000 --- a/ace/CLASSIX/CLASSIX_Addr.cpp +++ /dev/null @@ -1,13 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Defines the ClassiX IPC address family address format. - -#define ACE_BUILD_DLL -#include "ace/CLASSIX/CLASSIX_Addr.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Addr.i" -#endif /* __ACE_INLINE__ */ - -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_Addr) diff --git a/ace/CLASSIX/CLASSIX_Addr.h b/ace/CLASSIX/CLASSIX_Addr.h deleted file mode 100644 index 21089659649..00000000000 --- a/ace/CLASSIX/CLASSIX_Addr.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// CLASSIX_Addr.h -// -// = AUTHOR -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_ADDR_H -#include "ace/pre.h" -#define ACE_CLASSIX_ADDR_H - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Addr.h" - -#include -#include - -class ACE_Export ACE_CLASSIX_Addr : public ACE_Addr -{ - // = TITLE - // Defines the ClassiX IPC address format. - // - // = DESCRIPTION - // This class defines basic interfaces for "ACE-like" address for - // Chorus port. -public: - enum - { - ACE_CLASSIX_ADDR_UNKNOWN = ACE_INVALID_HANDLE, /* K_NONEPORT */ - ACE_CLASSIX_ADDR_DEFAULT = K_DEFAULTPORT, - AF_CLASSIX = AF_MAX + 1 - }; - - enum Addr_Type - { - PORT, // use Peer_Port - GROUP, // use Peer_Group - STAMP, // use peer_Stamp - DYNAMIC, // use Peer_Group - UNDEFINED - }; - - - /* -----------------------------------------------------*/ - // = INITIALIZATION - ACE_CLASSIX_Addr(int /* size of the underlying address structure*/); - virtual ~ACE_CLASSIX_Addr (void); - - - /* -----------------------------------------------------*/ - // = Direct initialization methods (useful after the object has been - // constructed). - // Returns 0 on success, -1 otherwise. - // - - /* -----------------------------------------------------*/ - // = ACCESS - // - virtual const KnUniqueId& get_id (void) const; - // Returns a reference to the unique identifier - - virtual ACE_HANDLE get_port_number(void) const; - virtual ACE_HANDLE get_handle(void) const; - // Returns the local port no( can be used as an ACE_HANDLE) - - virtual int is_configured(void) const; - // Returns 1, if address information is proper; Returns 0 otherwise - virtual ACE_CLASSIX_Addr::Addr_Type is_type(void) const; - // returns the type of the address - - // = HELPER - virtual void dump(void) const; - - ACE_ALLOC_HOOK_DECLARE; - // Declares the dynamic allocation hooks. - -private: -}; - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Addr.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_ADDR_H */ diff --git a/ace/CLASSIX/CLASSIX_Addr.i b/ace/CLASSIX/CLASSIX_Addr.i deleted file mode 100644 index 13cc5fd48e3..00000000000 --- a/ace/CLASSIX/CLASSIX_Addr.i +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// CLASSIX_Addr.i - -ACE_INLINE -ACE_CLASSIX_Addr::ACE_CLASSIX_Addr(int theSize) - : ACE_Addr (AF_CLASSIX, theSize) -{ -} - -ACE_INLINE -ACE_CLASSIX_Addr::~ACE_CLASSIX_Addr(void) -{ -} - -ACE_INLINE -const KnUniqueId& -ACE_CLASSIX_Addr::get_id(void) const -{ - return ACE_CLASSIX_OS::null_KnUniqueId(); -} - -ACE_INLINE -ACE_HANDLE -ACE_CLASSIX_Addr::get_handle(void) const -{ - return ACE_INVALID_HANDLE; -} - -ACE_INLINE -ACE_HANDLE -ACE_CLASSIX_Addr::get_port_number(void) const -{ - return get_handle(); -} - -ACE_INLINE -int -ACE_CLASSIX_Addr::is_configured(void) const -{ - return 0; -} - -ACE_INLINE -ACE_CLASSIX_Addr::Addr_Type -ACE_CLASSIX_Addr::is_type(void) const -{ - return ACE_CLASSIX_Addr::UNDEFINED; -} - -ACE_INLINE -void -ACE_CLASSIX_Addr::dump(void) const -{ -} diff --git a/ace/CLASSIX/CLASSIX_CLD_Connector.cpp b/ace/CLASSIX/CLASSIX_CLD_Connector.cpp deleted file mode 100644 index 1baf897b75b..00000000000 --- a/ace/CLASSIX/CLASSIX_CLD_Connector.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// $Id$ -/* -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_CLD_Connector.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// -// ============================================================================ -*/ -#define ACE_BUILD_DLL -#include "ace/CLASSIX/CLASSIX_CLD_Connector.h" -#include "ace/CLASSIX/CLASSIX_Addr.h" - -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_CLD_Connector) - -#if !defined (__ACE_INLINE__) -#include "CLASSIX_CLD_Connector.i" -#endif /* __ACE_INLINE__ */ -/* ------------------------------------------------------------------------- */ - -ACE_CLASSIX_CLD_Connector::ACE_CLASSIX_CLD_Connector ( - ACE_CLASSIX_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_CLASSIX_CLD_Connector::ACE_CLASSIX_CLD_Connector"); - if (this->connect (new_stream, remote_sap, timeout, local_sap, - reuse_addr, flags, perms, - protocol_family, protocol) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), ACE_TEXT - ("ACE_CLASSIX_CLD_Connector::ACE_CLASSIX_CLD_Connector"))); -} - -// Set up remote port information -int -ACE_CLASSIX_CLD_Connector::connect (ACE_CLASSIX_Stream &new_stream, - const ACE_Addr & theRemote,/* remote_sap */ - ACE_Time_Value *, /* timeout */ - const ACE_Addr & theLocal, - int, /* reuse_addr */ - int theFlag, /* flags */ - int, /* perms */ - int theProtocolFamily, - int /* protocol */) - -{ - ACE_TRACE ("ACE_CLASSIX_CLD_Connector::connect"); - // - // Set up peer SAP - // - if (theRemote == ACE_Addr::sap_any || - new_stream.set_peer_sap(theRemote) != 0) - ACE_ERROR_RETURN((LM_ERROR, "ACE_CLASSIX_CLD_Connector::connect()::" - "Invalid Connector SAP\n"), -1); - - // - // Set up local SAP - // - if (theLocal == ACE_Addr::sap_any) - { - // if local sap has not been configured - // create a port and use it as the local SAP - new_stream.open(); - } - else - { - // replace the local SAP information - new_stream.close(); - new_stream.open(theLocal); - } - - // - // Make the local SAP "selectable", if requested via the flag - // - if (new_stream.local_sap().is_configured() && - new_stream.peer_sap().is_configured() && /* remote sap info exist */ - theProtocolFamily == ACE_CLASSIX_Addr::AF_CLASSIX) - { - new_stream.control(); - // setup the default delivery mode, if applicable - if (theFlag & ACE_CLASSIX_CLD_Connector::ENABLE) - { - if (new_stream.selectable() == 0) - return 0; - else - return -1; - } - return 0; - } - else - { - return -1; - } -} - -void -ACE_CLASSIX_CLD_Connector::dump (void) const -{ - ACE_TRACE ("ACE_CLASSIX_CLD_Connector::dump"); -} - -/* ------------------------------------------------------------------------- */ diff --git a/ace/CLASSIX/CLASSIX_CLD_Connector.h b/ace/CLASSIX/CLASSIX_CLD_Connector.h deleted file mode 100644 index 324d484e65e..00000000000 --- a/ace/CLASSIX/CLASSIX_CLD_Connector.h +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -/* -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_CLD_Connector.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ -*/ - -#ifndef ACE_CLASSIX_CLD_CONNECTOR_H -#include "ace/pre.h" -#define ACE_CLASSIX_CLD_CONNECTOR_H - -#include "ace/CLASSIX/CLASSIX_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/* ------------------------------------------------------------------------- */ - -class ACE_CLASSIX_CLD_Connector - // = TITLE - // Defines an CLASSIX IPC connectionless connection factory for the - // template methods in . - // - // = DESCRIPTION - // This is used when a client needs to communicate with a server - // whose SAP address is known beforehand. - // - // Although there is a connection - // procedure, no connection is actually taken place - // between the client and server, since Chorus IPC does not have - // connection semantics. - // The connect procedure is necessary for - // compatibility with class. - // - // This class will simplify the client's - // program, since it provides connection-like communication - // mechanism. - // - // = NOTES - // The server in this case trusts everyone who lands on the - // server's SAP. - // - // = SEE ALSO - // ACE_CLASSIX_COD_Connector -{ - public: - // = Connect options - enum OPTIONS - { - // Do not enable the local SAP - // (so that the Reactor will not monitor the port) - ENABLE = 0x1 - }; - - // = Initialization routines. - ACE_CLASSIX_CLD_Connector (void); - // Default constructor. - - ACE_CLASSIX_CLD_Connector (ACE_CLASSIX_Stream &new_stream, - const ACE_Addr &remote_sap - = ACE_Addr::sap_any, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family - = ACE_CLASSIX_Addr::AF_CLASSIX, - int protocol = 0); - // Emulates connection semantics so that it can be plugged into - // - // Actively connect local SAP and remote SAP togeter. - // Produce a if things go well. - // - // is the peer's address. In ACE_SOCK_Connector it refers to - // the acceptor's address. In connectionless mode, we do not have - // an acceptor. The address will be copied to the new stream - // if things goes well. - // - // If refers to any address, a port will be - // allocated and will be used as a local SAP. - // - // The rest parameters are there so that this class can be plugged into - // . - - virtual int connect (ACE_CLASSIX_Stream &new_stream, - const ACE_Addr &remote_sap = ACE_Addr::sap_any, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family = ACE_CLASSIX_Addr::AF_CLASSIX, - int protocol = 0); - - // Factory method used in ::connect_svc_handler() - - // Initialization method when default constructor is used. - // See the comments for the corresponding constructor - - virtual int reset_new_handle (ACE_HANDLE handle); - // Factory method used in ACE_Connector::handle_output(). - // Meant for resetting any event associations on this handle - // Does nothig. - - // = HELPER - void dump(void) const; - - private: - - ACE_CLASSIX_CLD_Connector(ACE_CLASSIX_CLD_Connector const&); - ACE_CLASSIX_CLD_Connector const& operator=(ACE_CLASSIX_CLD_Connector const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_CLD_Connector.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_CLD_CONNECTOR_H */ diff --git a/ace/CLASSIX/CLASSIX_CLD_Connector.i b/ace/CLASSIX/CLASSIX_CLD_Connector.i deleted file mode 100644 index 8592b7825d2..00000000000 --- a/ace/CLASSIX/CLASSIX_CLD_Connector.i +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -// -// CLASSIX/CLD_Connector.i -/* ------------------------------------------------------------------------- */ - -// Do-nothing constructor... - -ACE_INLINE -ACE_CLASSIX_CLD_Connector::ACE_CLASSIX_CLD_Connector (void) -{ - ACE_TRACE ("ACE_CLASSIX_CLD_Connector::ACE_CLASSIX_CLD_Connector"); -} - -ACE_INLINE -int -ACE_CLASSIX_CLD_Connector::reset_new_handle (ACE_HANDLE /* handle */) -{ - return 0; -} - -/* ------------------------------------------------------------------------- */ - - diff --git a/ace/CLASSIX/CLASSIX_CO_Acceptor.cpp b/ace/CLASSIX/CLASSIX_CO_Acceptor.cpp deleted file mode 100644 index b46d594c262..00000000000 --- a/ace/CLASSIX/CLASSIX_CO_Acceptor.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "CLASSIX_CO_Acceptor.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "CLASSIX_CO_Acceptor.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/Synch.h" - -ACE_ALLOC_HOOK_DEFINE (ACE_CLASSIX_CO_Acceptor) - -// General purpose routine for performing server creation. - -ACE_CLASSIX_CO_Acceptor::ACE_CLASSIX_CO_Acceptor (const ACE_Addr &local_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol, - ACE_Reactor* theReactor) - : port_ (0), - reactor_ (theReactor) -{ - ACE_TRACE ("ACE_CLASSIX_CO_Acceptor::ACE_CLASSIX_CO_Acceptor"); - if (this->open (local_sap, reuse_addr, protocol_family, - backlog, protocol, theReactor) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_CLASSIX_CO_Acceptor"))); -} - -// General purpose routine for performing server creation. - -int -ACE_CLASSIX_CO_Acceptor::open (const ACE_Addr & theLocalSap, - int /* reuse_addr */, - int theProtocolFamily, - int /* backlog */, - int /* protocol */, - ACE_Reactor* theReactor) -{ - // make sure that the client requests for a "CLASSIX" family. - - if (theProtocolFamily != ACE_CLASSIX_Addr::AF_CLASSIX) - return -1; - - // Setup local address - - int error = 0; - if (theLocalSap == ACE_Addr::sap_any) - { - this->port_ = new ACE_CLASSIX_Port_Core (); - ACE_ASSERT (this->port_); - error = this->addr_.set (*this->port_); - } - else - error = this->addr_.set (theLocalSap); - - if (error != 0) - ACE_ERROR_RETURN ((LM_ERROR, "ACE_CLASSIX_CO_Acceptor::open ()::" - "Cannot setup address\n"), -1); - - // Make the port "selectable" - - if (this->addr_.selectable () != 0) - ACE_ERROR_RETURN ((LM_ERROR, "ACE_CLASSIX_CO_Acceptor::open ()::" - "Cannot enable port\n"), -1); - - this->reactor_ = theReactor; - return 0; -} - -// General purpose routine for accepting new connections. - -int -ACE_CLASSIX_CO_Acceptor::accept (ACE_CLASSIX_Stream &new_stream, - ACE_Addr *remote_addr, - ACE_Time_Value* /* timeout */, - int /* restart */, - int /* reset_new_handle */) const -{ - ACE_TRACE ("ACE_CLASSIX_CO_Acceptor::accept"); - - // Get peer's address info - - size_t size = 0; - if (this->reactor_->current_info (this->get_handle (), size) - == -1) - ACE_ERROR_RETURN ((LM_ERROR, "ACE_CLASSIX_CO_Acceptor:.accept ()::" - "Cannot get peer addr\n"), -1); - - ACE_CLASSIX_CO_Acceptor::Peer_Union data; - ACE_CLASSIX_Msg rmsg (&data, sizeof (ACE_CLASSIX_CO_Acceptor::Peer_Union)); - if (size != sizeof (ACE_CLASSIX_CO_Acceptor::Peer_Union) - || ::ipcGetData (rmsg.get ()) != size) - ACE_ERROR_RETURN ((LM_ERROR, "%t" - "ACE_CLASSIX_CO_Acceptor::accept::ipcGetData (%d)\n", - size), - -1); - - // Set up Peer SAP - - int error = 0; - switch (data.type) - { - case ACE_CLASSIX_Addr::PORT: - error = new_stream.set_peer_sap (data.choose.port.peer); - break; - - case ACE_CLASSIX_Addr::GROUP: - error = new_stream.set_peer_sap (data.choose.group.peer); - break; - - case ACE_CLASSIX_Addr::STAMP: - error = new_stream.set_peer_sap (data.choose.stamp.peer); - break; - - case ACE_CLASSIX_Addr::DYNAMIC: - error = new_stream.set_peer_sap (data.choose.group.peer); - break; - - default: - ACE_ERROR_RETURN ((LM_ERROR, "ACE_CLASSIX_CO_Accept::accept ()::" - "Invalid peer address\n"), -1); - } - - if (error != 0) - ACE_ERROR_RETURN ((LM_ERROR, "ACE_CLASSIX_CO_Accept::accept ()::" - "cannot set peer address\n"), -1); - - // Set up local SAP & tell the peer - - data.type = ACE_CLASSIX_Addr::UNDEFINED; - - if (remote_addr != 0) - { - if (remote_addr->get_type () == ACE_CLASSIX_Addr::AF_CLASSIX && - ((ACE_CLASSIX_Addr*) remote_addr)->is_type == - ACE_CLASSIX_Addr::PORT) - { - new_stream.get_local_sap ().set (*remote_addr); - data.type = ACE_CLASSIX_Addr::PORT; - } - } - else - { - ACE_CLASSIX_Port_Core *port = new ACE_CLASSIX_Port_Core (); - if (new_stream.set_local_port (port) == 0) - data.type = ACE_CLASSIX_Addr::PORT;; - } - - data.choose.port.peer = - new_stream.get_local_sap ().get_addr ().get_id (); - - ACE_CLASSIX_Msg smsg (&data, sizeof (ACE_CLASSIX_CO_Acceptor::Peer_Union)); - - if (::ipcReply (smsg.get ()) != 0) - ACE_ERROR_RETURN ((LM_ERROR, "ACE_CLASSIX_CO_Accept::accept ()::" - "cannot deliver server address to peer\n"), -1); - - // Make new_stream's local SAP selectable. - if (new_stream.selectable () != 0) - return -1; - - return 0; -} - -int -ACE_CLASSIX_CO_Acceptor::close (void) -{ - ACE_TRACE ("ACE_CLASSIX_CO_Acceptor::close"); - int result = 0; - - if (this->get_handle () != ACE_INVALID_HANDLE) - { - delete this->port_; - this->port_ = 0; - ((ACE_CLASSIX_Port) this->addr_.get_addr ()).clear (); - } - return 0; -} - - -int -ACE_CLASSIX_CO_Acceptor::get_local_addr (ACE_Addr &theAddr) const -{ - int size = theAddr.get_size (); - if (size < this->addr_.get_addr ().get_size ()) - return -1; - - return this->addr_.get_addr (theAddr); -} - -void -ACE_CLASSIX_CO_Acceptor::dump (void) const -{ - ACE_TRACE ("ACE_CLASSIX_CO_Acceptor::dump"); -} diff --git a/ace/CLASSIX/CLASSIX_CO_Acceptor.h b/ace/CLASSIX/CLASSIX_CO_Acceptor.h deleted file mode 100644 index b095b394ba7..00000000000 --- a/ace/CLASSIX/CLASSIX_CO_Acceptor.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// CLASSIX_CO_Acceptor.h -// -// = AUTHOR -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_CO_ACCEPTOR_H -#include "ace/pre.h" -#define ACE_CLASSIX_CO_ACCEPTOR_H - -#include "ace/CLASSIX/CLASSIX_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Time_Value.h" - -class ACE_Export ACE_CLASSIX_CO_Acceptor -{ - // = TITLE - // Defines the format and interface for a connection - // oriented acceptor. - // - // = DESCRIPTION - // This class is the counter part of the - // class. It exchanges SAP information to set up a logical - // connection. - // - // Data format passed between a connector and this class uses - // Peer_Union structure. - // - // = SEE ALSO - // ACE_CLASSIX_Connector - // -public: - struct Peer_Port - { - KnUniqueId peer; - }; - - struct Peer_Group - { - KnCap peer; - }; - - struct Peer_Stamp - { - int peer; - }; - - struct Peer_Union - { - int type; - union - { - Peer_Port port; - Peer_Group group; - Peer_Stamp stamp; - }choose; - }; - - // = Initialization methods. - ACE_CLASSIX_CO_Acceptor (ACE_Reactor* = ACE_Reactor::instance()); - // Default constructor. - - ACE_CLASSIX_CO_Acceptor (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = ACE_CLASSIX_Addr::AF_CLASSIX, - int backlog = 0, - int protocol = 0, - ACE_Reactor* = ACE_Reactor::instance()); - // Initiate a passive mode socket. - - virtual ~ACE_CLASSIX_CO_Acceptor (void); - // Default dtor. - - int open (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = ACE_CLASSIX_Addr::AF_CLASSIX, - int backlog = 5, - int protocol = 0, - ACE_Reactor* = ACE_Reactor::instance()); - // Initiate a passive mode socket. - int close (void); - // Closes down the listening port. - - // = Passive connection acceptance method. - int accept (ACE_CLASSIX_Stream &new_stream, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; - // Accept a new data transfer connection. A of 0 means - // block forever, a of {0, 0} means poll. == 1 - // means "restart if interrupted." - - // = ACCESS - ACE_HANDLE get_handle (void) const; - // Get the underlying descriptor. - int get_local_addr (ACE_Addr &) const; - // Return the local endpoint address in the referenced ACE_Addr. - // Returns 0 if successful, else -1. - - void reactor(ACE_Reactor*); - // reset the reactor - - // = META-TYPE info - typedef ACE_CLASSIX_Addr PEER_ADDR; - typedef ACE_CLASSIX_Stream PEER_STREAM; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - -private: - - ACE_CLASSIX_Port_Core *port_; - // optional port. - // If 0, default port is used. - ACE_CLASSIX_SAP addr_; - - ACE_Reactor *reactor_; - // for reference only. Does not own it -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/CLASSIX/CLASSIX_CO_Acceptor.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_CO_ACCEPTOR_H */ diff --git a/ace/CLASSIX/CLASSIX_CO_Acceptor.i b/ace/CLASSIX/CLASSIX_CO_Acceptor.i deleted file mode 100644 index dcb6a0d2862..00000000000 --- a/ace/CLASSIX/CLASSIX_CO_Acceptor.i +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Do nothing routine for constructor. -ACE_INLINE -ACE_CLASSIX_CO_Acceptor::ACE_CLASSIX_CO_Acceptor (ACE_Reactor* theReactor) - : port_ (0), - reactor_ (theReactor) -{ - ACE_TRACE ("ACE_CLASSIX_Acceptor::ACE_CLASSIX_Acceptor"); -} - -ACE_INLINE -ACE_CLASSIX_CO_Acceptor::~ACE_CLASSIX_CO_Acceptor(void) -{ - delete this->port_; -} - -ACE_INLINE -void -ACE_CLASSIX_CO_Acceptor::reactor(ACE_Reactor* theReactor) -{ - this->reactor_ = theReactor; -} - -ACE_INLINE -ACE_HANDLE -ACE_CLASSIX_CO_Acceptor::get_handle(void) const -{ - return this->addr_.get_handle(); -} diff --git a/ace/CLASSIX/CLASSIX_CO_Connector.cpp b/ace/CLASSIX/CLASSIX_CO_Connector.cpp deleted file mode 100644 index 12280142b2b..00000000000 --- a/ace/CLASSIX/CLASSIX_CO_Connector.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// $Id$ -/* -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_CO_Connector.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ -*/ -#define ACE_BUILD_DLL -#include "ace/CLASSIX/CLASSIX_CO_Connector.h" -#include "ace/CLASSIX/CLASSIX_CO_Acceptor.h" - -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_CO_Connector) - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_CO_Connector.i" -#endif /* __ACE_INLINE__ */ -/* ------------------------------------------------------------------------- */ - -// Set up remote port information - -int -ACE_CLASSIX_CO_Connector::connect (ACE_CLASSIX_Stream &new_stream, - const ACE_Addr & theAcceptor,/* acceptor */ - ACE_Time_Value * theTimeout, /* timeout */ - const ACE_Addr & theLocal, - int theReuse, - int theFlag, - int thePerm, - int theProtocolFamily, - int theProtocol) - -{ - // - // set up local SAP and connector info in - // - if (this->ACE_CLASSIX_CLD_Connector:: - connect(new_stream, - theAcceptor, - theTimeout, - theLocal, - theReuse, - theFlag & (~ACE_CLASSIX_CLD_Connector::ENABLE), - thePerm, - theProtocolFamily, - theProtocol) != 0) - return -1; - - // - // make a connection - // - // Tell the connector my own SAP - ACE_CLASSIX_CO_Acceptor::Peer_Union peer; - size_t size = sizeof (ACE_CLASSIX_CO_Acceptor::Peer_Union); - peer.type = ACE_CLASSIX_Addr::PORT; - peer.choose.port.peer = new_stream.local_sap().get_addr().get_id(); - - if (new_stream.send((void*) &peer, size) != size) - ACE_ERROR_RETURN((LM_ERROR, "%t|%P|%p\n", - "ACE_CLASSIX_Connector::connect()::send:"), -1); - // Wait for peer SAP information from the acceptor - if (new_stream.ipcRecv((void*) &peer, size, 0, theTimeout) != size) - ACE_ERROR_RETURN((LM_ERROR, "ACE_CLASSIX_Connector::connect()::" - "unable to receive connect response\n"), -1); - - int error = 0; - switch (peer.type) - { - case ACE_CLASSIX_Addr::PORT: - error = new_stream.set_peer_sap(peer.choose.port.peer); - break; - - case ACE_CLASSIX_Addr::GROUP: - error = new_stream.set_peer_sap(peer.choose.group.peer); - break; - - case ACE_CLASSIX_Addr::STAMP: - error = new_stream.set_peer_sap(peer.choose.stamp.peer); - break; - - case ACE_CLASSIX_Addr::DYNAMIC: - error = new_stream.set_peer_sap(peer.choose.group.peer); - break; - - default: - ACE_ERROR_RETURN((LM_ERROR, "ACE_CLASSIX_Connect::connect()::" - "Invalid peer address\n"), -1); - } - - if (error != 0) - ACE_ERROR_RETURN((LM_ERROR, "ACE_CLASSIX_Connector::connect()::" - "unable to receive connect response\n"), -1); - - - // - // Make the local SAP "selectable" - // - if (theFlag & ACE_CLASSIX_CO_Connector::ENABLE && - new_stream.selectable() != 0) - return -1; - - return 0; -} - -void -ACE_CLASSIX_CO_Connector::dump (void) const -{ - ACE_TRACE ("ACE_CLASSIX_CO_Connector::dump"); -} - -/* ------------------------------------------------------------------------- */ diff --git a/ace/CLASSIX/CLASSIX_CO_Connector.h b/ace/CLASSIX/CLASSIX_CO_Connector.h deleted file mode 100644 index b59e04a72e2..00000000000 --- a/ace/CLASSIX/CLASSIX_CO_Connector.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -/* -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_CO_Connector.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ -*/ - -#ifndef ACE_CLASSIX_CO_CONNECTOR_H -#include "ace/pre.h" -#define ACE_CLASSIX_CO_CONNECTOR_H - -#include "ace/CLASSIX/CLASSIX_CLD_Connector.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/* ------------------------------------------------------------------------- */ - -class ACE_CLASSIX_CO_Connector : public ACE_CLASSIX_CLD_Connector - // = TITLE - // Defines an CLASSIX IPC connection factory for the - // template methods in . - // - // = DESCRIPTION - // This is used when a client needs to communicate with a server - // whose SAP address is unknown. - // - // and exchanges - // address(SAP) information to establish a logical link. - // - // = NOTES - // There is no other identifier and sequence information - // passed between the acceptor and the connector. - // Some applications may need to have a - // reliable protocol for the connection setup procedure. - // - // = SEE ALSO - // ACE_CLASSIX_CLD_Connector - // ACE_CLASSIX_Acceptor - // -{ - public: - // = Initialization routines. - ACE_CLASSIX_CO_Connector (void); - // Default constructor. - - ACE_CLASSIX_CO_Connector (ACE_CLASSIX_Stream &new_stream, - const ACE_Addr &remote_sap - = ACE_Addr::sap_any, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family - = ACE_CLASSIX_Addr::AF_CLASSIX, - int protocol = 0); - // Emulates connection semantics so that it can be plugged into - // - // Actively connect local SAP and remote SAP togeter. - // Produce a if things go well. - // - // is the peer's address. In ACE_SOCK_Connector it refers to - // the acceptor's address. In connectionless mode, we do not have - // an acceptor. The address will be copied to the new stream - // if things goes well. - // - // If refers to any address, a port will be - // allocated and will be used as a local SAP. - // - // The rest parameters are there so that this class can be plugged into - // . - - int connect (ACE_CLASSIX_Stream &new_stream, - const ACE_Addr &remote_sap = ACE_Addr::sap_any, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family = ACE_CLASSIX_Addr::AF_CLASSIX, - int protocol = 0); - - // Factory method used in ::connect_svc_handler() - - // Initialization method when default constructor is used. - // See the comments for the corresponding constructor - - // = HELPER - void dump(void) const; - - - private: - - ACE_CLASSIX_CO_Connector(ACE_CLASSIX_CO_Connector const&); - ACE_CLASSIX_CO_Connector const& operator=(ACE_CLASSIX_CO_Connector const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_CO_Connector.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_CO_CONNECTOR_H */ diff --git a/ace/CLASSIX/CLASSIX_CO_Connector.i b/ace/CLASSIX/CLASSIX_CO_Connector.i deleted file mode 100644 index 7f28a66719f..00000000000 --- a/ace/CLASSIX/CLASSIX_CO_Connector.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -// -// CLASSIX_CO_Connector.i -/* ------------------------------------------------------------------------- */ - -ACE_INLINE -ACE_CLASSIX_CO_Connector::ACE_CLASSIX_CO_Connector ( - ACE_CLASSIX_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms, - int protocol_family, - int protocol) - : ACE_CLASSIX_CLD_Connector(new_stream, remote_sap, timeout, local_sap, - reuse_addr, flags, perms, - protocol_family, protocol) -{ - ACE_TRACE ("ACE_CLASSIX_CO_Connector::ACE_CLASSIX_CO_Connector"); -} - -// Do-nothing constructor... - -ACE_INLINE -ACE_CLASSIX_CO_Connector::ACE_CLASSIX_CO_Connector (void) - : ACE_CLASSIX_CLD_Connector() -{ - ACE_TRACE ("ACE_CLASSIX_CO_Connector::ACE_CLASSIX_CO_Connector"); -} - -/* ------------------------------------------------------------------------- */ - - diff --git a/ace/CLASSIX/CLASSIX_Dgram_Mcast.cpp b/ace/CLASSIX/CLASSIX_Dgram_Mcast.cpp deleted file mode 100644 index 112d25956b7..00000000000 --- a/ace/CLASSIX/CLASSIX_Dgram_Mcast.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// IPP -// -// = FILENAME -// CLASSIX/Dgram_Mcast.cpp -// -// = AUTHOR(S) -// Wei Chiang -// -// = COPYRIGHT -// Copyright 1998 Nokia Telecommunications -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_Dgram_Mcast.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Dgram_Mcast.i" -#endif /* __ACE_INLINE__ */ -/* ------------------------------------------------------------------------- */ -int -ACE_CLASSIX_Dgram_Mcast::set_saps(int theStamp, - const ACE_CLASSIX_Port& thePort) -{ - this->local_sap_.set_addr(thePort); - if (this->peer_sap_.set(theStamp) != 0) - { - errno = EADDRNOTAVAIL; - ACE_ERROR_RETURN((LM_ERROR, "ACE_CLASSIX_Dgram_Mcast- " - "failed to set up peer sap address \n"), -1); - } - else - { - this->dest_.target = this->peer_sap_.get_addr()->get_id(); - return 0; - } -} - - -int -ACE_CLASSIX_Dgram_Mcast::set_mode_(u_int theMode, int theSite) -{ - int result = K_EFAULT; - if (theMode <= K_FUNCXMODE && - (result =::uiSite(&this->dest_.coTarget, theSite)) == 0) - result = ::ipcTarget(&this->dest_.target, theMode); - - if (result != 0) - { - errno = ACE_CLASSIX_OS::convert_io_error(result); - result = -1; - } - return result; -} - -int -ACE_CLASSIX_Dgram_Mcast::set_mode_(u_int theMode) -{ - int result = K_EFAULT; - if (theMode <= K_FUNCXMODE ) - result = ::ipcTarget(&this->dest_.target, theMode); - - if (result < 0) - { - errno = ACE_CLASSIX_OS::convert_io_error(result); - result = -1; - } - return result; -} - - -void -ACE_CLASSIX_Dgram_Mcast::dump (void) const -{ - ACE_DEBUG ((LM_DEBUG, "ACE_CLASSIX_Dgram_Mcast...\n")); - this->ACE_CLASSIX_Stream::dump(); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_Dgram_Mcast.h b/ace/CLASSIX/CLASSIX_Dgram_Mcast.h deleted file mode 100644 index 35166b99ca0..00000000000 --- a/ace/CLASSIX/CLASSIX_Dgram_Mcast.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Dgram_Mcast.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_DGRAM_MCAST_H -#include "ace/pre.h" -#define ACE_CLASSIX_DGRAM_MCAST_H - -/* ------------------------------------------------------------------------- */ -#include - -class ACE_CLASSIX_Dgram_Mcast : public ACE_CLASSIX_Stream - // = TITLE - // Provides Dgram_Mcast interfaces for CLASSIX IPC communications. - // - // = DESCRIPTION - // This class represents multiple end-points for message delivery. - // All the remote ports are belong to the same group identified by - // a stamp. - // It uses the broadcast mode provided by ipcSend() to deliver - // messages. - // - // This class is most likely used in the server. - // -{ - public: - // = INITIALIZATION - ACE_CLASSIX_Dgram_Mcast(void); - // Default constructor, does not setup anything - - ACE_CLASSIX_Dgram_Mcast(int /* stamp */, - const ACE_CLASSIX_Port& = - *ACE_CLASSIX_DEFAULT_PORT::instance()); - // remote SAP = port group, local SAP = default port - - int set_saps(int /* stamp */, - const ACE_CLASSIX_Port& = - *ACE_CLASSIX_DEFAULT_PORT::instance()); - // remote SAP = port group, local SAP = default port - - //virtual ssize_t send (const void *, /* buf */ - // size_t /* n */) const; - - - // = HELPER - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - protected: - - virtual int set_mode_(u_int = K_BROADMODE); /* theMode */ - // Sets the addressing mode with the current setting of coTarget - virtual int set_mode_(u_int, /* mode */ int /* site */); - // Sets the addressing mode as well as the coTarget - - // Site information for delivery mode, see - // Can be changed by control()/set_mode_() - int dest_site_; - - - private: - // Disable copy constructor - ACE_CLASSIX_Dgram_Mcast(ACE_CLASSIX_Dgram_Mcast const&); - ACE_CLASSIX_Dgram_Mcast const& operator=(ACE_CLASSIX_Dgram_Mcast const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Dgram_Mcast.i" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_DGRAM_MCAST_H */ diff --git a/ace/CLASSIX/CLASSIX_Dgram_Mcast.i b/ace/CLASSIX/CLASSIX_Dgram_Mcast.i deleted file mode 100644 index 5d9fd3df0d3..00000000000 --- a/ace/CLASSIX/CLASSIX_Dgram_Mcast.i +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -// -// ace/CLASSIX_Dgram_Mcast.i -/* ------------------------------------------------------------------------- */ -ACE_INLINE -ACE_CLASSIX_Dgram_Mcast::ACE_CLASSIX_Dgram_Mcast(void) - : ACE_CLASSIX_Stream() -{ -} - -ACE_INLINE -ACE_CLASSIX_Dgram_Mcast::ACE_CLASSIX_Dgram_Mcast (int theStamp, - const ACE_CLASSIX_Port& thePort) - : ACE_CLASSIX_Stream() -{ - this->set_saps(theStamp, thePort); -} - - -/* ------------------------------------------------------------------------- */ diff --git a/ace/CLASSIX/CLASSIX_Group.cpp b/ace/CLASSIX/CLASSIX_Group.cpp deleted file mode 100644 index cb0064d3298..00000000000 --- a/ace/CLASSIX/CLASSIX_Group.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Group.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_Group.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Group.i" -#endif /* __ACE_INLINE__ */ -/* ------------------------------------------------------------------------- */ - -void -ACE_CLASSIX_Group::init_(void) -{ - this->clear_config_(); - this->addr_.group_.ui.uiHead = this->addr_.group_.ui.uiTail = 0; - this->addr_.group_.key.keyHead = this->addr_.group_.key.keyTail = 0; -} - -void -ACE_CLASSIX_Group::set_addr(void* theSrc, int theLen) -{ - if (theLen > this->get_size()) - return; - - ACE_OS::memcpy ((void *) &this->addr_, - (void *) theSrc, theLen); -} - -void -ACE_CLASSIX_Group::set_addr(const KnCap& thePeer) -{ - this->addr_.group_ = thePeer; - this->set_config_(); -} - - -int -ACE_CLASSIX_Group::insert(const ACE_CLASSIX_Port* thePort) -{ - if (this->is_configured()) - return ::grpPortInsert((KnCap*) &this->get_cap(), - (KnUniqueId*) &thePort->get_id()); - else - return K_EINVAL; -} - -int -ACE_CLASSIX_Group::remove(const ACE_CLASSIX_Port* thePort) -{ - if (this->is_configured()) - return ::grpPortRemove((KnCap*) &this->get_cap(), - (KnUniqueId*) &thePort->get_id()); - else - return K_EINVAL; -} - -void -ACE_CLASSIX_Group::dump(void) const -{ - ACE_DEBUG ((LM_DEBUG, "ACE_CLASSIX_Group...\n")); - char s[200]; - if (!this->is_configured()) - ACE_OS::sprintf(s, "Group has not been setup\n"); - else - { - const KnCap &group = this->get_cap(); - ACE_OS::sprintf (s, "id head = %d(%x), id tail = %d(%x)\n" - "key head = %d(%x) key tail = %d(%x)\n", - group.ui.uiHead, group.ui.uiHead, - group.ui.uiTail, group.ui.uiTail, - group.key.keyHead, group.key.keyHead, - group.key.keyTail, group.key.keyTail); - } - ACE_DEBUG ((LM_DEBUG, "\n%s", s)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_Group.h b/ace/CLASSIX/CLASSIX_Group.h deleted file mode 100644 index 5c4c6dfabc5..00000000000 --- a/ace/CLASSIX/CLASSIX_Group.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX/Group.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_GROUP_H -#include "ace/pre.h" -#define ACE_CLASSIX_GROUP_H - -/* ------------------------------------------------------------------------- */ -#include "ace/CLASSIX/CLASSIX_Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/CLASSIX/CLASSIX_Port.h" - -class ACE_CLASSIX_Group : public ACE_CLASSIX_Addr - // = TITLE - // Wrapper over Chorus's Group concept. - // - // = DESCRIPTION - // Provides interface to insert and remove ports in the group which is - // created based on a given KnCap. This" is the unique - // identifier of the group. - // - // = NOTE - // Chorus does not provide facility to remove a group from the system, - // nor explicitly create a group. - // As such, the wrapper allows users to freely change from one group - // to the other within the same instance. - // - // = SEE ALSO - // , - // -{ - public: - // = INITIALIZATION - ACE_CLASSIX_Group(void*, /* group id */ int /* len */); - // Sets up the group wrapper using the supplied group id. - ACE_CLASSIX_Group(const KnCap&); - // Sets up the group wrapper using the supplied KnCap - - // = ACCESS - int is_configured(void) const; - // Returns 1, if it contains valid group id; 0, otherwise. - virtual ACE_CLASSIX_Addr::Addr_Type is_type(void) const; - // returns GROUP type - void* get_addr(void) const; - // Returns the group id - virtual const KnUniqueId& get_id (void) const; - // Returns a reference to the unique identifier - virtual void set_addr(void* /* source */, int /* len */); - // Sets the group information according to the supplied data - // in raw format. - virtual void set_addr(const KnCap&); - // Sets the group information according to the supplied KnCap. - const KnCap& get_cap(void) const; - // Returns the capability to the supplied location - // If the address is not configured, the return value is unpredictable. - int insert(const ACE_CLASSIX_Port*); - int remove (const ACE_CLASSIX_Port*); - // Inserts/removes the specified port in to the group - // Returns 0, if successful; returns a negative value otherwise - - int operator == (const ACE_CLASSIX_Group &) const; - int operator != (const ACE_CLASSIX_Group &) const; - - // = HELPER - void dump(void) const; - - protected: - // = INITIALIZATION - ACE_CLASSIX_Group(); - // default constructor, does nothing but init. - - void init_(void); - // Initializes the structure. - - void set_config_(); - // Sets the group configured. - void clear_config_(); - // Sets the group not-configured. - - struct group_addr - { - int config_; // 1, if the following fields are valid - KnCap group_; - }; - group_addr addr_; - - private: - - // disable copy/assignment constructor - ACE_CLASSIX_Group(ACE_CLASSIX_Group const&); - ACE_CLASSIX_Group const& operator=(ACE_CLASSIX_Group const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Group.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_GROUP_H */ diff --git a/ace/CLASSIX/CLASSIX_Group.i b/ace/CLASSIX/CLASSIX_Group.i deleted file mode 100644 index e3650502a10..00000000000 --- a/ace/CLASSIX/CLASSIX_Group.i +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CLASSIX_Group::ACE_CLASSIX_Group() - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Group::group_addr)) -{ - this->init_(); -} - -ACE_INLINE -ACE_CLASSIX_Group::ACE_CLASSIX_Group(void* theSrc, int theLen) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Group::group_addr)) -{ - this->set_addr(theSrc, theLen); -} - -ACE_INLINE -ACE_CLASSIX_Group::ACE_CLASSIX_Group(const KnCap& thePeer) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Group::group_addr)) -{ - this->set_addr(thePeer); -} - -ACE_INLINE -void * -ACE_CLASSIX_Group::get_addr(void) const -{ - return (void*) &this->addr_; -} - -ACE_INLINE -const KnUniqueId& -ACE_CLASSIX_Group::get_id(void) const -{ - return this->addr_.group_.ui; -} - -ACE_INLINE -int -ACE_CLASSIX_Group::is_configured(void) const -{ - return this->addr_.config_ == 1; -} - -ACE_INLINE -ACE_CLASSIX_Addr::Addr_Type -ACE_CLASSIX_Group::is_type(void) const -{ - return ACE_CLASSIX_Addr::GROUP; -} - -ACE_INLINE -void -ACE_CLASSIX_Group::set_config_(void) -{ - this->addr_.config_ = 1; -} - -ACE_INLINE -void -ACE_CLASSIX_Group::clear_config_(void) -{ - this->addr_.config_ = 0; -} - -ACE_INLINE -const KnCap& -ACE_CLASSIX_Group::get_cap(void) const -{ - return this->addr_.group_; -} - -ACE_INLINE -int -ACE_CLASSIX_Group::operator ==(const ACE_CLASSIX_Group & theRhs) const -{ - return - this->is_configured() && - theRhs.is_configured() && - ((KnCap) (this->get_cap()) == (KnCap) (theRhs.get_cap())); -} - -ACE_INLINE -int -ACE_CLASSIX_Group::operator !=(const ACE_CLASSIX_Group & theRhs) const -{ - return !(*this == theRhs); -} diff --git a/ace/CLASSIX/CLASSIX_Group_Dynamic.cpp b/ace/CLASSIX/CLASSIX_Group_Dynamic.cpp deleted file mode 100644 index a0ecbe357e6..00000000000 --- a/ace/CLASSIX/CLASSIX_Group_Dynamic.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Group_Creator.cpp.1 -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_Group_Dynamic.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Group_Dynamic.i" -#endif /* __ACE_INLINE__ */ diff --git a/ace/CLASSIX/CLASSIX_Group_Dynamic.h b/ace/CLASSIX/CLASSIX_Group_Dynamic.h deleted file mode 100644 index eb469fcf81a..00000000000 --- a/ace/CLASSIX/CLASSIX_Group_Dynamic.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Group_Dynamic.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_GROUP_DYNAMIC_H -#include "ace/pre.h" -#define ACE_CLASSIX_GROUP_DYNAMIC_H - -/* ------------------------------------------------------------------------- */ -#include "ace/CLASSIX/CLASSIX_Group.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_CLASSIX_Group_Dynamic : public ACE_CLASSIX_Group - // = TITLE - // Wrapper over Chorus's Group which is created dynamically and not named - // by a . - // - // = DESCRIPTION - // This is a subclass of . - // - // Its encapsulated group is created dynamically and the - // is the name as well as the unique identifier. - // - // = SEE ALSO - // , -{ - public: - - ACE_CLASSIX_Group_Dynamic(void); - // default constructor... create a group use Chorus IPC's K_DYNAMIC option - - virtual ACE_CLASSIX_Addr::Addr_Type is_type(void) const; - // returns Dynamic type - - private: - - ACE_CLASSIX_Group_Dynamic(ACE_CLASSIX_Group_Dynamic const&); - ACE_CLASSIX_Group_Dynamic const& operator=(ACE_CLASSIX_Group_Dynamic const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Group_Dynamic.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_GROUP_DYNAMIC_H */ diff --git a/ace/CLASSIX/CLASSIX_Group_Dynamic.i b/ace/CLASSIX/CLASSIX_Group_Dynamic.i deleted file mode 100644 index a7974ce45c1..00000000000 --- a/ace/CLASSIX/CLASSIX_Group_Dynamic.i +++ /dev/null @@ -1,16 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CLASSIX_Group_Dynamic::ACE_CLASSIX_Group_Dynamic(void) -{ - if (::grpAllocate( K_DYNAMIC, &this->addr_.group_, 0) == 0) - this->set_config_(); -} - -ACE_INLINE -ACE_CLASSIX_Addr::Addr_Type -ACE_CLASSIX_Group_Dynamic::is_type(void) const -{ - return ACE_CLASSIX_Addr::DYNAMIC; -} diff --git a/ace/CLASSIX/CLASSIX_Group_Stamp.cpp b/ace/CLASSIX/CLASSIX_Group_Stamp.cpp deleted file mode 100644 index b1205ca66ec..00000000000 --- a/ace/CLASSIX/CLASSIX_Group_Stamp.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// ace/CLASSIX_Group_Stamp.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_Group_Stamp.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Group_Stamp.i" -#endif /* __ACE_INLINE__ */ -/* ------------------------------------------------------------------------- */ -void -ACE_CLASSIX_Group_Stamp::set_addr(void* theStamp, int) -{ - // Get the group capability - this->stamp_ = *((u_int*)theStamp); - KnActorPrivilege actor; - actorPrivilege(K_MYACTOR, &actor, NULL); - if (::grpAllocate((actor == K_SUPACTOR) ? K_STATSYS : K_STATUSER, - &this->addr_.group_, - this->stamp_) < 0 ) - { - ACE_DEBUG((LM_DEBUG, "ACE_CLASSIX_Group_Stamp()::" - "group allocation failed\n")); - this->init_(); - this->stamp_ = ACE_CLASSIX_Group_Stamp::ILLEGAL_STAMP; - } - else - { - this->set_config_(); - } -} - -void -ACE_CLASSIX_Group_Stamp::dump(void) const -{ - ACE_DEBUG ((LM_DEBUG, "ACE_CLASSIX_Group_Stamp...\n")); - ACE_DEBUG ((LM_DEBUG, "\nStamp = %d\n", this->get_stamp())); - this->ACE_CLASSIX_Group::dump(); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_Group_Stamp.h b/ace/CLASSIX/CLASSIX_Group_Stamp.h deleted file mode 100644 index f71149616d3..00000000000 --- a/ace/CLASSIX/CLASSIX_Group_Stamp.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Group_Stamp.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_GROUP_STAMP_H -#include "ace/pre.h" -#define ACE_CLASSIX_GROUP_STAMP_H - -/* ------------------------------------------------------------------------- */ -#include "ace/CLASSIX/CLASSIX_Group.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_CLASSIX_Group_Stamp : public ACE_CLASSIX_Group - // = TITLE - // Wrapper over Chorus's Group using for naming the group. - // - // = DESCRIPTION - // This is a subclass of . - // - // Its encapsulated group is named by a . However, - // is still the unique identifier of the group. - // - // = NOTE - // As at the time of writing, The stamp is contained in the ui.uiTail - // field of . - // - // = SEE ALSO - // , - // -{ - public: - enum - { - ILLEGAL_STAMP = 0 - /* Have we defined the range of valid stamps? */ - }; - - // = INITIALIZATION - ACE_CLASSIX_Group_Stamp(); - // default constructor. Does not contain group information.. - ACE_CLASSIX_Group_Stamp(int /* stamp */); - // creates a group use the specfied stamp - virtual void set_addr(void*, /* pointer to the stamp */ - int = 0 /* not used */); - // Replaces the existing group according to the supplied stamp - - // = ACCESS - virtual ACE_CLASSIX_Addr::Addr_Type is_type(void) const; - // returns STAMP type - - int get_stamp() const; - // Returns the stamp - // If the address is not configured, the return value is unpredictable. - - // = HELPER - void dump(void) const; - - - - private: - u_int stamp_; - - // disable copy/assignment constructor - ACE_CLASSIX_Group_Stamp(ACE_CLASSIX_Group_Stamp const&); - ACE_CLASSIX_Group_Stamp const& operator=(ACE_CLASSIX_Group_Stamp const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Group_Stamp.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_GROUP_STAMP_H */ diff --git a/ace/CLASSIX/CLASSIX_Group_Stamp.i b/ace/CLASSIX/CLASSIX_Group_Stamp.i deleted file mode 100644 index 0c03d8ab17a..00000000000 --- a/ace/CLASSIX/CLASSIX_Group_Stamp.i +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CLASSIX_Group_Stamp::ACE_CLASSIX_Group_Stamp() - : ACE_CLASSIX_Group (), - stamp_ (0) -{ -} - -ACE_INLINE -ACE_CLASSIX_Group_Stamp::ACE_CLASSIX_Group_Stamp(int theStamp) - : ACE_CLASSIX_Group () -{ - this->set_addr(&theStamp); -} - -ACE_INLINE -int -ACE_CLASSIX_Group_Stamp::get_stamp() const -{ - return this->stamp_; - -// return this->addr_.group_.ui.uiTail; -} - -ACE_INLINE -ACE_CLASSIX_Addr::Addr_Type -ACE_CLASSIX_Group_Stamp::is_type(void) const -{ - return ACE_CLASSIX_Addr::STAMP; -} diff --git a/ace/CLASSIX/CLASSIX_OS.cpp b/ace/CLASSIX/CLASSIX_OS.cpp deleted file mode 100644 index 2ec4b6af6d8..00000000000 --- a/ace/CLASSIX/CLASSIX_OS.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_OS.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_OS.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_OS.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/CLASSIX/CLASSIX_Select_Reactor.h" - -/* ------------------------------------------------------------------------- */ - -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_OS) -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_Msg) - -#if 0 -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_Mgr) -ACE_CLASSIX_Mgr::ACE_CLASSIX_Mgr(void) -{ -} - -ACE_CLASSIX_Mgr::~ACE_CLASSIX_Mgr(void) -{ -} - -ACE_SYNCH_RECURSIVE_MUTEXT& -ACE_CLASSIX_Mgr::ref_lock(void) const; -{ - return port_lock_; -} -#endif -/* ------------------------------------------------------------------------- */ -KnUniqueId ACE_CLASSIX_OS::null_KnUniqueId_; -ACE_Recursive_Thread_Mutex ACE_CLASSIX_OS::lock_; - -ACE_CLASSIX_OS::ACE_CLASSIX_OS(void) -{ - // Create a actor-wide CLASSIX reactor - ACE_Reactor *r = - ACE_Reactor::instance - (new ACE_Reactor(new ACE_CLASSIX_Select_Reactor(), 1), 1); - delete r; - - // Fills in a null KnUniqueId so that it can be referenced when required - this->null_KnUniqueId_.uiHead = this->null_KnUniqueId_.uiTail = 0; -} - -ssize_t -ACE_CLASSIX_OS::convert_io_error(ssize_t theOriginal) -{ - switch (theOriginal) - { - case K_EFULL: - return ENOBUFS; - - case K_EINVAL: - return EFTYPE; - - case K_EFAULT: - return EFAULT; - - case K_ETOOMUCH: - return EMSGSIZE; - - case K_EUNKNOWN: - return EBADF; - - case K_ENOPORT: - return EBADF; - - case K_ETIMEOUT: - return ETIMEOUT; - - case K_EABORT: - return EINTR; - - default: - ACE_DEBUG((LM_DEBUG, "unknonw error: %d\n", theOriginal)); - return EFAULT; - } -} - - - -/* ------------------------------------------------------------------------- */ - -void -ACE_CLASSIX_Msg::dump(void) const -{ - ACE_DEBUG ((LM_INFO, ACE_BEGIN_DUMP, this)); - - char s[100]; - ACE_OS::sprintf (s, "flag = %x\n" - "body size = %d\t addr = %x\n" - "annex addr = %x\n" - "seq no = %d\n", - this->msg_.flags, - this->msg_.bodySize, this->msg_.bodyAddr, - this->msg_.annexAddr, - this->msg_.seqNum); - ACE_DEBUG ((LM_INFO, "%s", s)); - ACE_DEBUG ((LM_INFO, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_OS.h b/ace/CLASSIX/CLASSIX_OS.h deleted file mode 100644 index 7f2118d5089..00000000000 --- a/ace/CLASSIX/CLASSIX_OS.h +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_OS.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_OS_H -#include "ace/pre.h" -#define ACE_CLASSIX_OS_H - -/* ------------------------------------------------------------------------- */ -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Select_Reactor.h" -#include "ace/Singleton.h" -#include "ace/CLASSIX/CLASSIX_Port_Core.h" - -#include - - -#if 0 -class ACE_Export ACE_CLASSIX_Mgr - // = TITLE - // Class to manage resouces, especially static resources - // - // = DESCRIPTION - // It is intended that one per actor - // -{ - public: - friend ACE_Singleton; - - ACE_SYNCH_RECURSIVE_MUTEXT& ref_lock(const) const; - - protected: - // = Initialization - ACE_CLASSIX_Mgr(void); - // Only allow its fried to instantiate, since it is meant as a - // singleton class. - // This class shall be instanti - -private: - ACE_SYNCH_RECURSIVE_MUTEX *port_lock_; -}; -#endif - -class ACE_Export ACE_CLASSIX_OS -{ -public: - - ACE_CLASSIX_OS(); - - static const KnUniqueId& null_KnUniqueId(); - static ssize_t convert_io_error (ssize_t /* CLASSIX' error no */); - // conver CLASSIX's errno no to Posix no. - -protected: - -private: - friend class ACE_CLASSIX_Port_Core; - friend class ACE_CLASSIX_Port; - static ACE_Recursive_Thread_Mutex& get_lock_(void); - // Returns CLASSIX environment-wide lock - - static KnUniqueId null_KnUniqueId_; - // Null-filled KnUniqueId - - static ACE_Recursive_Thread_Mutex lock_; -}; - -/* ------------------------------------------------------------------------- */ - - -class ACE_CLASSIX_Msg - // = TITLE - // Class wrapper over Chorus's KnMsgDesc structure - // - // = DESCRIPTION - // Provides initialization and reset methods to construct a KnMsgDesc. - // - // The flags in the field of the KnMsgDesc structure is always - // set to 0. Therefore, the message body will always be copied and - // the message is assumed to be part of the user(kernel) address - // space when the caller is a USER(SUPERVISOR) thread. - // (Chorus may not support the options defined in the flag, so we - // choose not to use the flag, i.e. set it to null). - // - // The message annex is not used. - - // = SEE ALSO - // ipcSend(2) -{ - public: - // = initialization - ACE_CLASSIX_Msg(); - // default constructor - ACE_CLASSIX_Msg(const void * /* body address */, int /* msg length */); - - KnMsgDesc* get(void); - // get CLASSIX' message structure - void set (const void* /* body address */, int /* msg length*/); - // Reset the message. The original message will be overwritten. - - void dump(void) const; - - ACE_ALLOC_HOOK_DECLARE; - // declare the dynamic allocation hooks - - private: - KnMsgDesc msg_; -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_OS.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_OS_H */ diff --git a/ace/CLASSIX/CLASSIX_OS.i b/ace/CLASSIX/CLASSIX_OS.i deleted file mode 100644 index d5ded0cc75a..00000000000 --- a/ace/CLASSIX/CLASSIX_OS.i +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -/* ------------------------------------------------------------------------- */ -ACE_INLINE -const KnUniqueId& -ACE_CLASSIX_OS::null_KnUniqueId(void) -{ - return null_KnUniqueId_; -} - - -ACE_INLINE -ACE_Recursive_Thread_Mutex& -ACE_CLASSIX_OS::get_lock_(void) -{ - return lock_; -} - -/* ------------------------------------------------------------------------- */ -ACE_INLINE -ACE_CLASSIX_Msg::ACE_CLASSIX_Msg(void) -{ - // Make a null-filled message - this->msg_.flags = 0; - this->msg_.bodySize = 0; - this->msg_.bodyAddr = 0; - this->msg_.annexAddr = 0; - this->msg_.seqNum = 0; -} - -ACE_INLINE -ACE_CLASSIX_Msg::ACE_CLASSIX_Msg(const void* theBuf, int theLen) -{ - this->msg_.flags = 0; - this->msg_.annexAddr = 0; - this->msg_.seqNum = 0; - - this->msg_.bodySize = theLen; - this->msg_.bodyAddr = (VmAddr) theBuf; -} - -ACE_INLINE -void -ACE_CLASSIX_Msg::set(const void* theBuf, int theLen) -{ - this->msg_.bodySize = theLen; - this->msg_.bodyAddr = (VmAddr) theBuf; -} - -ACE_INLINE -KnMsgDesc* -ACE_CLASSIX_Msg::get(void) -{ - return &this->msg_; -} diff --git a/ace/CLASSIX/CLASSIX_Peer_SAP.cpp b/ace/CLASSIX/CLASSIX_Peer_SAP.cpp deleted file mode 100644 index 9dbddf9c0b1..00000000000 --- a/ace/CLASSIX/CLASSIX_Peer_SAP.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Peer_SAP.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_Peer_SAP.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Peer_SAP.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/CLASSIX/CLASSIX_Group_Stamp.h" -/* ------------------------------------------------------------------------- */ -int -ACE_CLASSIX_Peer_SAP::set(const ACE_CLASSIX_Port_Core& thePeer) -{ - delete this->peer_addr_; - this->peer_addr_ = new ACE_CLASSIX_Port (thePeer); - ACE_ASSERT(this->peer_addr_); - return 0; -} - -int -ACE_CLASSIX_Peer_SAP::set(const ACE_Addr& thePeer) -{ - delete this->peer_addr_; - this->peer_addr_ = new ACE_CLASSIX_Port (thePeer); - ACE_ASSERT(this->peer_addr_); - return 0; -} - -int -ACE_CLASSIX_Peer_SAP::set(const KnUniqueId& thePeer) -{ - delete this->peer_addr_; - this->peer_addr_ = new ACE_CLASSIX_Port (thePeer); - ACE_ASSERT(this->peer_addr_); - return 0; -} - -int -ACE_CLASSIX_Peer_SAP::set(const KnCap& thePeer) -{ - delete this->peer_addr_; - this->peer_addr_ = new ACE_CLASSIX_Group (thePeer); - ACE_ASSERT(this->peer_addr_); - return 0; -} - -int -ACE_CLASSIX_Peer_SAP::set(int theStamp) -{ - delete this->peer_addr_; - this->peer_addr_ = new ACE_CLASSIX_Group_Stamp (theStamp); - ACE_ASSERT(this->peer_addr_); - return 0; -} - -void -ACE_CLASSIX_Peer_SAP::dump (void) const -{ - ACE_DEBUG ((LM_DEBUG, "ACE_CLASSIX_Peer_SAP...\n")); - if (this->peer_addr_) - this->peer_addr_->dump(); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_Peer_SAP.h b/ace/CLASSIX/CLASSIX_Peer_SAP.h deleted file mode 100644 index 93e65996763..00000000000 --- a/ace/CLASSIX/CLASSIX_Peer_SAP.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Peer_SAP.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_PEER_SAP_H -#include "ace/pre.h" -#define ACE_CLASSIX_PEER_SAP_H - -/* ------------------------------------------------------------------------- */ -#include -#include - -class ACE_CLASSIX_Peer_SAP - // = TITLE - // Class implementing the peer SAP. - // - // = DESCRIPTION - // - // In CLASSIX, a local SAP is always a port, a peer SAP can be - // a port or a group of port. This class is for peer SAP and - // is for local SAP. - // - // = SEE ALSO - // -{ - public: - // = INITIALIZATION - ACE_CLASSIX_Peer_SAP(void); - // Default constructor. - // Needs to be initialized by a set() operation. - ACE_CLASSIX_Peer_SAP(const ACE_CLASSIX_Port_Core&);/* peer port */ - - ACE_CLASSIX_Peer_SAP(const ACE_CLASSIX_Port&);/* peer port address */ - ACE_CLASSIX_Peer_SAP(const ACE_Addr&); /* peer port address */ - - ACE_CLASSIX_Peer_SAP(const KnUniqueId&); /* peer port address */ - ACE_CLASSIX_Peer_SAP(const KnCap&); /* peer group address */ - ACE_CLASSIX_Peer_SAP(int /* stamp */); /* stamp for peer group */ - - ~ACE_CLASSIX_Peer_SAP(void); - - int set(const ACE_CLASSIX_Port_Core&); /* peer port */ - - int set(const ACE_Addr&); /* peer port address */ - - int set(const KnUniqueId&); /* peer port address */ - int set(const KnCap&); /* peer group address */ - int set(int /* stamp */); /* stamp for the peer group */ - - // = ACCESS - const ACE_CLASSIX_Addr* get_addr(void) const; - // Returns peer's address, either a port or a group of ports - int is_configured(void) const; - // Returns 1, if address information is proper; Returns 0 otherwise - - // = CONTROL -#if 0 - int control(u_int = K_BROADMODE); - int control(u_int, /* mode */ int /* site */ ); - // Interface for CLASSIX' send mode -#endif - // = HELPER - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - protected: -#if 0 - virtual set_mode_(u_int = K_BROADMODE); /* theMode */ - // Sets the addressing mode with the current setting of coTarget - virtual set_mode_(u_int, /* mode */ int /* site */); - // Sets the addressing mode as well as the coTarget -#endif - ACE_CLASSIX_Addr *peer_addr_; - - private: - // Disable copy constructor - ACE_CLASSIX_Peer_SAP(ACE_CLASSIX_Peer_SAP const&); - ACE_CLASSIX_Peer_SAP const& operator=(ACE_CLASSIX_Peer_SAP const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Peer_SAP.i" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_PEER_SAP_H */ diff --git a/ace/CLASSIX/CLASSIX_Peer_SAP.i b/ace/CLASSIX/CLASSIX_Peer_SAP.i deleted file mode 100644 index a10bcfd12b5..00000000000 --- a/ace/CLASSIX/CLASSIX_Peer_SAP.i +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CLASSIX_Peer_SAP::ACE_CLASSIX_Peer_SAP(void) - : peer_addr_ (0) -{ -} - -ACE_INLINE -ACE_CLASSIX_Peer_SAP::ACE_CLASSIX_Peer_SAP(const ACE_CLASSIX_Port_Core& - thePeer) - : peer_addr_ (0) -{ - this->set(thePeer); -} - -ACE_INLINE -ACE_CLASSIX_Peer_SAP::ACE_CLASSIX_Peer_SAP(const ACE_CLASSIX_Port& thePeer) - : peer_addr_ (0) -{ - this->set(thePeer); -} - -ACE_INLINE -ACE_CLASSIX_Peer_SAP::ACE_CLASSIX_Peer_SAP(const ACE_Addr& thePeer) - : peer_addr_ (0) -{ - this->set(thePeer); -} - -ACE_INLINE -ACE_CLASSIX_Peer_SAP::ACE_CLASSIX_Peer_SAP(const KnUniqueId& thePeer) - : peer_addr_ (0) -{ - this->set(thePeer); -} - -ACE_INLINE -ACE_CLASSIX_Peer_SAP::ACE_CLASSIX_Peer_SAP(int theStamp) - : peer_addr_ (0) -{ - this->set(theStamp); -} - -ACE_INLINE -ACE_CLASSIX_Peer_SAP::~ACE_CLASSIX_Peer_SAP(void) -{ - delete this->peer_addr_; -} - - -ACE_INLINE -const ACE_CLASSIX_Addr* -ACE_CLASSIX_Peer_SAP::get_addr(void) const -{ - return this->peer_addr_; -} - -ACE_INLINE -int -ACE_CLASSIX_Peer_SAP::is_configured(void) const -{ - if (this->peer_addr_) - return this->peer_addr_->is_configured(); - else - return 0; -} - -#if 0 -ACE_INLINE -int -ACE_CLASSIX_Peer_SAP::control(u_int theMode) -{ - return this->peer_addr_->set_mode_(theMode); -} - -ACE_INLINE -int -ACE_CLASSIX_Peer_SAP::control(u_int theMode, int theSite) -{ - return this->set_mode_(theMode, theSite); -} - - -ACE_INLINE -int -ACE_CLASSIX_Peer_SAP::set_mode_(u_int) -{ - return K_EFAULT; -} - -ACE_INLINE -int -ACE_CLASSIX_Peer_SAP::set_mode_(u_int, int) -{ - return K_EFAULT; -} -#endif diff --git a/ace/CLASSIX/CLASSIX_Port.cpp b/ace/CLASSIX/CLASSIX_Port.cpp deleted file mode 100644 index e819e1abcfd..00000000000 --- a/ace/CLASSIX/CLASSIX_Port.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Defines the ClassiX IPC address family address format. - -#define ACE_BUILD_DLL -#include "ace/CLASSIX/CLASSIX_Port.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Port.i" -#endif /* __ACE_INLINE__ */ - -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_Port) - - -ACE_CLASSIX_Port::ACE_CLASSIX_Port(void* thePort, int theLen) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Port_Core::Addr)) -{ - if (thePort && theLen == this->get_size()) - { - ACE_CLASSIX_Port_Core::Addr *port = - (ACE_CLASSIX_Port_Core::Addr*) thePort; - this->addr_.handle = port->handle; - this->addr_.id = port->id; - } - else - { - this->clear(); - } -} - -ACE_CLASSIX_Port::ACE_CLASSIX_Port(ACE_Addr const& theAddr) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Port_Core::Addr)) -{ - if (theAddr.get_size() == this->get_size() && - theAddr.get_type() == this->get_type()) - this->set_(theAddr); - else - this->clear(); -} - -void -ACE_CLASSIX_Port::clear(void) -{ - this->addr_.handle = ACE_CLASSIX_ADDR_UNKNOWN; - this->addr_.id.uiHead = this->addr_.id.uiTail = 0; -} - -int -ACE_CLASSIX_Port::set_(const ACE_Addr& theAddr) -{ - ACE_CLASSIX_Port_Core::Addr *src = - ((ACE_CLASSIX_Port_Core::Addr*) theAddr.get_addr()); - this->addr_.id = src->id; - this->addr_.handle = src->handle; - - return 0; -} - -int -ACE_CLASSIX_Port::set(const KnUniqueId& thePort) -{ - int no = ::portLi((KnUniqueId*) &thePort); - - // update the port no only if the no is valid - if (no < 0) - // Assume this is a remote port - no = ACE_INVALID_HANDLE; - - this->addr_.handle = no; - this->addr_.id = thePort; - return 0; -} - -int -ACE_CLASSIX_Port::set_handle(ACE_HANDLE thePort) -{ - if (thePort == ACE_INVALID_HANDLE && - ::portUi(&this->addr_.id, thePort) < 0) - return -1; - - this->addr_.handle = thePort; - return 0; -} - -void -ACE_CLASSIX_Port::set_addr(void* theSrc, int theLen) -{ - // Remove self owned first and Make sure no memory overflow - if (theSrc && theLen > this->get_size()) - return; - - ACE_OS::memcpy ((void *) &this->addr_, - (void *) theSrc, theLen); - -} - -ACE_CLASSIX_Port const& -ACE_CLASSIX_Port::operator =(ACE_Addr const& theAddr) -{ - if (theAddr.get_size() == this->get_size() && - theAddr.get_type() == this->get_type()) - { - - this->set_(theAddr); - } - return *this; -} - -int -ACE_CLASSIX_Port::addr_to_string (ACE_TCHAR s[], size_t) const -{ - ACE_OS::sprintf (s, ACE_TEXT ("%d:%d"), - ACE_TEXT_CHAR_TO_TCHAR (::agetId()), - this->get_port_number ()); -} - -void -ACE_CLASSIX_Port::dump (void) const -{ - ACE_DEBUG ((LM_DEBUG, "ACE_CLASSIX_Port...\n")); - ACE_Addr::dump(); - char s[100]; - ACE_OS::sprintf (s, "handle = %d;\tid head = %x, id tail = %x\n", - this->get_handle(), - this->get_id().uiHead, this->get_id().uiTail); - ACE_DEBUG ((LM_DEBUG, "%s", s)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_Port.h b/ace/CLASSIX/CLASSIX_Port.h deleted file mode 100644 index 94402bf16ca..00000000000 --- a/ace/CLASSIX/CLASSIX_Port.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Port.h -// -// = AUTHOR -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_PORT_H -#include "ace/pre.h" -#define ACE_CLASSIX_PORT_H - -#include "ace/Singleton.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/CLASSIX/CLASSIX_OS.h" -#include "ace/CLASSIX/CLASSIX_Addr.h" - - -class ACE_Export ACE_CLASSIX_Port : public ACE_CLASSIX_Addr -{ - // = TITLE - // Defines the ClassiX IPC Port address format for "ACE Socket" like - // interfaces - // - // = DESCRIPTION - // The port address contains two fields: - // a global unique identifier and a local identifier. - // The global unique identifier is also referred to as the port address - // and the local identifier as the port no. - // - // = NOTE - // In Chorus, one can always convert from a port unique identifier to - // a port no and vice versa. This class is implemented based on this - // premise. - // - // = SEE ALSO - // , - // -public: - /* -----------------------------------------------------*/ - // = Initialization methods. - ACE_CLASSIX_Port (); - // Default constructor. - // The address corresponds to the default port of the actor. - - ACE_CLASSIX_Port (const ACE_CLASSIX_Port &); - // Copy constructor. - ACE_CLASSIX_Port (const ACE_Addr &); - // Copy constructor. - - ACE_CLASSIX_Port (const ACE_CLASSIX_Port_Core&); - // Creates an from - - ACE_CLASSIX_Port (const KnUniqueId& /* port_id */); - // Creates an from the given - - ACE_CLASSIX_Port (ACE_HANDLE /* port_no */); - // Creates an from the given - - ACE_CLASSIX_Port (void* /* location */, int /* length */); - // Create an from the address in raw format. - - ACE_CLASSIX_Port const& operator =(ACE_Addr const&); - - - /* -----------------------------------------------------*/ - // = ACCESS - - virtual int addr_to_string (ACE_TCHAR addr[], size_t) const; - // Transform the current address into string format, - // which is in the form "actor-id:port-number" - - int set (const KnUniqueId& /* port_id */); - // Sets the from a - - virtual void set_addr (void * /* addr location */, - int /* len */); - // Set the address as the one pointed to by the location pointer. - // The address contains bytes. - // Would prefer to return the status, but the base class uses void. - int set_handle (ACE_HANDLE /* port_no */); - // Sets the field from a - - virtual void *get_addr (void) const; - // Returns a pointer to the address:, - // - virtual const KnUniqueId& get_id (void) const; - // Returns a reference to the port id. - virtual ACE_HANDLE get_handle (void) const; - // Returns the port no. - int is_configured(void) const; - // Returns 1, if address information is proper; Returns 0 otherwise - virtual ACE_CLASSIX_Addr::Addr_Type is_type(void) const; - // returns PORT type - - /* -----------------------------------------------------*/ - // = Control - // - virtual int enable(int /* receive priority */) const; - // Puts the port into the set of monitored ports. - virtual int disable(void) const; - // Removes the port from the set of monitored ports. - virtual void clear(void); - // Remove port information - - /* -----------------------------------------------------*/ - // = Comparison - // - int operator == (const ACE_CLASSIX_Port &) const; - // Compare two addresses for equality. The addresses are considered - // equal if they have the same content in the KnUniqueId address structure. - - int operator != (const ACE_CLASSIX_Port &) const; - // Compare two addresses for inequality. - - /* -----------------------------------------------------*/ - // = Helper - // - void dump (void) const; - // Dump the state of an object. - - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - /* -----------------------------------------------------*/ - // = Direct initialization methods (useful after the object has been - // constructed). - // Will create/reset the port only if the port no was - // Returns 0 on success, -1 otherwise. - // - - int set_ (const ACE_Addr &); - // Sets the from another . - - - -private: - ACE_CLASSIX_Port_Core::Addr addr_; -}; - -/* ------------------------------------------------------------------------- */ -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Port.i" -#endif /* __ACE_INLINE__ */ - - -#include "ace/post.h" -#endif /* ACE_CLASSIX_PORT_H */ diff --git a/ace/CLASSIX/CLASSIX_Port.i b/ace/CLASSIX/CLASSIX_Port.i deleted file mode 100644 index 762f6ec5794..00000000000 --- a/ace/CLASSIX/CLASSIX_Port.i +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CLASSIX_Port::ACE_CLASSIX_Port(void) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Port_Core::Addr)) -{ - this->set_handle(K_DEFAULTPORT); -} - -ACE_INLINE -ACE_CLASSIX_Port::ACE_CLASSIX_Port(const ACE_CLASSIX_Port& theSrc) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Port_Core::Addr)) -{ - this->set_(theSrc); -} - -ACE_INLINE -ACE_CLASSIX_Port::ACE_CLASSIX_Port(const KnUniqueId& thePort) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Port_Core::Addr)) -{ - this->set(thePort); -} - -ACE_INLINE -ACE_CLASSIX_Port::ACE_CLASSIX_Port(ACE_HANDLE thePort) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Port_Core::Addr)) -{ - this->set_handle(thePort); -} - -ACE_INLINE -ACE_CLASSIX_Port::ACE_CLASSIX_Port(const ACE_CLASSIX_Port_Core& thePort) - : ACE_CLASSIX_Addr (sizeof (ACE_CLASSIX_Port_Core::Addr)) -{ - this->addr_.handle = thePort.get_handle(); - this->addr_.id = thePort.get_id(); -} - -ACE_INLINE -ACE_HANDLE -ACE_CLASSIX_Port::get_handle(void) const -{ - return this->addr_.handle; -} - -ACE_INLINE -const KnUniqueId& -ACE_CLASSIX_Port::get_id(void) const -{ - return this->addr_.id; -} - -ACE_INLINE -void * -ACE_CLASSIX_Port::get_addr(void) const -{ - return (void*) &this->addr_; -} - -ACE_INLINE -int -ACE_CLASSIX_Port::is_configured(void) const -{ - return (this->addr_.handle != ACE_CLASSIX_ADDR_UNKNOWN); -} - -ACE_INLINE -ACE_CLASSIX_Addr::Addr_Type -ACE_CLASSIX_Port::is_type(void) const -{ - return ACE_CLASSIX_Addr::PORT; -} - -ACE_INLINE -int -ACE_CLASSIX_Port::enable(int thePriority) const -{ - if (ACE_Reactor::instance()->notify() == 0) - return ::portEnable(K_MYACTOR, this->get_handle(), thePriority); - else - return -1; -} - -ACE_INLINE -int -ACE_CLASSIX_Port::disable(void) const -{ - if (ACE_Reactor::instance()->notify() == 0) - return ::portDisable(K_MYACTOR, this->get_handle()); - else - return -1; -} - -// Compare two addresses for equality. -ACE_INLINE -int -ACE_CLASSIX_Port::operator==(const ACE_CLASSIX_Port &theSrc) const -{ - return - this->ACE_Addr::operator == (theSrc) && - this->addr_.id.uiHead == theSrc.addr_.id.uiHead && - this->addr_.id.uiTail == theSrc.addr_.id.uiTail && - this->addr_.handle == theSrc.addr_.handle; -} - -ACE_INLINE -int -ACE_CLASSIX_Port::operator != (const ACE_CLASSIX_Port &sap) const -{ - return !((*this) == sap); -} diff --git a/ace/CLASSIX/CLASSIX_Port_Core.cpp b/ace/CLASSIX/CLASSIX_Port_Core.cpp deleted file mode 100644 index 4d1903939b9..00000000000 --- a/ace/CLASSIX/CLASSIX_Port_Core.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Port_Core.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_Port_Core.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Port_Core.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/Synch_T.h" -#include "ace/CLASSIX/CLASSIX_OS.h" -/* ------------------------------------------------------------------------- */ - -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_Port_Core) - -ACE_CLASSIX_Port_Core::ACE_CLASSIX_Port_Core(void) -{ - if ((this->addr_.handle = ::portCreate(K_MYACTOR, &this->addr_.id)) < 0) - this->clear_config_(); - else - { - this->set_config_(); - } -} - -ACE_CLASSIX_Port_Core::~ACE_CLASSIX_Port_Core(void) -{ - if (this->is_configured()) - if (int result = ::portDelete(K_MYACTOR, this->get_handle()) < 0) - ACE_ERROR((LM_DEBUG, - "ACE_CLASSIX_Port_Core::~ACE_CLASSIX_PORT_CORE()- " - "failed to delete port, error = %d", result)); -} - -void -ACE_CLASSIX_Port_Core::clear_config_(void) -{ - this->config_ = 0; - this->addr_.id.uiHead = this->addr_.id.uiTail = 0; - this->addr_.handle = ACE_INVALID_HANDLE; -} - - -void -ACE_CLASSIX_Port_Core::dump (void) const -{ - ACE_DEBUG ((LM_DEBUG, "ACE_CLASSIX_Port_Core...\n")); - char s[100]; - if (!this->is_configured()) - ACE_OS::sprintf(s, "Port has not been allocated\n"); - else - ACE_OS::sprintf (s, "handle = %d;\tid head = %x, id tail = %x\n", - this->get_handle(), - this->get_id().uiHead, this->get_id().uiTail); - ACE_DEBUG ((LM_DEBUG, "%s", s)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_Port_Core.h b/ace/CLASSIX/CLASSIX_Port_Core.h deleted file mode 100644 index beef0356c63..00000000000 --- a/ace/CLASSIX/CLASSIX_Port_Core.h +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Port_Core.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_PORT_CORE_H -#include "ace/pre.h" -#define ACE_CLASSIX_PORT_CORE_H - -/* ------------------------------------------------------------------------- */ -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include - - -/* ------------------------------------------------------------------------- */ -class ACE_Export ACE_CLASSIX_Port_Core -{ - // = TITLE - // Defines interfaces for allocation/deallocation of a Chorus - // IPC port - // - // = DESCRIPTION - // This class allocates a port in the constructor and deallocates it in - // the destructor. - -public: - /* -----------------------------------------------------*/ - // = Initialization methods. - ACE_CLASSIX_Port_Core (void); - // Allocates a port from the OS - // - virtual ~ACE_CLASSIX_Port_Core (void); - // Deallocates the port from the OS. - - virtual const KnUniqueId& get_id (void) const; - // Returns a reference to the port id. - virtual ACE_HANDLE get_handle (void) const; - // Returns the port no(used as an ACE_HANDLE) - virtual void* get_addr(void) const; - // Returns a pointer to the location containing the raw - // address of the port. - int is_configured(void) const; - // Returns 1, if the port has been successfully created. - -#if 0 - int enable(int /* priority */) const; - int disable (int) const; - // Puts/Removes the port into/from the set of monitored ports. -#endif - /* -----------------------------------------------------*/ - // = Helper - // - void dump (void) const; - // Dump the state of an object. - - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - struct Addr - { - KnUniqueId id; // port address: unique identifier - ACE_HANDLE handle;// port no: local identifier. - - }; - -protected: - void clear_config_(); - // Indicates that port has been allocated. - void set_config_(); - - ACE_CLASSIX_Port_Core::Addr addr_; - int config_; // Sets to 1, if configured; - // 0 otherwise -private: - // Disallow copy constructor/assignment - ACE_CLASSIX_Port_Core(ACE_CLASSIX_Port_Core const&); - ACE_CLASSIX_Port_Core const& operator =(ACE_CLASSIX_Port_Core const&); -}; -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Port_Core.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_PORT_CORE_H */ diff --git a/ace/CLASSIX/CLASSIX_Port_Core.i b/ace/CLASSIX/CLASSIX_Port_Core.i deleted file mode 100644 index 7fd3694d8de..00000000000 --- a/ace/CLASSIX/CLASSIX_Port_Core.i +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -void -ACE_CLASSIX_Port_Core::set_config_(void) -{ - this->config_ = 1; -} - -ACE_INLINE -int -ACE_CLASSIX_Port_Core::is_configured(void) const -{ - return this->config_ == 1; -} - - -ACE_INLINE -ACE_HANDLE -ACE_CLASSIX_Port_Core::get_handle(void) const -{ - return this->addr_.handle; -} - -ACE_INLINE -const KnUniqueId& -ACE_CLASSIX_Port_Core::get_id(void) const -{ - return this->addr_.id; -} - -ACE_INLINE -void* -ACE_CLASSIX_Port_Core::get_addr(void) const -{ - return (void*) (&this->addr_); -} diff --git a/ace/CLASSIX/CLASSIX_Port_Default.cpp b/ace/CLASSIX/CLASSIX_Port_Default.cpp deleted file mode 100644 index e18d55971e2..00000000000 --- a/ace/CLASSIX/CLASSIX_Port_Default.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Defines the ClassiX IPC address family address format. - -#define ACE_BUILD_DLL -#include "ace/CLASSIX/CLASSIX_Port_Default.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Port_Default.i" -#endif /* __ACE_INLINE__ */ - -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_Port_Default) - -/* ------------------------------------------------------------------------- */ -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Singleton; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiation ACE_Singleton - -#endif diff --git a/ace/CLASSIX/CLASSIX_Port_Default.h b/ace/CLASSIX/CLASSIX_Port_Default.h deleted file mode 100644 index ce237daceb3..00000000000 --- a/ace/CLASSIX/CLASSIX_Port_Default.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Port_Default.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_PORT_DEFAULT_H -#include "ace/pre.h" -#define ACE_CLASSIX_PORT_DEFAULT_H - -#include "ace/Singleton.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/CLASSIX/CLASSIX_Port.h" - -class ACE_CLASSIX_Port_Default : public ACE_CLASSIX_Port -{ - // = TITLE - // Implements the address wrapper of an actor's default port. - // - // = DESCRIPTION - // This corresponds to the address of an actor's default port - // which does not change - // in the life time of the actor. Therefore the address information - // in this class can not be modified once it is created. - // - // Each actor has one and only one default port. Therefore an instance - // of this class is a singleton. The protected constructor and the - // friendship with the ACE_Singleton preventys this class from being - // instantiated by other classes. - // - // = NOTE - // - // = SEE ALSO - // - // - friend class ACE_Singleton; - - /* -----------------------------------------------------*/ - // = Access - virtual void set_addr(void*, int); - ACE_CLASSIX_Port const& operator =(ACE_CLASSIX_Port const&); - ACE_CLASSIX_Port const& operator =(ACE_Addr const&); - // Does nothing...The default port's address cannot be changed - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - /* -----------------------------------------------------*/ - // = Initialization methods. - ACE_CLASSIX_Port_Default (); - // Wrapper for the Actor's default port -}; - - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Port_Default.i" -#endif /* __ACE_INLINE__ */ - -/* ------------------------------------------------------------------------- */ -typedef ACE_Singleton - ACE_CLASSIX_DEFAULT_PORT; -/* ------------------------------------------------------------------------- */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_PORT_DEFAULT_H */ diff --git a/ace/CLASSIX/CLASSIX_Port_Default.i b/ace/CLASSIX/CLASSIX_Port_Default.i deleted file mode 100644 index fac497bace0..00000000000 --- a/ace/CLASSIX/CLASSIX_Port_Default.i +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CLASSIX_Port_Default::ACE_CLASSIX_Port_Default(void) - : ACE_CLASSIX_Port() -{ -} - -ACE_INLINE -void -ACE_CLASSIX_Port_Default::set_addr(void*, int) -{ -} - -ACE_INLINE -ACE_CLASSIX_Port const& -ACE_CLASSIX_Port_Default::operator =(ACE_CLASSIX_Port const&) -{ - return *this; -} - -ACE_INLINE -ACE_CLASSIX_Port const& -ACE_CLASSIX_Port_Default::operator =(ACE_Addr const&) -{ - return *this; -} diff --git a/ace/CLASSIX/CLASSIX_SAP.cpp b/ace/CLASSIX/CLASSIX_SAP.cpp deleted file mode 100644 index 55a9c8183a0..00000000000 --- a/ace/CLASSIX/CLASSIX_SAP.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_SAP.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_SAP.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_SAP.i" -#endif /* __ACE_INLINE__ */ - -ACE_ALLOC_HOOK_DEFINE(ACE_CLASSIX_SAP) -/* ------------------------------------------------------------------------- */ -int -ACE_CLASSIX_SAP::get_addr(ACE_Addr& theAddr) const -{ - if (theAddr.get_size() < this->local_addr_.get_size() || - theAddr.get_type() != this->local_addr_.get_type()) - { - return -1; - } - else - { - theAddr.set_addr(this->local_addr_.get_addr(), - this->local_addr_.get_size()); - return 0; - } -} - -void -ACE_CLASSIX_SAP::set_addr(const ACE_Addr& theAddr) -{ - this->local_addr_.set_addr(theAddr.get_addr(), theAddr.get_size()); -} - - -void -ACE_CLASSIX_SAP::set_addr(const ACE_CLASSIX_Port_Core& thePort) -{ - this->local_addr_.set_addr(thePort.get_addr(), - sizeof (ACE_CLASSIX_Port_Core::Addr)); -} - -int -ACE_CLASSIX_SAP::set(const KnUniqueId& theId) -{ - return this->local_addr_.set(theId); -} - -void -ACE_CLASSIX_SAP::set_handle(ACE_HANDLE theHandle) -{ - if (this->local_addr_.set_handle(theHandle) == -1) - ACE_DEBUG((LM_DEBUG, "ACE_CLASSIX_SAP::set_handle()::" - "Handle invalid\n")); -} - -int -ACE_CLASSIX_SAP::set(const ACE_Addr& theAddr) -{ - this->set_addr(theAddr); - return 0; -} - -int -ACE_CLASSIX_SAP::open(const ACE_Addr& theAddr) -{ - this->set_addr(theAddr); - return 0; -} - - -int -ACE_CLASSIX_SAP::set(const ACE_CLASSIX_Port_Core& thePort) -{ - this->set_addr(thePort); - return 0; -} - - -int -ACE_CLASSIX_SAP::open(const ACE_CLASSIX_Port_Core* thePort) -{ - if (thePort) - { - this->set_addr(ACE_CLASSIX_Port(*thePort)); - return 0; - } - else - return -1; -} - -int -ACE_CLASSIX_SAP::close(void) -{ - // Disable receiving - this->unselectable(); - //*** Do something to flush out potential messages on the local port - // e.g. have a separte thread call ipcReceive on each disabled SAP. - - this->local_addr_.clear(); - return 0; -} - -int -ACE_CLASSIX_SAP::selectable(int thePriority) -{ - if (!this->enabled_) - { - int result = this->local_addr_.enable(thePriority); - if (result == 0) - this->enabled_ = 1; - return result; - } - else - return 0; -} - -int -ACE_CLASSIX_SAP::unselectable(int) -{ - if (this->enabled_) - { - int result = this->local_addr_.disable(); - if (result == 0) - this->enabled_ = 0; - return result; - } - else - return 0; -} - - -void -ACE_CLASSIX_SAP::dump(void) const -{ - ACE_DEBUG ((LM_INFO, "ACE_CLASSIX_SAP...\n")); - - this->local_addr_.dump(); - - ACE_DEBUG ((LM_INFO, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_SAP.h b/ace/CLASSIX/CLASSIX_SAP.h deleted file mode 100644 index c8c5df0e18e..00000000000 --- a/ace/CLASSIX/CLASSIX_SAP.h +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_SAP.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_SAP_H -#include "ace/pre.h" -#define ACE_CLASSIX_SAP_H - -/* ------------------------------------------------------------------------- */ -#include "ace/CLASSIX/CLASSIX_Port.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_CLASSIX_SAP - // = TITLE - // Class implementing the SAP over a Chorus port. - // - // = DESCRIPTION - // A SAP has a port which is referred to as the local port. - // This class provides methods to manipulate this port. - // - // The SAP will always put the port in DISABLED state on exit. - // - // In CLASSIX, a local SAP is always a port, a peer SAP can be - // a port or a group of port. This class is for local SAP and - // is for peer SAP. - // - // = SEE ALSO - // - // -{ - public: - enum - { - DEFAULT_PRIORITY = 10 - }; - - // = INITIALIZATION - ACE_CLASSIX_SAP(void); - // Creates a SAP, using the address of the actor's default port. - ACE_CLASSIX_SAP(const ACE_Addr&); - // Creates a SAP, using the specified address as the local address. - virtual ~ACE_CLASSIX_SAP(void); - - // = ACCESS - void set_addr(const ACE_Addr&); - void set_addr(const ACE_CLASSIX_Port_Core&); - // Sets the based on the given address information. - // The caller should make sure that the original address can be removed! - int set(const ACE_Addr&); - // Returns 0, if successful; returns -1, otherwise - // same as set_addr(const ACE_Addr&); - int set(const ACE_CLASSIX_Port_Core&); - // Returns 0, if successful; returns -1, otherwise - // same as void set_addr(const ACE_CLASSIX_Port_Core&); - int set (const KnUniqueId&); - // Returns 0, if successful; returns -1, otherwise - - void set_handle (ACE_HANDLE /* port_no */); - // Sets the port address according to - - int get_addr(ACE_Addr& /* return_addr */) const; - // Returns address information to the supplied location. - // if successful, return 0 and the return_addr parameter contains the - // address info. - // Otherwise, return -1 - const ACE_CLASSIX_Port& get_addr(void) const; - // Returns a reference to the address information - ACE_HANDLE get_handle(void) const; - // Get handles that the Reactor uses - virtual int is_configured(void) const; - // Returns 1, if address information is proper; Returns 0 otherwise - int is_selectable(void) const; - // Retruns 1, if the local SAP is enabled. - - // = CONTROL - int selectable(int = ACE_CLASSIX_SAP::DEFAULT_PRIORITY /* priority */); - // Puts the SAP in the ENABLED state so that data the port associated - // with its local addess can be monitored by the CLASSIX's Reactor. - - int unselectable(int = 0 /* not used */); - // Makes the SAP DISABLED and therefore the SAP can not be monitored - // by the CLASSIX's Reactor.. - int open(const ACE_Addr&); - int open(const ACE_CLASSIX_Port_Core*); - // Sets the address information according to the supplied port - // Returns 0 on success; returns -1 otherwise - int close(void); - // removes the port information - // Returns 0 on success (always); returns -1 otherwise - - void clear(void); - // erase local port info - -#if 0 - int control(u_int = K_BROADMODE); - int control(u_int, /* mode */ int /* site */ ); - // Interface for CLASSIX' send mode -#endif - - - // = HELPER - void dump(void) const; - // dump the state of an object - - ACE_ALLOC_HOOK_DECLARE; - // declare the dynamic allocation hooks - - protected: -#if 0 - virtual set_mode_(u_int = K_BROADMODE); /* theMode */ - // Sets the addressing mode with the current setting of coTarget - virtual set_mode_(u_int, /* mode */ int /* site */); - // Sets the addressing mode as well as the coTarget -#endif - // Disable copy constructor/assignment - ACE_CLASSIX_SAP(ACE_CLASSIX_SAP const&); - ACE_CLASSIX_SAP const& operator=(ACE_CLASSIX_SAP const&); - - ACE_CLASSIX_Port local_addr_; - int enabled_; // 1 if enabled, 0 if disabled (Default) -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_SAP.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_SAP_H */ diff --git a/ace/CLASSIX/CLASSIX_SAP.i b/ace/CLASSIX/CLASSIX_SAP.i deleted file mode 100644 index 105570b363b..00000000000 --- a/ace/CLASSIX/CLASSIX_SAP.i +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CLASSIX_SAP::ACE_CLASSIX_SAP(void) - :local_addr_ (), - enabled_ (0) -{ -} - -ACE_INLINE -ACE_CLASSIX_SAP::ACE_CLASSIX_SAP(const ACE_Addr& theAddr) - :local_addr_ (theAddr.get_addr(), theAddr.get_size()), - enabled_ (0) -{ -} - -ACE_INLINE -ACE_CLASSIX_SAP::~ACE_CLASSIX_SAP(void) -{ - this->unselectable(); -} - -ACE_INLINE -const ACE_CLASSIX_Port& -ACE_CLASSIX_SAP::get_addr(void) const -{ - return this->local_addr_; -} - - -ACE_INLINE -ACE_HANDLE -ACE_CLASSIX_SAP::get_handle(void) const -{ - return this->local_addr_.get_handle(); -} - -ACE_INLINE -int -ACE_CLASSIX_SAP::is_configured(void) const -{ - return this->local_addr_.is_configured(); -} - -ACE_INLINE -int -ACE_CLASSIX_SAP::is_selectable(void) const -{ - return this->enabled_ == 1; -} - -ACE_INLINE -void -ACE_CLASSIX_SAP::clear(void) -{ - this->local_addr_.clear(); -} diff --git a/ace/CLASSIX/CLASSIX_Select_Reactor.cpp b/ace/CLASSIX/CLASSIX_Select_Reactor.cpp deleted file mode 100644 index 13716a5d351..00000000000 --- a/ace/CLASSIX/CLASSIX_Select_Reactor.cpp +++ /dev/null @@ -1,337 +0,0 @@ -// $Id$ -/* -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// CLASSIX_Reactor.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ -*/ -#include "ace/CLASSIX/CLASSIX_Select_Reactor.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Select_Reactor.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/CLASSIX/CLASSIX_OS.h" -/* ------------------------------------------------------------------------- */ -int -ACE_CLASSIX_Select_Reactor::wait_for_multiple_events -(ACE_Select_Reactor_Handle_Set &theDispatchSet, - ACE_Time_Value *max_wait_time) -{ - - ACE_Time_Value timer_buf (0); - ACE_Time_Value *this_timeout = &timer_buf; - - int number_of_active_handles = this->any_ready (theDispatchSet); - - // If there are any bits enabled in the then we'll - // handle those first, otherwise we'll block in select(). - - if (number_of_active_handles == 0) - { - int port = K_ANYENABLED; - do - { - // Monitor all enabled ports - // CLASSIX uses -1 rathre than 0 for blocked receive - int msec = -1; - if (this->timer_queue_->calculate_timeout (max_wait_time, - this_timeout) != 0) - { - if ((msec = this_timeout->msec()) == 0) - { - msec = -1; - this_timeout = 0; - } - } - else - this_timeout = 0; - - ACE_CLASSIX_Msg rmsg(0, 0); - port = K_ANYENABLED; - ssize_t size = ::ipcReceive(rmsg.get(), &port, msec); -#if 0 - ACE_DEBUG((LM_DEBUG, - "(%t)ACE_CLASSIX_Select_Reactor::" - "return from ipcReceive():ret = %d" - ", port = %d, timeout = %d\n", - size, port, msec)); -#endif - if (size >= 0) - { - // Is 0 valid ??? - // Keep info about which handler this message is for and - // its size. - if (this->set_current_info_(port, size) == 0) - { - theDispatchSet.rd_mask_.set_bit(port); - number_of_active_handles = 1; - } - else - { - ACE_DEBUG((LM_DEBUG, - "Synchronization problem in Reactor???\n")); - number_of_active_handles = -1; - errno = K_EFAULT; - } - } - else - { - // make the current message information invalid - this->set_current_info_(ACE_INVALID_HANDLE, 0); - if ((errno = size) == K_ETIMEOUT) - number_of_active_handles = 0; - else - number_of_active_handles = -1; - } - } - while (number_of_active_handles == -1 && - this->handle_error_ (port) > 0); - } - // Return the number of events to dispatch. - return number_of_active_handles; -} - -int -ACE_CLASSIX_Select_Reactor::set_current_info_(ACE_HANDLE thePort, - size_t theSize) -{ - ACE_MT(ACE_GUARD_RETURN (ACE_SELECT_REACTOR_MUTEX, ace_mon, - this->token_, -1)); - - this->current_handle_ = thePort; - this->current_msg_size_ = theSize; - return 0; -} - -int -ACE_CLASSIX_Select_Reactor::current_info(ACE_HANDLE thePort, - size_t& theSize) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_MUTEX, - ace_mon, this->token_, -1)); - - if (this->current_handle_ == thePort) - { - theSize = this->current_msg_size_; - this->current_msg_size_ = 0; - this->current_handle_ = ACE_INVALID_HANDLE; - return 0; - } - else - { - theSize = 0; - return -1; - } -} - -int -ACE_CLASSIX_Select_Reactor::handle_error_ (int thePort) -{ - - // The thread has been aborted - if (errno == K_EABORT) - return this->restart_; - // No port or a (Chorus) handler is attached to the port - else if (errno == K_ENOPORT || errno == K_EINVAL) - return this->check_handles_ (thePort); - else - return -1; -} - -int -ACE_CLASSIX_Select_Reactor::check_handles_ (int thePort) -{ - ACE_TRACE ("ACE_Select_Reactor::check_handles"); - if (thePort == K_ANYENABLED) - return -1; - else - // Don't know how to check if a Chorus port has been disabled or deleted. - return 0; -} - -/* ------------------------------------------------------------------------- */ -void -ACE_CLASSIX_Select_Reactor_Notify::dump (void) const -{ - ACE_TRACE ("ACE_CLASSIX_Select_Reactor_Notify::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_CLASSIX_select_reactor_ = %x"), - this->select_reactor_)); - this->notification_sap_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -int -ACE_CLASSIX_Select_Reactor_Notify::open (ACE_Reactor_Impl *theReactor, - ACE_Timer_Queue*, - int the_disable_notify_pipe) -{ - if (the_disable_notify_pipe == 0) - { - this->select_reactor_ = ACE_dynamic_cast - (ACE_CLASSIX_Select_Reactor *, theReactor); - - if (this->notification_sap_.open (&this->notification_port_) != 0 || - this->notification_sap_.selectable() != 0) - return -1; - - return this->select_reactor_->register_handler - (this->notification_sap_.get_handle (), - this, - ACE_Event_Handler::READ_MASK); - } - else - { - this->select_reactor_ = 0; - } -} - -ssize_t -ACE_CLASSIX_Select_Reactor_Notify::notify (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - ACE_Time_Value *timeout) -{ - ACE_Notification_Buffer buffer (eh, mask); - ACE_CLASSIX_Msg msg(&buffer, sizeof (buffer)); - KnIpcDest dest; - dest.target = this->notification_sap_.get_addr().get_id(); - - ssize_t n = ipcSend (msg.get(), K_DEFAULTPORT, &dest); - if (n < 0) - ACE_DEBUG((LM_DEBUG, "ipcSend() error = %d\n", n)); - return n == 0 ? 0 : -1; -} - -// Handles pending threads (if any) that are waiting to unblock the -// Select_Reactor. - -int -ACE_CLASSIX_Select_Reactor_Notify::dispatch_notifications ( - int & number_of_active_handles, - const ACE_Handle_Set &rd_mask) -{ - ACE_TRACE ("(%t) ACE_Select_Reactor_Notify::handle_notification"); - - ACE_HANDLE read_handle = - this->notification_sap_.get_handle (); - - if (rd_mask.is_set (read_handle)) - { - number_of_active_handles--; - return this->handle_input (read_handle); - } - else - return 0; -} - -// Special trick to unblock select() when updates occur in somewhere -// other than the main ACE_Select_Reactor thread. All we do is write data to -// a pipe that the ACE_Select_Reactor is listening on. Thanks to Paul -// Stephenson for suggesting this approach. - -int -ACE_CLASSIX_Select_Reactor_Notify::handle_input (ACE_HANDLE handle) -{ - // Precondition: this->select_reactor_.token_.current_owner () == - // ACE_Thread::self (); - - if (handle != this->notification_sap_.get_handle()) - { - ACE_DEBUG((LM_DEBUG, "ACE_CLASSIX_Select_Reator_Notify::" - "handle_input() Not my handle\n")); - return 0; - } - - ssize_t n = 0; - size_t n1= 0; - - int number_dispatched = 0; - - ACE_Notification_Buffer buffer; - ACE_CLASSIX_Msg rmsg(&buffer, sizeof (buffer)); - - if (this->select_reactor_->current_info(handle, n1) == -1 || - n1 != sizeof buffer) - { - // I'm not quite sure what to do at this point. It's - // probably best just to return -1. - ACE_DEBUG((LM_DEBUG, - "ACE_CLASSIX_Select_Reactor_Notify:: " - "read not expected by the reactor\n", n1)); - return -1; - } - - while ((n = ::ipcGetData(rmsg.get())) > 0) - { - if (n != sizeof buffer) - { - // I'm not sure quite what to do at this point. It's - // probably best just to return -1. - ACE_DEBUG((LM_DEBUG, - "ACE_CLASSIX_Select_Reactor_Notify::ipcGetDAta() " - "incorrect read(%d)\n", n)); - return -1; - } - - // If eh == 0 then another thread is unblocking the ACE_Select_Reactor - // to update the ACE_Select_Reactor's internal structures. Otherwise, - // we need to dispatch the appropriate handle_* method on the - // ACE_Event_Handler pointer we've been passed. - if (buffer.eh_ != 0) - { - int result = 0; - - switch (buffer.mask_) - { - case ACE_Event_Handler::READ_MASK: - case ACE_Event_Handler::ACCEPT_MASK: - result = buffer.eh_->handle_input (ACE_INVALID_HANDLE); - break; - case ACE_Event_Handler::WRITE_MASK: - result = buffer.eh_->handle_output (ACE_INVALID_HANDLE); - break; - case ACE_Event_Handler::EXCEPT_MASK: - result = buffer.eh_->handle_exception (ACE_INVALID_HANDLE); - break; - default: - // Should we bail out if we get an invalid mask? - ACE_ERROR ((LM_ERROR, ACE_TEXT ("invalid mask = %d\n"), buffer.mask_)); - } - if (result == -1) - buffer.eh_->handle_close (ACE_INVALID_HANDLE, - ACE_Event_Handler::EXCEPT_MASK); - } - - number_dispatched++; - - // Bail out if we've reached the . Note that - // by default is -1, so we'll loop until all - // the notifications in the pipe have been dispatched. - if (number_dispatched == this->select_reactor_->max_notify_iterations()) - break; - } - - // Reassign number_dispatched to -1 if things have gone seriously - // wrong. - if (n < 0) - number_dispatched = -1; - - - // Enqueue ourselves into the list of waiting threads. When we - // reacquire the token we'll be off and running again with ownership - // of the token. The postcondition of this call is that - // this->select_reactor_.token_.current_owner () == ACE_Thread::self (); - this->select_reactor_->renew(); - return number_dispatched; -} -/* ------------------------------------------------------------------------- */ diff --git a/ace/CLASSIX/CLASSIX_Select_Reactor.h b/ace/CLASSIX/CLASSIX_Select_Reactor.h deleted file mode 100644 index 98063a60c1f..00000000000 --- a/ace/CLASSIX/CLASSIX_Select_Reactor.h +++ /dev/null @@ -1,209 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -/* -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// CLASSIX_Reactor.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ -*/ - -#ifndef ACE_CLASSIX_REACTOR_H -#include "ace/pre.h" -#define ACE_CLASSIX_REACTOR_H - -/* ------------------------------------------------------------------------- */ -#include "ace/Timer_Queue.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Select_Reactor.h" -#include "ace/Message_Block.h" -#include "ace/CLASSIX/CLASSIX_SAP.h" - -class ACE_CLASSIX_Select_Reactor; - -class ACE_Export ACE_CLASSIX_Select_Reactor_Notify : - public ACE_Reactor_Notify -{ - // = TITLE - // Unblock the from its event loop. - // - // = DESCRIPTION - // This replaces class. - // Instead of using pipe, this class uses an Chorus IPC port to - // trigger the unblock event. - // -public: - // = Initialization and termination methods. - ACE_CLASSIX_Select_Reactor_Notify(void); - ~ACE_CLASSIX_Select_Reactor_Notify(void); - - virtual int open (ACE_Reactor_Impl *, - ACE_Timer_Queue * = 0, - int = 0 /* dusable_notify_pip */); - // Enables the notification port and register it with the reactor - virtual int close (void); - // Disables the notification port - - int dispatch_notifications (int &number_of_active_handles, - const ACE_Handle_Set &rd_mask); - // Handles pending threads (if any) that are waiting to unblock the - // Select_Reactor. - - ssize_t notify (ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value * = 0); - // Called by a thread when it wants to unblock the Select_Reactor. - // This wakeups the if currently blocked in - // select()/poll(). Pass over both the *and* the - // to allow the caller to dictate which - // method the will invoke. The - // indicates how long to blocking trying to notify the - // . If == 0, the caller will block until - // action is possible, else will wait until the relative time - // specified in * elapses). - - virtual int handle_input (ACE_HANDLE handle); - // Called back by the Select_Reactor when a thread wants to unblock us. - - virtual void max_notify_iterations (int); - // Set the maximum number of times that the - // method will iterate - // Always 1. - - virtual int max_notify_iterations (void); - // Get the maximum number of times that the - // method will iterate. - // Always 1 - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_CLASSIX_Select_Reactor *select_reactor_; - // Keep a back pointer to the . If this value - // if NULL then the has been initialized with - // . - ACE_CLASSIX_Port_Core notification_port_; // CLASSIX' IPC port - ACE_CLASSIX_SAP notification_sap_; - // The HANDLE that the Select_Reactor is listening on and - // the HANDLE that threads wanting the attention of the - // Select_Reactor will write t are the same. - // It can be seen that the notification port is implicitly connected to the - // port from where the notification is written. In many cases, it will be - // the actor's default port. -}; - -class ACE_CLASSIX_Select_Reactor : public ACE_Select_Reactor - // = TITLE - // Implementing a Reactor for monitoring incoming data - // - // = DESCRIPTION - // This class redefines the wait_for_events() method of - // class. - // - // The wait_for_events() method uses ipcReceive() to monitor - // all ENABLED ports for incoming messages. The ipcReceive() is - // set up such that it will find out the size of the message but will - // not read the message. The Chorus OS provides an ipcGetData() - // to read the message that has just been detected on the same - // thread. - // Once a message is detected on a particular - // port, the reactor will invoke the port handler's - // handle_input() method on the same thread. It is important that - // handle_input() shall immediately retrieve(use ipcGetData()) - // the message on the same - // thread and it shall not hold up this thread in the handle_input() - // routine for too long. This will allow the Reactor to respond to - // events more quickly. - // - // = NOTE - // Since chorus does not allow ipcReceive to monitor a subset of - // ENABLED ports. One cannot have two ACE_CLASSIX_Select_Reactors - // in one actor. - // -{ - public: - - - // = CURRENT MESSAGE - // The following message should be called in the handler's - // handle_input() routine. - // The handle_input() routine should not hold the reactor for too long. - virtual int current_info(ACE_HANDLE /* port */, - size_t& /* msg size */); - // Retruns the current messageage to the caleer if the supplied - // handle id is the same as the - // Returns 0, if constains the size of the message - // that the handler shall read. - // Returns -1, if the caller is not the expected handler. - - protected: - // = INITIALIZATION - ACE_CLASSIX_Select_Reactor (ACE_Timer_Queue * = 0); - // Initializes with the handler - // repository of the default size. - - ACE_CLASSIX_Select_Reactor (size_t size, - int restart = 0, - ACE_Timer_Queue * = 0); - // Initializes with the handler repository of - // size . - - // multiplexer - virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &, - ACE_Time_Value *); - // Wait for events to occur. - - virtual int set_current_info_(ACE_HANDLE /* handle */, - size_t /* size of data */); - // record the handler and the size of the message that the handler shall - // read next. - - - // ACE_Recursive_Thread_Mutex lock_current_; - // lock for data relating to the current message. - // use token lock - - size_t current_msg_size_; - // size of the message that has just been detected. - - ACE_HANDLE current_handle_; - // handler id of the current address. - - friend class ACE_CLASSIX_Select_Reactor_Notify; - friend class ACE_CLASSIX_OS; - // for constructors - - private: - int handle_error_(int /* port handle */); - // Takes corrective action when errors occur. - int check_handles_(int /* port handle */); - // Makes sure the handler is valid. - - ACE_CLASSIX_Select_Reactor(ACE_CLASSIX_Select_Reactor const&); - ACE_CLASSIX_Select_Reactor const& operator=(ACE_CLASSIX_Select_Reactor const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Select_Reactor.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_REACTOR_H */ diff --git a/ace/CLASSIX/CLASSIX_Select_Reactor.i b/ace/CLASSIX/CLASSIX_Select_Reactor.i deleted file mode 100644 index af4e995cb87..00000000000 --- a/ace/CLASSIX/CLASSIX_Select_Reactor.i +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -// -// CLASSIX/Reactor.i -/* ------------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------------- */ -ACE_INLINE -ACE_CLASSIX_Select_Reactor_Notify::ACE_CLASSIX_Select_Reactor_Notify(void) - : ACE_Reactor_Notify() -{ -} - -ACE_INLINE -ACE_CLASSIX_Select_Reactor_Notify::~ACE_CLASSIX_Select_Reactor_Notify(void) -{ -} - -ACE_INLINE -ACE_CLASSIX_Select_Reactor::ACE_CLASSIX_Select_Reactor( - ACE_Timer_Queue *theTimeQ) - : ACE_Select_Reactor(0, theTimeQ, 0, - new ACE_CLASSIX_Select_Reactor_Notify()), - current_msg_size_ (0), - current_handle_ (ACE_INVALID_HANDLE) -{ -} - -ACE_INLINE -ACE_CLASSIX_Select_Reactor::ACE_CLASSIX_Select_Reactor ( - size_t theSize, - int theRs, - ACE_Timer_Queue *theTimeQ) - : ACE_Select_Reactor (theSize, theRs, 0, theTimeQ, 0, - new ACE_CLASSIX_Select_Reactor_Notify() ), - current_msg_size_ (0), - current_handle_ (ACE_INVALID_HANDLE) -{ -} - -ACE_INLINE -int -ACE_CLASSIX_Select_Reactor_Notify::close (void) -{ - // deregister handle ??? - return this->notification_sap_.close (); -} - -ACE_INLINE -void -ACE_CLASSIX_Select_Reactor_Notify::max_notify_iterations (int iterations) -{ -} - -ACE_INLINE -int -ACE_CLASSIX_Select_Reactor_Notify::max_notify_iterations (void) -{ - return 1; -} - - -/* ------------------------------------------------------------------------- */ diff --git a/ace/CLASSIX/CLASSIX_Stream.cpp b/ace/CLASSIX/CLASSIX_Stream.cpp deleted file mode 100644 index 5d1ba095853..00000000000 --- a/ace/CLASSIX/CLASSIX_Stream.cpp +++ /dev/null @@ -1,362 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Stream.cpp -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#include "ace/CLASSIX/CLASSIX_Stream.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Stream.i" -#endif /* __ACE_INLINE__ */ -/* ------------------------------------------------------------------------- */ -ACE_CLASSIX_Stream::ACE_CLASSIX_Stream(void) - : local_sap_ (), - local_sap_closed_ (0), - local_port_ (0), - peer_sap_ (), - peer_sap_closed_ (1) -// dest_site_ (-1) -{ -} - -ACE_CLASSIX_Stream::ACE_CLASSIX_Stream - (const ACE_CLASSIX_Port_Core& thePeer, - const ACE_CLASSIX_Port& theLocal) - : local_sap_ (theLocal), - local_sap_closed_ (0), - local_port_ (0), - peer_sap_ (thePeer), - peer_sap_closed_ (1) -// dest_site_ (-1) -{ - this->dest_.target = this->peer_sap_.get_addr()->get_id(); -} - -ACE_CLASSIX_Stream::ACE_CLASSIX_Stream(const ACE_CLASSIX_Port& thePeer, - const ACE_CLASSIX_Port& theLocal) - : local_sap_ (theLocal), - local_sap_closed_(0), - local_port_ (0), - peer_sap_ (thePeer), - peer_sap_closed_ (1) -// dest_site_ (-1) -{ - this->dest_.target = this->peer_sap_.get_addr()->get_id(); -} - - -ACE_CLASSIX_Stream::ACE_CLASSIX_Stream(const KnUniqueId& thePeer, - const ACE_CLASSIX_Port& theLocal) - : local_sap_ (theLocal), - local_sap_closed_(0), - local_port_ (0), - peer_sap_ (thePeer), - peer_sap_closed_ (1) -// dest_site_ (-1) -{ - this->dest_.target = this->peer_sap_.get_addr()->get_id(); -} - -int -ACE_CLASSIX_Stream::set_local_port(ACE_CLASSIX_Port_Core* thePort) -{ - delete this->local_port_; - if (this->local_sap_.open(thePort) == 0) - { - this->local_port_ = thePort; - return 0; - } - else - { - this->local_port_ = 0; - this->local_sap_.clear(); - return -1; - } -} - -int -ACE_CLASSIX_Stream::open(void) -{ - this->dest_.target = this->peer_sap_.get_addr()->get_id(); - this->open_writer(); - - if (!this->local_sap().is_configured() || - this->local_sap().get_handle() == - ACE_CLASSIX_DEFAULT_PORT::instance()->get_handle()) - { - delete this->local_port_; - ACE_NEW_RETURN(this->local_port_, ACE_CLASSIX_Port_Core(), -1); - return this->local_sap_.open(this->local_port_); - } - - return 0; -} - -int -ACE_CLASSIX_Stream::open(const ACE_Addr& theAddr) -{ - this->dest_.target = this->peer_sap_.get_addr()->get_id(); - this->open_writer(); - - if (!this->local_sap().is_configured() || - this->local_sap().get_handle() == - ACE_CLASSIX_DEFAULT_PORT::instance()->get_handle()) - { - delete this->local_port_; - if (theAddr.get_size() != this->local_sap().get_addr().get_size()) - return -1; - return this->local_sap_.open(theAddr); - } - return 0; -} - -int -ACE_CLASSIX_Stream::close_writer(void) -{ - if (this->peer_sap_closed_ == 0) - { - if (this->send_n(0, 0) < 0) - ACE_DEBUG((LM_DEBUG, "failed to send a zero byte msg\n")); - this->peer_sap_closed_ = 1; - } - return 0; -} - -void -ACE_CLASSIX_Stream::open_writer(void) -{ - this->peer_sap_closed_ = 0; -} - -int -ACE_CLASSIX_Stream::close(void) -{ - this->close_writer(); - - this->local_sap_.close(); - if (this->local_port_) - { - delete this->local_port_; - this->local_port_ = 0; - } - this->dest_.target = ACE_CLASSIX_OS::null_KnUniqueId(); - return 0; -} - -void -ACE_CLASSIX_Stream::set_target_() -{ - this->dest_.target = this->peer_sap_.get_addr()->get_id(); -} - -int -ACE_CLASSIX_Stream::set_peer_sap(const ACE_Addr& theAddr) -{ - if (this->peer_sap_.set(theAddr) == 0) - { - this->set_target_(); - return 0; - } - return -1; -} - -int -ACE_CLASSIX_Stream::set_peer_sap(const ACE_CLASSIX_Port_Core& theAddr) -{ - if (this->peer_sap_.set(theAddr) == 0) - { - this->set_target_(); - return 0; - } - return -1; -} - -int -ACE_CLASSIX_Stream::set_peer_sap(const KnUniqueId& theAddr) -{ - if (this->peer_sap_.set(theAddr) == 0) - { - this->set_target_(); - return 0; - } - return -1; -} - -int -ACE_CLASSIX_Stream::set_peer_sap(const KnCap& theAddr) -{ - if (this->peer_sap_.set(theAddr) == 0) - { - this->set_target_(); - return 0; - } - return -1; -} - -ssize_t -ACE_CLASSIX_Stream::send_n(const void* theBuf, size_t theLen, int theFlags) -{ - if (!this->is_writer_closed()) - { - this->set_mode_(theFlags); - return this->send_n(theBuf, theLen); - } - else - return 0; -} - -ssize_t -ACE_CLASSIX_Stream::send_n(const void* theBuf, size_t theLen) const -{ - if (!this->is_writer_closed()) - { - ACE_CLASSIX_Msg msg(theBuf, theLen); - int result = 0; - if ((result = ::ipcSend((KnMsgDesc*) msg.get(), - this->local_sap().get_handle(), - (KnIpcDest*) &this->dest_)) == 0) - return theLen; - else - { - errno = ACE_CLASSIX_OS::convert_io_error(result); - return -1; - } - } - else - { - return 0; - } -} - -ssize_t -ACE_CLASSIX_Stream::reply(const void* theBuf, size_t theLen) const -{ - if (!this->is_writer_closed()) - { - ACE_CLASSIX_Msg msg(theBuf, theLen); - if (int result = ::ipcReply((KnMsgDesc*) msg.get()) == 0) - return theLen; - else - { - errno = ACE_CLASSIX_OS::convert_io_error(result); - return -1; - } - } - else - return 0; -} - -ssize_t -ACE_CLASSIX_Stream::ipcRecv(void* theBuf, size_t theLen, - int theFlag, ACE_Time_Value* theTimeout) const -{ - if (!this->is_reader_closed()) - { - // In chorus environment, a negative value means block - // until recv is possible - int timeout = theTimeout == 0 ? -1 : theTimeout->msec(); - if (timeout == 0) - timeout = -1; - - if (theFlag & MSG_PEEK) - { - theBuf = 0; - theLen = 0; - } - - ACE_CLASSIX_Msg rmsg(theBuf, theLen); - int handle = this->local_sap().get_handle(); - int result = ::ipcReceive((KnMsgDesc*) rmsg.get(), &handle, - timeout); - if (result < 0) - { - errno = ACE_CLASSIX_OS::convert_io_error(result); - return -1; - } - else - return result; - } - else - { - errno = ENOTCONN; - return -1; - } -} - -ssize_t -ACE_CLASSIX_Stream::ipcRecv_n(void* theBuf, size_t theLen, - int theFlag, ACE_Time_Value* theTimeout) const -{ - // Timeout value applies to each around of receive. - // ....Should be adjusted after each round! - int len = 0; - void *next = theBuf; - size_t more = theLen; - for (int n = 0; - more > 0; - len += n, next += n, more -=n) - { - if ((n = this->ipcRecv(next, more, theFlag, theTimeout)) == -1) - break; - } - return len; -} - -ssize_t -ACE_CLASSIX_Stream::recv(void* theBuf, int theLen) const -{ - if (!this->is_reader_closed()) - { - ACE_CLASSIX_Msg rmsg(theBuf, theLen); - int result = ::ipcGetData(rmsg.get()); - if (result >= 0) - return result; - else if (result == K_EINVAL) - errno = EWOULDBLOCK; - else - errno = EFAULT; - - return -1; - } - else - return 0; -} - - - -void -ACE_CLASSIX_Stream::dump (void) const -{ - ACE_DEBUG ((LM_DEBUG, "ACE_CLASSIX_Stream...\n")); - ACE_DEBUG ((LM_DEBUG, "...local sap(%s)\n", - this->is_writer_closed() == 1 ? "closed" : "opened")); - if (this->local_port_) - ACE_DEBUG ((LM_DEBUG, "\towns the local port(%x)\n", - this->local_port_)); - this->local_sap().dump(); - - ACE_DEBUG ((LM_DEBUG, "...Peer sap(%s & %s)\n", - this->is_reader_closed() == 1 ? "closed" : "opened", - this->is_selectable() ? "enabled" : "disabled")); - this->peer_sap().dump(); - ACE_DEBUG((LM_DEBUG, "Dest- Target\n head = %x tail = %x\n", - this->dest_.target.uiHead, - this->dest_.target.uiTail - /* this->dest_site_ */)); - ACE_DEBUG((LM_DEBUG, "Dest- coTarget\n head = %x tail = %x\n", - this->dest_.coTarget.uiHead, - this->dest_.coTarget.uiTail - /* this->dest_site_ */)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} diff --git a/ace/CLASSIX/CLASSIX_Stream.h b/ace/CLASSIX/CLASSIX_Stream.h deleted file mode 100644 index 0ebced26877..00000000000 --- a/ace/CLASSIX/CLASSIX_Stream.h +++ /dev/null @@ -1,272 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CLASSIX_Stream.h -// -// = AUTHOR(S) -// Nokia Telecommunications -// -// ============================================================================ - -#ifndef ACE_CLASSIX_STREAM_H -#include "ace/pre.h" -#define ACE_CLASSIX_STREAM_H - -/* ------------------------------------------------------------------------- */ -#include "ace/CLASSIX/CLASSIX_SAP.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/CLASSIX/CLASSIX_Peer_SAP.h" -#include "ace/CLASSIX/CLASSIX_Port_Default.h" - -class ACE_CLASSIX_Stream - // = TITLE - // Provides the stream interface for CLASSIX IPC communications. - // - // = DESCRIPTION - // This classes provides a stream wrapper over CLASSIX' - // IPC. It is designed to be an alternative to Stream type of - // communication in the UNIX AF_INET environment. - // - // To the user, the stream is connection-oriented. The stream - // is implemented on top of IPC, it is connectionless and its - // reliability is as good as what the raw IPC can offer. - // - // Since CLASSIX IPC is not intended to go across wide area network, - // it can be seen as an - // alternative to AF_INET's connection oriented stream, even though - // the CLASSIX IPC is connectionless. - // - // This class contains a local sap, peer sap and data holding - // delivery mode information. - // - // When a stream is created, the peer SAP information must be provided. - // The local SAP information may be provided in the constructor or - // open(). The local SAP information given in open() overrides the - // existing one. If the local SAP address is not given at all, it will - // allocate a port and use it as the local SAP. - // -{ - public: - ACE_CLASSIX_Stream(void); - // Default constructor, does not setup anything - ACE_CLASSIX_Stream(const ACE_CLASSIX_Port_Core&, /* remote port */ - const ACE_CLASSIX_Port& = - *ACE_CLASSIX_DEFAULT_PORT::instance()); /* local address */ - - ACE_CLASSIX_Stream(const ACE_CLASSIX_Port&, /* remote port address */ - const ACE_CLASSIX_Port& = - *ACE_CLASSIX_DEFAULT_PORT::instance());/* local address */ - - ACE_CLASSIX_Stream(const KnUniqueId&, /* remote port address */ - const ACE_CLASSIX_Port& = - *ACE_CLASSIX_DEFAULT_PORT::instance());/* local address */ - - // = IO - // Returns -1, if fault has occured during receive. errno contains - // the error condition. - // Returns no of bytes received/sent, otherwise. - // - virtual ssize_t send_n (const void *, /* buf */ - size_t, /* n */ - int /* flags */); - // Sends exactly n bytes (keep trying until n bytes are sent) - virtual ssize_t send_n (const void *, /* buf */ size_t /* n */) const; - // Sends n bytes(keep trying until n bytes are sent) - // Uses the current addressing mode - virtual ssize_t send (const void *, /* buf */ - size_t, /* n */ - int /* flags */); - // Sends n bytes. Same as send_n(buf, n, flag) - virtual ssize_t send (const void *, /* buf */ - size_t /* n */) const; - // Sends n bytes. same as send_n(buf, n). - virtual ssize_t reply (const void *, /* buf */ - size_t /* n */) const; - // Sends n bytes to the sender of the cureent thread's current message. - - ssize_t ipcRecv (void *, /* buffer */ - size_t, /* length */ - int = 0, /* flag: 0 or MSG_PEEK */ - ACE_Time_Value* = 0) const; /* timeout */ - // Recv an byte buffer - // Wait up to amount of time to receive up to bytes - // into from (uses the call). If times - // out a -1 is returned with . If it succeeds the - // number of bytes received is returned. - // If == 0, the caller - // will block until action is possible, else will wait until the - // relative time specified in * elapses). - ssize_t ipcRecv_n (void *, /* buffer */ - size_t, /* length */ - int = 0, /* flag: 0 or MSG_PEEK */ - ACE_Time_Value* = 0) const; /* timeout */ - // Continue until receives n bytes of data or an error has occurred. - // Retruns the no of bytes actually received. - // If it is less than expected, errno contains error info. - - ssize_t peek(ACE_Time_Value* = 0 /* timeout */) const; - // It is the same as recv(0, 0, MSG_PEEK, timeout) - // This must be followd by get_data() in order to read the peeked message - ssize_t recv(void* /*buf */, int /* len */) const; - // Gets data which have been peeked - ssize_t recv_n(void* /*buf */, int /* len */) const; - // Gets data which have been peeked - - // = ACCESS - virtual ACE_HANDLE get_handle (void) const; - // virtual void set_handle (ACE_HANDLE); - virtual void set_handle(ACE_HANDLE); - // set the local port's address according to the supplied handle - - const ACE_CLASSIX_SAP& local_sap(void) const; - // Returns read-only local sap - const ACE_CLASSIX_Peer_SAP& peer_sap(void) const; - // Returns read-only peer sap - int get_remote_addr (ACE_Addr & /* dest */) const; - // Returns 0, if the remote address has been setup, else -1. - // The parameter is not changed. - // This method is here for compatability with SOCK_Stream. - // Since the remote addr may be a port or a group and since the - // address formats are different between a port and a group, the caller - // cannot provide an appropriate buffer for recording the address. The - // parameter is therefore not used. - - - const ACE_CLASSIX_Port& local_addr(void) const; - // Returns local address in format - - int is_selectable(void) const; - // Retruns 1, if the local SAP is enabled. - int is_writer_closed(void) const; - // Retruns 1, if writer side is closed. - int is_reader_closed(void) const; - // Retruns 1, if reader side is closed. - - - // = CONTROL - int set_peer_sap(const ACE_Addr&); - // Returns 0, if successful; returns -1, otherwise - // same as set_addr(const ACE_Addr&); - int set_peer_sap(const ACE_CLASSIX_Port_Core&); - // Returns 0, if successful; returns -1, otherwise - // same as void set_addr(const ACE_CLASSIX_Port_Core&); - int set_peer_sap (const KnUniqueId&); - // Returns 0, if successful; returns -1, otherwise - int set_peer_sap (const KnCap&); - // Returns 0, if successful; returns -1, otherwise - - virtual int enable(int) const; - virtual int disable(int) const; - // These two methods do nothing. They are here to maintain the same - // interface as other type of Stream class, e.g. ACE_SOCK_Stream - - int selectable(int = ACE_CLASSIX_SAP::DEFAULT_PRIORITY); - int unselectable(void); - // Enables/Disables the local port to be monitored (by a CLASSIX reactor) - // Default = DISABLED - virtual void open_writer(void); - virtual int close_writer(void); - // Closes down the writer - // Returns -1, if it fails; returns 0, otherwise - // Subclass can overwrite this with sophisticated mechanism, such as - // exchange protocol information with the peer. - virtual int close_reader(void); - // Closes down the writer - // Returns -1, if it fails; returns 0, otherwise - // Subclass can overwrite this with sophisticated mechanism, such as - // exchange protocol information with the peer. - - virtual int open(void); - // for local SAP... - // Creates a port and uses it as a SAP. - // A port can be created if the local_sap is not configured or - // it is configured and the local_sap uses the actor's default port. - // Returns -1, if it fails; returns 0, otherwise - virtual int open(const ACE_Addr&); - // for local SAP... - // Uses the supplied port information for the local SAP. - virtual int close(void); - // for local SAP... - // Deletes the optional local port and clears the local SAP infomration. - - // = OPTIONS - int control(u_int = K_BROADMODE); - int control(u_int, /* mode */ int /* site */ ); - // Interface for CLASSIX' send mode - - // = HELPER - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - protected: - friend class ACE_CLASSIX_CLD_Connector; - friend class ACE_CLASSIX_CO_Connector; - friend class ACE_CLASSIX_CO_Acceptor; - ACE_CLASSIX_SAP& get_local_sap(void); - // Returns local sap - ACE_CLASSIX_Peer_SAP& get_peer_sap(void); - // Returns peer sap - int set_local_port(ACE_CLASSIX_Port_Core*); - // Uses the supplied port as the local port and assumes the ownership - // of the port. The existing local port, if any, will be deleted. - // Returns 0, if it is successful. - // Returns -1, otherwise. The setting of the original local port - // will be erased. - - void set_target_(void); - // set the delivery target structure using the existing peer information - - virtual int set_mode_(u_int = K_BROADMODE); /* theMode */ - // Sets the addressing mode with the current setting of coTarget - virtual int set_mode_(u_int, /* mode */ int /* site */); - // Sets the addressing mode as well as the coTarget - - ACE_CLASSIX_SAP local_sap_; - int local_sap_closed_; - // 0 if it's not closed(default), - // 1 if it's closed. - ACE_CLASSIX_Port_Core *local_port_; - // if non-zero, it will be - // deleted on exit. - - ACE_CLASSIX_Peer_SAP peer_sap_; - int peer_sap_closed_; - // 0 if it's not closed(default), - // 1 if it's closed. - - // Mode applied destination address - // Can be changed by control()/set_mode_() - // Mode is applicable in IPC classes other than the Stream class. - // It is here since it is the destination format used by ipcSend. - - // with/without additional site information - // int dest_site_; - KnIpcDest dest_; - - private: - // Disable copy constructor - ACE_CLASSIX_Stream(ACE_CLASSIX_Stream const&); - ACE_CLASSIX_Stream const& operator=(ACE_CLASSIX_Stream const&); -}; - -/* ------------------------------------------------------------------------- */ - -#if defined (__ACE_INLINE__) -#include "ace/CLASSIX/CLASSIX_Stream.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CLASSIX_Stream_H */ diff --git a/ace/CLASSIX/CLASSIX_Stream.i b/ace/CLASSIX/CLASSIX_Stream.i deleted file mode 100644 index a876a3d78c9..00000000000 --- a/ace/CLASSIX/CLASSIX_Stream.i +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CLASSIX_Stream::~ACE_CLASSIX_Stream(void) -{ - this->close(); -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::control(u_int theMode) -{ - return this->set_mode_(theMode); -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::control(u_int theMode, int theSite) -{ - return this->set_mode_(theMode, theSite); -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::set_mode_(u_int theMode) -{ - return 0; -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::set_mode_(u_int theMode, int theSite) -{ - return 0; -} - -ACE_INLINE -ssize_t -ACE_CLASSIX_Stream::peek(ACE_Time_Value* theTimeout) const -{ - return this->ipcRecv(0, 0, MSG_PEEK, theTimeout); -} - -ACE_INLINE -ssize_t -ACE_CLASSIX_Stream::send(const void *theBuf, size_t theLen) const -{ - return this->send_n(theBuf, theLen); -} - -ACE_INLINE -ssize_t -ACE_CLASSIX_Stream::send(const void *theBuf,size_t theLen, int theFlag) -{ - return this->send_n(theBuf, theLen, theFlag); -} - -ACE_INLINE -ssize_t -ACE_CLASSIX_Stream::recv_n(void* theBuf, int theLen) const -{ - return this->recv_n(theBuf, theLen); -} - -ACE_INLINE -ACE_HANDLE -ACE_CLASSIX_Stream::get_handle(void) const -{ - return this->local_sap_.get_handle(); -} - -ACE_INLINE -void -ACE_CLASSIX_Stream::set_handle(ACE_HANDLE theHandle) -{ - this->local_sap_.set_handle(theHandle); -} - -ACE_INLINE -const ACE_CLASSIX_SAP& -ACE_CLASSIX_Stream::local_sap(void) const -{ - return this->local_sap_; -} - -ACE_INLINE -const ACE_CLASSIX_Peer_SAP& -ACE_CLASSIX_Stream::peer_sap(void) const -{ - return this->peer_sap_; -} - -ACE_INLINE -ACE_CLASSIX_SAP& -ACE_CLASSIX_Stream::get_local_sap(void) -{ - return this->local_sap_; -} - -ACE_INLINE -ACE_CLASSIX_Peer_SAP& -ACE_CLASSIX_Stream::get_peer_sap(void) -{ - return this->peer_sap_; -} - -ACE_INLINE -const ACE_CLASSIX_Port& -ACE_CLASSIX_Stream::local_addr(void) const -{ - return this->local_sap_.get_addr(); -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::selectable(int thePriority) -{ - return this->local_sap_.selectable(thePriority); -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::unselectable(void) -{ - return this->local_sap_.unselectable(); -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::is_selectable(void) const -{ - return this->local_sap_.is_selectable(); -} - - -ACE_INLINE -int -ACE_CLASSIX_Stream::is_writer_closed(void) const -{ - - return (this->peer_sap_closed_ == 1); -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::close_reader(void) -{ - this->local_sap_closed_ = 1; - return 0; -} - - -ACE_INLINE -int -ACE_CLASSIX_Stream::is_reader_closed(void) const -{ - - return this->local_sap_closed_ == 1; -} - - -ACE_INLINE -int -ACE_CLASSIX_Stream::enable(int) const -{ - return 0; -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::disable(int) const -{ - return 0; -} - -ACE_INLINE -int -ACE_CLASSIX_Stream::get_remote_addr(ACE_Addr&) const -{ - return this->peer_sap_closed_ == 0; -} diff --git a/ace/CLASSIX/Makefile b/ace/CLASSIX/Makefile deleted file mode 100644 index a207ce3da0e..00000000000 --- a/ace/CLASSIX/Makefile +++ /dev/null @@ -1,544 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id$ -# -# Makefile for the entire ACE release -#---------------------------------------------------------------------------- - -MAKEFILE = Makefile -LIB = libCLASSIX.a - -FILES = \ - CLASSIX_OS \ - CLASSIX_Select_Reactor \ - CLASSIX_Addr \ - CLASSIX_Port_Core \ - CLASSIX_Port \ - CLASSIX_Port_Default \ - CLASSIX_Group \ - CLASSIX_Group_Stamp \ - CLASSIX_Group_Dynamic \ - CLASSIX_SAP \ - CLASSIX_Peer_SAP \ - CLASSIX_Stream \ - CLASSIX_Dgram_Mcast \ - CLASSIX_CO_Acceptor \ - CLASSIX_CO_Connector \ - CLASSIX_CLD_Connector - -DEFS = $(addsuffix .h,$(FILES)) Svc_Conf_Tokens.h -DEFS += $(addsuffix .i,$(FILES)) -LSRC = $(addsuffix .cpp,$(FILES)) - -BUILD = $(VLIB) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU -#### Disable installs in this ($(ACE_ROOT)/ace) directory, because this -#### is the (default) destination of installs anyways. And this will prevent -#### creation of a link from the ACE library to itself when the build of -#### the ACE library fails. -INSTALL = -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#### Setting ACELIB to null allows it to be used for building shared libraries, -#### including libACE.$(SOEXT,) on certain platforms. -ACELIB = - - -ifeq ($(SUPPRESS_DASH_G),1) -#### Build this target without -g on some platforms. - $(COMPILE-NO_DASH_G.cc) -o $@ $< -endif # SUPPRESS_DASH_G - -ifeq ($(CHORUS),1) - ifeq ($(CC),$(GHS_DIR)/build -driver ch68) - #### Build this target without -g, because it causes ghs 1.8.8 to core - #### dump. - $(VDIR)Select_Reactor.o .obj/Select_Reactor.so .shobj/Select_Reactor.o .shobj/Select_Reactor.so: - $(COMPILE-NO_DASH_G.cc) -o $@ $< - endif # CC -endif # CHORUS - -ifneq ($(GHS),) - ifeq ($(CPU),86) - $(VDIR)gethrtime.$(OBJEXT): - make $@ ghs=0 - endif # 86 -endif # GHS - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/CLASSIX_OS.o .obj/CLASSIX_OS.so .shobj/CLASSIX_OS.o .shobj/CLASSIX_OS.so: CLASSIX_OS.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/config-g++-common.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Select_Reactor.h \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Token.h \ - $(ACE_ROOT)/ace/Token.i \ - $(ACE_ROOT)/ace/Pipe.h \ - $(ACE_ROOT)/ace/Pipe.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Select_Reactor.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Select_Reactor.h \ - $(ACE_ROOT)/ace/Message_Block.h \ - $(ACE_ROOT)/ace/Message_Block.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_SAP.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_SAP.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Select_Reactor.i -.obj/CLASSIX_Select_Reactor.o .obj/CLASSIX_Select_Reactor.so .shobj/CLASSIX_Select_Reactor.o .shobj/CLASSIX_Select_Reactor.so: CLASSIX_Select_Reactor.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Select_Reactor.h \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/config-g++-common.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Select_Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Token.h \ - $(ACE_ROOT)/ace/Token.i \ - $(ACE_ROOT)/ace/Pipe.h \ - $(ACE_ROOT)/ace/Pipe.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Select_Reactor.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Message_Block.h \ - $(ACE_ROOT)/ace/Message_Block.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_SAP.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_SAP.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Select_Reactor.i -.obj/CLASSIX_Addr.o .obj/CLASSIX_Addr.so .shobj/CLASSIX_Addr.o .shobj/CLASSIX_Addr.so: CLASSIX_Addr.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/config-g++-common.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.i -.obj/CLASSIX_Port_Core.o .obj/CLASSIX_Port_Core.so .shobj/CLASSIX_Port_Core.o .shobj/CLASSIX_Port_Core.so: CLASSIX_Port_Core.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/config-g++-common.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.h \ - $(ACE_ROOT)/ace/Select_Reactor.h \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Token.h \ - $(ACE_ROOT)/ace/Token.i \ - $(ACE_ROOT)/ace/Pipe.h \ - $(ACE_ROOT)/ace/Pipe.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Select_Reactor.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.i -.obj/CLASSIX_Port.o .obj/CLASSIX_Port.so .shobj/CLASSIX_Port.o .shobj/CLASSIX_Port.so: CLASSIX_Port.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/config-g++-common.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.h \ - $(ACE_ROOT)/ace/Select_Reactor.h \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Token.h \ - $(ACE_ROOT)/ace/Token.i \ - $(ACE_ROOT)/ace/Pipe.h \ - $(ACE_ROOT)/ace/Pipe.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Select_Reactor.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.i -.obj/CLASSIX_Port_Default.o .obj/CLASSIX_Port_Default.so .shobj/CLASSIX_Port_Default.o .shobj/CLASSIX_Port_Default.so: CLASSIX_Port_Default.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Default.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/config-g++-common.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.h \ - $(ACE_ROOT)/ace/Select_Reactor.h \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Token.h \ - $(ACE_ROOT)/ace/Token.i \ - $(ACE_ROOT)/ace/Pipe.h \ - $(ACE_ROOT)/ace/Pipe.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Select_Reactor.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Core.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_OS.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port_Default.i -.obj/CLASSIX_Group.o .obj/CLASSIX_Group.so .shobj/CLASSIX_Group.o .shobj/CLASSIX_Group.so: CLASSIX_Group.cpp \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Group.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/config-g++-common.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Addr.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.h \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Port.i \ - $(ACE_ROOT)/ace/CLASSIX/CLASSIX_Group.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/ace/CORBA_Handler.cpp b/ace/CORBA_Handler.cpp deleted file mode 100644 index a4d20ae153b..00000000000 --- a/ace/CORBA_Handler.cpp +++ /dev/null @@ -1,593 +0,0 @@ -// CORBA_Handler.cpp -// $Id$ - -#include "ace/CORBA_Handler.h" - -#include "ace/Object_Manager.h" -#include "ace/Thread_Manager.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CORBA_Handler.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, CORBA_Handler, "$Id$") - -#if defined (ACE_HAS_ORBIX) && (ACE_HAS_ORBIX != 0) -ACE_ALLOC_HOOK_DEFINE(ACE_ST_CORBA_Handler) -ACE_ALLOC_HOOK_DEFINE(ACE_CORBA_Handler) - -void -ACE_CORBA_Handler::dump (void) const -{ - ACE_TRACE ("ACE_CORBA_Handler::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nreference_count_ = %d"), this->reference_count_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_CORBA_Handler::ACE_CORBA_Handler (const ACE_CORBA_Handler &rhs) -{ - ACE_TRACE ("ACE_CORBA_Handler::ACE_CORBA_Handler"); -} - -const ACE_CORBA_Handler & -ACE_CORBA_Handler::operator= (const ACE_CORBA_Handler &rhs) -{ - ACE_TRACE ("ACE_CORBA_Handler::operator="); - return *this; -} - -void -ACE_ST_CORBA_Handler::dump (void) const -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::dump"); - - ACE_CORBA_Handler::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %x"), this->instance_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\niteration_ = %d"), this->iterations_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_CORBA_Handler::~ACE_CORBA_Handler (void) -{ - ACE_TRACE ("ACE_CORBA_Handler::~ACE_CORBA_Handler"); -} - -ACE_CORBA_Handler::ACE_CORBA_Handler (void) - : reference_count_ (0) -{ - ACE_TRACE ("ACE_CORBA_Handler::ACE_CORBA_Handler"); - reactor (ACE_Reactor::instance ()); -} - -// Only one ST CORBA Handler per-process... -/* static */ -ACE_ST_CORBA_Handler *ACE_ST_CORBA_Handler::instance_ = 0; - -#if defined (ACE_TAKEOVER_ORBIX_CALLBACKS) -// Define the class statics -int ACE_ST_CORBA_Handler::set_callbacks_ = 0; -OrbixIOCallback ACE_ST_CORBA_Handler::previous_orbix_open_callback_ = 0; -OrbixIOCallback ACE_ST_CORBA_Handler::previous_orbix_close_callback_ = 0; -#endif /* ACE_TAKEOVER_ORBIX_CALLBACKS */ - - -// Insert a descriptor into the ACE_Reactor that Orbix has just added. - -/* static */ -void -ACE_ST_CORBA_Handler::insert_handle (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::insert_handle"); -// ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("+++ inserting %d\n"), handle)); - -#if defined (ACE_TAKEOVER_ORBIX_CALLBACKS) - if (ACE_ST_CORBA_Handler::previous_orbix_open_callback_ != 0) - ACE_ST_CORBA_Handler::previous_orbix_open_callback_ (handle); -#endif /* ACE_TAKEOVER_ORBIX_CALLBACKS */ - - if (ACE_ST_CORBA_Handler::instance_ == 0) - return; - - if (ACE_ST_CORBA_Handler::instance_->reactor() != 0) - ACE_ST_CORBA_Handler::instance_->reactor()->register_handler - (handle, ACE_ST_CORBA_Handler::instance_, ACE_Event_Handler::READ_MASK); - else - ; -// ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("insert_handle: reactor NULL\n"))); -} - -// Remove a descriptor from the ACE_Reactor that Orbix has just deleted. - -/* static */ -void -ACE_ST_CORBA_Handler::remove_handle (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::remove_handle"); -// ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("--- removing %d\n"), handle)); - -#if defined (ACE_TAKEOVER_ORBIX_CALLBACKS) - if (ACE_ST_CORBA_Handler::previous_orbix_close_callback_ != 0) - ACE_ST_CORBA_Handler::previous_orbix_close_callback_ (handle); -#endif /* ACE_TAKEOVER_ORBIX_CALLBACKS */ - - if (ACE_ST_CORBA_Handler::instance_ == 0) - return; - - if (ACE_ST_CORBA_Handler::instance_->reactor () != 0) - ACE_ST_CORBA_Handler::instance_->reactor ()->remove_handler - (handle, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL); - else - ; -// ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("remove_handle: reactor NULL\n"))); -} - -/* static */ -void ACE_ST_CORBA_Handler::instance_cleaner (void *object, void *param) -{ - ACE_UNUSED_ARG (param); - delete ACE_reinterpret_cast (ACE_ST_CORBA_Handler *, object); - return; -} - - -// Process the next Orbix event. - -int -ACE_ST_CORBA_Handler::handle_input (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::handle_input"); - // ACE_DEBUG ((LM_DEBUG, "dispatching Orbix handle = %d in process - // = %P\n", handle)); - - TRY { - // Loop up to dispatching the - // next event. Note the trade off between efficiency and - // fairness... - - for (size_t i = 0; i < this->iterations_; i++) - if (ACE_CORBA_1 (Orbix.isEventPending) (IT_X)) - // Process the next Orbix event (don't block). - ACE_CORBA_1 (Orbix.processNextEvent) (0, IT_X); - else - break; - } - CATCHANY { - // an error occured calling processNextEvent () - output the - // error. - cerr << IT_X << endl; - } ENDTRY; - return 0; -} - -int -ACE_ST_CORBA_Handler::suspend (void) -{ - // Create an iterator. - ACE_Handle_Set set (ACE_CORBA_1 (Orbix.getFileDescriptors) ()); - ACE_Handle_Set_Iterator orbix_descriptors (set); - - // Suspend all the HANDLEs registered by Orbix. - for (ACE_HANDLE h; - (h = orbix_descriptors ()) != ACE_INVALID_HANDLE; - ++orbix_descriptors) - this->reactor ()->suspend_handler (h); - - return 0; -} - -int -ACE_ST_CORBA_Handler::resume (void) -{ - // Create an iterator. - ACE_Handle_Set set (ACE_CORBA_1 (Orbix.getFileDescriptors) ()); - ACE_Handle_Set_Iterator orbix_descriptors (set); - - // Resume all the HANDLEs registered by Orbix. - for (ACE_HANDLE h; - (h = orbix_descriptors ()) != ACE_INVALID_HANDLE; - ++orbix_descriptors) - this->reactor ()->resume_handler (h); - - return 0; -} - -// Dummy constructor. -ACE_ST_CORBA_Handler::ACE_ST_CORBA_Handler (void) -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::ACE_ST_CORBA_Handler"); - - // This is set by default for backward compatibility. The user can - // use the set/get operations to change the iterations - this->iterations_ = 5; - - // Set up the callbacks so that we get informed when Orbix changes - // its descriptors. - OrbixIOCallback old_open, old_close; - - old_open = ACE_CORBA_1 (Orbix.registerIOCallback) ((OrbixIOCallback) &ACE_ST_CORBA_Handler::insert_handle, - FD_OPEN_CALLBACK); - old_close = ACE_CORBA_1 (Orbix.registerIOCallback) ((OrbixIOCallback) &ACE_ST_CORBA_Handler::remove_handle, - FD_CLOSE_CALLBACK); -#if defined (ACE_TAKEOVER_ORBIX_CALLBACKS) - if (ACE_ST_CORBA_Handler::set_callbacks_ == 0) - { - ACE_ST_CORBA_Handler::previous_orbix_open_callback = old_open; - ACE_ST_CORBA_Handler::previous_orbix_close_callback = old_close; - ACE_ST_CORBA_Handler::set_callbacks_ = 1; - } -#endif -} - -void -ACE_ST_CORBA_Handler::get_orbix_descriptors (void) -{ - // Create an iterator. - ACE_Handle_Set set (ACE_CORBA_1 (Orbix.getFileDescriptors) ()); - ACE_Handle_Set_Iterator orbix_descriptors (set); - - // Preinitialize anything that's already registered. - for (ACE_HANDLE h; - (h = orbix_descriptors ()) != ACE_INVALID_HANDLE; - ++orbix_descriptors) - ACE_ST_CORBA_Handler::insert_handle (h); -} - -// Register by doing a "putit" to register the -// using the at with -// orbixd. - -/* static */ -int -ACE_CORBA_Handler::register_service (const char *service_name, - const char *marker_name, - const char *service_location) -{ - ACE_TRACE ("ACE_CORBA_Handler::register_service"); - char buf[BUFSIZ * 2]; // I hope this is enough space... - - // Be defensive here... - if (service_name == 0 || service_location == 0) - { - errno = EINVAL; - return -1; - } - else if (marker_name == 0) - ACE_OS::sprintf (buf, "putit %s %s", service_name, service_location); - else - ACE_OS::sprintf (buf, "putit -marker %s %s %s", - marker_name, service_name, service_location); - - return ACE_OS::system (buf); // Use system(3S) to execute Orbix putit. -} - -// Register by doing a "putit" to register -// using the with orbixd. - -/* static */ -int -ACE_CORBA_Handler::remove_service (const char *service_name, - const char *marker_name) -{ - ACE_TRACE ("ACE_CORBA_Handler::remove_service"); - char buf[BUFSIZ * 2]; // I hope this is enough space! - if (service_name == 0) - { - errno = EINVAL; - return -1; - } - else if (marker_name == 0) - ACE_OS::sprintf (buf, "rmit %s\n", service_name); - else - ACE_OS::sprintf (buf, "rmit -marker %s %s\n", marker_name, service_name); - return ACE_OS::system (buf); // Use system(3S) to execute Orbix rmit. -} - -ACE_ST_CORBA_Handler::~ACE_ST_CORBA_Handler (void) -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::~ACE_ST_CORBA_Handler"); - // Create an iterator. - ACE_Handle_Set set (ACE_CORBA_1 (Orbix.getFileDescriptors) ()); - ACE_Handle_Set_Iterator orbix_descriptors (set); - - // Remove everything! - - for (ACE_HANDLE h; - (h = orbix_descriptors ()) != ACE_INVALID_HANDLE; - ++orbix_descriptors) - ACE_ST_CORBA_Handler::remove_handle (h); - - // Keep Orbix from calling us back and crashing the system! - ACE_CORBA_1 (Orbix.registerIOCallback) (0, FD_OPEN_CALLBACK); - ACE_CORBA_1 (Orbix.registerIOCallback) (0, FD_CLOSE_CALLBACK); - ACE_ST_CORBA_Handler::instance_ = 0; -} - -// Decrement the reference count and free up all the resources if this -// is the last service to be using the ACE_ST_CORBA_Handler... - -/* static */ -int -ACE_CORBA_Handler::deactivate_service (const char *service_name, - const char *marker_name) -{ - ACE_TRACE ("ACE_CORBA_Handler::deactivate_service"); - if (service_name != 0 - && this->remove_service (service_name, marker_name) == -1) - return -1; - - int ref_count = this->reference_count_; - - this->reference_count_--; - - // Close everything down if the count drops to 0. - if (this->reference_count_ == 0) - // Commit suicide! - delete this; - - if (ref_count < 0) - ; -// ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("warning, reference count == %d\n"), -// ref_count)); - return 0; -} - -/* static */ -ACE_CORBA_Handler * -ACE_ST_CORBA_Handler::instance (void) -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::instance"); - - // Note that this does not need a double-check since it should be - // called from a single-threaded environment. - - if (ACE_ST_CORBA_Handler::instance_ == 0) - { - ACE_NEW_RETURN (ACE_ST_CORBA_Handler::instance_, - ACE_ST_CORBA_Handler, - 0); - // Set up so that instance_cleaner() is called to destroy the instance - // at program shutdown when the static objects are destroyed. - // This should be _before_ the singleton reactor is destroyed since - // cleanup objects are destroyed in LIFO order, and if the reactor - // is not yet created, it will be by ACE_CORBA_Handler's constructor, - // executed during ACE_NEW_RETURN, above. - ACE_Object_Manager::at_exit (ACE_ST_CORBA_Handler::instance_, - &ACE_ST_CORBA_Handler::instance_cleaner, - 0); - - ACE_ST_CORBA_Handler::instance_->get_orbix_descriptors (); - } - - return ACE_ST_CORBA_Handler::instance_; -} - -// Activate and register with the Orbix daemon. If -// and are != 0 then do a "putit" to -// register this service with orbixd. This method also increments the -// reference count of active services using the ACE_ST_CORBA_Handler. - -int -ACE_CORBA_Handler::activate_service (const char *service_name, - const char *marker_name, - const char *service_location) -{ - ACE_TRACE ("ACE_CORBA_Handler::activate_service"); - // Since the ACE_CORBA_Handler is a singleton, make sure not to - // allocate and initialize more than one copy. By incrementing the - // reference count we ensure this. - - this->reference_count_++; - - if (service_name != 0 && service_location != 0 - && this->register_service (service_name, marker_name, - service_location) == -1) - return -1; - - // Tell Orbix that we have completed the server's initialization. - // Note that we don't block by giving a timeout of 0... - - TRY { - ACE_CORBA_1 (Orbix.impl_is_ready) ((char *) service_name, 0, IT_X); - } CATCHANY { - return -1; - } ENDTRY - - return 0; -} - -#if defined (ACE_HAS_MT_ORBIX) && (ACE_HAS_MT_ORBIX != 0) - -ACE_ALLOC_HOOK_DEFINE(ACE_MT_CORBA_Handler) - -void -ACE_MT_CORBA_Handler::dump (void) const -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::dump"); - ACE_CORBA_Handler::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %x"), this->instance_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_mgr_ = %x"), this->thr_mgr_)); - this->pipe_.dump (); - ACE_MT (ACE_Thread_Mutex *lock = - ACE_Managed_Object::get_preallocated_object - (ACE_Object_Manager::ACE_MT_CORBA_HANDLER_LOCK); - if (lock != 0) lock->dump ()); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// Only one MT CORBA Handler per-process... -/* static */ -ACE_MT_CORBA_Handler *ACE_MT_CORBA_Handler::instance_ = 0; - -/* static */ -ACE_CORBA_Handler * -ACE_MT_CORBA_Handler::instance (void) -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::instance"); - - if (ACE_MT_CORBA_Handler::instance_ == 0) - { - ACE_MT (ACE_Thread_Mutex *lock = - ACE_Managed_Object::get_preallocated_object - (ACE_Object_Manager::ACE_MT_CORBA_HANDLER_LOCK); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, *lock, 0)); - - if (ACE_MT_CORBA_Handler::instance_ == 0) - ACE_NEW_RETURN (ACE_MT_CORBA_Handler::instance_, - ACE_MT_CORBA_Handler, 0); - } - - return ACE_MT_CORBA_Handler::instance_; -} - -int -ACE_MT_CORBA_Handler::suspend (void) -{ - // Suspend the event handler listening for new CORBA requests to - // dispatch. - this->reactor ()->suspend_handler (this->pipe_.read_handle ()); - - // Suspend the daemon thread. - this->thr_mgr ()->suspend_all (); - return 0; -} - -int -ACE_MT_CORBA_Handler::resume (void) -{ - // Resume the event handler listening for new CORBA requests to - // dispatch. - this->reactor ()->resume_handler (this->pipe_.read_handle ()); - - // Resume the daemon thread. - this->thr_mgr ()->resume_all (); - return 0; -} - -ACE_MT_CORBA_Handler::ACE_MT_CORBA_Handler (void) -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::ACE_MT_CORBA_Handler"); - this->thr_mgr (ACE_Thread_Manager::instance ()); - - int result = 0; - - if (this->pipe_.open () == -1) - result = -1; - // Register one end of the pipe with the reactor with a READ mask. - else if (this->reactor ()->register_handler - (this->pipe_.read_handle (), this, ACE_Event_Handler::READ_MASK) == -1) - result = -1; - // Create a new thread that processes events for the Orbix event - // queue. - else if (this->thr_mgr ()->spawn (ACE_THR_FUNC (ACE_MT_CORBA_Handler::process_events), - 0, THR_DETACHED | THR_NEW_LWP) == -1) - result = -1; - - if (result == -1) - { - delete ACE_MT_CORBA_Handler::instance_; - ACE_MT_CORBA_Handler::instance_ = 0; - } -} - -void * -ACE_MT_CORBA_Handler::process_events (void *) -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::process_events"); - - // Special knowlege, we "know" that we are dealing with a singleton - // and that we are invoked in a context where the mutex controlling - // instance creation is held, so by the time we get the mutex - // the instance must exist. - if (ACE_MT_CORBA_Handler::instance_ == 0) - { - ACE_MT (ACE_Thread_Mutex *lock = - ACE_Managed_Object::get_preallocated_object - (ACE_Object_Manager::ACE_MT_CORBA_HANDLER_LOCK); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, *lock, 0)); - - ACE_ASSERT (ACE_MT_CORBA_Handler::instance_ != 0); - } - - ACE_Thread_Control t (ACE_MT_CORBA_Handler::instance_->thr_mgr ()); - - // This thread only processes events. - TRY { - // it is OK to block - ACE_CORBA_1 (Orbix.processEvents) (ACE_CORBA_1 (Orbix.INFINITE_TIMEOUT), IT_X); - } CATCHANY { - // An error occured calling processEvents () - output the error. - cerr << IT_X << endl; - } ENDTRY; - - // Thread dies if we reach here : error occured in processEvents. - return 0; -} - -int -ACE_MT_CORBA_Handler::inRequestPreMarshal (ACE_CORBA_1 (Request) &req, - ACE_CORBA_1 (Environment) &IT_env) -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::inRequestPreMarshal"); - - // Pump the request through the pipe. - u_long request_addr = (u_long) &req; - - ssize_t result = ACE::send (this->pipe_.write_handle (), - (const char *) &request_addr, - sizeof request_addr); - - if (result != sizeof request_addr) - { - // Don't continue with request - return 0; - } - - // Everything is fine: we have delegated the work to a different - // thread Tell Orbix we will dispatch the request later... - return -1; -} - -int -ACE_MT_CORBA_Handler::handle_input (ACE_HANDLE) -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::handle_input"); - ACE_CORBA_1 (Request) *req = 0; - - u_long request_addr; - - // Read the request from the pipe. - ssize_t result = ACE::recv (this->pipe_.read_handle (), - (char *) &request_addr, - sizeof request_addr); - - if (result != sizeof request_addr) - // We are in trouble: bail out. - return -1; - - req = (ACE_CORBA_1 (Request) *) request_addr; - - // Tell Orbix to dispatch the request. - ACE_CORBA_1 (Orbix.continueThreadDispatch) (*req); - return 0; -} - -ACE_MT_CORBA_Handler::~ACE_MT_CORBA_Handler (void) -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::~ACE_MT_CORBA_Handler"); - - // Unregister one end of the pipe with the reactor - this->reactor ()->remove_handler - (this->pipe_.read_handle (), - ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL); - - this->pipe_.close (); - - ACE_MT_CORBA_Handler::instance_ = 0; -} -#endif /* ACE_HAS_MT_ORBIX */ -#endif /* ACE_HAS_ORBIX */ diff --git a/ace/CORBA_Handler.h b/ace/CORBA_Handler.h deleted file mode 100644 index 5efe99f729e..00000000000 --- a/ace/CORBA_Handler.h +++ /dev/null @@ -1,256 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CORBA_Handler.h -// -// = AUTHOR -// Douglas C. Schmidt (schmidt@cs.wustl.edu) and -// Irfan Pyarali (irfan@wuerl.wustl.edu). -// -// ============================================================================ - -#ifndef ACE_CORBA_HANDLER_H -#define ACE_CORBA_HANDLER_H -#include "ace/pre.h" - -#include "ace/Service_Config.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Pipe.h" - -#if (defined (ACE_HAS_ORBIX) && (ACE_HAS_ORBIX != 0)) || (defined (ACE_HAS_MT_ORBIX) && (ACE_HAS_MT_ORBIX != 0)) -#define EXCEPTIONS -#define WANT_ORBIX_FDS -#include /**/ -// #include /**/ -#undef EXCEPTIONS -#undef WANT_ORBIX_FDS - -class ACE_Export ACE_CORBA_Handler : public ACE_Service_Object -{ - // = TITLE - // Handle Orbix requests in conjunction with ACE. - // - // = DESCRIPTION - // Note, do *NOT* inherit from this class! Instead, use the - // and as - // Singletons. -public: - // = Activation and deactivation methods. - - virtual int activate_service (const char *service_name, - const char *marker_name = 0, - const char *service_location = 0); - // Activate and register with the Orbix daemon. If - // and are != 0 then do a "putit" - // to register this service with orbixd. This method also - // increments the reference count of active services using the - // ACE_ST_CORBA_Handler. - - virtual int deactivate_service (const char *service_name = 0, - const char *marker_name = 0); - // Decrement the reference count and free up all the - // resources if this is the last service to be using - // the ACE_ST_CORBA_Handler... - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - ACE_CORBA_Handler (void); - // Make this into an "abstract" class... - - virtual ~ACE_CORBA_Handler (void); - // Note virtual destructor... - - virtual int register_service (const char *service_name, - const char *marker_name, - const char *service_location); - // Register by doing a "putit" to register the - // using the at with - // orbixd. - - virtual int remove_service (const char *service_name, - const char *marker_name = 0); - // Register by doing a "putit" to register - // using the with orbixd. - - ssize_t reference_count_; - // Keep track of the number of active CORBA_Handlers. - -private: - // = Disallow assignment and initialization. - ACE_CORBA_Handler (const ACE_CORBA_Handler &rhs); - const ACE_CORBA_Handler &operator= (const ACE_CORBA_Handler &rhs); -}; - -class ACE_Export ACE_ST_CORBA_Handler : public ACE_CORBA_Handler -{ - // = TITLE - // Handle single-threaded Orbix requests in conjunction with the - // . - // - // = DESCRIPTION - // You should NOT use this class unless you've got a VERY old - // version of Orbix that only supports single-threading. If - // you're using a more recent version of Orbix use the - // . -public: - // = Singleton access point. - static ACE_CORBA_Handler *instance (void); - // Returns a Singleton. - - // = Demuxing hook. - virtual int handle_input (ACE_HANDLE); - // Process the next Orbix event. - - // = Dynamic linking hooks. - virtual int suspend (void); - // Atomically suspend all the threads associated with the . - - virtual int resume (void); - // Atomically resume all the threads associated with the . - - // = Iterations dictate # of calls per-callback. - size_t iterations (void); - // Get the current iteration. - - void iterations (size_t); - // Set the current iteration. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - void get_orbix_descriptors (void); - // Preinitialize any descriptors that Orbix is using. This is - // called in . - - ACE_ST_CORBA_Handler (void); - // Constructors (ensure Singleton...). - - virtual ~ACE_ST_CORBA_Handler (void); - // Destructor cleans up resources. - - static void insert_handle (ACE_HANDLE); - // Insert a descriptor into the ACE_Reactor that Orbix has just added. - - static void remove_handle (ACE_HANDLE); - // Remove a descriptor from the ACE_Reactor that Orbix has just deleted. - - static void instance_cleaner (void *object, void *param); - // Clean up the singleton at program rundown. - - static ACE_ST_CORBA_Handler *instance_; - // ACE_ST_CORBA_Handler is a singleton object. - - size_t iterations_; - // Number of iterations to process per call. - - // If the user has complete control of all Orbix callback processing and - // really, really knows how to handle all of the involved interworkings, - // they can set up to daisy-chain Orbix callbacks from this class to - // other handlers established outside the control of this class. This is - // an intrinsically dangerous thing to do, and is most often the wrong - // thing to do. But if you must, set ACE_TAKEOVER_ORBIX_CALLBACKS in the - // config.h file before including the platform's config file. -# if defined (ACE_TAKEOVER_ORBIX_CALLBACKS) - static int set_callbacks_; - static OrbixIOCallback previous_orbix_open_callback_; - static OrbixIOCallback previous_orbix_close_callback_; -# endif /* ACE_TAKEOVER_ORBIX_CALLBACKS */ -}; - -#if defined (ACE_HAS_MT_ORBIX) && (ACE_HAS_MT_ORBIX != 0) - -class ACE_Export ACE_MT_CORBA_Handler : public ACE_CORBA_Handler, public ACE_CORBA_1 (ThreadFilter) -{ - // = TITLE - // Handle multi-threaded Orbix requests in conjunction with the - // . - // - // = DESCRIPTION - // If you are using MT-Orbix (which has been the default Orbix - // for years) you should use this class rather than - // . See - // - // www.cs.wustl.edu/~schmidt/COOTS-96.ps.gz - // - // for an explanation of what this class does for Orbix. -public: - // = Singleton access point. - static ACE_CORBA_Handler *instance (void); - // Returns a Singleton. - - // = Demuxing hook. - virtual int handle_input (ACE_HANDLE); - // Process the next Orbix event. - - // = Threading hook. - void thr_mgr (ACE_Thread_Manager *tm); - // Set the Thread_Manager used by ACE_MT_CORBA_Handler - - ACE_Thread_Manager *thr_mgr (void) const; - // Get the Thread_Manager used by ACE_MT_CORBA_Handler - - // = Dynamic linking hooks. - virtual int suspend (void); - // Atomically suspend all the threads associated with the . - - virtual int resume (void); - // Atomically resume all the threads associated with the . - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - static void *process_events (void *); - // function executed by new thread - - ACE_MT_CORBA_Handler (void); - // Constructors (ensure Singleton...). - - virtual ~ACE_MT_CORBA_Handler (void); - // Destructor cleans up resources. - - virtual int inRequestPreMarshal (ACE_CORBA_1 (Request) &r, - ACE_CORBA_1 (Environment) &IT_env = ACE_CORBA_1 (default_environment)); - // Take the incoming request and pass it to through - // the Reactor. - - static ACE_MT_CORBA_Handler *instance_; - // ACE_MT_CORBA_Handler is a singleton object. - - ACE_Thread_Manager *thr_mgr_; - // Event demultiplexor used by ACE_ST_CORBA_Handler. - - ACE_Pipe pipe_; - // Used to send CORBA::Requests through the server -}; -#endif /* ACE_HAS_MT_ORBIX */ - -#if defined (__ACE_INLINE__) -#include "ace/CORBA_Handler.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_ORBIX */ -#include "ace/post.h" -#endif /* ACE_CORBA_HANDLER_H */ diff --git a/ace/CORBA_Handler.i b/ace/CORBA_Handler.i deleted file mode 100644 index a1f3bfbd774..00000000000 --- a/ace/CORBA_Handler.i +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// CORBA_Handler.i - -#if defined (ACE_HAS_ORBIX) && (ACE_HAS_ORBIX != 0) -// = Set/get the number of iterations per processNextEvent() call. - -/* static */ -ACE_INLINE size_t -ACE_ST_CORBA_Handler::iterations (void) -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::iterations"); - return this->iterations_; -} - -/* static */ -ACE_INLINE void -ACE_ST_CORBA_Handler::iterations (size_t i) -{ - ACE_TRACE ("ACE_ST_CORBA_Handler::iterations"); - this->iterations_ = i; -} - -#if defined (ACE_HAS_MT_ORBIX) && (ACE_HAS_MT_ORBIX != 0) -ACE_INLINE void -ACE_MT_CORBA_Handler::thr_mgr (ACE_Thread_Manager *tm) -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::thr_mgr"); - this->thr_mgr_ = tm; -} - -ACE_INLINE ACE_Thread_Manager * -ACE_MT_CORBA_Handler::thr_mgr (void) const -{ - ACE_TRACE ("ACE_MT_CORBA_Handler::thr_mgr"); - return this->thr_mgr_; -} -#endif /* ACE_HAS_MT_ORBIX */ -#endif /* ACE_HAS_ORBIX */ diff --git a/ace/CORBA_Ref.cpp b/ace/CORBA_Ref.cpp deleted file mode 100644 index 9c014d2c104..00000000000 --- a/ace/CORBA_Ref.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// CORBA_Ref.cpp -// $Id$ - -#if !defined (ACE_CORBA_REF_C) -#define ACE_CORBA_REF_C - -#include "ace/CORBA_Ref.h" -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -#include "ace/CORBA_Ref.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, CORBA_Ref, "$Id$") - -template -ACE_CORBA_Ref::ACE_CORBA_Ref (void) - : ref_ (0) -{ - ACE_TRACE ("ACE_CORBA_Ref::ACE_CORBA_Ref"); -} - -template -ACE_CORBA_Ref::ACE_CORBA_Ref (CORBA_REF *ref) -{ - ACE_TRACE ("ACE_CORBA_Ref::ACE_CORBA_Ref"); - if (ref != 0) - ref_ = ref->_duplicate (); - else - ref_ = 0; -} - -template CORBA_REF * -ACE_CORBA_Ref::operator= (CORBA_REF *ref) -{ - ACE_TRACE ("ACE_CORBA_Ref::operator="); - if (ref_ != 0) - ref_->_release (); - if (ref == 0) - { - ref_ = 0; - return 0; - } - else - return ref_ = ref->_duplicate (); -} - -template -ACE_CORBA_Ref::operator CORBA_REF * (void) const -{ - ACE_TRACE ("ACE_CORBA_Ref::operator CORBA_REF *"); - ACE_ASSERT (ref_ != 0); - return ref_; -} - -template CORBA_REF * -ACE_CORBA_Ref::operator-> (void) const -{ - ACE_TRACE ("ACE_CORBA_Ref::operator->"); - ACE_ASSERT (ref_ != 0); - return ref_; -} - -template int -ACE_CORBA_Ref::operator== (CORBA_REF *rhs) const -{ - ACE_TRACE ("ACE_CORBA_Ref::operator=="); - // pointer comparison. - return ref_ == rhs; -} - -template int -ACE_CORBA_Ref::operator!= (CORBA_REF *rhs) const -{ - ACE_TRACE ("ACE_CORBA_Ref::operator!="); - // pointer comparison. - return ref_ != rhs; -} - -template -ACE_CORBA_Ref::~ACE_CORBA_Ref () -{ - ACE_TRACE ("ACE_CORBA_Ref::~ACE_CORBA_Ref"); - if (ref_ != 0) - ref_->_release (); -} - -#endif /* ACE_CORBA_REF_C */ diff --git a/ace/CORBA_Ref.h b/ace/CORBA_Ref.h deleted file mode 100644 index 0c6b9e89307..00000000000 --- a/ace/CORBA_Ref.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CORBA_Ref.h -// -// = AUTHOR -// Irfan Pyarali (irfan@wuerl.wustl.edu). -// Tim Harrison (harrison@cs.wustl.edu) -// -// = DESCRIPTION -// A wrapper for helping with Orbix object references. -// -// ============================================================================ - -#ifndef ACE_CORBA_REF_H -#define ACE_CORBA_REF_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -template -class ACE_CORBA_Ref -{ - // = TITLE - // A wrapper for helping with Orbix object references. - // - // = DESCRIPTION - // is parameterized by the type of orbix object - // reference to be used. The construtor, operator=, and the - // destructor of perform implicit duplicates and - // releases in order to help make the use of Orbix object - // references transparent. -public: - ACE_CORBA_Ref (void); - // Null construction. - - ACE_CORBA_Ref (CORBA_REF *ref); - // Contruction with an orbix ref. - // performs a . - - CORBA_REF *operator= (CORBA_REF *ref); - // Assignment performs a . - - operator CORBA_REF *(void) const; - // Type operator - - CORBA_REF *operator-> (void) const; - // Smart pointer to forward all CORBA_REF calls to the underlying - // Orbix reference. - - int operator== (CORBA_REF *) const; - // Pointer comparison. - - int operator!= (CORBA_REF *) const; - // Pointer comparison. - - ~ACE_CORBA_Ref (void); - // Destruction: calls . - -private: - CORBA_REF *ref_; -}; - -#if defined (__ACE_INLINE__) -#include "ace/CORBA_Ref.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/CORBA_Ref.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("CORBA_Ref.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* CORBA_REF_H */ diff --git a/ace/CORBA_Ref.i b/ace/CORBA_Ref.i deleted file mode 100644 index 3002ddac574..00000000000 --- a/ace/CORBA_Ref.i +++ /dev/null @@ -1,4 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// CORBA_Ref.i diff --git a/ace/CORBA_macros.h b/ace/CORBA_macros.h deleted file mode 100644 index c06df17bd53..00000000000 --- a/ace/CORBA_macros.h +++ /dev/null @@ -1,413 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// CORBA_macros.h -// -// = DESCRIPTION -// Writing code that is portable between platforms with or without -// native C++ exceptions is hard. The following macros offer some -// help on this task, mostly oriented to making the ORB code and the -// IDL generated code portable. -// -// = AUTHOR -// Nanbor Wang -// Based on the original implementation by -// Aniruddha Gokhale -// Carlos O'Ryan , et al. -// ============================================================================ - -// Macros for handling CORBA exceptions. - -#ifndef ACE_CORBA_MACROS_H -#define ACE_CORBA_MACROS_H -#include "ace/pre.h" - -# if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -# endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS.h" - -// All these macros assume the CORBA::Environment variable used to pass -// in/out the exception is call ACE_TRY_ENV. Below is the name we use -// in TAO (The ACE ORB.) Most other ORB's have their own naming -// convention. You can redefine ACE_TRY_ENV to change the default name -// ACE_ADOPT_CORBA_ENV allows the use of non-standard name within a -// scope. -#if !defined (ACE_TRY_ENV) -# define ACE_TRY_ENV _ACE_CORBA_Environment_variable -#endif /* ACE_TRY_ENV */ - -// This is the exception caught by ACE_CATCHANY. -#if !defined (ACE_ANY_EXCEPTION) -# define ACE_ANY_EXCEPTION ex -#endif /* ACE_ANY_EXCEPTION */ - -// By default, if the compiler support native exception handling, assume -// CORBA also support native exception handling. But it can be disabled -// by defining ACE_CORBA_HAS_EXCEPTIONS=0. -// If the compiler does not support exceptions handling, make sure native -// exception handling is disabled. -#if defined (ACE_HAS_EXCEPTIONS) -# if defined (ACE_CORBA_HAS_EXCEPTIONS) -# if (ACE_CORBA_HAS_EXCEPTIONS == 0) -# undef ACE_CORBA_HAS_EXCEPTIONS -# endif /* ACE_CORBA_HAS_EXCEPTIONS == 0 */ -# else /* !ACE_CORBA_HAS_EXCEPTIONS */ -# define ACE_CORBA_HAS_EXCEPTIONS -# endif /* ACE_CORBA_HAS_EXCEPTIONS */ -#else -# if defined (ACE_CORBA_HAS_EXCEPTIONS) -# undef ACE_CORBA_HAS_EXCEPTIONS -# endif /* ACE_CORBA_HAS_EXCEPTIONS */ -#endif /* ACE_HAS_EXCEPTIONS */ - -#define ACE_DECLARE_NEW_CORBA_ENV \ - CORBA::Environment ACE_TRY_ENV - -#if defined (ACE_CORBA_HAS_EXCEPTIONS) -// ----------------------------------------------------------------- -# define ACE_ADOPT_CORBA_ENV(ENV) ACE_UNUSED_ARG(ENV) - -// No need to check. Native exceptions handle the control -// flow automatically when an exception occurs. -# define ACE_CHECK -// Used then the function requires a return value. -# define ACE_CHECK_RETURN(RETV) - -// ACE_THROW_INT should not be used by the user. -# define ACE_THROW_INT(EXCEPTION) \ - do { \ - ACE_UNUSED_ARG(ACE_TRY_ENV); \ - throw EXCEPTION; \ - } while (0) - -// Throwing an exception is easy. These two macros should _NOT_ be -// used within try blocks. -# define ACE_THROW(EXCEPTION) \ - do { \ - ACE_UNUSED_ARG(ACE_TRY_ENV); \ - throw EXCEPTION; \ - } while (0) - -// Throwing an exception when the function reqires a return value. -# if defined (WIN32) || defined (__HP_aCC) -# define ACE_THROW_RETURN(EXCEPTION, RETV) \ - do \ - { \ - ACE_UNUSED_ARG(ACE_TRY_ENV); \ - throw EXCEPTION; \ - return RETV; \ - } while (0) -# else /* WIN32 */ -# define ACE_THROW_RETURN(EXCEPTION,RETV) \ - do { \ - ACE_UNUSED_ARG(ACE_TRY_ENV); \ - throw EXCEPTION; \ - } while (0) -# endif /* WIN32 */ - -// For compilers with native exceptions, we can simply use -// try to try. ;-) do {} while (0) is required to avoid -// compilation warnings. -# define ACE_TRY \ - do \ - { \ - try \ - { -# define ACE_TRY_NEW_ENV \ - do \ - { \ - CORBA::Environment ACE_TRY_ENV; \ - try \ - { -# define ACE_TRY_EX(LABEL) \ - do \ - { \ - try \ - { - -// No need to check for exceptions within try block for compilers with -// native exceptions. -# define ACE_TRY_CHECK -# define ACE_TRY_CHECK_EX(LABEL) - -// Likewise, throwing exceptions within try blocks is easy. -# define ACE_TRY_THROW(EXCEPTION) throw EXCEPTION -# define ACE_TRY_THROW_EX(EXCEPTION,LABEL) throw EXCEPTION - -// Same thing for catch. -# define ACE_CATCH(EXCEPTION,VAR) \ - } \ - catch (EXCEPTION & VAR) \ - { \ - ACE_UNUSED_ARG (VAR); -# define ACE_CATCHANY \ - ACE_CATCH(CORBA::Exception, ACE_ANY_EXCEPTION) -# define ACE_CATCHALL \ - } \ - catch (...) \ - { - -// Rethrowing the exception from catch blocks. -# define ACE_RETHROW throw - -// Close the catch block. -# define ACE_ENDTRY \ - } \ - } while (0) - -#else /* ! ACE_CORBA_HAS_EXCEPTIONS */ -// ----------------------------------------------------------------- -// To handle compilers without native exceptions, things get a bit -// hairy. Exceptions are simulated using CORBA::Environment. -// The trick here is to make sure the flow-of-control can simulate -// the case when native exceptions occur... - -# define ACE_ADOPT_CORBA_ENV(ENV) CORBA::Environment &ACE_TRY_ENV = ENV - -// Follow every statement that could throw exceptions with ACE_CHECK -// or ACE_CHECK_ENV. These two macros should _NOT_ be used within -// try blocks. Use ACE_TRY_CHECK or ACE_TRY_CHECK_EX instead. -# define ACE_CHECK \ - if (ACE_TRY_ENV . exception () != 0) \ - return -// When function requires a return value -# define ACE_CHECK_RETURN(RETV) \ - if (ACE_TRY_ENV . exception () != 0) \ - return RETV - -// ACE_THROW_INT should not be used by the user. -# define ACE_THROW_INT(EXCEPTION) ACE_TRY_ENV.exception (new EXCEPTION) - -// Throwing exceptions will inevitably cause an return from the current -// function. These two macros should _NOT_ be used within try blocks. -// Use ACE_TRY_THROW or ACE_TRY_THROW_EX instead. -# define ACE_THROW(EXCEPTION) \ - do \ - { \ - ACE_TRY_ENV.exception (new EXCEPTION); \ - return; \ - } while (0) - -# define ACE_THROW_RETURN(EXCEPTION,RETV) \ - do \ - { \ - ACE_TRY_ENV.exception (new EXCEPTION); \ - return RETV; \ - } while (0) - -// ACE_TRY sets up flags to control program flow. ACE_TRY_FLAG acts -// like a one-shot flip-flop. When an exception occured (detect it -// using ACE_TRY_CHECK,) ACE_TRY_FLAG will be reset and the control -// goes back into ACE_TRY_LABEL. Since ACE_TRY_FLAG is reset, the try -// block won't get executed again and the control proceeds to the following -// catch blocks. ACE_EXECTION_NOT_CAUGHT flag is used to prevent -// catching an exception twice. This macro assumes there's already an -// CORBA:;Environment variable ACE_TRY_ENV defined (which, should be -// the most usual case.) -# define ACE_TRY \ - do { \ - int ACE_TRY_FLAG = 1; \ - int ACE_EXCEPTION_NOT_CAUGHT = 1; \ - ACE_TRY_LABEL: \ - if (ACE_TRY_FLAG) \ - do { - -// ACE_TRY_NEW_ENV functions like the macro ACE_TRY but defines a -// new CORBA::Environment variable ACE_TRY_ENV. It is most often -// used in the outer most function where no ACE_TRY_ENV is available. -# define ACE_TRY_NEW_ENV \ - do { \ - CORBA::Environment ACE_TRY_ENV;\ - int ACE_TRY_FLAG = 1; \ - int ACE_EXCEPTION_NOT_CAUGHT = 1; \ - ACE_TRY_LABEL: \ - if (ACE_TRY_FLAG) \ - do { - -// ACE_TRY_EX works exactly like ACE_TRY macro except the lable used -// in the try block is customizable to avoid name clashing. It should -// be used when, nested try blocks or, multiple try blocks are required -// in the same function. -# define ACE_TRY_EX(LABEL) \ - do { \ - int ACE_TRY_FLAG = 1; \ - int ACE_EXCEPTION_NOT_CAUGHT = 1; \ - ACE_TRY_LABEL ## LABEL: \ - if (ACE_TRY_FLAG) \ - do { - -// Check for exceptions within try blocks. -# define ACE_TRY_CHECK \ - { \ - if (ACE_TRY_ENV.exception () != 0) \ - { \ - ACE_TRY_FLAG = 0; \ - goto ACE_TRY_LABEL; \ - } \ - } - -// Checking exception within EX try blocks. -# define ACE_TRY_CHECK_EX(LABEL) \ - { \ - if (ACE_TRY_ENV.exception () != 0) \ - { \ - ACE_TRY_FLAG = 0; \ - goto ACE_TRY_LABEL ## LABEL; \ - } \ - } - -// Throwing exception within TRY blocks. -# define ACE_TRY_THROW(EXCEPTION) \ - { \ - ACE_TRY_ENV.exception (new EXCEPTION); \ - ACE_TRY_FLAG = 0; \ - goto ACE_TRY_LABEL; \ - } - -# define ACE_TRY_THROW_EX(EXCEPTION,LABEL) \ - { \ - ACE_TRY_ENV.exception (new EXCEPTION); \ - ACE_TRY_FLAG = 0; \ - goto ACE_TRY_LABEL ## LABEL; \ - } - -// When exceptions occur or try block finishes execution without -// exception, control will continue in the catch block. This macro -// first check if there's non-caught exception we are waiting for -// left. It all the conditions met, we have caught an exception. -// It then reset the ACE_EXCEPTION_NOT_CAUGHT to prevent subsequent -// catch blocks catch the same exception again and extract out the -// underlying exception in the ACE_TRY_ENV. We also make a copy -// of ACE_TRY_ENV in ACE_CAUGHT_ENV in case we want to rethrow the -// exception. ACE_TRY_ENV is cleared out after the exception is -// caught so you should not use ACE_TRY_ENV within the catch block. -// (In fact, you should use the exception directly.) -# define ACE_CATCH(TYPE,VAR) \ - } while (0); \ - do \ - if (ACE_TRY_ENV.exception () != 0 && ACE_EXCEPTION_NOT_CAUGHT && \ - TYPE::_narrow(ACE_TRY_ENV.exception ()) != 0) \ - { \ - CORBA::Environment ACE_CAUGHT_ENV = ACE_TRY_ENV;\ - ACE_EXCEPTION_NOT_CAUGHT = 0; \ - TYPE &VAR = *TYPE::_narrow (ACE_CAUGHT_ENV.exception ()); \ - ACE_UNUSED_ARG (VAR); \ - ACE_TRY_ENV.clear (); - -// ACE_CATCHANY uses ACE_CATCH to catch all CORBA exceptions. -# define ACE_CATCHANY ACE_CATCH (CORBA::Exception, ACE_ANY_EXCEPTION) - -// Since there's no other exception for compilers without exception -// support, we simply catch all CORBA exceptions for ACE_CATCHALL. -# define ACE_CATCHALL ACE_CATCHANY - -// Rethrowing exception within catch blocks. Notice that we depends -// on the ACE_CHECK/ACE_CHECK_RETURN following the ACE_ENDTRY to -// do the "Right Thing[TM]." -# define ACE_RETHROW \ - do \ - ACE_TRY_ENV = ACE_CAUGHT_ENV; \ - while (0) - -// Close the try block. Notice that since exception may not get -// caught, and exceptions can also be rethrown from the catch block, -// it's always a good idea to follow ACE_ENDTRY with ACE_CHECK or -// ACE_TRY_CHECK (depending on the context.) -# define ACE_ENDTRY \ - } while (0); \ - } while (0) - -#endif /* ! ACE_CORBA_HAS_EXCEPTIONS */ - -// ACE_HAS_EXCEPTIONS is not the same as ACE_NEW_THROWS_EXCEPTIONS. -#if defined(ACE_NEW_THROWS_EXCEPTIONS) - -# define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { errno = ENOMEM; ACE_THROW_INT (EXCEPTION); } \ - } while (0) -// The following ACE_NEW_THROW* macros are to be deprecated soon. -// -------------------- Start Deprecated -------------------- -# define ACE_NEW_THROW(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { errno = ENOMEM; TAO_THROW (EXCEPTION); } \ - } while (0) -# define ACE_NEW_THROW_RETURN(POINTER,CONSTRUCTOR,EXCEPTION,RET_VAL) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { errno = ENOMEM; TAO_THROW_RETURN (EXCEPTION,RET_VAL); } \ - } while (0) -# define ACE_NEW_TRY_THROW(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { errno = ENOMEM; TAO_TRY_THROW (EXCEPTION); } \ - } while (0) -// -------------------- End Deprecated -------------------- - -#else - -# define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { POINTER = new CONSTRUCTOR; \ - if (POINTER == 0) { errno = ENOMEM; ACE_THROW_INT (EXCEPTION); } \ - } while (0) -// The following ACE_NEW_THROW* macros are to be deprecated soon. -// -------------------- Start Deprecated -------------------- -# define ACE_NEW_THROW(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { POINTER = new CONSTRUCTOR; \ - if (POINTER == 0) { errno = ENOMEM; TAO_THROW (EXCEPTION); } \ - } while (0) -# define ACE_NEW_THROW_RETURN(POINTER,CONSTRUCTOR,EXCEPTION,RET_VAL) \ - do { POINTER = new CONSTRUCTOR; \ - if (POINTER == 0)\ - { errno = ENOMEM; TAO_THROW_RETURN (EXCEPTION,RET_VAL); } \ - } while (0) -# define ACE_NEW_TRY_THROW(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { POINTER = new CONSTRUCTOR; \ - if (POINTER == 0) { errno = ENOMEM; TAO_TRY_THROW (EXCEPTION); } \ - } while (0) -// -------------------- End Deprecated -------------------- - -#endif /* ACE_NEW_THROWS_EXCEPTIONS */ - -# define ACE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION); - -# define ACE_READ_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Read_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION); - -# define ACE_WRITE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Write_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION); - -// The following ACE_GUARD_THROW* macros are to be deprecated soon. -// -------------------- Start Deprecated -------------------- -# define ACE_GUARD_THROW(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) TAO_THROW (EXCEPTION); -# define ACE_GUARD_THROW_RETURN(MUTEX,OBJ,LOCK,EXCEPTION,RETURN) \ - ACE_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) TAO_THROW_RETURN (EXCEPTION, RETURN); -// -------------------- End Deprecation -------------------- - -// ============================================================ - -// Print out a TAO exception. This is not CORBA compliant. -# define ACE_PRINT_TAO_EXCEPTION(EX,INFO) \ - EX._tao_print_exception (INFO) - -// Print out a CORBA exception. There is not portable way to -// dump a CORBA exception. If you are using other ORB implementation, -// redefine the macro to get what you want. -# if !defined ACE_PRINT_EXCEPTION -# define ACE_PRINT_EXCEPTION(EX,INFO) ACE_PRINT_TAO_EXCEPTION(EX,INFO) -# endif /* ACE_PRINT_EXCEPTION */ - -#include "ace/post.h" -#endif /* ACE_CORBA_MACROS_H */ diff --git a/ace/Cache_Map_Manager_T.cpp b/ace/Cache_Map_Manager_T.cpp deleted file mode 100644 index b8779796b4e..00000000000 --- a/ace/Cache_Map_Manager_T.cpp +++ /dev/null @@ -1,420 +0,0 @@ -// $Id$ - -#ifndef ACE_CACHE_MAP_MANAGER_T_C -#define ACE_CACHE_MAP_MANAGER_T_C - -#include "ace/Cache_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Malloc.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Cache_Map_Manager_T.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Cache_Map_Manager_T, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Manager) - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Iterator) - -ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Reverse_Iterator) - -#define ACE_T1 class KEY, class VALUE, class MAP, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, MAP, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES - -#else - -#define ACE_T1 class KEY, class VALUE, class MAP, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, MAP, CACHING_STRATEGY, ATTRIBUTES - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -template -ACE_Cache_Map_Manager::ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_s, - size_t size, - ACE_Allocator *alloc) - : caching_strategy_ (caching_s) -{ - if (this->open (size, alloc) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Cache_Map_Manager::ACE_Cache_Map_Manager"))); - -} - -template -ACE_Cache_Map_Manager::~ACE_Cache_Map_Manager (void) -{ - this->close (); -} - -template int -ACE_Cache_Map_Manager::open (size_t length, - ACE_Allocator *alloc) -{ - return this->map_.open (length, - alloc); -} - -template int -ACE_Cache_Map_Manager::close (void) -{ - return this->map_.close (); -} - -template int -ACE_Cache_Map_Manager::bind (const KEY &key, - const VALUE &value) -{ - // Insert an entry which has the and the which - // is the combination of the and the attributes of the - // caching strategy. - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int bind_result = this->map_.bind (key, - cache_value); - - if (bind_result != -1) - { - - int result = this->caching_strategy_.notify_bind (bind_result, - cache_value.second ()); - - if (result == -1) - { - - this->map_.unbind (key); - - // Unless the notification goes thru the bind operation is - // not complete. - bind_result = -1; - - } - - } - - return bind_result; -} - - -template int -ACE_Cache_Map_Manager::rebind (const KEY &key, - const VALUE &value) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int rebind_result = this->map_.rebind (key, - cache_value); - - if (rebind_result != -1) - { - - int result = this->caching_strategy_.notify_rebind (rebind_result, - cache_value.second ()); - - if (result == -1) - { - - // Make sure the unbind operation is done only when the - // notification fails after a bind which is denoted by - // rebind_result = 0 - if (rebind_result == 0) - this->map_.unbind (key); - - // Unless the notification goes thru the rebind operation is - // not complete. - rebind_result = -1; - - } - - } - - return rebind_result; -} - - -template int -ACE_Cache_Map_Manager::rebind (const KEY &key, - const VALUE &value, - VALUE &old_value) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - CACHE_VALUE old_cache_value (old_value, - this->caching_strategy_.attributes ()); - - int rebind_result = this->map_.rebind (key, - cache_value, - old_cache_value); - - if (rebind_result != -1) - { - - int result = this->caching_strategy_.notify_rebind (rebind_result, - cache_value.second ()); - - if (result == -1) - { - - // Make sure the unbind operation is done only when the - // notification fails after a bind which is denoted by - // rebind_result = 0 - if (rebind_result == 0) - this->map_.unbind (key); - - // Unless the notification goes thru the rebind operation is - // not complete. - rebind_result = -1; - - } - else - { - - old_value = old_cache_value.first (); - - } - - } - - return rebind_result; -} - -template int -ACE_Cache_Map_Manager::rebind (const KEY &key, - const VALUE &value, - KEY &old_key, - VALUE &old_value) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - CACHE_VALUE old_cache_value (old_value, - this->caching_strategy_.attributes ()); - - int rebind_result = this->map_.rebind (key, - cache_value, - old_key, - old_cache_value); - - if (rebind_result != -1) - { - - int result = this->caching_strategy_.notify_rebind (rebind_result, - cache_value.second ()); - - if (result == -1) - { - - // Make sure the unbind operation is done only when the - // notification fails after a bind which is denoted by - // rebind_result = 0 - if (rebind_result == 0) - this->map_.unbind (key); - - // Unless the notification goes thru the rebind operation is - // not complete. - rebind_result = -1; - - } - else - { - - old_value = old_cache_value.first (); - - } - - } - - return rebind_result; -} - -template int -ACE_Cache_Map_Manager::trybind (const KEY &key, - VALUE &value) -{ - CACHE_VALUE cache_value (value, - this->caching_strategy_.attributes ()); - - int trybind_result = this->map_.trybind (key, - cache_value); - - if (trybind_result != -1) - { - - int result = this->caching_strategy_.notify_trybind (trybind_result, - cache_value.second ()); - - if (result == -1) - { - - // If the entry has got inserted into the map, it is removed - // due to failure. - if (trybind_result == 0) - this->map_.unbind (key); - - trybind_result = -1; - - } - else - { - - // If an attempt is made to bind an existing entry the value - // is overwritten with the value from the map. - if (trybind_result == 1) - value = cache_value.first (); - - } - - } - - return trybind_result; -} - -template int -ACE_Cache_Map_Manager::find (const KEY &key, - VALUE &value) -{ - // Lookup the key and populate the . - CACHE_VALUE cache_value; - - int find_result = this->map_.find (key, - cache_value); - - if (find_result != -1) - { - - int result = this->caching_strategy_.notify_find (find_result, - cache_value.second ()); - - // Unless the find and notification operations go thru, this - // method is not successful. - if (result == -1) - find_result = -1; - else - { - - // Since the has now changed after the - // notification, we need to bind to the map again. - int rebind_result = this->map_.rebind (key, - cache_value); - if (rebind_result == -1) - find_result = -1; - else - value = cache_value.first (); - - } - - } - - return find_result; -} - -template int -ACE_Cache_Map_Manager::find (const KEY &key) -{ - // Lookup the key and populate the . - CACHE_VALUE cache_value; - - int find_result = this->map_.find (key, - cache_value); - - if (find_result != -1) - { - - int result = this->caching_strategy_.notify_find (find_result, - cache_value.second ()); - - // Unless the find and notification operations go thru, this - // method is not successful. - if (result == -1) - find_result = -1; - else - { - - // Since the has now changed after the - // notification, we need to bind to the map again. - int rebind_result = this->map_.rebind (key, - cache_value); - - if (rebind_result == -1) - find_result = -1; - - } - - } - - return find_result; -} - - -template int -ACE_Cache_Map_Manager::unbind (const KEY &key) -{ - // Remove the entry from the cache. - CACHE_VALUE cache_value; - - int unbind_result = this->map_.unbind (key, - cache_value); - - if (unbind_result != -1) - { - - int result = this->caching_strategy_.notify_unbind (unbind_result, - cache_value.second ()); - - if (result == -1) - unbind_result = -1; - - } - - return unbind_result; -} - -template int -ACE_Cache_Map_Manager::unbind (const KEY &key, - VALUE &value) -{ - // Remove the entry from the cache. - CACHE_VALUE cache_value; - - int unbind_result = this->map_.unbind (key, - cache_value); - - if (unbind_result != -1) - { - - int result = this->caching_strategy_.notify_unbind (unbind_result, - cache_value.second ()); - - if (result == -1) - unbind_result = -1; - else - value = cache_value.first (); - - } - - return unbind_result; -} - - -template void -ACE_Cache_Map_Manager::dump (void) const -{ - this->map_.dump (); - - this->caching_strategy_.dump (); -} - -#undef ACE_T1 -#undef ACE_T2 - -#endif /* ACE_CACHE_MAP_MANAGER_T_C */ diff --git a/ace/Cache_Map_Manager_T.h b/ace/Cache_Map_Manager_T.h deleted file mode 100644 index 30d957b91ac..00000000000 --- a/ace/Cache_Map_Manager_T.h +++ /dev/null @@ -1,399 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Cache_Map_Manager.h -// -// = AUTHOR -// Kirthika Parameswaran -// -// ============================================================================ - -#ifndef CACHE_MAP_MANAGER_T_H -#define CACHE_MAP_MANAGER_T_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Pair_T.h" - -// Forward declaration. -class ACE_Allocator; - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -#define ACE_Cache_Map_Iterator ACMI -#define ACE_Cache_Map_Reverse_Iterator ACMRI - -template -class ACE_Cache_Map_Iterator; - -template -class ACE_Cache_Map_Reverse_Iterator; - -#define ACE_T1 class KEY, class VALUE, class MAP, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, MAP, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES - -#else - -#define ACE_T1 class KEY, class VALUE, class MAP, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, MAP, CACHING_STRATEGY, ATTRIBUTES - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -// For linkers that cant grok long names. -#define ACE_Cache_Map_Manager ACMM - -template -class ACE_Cache_Map_Manager -{ - // = TITLE - // Defines a abstraction that will purge entries from a map. - // - // = DESCRIPTION - // The will manage the map it contains - // and provide purging on demand from the map. The strategy for - // caching is decided by the user and provided to the Cache - // Manager. The Cache Manager acts as a agent and communicates - // between the Map and the Strategy for purging entries from the - // map. - // - // No locking mechanism provided since locking at this level - // isn't efficient. Locking has to be provided by the - // application. -public: - - // = Traits. - typedef KEY key_type; - typedef VALUE mapped_type; - typedef MAP map_type; - typedef CACHING_STRATEGY caching_strategy_type; - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - - typedef ITERATOR_IMPL ITERATOR_IMPLEMENTATION; - typedef REVERSE_ITERATOR_IMPL REVERSE_ITERATOR_IMPLEMENTATION; - - friend class ACE_Cache_Map_Iterator; - friend class ACE_Cache_Map_Reverse_Iterator; - - // = ACE-style iterator typedefs. - typedef ACE_Cache_Map_Iterator - ITERATOR; - typedef ACE_Cache_Map_Reverse_Iterator - REVERSE_ITERATOR; - - // = STL-style iterator typedefs. - typedef ITERATOR - iterator; - typedef REVERSE_ITERATOR - reverse_iterator; - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - - typedef ACE_Pair CACHE_VALUE; - // The actual value mapped to the key in the map. The - // are used by the strategy and is transparent to the user of this - // class. - - // = Initialization and termination methods. - - ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_strategy, - size_t size = ACE_DEFAULT_MAP_SIZE, - ACE_Allocator *alloc = 0); - // Initialize a with and - // entries. - - virtual ~ACE_Cache_Map_Manager (void); - // Close down a and release dynamically allocated - // resources. - - int open (size_t length = ACE_DEFAULT_MAP_SIZE, - ACE_Allocator *alloc = 0); - // Initialize a cache with size . - - int close (void); - // Close down a cache and release dynamically allocated resources. - - int bind (const KEY &key, - const VALUE &value); - // Associate with . If is already in the MAP - // then the ENTRY is not changed. Returns 0 if a new entry is bound - // successfully, returns 1 if an attempt is made to bind an existing - // entry, and returns -1 if failures occur. - - int find (const KEY &key, - VALUE &value); - // Loopkup entry in the cache. - - int find (const KEY &key); - // Is in the cache? - - int rebind (const KEY &key, - const VALUE &value); - // Reassociate the with . If the already exists - // in the cache then returns 1, on a new bind returns 0 and returns - // -1 in case of any failures. - - int rebind (const KEY &key, - const VALUE &value, - VALUE &old_value); - // Reassociate with , storing the old value into the - // "out" parameter . The function fails if is not - // in the cache for caches that do not allow user specified keys. - // However, for caches that allow user specified keys, if the key is - // not in the cache, a new / association is created. - - int rebind (const KEY &key, - const VALUE &value, - KEY &old_key, - VALUE &old_value); - // Reassociate with , storing the old key and value - // into the "out" parameters and . The - // function fails if is not in the cache for caches that do - // not allow user specified keys. However, for caches that allow - // user specified keys, if the key is not in the cache, a new - // / association is created. - - int trybind (const KEY &key, - VALUE &value); - // Associate with if and only if is not in the - // cache. If is already in the cache, then the - // parameter is overwritten with the existing value in the - // cache. Returns 0 if a new / association is created. - // Returns 1 if an attempt is made to bind an existing entry. This - // function fails for maps that do not allow user specified keys. - - int unbind (const KEY &key); - // Remove from the cache. - - int unbind (const KEY &key, - VALUE &value); - // Remove from the cache, and return the associated with - // . - - int purge (void); - // Remove entries from the cache depending upon the strategy. - - size_t current_size (void) const; - // Return the current size of the cache. - - size_t total_size (void) const; - // Return the total size of the cache. - - void dump (void) const; - // Dumps the state of the object. - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - - // = STL styled iterator factory functions. - - ITERATOR begin (void); - ITERATOR end (void); - // Return forward iterator. - - REVERSE_ITERATOR rbegin (void); - REVERSE_ITERATOR rend (void); - // Return reverse iterator. - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - - MAP &map (void); - // The map managed by the Cache_Map_Manager. - - CACHING_STRATEGY &caching_strategy (void); - // The caching strategy used on the cache. - -protected: - - MAP map_; - // The underlying map which needs to be cached. - - CACHING_STRATEGY &caching_strategy_; - // The strategy to be followed for caching entries in the map. - -private: - - // = Disallow these operations. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Cache_Map_Manager &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Cache_Map_Manager (const ACE_Cache_Map_Manager &)) - -}; - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -template -class ACE_Cache_Map_Iterator -{ - // = TITLE - // Defines a iterator for the Cache_Map_Manager. - // - // = DESCRIPTION - // Implementation to be provided by the iterator of the map - // managed by the ACE_Cache_Map_Manager. - -public: - - // = Traits. - typedef ACE_Reference_Pair - value_type; - typedef ACE_Pair - CACHE_VALUE; - // The actual value mapped to the key in the cache. The - // are used by the strategy and is transperant to the cache user. - - // = Initialisation and termination methods. - - ACE_Cache_Map_Iterator (const IMPLEMENTATION &iterator_impl); - - ACE_Cache_Map_Iterator (const ACE_Cache_Map_Iterator &rhs); - // Copy constructor. - - virtual ~ACE_Cache_Map_Iterator (void); - - // = Iteration methods. - - ACE_Cache_Map_Iterator &operator= - (const ACE_Cache_Map_Iterator &rhs); - // assignment operator. - - int operator== (const ACE_Cache_Map_Iterator &rhs) const; - int operator!= (const ACE_Cache_Map_Iterator &rhs) const; - // Comparision operators. - - ACE_Reference_Pair operator* (void) const; - // Returns a reference to the internal element is pointing - // to. - - // = STL styled iteration, compare, and reference functions. - - ACE_Cache_Map_Iterator &operator++ (void); - // Prefix advance - - ACE_Cache_Map_Iterator operator++ (int); - // Postfix advance. - - ACE_Cache_Map_Iterator &operator-- (void); - // Prefix reverse. - - ACE_Cache_Map_Iterator operator-- (int); - // Postfix reverse. - - IMPLEMENTATION &iterator_implementation (void); - // Returns the iterator of the internal map in the custody of the - // Cache_Map_Manager. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - IMPLEMENTATION iterator_implementation_; - // The actual iterator which iterates internally on the map - // belonging to the Cache_Map_Manager. -}; - -template -class ACE_Cache_Map_Reverse_Iterator -{ - // = TITLE - // Defines a reverse iterator for the Cache_Map_Manager. - // - // = DESCRIPTION - // Implementation to be provided by the reverse iterator of the map - // managed by thr Cache_Map_manager. -public: - - // = Traits. - typedef ACE_Reference_Pair value_type; - typedef ACE_Pair CACHE_VALUE; - // The actual value mapped to the key in the cache. The - // are used by the strategy and is transperant to the cache user. - - // = Initialisation and termination methods. - - ACE_Cache_Map_Reverse_Iterator (const REVERSE_IMPLEMENTATION &iterator_impl); - - ACE_Cache_Map_Reverse_Iterator (const ACE_Cache_Map_Reverse_Iterator &rhs); - // Copy constructor. - - ~ACE_Cache_Map_Reverse_Iterator (void); - - // = Iteration methods. - - ACE_Cache_Map_Reverse_Iterator &operator= - (const ACE_Cache_Map_Reverse_Iterator &rhs); - // Assignment operator. - - int operator== (const ACE_Cache_Map_Reverse_Iterator &rhs) const; - int operator!= (const ACE_Cache_Map_Reverse_Iterator &rhs) const; - // Comparision operators. - - ACE_Reference_Pair operator* (void) const; - // Returns a reference to the internal element is pointing - // to. - - // = STL styled iteration, compare, and reference functions. - - ACE_Cache_Map_Reverse_Iterator &operator++ (void); - // Prefix advance - - ACE_Cache_Map_Reverse_Iterator operator++ (int); - // Postfix advance. - - ACE_Cache_Map_Reverse_Iterator &operator-- (void); - // Prefix reverse. - - ACE_Cache_Map_Reverse_Iterator operator-- (int); - // Postfix reverse. - - REVERSE_IMPLEMENTATION &iterator_implementation (void); - // Returns the iterator of the internal map in the custody of the - // Cache_Map_Manager. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - REVERSE_IMPLEMENTATION reverse_iterator_implementation_; - // The actual iterator which iterates internally on the map - // belonging to the Cache_Map_Manager. -}; - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -#undef ACE_T1 -#undef ACE_T2 - -#if defined (__ACE_INLINE__) -#include "ace/Cache_Map_Manager_T.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Cache_Map_Manager_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Cache_Map_Manager_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* CACHE_MAP_MANAGER_T_H */ diff --git a/ace/Cache_Map_Manager_T.i b/ace/Cache_Map_Manager_T.i deleted file mode 100644 index ab90786fe1b..00000000000 --- a/ace/Cache_Map_Manager_T.i +++ /dev/null @@ -1,273 +0,0 @@ -/* -*- C++ -*- */ -//$Id$ - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -#define ACE_T1 class KEY, class VALUE, class MAP, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, MAP, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES - -#else - -#define ACE_T1 class KEY, class VALUE, class MAP, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, MAP, CACHING_STRATEGY, ATTRIBUTES - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -template ACE_INLINE int -ACE_Cache_Map_Manager::purge (void) -{ - return this->caching_strategy ().caching_utility ().clear_cache (this->map_, - this->caching_strategy ().purge_percent ()); -} - -template ACE_INLINE size_t -ACE_Cache_Map_Manager::current_size (void) const -{ - return this->map_.current_size (); -} - -template ACE_INLINE size_t -ACE_Cache_Map_Manager::total_size (void) const -{ - return this->map_.total_size (); -} - -template ACE_INLINE MAP & -ACE_Cache_Map_Manager::map (void) -{ - return this->map_; -} - -template ACE_INLINE CACHING_STRATEGY & -ACE_Cache_Map_Manager::caching_strategy (void) -{ - return this->caching_strategy_; -} - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -template ACE_INLINE ACE_Cache_Map_Iterator -ACE_Cache_Map_Manager::begin (void) -{ - return ITERATOR (this->map_.begin ()); -} - -template ACE_INLINE ACE_Cache_Map_Iterator -ACE_Cache_Map_Manager::end (void) -{ - return ITERATOR (this->map_.end ()); -} - -template ACE_INLINE ACE_Cache_Map_Reverse_Iterator -ACE_Cache_Map_Manager::rbegin (void) -{ - return REVERSE_ITERATOR (this->map_.rbegin ()); -} -template ACE_INLINE ACE_Cache_Map_Reverse_Iterator -ACE_Cache_Map_Manager::rend (void) -{ - return REVERSE_ITERATOR (this->map_.rend ()); -} - -#undef ACE_T1 -#undef ACE_T2 - -//////////////////////////////////////////////////////////////////////////////// - -#define ACE_T1 class KEY, class VALUE, class IMPLEMENTATION, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, IMPLEMENTATION, CACHING_STRATEGY, ATTRIBUTES - -template ACE_INLINE -ACE_Cache_Map_Iterator::ACE_Cache_Map_Iterator (const ACE_Cache_Map_Iterator &rhs) - : iterator_implementation_ (rhs.iterator_implementation_) -{ -} - -template ACE_INLINE -ACE_Cache_Map_Iterator::~ACE_Cache_Map_Iterator (void) -{ -} - -template ACE_INLINE ACE_Cache_Map_Iterator & -ACE_Cache_Map_Iterator::operator= (const ACE_Cache_Map_Iterator &rhs) -{ - this->iterator_implementation_ = rhs.iterator_implementation_; - return *this; -} - -template ACE_INLINE int -ACE_Cache_Map_Iterator::operator== (const ACE_Cache_Map_Iterator &rhs) const -{ - return this->iterator_implementation_ == rhs.iterator_implementation_; -} - -template ACE_INLINE int -ACE_Cache_Map_Iterator::operator!= (const ACE_Cache_Map_Iterator &rhs) const -{ - return this->iterator_implementation_ != rhs.iterator_implementation_; -} - -template ACE_INLINE ACE_Reference_Pair -ACE_Cache_Map_Iterator::operator* (void) const -{ - value_type retn ((*this->iterator_implementation_).ext_id_, - (*this->iterator_implementation_).int_id_.first ()); - return retn; -} - -template ACE_INLINE -ACE_Cache_Map_Iterator & -ACE_Cache_Map_Iterator::operator++ (void) -{ - ++this->iterator_implementation_; - return *this; -} - -template ACE_INLINE -ACE_Cache_Map_Iterator -ACE_Cache_Map_Iterator::operator++ (int) -{ - ACE_Cache_Map_Iterator retn = *this; - ++this->iterator_implementation_; - return retn; -} - -template ACE_INLINE -ACE_Cache_Map_Iterator & -ACE_Cache_Map_Iterator::operator-- (void) -{ - --this->iterator_implementation_; - return *this; -} - -template ACE_INLINE -ACE_Cache_Map_Iterator -ACE_Cache_Map_Iterator::operator-- (int) -{ - ACE_Cache_Map_Iterator retn = *this; - --this->iterator_implementation_; - return retn; -} - - -template ACE_INLINE void -ACE_Cache_Map_Iterator::dump (void) const -{ - this->iterator_implementation_.dump (); -} - -template ACE_INLINE -ACE_Cache_Map_Iterator::ACE_Cache_Map_Iterator (const IMPLEMENTATION &iterator_impl) - : iterator_implementation_ (iterator_impl) -{ -} - -template ACE_INLINE IMPLEMENTATION & -ACE_Cache_Map_Iterator::iterator_implementation (void) -{ - return this->iterator_implementation_; -} - -#undef ACE_T1 -#undef ACE_T2 - -//////////////////////////////////////////////////////////////////////////////// - -#define ACE_T1 class KEY, class VALUE, class REVERSE_IMPLEMENTATION, class CACHING_STRATEGY, class ATTRIBUTES -#define ACE_T2 KEY, VALUE, REVERSE_IMPLEMENTATION, CACHING_STRATEGY, ATTRIBUTES - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator::ACE_Cache_Map_Reverse_Iterator (const ACE_Cache_Map_Reverse_Iterator &rhs) - : reverse_iterator_implementation_ (rhs.reverse_iterator_implementation_) -{ -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator::~ACE_Cache_Map_Reverse_Iterator (void) -{ -} - -template ACE_INLINE ACE_Cache_Map_Reverse_Iterator & -ACE_Cache_Map_Reverse_Iterator::operator= (const ACE_Cache_Map_Reverse_Iterator &rhs) -{ - this->reverse_iterator_implementation_ = rhs.reverse_iterator_implementation_; - return *this; -} - -template ACE_INLINE int -ACE_Cache_Map_Reverse_Iterator::operator== (const ACE_Cache_Map_Reverse_Iterator &rhs) const -{ - return this->reverse_iterator_implementation_ == rhs.reverse_iterator_implementation_; -} - -template ACE_INLINE int -ACE_Cache_Map_Reverse_Iterator::operator!= (const ACE_Cache_Map_Reverse_Iterator &rhs) const -{ - return this->reverse_iterator_implementation_ != rhs.reverse_iterator_implementation_; -} - -template ACE_INLINE ACE_Reference_Pair -ACE_Cache_Map_Reverse_Iterator::operator* (void) const -{ - value_type retv ((*this->reverse_iterator_implementation_).ext_id_, - (*this->reverse_iterator_implementation_).int_id_.first ()); - return retv; -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator & -ACE_Cache_Map_Reverse_Iterator::operator++ (void) -{ - ++this->reverse_iterator_implementation_; - return *this; -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator -ACE_Cache_Map_Reverse_Iterator::operator++ (int) -{ - ACE_Cache_Map_Reverse_Iterator retn = *this; - ++this->reverse_iterator_implementation_; - return retn; -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator & -ACE_Cache_Map_Reverse_Iterator::operator-- (void) -{ - --this->reverse_iterator_implementation_; - return *this; -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator -ACE_Cache_Map_Reverse_Iterator::operator-- (int) -{ - ACE_Cache_Map_Reverse_Iterator retn = *this; - --this->reverse_iterator_implementation_; - return retn; -} - - -template ACE_INLINE void -ACE_Cache_Map_Reverse_Iterator::dump (void) const -{ - this->reverse_iterator_implementation_.dump (); -} - -template ACE_INLINE -ACE_Cache_Map_Reverse_Iterator::ACE_Cache_Map_Reverse_Iterator (const REVERSE_IMPLEMENTATION &iterator_impl) - : reverse_iterator_implementation_(iterator_impl) -{ -} - -template ACE_INLINE REVERSE_IMPLEMENTATION & -ACE_Cache_Map_Reverse_Iterator::iterator_implementation (void) -{ - return this->reverse_iterator_implementation_; -} - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -#undef ACE_T1 -#undef ACE_T2 diff --git a/ace/Cached_Connect_Strategy_T.cpp b/ace/Cached_Connect_Strategy_T.cpp deleted file mode 100644 index ff660ff20ed..00000000000 --- a/ace/Cached_Connect_Strategy_T.cpp +++ /dev/null @@ -1,546 +0,0 @@ -//$Id$ - -#ifndef CACHED_CONNECT_STRATEGY_T_C -#define CACHED_CONNECT_STRATEGY_T_C - -#include "ace/Cached_Connect_Strategy_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/ACE.h" -#include "ace/Service_Repository.h" -#include "ace/Synch.h" -#include "ace/Service_Types.h" -#include "ace/Thread_Manager.h" -#include "ace/WFMO_Reactor.h" -#include "ace/Pair_T.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/Cached_Connect_Strategy_T.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -ACE_RCSID(ace, Cached_Connect_Strategy_T, "$Id$") - -#define ACE_T1 class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX -#define ACE_T2 SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX - -template -ACE_Cached_Connect_Strategy_Ex::ACE_Cached_Connect_Strategy_Ex -(CACHING_STRATEGY &caching_s, - ACE_Creation_Strategy *cre_s, - ACE_Concurrency_Strategy *con_s, - ACE_Recycling_Strategy *rec_s, - MUTEX *lock, - int delete_lock) - : CCSBASE (cre_s, con_s, rec_s, lock, delete_lock), - connection_cache_ (caching_s) -{ - if (this->open (cre_s, con_s, rec_s) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Cached_Connect_Strategy_Ex\n"))); -} - -template -ACE_Cached_Connect_Strategy_Ex::~ACE_Cached_Connect_Strategy_Ex (void) -{ -#if defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - cleanup (); -#else - // Close down all cached service handlers. - for (ACE_TYPENAME CONNECTION_CACHE::ITERATOR iter = this->connection_cache_.begin (); - iter != this->connection_cache_.end (); - ++iter) - { - if ((*iter).second () != 0) - { - (*iter).second ()->recycler (0, 0); - (*iter).second ()->close (); - } - } -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ -} - -template int -ACE_Cached_Connect_Strategy_Ex::check_hint_i -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, ACE_Pair > *&entry, - int &found) -{ - ACE_UNUSED_ARG (remote_addr); - ACE_UNUSED_ARG (timeout); - ACE_UNUSED_ARG (local_addr); - ACE_UNUSED_ARG (reuse_addr); - ACE_UNUSED_ARG (flags); - ACE_UNUSED_ARG (perms); - - found = 0; - - // Get the recycling act for the svc_handler - CONNECTION_CACHE_ENTRY *possible_entry = (CONNECTION_CACHE_ENTRY *) sh->recycling_act (); - - // Check to see if the hint svc_handler has been closed down - if (possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_CLOSED) - { - // If close, decrement refcount - if (possible_entry->ext_id_.decrement () == 0) - { - // If refcount goes to zero, close down the svc_handler - possible_entry->int_id_.first ()->recycler (0, 0); - possible_entry->int_id_.first ()->close (); - this->purge_i (possible_entry); - } - - // Hint not successful - found = 0; - - // Reset hint - sh = 0; - } - - // If hint is not closed, see if it is connected to the correct - // address and is recyclable - else if ((possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || - possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE) && - possible_entry->ext_id_.subject () == remote_addr) - { - // Hint successful - found = 1; - - // Tell the that it should prepare itself for - // being recycled. - this->prepare_for_recycling (sh); - - // - // Update the caching attributes directly since we don't do a - // find() on the cache map. - // - - // Indicates successful find. - int find_result = 0; - - int result = this->caching_strategy ().notify_find (find_result, - possible_entry->int_id_.second ()); - - if (result == -1) - return result; - } - else - { - // This hint will not be used. - possible_entry->ext_id_.decrement (); - - // Hint not successful - found = 0; - - // If is not connected to the correct address or is busy, - // we will not use it. - sh = 0; - } - - if (found) - entry = possible_entry; - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::find_or_create_svc_handler_i -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, ACE_Pair > *&entry, - int &found) -{ - REFCOUNTED_HASH_RECYCLABLE_ADDRESS search_addr (remote_addr); - - // Try to find the address in the cache. Only if we don't find it - // do we create a new and connect it with the server. - if (this->find (search_addr, entry) == -1) - { - // Set the flag - found = 0; - - // We need to use a temporary variable here since we are not - // allowed to change because other threads may use this - // when we let go of the lock during the OS level connect. - // - // Note that making a new svc_handler, connecting remotely, - // binding to the map, and assigning of the hint and recycler - // should be atomic to the outside world. - SVC_HANDLER *potential_handler = 0; - - // Create a new svc_handler - if (this->make_svc_handler (potential_handler) == -1) - return -1; - - // Connect using the svc_handler. - if (this->cached_connect (potential_handler, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms) == -1) - { - // Close the svc handler. - potential_handler->close (0); - - return -1; - } - else - { - // Insert the new SVC_HANDLER instance into the cache. - if (this->connection_cache_.bind (search_addr, - potential_handler, - entry) == -1) - { - // Close the svc handler and reset . - potential_handler->close (0); - - return -1; - } - - // Everything succeeded as planned. Assign to . - sh = potential_handler; - - // Set the recycler and the recycling act - this->assign_recycler (sh, this, entry); - } - } - else // We found a cached svc_handler. - { - // Set the flag - found = 1; - - // Get the cached - sh = entry->int_id_.first (); - - // Tell the that it should prepare itself for - // being recycled. - this->prepare_for_recycling (sh); - } - - return 0; - -} - -template int -ACE_Cached_Connect_Strategy_Ex::cached_connect (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - // Actively establish the connection. This is a timed blocking - // connect. - if (this->new_connection (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms) == -1) - { - // If connect() failed because of timeouts, we have to reject - // the connection entirely. This is necessary since currently - // there is no way for the non-blocking connects to complete and - // for the to notify the cache of the completion of - // connect(). - - if (errno == EWOULDBLOCK) - errno = ENOTSUP; - else if (ACE::out_of_handles (errno)) - { - // If the connect failed due to the process running out of - // file descriptors then, auto_purging of some connections - // are done from the CONNECTION_CACHE. This frees the - // descriptors which get used in the connect process and - // hence the same method is called again! - if (this->purge_connections () == -1) - return -1; - - // Try connecting again. - if (this->new_connection (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms) == -1) - { - if (errno == EWOULDBLOCK) - errno = ENOTSUP; - return -1; - } - } - else - { - return -1; - } - } - - return 0; - -} - - -template int -ACE_Cached_Connect_Strategy_Ex::connect_svc_handler_i -(SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - int& found) -{ - CONNECTION_CACHE_ENTRY *entry = 0; - - // Check if the user passed a hint svc_handler - if (sh != 0) - { - - int result = this->check_hint_i (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms, - entry, - found); - if (result != 0) - return result; - } - - // If not found - if (!found) - { - int result = this->find_or_create_svc_handler_i (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms, - entry, - found); - - if (result != 0) - return result; - - } - - // For all successful cases: mark the in the cache - // as being . Therefore recyclable is BUSY. - entry->ext_id_.recycle_state (ACE_RECYCLABLE_BUSY); - - // And increment the refcount - entry->ext_id_.increment (); - - return 0; -} - - -template int -ACE_Cached_Connect_Strategy_Ex::cache_i (const void *recycling_act) -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Mark the in the cache as not being . - // Therefore recyclable is IDLE. - entry->ext_id_.recycle_state (ACE_RECYCLABLE_IDLE_AND_PURGABLE); - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::recycle_state_i (const void *recycling_act, - ACE_Recyclable_State new_state) -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Mark the in the cache as not being . - // Therefore recyclable is IDLE. - entry->ext_id_.recycle_state (new_state); - - return 0; -} - -template ACE_Recyclable_State -ACE_Cached_Connect_Strategy_Ex::recycle_state_i (const void *recycling_act) const -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Mark the in the cache as not being . - // Therefore recyclable is IDLE. - return entry->ext_id_.recycle_state (); -} - -template int -ACE_Cached_Connect_Strategy_Ex::purge_i (const void *recycling_act) -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - return this->connection_cache_.unbind (entry); -} - - -template int -ACE_Cached_Connect_Strategy_Ex::mark_as_closed_i (const void *recycling_act) -{ - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Mark the in the cache as CLOSED. - entry->ext_id_.recycle_state (ACE_RECYCLABLE_CLOSED); - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::cleanup_hint_i (const void *recycling_act, - void **act_holder) -{ - // Reset the <*act_holder> in the confines and protection of the - // lock. - if (act_holder) - *act_holder = 0; - - // The wonders and perils of ACT - CONNECTION_CACHE_ENTRY *entry = (CONNECTION_CACHE_ENTRY *) recycling_act; - - // Decrement the refcount on the . - int refcount = entry->ext_id_.decrement (); - - // If the svc_handler state is closed and the refcount == 0, call - // close() on svc_handler. - if (entry->ext_id_.recycle_state () == ACE_RECYCLABLE_CLOSED && - refcount == 0) - { - entry->int_id_.first ()->recycler (0, 0); - entry->int_id_.first ()->close (); - this->purge_i (entry); - } - - return 0; -} - -template int -ACE_Cached_Connect_Strategy_Ex::purge_connections (void) -{ - return this->connection_cache_.purge (); -} - -template CACHING_STRATEGY & -ACE_Cached_Connect_Strategy_Ex::caching_strategy (void) -{ - return this->connection_cache_.caching_strategy (); -} - -template int -ACE_Cached_Connect_Strategy_Ex::find (ACE_Refcounted_Hash_Recyclable &search_addr, - ACE_Hash_Map_Entry, ACE_Pair > *&entry) -{ - typedef ACE_Hash_Map_Bucket_Iterator, - ACE_Hash, - ACE_Equal_To, - ACE_Null_Mutex> - CONNECTION_CACHE_BUCKET_ITERATOR; - - CONNECTION_CACHE_BUCKET_ITERATOR iterator (this->connection_cache_.map (), - search_addr); - - CONNECTION_CACHE_BUCKET_ITERATOR end (this->connection_cache_.map (), - search_addr, - 1); - - for (; - iterator != end; - ++iterator) - { - REFCOUNTED_HASH_RECYCLABLE_ADDRESS &addr = (*iterator).ext_id_; - - if (addr.recycle_state () != ACE_RECYCLABLE_IDLE_AND_PURGABLE && - addr.recycle_state () != ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE) - continue; - - if (addr.subject () != search_addr.subject ()) - continue; - - entry = &(*iterator); - - // - // Update the caching attributes directly since we don't do a - // find() on the cache map. - // - - // Indicates successful find. - int find_result = 0; - - int result = this->caching_strategy ().notify_find (find_result, - entry->int_id_.second ()); - - if (result == -1) - return result; - - return 0; - } - - return -1; -} - -#if defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) -template void -ACE_Cached_Connect_Strategy_Ex::cleanup (void) -{ - typedef ACE_Hash_Map_Iterator_Ex, - ACE_Hash, - ACE_Equal_To, - ACE_Null_Mutex> - CONNECTION_MAP_ITERATOR; - - CONNECTION_MAP_ITERATOR end = this->connection_cache_.map ().end (); - CONNECTION_MAP_ITERATOR iter = this->connection_cache_.map ().begin (); - - for (; - iter != end; - ++iter) - { - if ((*iter).int_id_.first () != 0) - { - (*iter).int_id_.first ()->recycler (0, 0); - (*iter).int_id_.first ()->close (); - } - } -} -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -ACE_ALLOC_HOOK_DEFINE(ACE_Cached_Connect_Strategy_Ex) - -#undef ACE_T1 -#undef ACE_T2 - -#endif /* CACHED_CONNECT_STRATEGY_T_C */ diff --git a/ace/Cached_Connect_Strategy_T.h b/ace/Cached_Connect_Strategy_T.h deleted file mode 100644 index d8e7629b959..00000000000 --- a/ace/Cached_Connect_Strategy_T.h +++ /dev/null @@ -1,194 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Cached_Connect_Strategy_T.h -// -// = AUTHOR -// Kirthika Parameswaran -// -// ============================================================================ - -#ifndef CACHED_CONNECT_STRATEGY_T_H -#define CACHED_CONNECT_STRATEGY_T_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Strategies_T.h" -#include "ace/Hash_Cache_Map_Manager_T.h" -#include "ace/Caching_Strategies_T.h" -#include "ace/Functor_T.h" -#include "ace/Pair_T.h" -#include "ace/Synch.h" - -// For linkers which cant grok long names... -#define ACE_Cached_Connect_Strategy_Ex ACCSE - -template -class ACE_Cached_Connect_Strategy_Ex : public ACE_Cached_Connect_Strategy -{ - // = TITLE - // A connection strategy which caches connections to peers - // (represented by instances), thereby allowing - // subsequent re-use of unused, but available, connections. - // - // = DESCRIPTION - // is intended to be used as a - // plug-in connection strategy for . - // It's added value is re-use of established connections and - // tweaking the role of the cache as per the caching strategy. - -public: - - ACE_Cached_Connect_Strategy_Ex (CACHING_STRATEGY &caching_s, - ACE_Creation_Strategy *cre_s = 0, - ACE_Concurrency_Strategy *con_s = 0, - ACE_Recycling_Strategy *rec_s = 0, - MUTEX *lock = 0, - int delete_lock = 0); - // Constructor - - virtual ~ACE_Cached_Connect_Strategy_Ex (void); - // Destructor - - virtual int purge_connections (void); - // Explicit purging of connection entries from the connection cache. - - virtual int mark_as_closed_i (const void *recycling_act); - // Mark as closed (non-locking version). This is used during the cleanup of the - // connections purged. - - // = Typedefs for managing the map - typedef ACE_Refcounted_Hash_Recyclable - REFCOUNTED_HASH_RECYCLABLE_ADDRESS; - typedef ACE_Hash_Cache_Map_Manager, - ACE_Equal_To, - CACHING_STRATEGY, - ATTRIBUTES> - CONNECTION_CACHE; - typedef ACE_TYPENAME CONNECTION_CACHE::CACHE_ENTRY - CONNECTION_CACHE_ENTRY; - typedef ACE_TYPENAME CONNECTION_CACHE::key_type - KEY; - typedef ACE_TYPENAME CONNECTION_CACHE::mapped_type - VALUE; - - // = Cleanup of the svc_handler. - typedef ACE_Recyclable_Handler_Cleanup_Strategy, - ACE_Hash_Map_Manager_Ex, - ACE_Hash, - ACE_Equal_To, - MUTEX> > - CLEANUP_STRATEGY; - - typedef ACE_Cached_Connect_Strategy - CCSBASE; - - // = Accessor. - CACHING_STRATEGY &caching_strategy (void); - -protected: - - int find (ACE_Refcounted_Hash_Recyclable &search_addr, - ACE_Hash_Map_Entry, ACE_Pair > *&entry); - // Find an idle handle. - - virtual int purge_i (const void *recycling_act); - // Remove from cache (non-locking version). - - virtual int cache_i (const void *recycling_act); - // Add to cache (non-locking version). - - virtual int recycle_state_i (const void *recycling_act, - ACE_Recyclable_State new_state); - virtual ACE_Recyclable_State recycle_state_i (const void *recycling_act) const; - // Get/Set (non-locking version). - - virtual int cleanup_hint_i (const void *recycling_act, - void **act_holder); - // Cleanup hint and reset <*act_holder> to zero if . - - // = Helpers - int check_hint_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, ACE_Pair > *&entry, - int &found); - - int find_or_create_svc_handler_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - ACE_Hash_Map_Entry, ACE_Pair > *&entry, - int &found); - - virtual int connect_svc_handler_i (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms, - int &found); - - virtual int cached_connect (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - // Connection of the svc_handler with the remote host. This method - // also encapsulates the connection done with auto_purging under the - // hood. If the connect failed due to the process running out of - // file descriptors then, auto_purging of some connections are done - // from the CONNECTION_CACHE. This frees the descriptors which get - // used in the connect process and hence the connect operation can - // succeed. - -#if defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - void cleanup (void); - // Since g++ version < 2.8 arent happy with templates, this special - // method had to be devised to avoid memory leaks and perform - // cleanup of the . -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - - CONNECTION_CACHE connection_cache_; - // Table that maintains the cache of connected s. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/Cached_Connect_Strategy_T.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Cached_Connect_Strategy_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Cached_Connect_Strategy_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* CACHED_CONNECT_STRATEGY_T_H */ diff --git a/ace/Cached_Connect_Strategy_T.i b/ace/Cached_Connect_Strategy_T.i deleted file mode 100644 index 64205b0dc62..00000000000 --- a/ace/Cached_Connect_Strategy_T.i +++ /dev/null @@ -1,3 +0,0 @@ -/* -*- C++ -*- */ -//$Id$ - diff --git a/ace/Caching_Strategies_T.cpp b/ace/Caching_Strategies_T.cpp deleted file mode 100644 index f36d593ad84..00000000000 --- a/ace/Caching_Strategies_T.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//$Id$ - -#ifndef CACHING_STRATEGIES_T_C -#define CACHING_STRATEGIES_T_C - -#include "ace/Caching_Strategies_T.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Caching_Strategies_T.i" -#endif /* __ACE_INLINE__ */ - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(ace, Caching_Strategies_T, "$Id$") - -template -ACE_Caching_Strategy::~ACE_Caching_Strategy (void) -{ -} - -////////////////////////////////////////////////////////////////////////////////// - -template -ACE_LRU_Caching_Strategy::ACE_LRU_Caching_Strategy (void) - : timer_ (0), - purge_percent_ (10) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_LFU_Caching_Strategy::ACE_LFU_Caching_Strategy (void) - : purge_percent_ (10) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_FIFO_Caching_Strategy::ACE_FIFO_Caching_Strategy (void) - : order_ (0), - purge_percent_ (10) -{ -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -ACE_ALLOC_HOOK_DEFINE(ACE_LRU_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_LFU_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Caching_Strategy) -ACE_ALLOC_HOOK_DEFINE(ACE_Null_Caching_Strategy) - -#endif /* CACHING_STRATEGIES_T_C */ diff --git a/ace/Caching_Strategies_T.h b/ace/Caching_Strategies_T.h deleted file mode 100644 index 8fd8c86aa06..00000000000 --- a/ace/Caching_Strategies_T.h +++ /dev/null @@ -1,529 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Caching_Strategies_T.h -// -// = AUTHOR -// Kirthika Parameswaran -// -// ============================================================================ - -#ifndef CACHING_STRATEGIES_H -#define CACHING_STRATEGIES_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#include "ace/Caching_Utility_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined(_MSC_VER) -#pragma warning(disable:4503) -#endif /* _MSC_VER */ - -// For linkers that cant grok long names. -#define ACE_Caching_Strategy ACS - -template -class ACE_Caching_Strategy -{ - // = TITLE - // This class is an abstract base class for a caching strategy. - // - // = DESCRIPTION - // This class consists of all the interfaces a caching strategy should have and - // is used in association with the ACE_Caching_Strategy_Adaptor. - -public: - - virtual ~ACE_Caching_Strategy (void); - // Destructor. - - virtual ATTRIBUTES attributes (void) = 0; - // Accessor method for the timer attributes. - - // = Accessor methods for the percentage of entries to purge. - virtual double purge_percent (void) = 0; - virtual void purge_percent (double percentage) = 0; - - // = Strategy related Operations - - virtual int notify_bind (int result, - const ATTRIBUTES &attr) = 0; - // This method acts as a notification about the CONTAINERs bind - // method call. - - virtual int notify_find (int result, - ATTRIBUTES &attr) = 0; - // This method acts as a notification about the CONTAINERs find - // method call - - virtual int notify_unbind (int result, - const ATTRIBUTES &attr) = 0; - // This method acts as a notification about the CONTAINERs unbind - // method call - - virtual int notify_trybind (int result, - ATTRIBUTES &attr) = 0; - // This method acts as a notification about the CONTAINERs trybind - // method call - - virtual int notify_rebind (int result, - const ATTRIBUTES &attr) = 0; - // This method acts as a notification about the CONTAINERs rebind - // method call - - virtual CACHING_UTILITY &caching_utility (void) = 0; - // Purge the cache. - - virtual void dump (void) const = 0; - // Dumps the state of the object. -}; - -////////////////////////////////////////////////////////////////////////// - -#define ACE_Caching_Strategy_Adapter ACSA - -template -class ACE_Caching_Strategy_Adapter : public ACE_Caching_Strategy -{ - // = TITLE - // This class follows the Adaptor pattern and is used to provide - // External Polymorphism by deriving from ACE_Caching_Strategy. - // - // = DESCRIPTION - // This class simply delegates all requests to the - // IMPLEMNETATION object within. This class should be passed in - // place of the the abstract base ACE_Caching_Strategy class as - // part of the External Polymorphism pattern. - -public: - - ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation = 0, - int delete_implementation = 0); - // Constructor. - - ~ACE_Caching_Strategy_Adapter (void); - // Destructor. - - ATTRIBUTES attributes (void); - // Accessor method for the timer attributes. - - // = Accessor methods for the percentage of entries to purge. - double purge_percent (void); - void purge_percent (double percentage); - - // = Strategy related Operations - - int notify_bind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs bind - // method call. - - int notify_find (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs find - // method call - - int notify_unbind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs unbind - // method call - - int notify_trybind (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs trybind - // method call - - int notify_rebind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs rebind - // method call - - IMPLEMENTATION &implementation (void); - // Accessor to the implementation. - - CACHING_UTILITY &caching_utility (void); - // Purge the cache. - - void dump (void) const; - // Dumps the state of the object. - -private: - - IMPLEMENTATION *implementation_; - // Implementation class. - - int delete_implementation_; - // Do we need to delete the implementation? -}; - -////////////////////////////////////////////////////////////////////////// -#define ACE_LRU_Caching_Strategy ALRU - -template -class ACE_LRU_Caching_Strategy -{ - // = TITLE - // Defines a Least Recently Used strategy which will decide on - // the item to be removed from the cache. - // - // = DESCRIPTION - // This is a strategy which makes use of a virtual timer which - // is updated whenever an item is inserted or looked up in the - // container. When the need of purging entries arises, the items - // with the lowest timer values are removed. - // - // Explanation of the template parameter list: - // CONTAINER is any map with entries of type . - // The ATTRIBUTES are the deciding factor for purging of entries - // and should logically be included with the VALUE. Some ways of - // doing this are: As being a member of the VALUE or VALUE being - // ACE_Pair. The CACHING_UTILITY is the - // class which can be plugged in and which decides the entries - // to purge. - -public: - - // Traits. - typedef ATTRIBUTES CACHING_ATTRIBUTES; - - // = Initialisation and termination. - - ACE_LRU_Caching_Strategy (void); - // The is the map in which the entries reside. The - // timer attribute is initialed to zero in this constructor. And - // the field denotes the percentage of the entries - // in the cache which can be purged automagically and by default is - // set to 10%. - - // = Operations of the strategy. - - ATTRIBUTES attributes (void); - // Accessor method for the timer attributes. - - // = Accessor methods for the percentage of entries to purge. - double purge_percent (void); - - void purge_percent (double percentage); - - // = Strategy related Operations - - int notify_bind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs bind - // method call. - - int notify_find (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs find - // method call - - int notify_unbind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs unbind - // method call - - - int notify_trybind (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs trybind - // method call - - int notify_rebind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs rebind - // method call - - CACHING_UTILITY &caching_utility (void); - // Purge the cache. - - void dump (void) const; - // Dumps the state of the object. - -private: - - ATTRIBUTES timer_; - // This element is the one which is the deciding factor for purging - // of an ITEM. - - double purge_percent_; - // The level about which the purging will happen automagically. - - CACHING_UTILITY caching_utility_; - // This is the helper class which will decide and expunge entries - // from the cache. -}; - -////////////////////////////////////////////////////////////////////////// -#define ACE_LFU_Caching_Strategy ALFU - -template -class ACE_LFU_Caching_Strategy -{ - // = TITLE - // Defines a Least Frequently Used strategy for which will decide on - // the item to be removed from the cache. - // - // = DESCRIPTION - // A attribute is tagged to each item which increments whenever - // the item is bound or looked up in the cache. Thus it denotes - // the frequency of use. According to the value of the attribute - // the item is removed from the CONTAINER i.e cache. - // - // Explanation of the template parameter list: - // CONTAINER is any map with entries of type . - // The ATTRIBUTES are the deciding factor for purging of entries - // and should logically be included with the VALUE. Some ways of - // doing this are: As being a member of the VALUE or VALUE being - // ACE_Pair. The CACHING_UTILITY is the - // class which can be plugged in and which decides the entries - // to purge. - -public: - - // Traits. - typedef ATTRIBUTES CACHING_ATTRIBUTES; - - // = Initialisation and termination methods. - - ACE_LFU_Caching_Strategy (void); - // The is the map in which the entries reside. The - // timer attribute is initialed to zero in this constructor. And - // the field denotes the percentage of the entries - // in the cache which can be purged automagically and by default is - // set to 10%. - - // = Strategy methods. - - ATTRIBUTES attributes (void); - // Access the attributes. - - // = Accessor methods for the percentage of entries to purge. - double purge_percent (void); - - void purge_percent (double percentage); - - // = Strategy related Operations - - int notify_bind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs bind - // method call. - - int notify_find (int result, - ATTRIBUTES &attr); - // Lookup notification. - - int notify_unbind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs unbind - // method call - - int notify_trybind (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs trybind - // method call - - int notify_rebind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs rebind - // method call - - CACHING_UTILITY &caching_utility (void); - // Purge the cache. - - void dump (void) const; - // Dumps the state of the object. - -private: - - double purge_percent_; - // The level about which the purging will happen automagically. - - CACHING_UTILITY caching_utility_; - // This is the helper class which will decide and expunge entries - // from the cache. -}; - -///////////////////////////////////////////////////////////// -#define ACE_FIFO_Caching_Strategy AFIFO - -template -class ACE_FIFO_Caching_Strategy -{ - // = TITLE - // The First In First Out strategy is implemented wherein each - // item is ordered. - // - // = DESCRIPTION - // The order tag of each item is used to decide the item to be - // removed from the cache. The items with least order are removed. - // - // Explanation of the template parameter list: - // CONTAINER is any map with entries of type . - // The ATTRIBUTES are the deciding factor for purging of entries - // and should logically be included with the VALUE. Some ways of - // doing this are: As being a member of the VALUE or VALUE being - // ACE_Pair. The CACHING_UTILITY is the - // class which can be plugged in and which decides the entries - // to purge. - -public: - - typedef ATTRIBUTES CACHING_ATTRIBUTES; - - // = Initialisation and termination. - - ACE_FIFO_Caching_Strategy (void); - // The is the map in which the entries reside. The - // timer attribute is initialed to zero in this constructor. And - // the field denotes the percentage of the entries - // in the cache which can be purged automagically and by default is - // set to 10%. - - // = Strategy methods. - - ATTRIBUTES attributes (void); - // Accessor method. - - // = Accessor methods for the percentage of entries to purge. - double purge_percent (void); - - void purge_percent (double percentage); - - // = Strategy related Operations - - int notify_bind (int result, - const ATTRIBUTES &attr); - // Notification for an item getting bound into the cache. - - int notify_find (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs find - // method call - - int notify_unbind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs unbind - // method call - - int notify_trybind (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs trybind - // method call - - int notify_rebind (int result, - const ATTRIBUTES &attr); - // Notification for an item getting bound again into the cache. - - CACHING_UTILITY &caching_utility (void); - // Purge the cache. - - void dump (void) const; - // Dumps the state of the object. - -private: - - ATTRIBUTES order_; - // The order is the deciding factor for the item to be removed from - // the cache. - - double purge_percent_; - // The level about which the purging will happen automagically. - - CACHING_UTILITY caching_utility_; - // This is the helper class which will decide and expunge entries - // from the cache. -}; - -////////////////////////////////////////////////////////////////////// -#define ACE_Null_Caching_Strategy ANULL - -template -class ACE_Null_Caching_Strategy -{ - // = TITLE - // The is a special caching strategy which doesnt have the purging - // feature. - // - // = DESCRIPTION - // No purging provided. To be used when purging might be too expensive - // an operation. - -public: - - // = Traits. - typedef ATTRIBUTES CACHING_ATTRIBUTES; - - // = Strategy methods. All are NO_OP methods!!! - - ATTRIBUTES attributes (void); - // Accessor method. - - // = Accessor methods for the percentage of entries to purge. - double purge_percent (void); - - void purge_percent (double percentage); - - // = Strategy related Operations - - int notify_bind (int result, - const ATTRIBUTES &attr); - // Notification for an item getting bound into the cache. - - int notify_find (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs find - // method call - - int notify_unbind (int result, - const ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs unbind - // method call - - int notify_trybind (int result, - ATTRIBUTES &attr); - // This method acts as a notification about the CONTAINERs trybind - // method call - - int notify_rebind (int result, - const ATTRIBUTES &attr); - // Notification for an item getting bound again into the cache. - - CACHING_UTILITY &caching_utility (void); - // Purge the cache. - - void dump (void) const; - // Dumps the state of the object. - -private: - - CACHING_UTILITY caching_utility_; - // This is the helper class which will decide and expunge entries - // from the cache. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Caching_Strategies_T.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Caching_Strategies_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Caching_Strategies_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* CACHING_STRATEGIES_H */ diff --git a/ace/Caching_Strategies_T.i b/ace/Caching_Strategies_T.i deleted file mode 100644 index 30df91a76ed..00000000000 --- a/ace/Caching_Strategies_T.i +++ /dev/null @@ -1,448 +0,0 @@ -/* -*-C++-*- */ -//$Id$ - -////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE -ACE_Caching_Strategy_Adapter::ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation, - int delete_implementation) - : implementation_ (implementation), - delete_implementation_ (delete_implementation) -{ - if (this->implementation_ == 0) - { - ACE_NEW (this->implementation_, - IMPLEMENTATION); - this->delete_implementation_ = 1; - } -} - -template ACE_INLINE -ACE_Caching_Strategy_Adapter::~ACE_Caching_Strategy_Adapter (void) -{ - if (this->delete_implementation_) - { - delete this->implementation_; - this->delete_implementation_ = 0; - this->implementation_ = 0; - } -} - -template ACE_INLINE ATTRIBUTES -ACE_Caching_Strategy_Adapter::attributes (void) -{ - return this->implementation_->attributes (); -} - -template ACE_INLINE double -ACE_Caching_Strategy_Adapter::purge_percent (void) -{ - return this->implementation_->purge_percent (); -} - -template ACE_INLINE void -ACE_Caching_Strategy_Adapter::purge_percent (double percentage) -{ - this->implementation_->purge_percent (percentage); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_bind (int result, - const ATTRIBUTES &attr) -{ - return this->implementation_->notify_bind (result, - attr); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_find (int result, - ATTRIBUTES &attr) -{ - return this->implementation_->notify_find (result, - attr); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_unbind (int result, - const ATTRIBUTES &attr) -{ - return this->implementation_->notify_unbind (result, - attr); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_trybind (int result, - ATTRIBUTES &attr) -{ - return this->implementation_->notify_trybind (result, - attr); -} - -template ACE_INLINE int -ACE_Caching_Strategy_Adapter::notify_rebind (int result, - const ATTRIBUTES &attr) -{ - return this->implementation_->notify_rebind (result, - attr); -} - -template ACE_INLINE IMPLEMENTATION & -ACE_Caching_Strategy_Adapter::implementation (void) -{ - return *this->implementation_; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_Caching_Strategy_Adapter::caching_utility (void) -{ - return this->implementation_->caching_utility (); -} - -template ACE_INLINE void -ACE_Caching_Strategy_Adapter::dump (void) const -{ - ACE_TRACE ("ACE_Caching_Strategy_Adapter::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE ATTRIBUTES -ACE_LRU_Caching_Strategy::attributes (void) -{ - return this->timer_; -} - -template ACE_INLINE double -ACE_LRU_Caching_Strategy::purge_percent (void) -{ - return this->purge_percent_; -} - -template ACE_INLINE void -ACE_LRU_Caching_Strategy::purge_percent (double percentage) -{ - this->purge_percent_ = percentage; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_bind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - if (result == 0) - ++this->timer_; - - return result; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_find (int result, - ATTRIBUTES &attr) -{ - if (result == 0) - { - attr = this->timer_; - ++this->timer_; - } - - return result; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_unbind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - return result; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_trybind (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_LRU_Caching_Strategy::notify_rebind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - if (result == 0) - ++this->timer_; - - return result; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_LRU_Caching_Strategy::caching_utility (void) -{ - return this->caching_utility_; -} - -template ACE_INLINE void -ACE_LRU_Caching_Strategy::dump (void) const -{ - ACE_TRACE ("ACE_LRU_Caching_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("timer_ = %d "), this->timer_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE ATTRIBUTES -ACE_LFU_Caching_Strategy::attributes (void) -{ - return 0; -} - -template ACE_INLINE double -ACE_LFU_Caching_Strategy::purge_percent (void) -{ - return this->purge_percent_; -} - -template ACE_INLINE void -ACE_LFU_Caching_Strategy::purge_percent (double percentage) -{ - this->purge_percent_ = percentage; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_bind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_find (int result, - ATTRIBUTES &attr) -{ - if (result == 0) - ++attr; - - return result; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_trybind (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_rebind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_LFU_Caching_Strategy::notify_unbind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_LFU_Caching_Strategy::caching_utility (void) -{ - return this->caching_utility_; -} - -template ACE_INLINE void -ACE_LFU_Caching_Strategy::dump (void) const -{ - ACE_TRACE ("ACE_LFU_Caching_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -////////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE ATTRIBUTES -ACE_FIFO_Caching_Strategy::attributes (void) -{ - return this->order_; -} - -template ACE_INLINE double -ACE_FIFO_Caching_Strategy::purge_percent (void) -{ - return this->purge_percent_; -} - -template ACE_INLINE void -ACE_FIFO_Caching_Strategy::purge_percent (double percentage) -{ - this->purge_percent_ = percentage; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_bind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - if (result == 0) - ++this->order_; - - return result; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_find (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_unbind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_trybind (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_FIFO_Caching_Strategy::notify_rebind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - if (result == 0) - ++this->order_; - - return result; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_FIFO_Caching_Strategy::caching_utility (void) -{ - return this->caching_utility_; -} - -template ACE_INLINE void -ACE_FIFO_Caching_Strategy::dump (void) const -{ - ACE_TRACE ("ACE_FIFO_Caching_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("order_ = %d "), this->order_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -////////////////////////////////////////////////////////////////////////////////// - -template ACE_INLINE ATTRIBUTES -ACE_Null_Caching_Strategy::attributes (void) -{ - return 0; -} - -template ACE_INLINE double -ACE_Null_Caching_Strategy::purge_percent (void) -{ - return 0; -} - -template ACE_INLINE void -ACE_Null_Caching_Strategy::purge_percent (double percentage) -{ - ACE_UNUSED_ARG (percentage); -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_bind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_find (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_unbind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_trybind (int result, - ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE int -ACE_Null_Caching_Strategy::notify_rebind (int result, - const ATTRIBUTES &attr) -{ - ACE_UNUSED_ARG (attr); - - return result; -} - -template ACE_INLINE CACHING_UTILITY & -ACE_Null_Caching_Strategy::caching_utility (void) -{ - return this->caching_utility_; -} - -template ACE_INLINE void -ACE_Null_Caching_Strategy::dump (void) const -{ - ACE_TRACE ("ACE_Null_Caching_Strategy::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -////////////////////////////////////////////////////////////////////////////////// diff --git a/ace/Caching_Utility_T.cpp b/ace/Caching_Utility_T.cpp deleted file mode 100644 index e571e7509e1..00000000000 --- a/ace/Caching_Utility_T.cpp +++ /dev/null @@ -1,487 +0,0 @@ -//$Id$ - -#ifndef CACHING_UTILITY_T_C -#define CACHING_UTILITY_T_C - -#include "ace/Caching_Utility_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Strategies.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Caching_Utility_T.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Caching_Utility_T, "$Id$") - -///////////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_Pair_Caching_Utility::ACE_Pair_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Pair_Caching_Utility::~ACE_Pair_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Pair_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - // Check that the purge_percent is non-zero. - if (purge_percent == 0) - return 0; - - // Get the number of entries in the container. - size_t current_map_size = container.current_size (); - - // Also whether the number of entries in the cache is just one! - // Oops! then there is no way out but exiting. So return an error. - if (current_map_size <= 1) - return 0; - - // Calculate the no of entries to remove from the cache depending - // upon the . - size_t entries_to_remove = size_t ((double (purge_percent) / 100 * current_map_size) + 0.5); - - KEY *key_to_remove = 0; - VALUE *value_to_remove = 0; - - for (size_t i = 0; i < entries_to_remove ; ++i) - { - this->minimum (container, - key_to_remove, - value_to_remove); - - // Simply verifying that the key is non-zero. - // This is important for strategies where the minimum - // entry cant be found due to constraints on the type of entry - // to remove. - if (key_to_remove == 0) - return 0; - - if (this->cleanup_strategy_->cleanup (container, - key_to_remove, - value_to_remove) == -1) - return -1; - - } - - return 0; -} - -template void -ACE_Pair_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - // Starting values. - ITERATOR iter = container.begin (); - ITERATOR end = container.end (); - ATTRIBUTES min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - - // The iterator moves thru the container searching for the entry - // with the lowest ATTRIBUTES. - for (++iter; - iter != end; - ++iter) - { - if (min > (*iter).int_id_.second ()) - { - // Ah! an item with lower ATTTRIBUTES... - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_Recyclable_Handler_Caching_Utility::ACE_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Recyclable_Handler_Caching_Utility::~ACE_Recyclable_Handler_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Recyclable_Handler_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - // Check that the purge_percent is non-zero. - if (purge_percent == 0) - return 0; - - // Get the number of entries in the container. - size_t current_map_size = container.current_size (); - - // Also whether the number of entries in the cache is just one! - // Oops! then there is no way out but exiting. So return an error. - if (current_map_size <= 1) - return 0; - - // Calculate the no of entries to remove from the cache depending - // upon the . - size_t entries_to_remove = size_t ((double (purge_percent) / 100 * current_map_size) + 0.5); - - KEY *key_to_remove = 0; - VALUE *value_to_remove = 0; - - for (size_t i = 0; i < entries_to_remove ; ++i) - { - this->minimum (container, - key_to_remove, - value_to_remove); - - // Simply verifying that the key is non-zero. - // This is important for strategies where the minimum - // entry cant be found due to constraints on the type of entry - // to remove. - if (key_to_remove == 0) - return 0; - - if (this->cleanup_strategy_->cleanup (container, - key_to_remove, - value_to_remove) == -1) - return -1; - } - - return 0; -} - -template void -ACE_Recyclable_Handler_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - // Starting values. - ITERATOR end = container.end (); - ITERATOR iter = container.begin (); - ATTRIBUTES min = (*iter).int_id_.second (); - key_to_remove = 0; - value_to_remove = 0; - // Found the minimum entry to be purged? - int found = 0; - - // The iterator moves thru the container searching for the entry - // with the lowest ATTRIBUTES. - for (; - iter != end; - ++iter) - { - // If the entry isnt IDLE_AND_PURGABLE continue until you reach - // the first entry which can be purged. This is the minimum with - // which you will compare the rest of the purgable entries. - if ((*iter).ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || - (*iter).ext_id_.recycle_state () == ACE_RECYCLABLE_PURGABLE_BUT_NOT_IDLE) - { - if (found == 0) - { - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - found = 1; - } - else - { - // Ah! an entry with lower ATTTRIBUTES... - if (min > (*iter).int_id_.second ()) - { - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - } - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// - -template -ACE_Refcounted_Recyclable_Handler_Caching_Utility::ACE_Refcounted_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy), - marked_as_closed_entries_ (0) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Refcounted_Recyclable_Handler_Caching_Utility::~ACE_Refcounted_Recyclable_Handler_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Refcounted_Recyclable_Handler_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - // Check that the purge_percent is non-zero. - if (purge_percent == 0) - return 0; - - // Get the number of entries in the container which can be considered for purging. - size_t available_entries = container.current_size () - this->marked_as_closed_entries_; - - // Also whether the number of entries in the cache zero. - // Oops! then there is no way out but exiting. - if (available_entries <= 0) - return 0; - - // Calculate the no of entries to remove from the cache depending - // upon the . - size_t entries_to_remove = size_t ((double (purge_percent) / 100 * available_entries) + 0.5); - - if (entries_to_remove >= available_entries || - entries_to_remove == 0) - entries_to_remove = available_entries - 1; - - KEY *key_to_remove = 0; - VALUE *value_to_remove = 0; - - for (size_t i = 0; i < entries_to_remove ; ++i) - { - this->minimum (container, - key_to_remove, - value_to_remove); - - // Simply verifying that the key is non-zero. - // This is important for strategies where the minimum - // entry cant be found due to constraints on the type of entry - // to remove. - if (key_to_remove == 0) - return 0; - - if (this->cleanup_strategy_->cleanup (container, - key_to_remove, - value_to_remove) == -1) - return -1; - - ++this->marked_as_closed_entries_; - } - - return 0; -} - -template void -ACE_Refcounted_Recyclable_Handler_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - // Starting values. - ITERATOR end = container.end (); - ITERATOR iter = container.begin (); - ATTRIBUTES min = (*iter).int_id_.second (); - key_to_remove = 0; - value_to_remove = 0; - // Found the minimum entry to be purged? - int found = 0; - - // The iterator moves thru the container searching for the entry - // with the lowest ATTRIBUTES. - for (; - iter != end; - ++iter) - { - // If the entry isnt IDLE_AND_PURGABLE continue until you reach - // the first entry which can be purged. This is the minimum with - // which you will compare the rest of the purgable entries. - if ((*iter).ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || - (*iter).ext_id_.recycle_state () == ACE_RECYCLABLE_PURGABLE_BUT_NOT_IDLE) - { - if (found == 0) - { - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - found = 1; - } - else - { - // Ah! an entry with lower ATTTRIBUTES... - if (min > (*iter).int_id_.second ()) - { - min = (*iter).int_id_.second (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - } - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// - -template -ACE_Handler_Caching_Utility::ACE_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Handler_Caching_Utility::~ACE_Handler_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Handler_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - // Check that the purge_percent is non-zero. - if (purge_percent == 0) - return 0; - - // Get the number of entries in the container. - size_t current_map_size = container.current_size (); - - // Also whether the number of entries in the cache is just one! - // Oops! then there is no way out but exiting. So return an error. - if (current_map_size <= 1) - return 0; - - // Calculate the no of entries to remove from the cache depending - // upon the . - size_t entries_to_remove = (purge_percent / 100 * current_map_size) + 0.5; - - KEY *key_to_remove = 0; - VALUE *value_to_remove = 0; - - for (size_t i = 0; i < entries_to_remove ; ++i) - { - this->minimum (container, - key_to_remove, - value_to_remove); - - if (this->cleanup_strategy_->cleanup (container, - key_to_remove, - value_to_remove) == -1) - return -1; - } - - return 0; -} - -template void -ACE_Handler_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - // Starting values. - ITERATOR iter = container.begin (); - ITERATOR end = container.end (); - ATTRIBUTES min = (*iter).int_id_->caching_attributes (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - - // The iterator moves thru the container searching for the entry - // with the lowest ATTRIBUTES. - for (++iter; - iter != end; - ++iter) - { - if (min > (*iter).int_id_->caching_attributes () && - (*iter).int_id_->active () != 1) - { - // Ah! an item with lower ATTTRIBUTES... - min = (*iter).int_id_->caching_attributes (); - key_to_remove = &(*iter).ext_id_; - value_to_remove = &(*iter).int_id_; - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////// - -template -ACE_Null_Caching_Utility::ACE_Null_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy, - int delete_cleanup_strategy) - : cleanup_strategy_ (cleanup_strategy), - delete_cleanup_strategy_ (delete_cleanup_strategy) -{ - if (cleanup_strategy == 0) - { - ACE_NEW (this->cleanup_strategy_, - CLEANUP_STRATEGY); - this->delete_cleanup_strategy_ = 1; - } -} - -template -ACE_Null_Caching_Utility::~ACE_Null_Caching_Utility (void) -{ - if (this->delete_cleanup_strategy_) - delete this->cleanup_strategy_; -} - -template int -ACE_Null_Caching_Utility::clear_cache (CONTAINER &container, - double purge_percent) -{ - ACE_UNUSED_ARG (container); - ACE_UNUSED_ARG (purge_percent); - - return 0; -} - -template void -ACE_Null_Caching_Utility::minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove) -{ - ACE_UNUSED_ARG (container); - ACE_UNUSED_ARG (key_to_remove); - ACE_UNUSED_ARG (value_to_remove); -} - -#endif /* CACHING_UTILITY_T_C */ diff --git a/ace/Caching_Utility_T.h b/ace/Caching_Utility_T.h deleted file mode 100644 index 0d50b88fd22..00000000000 --- a/ace/Caching_Utility_T.h +++ /dev/null @@ -1,313 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Caching_Utility_T.h -// -// = AUTHOR -// Kirthika Parameswaran -// -// ============================================================================ - -#ifndef CACHING_UTILITY_H -#define CACHING_UTILITY_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Cleanup_Strategies_T.h" - -// For linkers that cant grok long names. -#define ACE_Pair_Caching_Utility APUTIL - -template -class ACE_Pair_Caching_Utility -{ - // = TITLE - // Defines a helper class for the Caching Strategies. - // - // = DESCRIPTION - // This class defines the methods commonly used by the different - // caching strategies. For instance: method which - // decides and purges the entry from the container. Note: This - // class helps in the caching_strategies using a container - // containing entries of > - // kind. The attributes helps in deciding the entries to be - // purged. The Cleanup_Strategy is the callback class to which the - // entries to be cleaned up will be delegated. -public: - - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY; - - ACE_Pair_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - - // Constructor. - - ~ACE_Pair_Caching_Utility (void); - // Destructor. - - int clear_cache (CONTAINER &container, - double purge_percent); - - // Purge entries from the . The Cleanup_Strategy will do - // the actual job of cleanup once the entries to be cleaned up are - // decided. - -protected: - - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - // Find the entry with minimum caching attributes. - - CLEANUP_STRATEGY *cleanup_strategy_; - // The cleanup strategy which can be used to destroy the entries of - // the container. - - int delete_cleanup_strategy_; - // Whether the cleanup_strategy should be destroyed or not. -}; - -//////////////////////////////////////////////////////////////////////////////// -#define ACE_Recyclable_Handler_Caching_Utility ARHUTIL - -template -class ACE_Recyclable_Handler_Caching_Utility -{ - // = TITLE - // Defines a helper class for the Caching Strategies. - // - // = DESCRIPTION - // This class defines the methods commonly used by the different - // caching strategies. For instance: method which - // decides and purges the entry from the container. Note: This - // class helps in the caching_strategies using a container - // containing entries of kind. The attributes - // helps in deciding the entries to be purged. The - // Cleanup_Strategy is the callback class to which the entries to - // be cleaned up will be delegated. - -public: - - typedef ACE_Recyclable_Handler_Cleanup_Strategy CLEANUP_STRATEGY; - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; - - ACE_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - - // Constructor. - - ~ACE_Recyclable_Handler_Caching_Utility (void); - // Destructor. - - int clear_cache (CONTAINER &container, - double purge_percent); - // Purge entries from the . The Cleanup_Strategy will do - // the actual job of cleanup once the entries to be cleaned up are - // decided. - -protected: - - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - // Find the entry with minimum caching attributes. - - CLEANUP_STRATEGY_BASE *cleanup_strategy_; - // This is the default Cleanup Strategy for this utility. - - int delete_cleanup_strategy_; - // Whether the cleanup_strategy should be destroyed or not. - -}; - -//////////////////////////////////////////////////////////////////////////////////////// -#define ACE_Refcounted_Recyclable_Handler_Caching_Utility ARRHUTIL - -template -class ACE_Refcounted_Recyclable_Handler_Caching_Utility -{ - // = TITLE - // Defines a helper class for the Caching Strategies. - // - // = DESCRIPTION - // This class defines the methods commonly used by the different - // caching strategies. For instance: clear_cache () method which - // decides and purges the entry from the container. Note: This - // class helps in the caching_strategies using a container - // containing entries of kind. The attributes helps in - // deciding the entries to be purged. The Cleanup_Strategy is the - // callback class to which the entries to be cleaned up will be - // delegated. - -public: - - typedef ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy CLEANUP_STRATEGY; - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; - - ACE_Refcounted_Recyclable_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - - // Constructor. - - ~ACE_Refcounted_Recyclable_Handler_Caching_Utility (void); - // Destructor. - - int clear_cache (CONTAINER &container, - double purge_percent); - // Purge entries from the . The Cleanup_Strategy will do - // the actual job of cleanup once the entries to be cleaned up are - // decided. - -protected: - - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - // Find the entry with minimum caching attributes. - - CLEANUP_STRATEGY_BASE *cleanup_strategy_; - // This is the default Cleanup Strategy for this utility. - - int delete_cleanup_strategy_; - // Whether the cleanup_strategy should be destroyed or not. - - size_t marked_as_closed_entries_; - // This figure denotes the number of entries are there in the - // container which have been marked as closed already but might - // not have been unbound from the container. - -}; - -//////////////////////////////////////////////////////////////////////////////////////// - -template -class ACE_Handler_Caching_Utility -{ - // = TITLE - // Defines a helper class for the Caching Strategies. - // - // = DESCRIPTION - // This class defines the methods commonly used by the different - // caching strategies. For instance: method which - // decides and purges the entry from the container. Note: This - // class helps in the caching_strategies using a container - // containing entries of kind where the HANDLER - // contains the caching attributes which help in deciding the - // entries to be purged. The Cleanup_Strategy is the callback - // class to which the entries to be cleaned up will be delegated. -public: - - typedef ACE_Handler_Cleanup_Strategy CLEANUP_STRATEGY; - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; - - ACE_Handler_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - // Constructor. - - ~ACE_Handler_Caching_Utility (void); - // Destructor. - - int clear_cache (CONTAINER &container, - double purge_percent); - // Purge entries from the . The Cleanup_Strategy will do - // the actual job of cleanup once the entries to be cleaned up are - // decided. - -protected: - - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - // Find the entry with minimum caching attributes. This is handler - // specific since this utility is to be used very specifically for - // handler who have caching_attributes for server side acched - // connection management. - - CLEANUP_STRATEGY_BASE *cleanup_strategy_; - // The cleanup strategy which can be used to destroy the entries of - // the container. - - int delete_cleanup_strategy_; - // Whether the cleanup_strategy should be destroyed or not. - -}; - -/////////////////////////////////////////////////////////////////////////// -#define ACE_Null_Caching_Utility ANUTIL -template -class ACE_Null_Caching_Utility -{ - // = TITLE - // Defines a dummy helper class for the Caching Strategies. - // - // = DESCRIPTION - // This class defines the methods commonly used by the different - // caching strategies. For instance: method which - // decides and purges the entry from the container. Note: This - // class is be used with the Null_Caching_Strategy. The - // Cleanup_Strategy is the callback class to which the entries to - // be cleaned up will be delegated. -public: - - typedef ACE_Null_Cleanup_Strategy CLEANUP_STRATEGY; - typedef ACE_Cleanup_Strategy CLEANUP_STRATEGY_BASE; - - ACE_Null_Caching_Utility (ACE_Cleanup_Strategy *cleanup_strategy = 0, - int delete_cleanup_strategy = 0); - // Constructor. - - ~ACE_Null_Caching_Utility (void); - // Destructor. - - int clear_cache (CONTAINER &container, - double purge_percent); - // Purge entries from the . The Cleanup_Strategy will do - // the actual job of cleanup once the entries to be cleaned up are - // decided. NOte: Here it is a no-op. - -protected: - - void minimum (CONTAINER &container, - KEY *&key_to_remove, - VALUE *&value_to_remove); - // Find the entry with minimum caching attributes. This is handler - // specific since this utility is to be used very specifically for - // handler who have caching_attributes for server side acched - // connection management.Note: Here it is a no-op. - - CLEANUP_STRATEGY_BASE *cleanup_strategy_; - // The cleanup strategy which can be used to destroy the entries of - // the container. - - int delete_cleanup_strategy_; - // Whether the cleanup_strategy should be destroyed or not. -}; - -/////////////////////////////////////////////////////////////////////////// - -#if defined (__ACE_INLINE__) -#include "ace/Caching_Utility_T.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Caching_Utility_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Caching_Utility_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* CACHING_UTILITY_H */ diff --git a/ace/Caching_Utility_T.i b/ace/Caching_Utility_T.i deleted file mode 100644 index acecbfb986d..00000000000 --- a/ace/Caching_Utility_T.i +++ /dev/null @@ -1,2 +0,0 @@ -/* -*-C++-*- */ -// $Id$ diff --git a/ace/Capabilities.cpp b/ace/Capabilities.cpp deleted file mode 100644 index 4a056e07940..00000000000 --- a/ace/Capabilities.cpp +++ /dev/null @@ -1,365 +0,0 @@ -// $Id$ - -#include "ace/Map_Manager.h" -#include "ace/Capabilities.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Capabilities.i" -#endif /* !__ACE_INLINE__ */ - -#define ACE_ESC ((ACE_TCHAR)0x1b) - -ACE_CapEntry::~ACE_CapEntry (void) -{ -} - -ACE_Capabilities::ACE_Capabilities (void) -{ -} - -ACE_Capabilities::~ACE_Capabilities (void) -{ - this->resetcaps (); -} - -const ACE_TCHAR * -ACE_Capabilities::parse (const ACE_TCHAR *buf, ACE_TString &cap) -{ - while (*buf != ACE_TEXT ('\0') && *buf != ACE_TEXT (',')) - { - if (*buf == ACE_TEXT ('\\')) - { - buf++; - if (*buf == ACE_TEXT ('E') || *buf == ACE_TEXT ('e')) - { - cap += ACE_ESC; - buf++; - continue; - } - else if (*buf == ACE_TEXT ('r')) - { - cap += ACE_TEXT ('\r'); - buf++; - continue; - } - else if (*buf == ACE_TEXT ('n')) - { - cap += ACE_TEXT ('\n'); - buf++; - continue; - } - else if (*buf == ACE_TEXT ('t')) - { - cap += ACE_TEXT ('\t'); - buf++; - continue; - } - else if (*buf == ACE_TEXT ('\\')) - { - cap += *buf++; - continue; - } - if (isdigit(*buf)) - { - // @@ UNICODE Does this work with unicode? - int oc = 0; - for (int i = 0; - i < 3 && *buf && isdigit (*buf); - i++) - oc = oc * 8 + (*buf++ - ACE_TEXT ('0')); - - cap += (ACE_TCHAR) oc; - continue; - } - } - cap += *buf++; - } - return buf; -} - -const ACE_TCHAR * -ACE_Capabilities::parse (const ACE_TCHAR *buf, int &cap) -{ - int n = 0; - - while (*buf && isdigit (*buf)) - n = n * 10 + (*buf++ - ACE_TEXT ('0')); - - cap = n; - - return buf; -} - -void -ACE_Capabilities::resetcaps (void) -{ - for (ACE_Hash_Map_Iterator iter (caps_); - !iter.done (); - iter.advance ()) - { - ACE_Hash_Map_Entry *entry; - iter.next (entry); - delete entry->int_id_; - } - - caps_.close (); - caps_.open (); -} - -int -ACE_Capabilities::fillent (const ACE_TCHAR *buf) -{ - this->resetcaps (); - while (*buf) - { - ACE_TString s; - int n; - ACE_TString name; - ACE_CapEntry *ce; - - // Skip blanks - while (*buf && isspace(*buf)) buf++; - // If we get end of line return - - if (*buf == ACE_TEXT ('\0')) - break; - - if (*buf == ACE_TEXT ('#')) - { - while (*buf && *buf != ACE_TEXT ('\n')) - buf++; - if (*buf == ACE_TEXT ('\n')) - buf++; - continue; - } - while(*buf && *buf != ACE_TEXT ('=') - && *buf!= ACE_TEXT ('#') - && *buf != ACE_TEXT (',')) - name += *buf++; - - // If name is null. - switch (*buf) - { - case ACE_TEXT ('='): - // String property - buf = this->parse (buf + 1, s); - ACE_NEW_RETURN (ce, - ACE_StringCapEntry (s), - -1); - if (caps_.bind (name, ce) == -1) - { - delete ce; - return -1; - } - break; - case ACE_TEXT ('#'): - // Integer property - buf = this->parse (buf + 1, n); - ACE_NEW_RETURN (ce, - ACE_IntCapEntry (n), - -1); - if (caps_.bind (name, ce) == -1) - { - delete ce; - return -1; - } - break; - case ACE_TEXT (','): - // Boolean - ACE_NEW_RETURN (ce, - ACE_BoolCapEntry (1), - -1); - if (caps_.bind (name, ce) == -1) - { - delete ce; - return -1; - } - break; - default: - return 0; - } - - if (*buf++ != ACE_TEXT (',')) - return -1; - } - - return 0; -} - -int -ACE_Capabilities::is_entry (const ACE_TCHAR *name, const ACE_TCHAR *line) -{ - for (;;) - { - // Skip blanks or irrelevant characters - while (*line && isspace(*line)) - line++; - - // End of line reached - if (*line == ACE_TEXT ('\0')) - break; - - // Build the entry name - ACE_TString nextname; - while (*line && *line != ACE_TEXT ('|') && *line != ACE_TEXT (',')) - nextname += *line++; - - // We have found the required entry? - if (ACE_OS::strcmp (nextname.c_str (), name) == 0) - return 1; - - // Skip puntuaction char if neccesary. - if (*line == ACE_TEXT ('|') || *line == ACE_TEXT (',')) - line++; - else - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Invalid entry\n"))); - break; - } - } - return 0; -} - -int -ACE_Capabilities::getline (FILE *fp, ACE_TString &line) -{ - int ch; - - line.set (0, 0); - - while ((ch = fgetc (fp)) != EOF && ch != ACE_TEXT ('\n')) - line += (ACE_TCHAR) ch; - - if (ch == EOF && line.length () == 0) - return -1; - else - return 0; -} - -int -ACE_Capabilities::getval (const ACE_TCHAR *keyname, ACE_TString &val) -{ - ACE_CapEntry* cap; - if (caps_.find (keyname, cap) == -1) - return -1; - - ACE_StringCapEntry *scap = - ACE_dynamic_cast (ACE_StringCapEntry *, cap); - if (scap == 0) - return -1; - - val = scap->getval (); - return 0; -} - -int -ACE_Capabilities::getval (const ACE_TCHAR *keyname, int &val) -{ - ACE_CapEntry *cap; - if (caps_.find (keyname, cap) == -1) - return -1; - - ACE_IntCapEntry *icap = - ACE_dynamic_cast (ACE_IntCapEntry *, cap); - if (icap != 0) - { - val = icap->getval (); - return 0; - } - - ACE_BoolCapEntry *bcap = - ACE_dynamic_cast (ACE_BoolCapEntry *, cap); - - if (bcap == 0) - return -1; - - val = bcap->getval (); - return 0; -} - -static int -is_empty (const ACE_TCHAR *line) -{ - while (*line && isspace (*line)) - line++; - - return *line == ACE_TEXT ('\0') || *line == ACE_TEXT ('#'); -} - -static int -is_line (const ACE_TCHAR *line) -{ - while (*line && isspace (*line)) - line++; - - return *line != ACE_TEXT ('\0'); -} - -int -ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name) -{ - FILE *fp = ACE_OS::fopen (fname, ACE_TEXT ("r")); - - if (fp == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Can't open %s file\n"), - fname), - -1); - - int done; - ACE_TString line; - - while (!(done = (this->getline (fp, line) == -1)) - && is_empty (line.c_str ())) - continue; - - while (!done) - { - ACE_TString newline; - ACE_TString description; - - while (!(done = (this->getline (fp, newline) == -1))) - if (is_line (newline.c_str ())) - description += newline; - else - break; - - if (this->is_entry (name, line.c_str())) - { - ACE_OS::fclose (fp); - return this->fillent (description.c_str ()); - } - - line = newline; - while (!done && is_empty (line.c_str ())) - done = this->getline (fp, line) == -1; - } - - ACE_OS::fclose (fp); - return -1; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Iterator; -template class ACE_Hash_Map_Reverse_Iterator; -template class ACE_Hash_Map_Entry; -template class ACE_Hash_Map_Manager_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash; -template class ACE_Equal_To; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Hash_Map_Manager -#pragma instantiate ACE_Hash_Map_Iterator -#pragma instantiate ACE_Hash_Map_Reverse_Iterator -#pragma instantiate ACE_Hash_Map_Entry -#pragma instantiate ACE_Hash_Map_Manager_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash -#pragma instantiate ACE_Equal_To -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/Capabilities.h b/ace/Capabilities.h deleted file mode 100644 index 53393da6e19..00000000000 --- a/ace/Capabilities.h +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Capabilities.h -// -// = AUTHOR -// Arturo Montes -// -// ============================================================================ - -#ifndef ACE_CAPABILITIES_H -#define ACE_CAPABILITIES_H -#include "ace/pre.h" - -#include "ace/OS.h" -#include "ace/Synch.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/Containers.h" -#include "ace/SString.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_CapEntry -{ - // = TITLE - // This class is the base class for all ACE Capabilities entry - // subclasses. - // - // = DESCRIPTION - // This class is not instantiable and does not provide accessors - // or methods. If you want to add a new kind of attribute you - // subclasses of this class and dynamic cast to proper subclass. -public: - virtual ~ACE_CapEntry (void); - -protected: - enum - { - ACE_INTCAP = 0, - ACE_STRINGCAP = 1, - ACE_BOOLCAP = 2 - }; - - ACE_CapEntry (int captype); - - int captype_; -}; - -class ACE_Export ACE_IntCapEntry : public ACE_CapEntry -{ - // = TITLE - // This class implement the ACE Integer Capability subclass. - // - // = DESCRIPTION - // This is a container class for ACE Capabilities integer container - // values. -public: - ACE_IntCapEntry (int val); - int getval (void) const; - -protected: - int val_; -}; - -class ACE_Export ACE_StringCapEntry : public ACE_CapEntry -{ - // = TITLE - // This class implement the ACE String Capability subclass. - // - // = DESCRIPTION - // This is a container class for ACE Capabilities String container - // values. -public: - ACE_StringCapEntry (const ACE_TString &val); - ACE_TString getval (void) const; - -protected: - ACE_TString val_; -}; - -class ACE_Export ACE_BoolCapEntry : public ACE_CapEntry -{ - // = TITLE - // This class implement the ACE Bool Capability subclass. - // - // = DESCRIPTION - // This is a container class for ACE Capabilities bool container - // values. -public: - ACE_BoolCapEntry (int val); - int getval (void) const; - -protected: - int val_; -}; - -class ACE_Export ACE_Capabilities -{ - // = TITLE - // This class implement the ACE Capabilities. - // - // = DESCRIPTION - // This is a container class for ACE Capabilities - // values. Currently exist three different capability values: - // (integer), (bool) and - // (String). An is a - // unordered set of pair = (, *). Where - // the first component is the name of capability and the second - // component is a pointer to the capability value container. A - // is a container for , the - // has a name in the file, as a termcap file. -public: - ACE_Capabilities (void); - // The Constructor - - ~ACE_Capabilities(void); - // The Destructor - -public: - int getval (const ACE_TCHAR *ent, ACE_TString &val); - // Get a string entry. - - int getval (const ACE_TCHAR *ent, int &val); - // Get an integer entry. - - int getent (const ACE_TCHAR *fname, const ACE_TCHAR *name); - // Get the ACE_Capabilities name from FILE fname and load the - // associated capabitily entries in map. - -protected: - // Parse an integer property - const ACE_TCHAR *parse (const ACE_TCHAR *buf, int &cap); - // Parse a string property - - const ACE_TCHAR *parse (const ACE_TCHAR *buf, ACE_TString &cap); - // Fill the ACE_Capabilities with description in ent. - - int fillent(const ACE_TCHAR *ent); - // Parse a cap entry - - int parseent (const ACE_TCHAR *name, ACE_TCHAR *line); - // Get a line from FILE input stream - - int getline (FILE* fp, - ACE_TString &line); - // Is a valid entry - - int is_entry (const ACE_TCHAR *name, const ACE_TCHAR *line); - // Reset the set of capabilities - - void resetcaps (void); - // Atributes. - -private: - ACE_Hash_Map_Manager caps_; - // This is the set of ACE_CapEntry. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Capabilities.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* __ACE_CAPABILITIES_H__ */ diff --git a/ace/Capabilities.i b/ace/Capabilities.i deleted file mode 100644 index d34d0e08862..00000000000 --- a/ace/Capabilities.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_CapEntry::ACE_CapEntry (int captype) - : captype_ (captype) -{ -} - -ACE_INLINE -ACE_IntCapEntry::ACE_IntCapEntry (int val) - : ACE_CapEntry (ACE_INTCAP), - val_ (val) -{ -} - -ACE_INLINE int -ACE_IntCapEntry::getval (void) const -{ - return val_; -} - -ACE_INLINE -ACE_StringCapEntry::ACE_StringCapEntry (const ACE_TString &val) - : ACE_CapEntry (ACE_STRINGCAP), - val_(val) -{ -} - -ACE_INLINE ACE_TString -ACE_StringCapEntry::getval (void) const -{ - return val_; -} - -ACE_INLINE -ACE_BoolCapEntry::ACE_BoolCapEntry (int val) - : ACE_CapEntry (ACE_BOOLCAP), - val_(val) -{ -} - -ACE_INLINE int -ACE_BoolCapEntry::getval (void) const -{ - return val_; -} diff --git a/ace/Cleanup_Strategies_T.cpp b/ace/Cleanup_Strategies_T.cpp deleted file mode 100644 index 6158bdac2d9..00000000000 --- a/ace/Cleanup_Strategies_T.cpp +++ /dev/null @@ -1,93 +0,0 @@ -//$Id$ - -#ifndef CLEANUP_STRATEGIES_T_C -#define CLEANUP_STRATEGIES_T_C - -#include "ace/Cleanup_Strategies_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/Cleanup_Strategies_T.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -ACE_RCSID(ace, Cleanup_Strategies_T, "$Id$") - -//////////////////////////////////////////////////////////////////////////// - -template int -ACE_Cleanup_Strategy::cleanup (CONTAINER &container, - KEY *key, - VALUE *value) -{ - ACE_UNUSED_ARG (value); - - return container.unbind (*key); -} - -//////////////////////////////////////////////////////////////////////////// - -template int -ACE_Recyclable_Handler_Cleanup_Strategy::cleanup (CONTAINER &container, - KEY *key, - VALUE *) -{ - VALUE value; - - if (container.unbind (*key, value) == -1) - return -1; - - value.first ()->recycler (0, 0); - - value.first ()->close (); - - return 0; -} - -///////////////////////////////////////////////////////////////////////////// - -template int -ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy::cleanup (CONTAINER &, - KEY *, - VALUE *value) -{ - return value->first ()->handle_close_i (); -} - -//////////////////////////////////////////////////////////////////////////// - -template int -ACE_Handler_Cleanup_Strategy::cleanup (CONTAINER &container, - KEY *key, - VALUE *value) -{ - // Remove the item from cache only if the handler isnt in use. - if ((*value)->active () == 0) - { - (*value)->close (); - - if (container.unbind (*key) == -1) - return -1; - - } - - return 0; -} - -//////////////////////////////////////////////////////////////////////////// - -template int -ACE_Null_Cleanup_Strategy::cleanup (CONTAINER &container, - KEY *key, - VALUE *value) -{ - ACE_UNUSED_ARG (container); - ACE_UNUSED_ARG (key); - ACE_UNUSED_ARG (value); - - return 0; -} - -#endif /* CLEANUP_STRATEGIES_T_C */ diff --git a/ace/Cleanup_Strategies_T.h b/ace/Cleanup_Strategies_T.h deleted file mode 100644 index e7353fd7e6f..00000000000 --- a/ace/Cleanup_Strategies_T.h +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Cleanup_Strategies_T.h -// -// = AUTHOR -// Kirthika Parameswaran -// -// ============================================================================ - -#ifndef CLEANUP_STRATEGIES_H -#define CLEANUP_STRATEGIES_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#define ACE_LACKS_PRAGMA_ONCE -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// For linkers that cant grok long names. -#define ACE_Cleanup_Strategy ACLE - -template -class ACE_Cleanup_Strategy -{ - // = TITLE - // Defines a default strategy to be followed for cleaning up - // entries from a map which is the container. - // - // = DESCRIPTION - // By default the entry to be cleaned up is removed from the - // container. - -public: - - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); - // The method which will do the cleanup of the entry in the container. -}; - -////////////////////////////////////////////////////////////////////// -#define ACE_Recyclable_Handler_Cleanup_Strategy ARHCLE - -template -class ACE_Recyclable_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy -{ - // = TITLE - // Defines a strategy to be followed for cleaning up - // entries which are svc_handlers from a container. - // - // = DESCRIPTION - // The entry to be cleaned up is removed from the container. - // Here, since we are dealing with svc_handlers specifically, we - // perform a couple of extra operations. Note: To be used when - // the handler is recyclable. - -public: - - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); - // The method which will do the cleanup of the entry in the container. -}; - -////////////////////////////////////////////////////////////////////// -#define ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy ARRHCLE - -template -class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy -{ - // = TITLE - // Defines a strategy to be followed for cleaning up - // entries which are svc_handlers from a container. - // - // = DESCRIPTION - // The entry to be cleaned up is removed from the container. - // Here, since we are dealing with recyclable svc_handlers with - // addresses which are refcountable specifically, we perform a - // couple of extra operations and do so without any locking. - -public: - - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); - // The method which will do the cleanup of the entry in the container. -}; - -////////////////////////////////////////////////////////////////////// - -template -class ACE_Handler_Cleanup_Strategy : public ACE_Cleanup_Strategy -{ - // = TITLE - // Defines a strategy to be followed for cleaning up - // entries which are svc_handlers from a container. - // - // = DESCRIPTION - // The entry to be cleaned up is removed from the container. - // Here, since we are dealing with svc_handlers specifically, we - // perform a couple of extra operations. Note: This cleanup strategy - // should be used in the case when the handler has the caching - // attributes. - -public: - - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); - // The method which will do the cleanup of the entry in the container. -}; - -////////////////////////////////////////////////////////////////////// -#define ACE_Null_Cleanup_Strategy ANCLE - -template -class ACE_Null_Cleanup_Strategy : public ACE_Cleanup_Strategy -{ - // = TITLE - // Defines a do-nothing implementation of the cleanup strategy. - // - // = DESCRIPTION - // This class simply does nothing at all! Can be used to nullify - // the effect of the Cleanup Strategy. - -public: - - virtual int cleanup (CONTAINER &container, KEY *key, VALUE *value); - // The dummy cleanup method. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Cleanup_Strategies_T.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Cleanup_Strategies_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Cleanup_Strategies_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* CLEANUP_STRATEGIES_H */ diff --git a/ace/Cleanup_Strategies_T.i b/ace/Cleanup_Strategies_T.i deleted file mode 100644 index d2600eef20a..00000000000 --- a/ace/Cleanup_Strategies_T.i +++ /dev/null @@ -1,2 +0,0 @@ -/* -*-C++-*- */ -//$Id$ diff --git a/ace/Codeset_IBM1047.cpp b/ace/Codeset_IBM1047.cpp deleted file mode 100644 index 45ae7932665..00000000000 --- a/ace/Codeset_IBM1047.cpp +++ /dev/null @@ -1,284 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Codeset_IBM1047.cpp -// -// = DESCRIPTION -// Defines the arrays required to convert between ISO8859 (aka -// Latin/1) and IBM1047 (aka EBCDIC). -// -// = AUTHOR -// Jim Rogers (jrogers@viasoft.com) -// -// ============================================================================ - -#include "ace/Codeset_IBM1047.h" - -#if defined(ACE_MVS) - -ACE_RCSID(ace, Codeset_IBM1047, "$Id$") - -// **************************************************************** - -ACE_IBM1047_ISO8859::ACE_IBM1047_ISO8859 (void) -{ -} - -ACE_IBM1047_ISO8859::~ACE_IBM1047_ISO8859 (void) -{ -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::read_char (ACE_InputCDR &in, - ACE_CDR::Char &x) -{ - if (this->read_1 (in, ACE_reinterpret_cast (ACE_CDR::Octet*, &x))) - { - x = ACE_to_IBM1047[x]; - return 1; - } - return 0; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::read_string (ACE_InputCDR& in, - ACE_CDR::Char *& x) -{ - ACE_CDR::ULong len; - - in.read_ulong (len); - - if (len > 0) - { - ACE_NEW_RETURN (x, - ACE_CDR::Char[len], - 0); - - if (this->read_char_array (in, x, len)) - return 1; - - delete [] x; - } - - x = 0; - return 0; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::read_char_array (ACE_InputCDR& in, - ACE_CDR::Char* x, - ACE_CDR::ULong len) -{ - if (this->read_array (in, - x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - len)) - { - for (ACE_CDR::ULong i = 0; i != len; ++i) - x[i] = ACE_to_IBM1047[x[i]]; - - return 1; - } - - return 0; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::write_char (ACE_OutputCDR& out, - ACE_CDR::Char x) -{ - return this->write_1 (out, - ACE_reinterpret_cast (const ACE_CDR::Octet*, - &ACE_from_IBM1047[x])); -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::write_string (ACE_OutputCDR& out, - ACE_CDR::ULong len, - const ACE_CDR::Char* x) -{ - if (out.write_ulong (len + 1)) - return this->write_char_array (out, x, len + 1); - return 0; -} - -ACE_CDR::Boolean -ACE_IBM1047_ISO8859::write_char_array (ACE_OutputCDR& out, - const ACE_CDR::Char* x, - ACE_CDR::ULong len) -{ - char *buf; - if (this->adjust (out, len, 1, buf) == 0) - { - ACE_OS::memcpy (buf, x, len); - - for (ACE_CDR::ULong i = 0; i != len; ++i) - buf[i] = ACE_from_IBM1047[buf[i]]; - - return 1; - } - - this->good_bit(out, 0); - return 0; -} - -// **************************************************************** - -ACE_ISO8859_IBM1047::ACE_ISO8859_IBM1047 (void) -{ -} - -ACE_ISO8859_IBM1047::~ACE_ISO8859_IBM1047 (void) -{ -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::read_char (ACE_InputCDR& in, - ACE_CDR::Char& x) -{ - if (this->read_1 (in, ACE_reinterpret_cast (ACE_CDR::Octet*, &x))) - { - x = ACE_from_IBM1047[x]; - return 1; - } - return 0; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::read_string (ACE_InputCDR &in, - ACE_CDR::Char *&x) -{ - ACE_CDR::ULong len; - - in.read_ulong (len); - - if (len > 0) - { - ACE_NEW_RETURN (x, - ACE_CDR::Char[len], - 0); - - if (this->read_char_array (in, x, len)) - return 1; - - delete [] x; - } - - x = 0; - return 0; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::read_char_array (ACE_InputCDR &in, - ACE_CDR::Char *x, - ACE_CDR::ULong len) -{ - if (this->read_array (in, - x, - ACE_CDR::OCTET_SIZE, - ACE_CDR::OCTET_ALIGN, - len)) - { - for (ACE_CDR::ULong i = 0; i != len; ++i) - x[i] = ACE_from_IBM1047[x[i]]; - - return 1; - } - - return 0; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::write_char (ACE_OutputCDR &out, - ACE_CDR::Char x) -{ - return this->write_1 (out, - ACE_reinterpret_cast (const ACE_CDR::Octet *, - &ACE_to_IBM1047[x])); -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::write_string (ACE_OutputCDR& out, - ACE_CDR::ULong len, - const ACE_CDR::Char* x) -{ - if (out.write_ulong (len + 1)) - return this->write_char_array (out, x, len + 1); - else - return 0; -} - -ACE_CDR::Boolean -ACE_ISO8859_IBM1047::write_char_array (ACE_OutputCDR &out, - const ACE_CDR::Char *x, - ACE_CDR::ULong len) -{ - char *buf; - - if (this->adjust (out, len, 1, buf) == 0) - { - ACE_OS::memcpy (buf, x, len); - - for (ACE_CDR::ULong i = 0; i != len; ++i) - buf[i] = ACE_to_IBM1047[buf[i]]; - - return 1; - } - - this->good_bit (out, 0); - return 0; -} - -// **************************************************************** - -char ACE_to_IBM1047[257] = -{ - "\x00\x01\x02\x03\x37\x2D\x2E\x2F\x16\x05\x25\x0B\x0C\x0D\x0E\x0F" // 00-0F - "\x10\x11\x12\x13\x3C\x3D\x32\x26\x18\x19\x3F\x27\x22\x1D\x35\x1F" // 10-1F - "\x40\x5A\x7F\x7B\x5B\x6C\x50\x7D\x4D\x5D\x5C\x4E\x6B\x60\x4B\x61" // 20-2F - "\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\x7A\x5E\x4C\x7E\x6E\x6F" // 30-3F - "\x7C\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xD1\xD2\xD3\xD4\xD5\xD6" // 40-4F - "\xD7\xD8\xD9\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xAD\xE0\xBD\x5F\x6D" // 50-5F - "\x79\x81\x82\x83\x84\x85\x86\x87\x88\x89\x91\x92\x93\x94\x95\x96" // 60-6F - "\x97\x98\x99\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xC0\x4F\xD0\xA1\x07" // 70-7F - "\x43\x20\x21\x1C\x23\xEB\x24\x9B\x71\x28\x38\x49\x90\xBA\xEC\xDF" // 80-8F - "\x45\x29\x2A\x9D\x72\x2B\x8A\x9A\x67\x56\x64\x4A\x53\x68\x59\x46" // 90-9F - "\xEA\xDA\x2C\xDE\x8B\x55\x41\xFE\x58\x51\x52\x48\x69\xDB\x8E\x8D" // A0-AF - "\x73\x74\x75\xFA\x15\xB0\xB1\xB3\xB4\xB5\x6A\xB7\xB8\xB9\xCC\xBC" // B0-BF - "\xAB\x3E\x3B\x0A\xBF\x8F\x3A\x14\xA0\x17\xCB\xCA\x1A\x1B\x9C\x04" // C0-CF - "\x34\xEF\x1E\x06\x08\x09\x77\x70\xBE\xBB\xAC\x54\x63\x65\x66\x62" // D0-DF - "\x30\x42\x47\x57\xEE\x33\xB6\xE1\xCD\xED\x36\x44\xCE\xCF\x31\xAA" // E0-EF - "\xFC\x9E\xAE\x8C\xDD\xDC\x39\xFB\x80\xAF\xFD\x78\x76\xB2\x9F\xFF" // F0-FF -}; - -char ACE_from_IBM1047[257] = -{ - "\x00\x01\x02\x03\xCF\x09\xD3\x7F\xD4\xD5\xC3\x0B\x0C\x0D\x0E\x0F" // 00-0F - "\x10\x11\x12\x13\xC7\xB4\x08\xC9\x18\x19\xCC\xCD\x83\x1D\xD2\x1F" // 10-1F - "\x81\x82\x1C\x84\x86\x0A\x17\x1B\x89\x91\x92\x95\xA2\x05\x06\x07" // 20-2F - "\x20\xEE\x16\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\xC1\x1A" // 30-3F - "\x20\xA6\xE1\x80\xEB\x90\x9F\xE2\xAB\x8B\x9B\x2E\x3C\x28\x2B\x7C" // 40-4F - "\x26\xA9\xAA\x9C\xDB\xA5\x99\xE3\xA8\x9E\x21\x24\x2A\x29\x3B\x5E" // 50-5F - "\x2D\x2F\xDF\xDC\x9A\xDD\xDE\x98\x9D\xAC\xBA\x2C\x25\x5F\x3E\x3F" // 60-6F - "\xD7\x88\x94\xB0\xB1\xB2\xFC\xD6\xFB\x60\x3A\x23\x40\x27\x3D\x22" // 70-7F - "\xF8\x61\x62\x63\x64\x65\x66\x67\x68\x69\x96\xA4\xF3\xAF\xAE\xC5" // 80-8F - "\x8C\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x97\x87\xCE\x93\xF1\xFE" // 90-9F - "\xC8\x7E\x73\x74\x75\x76\x77\x78\x79\x7A\xEF\xC0\xDA\x5B\xF2\xF9" // A0-AF - "\xB5\xB6\xFD\xB7\xB8\xB9\xE6\xBB\xBC\xBD\x8D\xD9\xBF\x5D\xD8\xC4" // B0-BF - "\x7B\x41\x42\x43\x44\x45\x46\x47\x48\x49\xCB\xCA\xBE\xE8\xEC\xED" // C0-CF - "\x7D\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\xA1\xAD\xF5\xF4\xA3\x8F" // D0-DF - "\x5C\xE7\x53\x54\x55\x56\x57\x58\x59\x5A\xA0\x85\x8E\xE9\xE4\xD1" // E0-EF - "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\xB3\xF7\xF0\xFA\xA7\xFF" // F0-FF -}; - -#elif defined (__HP_aCC) -// Make aC++ stop complaining about an empty translation unit -static int shut_up_aCC = 0; -#endif /* ACE_MVS */ diff --git a/ace/Codeset_IBM1047.h b/ace/Codeset_IBM1047.h deleted file mode 100644 index abb40517eb1..00000000000 --- a/ace/Codeset_IBM1047.h +++ /dev/null @@ -1,115 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Codeset_IBM1047.cpp -// -// = DESCRIPTION -// Declares the arrays required to convert between ISO8859 (aka -// Latin/1) and IBM1047 (aka EBCDIC). -// -// = AUTHOR -// Jim Rogers (jrogers@viasoft.com) -// -// ============================================================================ - -#ifndef ACE_CODESET_IMB1047_H -#define ACE_CODESET_IMB1047_H -#include "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined(ACE_MVS) - -#include "ace/CDR_Stream.h" - -extern ACE_Export char ACE_to_IBM1047[257]; -extern ACE_Export char ACE_from_IBM1047[257]; - -// **************************************************************** - -class ACE_Export ACE_IBM1047_ISO8859 : public ACE_Char_Codeset_Translator -{ - // = TITLE - // Codeset translation specialization. - // - // = DESCRIPTION - // This class performs the codeset translation: - // - // Native: IBM_1047 (i.e. EBCDIC) - // Stream: ISO-8859 (i.e. Latin/1) - // -public: - ACE_IBM1047_ISO8859 (void); - // A do nothing constructor. - - virtual ~ACE_IBM1047_ISO8859 (void); - // Virtual destruction - - // = Documented in $ACE_ROOT/ace/CDR_Stream.h - virtual ACE_CDR::Boolean read_char (ACE_InputCDR &, - ACE_CDR::Char &); - virtual ACE_CDR::Boolean read_string (ACE_InputCDR &, - ACE_CDR::Char *&); - virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR &, - ACE_CDR::Char *, - ACE_CDR::ULong); - virtual ACE_CDR::Boolean write_char (ACE_OutputCDR &, - ACE_CDR::Char); - virtual ACE_CDR::Boolean write_string (ACE_OutputCDR &, - ACE_CDR::ULong, - const ACE_CDR::Char *); - virtual ACE_CDR::Boolean write_char_array (ACE_OutputCDR &, - const ACE_CDR::Char *, - ACE_CDR::ULong); -}; - -class ACE_Export ACE_ISO8859_IBM1047 : public ACE_Char_Codeset_Translator -{ - // = TITLE - // Codeset translation specialization. - // - // = DESCRIPTION - // This class performs the codeset translation: - // - // Native: ISO-8859 (i.e. Latin/1) - // Stream: IBM-1047 (i.e. EBCDIC) - // -public: - ACE_ISO8859_IBM1047 (void); - // A do nothing constructor. - - virtual ~ACE_ISO8859_IBM1047 (void); - // Virtual destruction - - // = Documented in $ACE_ROOT/ace/CDR_Stream.h - virtual ACE_CDR::Boolean read_char (ACE_InputCDR &, - ACE_CDR::Char &); - virtual ACE_CDR::Boolean read_string (ACE_InputCDR &, - ACE_CDR::Char *&); - virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR &, - ACE_CDR::Char *, - ACE_CDR::ULong); - virtual ACE_CDR::Boolean write_char (ACE_OutputCDR &, - ACE_CDR::Char); - virtual ACE_CDR::Boolean write_string (ACE_OutputCDR &, - ACE_CDR::ULong, - const ACE_CDR::Char *); - virtual ACE_CDR::Boolean write_char_array (ACE_OutputCDR &, - const ACE_CDR::Char *, - ACE_CDR::ULong); -}; - -#endif /* ACE_MVS */ - -#include "ace/post.h" -#endif /* ACE_CODESET_IMB1047_H */ diff --git a/ace/Configuration.cpp b/ace/Configuration.cpp deleted file mode 100644 index 116906caace..00000000000 --- a/ace/Configuration.cpp +++ /dev/null @@ -1,1832 +0,0 @@ -// $Id$ -#include "ace/Configuration.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Configuration.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -#if defined (ACE_HAS_THREADS) -// ACE_SYNCH_MUTEX should not be used in the template instantiations -// because the resulting template instantiation for the -// single-threaded case already exists in ACE. -template class ACE_Allocator_Adapter >; -template class ACE_Malloc; -template class ACE_Malloc_T; -#endif /* ACE_HAS_THREADS */ -template class ACE_Hash_Map_Entry; -template class ACE_Hash_Map_Entry; -template class ACE_Hash_Map_Entry; -template class ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex>; - - -// Added to fix problems in SunOS CC5.0 -template class ACE_Hash_Map_Reverse_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Equal_To; -template class ACE_Hash_Map_Reverse_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash; - -template class ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_With_Allocator; -template class ACE_Hash_Map_With_Allocator; -template class ACE_Hash_Map_With_Allocator; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#if defined (ACE_HAS_THREADS) -// ACE_SYNCH_MUTEX should not be used in the template instantiations -// because the resulting template instantiation for the -// single-threaded case already exists in ACE. -#pragma instantiate ACE_Allocator_Adapter > -#pragma instantiate ACE_Malloc -#pragma instantiate ACE_Malloc_T -#endif /* ACE_HAS_THREADS */ -#pragma instantiate ACE_Hash_Map_Entry -#pragma instantiate ACE_Hash_Map_Entry -#pragma instantiate ACE_Hash_Map_Entry -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex> - -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Equal_To -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash - -#pragma instantiate ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager -#pragma instantiate ACE_Hash_Map_Manager -#pragma instantiate ACE_Hash_Map_Manager -#pragma instantiate ACE_Hash_Map_With_Allocator -#pragma instantiate ACE_Hash_Map_With_Allocator -#pragma instantiate ACE_Hash_Map_With_Allocator - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - -ACE_Section_Key_Internal::ACE_Section_Key_Internal (void) - : ref_count_ (0) -{ -} - -ACE_Section_Key_Internal::~ACE_Section_Key_Internal (void) -{ -} - -int -ACE_Section_Key_Internal::add_ref (void) -{ - ++ref_count_; - return 0; -} - -int -ACE_Section_Key_Internal::dec_ref (void) -{ - if (!--ref_count_) - delete this; - return 0; -} - -ACE_Configuration_Section_Key::ACE_Configuration_Section_Key (void) - : key_ (0) -{ -} - -ACE_Configuration_Section_Key::~ACE_Configuration_Section_Key (void) -{ - if (key_) - key_->dec_ref (); -} - -ACE_Configuration_Section_Key::ACE_Configuration_Section_Key (ACE_Section_Key_Internal* key) - : key_ (key) -{ - if (key_) - key_->add_ref (); -} - -ACE_Configuration_Section_Key::ACE_Configuration_Section_Key (const ACE_Configuration_Section_Key& rhs) - : key_ (rhs.key_) -{ - if (key_) - key_->add_ref (); -} - -ACE_Configuration_Section_Key& -ACE_Configuration_Section_Key::operator= (const ACE_Configuration_Section_Key& rhs) -{ - if (this != &rhs) - { - if (key_) - key_->dec_ref (); - - key_ = rhs.key_; - - if (key_) - key_->add_ref (); - } - return *this; -} - -////////////////////////////////////////////////////////////////////////////// - -ACE_Configuration::ACE_Configuration (void) - : root_ () -{ -} - -ACE_Configuration::~ACE_Configuration (void) -{ -} - -ACE_Section_Key_Internal* -ACE_Configuration::get_internal_key (const ACE_Configuration_Section_Key& key) -{ - return key.key_; -} - -int -ACE_Configuration::expand_path (const ACE_Configuration_Section_Key& key, - const ACE_TString& path_in, - ACE_Configuration_Section_Key& key_out, - int create) -{ - const ACE_TCHAR* begin = path_in.fast_rep (); - const ACE_TCHAR* end = 0; - - // Make a copy of key - ACE_Configuration_Section_Key current_section = key; - - // recurse through the path - while (1) - { - // Detmine the begin/ending of the key name - end = ACE_OS::strchr (begin, ACE_TEXT ('\\')); - size_t length = end ? (size_t)(end-begin) : ACE_OS::strlen (begin); - - // Make sure length is not 0 - if (!length) - return -1; - - ACE_TString section (begin, length); - - // Open the section - ACE_Configuration_Section_Key child_section; - if (open_section (current_section, - section.fast_rep (), - create, - child_section)) - return -1; - - current_section = child_section; - - // If end is NULL, we are done, return the result - if (!end) - { - key_out = current_section; - break; - } - begin = end + 1; - } - - return 0; -} - -int -ACE_Configuration::validate_name (const ACE_TCHAR* name) -{ - const ACE_TCHAR* pos = name; - // make sure it doesn't contain any invalid characters - while (*pos) - { - if (ACE_OS::strchr (ACE_TEXT ("\\]["), *pos)) - return -1; - - pos++; - } - - // Make sure its not too long - if (pos - name > 255) - return -2; - - return 0; -} - -int -ACE_Configuration::export_section (const ACE_Configuration_Section_Key& section, - const ACE_TString& path, - FILE* out) -{ - // don't export the root - if (path.length ()) - { - // Write out the section header - ACE_TString header = ACE_TEXT ("["); - header += path; - header += ACE_TEXT ("]"); - header += ACE_TEXT (" \n"); - if (ACE_OS::fputs (header.fast_rep (), out) < 0) - return -1; - - // Write out each value - int index = 0; - ACE_TString name; - VALUETYPE type; - ACE_TString line; - ACE_TCHAR int_value[32]; - ACE_TString string_value; - while (!enumerate_values (section, index, name, type)) - { - line = name + ACE_TEXT ("="); - switch (type) - { - case INTEGER: - { - u_int value; - if (get_integer_value (section, name.fast_rep (), value)) - return -2; - - ACE_OS::sprintf (int_value, ACE_TEXT ("#%d"), value); - line += int_value; - break; - } - case STRING: - { - if (get_string_value (section, - name.fast_rep (), - string_value)) - return -2; - - line += ACE_TEXT ("\""); - line += string_value; - break; - } - case BINARY: - { - // not supported yet - maybe use BASE64 codeing? - break; - } - default: - return -3; - } - - line += ACE_TEXT ("\n"); - if (ACE_OS::fputs (line.fast_rep (), out) < 0) - return -4; - - index++; - } - } - - // Export all sub sections - int index = 0; - ACE_TString name; - ACE_Configuration_Section_Key sub_key; - ACE_TString sub_section; - - while (!enumerate_sections (section, index, name)) - { - ACE_TString sub_section (path); - if (path.length ()) - sub_section += ACE_TEXT ("\\"); - - sub_section += name; - if (open_section (section, name.fast_rep (), 0, sub_key)) - return -5; - - if (export_section (sub_key, sub_section.fast_rep (), out)) - return -6; - - index++; - } - - return 0; -} - -int -ACE_Configuration::export_config (const ACE_TCHAR* filename) -{ - FILE* out = ACE_OS::fopen (filename, ACE_TEXT ("w")); - if (!out) - return -1; - - int result = export_section (root_, ACE_TEXT (""), out); - ACE_OS::fclose (out); - return result; -} - -int -ACE_Configuration::import_config (const ACE_TCHAR* filename) -{ - FILE* in = ACE_OS::fopen (filename, ACE_TEXT ("r")); - if (!in) - return -1; - - // @@ XXX - change this to a dynamic buffer - ACE_TCHAR buffer[4096]; - ACE_Configuration_Section_Key section; - while (ACE_OS::fgets (buffer, 4096, in)) - { - // Check for a comment - if (buffer[0] == ACE_TEXT (';') || buffer[0] == ACE_TEXT ('#')) - continue; - - if (buffer[0] == ACE_TEXT ('[')) - { - // We have a new section here, strip out the section name - int length = ACE_OS::strlen (buffer); - buffer[length - 2] = 0; - - if (expand_path (root_, buffer + 1, section, 1)) - return -3; - - continue; - } - - // assume this is a value, read in the value name - ACE_TCHAR* end = ACE_OS::strchr (buffer, ACE_TEXT ('=')); - if (!end) // no =, not a value so just skip it - continue; - - // null terminate the name - *end = 0; - end++; - // determine the type - if (*end == ACE_TEXT ('\"')) - { - // string type - if (set_string_value (section, buffer, end + 1)) - return -4; - } - else if (*end == ACE_TEXT ('#')) - { - // number type - u_int value = ACE_OS::atoi (end + 1); - if (set_integer_value (section, buffer, value)) - return -4; - } - else - { - // invalid type, ignore - continue; - } - } - - if (ferror (in)) - return -1; - - return 0; -} - -const ACE_Configuration_Section_Key& -ACE_Configuration::root_section (void) -{ - return root_; -} - -////////////////////////////////////////////////////////////////////////////// - -#if defined (WIN32) - -static const int ACE_DEFAULT_BUFSIZE = 256; - -ACE_Section_Key_Win32::ACE_Section_Key_Win32 (HKEY hKey) - : hKey_ (hKey) -{ -} - -ACE_Section_Key_Win32::~ACE_Section_Key_Win32 (void) -{ - ::RegCloseKey (hKey_); -} - -////////////////////////////////////////////////////////////////////////////// - -ACE_Configuration_Win32Registry::ACE_Configuration_Win32Registry (HKEY hKey) -{ - ACE_Section_Key_Win32 *temp; - - ACE_NEW (temp, ACE_Section_Key_Win32 (hKey)); - - root_ = ACE_Configuration_Section_Key (temp); -} - - -ACE_Configuration_Win32Registry::~ACE_Configuration_Win32Registry (void) -{ -} - -int -ACE_Configuration_Win32Registry::open_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, - ACE_Configuration_Section_Key& result) -{ - if (validate_name (sub_section)) - return -1; - - HKEY base_key; - if (load_key (base, base_key)) - return -1; - - HKEY result_key; - if (ACE_TEXT_RegOpenKeyEx (base_key, - sub_section, - 0, - KEY_ALL_ACCESS, - &result_key) != ERROR_SUCCESS) - { - if (!create) - return -2; - - if (ACE_TEXT_RegCreateKeyEx (base_key, - sub_section, - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &result_key, - NULL) != ERROR_SUCCESS) - return -3; - } - - ACE_Section_Key_Win32 *temp; - - ACE_NEW_RETURN (temp, ACE_Section_Key_Win32 (result_key), -4); - result = ACE_Configuration_Section_Key (temp); - return 0; -} - -int -ACE_Configuration_Win32Registry::remove_section (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* sub_section, - int recursive) -{ - if (validate_name (sub_section)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - if (recursive) - { - ACE_Configuration_Section_Key section; - if (open_section (key, sub_section, 0, section)) - return -2; - - HKEY sub_key; - if (load_key (section, sub_key)) - return -3; - - ACE_TCHAR name_buffer[ACE_DEFAULT_BUFSIZE]; - DWORD buffer_size = ACE_DEFAULT_BUFSIZE; - // Note we don't increment the index because the - // enumeration becomes invalid if we change the - // subkey, which we do when we delete it. By leaving - // it 0, we always delete the top entry - while (ACE_TEXT_RegEnumKeyEx (sub_key, - 0, - name_buffer, - &buffer_size, - NULL, - NULL, - NULL, - NULL) == ERROR_SUCCESS) - { - remove_section (section, name_buffer, 1); - buffer_size = ACE_DEFAULT_BUFSIZE; - } - } - - if (ACE_TEXT_RegDeleteKey (base_key, sub_section) != ERROR_SUCCESS) - return -2; - - return 0; -} - -int -ACE_Configuration_Win32Registry::enumerate_values (const ACE_Configuration_Section_Key& key, - int Index, - ACE_TString& name, - VALUETYPE& type) -{ - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - ACE_TCHAR name_buffer[ACE_DEFAULT_BUFSIZE]; - DWORD buffer_size = ACE_DEFAULT_BUFSIZE; - DWORD value_type; - if (ACE_TEXT_RegEnumValue (base_key, - Index, - name_buffer, - &buffer_size, - NULL, - &value_type, - NULL, - NULL) != ERROR_SUCCESS) - return -2; - - name = name_buffer; - - switch (value_type) - { - case REG_BINARY: - type = BINARY; - break; - case REG_SZ: - type = STRING; - break; - case REG_DWORD: - type = INTEGER; - break; - default: - type = INVALID; - } - - return 0; -} - -int -ACE_Configuration_Win32Registry::enumerate_sections (const ACE_Configuration_Section_Key& key, - int Index, - ACE_TString& name) -{ - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - ACE_TCHAR name_buffer[ACE_DEFAULT_BUFSIZE]; - DWORD buffer_size = ACE_DEFAULT_BUFSIZE; - if (ACE_TEXT_RegEnumKeyEx (base_key, - Index, - name_buffer, - &buffer_size, - NULL, - NULL, - NULL, - NULL) != ERROR_SUCCESS) - return -2; - - name = name_buffer; - - return 0; -} - -int -ACE_Configuration_Win32Registry::set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value) -{ - if (validate_name (name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - if (ACE_TEXT_RegSetValueEx (base_key, - name, - 0, - REG_SZ, - (BYTE *) value.fast_rep (), - value.length () + 1) != ERROR_SUCCESS) - return -2; - - return 0; -} - -int -ACE_Configuration_Win32Registry::set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value) -{ - if (validate_name (name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - if (ACE_TEXT_RegSetValueEx (base_key, - name, - 0, - REG_DWORD, - (BYTE *) &value, - sizeof (value)) != ERROR_SUCCESS) - return -2; - - return 0; -} - -int -ACE_Configuration_Win32Registry::set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - u_int length) -{ - if (validate_name (name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - if (ACE_TEXT_RegSetValueEx (base_key, - name, - 0, - REG_BINARY, - (BYTE*)data, - length) != ERROR_SUCCESS) - return -2; - - return 0; -} - -int -ACE_Configuration_Win32Registry::get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value) -{ - if (validate_name (name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - ACE_TCHAR buffer[ACE_DEFAULT_BUFSIZE]; - DWORD length = ACE_DEFAULT_BUFSIZE; - DWORD type; - if (ACE_TEXT_RegQueryValueEx (base_key, - name, - NULL, - &type, - (BYTE*)buffer, - &length) != ERROR_SUCCESS) - return -2; - - if (type != REG_SZ) - return -3; - - value = buffer; - return 0; -} - -int -ACE_Configuration_Win32Registry::get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value) -{ - if (validate_name (name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - DWORD length = sizeof (value); - DWORD type; - if (ACE_TEXT_RegQueryValueEx (base_key, - name, - NULL, - &type, - (BYTE*)&value, - &length) != ERROR_SUCCESS) - return -2; - - if (type != REG_DWORD) - return -3; - - return 0; -} - -int -ACE_Configuration_Win32Registry::get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void*& data, - u_int& length) -{ - if (validate_name (name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - unsigned char buffer[ACE_DEFAULT_BUFSIZE]; - DWORD buffer_length = ACE_DEFAULT_BUFSIZE; - DWORD type; - if (ACE_TEXT_RegQueryValueEx (base_key, - name, - NULL, - &type, - (BYTE*)&buffer, - &buffer_length) != ERROR_SUCCESS) - return -2; - - if (type != REG_BINARY) - return -3; - - length = buffer_length; - - char* new_data; - ACE_NEW_RETURN (new_data, char[length], -4); - - ACE_OS::memcpy (new_data, buffer, length); - data = new_data; - return 0; -} - -int -ACE_Configuration_Win32Registry::remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name) -{ - if (validate_name (name)) - return -1; - - HKEY base_key; - if (load_key (key, base_key)) - return -1; - - if (ACE_TEXT_RegDeleteValue (base_key, name) != ERROR_SUCCESS) - return -2; - - return 0; -} - - -int -ACE_Configuration_Win32Registry::load_key (const ACE_Configuration_Section_Key& key, - HKEY& hKey) -{ - ACE_Section_Key_Win32* pKey = ACE_dynamic_cast (ACE_Section_Key_Win32*, - get_internal_key (key)); - if (!pKey) - return -1; - - hKey = pKey->hKey_; - return 0; -} - -HKEY -ACE_Configuration_Win32Registry::resolve_key (HKEY hKey, - const ACE_TCHAR* path, - int create) -{ - const ACE_TCHAR* begin = path; - const ACE_TCHAR* end = 0; - HKEY result = 0; - - // Make a copy of hKey - if (::RegOpenKey (hKey, NULL, &result) != ERROR_SUCCESS) - return 0; - - // recurse through the path - while (1) - { - // Detmine the begin/ending of the key name - end = ACE_OS::strchr (begin, ACE_TEXT ('\\')); - size_t length = end ? (size_t)(end-begin) : ACE_OS::strlen (begin); - - // Make sure length is not 0 - if (!length) - return 0; - - // Open the key - ACE_TString key (begin, length); - HKEY subkey; - if (ACE_TEXT_RegOpenKey (result, - key.fast_rep (), - &subkey) != ERROR_SUCCESS) - { - // try creating it - if (!create || ACE_TEXT_RegCreateKeyEx (result, - key.fast_rep (), - NULL, - NULL, - NULL, - KEY_ALL_ACCESS, - NULL, - &subkey, - NULL) != ERROR_SUCCESS) - { - // error - ::RegCloseKey (result); - return 0; - } - } - // release our open key handle - ::RegCloseKey (result); - result = subkey; - - // If end is NULL, we are done, return the result - if (!end) - return result; - - begin = end + 1; - } - - return 0; -} - - - -#endif // WIN_32 - - - - -/////////////////////////////////////////////////////////////// - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (void) - : type_ (ACE_Configuration::INVALID), - data_ (0), - length_ (0) -{ -} - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (ACE_TCHAR* string) - : type_ (ACE_Configuration::STRING), - data_ (string), - length_ (0) -{ -} - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (u_int integer) - : type_ (ACE_Configuration::INTEGER), - data_ ((void*) integer), - length_ (0) -{ -} - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (void* data, u_int length) - : type_ (ACE_Configuration::BINARY), - data_ (data), - length_ (length) -{ -} - -ACE_Configuration_Value_IntId::ACE_Configuration_Value_IntId (const ACE_Configuration_Value_IntId& rhs) - : type_ (rhs.type_), - data_ (rhs.data_), - length_ (rhs.length_) -{ -} - - -ACE_Configuration_Value_IntId::~ACE_Configuration_Value_IntId (void) -{ -} - -ACE_Configuration_Value_IntId& ACE_Configuration_Value_IntId::operator= (const ACE_Configuration_Value_IntId& rhs) -{ - if (this != &rhs) - { - type_ = rhs.type_; - data_ = rhs.data_; - length_ = rhs.length_; - } - return *this; -} - -void -ACE_Configuration_Value_IntId::free (ACE_Allocator* allocator) -{ - switch (type_) - { - case ACE_Configuration::STRING: - case ACE_Configuration::BINARY: - - allocator->free ((void *) (data_)); - break; - - case ACE_Configuration::INTEGER: - case ACE_Configuration::INVALID: - // Do nothing - break; - } -} - -///////////////////////////////////////////////////////////////////////////// - -ACE_Configuration_ExtId::ACE_Configuration_ExtId (void) - : name_ (0) -{ -} - -ACE_Configuration_ExtId::ACE_Configuration_ExtId (const ACE_TCHAR* name) - : name_ (name) -{ -} - -ACE_Configuration_ExtId::ACE_Configuration_ExtId (const ACE_Configuration_ExtId& rhs) - : name_ (rhs.name_) -{ -} - -ACE_Configuration_ExtId::~ACE_Configuration_ExtId (void) -{ -} - -ACE_Configuration_ExtId& ACE_Configuration_ExtId::operator= (const ACE_Configuration_ExtId& rhs) -{ - if (this != &rhs) - name_ = rhs.name_; - - return *this; -} - -int -ACE_Configuration_ExtId::operator == (const ACE_Configuration_ExtId& rhs) const -{ - return (ACE_OS::strcmp (name_, rhs.name_) == 0); -} - -int -ACE_Configuration_ExtId::operator != (const ACE_Configuration_ExtId& rhs) const -{ - return (ACE_OS::strcmp (name_, rhs.name_) != 0); -} - -u_long -ACE_Configuration_ExtId::hash (void) const -{ - ACE_TString temp (name_); - return temp.hash (); -} - -const ACE_TCHAR* -ACE_Configuration_ExtId::name (void) -{ - return name_; -} - -void -ACE_Configuration_ExtId::free (ACE_Allocator* allocator) -{ - allocator->free ((void *) (name_)); -} - -/////////////////////////////////////////////////////////////////////// - -ACE_Configuration_Section_IntId::ACE_Configuration_Section_IntId (void) - : value_hash_map_ (0), - section_hash_map_ (0) -{ -} - -ACE_Configuration_Section_IntId::ACE_Configuration_Section_IntId (VALUE_MAP* value_hash_map, SUBSECTION_MAP* section_hash_map) - : value_hash_map_ (value_hash_map), - section_hash_map_ (section_hash_map) -{ -} - -ACE_Configuration_Section_IntId::ACE_Configuration_Section_IntId (const ACE_Configuration_Section_IntId& rhs) - : value_hash_map_ (rhs.value_hash_map_), - section_hash_map_ (rhs.section_hash_map_) -{ - -} - -ACE_Configuration_Section_IntId::~ACE_Configuration_Section_IntId () -{ -} - -ACE_Configuration_Section_IntId& -ACE_Configuration_Section_IntId::operator= (const ACE_Configuration_Section_IntId& rhs) -{ - if (this != &rhs) - { - value_hash_map_ = rhs.value_hash_map_; - section_hash_map_ = rhs.section_hash_map_; - } - return *this; -} - -void -ACE_Configuration_Section_IntId::free (ACE_Allocator* allocator) -{ - allocator->free ((void *)(value_hash_map_)); - allocator->free ((void *)(section_hash_map_)); -} - -ACE_Configuration_Section_Key_Heap::ACE_Configuration_Section_Key_Heap (const ACE_TCHAR* path) - : path_ (0), - value_iter_ (0), - section_iter_ (0) -{ - path_ = ACE_OS::strdup (path); -} - -ACE_Configuration_Section_Key_Heap::~ACE_Configuration_Section_Key_Heap () -{ - delete value_iter_; - delete section_iter_; - ACE_OS::free (path_); -} - -////////////////////////////////////////////////////////////////////////////// - -ACE_Configuration_Heap::ACE_Configuration_Heap (void) - : allocator_ (0), - index_ (0), - default_map_size_ (0) -{ - ACE_Configuration_Section_Key_Heap *temp = 0; - - ACE_NEW (temp, ACE_Configuration_Section_Key_Heap (ACE_TEXT (""))); - root_ = ACE_Configuration_Section_Key (temp); -} - -ACE_Configuration_Heap::~ACE_Configuration_Heap (void) -{ - if (allocator_) - allocator_->sync (); - - delete allocator_; -} - -int -ACE_Configuration_Heap::open (int default_map_size) -{ - default_map_size_ = default_map_size; - // Create the allocator with the appropriate options. - // The name used for the lock is the same as one used - // for the file. - ACE_NEW_RETURN (this->allocator_, - HEAP_ALLOCATOR (), - -1); - return create_index (); -} - - -int -ACE_Configuration_Heap::open (const ACE_TCHAR* file_name, - void* base_address, - int default_map_size) -{ - default_map_size_ = default_map_size; - - // Make sure that the file name is of the legal length. - if (ACE_OS::strlen (file_name) >= MAXNAMELEN + MAXPATHLEN) - { - errno = ENAMETOOLONG; - return -1; - } - -#if !defined (CHORUS) - ACE_MMAP_Memory_Pool::OPTIONS options (base_address); -#else - // Use base address == 0, don't use a fixed address. - ACE_MMAP_Memory_Pool::OPTIONS options (0, - 0, - 0, - ACE_CHORUS_LOCAL_NAME_SPACE_T_SIZE); -#endif /* CHORUS */ - - // Create the allocator with the appropriate options. The name used - // for the lock is the same as one used for the file. - ACE_NEW_RETURN (this->allocator_, - PERSISTENT_ALLOCATOR (file_name, - file_name, - &options), - -1); - -#if !defined (ACE_LACKS_ACCESS) - // Now check if the backing store has been created successfully. - if (ACE_OS::access (file_name, F_OK) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("create_index\n")), - -1); -#endif /* ACE_LACKS_ACCESS */ - - return create_index (); -} - -int -ACE_Configuration_Heap::create_index (void) -{ - void *section_index = 0; - - // This is the easy case since if we find hash table in the - // memory-mapped file we know it's already initialized. - if (this->allocator_->find (ACE_CONFIG_SECTION_INDEX, section_index) == 0) - this->index_ = (SECTION_MAP *) section_index; - - // Create a new (because we've just created a new - // memory-mapped file). - else - { - size_t index_size = sizeof (SECTION_MAP); - section_index = this->allocator_->malloc (index_size); - - if (section_index == 0 - || create_index_helper (section_index) == -1 - || this->allocator_->bind (ACE_CONFIG_SECTION_INDEX, - section_index) == -1) - { - // Attempt to clean up. - ACE_ERROR ((LM_ERROR, - ACE_TEXT("create_index\n"))); - this->allocator_->remove (); - return -1; - } - // Add the root section - return new_section (ACE_TEXT (""), root_); - } - return 0; -} - -int -ACE_Configuration_Heap::create_index_helper (void *buffer) -{ - ACE_NEW_RETURN (this->index_, - (buffer) SECTION_MAP (this->allocator_), - -1); - return 0; -} - -int -ACE_Configuration_Heap::load_key (const ACE_Configuration_Section_Key& key, - ACE_TString& name) -{ - ACE_Configuration_Section_Key_Heap* pKey = - ACE_dynamic_cast (ACE_Configuration_Section_Key_Heap*, - get_internal_key (key)); - if (!pKey) - return -1; - - name = pKey->path_; - return 0; -} - - -int -ACE_Configuration_Heap::add_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - ACE_Configuration_Section_Key& result) -{ - - ACE_TString section; - if (load_key (base, section)) - return -1; - - // Find the base section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; - - // See if this section already exists - ACE_Configuration_ExtId SubSectionExtId (sub_section); - int ignored = 0; - - if (!IntId.section_hash_map_->find (SubSectionExtId, ignored, allocator_)) - // already exists! - return -3; - - // Create the new section name - // only prepend a separater if were not at the root - if (section.length ()) - section += ACE_TEXT ("\\"); - - section += sub_section; - - // Add it to the base section - ACE_TCHAR* pers_name = (ACE_TCHAR*)allocator_->malloc ((ACE_OS::strlen (sub_section) + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_name, sub_section); - ACE_Configuration_ExtId SSExtId (pers_name); - if (IntId.section_hash_map_->bind (SSExtId, ignored, allocator_)) - { - allocator_->free (pers_name); - return -4; - } - return (new_section (section, result)); -} - -int -ACE_Configuration_Heap::new_section (const ACE_TString& section, - ACE_Configuration_Section_Key& result) -{ - // Create a new section and add it to the global list - - // Allocate memory for items to be stored in the table. - size_t section_len = section.length () + 1; - ACE_TCHAR *ptr = (ACE_TCHAR*) this->allocator_->malloc (section_len); - - int return_value = -1; - - if (ptr == 0) - return -1; - else - { - // Populate memory with data. - ACE_OS::strcpy (ptr, section.fast_rep ()); - - void *value_hash_map = 0; - size_t map_size = sizeof (VALUE_MAP); - value_hash_map = this->allocator_->malloc (map_size); - - // If allocation failed ... - if (value_hash_map == 0) - return -1; - - // Initialize allocated hash map through placement new. - if (value_open_helper (default_map_size_, value_hash_map ) == -1) - { - this->allocator_->free (value_hash_map ); - return -2; - } - - // create the section map - void* section_hash_map = 0; - map_size = sizeof (SUBSECTION_MAP); - section_hash_map = this->allocator_->malloc (map_size); - - // If allocation failed - if (section_hash_map == 0) - return -1; - - // initialize allocated hash map through placement new - if (section_open_helper (default_map_size_, section_hash_map) == -1) - { - this->allocator_->free (value_hash_map ); - this->allocator_->free (section_hash_map); - return -2; - } - - ACE_Configuration_ExtId name (ptr); - ACE_Configuration_Section_IntId entry ((VALUE_MAP*)value_hash_map , - (SUBSECTION_MAP*)section_hash_map); - - // Do a normal bind. This will fail if there's already an - // entry with the same name. - return_value = this->index_->bind (name, entry, this->allocator_); - - if (return_value == 1) - { - // Entry already existed so bind failed. Free our dynamically - // allocated memory. - this->allocator_->free ((void *) ptr); - return return_value; - } - - if (return_value == -1) - // Free our dynamically allocated memory. - this->allocator_->free ((void *) ptr); - else - // If bind() succeed, it will automatically sync - // up the map manager entry. However, we must sync up our - // name/value memory. - this->allocator_->sync (ptr, section_len); - - } - - // set the result - ACE_Configuration_Section_Key_Heap *temp; - ACE_NEW_RETURN (temp, ACE_Configuration_Section_Key_Heap (section.fast_rep ()), -2); - result = ACE_Configuration_Section_Key (temp); - return return_value; -} - -int -ACE_Configuration_Heap::value_open_helper (size_t hash_table_size, - void *buffer) -{ - ACE_NEW_RETURN (buffer, - (buffer) VALUE_MAP (hash_table_size, this->allocator_), - -1); - return 0; -} - -int -ACE_Configuration_Heap::section_open_helper (size_t hash_table_size, - void *buffer) -{ - ACE_NEW_RETURN (buffer, - (buffer) SUBSECTION_MAP (hash_table_size, this->allocator_), - -1); - return 0; -} - -int -ACE_Configuration_Heap::open_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, - ACE_Configuration_Section_Key& result) -{ - if (validate_name (sub_section)) - return -1; - - ACE_TString section; - if (load_key (base, section)) - return -1; - - // Only add the \\ if were not at the root - if (section.length ()) - section += ACE_TEXT ("\\"); - - section += sub_section; - - // resolve the section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - { - if (!create) - return -2; - - return add_section (base, sub_section, result); - } - - ACE_Configuration_Section_Key_Heap *temp; - - ACE_NEW_RETURN (temp, ACE_Configuration_Section_Key_Heap (section.fast_rep ()), -3); - result = ACE_Configuration_Section_Key (temp); - - return 0; -} - -int -ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* sub_section, - int recursive) -{ - if (validate_name (sub_section)) - return -1; - - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this key - ACE_Configuration_ExtId ParentExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId ParentIntId; - if (index_->find (ParentExtId, ParentIntId, allocator_)) - return -2;// no parent key - - // Find this subkey - if (section.length ()) - section += ACE_TEXT ("\\"); - - section += sub_section; - ACE_Configuration_ExtId SectionExtId (section.fast_rep ()); - SECTION_ENTRY* section_entry; - SECTION_HASH* hashmap = index_; - if (hashmap->find (SectionExtId, section_entry)) - return -2; - - if (recursive) - { - ACE_Configuration_Section_Key section; - if (open_section (key, sub_section, 0, section)) - return -3; - - int index = 0; - ACE_TString name; - while (!enumerate_sections (section, index, name)) - { - if (remove_section (section, name.fast_rep (), 1)) - return -4; - - index++; - } - } - - // Now make sure we dont have any subkeys - if (section_entry->int_id_.section_hash_map_->current_size ()) - return -3; - - // Now remove subkey from parent key - ACE_Configuration_ExtId SubSExtId (sub_section); - SUBSECTION_ENTRY* subsection_entry; - if (((SUBSECTION_HASH*)ParentIntId.section_hash_map_)-> - find (SubSExtId, subsection_entry)) - return -4; - - if (ParentIntId.section_hash_map_->unbind (SubSExtId, allocator_)) - return -5; - - subsection_entry->ext_id_.free (allocator_); - - // Remember the pointers so we can free them after we unbind - ACE_Configuration_ExtId ExtIdToFree (section_entry->ext_id_); - ACE_Configuration_Section_IntId IntIdToFree (section_entry->int_id_); - - // iterate over all values and free memory - VALUE_HASH* value_hash_map = section_entry->int_id_.value_hash_map_; - VALUE_HASH::ITERATOR value_iter = value_hash_map->begin (); - while (!value_iter.done ()) - { - VALUE_ENTRY* value_entry; - if (!value_iter.next (value_entry)) - return 1; - - value_entry->ext_id_.free (allocator_); - value_entry->int_id_.free (allocator_); - - value_iter.advance (); - } - - // remove it - if (index_->unbind (SectionExtId, allocator_)) - return -5; - - // Free the memory - ExtIdToFree.free (allocator_); - IntIdToFree.free (allocator_); - - return 0; -} - -int -ACE_Configuration_Heap::enumerate_values (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name, - VALUETYPE& type) -{ - ACE_Configuration_Section_Key_Heap* pKey = - ACE_dynamic_cast (ACE_Configuration_Section_Key_Heap*, - get_internal_key (key)); - if (!pKey) - return -1; - - name = pKey->path_; - - // resolve the section - ACE_Configuration_ExtId ExtId (pKey->path_); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; - - // Handle iterator resets - if (index == 0) - { - ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>* hash_map = IntId.value_hash_map_; - // @@ This zero pointer check is redundant -Ossama - // if (pKey->value_iter_) - delete pKey->value_iter_; - - ACE_NEW_RETURN (pKey->value_iter_, VALUE_HASH::ITERATOR(hash_map->begin()), -3); - } - - // Get the next entry - ACE_Hash_Map_Entry* entry; - if (!pKey->value_iter_->next (entry)) - return 1; - - // Return the value of the iterator and advance it - name = entry->ext_id_.name_; - type = entry->int_id_.type_; - pKey->value_iter_->advance (); - - return 0; -} - -int -ACE_Configuration_Heap::enumerate_sections (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name) -{ - // cast to a heap section key - ACE_Configuration_Section_Key_Heap* pKey = - ACE_dynamic_cast (ACE_Configuration_Section_Key_Heap*, - get_internal_key (key)); - if (!pKey) - return -1; // not a heap key! - - // resolve the section - ACE_Configuration_ExtId ExtId (pKey->path_); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; // unknown section - - // Handle iterator resets - if (index == 0) - { - if (pKey->section_iter_) - delete pKey->section_iter_; - - ACE_NEW_RETURN (pKey->section_iter_, SUBSECTION_HASH::ITERATOR (IntId.section_hash_map_->begin ()), -3); - } - - // Get the next entry - ACE_Hash_Map_Entry* entry; - if (!pKey->section_iter_->next (entry)) - return 1; - - // Return the value of the iterator and advance it - pKey->section_iter_->advance (); - name = entry->ext_id_.name_; - - return 0; -} - -int -ACE_Configuration_Heap::set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value) -{ - if (validate_name (name)) - return -1; - - ACE_TString section; - if (load_key (key, section)) - return -1; - - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; - - ACE_Configuration_ExtId VExtIdFind (name); - ACE_Configuration_Value_IntId VIntIdFind; - // See if it exists first - if (IntId.value_hash_map_->find (VExtIdFind, VIntIdFind, allocator_)) - { - // it doesn't exist, bind it - ACE_TCHAR* pers_name = (ACE_TCHAR*)allocator_->malloc ((ACE_OS::strlen (name) + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_name, name); - ACE_TCHAR* pers_value = (ACE_TCHAR*)allocator_->malloc ((value.length () + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_value, value.fast_rep ()); - ACE_Configuration_ExtId VExtId (pers_name); - ACE_Configuration_Value_IntId VIntId (pers_value); - if (IntId.value_hash_map_->bind (VExtId, VIntId, allocator_)) - { - allocator_->free (pers_value); - allocator_->free (pers_name); - return -3; - } - return 0; - } - else - { - // Free the old value memory - VIntIdFind.free (allocator_); - // Assign a new value - ACE_TCHAR* pers_value = (ACE_TCHAR*)allocator_->malloc ((value.length () + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_value, value.fast_rep ()); - VIntIdFind = ACE_Configuration_Value_IntId (pers_value); - } - - return 0; -} - -int -ACE_Configuration_Heap::set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value) -{ - if (validate_name (name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; // section does not exist - - // See if it exists first - ACE_Configuration_ExtId VExtId (name); - ACE_Configuration_Value_IntId VIntId; - if (IntId.value_hash_map_->find (VExtId, VIntId, allocator_)) - { - // it doesn't exist, bind it - ACE_TCHAR* pers_name = (ACE_TCHAR*)allocator_->malloc ((ACE_OS::strlen (name) + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_name, name); - ACE_Configuration_ExtId VExtId (pers_name); - ACE_Configuration_Value_IntId VIntId (value); - if (IntId.value_hash_map_->bind (VExtId, VIntId, allocator_)) - return -3; - - return 0; - } - else - { - // rebind it - VIntId = ACE_Configuration_Value_IntId (value); - } - return 0; -} - -int -ACE_Configuration_Heap::set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - u_int length) -{ - if (validate_name (name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; // section does not exist - - // See if the value exists first - ACE_Configuration_ExtId VExtIdFind (name); - ACE_Configuration_Value_IntId VIntIdFind; - if (IntId.value_hash_map_->find (VExtIdFind, VIntIdFind, allocator_)) - { - // it doesn't exist, bind it - ACE_TCHAR* pers_name = (ACE_TCHAR*)allocator_->malloc ((ACE_OS::strlen (name) + 1) * sizeof (ACE_TCHAR)); - ACE_OS::strcpy (pers_name, name); - ACE_TCHAR* pers_value = (ACE_TCHAR*)allocator_->malloc (length); - ACE_OS::memcpy (pers_value, data, length); - ACE_Configuration_ExtId VExtId (pers_name); - ACE_Configuration_Value_IntId VIntId (pers_value, length); - if (IntId.value_hash_map_->bind (VExtId, VIntId, allocator_)) - { - allocator_->free (pers_value); - allocator_->free (pers_name); - return -3; - } - return 0; - } - else - { - // it does exist, free the old value memory - VIntIdFind.free (allocator_); - // Assign a new value - ACE_TCHAR* pers_value = (ACE_TCHAR*)allocator_->malloc (length); - ACE_OS::memcpy (pers_value, data, length); - VIntIdFind = ACE_Configuration_Value_IntId (pers_value, length); - } - - return 0; -} - -int -ACE_Configuration_Heap::get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value) -{ - if (validate_name (name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; // section does not exist - - // See if it exists first - ACE_Configuration_ExtId VExtId (name); - ACE_Configuration_Value_IntId VIntId; - if (IntId.value_hash_map_->find (VExtId, VIntId, allocator_)) - return -3; // unknown value - - // Check type - if (VIntId.type_ != ACE_Configuration::STRING) - return -4; - - // everythings ok, return the data - value = (ACE_TCHAR*)VIntId.data_; - return 0; -} - -int -ACE_Configuration_Heap::get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value) -{ - if (validate_name (name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; // section does not exist - - - // See if it exists first - ACE_Configuration_ExtId VExtId (name); - ACE_Configuration_Value_IntId VIntId; - if (IntId.value_hash_map_->find (VExtId, VIntId, allocator_)) - return -3; // unknown value - - // Check type - if (VIntId.type_ != ACE_Configuration::INTEGER) - return -4; - - // Everythings ok, return the data - value = (u_int)((long)VIntId.data_); - return 0; -} - -int -ACE_Configuration_Heap::get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void*& data, - u_int& length) -{ - if (validate_name (name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; // section does not exist - - ACE_Configuration_ExtId VExtId (name); - ACE_Configuration_Value_IntId VIntId; - // See if it exists first - if (IntId.value_hash_map_->find (VExtId, VIntId, allocator_)) - return -3; // unknown value - - // Check type - if (VIntId.type_ != ACE_Configuration::BINARY) - return -4; - - // Make a copy - ACE_NEW_RETURN (data, char[VIntId.length_], -5); - ACE_OS::memcpy (data, VIntId.data_, VIntId.length_); - length = VIntId.length_; - return 0; -} - -int -ACE_Configuration_Heap::remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name) -{ - if (validate_name (name)) - return -1; - - // Get the section name from the key - ACE_TString section; - if (load_key (key, section)) - return -1; - - // Find this section - ACE_Configuration_ExtId ExtId (section.fast_rep ()); - ACE_Configuration_Section_IntId IntId; - if (index_->find (ExtId, IntId, allocator_)) - return -2; // section does not exist - - // Find it - ACE_Configuration_ExtId ValueExtId (name); - VALUE_ENTRY* value_entry; - if (((VALUE_HASH*)IntId.value_hash_map_)->find (ValueExtId, value_entry)) - return -4; - - // free it - value_entry->ext_id_.free (allocator_); - value_entry->int_id_.free (allocator_); - - // Unbind it - if (IntId.value_hash_map_->unbind (ValueExtId, allocator_)) - return -3; - - return 0; -} - - diff --git a/ace/Configuration.h b/ace/Configuration.h deleted file mode 100644 index cdfb5a6d155..00000000000 --- a/ace/Configuration.h +++ /dev/null @@ -1,679 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Configuration.h -// -// = AUTHOR -// Chris Hafey -// -// = DESCRIPTION -// The ACE configuration API provides a portable abstraction for -// program configuration. The API supports a tree based hierarchy -// of configuration sections. Each section contains other sections -// or values. Values may contain string, unsigned integer and -// binary data. -// -// = TODO -// - Add locking for thread safety. -// - Need to investigate what happens if memory mapped file gets mapped to -// a location different than it was created with. -// - Implement export and import of binary values -// - Add dynamic buffer when importing. currently it will not allow -// importing of values greater than a fixed ammount (4096 bytes) -// - Replace unsigned int with a type that is fixed accross platforms. -// -// ============================================================================ - -#ifndef ACE_CONFIGURATION_H -#define ACE_CONFIGURATION_H -#include "ace/pre.h" - -#include "ace/ACE.h" -#include "ace/SString.h" -#include "ace/Hash_Map_With_Allocator_T.h" -#include "ace/Malloc.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// configurable parameters - -#if !defined (ACE_CONFIG_SECTION_INDEX) -# define ACE_CONFIG_SECTION_INDEX "Config_Section_Index" -#endif /* ! ACE_CONFIG_SECTION_INDEX */ - -#if !defined (ACE_DEFAULT_CONFIG_SECTION_SIZE) -#define ACE_DEFAULT_CONFIG_SECTION_SIZE 16 -#endif /* ACE_DEFAULT_CONFIG_SECTION_SIZE */ - -class ACE_Export ACE_Section_Key_Internal -{ - // = TITLE - // A base class for internal handles to section keys for - // configuration implementations - // - // = DESCRIPTION - // Implementations subclass this base class to represent a - // section key. -public: - virtual ~ACE_Section_Key_Internal (void); - // Virtual destructor, make sure descendants are virtual! - - virtual int add_ref (void); - // Increment reference count - - virtual int dec_ref (void); - // Decrement reference count. Will delete this if count gets to 0 -protected: - ACE_Section_Key_Internal (void); - ACE_Section_Key_Internal (const ACE_Section_Key_Internal& rhs); - ACE_Section_Key_Internal& operator= (ACE_Section_Key_Internal& rhs); - - u_int ref_count_; -}; - -class ACE_Export ACE_Configuration_Section_Key -{ - // = TITLE - // Referenced counted wrapper for . - // - // = DESCRIPTION - // Reference counted wrapper class for the abstract internal - // section key. A user gets one of these to represent a section - // in the configuration database. - friend class ACE_Configuration; -public: - ACE_Configuration_Section_Key (void); - // Default ctor - - ACE_EXPLICIT ACE_Configuration_Section_Key (ACE_Section_Key_Internal *key); - // ctor based on a pointer to a concrete internal key, does an - // add_ref on . - - ACE_Configuration_Section_Key (const ACE_Configuration_Section_Key &rhs); - // Copy ctor, does an add_ref on rhs.key_. - - ~ACE_Configuration_Section_Key (void); - // destructor, does a on . - - ACE_Configuration_Section_Key & - operator= (const ACE_Configuration_Section_Key &rhs); - // assignment operator, does a on and to - // -private: - ACE_Section_Key_Internal *key_; -}; - -class ACE_Export ACE_Configuration -{ - // = TITLE - // Base class for configuration databases - // - // = DESCRIPTION - // This class provides an interface for configuration databases. -public: - enum VALUETYPE - { - STRING, - INTEGER, - BINARY, - INVALID - }; - // Enumeration for the various types of values we can store. - - virtual ~ACE_Configuration (void); - // destructor - - virtual const ACE_Configuration_Section_Key& root_section (void); - // Returns the root section of this configuration. - - virtual int open_section (const ACE_Configuration_Section_Key &base, - const ACE_TCHAR *sub_section, - int create, - ACE_Configuration_Section_Key& result) = 0; - // Finds a in and places the resulting key in - // . If create is non zero, the sub_section will be created - // if it doesn't exist - - virtual int remove_section (const ACE_Configuration_Section_Key &key, - const ACE_TCHAR *sub_section, - int recursive) = 0; - // Removes the from . If recursive is non zero, - // any subkeys below are remove as well. - - virtual int enumerate_values (const ACE_Configuration_Section_Key& key, - int index, - ACE_TString& name, - VALUETYPE& type) = 0; - // method to enumerate through the and of values in a - // . To begin iteration, must be zero. to continue - // iteration, invoke enumerate_values again while incrementing - // index. Each iteration will return the of the value and - // its . This method returns 0 on success, <0 on error and 1 - // when there are no more values to iterate through. Note - you may - // not delete or add values while enumerating. If you need to do - // this, you start the enumeration over again. - - virtual int enumerate_sections (const ACE_Configuration_Section_Key& key, - int index, ACE_TString& name) = 0; - // method to enumerate through the subsections in . To - // begin iteration, must zero. to continue iteration, invoke - // enumerate_sections again while incrementing index. Each - // iteration will return the of the sub section. This method - // returns 0 on success, <0 on error and 1 when there are no more - // subsections to iterate through. Note - you may not delete or add - // values while enumerating. If you need to do this, you start the - // enumeration over again. - - virtual int set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value) = 0; - // sets the value in with to a string of - - virtual int set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value) = 0; - // sets the value in with to an integer of - - virtual int set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - u_int length) = 0; - // sets the value in with to binary data of with - // . - - virtual int get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value) = 0; - // gets the string value of from and places it in - // . Returns non zero on error (if value is not a string). - - virtual int get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value) = 0; - // gets the integer value of from and places it in - // . Returns non zero on error (if value is not an integer). - - virtual int get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void*& data, - u_int& length) = 0; - // gets the binary value of from and places a copy in - // and sets to the length of the data. caller is - // responsible for freeing . Returns non zero on error (if - // value is not binary). - - virtual int remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name) = 0; - // Removes the the value from . returns non zero on - // error. - - int expand_path (const ACE_Configuration_Section_Key& key, - const ACE_TString& path_in, - ACE_Configuration_Section_Key& key_out, - int create = 1); - // Expands to from . If create is true, - // the subsections are created. Returns 0 on success, non zero on - // error The path consists of sections separated by the backslash - // '\'. - - virtual int export_config (const ACE_TCHAR* filename); - // Exports the configuration database to filename. If is - // alredy present, it is overwritten. - - virtual int import_config (const ACE_TCHAR* filename); - // Imports the configuration database from filename. Any existing - // data is not removed. - -protected: - ACE_Configuration (void); - // Default ctor - - ACE_Section_Key_Internal* get_internal_key - (const ACE_Configuration_Section_Key& key); - // resolves the internal key from a section key - - int validate_name (const ACE_TCHAR* name); - // tests to see if is valid. must be < 255 characters - // and not contain the path separator '\', brackets [] or = (maybe - // just restrict to alphanumeric?) returns non zero if name is not - // valid - - int export_section (const ACE_Configuration_Section_Key& section, - const ACE_TString& path, - FILE* out); - // Used when exporting a configuration to a file - - // Not used - ACE_Configuration (const ACE_Configuration& rhs); - ACE_Configuration& operator= (const ACE_Configuration& rhs); - ACE_Configuration_Section_Key root_; -}; - -#if defined (ACE_WIN32) - -class ACE_Export ACE_Section_Key_Win32 : public ACE_Section_Key_Internal -{ - // = TITLE - // The Win32 registry implementation of an internal section key. - // - // = DESCRIPTION - // Holds the HKEY for a section (registry key). -public: - ACE_Section_Key_Win32 (HKEY hKey); - // constructor based on an HKEY - - HKEY hKey_; - -protected: - virtual ~ACE_Section_Key_Win32 (void); - // destructor - invokes - - // Not used - ACE_Section_Key_Win32 (const ACE_Section_Key_Win32& rhs); - ACE_Section_Key_Win32& operator= (const ACE_Section_Key_Win32& rhs); -}; - -class ACE_Export ACE_Configuration_Win32Registry : public ACE_Configuration -{ - // = TITLE - // The win32 registry implementation of a configuration database - // - // = DESCRIPTION - // The win32 implementation basically makes calls through to the - // registry functions. The API is very similar so very little - // work must be done -public: - - ACE_EXPLICIT ACE_Configuration_Win32Registry (HKEY hKey); - // constructor for registry configuration database. hKey is the - // base registry key to attach to. This class takes ownership of - // hKey, it will invoke on it upon destruction. - - virtual ~ACE_Configuration_Win32Registry (void); - // destructor - - virtual int open_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, - ACE_Configuration_Section_Key& result); - - virtual int remove_section (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* sub_section, - int recursive); - - virtual int enumerate_values (const ACE_Configuration_Section_Key& key, - int Index, - ACE_TString& name, - VALUETYPE& type); - - virtual int enumerate_sections (const ACE_Configuration_Section_Key& key, - int Index, - ACE_TString& name); - - virtual int set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value); - - virtual int set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value); - - virtual int set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - u_int length); - - virtual int get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value); - - virtual int get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value); - - virtual int get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void*& data, - u_int& length); - - virtual int remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name); - // Removes the the value from . returns non zero on error - - static HKEY resolve_key (HKEY hKey, - const ACE_TCHAR* path, - int create = 1); - // This method traverses through . It is useful when - // you want the HKEY for a specific registry key, especially when - // initializing this implementation. Caller is responsible for - // closeing this key when it is no longer used. If create is 1 - // (default) the keys are create if they don't already exist. - // Returns 0 on error - -protected: - - int load_key (const ACE_Configuration_Section_Key& key, HKEY& hKey); - // Gets the HKEY for a configuration section - - // Not used - ACE_Configuration_Win32Registry (void); - ACE_Configuration_Win32Registry (const ACE_Configuration_Win32Registry& rhs); - ACE_Configuration_Win32Registry& operator= (const ACE_Configuration_Win32Registry& rhs); -}; -#endif /* ACE_WIN32 */ - -// ACE_Allocator version - -typedef ACE_Allocator_Adapter > - PERSISTENT_ALLOCATOR; -typedef ACE_Allocator_Adapter > - HEAP_ALLOCATOR; - -class ACE_Export ACE_Configuration_ExtId -{ - // = TITLE - // External ID for the section and value hash - // - // = DESCRIPTION - // Contains a pointer to the section or value name. -public: - ACE_Configuration_ExtId (void); - // defeault ctor - - ACE_EXPLICIT ACE_Configuration_ExtId (const ACE_TCHAR* name); - // named constructor - - ACE_Configuration_ExtId (const ACE_Configuration_ExtId& rhs); - // copy ctor - - ~ACE_Configuration_ExtId (void); - // destructor - - ACE_Configuration_ExtId& operator= (const ACE_Configuration_ExtId& rhs); - // assignment operator - - int operator== (const ACE_Configuration_ExtId &rhs) const; - // Equality comparison operator (must match name_). - - int operator!= (const ACE_Configuration_ExtId &rhs) const; - // Inequality comparison operator. - - void free (ACE_Allocator* allocator); - // Frees the name of the value. needed since we don't know the - // allocator name_ was created in - - u_long hash (void) const; - // function is required in order for this class to be usable by - // ACE_Hash_Map_Manager. - - // = Data members. - - const ACE_TCHAR * name_; - - // Accessors - const ACE_TCHAR *name (void); -}; - -typedef ACE_Hash_Map_With_Allocator - SUBSECTION_MAP; -typedef ACE_Hash_Map_Manager_Ex, - ACE_Equal_To, - ACE_Null_Mutex> - SUBSECTION_HASH; -typedef ACE_Hash_Map_Entry - SUBSECTION_ENTRY; - -class ACE_Export ACE_Configuration_Value_IntId -{ - // = TITLE - // The section hash table internal value class - // - // = DESCRIPTION - // This class is present as the internal portion of a section's - // value hash table It may store string, integer or binary data. -public: - ACE_Configuration_Value_IntId (void); - // default constructor - - ACE_EXPLICIT ACE_Configuration_Value_IntId (ACE_TCHAR* string); - // string constructor, takes ownership of string - - ACE_EXPLICIT ACE_Configuration_Value_IntId (u_int integer); - // integer constructor - - ACE_Configuration_Value_IntId (void* data, u_int length); - // binary constructor, takes ownership of data - - ACE_Configuration_Value_IntId (const ACE_Configuration_Value_IntId& rhs); - // copy ctor - - ~ACE_Configuration_Value_IntId (void); - // destructor - - ACE_Configuration_Value_IntId& operator= ( - const ACE_Configuration_Value_IntId& rhs); - // Assignment operator - - void free (ACE_Allocator* allocator); - - // = Data members. - - ACE_Configuration::VALUETYPE type_; - void* data_; - // points to the string value or binary data or IS the integer - // (XXX need to change this since sizeof (u_int) is - // not the same accross different platforms) - u_int length_; - // Length is only used when type_ == BINARY -}; - -typedef ACE_Hash_Map_With_Allocator - VALUE_MAP; -typedef ACE_Hash_Map_Manager_Ex, - ACE_Equal_To, - ACE_Null_Mutex> - VALUE_HASH; -typedef ACE_Hash_Map_Entry - VALUE_ENTRY; - -class ACE_Export ACE_Configuration_Section_IntId -{ - // = TITLE - // The internal ID for a section hash table - // - // = DESCRIPTION - // Contains a hash table containing value name/values -public: - ACE_Configuration_Section_IntId (void); - // default ctor - - ACE_EXPLICIT ACE_Configuration_Section_IntId (VALUE_MAP* value_hash_map, - SUBSECTION_MAP* section_hash_map); - // named ctor - - ACE_Configuration_Section_IntId (const ACE_Configuration_Section_IntId& rhs); - // copy ctor - - ~ACE_Configuration_Section_IntId (void); - // destructor - - ACE_Configuration_Section_IntId& operator= ( - const ACE_Configuration_Section_IntId& rhs); - // asignment operator - - void free (ACE_Allocator* allocator); - // frees the hash table and all its values - - // = Data Members. - VALUE_MAP* value_hash_map_; - - SUBSECTION_MAP* section_hash_map_; -}; -typedef ACE_Hash_Map_With_Allocator - SECTION_MAP; -typedef ACE_Hash_Map_Manager_Ex, - ACE_Equal_To, - ACE_Null_Mutex> - SECTION_HASH; -typedef ACE_Hash_Map_Entry - SECTION_ENTRY; - -class ACE_Export ACE_Configuration_Section_Key_Heap - : public ACE_Section_Key_Internal -{ - // = TITLE - // Internal section key class for heap based configuration - // database. - // - // = DESCRIPTION - // Contains a value iterator and full path name of section. -public: - ACE_Configuration_Section_Key_Heap (const ACE_TCHAR* path); - // constructor based on the full path of the section - - ACE_TCHAR* path_; - //the path itself - - VALUE_HASH::ITERATOR* value_iter_; - // The value iterator - - SUBSECTION_HASH::ITERATOR* section_iter_; - // The sub section iterator -protected: - virtual ~ACE_Configuration_Section_Key_Heap (void); - // destructor - will delete the iterators - - // Not used - ACE_Configuration_Section_Key_Heap (const ACE_Configuration_Section_Key_Heap& rhs); - ACE_Configuration_Section_Key_Heap& operator= (const ACE_Configuration_Section_Key_Heap& rhs); -}; - -class ACE_Export ACE_Configuration_Heap : public ACE_Configuration -{ - // = TITLE - // The concrete implementation of a allocator based - // configuration database - // - // = DESCRIPTION - // This class uses ACE's Allocators to manage a memory - // representation of a configuraiton database. A persistent heap - // may be used to store configurations persistently -public: - - ACE_Configuration_Heap (void); - // Default ctor - - virtual ~ACE_Configuration_Heap (void); - // destructor - - int open (const ACE_TCHAR* file_name, - void* base_address = ACE_DEFAULT_BASE_ADDR, - int default_map_size = ACE_DEFAULT_CONFIG_SECTION_SIZE); - // opens a configuration based on a file name - - int open (int default_map_size = ACE_DEFAULT_CONFIG_SECTION_SIZE); - // opens a heap based configuration - - virtual int open_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - int create, ACE_Configuration_Section_Key& result); - - virtual int remove_section (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* sub_section, - int recursive); - - virtual int enumerate_values (const ACE_Configuration_Section_Key& key, - int Index, - ACE_TString& name, - VALUETYPE& type); - - virtual int enumerate_sections (const ACE_Configuration_Section_Key& key, - int Index, - ACE_TString& name); - - virtual int set_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const ACE_TString& value); - - virtual int set_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int value); - - virtual int set_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - const void* data, - u_int length); - - virtual int get_string_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - ACE_TString& value); - - virtual int get_integer_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - u_int& value); - - virtual int get_binary_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name, - void* &data, - u_int &length); - - virtual int remove_value (const ACE_Configuration_Section_Key& key, - const ACE_TCHAR* name); - // Removes the the value from . returns non zero on error - -private: - int add_section (const ACE_Configuration_Section_Key& base, - const ACE_TCHAR* sub_section, - ACE_Configuration_Section_Key& result); - // adds a new section - - int create_index (void); - // Helper for the method. - - int create_index_helper (void *buffer); - // Helper for method: places hash table into an - // allocated space. - - int value_open_helper (size_t hash_table_size, void *buffer); - - int section_open_helper (size_t hash_table_size, void *buffer); - - int load_key (const ACE_Configuration_Section_Key& key, ACE_TString& name); - - int new_section (const ACE_TString& section, - ACE_Configuration_Section_Key& result); - - ACE_Configuration_Heap (const ACE_Configuration_Heap& rhs); - ACE_Configuration_Heap& operator= (const ACE_Configuration_Heap& rhs); - - ACE_Allocator *allocator_; - SECTION_MAP *index_; - int default_map_size_; -}; - -#if defined (__ACE_INLINE__) -#include "ace/Configuration.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_CONFIGURATION_H */ diff --git a/ace/Configuration.i b/ace/Configuration.i deleted file mode 100644 index e32ebb06902..00000000000 --- a/ace/Configuration.i +++ /dev/null @@ -1,4 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -// Configuration.i - diff --git a/ace/Connector.cpp b/ace/Connector.cpp deleted file mode 100644 index cd728d4a399..00000000000 --- a/ace/Connector.cpp +++ /dev/null @@ -1,934 +0,0 @@ -// Connector.cpp -// $Id$ - -#ifndef ACE_CONNECTOR_C -#define ACE_CONNECTOR_C - -#include "ace/Connector.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(ace, Connector, "$Id$") - -// Shorthand names. -#define SH SVC_HANDLER -#define PR_CO_1 ACE_PEER_CONNECTOR_1 -#define PR_CO_2 ACE_PEER_CONNECTOR_2 -#define PR_AD ACE_PEER_CONNECTOR_ADDR - -ACE_ALLOC_HOOK_DEFINE(ACE_Connector) - -template void -ACE_Connector::dump (void) const -{ - ACE_TRACE ("ACE_Connector::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nclosing_ = %d"), this->closing_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nflags_ = %d"), this->flags_)); - this->handler_map_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// Bridge method for creating a SVC_HANDLER. The strategy for -// creating a SVC_HANDLER are configured into the Acceptor via it's -// . The default is to create a new SVC_HANDLER. -// However, subclasses can override this strategy to perform -// SVC_HANDLER creation in any way that they like (such as creating -// subclass instances of SVC_HANDLER, using a singleton, dynamically -// linking the handler, etc.). - -template int -ACE_Connector::make_svc_handler (SVC_HANDLER *&sh) -{ - ACE_TRACE ("ACE_Connector::make_svc_handler"); - - if (sh == 0) - ACE_NEW_RETURN (sh, - SH, - -1); - - // Set the reactor of the newly created to the same - // reactor that this is using. - if (this->reactor ()) - sh->reactor (this->reactor ()); - return 0; -} - -template int -ACE_Connector::activate_svc_handler (SVC_HANDLER *svc_handler) -{ - ACE_TRACE ("ACE_Connector::activate_svc_handler"); - // No errors initially - int error = 0; - - // See if we should enable non-blocking I/O on the 's - // peer. - if (ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK) != 0) - { - if (svc_handler->peer ().enable (ACE_NONBLOCK) == -1) - error = 1; - } - // Otherwise, make sure it's disabled by default. - else if (svc_handler->peer ().disable (ACE_NONBLOCK) == -1) - error = 1; - - // We are connected now, so try to open things up. - if (error || svc_handler->open ((void *) this) == -1) - { - // Make sure to close down the to avoid descriptor - // leaks. - svc_handler->close (0); - return -1; - } - else - return 0; -} - -template int -ACE_Connector::connect_svc_handler (SVC_HANDLER *&svc_handler, - const PR_AD &remote_addr, - ACE_Time_Value *timeout, - const PR_AD &local_addr, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_Connector::connect_svc_handler"); - - return this->connector_.connect (svc_handler->peer (), - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Connector::connect_svc_handler (SVC_HANDLER *&svc_handler, - SVC_HANDLER *&sh_copy, - const PR_AD &remote_addr, - ACE_Time_Value *timeout, - const PR_AD &local_addr, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_Connector::connect_svc_handler"); - - sh_copy = svc_handler; - return this->connector_.connect (svc_handler->peer (), - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Connector::open (ACE_Reactor *r, int flags) -{ - ACE_TRACE ("ACE_Connector::open"); - this->reactor (r); - this->flags_ = flags; - this->closing_ = 0; - return 0; -} - -template -ACE_Connector::ACE_Connector (ACE_Reactor *r, int flags) -{ - ACE_TRACE ("ACE_Connector::ACE_Connector"); - (void) this->open (r, flags); -} - -template -ACE_Svc_Tuple::ACE_Svc_Tuple (SVC_HANDLER *sh, - ACE_HANDLE handle, - const void *arg, - long id) - : svc_handler_ (sh), - handle_ (handle), - arg_ (arg), - cancellation_id_ (id) -{ - ACE_TRACE ("ACE_Svc_Tuple::ACE_Svc_Tuple"); -} - -template SVC_HANDLER * -ACE_Svc_Tuple::svc_handler (void) -{ - ACE_TRACE ("ACE_Svc_Tuple::svc_handler"); - return this->svc_handler_; -} - -template const void * -ACE_Svc_Tuple::arg (void) -{ - ACE_TRACE ("ACE_Svc_Tuple::arg"); - return this->arg_; -} - -template void -ACE_Svc_Tuple::arg (const void *v) -{ - ACE_TRACE ("ACE_Svc_Tuple::arg"); - this->arg_ = v; -} - -template ACE_HANDLE -ACE_Svc_Tuple::handle (void) -{ - ACE_TRACE ("ACE_Svc_Tuple::handle"); - return this->handle_; -} - -template void -ACE_Svc_Tuple::handle (ACE_HANDLE h) -{ - ACE_TRACE ("ACE_Svc_Tuple::handle"); - this->handle_ = h; -} - -template long -ACE_Svc_Tuple::cancellation_id (void) -{ - ACE_TRACE ("ACE_Svc_Tuple::cancellation_id"); - return this->cancellation_id_; -} - -template void -ACE_Svc_Tuple::cancellation_id (long id) -{ - ACE_TRACE ("ACE_Svc_Tuple::cancellation_id"); - this->cancellation_id_ = id; -} - -template void -ACE_Svc_Tuple::dump (void) const -{ - ACE_TRACE ("ACE_Svc_Tuple::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("svc_handler_ = %x"), this->svc_handler_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\narg_ = %x"), this->arg_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncancellation_id_ = %d"), this->cancellation_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// This method is called if a connection times out before completing. -// In this case, we call our cleanup_AST() method to cleanup the -// descriptor from the ACE_Connector's table. - -template int -ACE_Connector::handle_timeout (const ACE_Time_Value &tv, - const void *arg) -{ - ACE_TRACE ("ACE_Connector::handle_timeout"); - AST *ast = 0; - - if (this->cleanup_AST (((AST *) arg)->handle (), - ast) == -1) - return -1; - else - { - ACE_ASSERT (((AST *) arg) == ast); - - // We may need this seemingly unnecessary assignment to work - // around a bug with MSVC++? - SH *sh = ast->svc_handler (); - - // Forward to the SVC_HANDLER the that was passed in as a - // magic cookie during ACE_Connector::connect(). This gives the - // SVC_HANDLER an opportunity to take corrective action (e.g., - // wait a few milliseconds and try to reconnect again. - if (sh->handle_timeout (tv, ast->arg ()) == -1) - sh->handle_close (sh->get_handle (), ACE_Event_Handler::TIMER_MASK); - - delete ast; - return 0; - } -} - -template int -ACE_Connector::cleanup_AST (ACE_HANDLE handle, - ACE_Svc_Tuple *&ast) -{ - ACE_TRACE ("ACE_Connector::cleanup_AST"); - - // Locate the ACE_Svc_Handler corresponding to the socket - // descriptor. - if (this->handler_map_.find (handle, ast) == -1) - { - // Error, entry not found in map. - errno = ENOENT; - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p %d not found in map\n"), - ACE_TEXT ("find"), - handle), - -1); - } - - // Try to remove from ACE_Timer_Queue but if it's not there we - // ignore the error. - this->reactor ()->cancel_timer (ast->cancellation_id ()); - - // Remove ACE_HANDLE from ACE_Reactor. - this->reactor ()->remove_handler - (handle, ACE_Event_Handler::ALL_EVENTS_MASK | ACE_Event_Handler::DONT_CALL); - - // Remove ACE_HANDLE from the map. - this->handler_map_.unbind (handle); - return 0; -} - -// Called when a failure occurs during asynchronous connection -// establishment. Simply delegate all work to this->handle_output(). - -template int -ACE_Connector::handle_input (ACE_HANDLE h) -{ - ACE_TRACE ("ACE_Connector::handle_input"); - AST *ast = 0; - - if (this->cleanup_AST (h, ast) != -1) - { - ast->svc_handler ()->close (0); - delete ast; - } - return 0; // Already removed from the ACE_Reactor. -} - -// Finalize a connection established in non-blocking mode. When a -// non-blocking connect *succeeds* the descriptor becomes enabled for -// writing... Likewise, it is generally the case that when a -// non-blocking connect *fails* the descriptor becomes enabled for -// reading. - -template int -ACE_Connector::handle_output (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Connector::handle_output"); - AST *ast = 0; - - if (this->cleanup_AST (handle, ast) == -1) - return 0; - - ACE_ASSERT (ast != 0); // This shouldn't happen! - - // Try to find out if the reactor uses event associations for the - // handles it waits on. If so we need to reset it. - int reset_new_handle = this->reactor ()->uses_event_associations (); - - if (reset_new_handle) - this->connector_.reset_new_handle (handle); - - // Transfer ownership of the ACE_HANDLE to the SVC_HANDLER. - ast->svc_handler ()->set_handle (handle); - - PR_AD raddr; - -#if defined (ACE_HAS_BROKEN_NON_BLOCKING_CONNECTS) - // Win32 has a timing problem - if you check to see if the - // connection has completed too fast, it will fail - so wait 35 - // millisecond to let it catch up. - ACE_Time_Value tv (0, ACE_NON_BLOCKING_BUG_DELAY); - ACE_OS::sleep (tv); -#endif /* ACE_HAS_BROKEN_NON_BLOCKING_CONNECTS */ - - // Check to see if we're connected. - if (ast->svc_handler ()->peer ().get_remote_addr (raddr) != -1) - this->activate_svc_handler (ast->svc_handler ()); - else // Somethings gone wrong, so close down... - ast->svc_handler ()->close (0); - - delete ast; - return 0; -} - -template int -ACE_Connector::handle_exception (ACE_HANDLE h) -{ - ACE_TRACE ("ACE_Connector::handle_exception"); - - return this->handle_output (h); -} - -// Initiate connection to peer. - -template int -ACE_Connector::connect (SH *&sh, - const PR_AD &remote_addr, - const ACE_Synch_Options &synch_options, - const PR_AD &local_addr, - int reuse_addr, - int flags, - int perms) -{ - return this->connect_i (sh, - 0, - remote_addr, - synch_options, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Connector::connect (SH *&sh, - SH *&sh_copy, - const PR_AD &remote_addr, - const ACE_Synch_Options &synch_options, - const PR_AD &local_addr, - int reuse_addr, - int flags, - int perms) -{ - return this->connect_i (sh, - &sh_copy, - remote_addr, - synch_options, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Connector::connect_i (SH *&sh, - SH **sh_copy, - const PR_AD &remote_addr, - const ACE_Synch_Options &synch_options, - const PR_AD &local_addr, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_Connector::connect"); - - // If the user hasn't supplied us with a we'll use the - // factory method to create one. Otherwise, things will remain as - // they are... - if (this->make_svc_handler (sh) == -1) - return -1; - - ACE_Time_Value *timeout; - int use_reactor = synch_options[ACE_Synch_Options::USE_REACTOR]; - - if (use_reactor) - timeout = (ACE_Time_Value *) &ACE_Time_Value::zero; - else - timeout = (ACE_Time_Value *) synch_options.time_value (); - - int result; - if (sh_copy == 0) - result = this->connect_svc_handler (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); - else - result = this->connect_svc_handler (sh, - *sh_copy, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); - - // Delegate to connection strategy. - if (result == -1) - { - if (use_reactor && errno == EWOULDBLOCK) - { - // If the connection hasn't completed and we are using - // non-blocking semantics then register ourselves with the - // ACE_Reactor so that it will call us back when the - // connection is complete or we timeout, whichever comes - // first... Note that we needn't check the return value - // here because if something goes wrong that will reset - // errno this will be detected by the caller (since -1 is - // being returned...). - if (sh_copy == 0) - this->create_AST (sh, - synch_options); - else - this->create_AST (*sh_copy, - synch_options); - } - else - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - // Make sure to close down the Channel to avoid descriptor - // leaks. - if (sh_copy == 0) - { - if (sh) - sh->close (0); - } - else - { - if (*sh_copy) - (*sh_copy)->close (0); - } - } - return -1; - } - else - { - // Activate immediately if we are connected. - return this->activate_svc_handler (sh); - } -} - -// Initiate connection to peer. - -template int -ACE_Connector::connect_n (size_t n, - SH *sh[], - PR_AD remote_addrs[], - ACE_TCHAR *failed_svc_handlers, - const ACE_Synch_Options &synch_options) -{ - int result = 0; - - for (size_t i = 0; i < n; i++) - { - if (this->connect (sh[i], remote_addrs[i], synch_options) == -1 - && !(synch_options[ACE_Synch_Options::USE_REACTOR] - && errno == EWOULDBLOCK)) - { - result = -1; - if (failed_svc_handlers != 0) - // Mark this entry as having failed. - failed_svc_handlers[i] = 1; - } - else if (failed_svc_handlers != 0) - // Mark this entry as having succeeded. - failed_svc_handlers[i] = 0; - } - - return result; -} - -// Cancel a that was started asynchronously. -template int -ACE_Connector::cancel (SH *sh) -{ - ACE_TRACE ("ACE_Connector::cancel"); - MAP_ITERATOR mi (this->handler_map_); - - for (MAP_ENTRY *me = 0; - mi.next (me) != 0; - mi.advance ()) - if (me->int_id_->svc_handler () == sh) - { - AST *ast = 0; - this->cleanup_AST (me->ext_id_, ast); - ACE_ASSERT (ast == me->int_id_); - delete ast; - return 0; - } - - return -1; -} - -// Register the pending SVC_HANDLER with the map so that it can be -// activated later on when the connection complets. - -template int -ACE_Connector::create_AST (SH *sh, - const ACE_Synch_Options &synch_options) -{ - // Save/restore errno. - ACE_Errno_Guard error (errno); - ACE_TRACE ("ACE_Connector::create_AST"); - AST *ast; - - ACE_NEW_RETURN (ast, - AST (sh, - sh->get_handle (), - synch_options.arg (), -1), - -1); - - // Register this with the reactor for connection events. - ACE_Reactor_Mask mask = ACE_Event_Handler::CONNECT_MASK; - - // Bind ACE_Svc_Tuple with the ACE_HANDLE we're trying to connect. - if (this->handler_map_.bind (sh->get_handle (), ast) == -1) - goto fail1; - - else if (this->reactor ()->register_handler (sh->get_handle (), this, mask) == -1) - goto fail2; - // If we're starting connection under timer control then we need to - // schedule a timeout with the ACE_Reactor. - else - { - ACE_Time_Value *tv = (ACE_Time_Value *) synch_options.time_value (); - - if (tv != 0) - { - int cancellation_id = - this->reactor ()->schedule_timer - (this, (const void *) ast, *tv); - if (cancellation_id == -1) - goto fail3; - - ast->cancellation_id (cancellation_id); - return 0; - } - else - return 0; // Ok, everything worked just fine... - } - - // Undo previous actions using the ol' "goto label and fallthru" - // trick... -fail3: - this->reactor ()->remove_handler (this, - mask | ACE_Event_Handler::DONT_CALL); - /* FALLTHRU */ -fail2: - this->handler_map_.unbind (sh->get_handle ()); - /* FALLTHRU */ -fail1: - - // Close the svc_handler - sh->close (0); - - delete ast; - return -1; -} - -// Terminate the Client ACE_Connector by iterating over any -// unconnected ACE_Svc_Handler's and removing them from the -// ACE_Reactor. Note that we can't call handle_close() back at this -// point since we own these things and we'll just get called -// recursively! - -template int -ACE_Connector::close (void) -{ - ACE_TRACE ("ACE_Connector::close"); - return this->handle_close (); -} - -template int -ACE_Connector::handle_close (ACE_HANDLE, ACE_Reactor_Mask) -{ - ACE_TRACE ("ACE_Connector::handle_close"); - - if (this->reactor () != 0 && this->closing_ == 0) - { - // We're closing down now, so make sure not to call ourselves - // recursively via other calls to handle_close() (e.g., from the - // Timer_Queue). - this->closing_ = 1; - - MAP_ITERATOR mi (this->handler_map_); - - // Iterate through the map and shut down all the pending handlers. - - for (MAP_ENTRY *me = 0; - mi.next (me) != 0; - mi.advance ()) - { - AST *ast = 0; - this->cleanup_AST (me->ext_id_, ast); - - // Close the svc_handler - ACE_ASSERT (ast == me->int_id_); - me->int_id_->svc_handler ()->close (0); - - delete ast; - } - } - - return 0; -} -template int -ACE_Connector::fini (void) -{ - ACE_TRACE ("ACE_Connector::fini"); - - // Make sure to call close here since our destructor might not be - // called if we're being dynamically linked via the svc.conf. - this->handler_map_.close (); - - // Make sure we call our handle_close(), not a subclass's! - return ACE_Connector::handle_close (); -} - -// Hook called by the explicit dynamic linking facility. - -template int -ACE_Connector::init (int, ACE_TCHAR *[]) -{ - ACE_TRACE ("ACE_Connector::init"); - return -1; -} - -template int -ACE_Connector::suspend (void) -{ - ACE_TRACE ("ACE_Connector::suspend"); - return -1; -} - -template int -ACE_Connector::resume (void) -{ - ACE_TRACE ("ACE_Connector::resume"); - return -1; -} - -template int -ACE_Connector::info (ACE_TCHAR **strp, size_t length) const -{ - ACE_TRACE ("ACE_Connector::info"); - ACE_TCHAR buf[BUFSIZ]; - - ACE_OS::sprintf (buf, - ACE_TEXT ("%s\t %s"), - ACE_TEXT ("ACE_Connector"), - ACE_TEXT ("# connector factory\n")); - - if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) - return -1; - else - ACE_OS::strncpy (*strp, buf, length); - return ACE_OS::strlen (buf); -} - -template -ACE_Connector::~ACE_Connector (void) -{ - ACE_TRACE ("ACE_Connector::~ACE_Connector"); - // We will call our handle_close(), not a subclass's, due to the way - // that C++ destructors work. - this->handle_close (); -} - -template int -ACE_Strategy_Connector::open (ACE_Reactor *r, int flags) -{ - ACE_TRACE ("ACE_Connector::open"); - return this->open (r, 0, 0, 0, flags); -} - -template int -ACE_Strategy_Connector::open - (ACE_Reactor *r, - ACE_Creation_Strategy *cre_s, - ACE_Connect_Strategy *conn_s, - ACE_Concurrency_Strategy *con_s, - int flags) -{ - ACE_TRACE ("ACE_Connector::open"); - - this->reactor (r); - - // @@ Not implemented yet. - // this->flags_ = flags; - ACE_UNUSED_ARG (flags); - - // Initialize the creation strategy. - - // First we decide if we need to clean up. - if (this->creation_strategy_ != 0 && - this->delete_creation_strategy_ != 0 && - cre_s != 0) - { - delete this->creation_strategy_; - this->creation_strategy_ = 0; - this->delete_creation_strategy_ = 0; - } - - if (cre_s != 0) - this->creation_strategy_ = cre_s; - else if (this->creation_strategy_ == 0) - { - ACE_NEW_RETURN (this->creation_strategy_, - CREATION_STRATEGY, - -1); - this->delete_creation_strategy_ = 1; - } - - - // Initialize the accept strategy. - - if (this->connect_strategy_ != 0 && - this->delete_connect_strategy_ != 0 && - conn_s != 0) - { - delete this->connect_strategy_; - this->connect_strategy_ = 0; - this->delete_connect_strategy_ = 0; - } - - if (conn_s != 0) - this->connect_strategy_ = conn_s; - else if (this->connect_strategy_ == 0) - { - ACE_NEW_RETURN (this->connect_strategy_, - CONNECT_STRATEGY, - -1); - this->delete_connect_strategy_ = 1; - } - - // Initialize the concurrency strategy. - - if (this->concurrency_strategy_ != 0 && - this->delete_concurrency_strategy_ != 0 && - con_s != 0) - { - delete this->concurrency_strategy_; - this->concurrency_strategy_ = 0; - this->delete_concurrency_strategy_ = 0; - } - - if (con_s != 0) - this->concurrency_strategy_ = con_s; - else if (this->concurrency_strategy_ == 0) - { - ACE_NEW_RETURN (this->concurrency_strategy_, - CONCURRENCY_STRATEGY, - -1); - this->delete_concurrency_strategy_ = 1; - } - - return 0; -} - -template -ACE_Strategy_Connector::ACE_Strategy_Connector - (ACE_Reactor *reactor, - ACE_Creation_Strategy *cre_s, - ACE_Connect_Strategy *conn_s, - ACE_Concurrency_Strategy *con_s, - int flags) - : creation_strategy_ (0), - delete_creation_strategy_ (0), - connect_strategy_ (0), - delete_connect_strategy_ (0), - concurrency_strategy_ (0), - delete_concurrency_strategy_ (0) -{ - ACE_TRACE ("ACE_Connector::ACE_Connector"); - - if (this->open (reactor, cre_s, conn_s, con_s, flags) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Strategy_Connector::ACE_Strategy_Connector"))); -} - -template -ACE_Strategy_Connector::~ACE_Strategy_Connector (void) -{ - ACE_TRACE ("ACE_Strategy_Connector::~ACE_Strategy_Connector"); - - // Close down - this->close (); -} - -template int -ACE_Strategy_Connector::close (void) -{ - if (this->delete_creation_strategy_) - delete this->creation_strategy_; - this->delete_creation_strategy_ = 0; - this->creation_strategy_ = 0; - - if (this->delete_connect_strategy_) - delete this->connect_strategy_; - this->delete_connect_strategy_ = 0; - this->connect_strategy_ = 0; - - if (this->delete_concurrency_strategy_) - delete this->concurrency_strategy_; - this->delete_concurrency_strategy_ = 0; - this->concurrency_strategy_ = 0; - - return SUPER::close (); -} - -template int -ACE_Strategy_Connector::make_svc_handler (SVC_HANDLER *&sh) -{ - return this->creation_strategy_->make_svc_handler (sh); -} - -template int -ACE_Strategy_Connector::connect_svc_handler - (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - return this->connect_strategy_->connect_svc_handler (sh, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Strategy_Connector::connect_svc_handler - (SVC_HANDLER *&sh, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms) -{ - return this->connect_strategy_->connect_svc_handler (sh, - sh_copy, - remote_addr, - timeout, - local_addr, - reuse_addr, - flags, - perms); -} - -template int -ACE_Strategy_Connector::activate_svc_handler (SVC_HANDLER *svc_handler) -{ - return this->concurrency_strategy_->activate_svc_handler (svc_handler, this); -} - -template ACE_Creation_Strategy * -ACE_Strategy_Connector::creation_strategy (void) const -{ - return this->creation_strategy_; -} - -template ACE_Connect_Strategy * -ACE_Strategy_Connector::connect_strategy (void) const -{ - return this->connect_strategy_; -} - -template ACE_Concurrency_Strategy * -ACE_Strategy_Connector::concurrency_strategy (void) const -{ - return this->concurrency_strategy_; -} - -#undef SH -#undef PR_CO_1 -#undef PR_CO_2 -#endif /* ACE_CONNECTOR_C */ diff --git a/ace/Connector.h b/ace/Connector.h deleted file mode 100644 index e352d35ebbc..00000000000 --- a/ace/Connector.h +++ /dev/null @@ -1,490 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Connector.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_CONNECTOR_H -#define ACE_CONNECTOR_H -#include "ace/pre.h" - -#include "ace/Service_Config.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Object.h" -#include "ace/Map_Manager.h" -#include "ace/Svc_Handler.h" -#include "ace/Strategies.h" - -template -class ACE_Svc_Tuple -{ - // = TITLE - // Holds the ACE_Svc_Handler and its argument and - // until an asynchronous connection completes. - // - // = DESCRIPTION - // This is a no-brainer... -public: - // = Initialization methods. - ACE_Svc_Tuple (SVC_HANDLER *, - ACE_HANDLE, - const void * = 0, - long timer_id = -1); - - // = Get SVC_HANDLER. - SVC_HANDLER *svc_handler (void); - - // = Get/set handle. - ACE_HANDLE handle (void); - // Get handle. - void handle (ACE_HANDLE); - // Set handle. - - // = Get/set argument. - const void *arg (void); - // Get argument. - void arg (const void *); - // Set argument. - - // = Set/get timer cancellation handle. - long cancellation_id (void); - // Get cancellation id. - void cancellation_id (long timer_id); - // Set cancellation id. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - SVC_HANDLER *svc_handler_; - // Associated SVC_HANDLER. - - ACE_HANDLE handle_; - // IPC that we are trying to connect. - - const void *arg_; - // Associated argument. - - long cancellation_id_; - // Associated cancellation id. -}; - -template -class ACE_Connector : public ACE_Service_Object -{ - // = TITLE - // Generic factory for actively connecting clients and creating - // service handlers (SVC_HANDLERs). - // - // = DESCRIPTION - // Implements the strategy for actively establishing connections - // with clients. An ACE_Connector is parameterized by concrete - // types that conform to the interfaces of PEER_CONNECTOR and - // SVC_HANDLER. The PEER_CONNECTOR is instantiated with a - // transport mechanism that passively establishes connections. - // The SVC_HANDLER is instantiated with a concrete type that - // performs the application-specific service. An ACE_Connector - // inherits from ACE_Service_Object, which in turn inherits from - // ACE_Event_Handler. This enables the ACE_Reactor to dispatch - // the ACE_Connector's handle_output method when connections - // complete asynchronously. The handle_output method performs - // the connector's active connection establishment and service - // activation strategy. -public: - // = Initialization and termination methods. - - // typedef ACE_TYPENAME ACE_PEER_CONNECTOR_ADDR PEER_ADDR; -#if defined (ACE_HAS_TYPENAME_KEYWORD) - typedef ACE_PEER_CONNECTOR_ADDR ACE_PEER_ADDR_TYPEDEF; -#endif /* ACE_HAS_TYPENAME_KEYWORD */ - - ACE_Connector (ACE_Reactor *r = ACE_Reactor::instance (), - int flags = 0); - // Initialize a connector. indicates how 's - // should be initialized prior to being activated. Right now, the - // only flag that is processed is , which enabled - // non-blocking I/O on the when it is opened. - - - virtual int open (ACE_Reactor *r = ACE_Reactor::instance (), - int flags = 0); - // Initialize a connector. indicates how 's - // should be initialized prior to being activated. Right now, the - // only flag that is processed is , which enabled - // non-blocking I/O on the when it is opened. - - virtual ~ACE_Connector (void); - // Shutdown a connector and release resources. - - // = Connection establishment methods. - - virtual int connect (SVC_HANDLER *&svc_handler, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options = ACE_Synch_Options::defaults, - const ACE_PEER_CONNECTOR_ADDR &local_addr - = (ACE_PEER_CONNECTOR_ADDR &) ACE_PEER_CONNECTOR_ADDR_ANY, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - // Initiate connection of to peer at - // using . If the caller wants to designate the - // selected they can (and can also insist that the - // be reused by passing a value == - // 1). and can be used to pass any flags that are - // needed to perform specific operations such as opening a file - // within connect with certain permissions. If the connection fails - // the hook on the will be called - // automatically to prevent resource leaks. - - virtual int connect (SVC_HANDLER *&svc_handler_hint, - SVC_HANDLER *&svc_handler, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options = ACE_Synch_Options::defaults, - const ACE_PEER_CONNECTOR_ADDR &local_addr - = (ACE_PEER_CONNECTOR_ADDR &) ACE_PEER_CONNECTOR_ADDR_ANY, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - // This is a variation on the previous method. On cached - // connectors the variable can be used as a hint - // for future lookups. Since this variable is modified in the - // context of the internal cache its use is thread-safe. But the - // actual svc_handler for the current connection is returned in the - // second parameter . If the connection fails the - // hook on the will be called automatically to - // prevent resource leaks. - - virtual int connect_n (size_t n, - SVC_HANDLER *svc_handlers[], - ACE_PEER_CONNECTOR_ADDR remote_addrs[], - ACE_TCHAR *failed_svc_handlers = 0, - const ACE_Synch_Options &synch_options = - ACE_Synch_Options::defaults); - // Initiate connection of to peers at - // using . Returns -1 if failure - // occurs and 0 otherwise. If is non-NULL, a - // 1 is placed in the corresponding index of - // for each that failed to connect, else a 0 is - // placed in that index. - - virtual int cancel (SVC_HANDLER *svc_handler); - // Cancel a that was started asynchronously. Note that - // this is the only case when the Connector does not actively close - // the . It is left up to the caller of to - // decide the fate of the . - - virtual int close (void); - // Close down the Connector - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - // = Helpful typedefs. - - typedef ACE_Svc_Tuple - AST; - - typedef ACE_Map_Manager *, ACE_SYNCH_RW_MUTEX> - MAP_MANAGER; - typedef ACE_Map_Iterator *, ACE_SYNCH_RW_MUTEX> - MAP_ITERATOR; - typedef ACE_Map_Entry *> - MAP_ENTRY; - - // = The following two methods define the Connector's strategies for - // creating, connecting, and activating SVC_HANDLER's, respectively. - - virtual int make_svc_handler (SVC_HANDLER *&sh); - // Bridge method for creating a SVC_HANDLER. The default is to - // create a new SVC_HANDLER only if == 0, else is - // unchanged. However, subclasses can override this policy to - // perform SVC_HANDLER creation in any way that they like (such as - // creating subclass instances of SVC_HANDLER, using a singleton, - // dynamically linking the handler, etc.). Returns -1 if failure, - // else 0. - - virtual int connect_svc_handler (SVC_HANDLER *&svc_handler, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - virtual int connect_svc_handler (SVC_HANDLER *&svc_handler, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - // Bridge method for connecting the to the - // . The default behavior delegates to the - // . - - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - // Bridge method for activating a with the appropriate - // concurrency strategy. The default behavior of this method is to - // activate the SVC_HANDLER by calling its method (which - // allows the SVC_HANDLER to define its own concurrency strategy). - // However, subclasses can override this strategy to do more - // sophisticated concurrency activations (such as creating the - // SVC_HANDLER as an "active object" via multi-threading or - // multi-processing). - - virtual int handle_input (ACE_HANDLE); - // Called by ACE_Reactor when asynchronous connections fail. - - virtual int handle_output (ACE_HANDLE); - // Called by ACE_Reactor when asynchronous connections succeed. - - virtual int handle_exception (ACE_HANDLE fd = ACE_INVALID_HANDLE); - // Called by ACE_Reactor when asynchronous connections complete (on - // some platforms only). - - // = Dynamic linking hooks. - virtual int init (int argc, ACE_TCHAR *argv[]); - // Default version does no work and returns -1. Must be overloaded - // by application developer to do anything meaningful. - - virtual int fini (void); - // Calls to shutdown the Connector gracefully. - - virtual int info (ACE_TCHAR **, size_t) const; - // Default version returns address info in . - - // = Demultiplexing hooks. - virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); - // Terminate the Client ACE_Connector by iterating over any - // unconnected ACE_Svc_Handler's and removing them from the - // ACE_Reactor. - - virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); - // This method is called if a connection times out before - // completing. - - // = Service management hooks. - virtual int suspend (void); - // Default version does no work and returns -1. Must be overloaded - // by application developer to do anything meaningful. - - virtual int resume (void); - // Default version does no work and returns -1. Must be overloaded - // by application developer to do anything meaningful. - - int create_AST (SVC_HANDLER *, - const ACE_Synch_Options &); - // Creates and inserts an ACE_Svc_Tuple into the . - // so that we can continue accepting this connection asynchronously. - - int cleanup_AST (ACE_HANDLE, AST *&); - // Cleanup the and returns the appropriate - // ACE_Svc_Tuple (which is 0 if there is no associated tuple). - - virtual int connect_i (SVC_HANDLER *&svc_handler, - SVC_HANDLER **sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - const ACE_Synch_Options &synch_options, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - // Implementation the methods. - - MAP_MANAGER handler_map_; - // Lookup table that maps an I/O handle to a SVC_HANDLER *. - -private: - ACE_PEER_CONNECTOR connector_; - // This is the concrete connector factory (it keeps no state so the - // is reentrant). - - char closing_; - // Keeps track of whether we are in the process of closing (required - // to avoid circular calls to ). - - int flags_; - // Flags that indicate how 's should be initialized - // prior to being activated. Right now, the only flag that is - // processed is , which enabled non-blocking I/O on - // the when it is opened. -}; - -template -class ACE_Strategy_Connector : public ACE_Connector -{ - // = TITLE - // Abstract factory for creating a service handler - // (SVC_HANDLER), connecting the SVC_HANDLER, and activating the - // SVC_HANDLER. - // - // = DESCRIPTION - // Implements a flexible and extensible set of strategies for - // actively establishing connections with clients. There are - // three main strategies: (1) creating a SVC_HANDLER, (2) - // actively connecting a new connection from a client into the - // SVC_HANDLER, and (3) activating the SVC_HANDLER with a - // particular concurrency mechanism. -public: - ACE_Strategy_Connector (ACE_Reactor *r = ACE_Reactor::instance (), - ACE_Creation_Strategy * = 0, - ACE_Connect_Strategy * = 0, - ACE_Concurrency_Strategy * = 0, - int flags = 0); - // Initialize a connector. indicates how 's - // should be initialized prior to being activated. Right now, the - // only flag that is processed is , which enabled - // non-blocking I/O on the when it is opened. - - virtual int open (ACE_Reactor *r, - int flags); - // Initialize a connector. indicates how 's - // should be initialized prior to being activated. Right now, the - // only flag that is processed is , which enabled - // non-blocking I/O on the when it is opened. - // Default strategies would be created and used. - - virtual int open (ACE_Reactor *r = ACE_Reactor::instance (), - ACE_Creation_Strategy * = 0, - ACE_Connect_Strategy * = 0, - ACE_Concurrency_Strategy * = 0, - int flags = 0); - // Initialize a connector. indicates how 's - // should be initialized prior to being activated. Right now, the - // only flag that is processed is , which enabled - // non-blocking I/O on the when it is opened. - - virtual ~ACE_Strategy_Connector (void); - // Shutdown a connector and release resources. - - virtual int close (void); - // Close down the Connector - - // = Define some useful typedefs traits. - typedef ACE_Creation_Strategy - CREATION_STRATEGY; - typedef ACE_Connect_Strategy - CONNECT_STRATEGY; - typedef ACE_Concurrency_Strategy - CONCURRENCY_STRATEGY; - typedef ACE_Connector - SUPER; - - // = Strategies accessors - virtual ACE_Creation_Strategy *creation_strategy (void) const; - virtual ACE_Connect_Strategy *connect_strategy (void) const; - virtual ACE_Concurrency_Strategy *concurrency_strategy (void) const; - -protected: - // = The following three methods define the 's strategies - // for creating, connecting, and activating 's, - // respectively. - - virtual int make_svc_handler (SVC_HANDLER *&sh); - // Bridge method for creating a . The strategy for - // creating a are configured into the Connector via - // it's . The default is to create a new - // only if == 0, else is unchanged. - // However, subclasses can override this policy to perform - // creation in any way that they like (such as - // creating subclass instances of , using a singleton, - // dynamically linking the handler, etc.). Returns -1 if failure, - // else 0. - - virtual int connect_svc_handler (SVC_HANDLER *&sh, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - // Bridge method for connecting the new connection into the - // . The default behavior delegates to the - // in the . - - virtual int connect_svc_handler (SVC_HANDLER *&sh, - SVC_HANDLER *&sh_copy, - const ACE_PEER_CONNECTOR_ADDR &remote_addr, - ACE_Time_Value *timeout, - const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, - int flags, - int perms); - // Bridge method for connecting the new connection into the - // . The default behavior delegates to the - // in the . - // is used to obtain a copy of the pointer, but that - // can be kept in the stack; the motivation is a bit too long to - // include here, but basically we want to modify safely, using - // the internal locks in the Connect_Strategy, while saving a TSS - // copy in , usually located in the stack. - - virtual int activate_svc_handler (SVC_HANDLER *svc_handler); - // Bridge method for activating a with the appropriate - // concurrency strategy. The default behavior of this method is to - // activate the by calling its method (which - // allows the to define its own concurrency strategy). - // However, subclasses can override this strategy to do more - // sophisticated concurrency activations (such as creating the - // as an "active object" via multi-threading or - // multi-processing). - - // = Strategy objects. - - CREATION_STRATEGY *creation_strategy_; - // Creation strategy for an . - - int delete_creation_strategy_; - // 1 if created the creation strategy and thus should - // delete it, else 0. - - CONNECT_STRATEGY *connect_strategy_; - // Connect strategy for a . - - int delete_connect_strategy_; - // 1 if created the connect strategy and thus should - // delete it, else 0. - - CONCURRENCY_STRATEGY *concurrency_strategy_; - // Concurrency strategy for an . - - int delete_concurrency_strategy_; - // 1 if created the concurrency strategy and thus should - // delete it, else 0. -}; - -#include "ace/Connector.i" - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Connector.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Connector.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_CONNECTOR_H */ diff --git a/ace/Connector.i b/ace/Connector.i deleted file mode 100644 index 7c7afcc0184..00000000000 --- a/ace/Connector.i +++ /dev/null @@ -1,4 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Connector.i diff --git a/ace/Containers.cpp b/ace/Containers.cpp deleted file mode 100644 index 9fb16735ea4..00000000000 --- a/ace/Containers.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -#include "ace/OS.h" -#include "ace/Containers.h" - -ACE_RCSID(ace, Containers, "$Id$") - -#if !defined (__ACE_INLINE__) -#include "ace/Containers.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Double_Linked_List; -template class ACE_Double_Linked_List_Iterator_Base; -template class ACE_Double_Linked_List_Iterator; -template class ACE_Double_Linked_List_Reverse_Iterator; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Double_Linked_List -#pragma instantiate ACE_Double_Linked_List_Iterator_Base -#pragma instantiate ACE_Double_Linked_List_Iterator -#pragma instantiate ACE_Double_Linked_List_Reverse_Iterator -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - diff --git a/ace/Containers.h b/ace/Containers.h deleted file mode 100644 index 46512fe9836..00000000000 --- a/ace/Containers.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Containers.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_CONTAINERS_H -#define ACE_CONTAINERS_H -#include "ace/pre.h" - -#include "ace/OS.h" -#include "ace/Malloc_Base.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -template -class ACE_Double_Linked_List; - -template -class ACE_Double_Linked_List_Iterator_Base; -template -class ACE_Double_Linked_List_Iterator; -template -class ACE_Double_Linked_List_Reverse_Iterator; - -class ACE_Export ACE_DLList_Node -{ - // = TITLE - // Base implementation of element in a DL list. Needed for - // ACE_Double_Linked_List. -public: - friend class ACE_Double_Linked_List; - friend class ACE_Double_Linked_List_Iterator_Base; - friend class ACE_Double_Linked_List_Iterator; - friend class ACE_Double_Linked_List_Reverse_Iterator; - - ACE_DLList_Node (void *&i, - ACE_DLList_Node *n = 0, - ACE_DLList_Node *p = 0); - ~ACE_DLList_Node (void); - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - void *item_; - - ACE_DLList_Node *next_; - ACE_DLList_Node *prev_; - -protected: - ACE_DLList_Node (void); -}; - -#if defined (__ACE_INLINE__) -#include "ace/Containers.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/Containers_T.h" - -#include "ace/post.h" -#endif /* ACE_CONTAINERS_H */ diff --git a/ace/Containers.i b/ace/Containers.i deleted file mode 100644 index 1312f2a47a6..00000000000 --- a/ace/Containers.i +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -ACE_DLList_Node::ACE_DLList_Node (void) - : item_ (0), - next_ (0), - prev_ (0) -{ -} - -ACE_INLINE -ACE_DLList_Node::ACE_DLList_Node (void *&i, - ACE_DLList_Node *n, - ACE_DLList_Node *p) - : item_ (i), - next_ (n), - prev_ (p) -{ -} - -ACE_INLINE -ACE_DLList_Node::~ACE_DLList_Node (void) -{ -} diff --git a/ace/Containers_T.cpp b/ace/Containers_T.cpp deleted file mode 100644 index 5cdc6364b86..00000000000 --- a/ace/Containers_T.cpp +++ /dev/null @@ -1,2685 +0,0 @@ -// $Id$ - -#ifndef ACE_CONTAINERS_T_C -#define ACE_CONTAINERS_T_C - -#include "ace/Malloc.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Containers.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Containers_T.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Containers_T, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Stack) - -template void -ACE_Bounded_Stack::dump (void) const -{ - ACE_TRACE ("ACE_Bounded_Stack::dump"); -} - -template -ACE_Bounded_Stack::ACE_Bounded_Stack (size_t size) - : top_ (0), - size_ (size) -{ - ACE_NEW (this->stack_, - T[size]); - ACE_TRACE ("ACE_Bounded_Stack::ACE_Bounded_Stack"); -} - -template -ACE_Bounded_Stack::ACE_Bounded_Stack (const ACE_Bounded_Stack &s) - : top_ (s.top_), - size_ (s.size_) -{ - ACE_NEW (this->stack_, - T[s.size_]); - - ACE_TRACE ("ACE_Bounded_Stack::ACE_Bounded_Stack"); - - for (size_t i = 0; i < this->top_; i++) - this->stack_[i] = s.stack_[i]; -} - -template void -ACE_Bounded_Stack::operator= (const ACE_Bounded_Stack &s) -{ - ACE_TRACE ("ACE_Bounded_Stack::operator="); - - if (&s != this) - { - if (this->size_ < s.size_) - { - delete [] this->stack_; - ACE_NEW (this->stack_, - T[s.size_]); - } - this->top_ = s.top_; - - for (size_t i = 0; i < this->top_; i++) - this->stack_[i] = s.stack_[i]; - } -} - -template -ACE_Bounded_Stack::~ACE_Bounded_Stack (void) -{ - ACE_TRACE ("ACE_Bounded_Stack::~ACE_Bounded_Stack"); - delete [] this->stack_; -} - -// ---------------------------------------- - -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Stack) - -template void -ACE_Fixed_Stack::dump (void) const -{ - ACE_TRACE ("ACE_Fixed_Stack::dump"); -} - -template -ACE_Fixed_Stack::ACE_Fixed_Stack (void) - : top_ (0), - size_ (ACE_SIZE) -{ - ACE_TRACE ("ACE_Fixed_Stack::ACE_Fixed_Stack"); -} - -template -ACE_Fixed_Stack::ACE_Fixed_Stack (const ACE_Fixed_Stack &s) - : top_ (s.top_), - size_ (s.size_) -{ - ACE_TRACE ("ACE_Fixed_Stack::ACE_Fixed_Stack"); - for (size_t i = 0; i < this->top_; i++) - this->stack_[i] = s.stack_[i]; -} - -template void -ACE_Fixed_Stack::operator= (const ACE_Fixed_Stack &s) -{ - ACE_TRACE ("ACE_Fixed_Stack::operator="); - - if (&s != this) - { - this->top_ = s.top_; - - for (size_t i = 0; i < this->top_; i++) - this->stack_[i] = s.stack_[i]; - } -} - -template -ACE_Fixed_Stack::~ACE_Fixed_Stack (void) -{ - ACE_TRACE ("ACE_Fixed_Stack::~ACE_Fixed_Stack"); -} - -//---------------------------------------- - -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Stack) - -template void -ACE_Unbounded_Stack::dump (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Stack::dump"); -} - -template -ACE_Unbounded_Stack::ACE_Unbounded_Stack (ACE_Allocator *alloc) - : head_ (0), - cur_size_ (0), - allocator_ (alloc) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::ACE_Unbounded_Stack"); - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node); - this->head_->next_ = this->head_; -} - -template void -ACE_Unbounded_Stack::delete_all_nodes (void) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::delete_all_nodes"); - - while (this->is_empty () == 0) - { - ACE_Node *temp = this->head_->next_; - this->head_->next_ = temp->next_; - ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free, - ACE_Node, ); - } - - this->cur_size_ = 0; - - ACE_ASSERT (this->head_ == this->head_->next_ - && this->is_empty ()); -} - -template void -ACE_Unbounded_Stack::copy_all_nodes (const ACE_Unbounded_Stack &s) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::copy_all_nodes"); - - ACE_ASSERT (this->head_ == this->head_->next_); - - ACE_Node *temp = this->head_; - - for (ACE_Node *s_temp = s.head_->next_; - s_temp != s.head_; - s_temp = s_temp->next_) - { - ACE_Node *nptr = temp->next_; - ACE_NEW_MALLOC (temp->next_, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node (s_temp->item_, nptr)); - temp = temp->next_; - } - this->cur_size_ = s.cur_size_; -} - -template -ACE_Unbounded_Stack::ACE_Unbounded_Stack (const ACE_Unbounded_Stack &s) - : head_ (0), - cur_size_ (0), - allocator_ (s.allocator_) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node); - this->head_->next_ = this->head_; - - // ACE_TRACE ("ACE_Unbounded_Stack::ACE_Unbounded_Stack"); - this->copy_all_nodes (s); -} - -template void -ACE_Unbounded_Stack::operator= (const ACE_Unbounded_Stack &s) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::operator="); - - if (this != &s) - { - this->delete_all_nodes (); - this->copy_all_nodes (s); - } -} - -template -ACE_Unbounded_Stack::~ACE_Unbounded_Stack (void) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::~ACE_Unbounded_Stack"); - - this->delete_all_nodes (); - ACE_DES_FREE_TEMPLATE (head_, - this->allocator_->free, - ACE_Node, - ); -} - -template int -ACE_Unbounded_Stack::push (const T &new_item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::push"); - - ACE_Node *temp; - - ACE_NEW_MALLOC_RETURN (temp, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node (new_item, this->head_->next_), - -1); - this->head_->next_ = temp; - this->cur_size_++; - return 0; -} - -template int -ACE_Unbounded_Stack::pop (T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::pop"); - - if (this->is_empty ()) - return -1; - else - { - ACE_Node *temp = this->head_->next_; - item = temp->item_; - this->head_->next_ = temp->next_; - - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - this->cur_size_--; - return 0; - } -} - -template int -ACE_Unbounded_Stack::find (const T &item) const -{ - // ACE_TRACE ("ACE_Unbounded_Stack::find"); - // Set into the dummy node. - this->head_->item_ = item; - - ACE_Node *temp = this->head_->next_; - - // Keep looping until we find the item. - while (!(temp->item_ == item)) - temp = temp->next_; - - // If we found the dummy node then it's not really there, otherwise, - // it is there. - return temp == this->head_ ? -1 : 0; -} - -template int -ACE_Unbounded_Stack::insert (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::insert"); - - if (this->find (item) == 0) - return 1; - else - return this->push (item); -} - -template int -ACE_Unbounded_Stack::remove (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack::remove"); - - // Insert the item to be founded into the dummy node. - this->head_->item_ = item; - - ACE_Node *curr = this->head_; - - while (!(curr->next_->item_ == item)) - curr = curr->next_; - - if (curr->next_ == this->head_) - return -1; // Item was not found. - else - { - ACE_Node *temp = curr->next_; - // Skip over the node that we're deleting. - curr->next_ = temp->next_; - this->cur_size_--; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - return 0; - } -} - -template -ACE_Unbounded_Queue::ACE_Unbounded_Queue (ACE_Allocator *alloc) - : head_ (0), - cur_size_ (0), - allocator_ (alloc) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::ACE_Unbounded_Queue (void)"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node); - // Make the list circular by pointing it back to itself. - this->head_->next_ = this->head_; -} - -template -ACE_Unbounded_Queue::ACE_Unbounded_Queue (const ACE_Unbounded_Queue &us) - : head_ (0), - cur_size_ (0), - allocator_ (us.allocator_) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::ACE_Unbounded_Queue"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node); - this->head_->next_ = this->head_; - this->copy_nodes (us); -} - -template void -ACE_Unbounded_Queue::operator= (const ACE_Unbounded_Queue &us) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::operator="); - - if (this != &us) - { - this->delete_nodes (); - this->copy_nodes (us); - } -} - -template ACE_Unbounded_Queue_Iterator -ACE_Unbounded_Queue::begin (void) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::begin"); - return ACE_Unbounded_Queue_Iterator (*this); -} - -template ACE_Unbounded_Queue_Iterator -ACE_Unbounded_Queue::end (void) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::end"); - return ACE_Unbounded_Queue_Iterator (*this, 1); -} - - -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Queue) - -template void -ACE_Unbounded_Queue::dump (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Queue::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_ = %u"), this->head_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_->next_ = %u"), this->head_->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d\n"), this->cur_size_)); - - T *item = 0; -#if !defined (ACE_NLOGGING) - size_t count = 1; -#endif /* ! ACE_NLOGGING */ - - for (ACE_Unbounded_Queue_Iterator iter (*(ACE_Unbounded_Queue *) this); - iter.next (item) != 0; - iter.advance ()) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("count = %d\n"), count++)); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template void -ACE_Unbounded_Queue::copy_nodes (const ACE_Unbounded_Queue &us) -{ - for (ACE_Node *curr = us.head_->next_; - curr != us.head_; - curr = curr->next_) - if (this->enqueue_tail (curr->item_) == -1) - // @@ What's the right thing to do here? - this->delete_nodes (); -} - -template void -ACE_Unbounded_Queue::delete_nodes (void) -{ - for (ACE_Node *curr = this->head_->next_; - // Keep looking until we've hit the dummy node. - curr != this->head_; - ) - { - ACE_Node *temp = curr; - curr = curr->next_; - - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - this->cur_size_--; - // @@ Doesnt make sense to have this check since - // this will always be true. - // ACE_ASSERT (this->cur_size_ >= 0); - } - - // Reset the list to be a circular list with just a dummy node. - this->head_->next_ = this->head_; -} - -template -ACE_Unbounded_Queue::~ACE_Unbounded_Queue (void) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::~ACE_Unbounded_Queue (void)"); - - this->delete_nodes (); - ACE_DES_FREE_TEMPLATE (head_, - this->allocator_->free, - ACE_Node, - ); - this->head_ = 0; -} - -template int -ACE_Unbounded_Queue::enqueue_head (const T &new_item) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::enqueue_tail"); - - ACE_Node *temp; - - // Create a new node that points to the original head. - ACE_NEW_MALLOC_RETURN (temp, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node (new_item, this->head_->next_), - -1); - // Link this pointer into the front of the list. Note that the - // "real" head of the queue is next_>, whereas is - // just a pointer to the dummy node. - this->head_->next_ = temp; - - this->cur_size_++; - return 0; -} - -template int -ACE_Unbounded_Queue::enqueue_tail (const T &new_item) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::enqueue_head"); - - ACE_Node *temp; - - // Insert into the old dummy node location. Note that this - // isn't actually the "head" item in the queue, it's a dummy node at - // the "tail" of the queue... - this->head_->item_ = new_item; - - // Create a new dummy node. - ACE_NEW_MALLOC_RETURN (temp, - (ACE_Node *) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node (this->head_->next_), -1); - // Link this dummy pointer into the list. - this->head_->next_ = temp; - - // Point the head to the new dummy node. - this->head_ = temp; - - this->cur_size_++; - return 0; -} - -template int -ACE_Unbounded_Queue::dequeue_head (T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::dequeue_head"); - - // Check for empty queue. - if (this->is_empty ()) - return -1; - - ACE_Node *temp = this->head_->next_; - - item = temp->item_; - this->head_->next_ = temp->next_; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - --this->cur_size_; - return 0; -} - -template void -ACE_Unbounded_Queue::reset (void) -{ - ACE_TRACE ("reset"); - - this->delete_nodes (); -} - -template int -ACE_Unbounded_Queue::get (T *&item, size_t slot) const -{ - // ACE_TRACE ("ACE_Unbounded_Queue::get"); - - ACE_Node *curr = this->head_->next_; - - size_t i; - - for (i = 0; i < this->cur_size_; i++) - { - if (i == slot) - break; - - curr = curr->next_; - } - - if (i < this->cur_size_) - { - item = &curr->item_; - return 0; - } - else - return -1; -} - -template int -ACE_Unbounded_Queue::set (const T &item, - size_t slot) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::set"); - - ACE_Node *curr = this->head_->next_; - - size_t i; - - for (i = 0; - i < slot && i < this->cur_size_; - i++) - curr = curr->next_; - - if (i < this->cur_size_) - { - // We're in range, so everything's cool. - curr->item_ = item; - return 0; - } - else - { - // We need to expand the list. - - // A common case will be increasing the set size by 1. - // Therefore, we'll optimize for this case. - if (i == slot) - { - // Try to expand the size of the set by 1. - if (this->enqueue_tail (item) == -1) - return -1; - else - return 0; - } - else - { - T dummy; - - // We need to expand the list by multiple (dummy) items. - for (; i < slot; i++) - { - // This head points to the existing dummy node, which is - // about to be overwritten when we add the new dummy - // node. - curr = this->head_; - - // Try to expand the size of the set by 1, but don't - // store anything in the dummy node (yet). - if (this->enqueue_tail (dummy) == -1) - return -1; - } - - curr->item_ = item; - return 0; - } - } -} - -template void -ACE_Unbounded_Queue_Iterator::dump (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Queue_Iterator::dump"); -} - -template -ACE_Unbounded_Queue_Iterator::ACE_Unbounded_Queue_Iterator (ACE_Unbounded_Queue &q, int end) - : current_ (end == 0 ? q.head_->next_ : q.head_ ), - queue_ (q) -{ - // ACE_TRACE ("ACE_Unbounded_Queue_Iterator::ACE_Unbounded_Queue_Iterator"); -} - -template int -ACE_Unbounded_Queue_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Unbounded_Queue_Iterator::advance"); - this->current_ = this->current_->next_; - return this->current_ != this->queue_.head_; -} - -template int -ACE_Unbounded_Queue_Iterator::first (void) -{ - // ACE_TRACE ("ACE_Unbounded_Queue_Iterator::first"); - this->current_ = this->queue_.head_->next_; - return this->current_ != this->queue_.head_; -} - -template int -ACE_Unbounded_Queue_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Unbounded_Queue_Iterator::done"); - - return this->current_ == this->queue_.head_; -} - -template int -ACE_Unbounded_Queue_Iterator::next (T *&item) -{ - // ACE_TRACE ("ACE_Unbounded_Queue_Iterator::next"); - if (this->current_ == this->queue_.head_) - return 0; - else - { - item = &this->current_->item_; - return 1; - } -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Iterator_Base) - -template -ACE_Double_Linked_List_Iterator_Base::ACE_Double_Linked_List_Iterator_Base (ACE_Double_Linked_List &dll) - : current_ (0), dllist_ (&dll) -{ - // Do nothing -} - -template -ACE_Double_Linked_List_Iterator_Base::ACE_Double_Linked_List_Iterator_Base (const ACE_Double_Linked_List_Iterator_Base &iter) - : current_ (iter.current_), - dllist_ (iter.dllist_) -{ - // Do nothing -} - - -template T * -ACE_Double_Linked_List_Iterator_Base::next (void) const -{ - return this->not_done (); -} - -template int -ACE_Double_Linked_List_Iterator_Base::next (T *&ptr) const -{ - ptr = this->not_done (); - return ptr ? 1 : 0; -} - - -template int -ACE_Double_Linked_List_Iterator_Base::done (void) const -{ - return this->not_done () ? 0 : 1; -} - -template T & -ACE_Double_Linked_List_Iterator_Base::operator* (void) const -{ - return *(this->not_done ()); -} - -// @@ Is this a valid retasking? Make sure to check with Purify and -// whatnot that we're not leaking memory or doing any other screwing things. -template void -ACE_Double_Linked_List_Iterator_Base::reset (ACE_Double_Linked_List &dll) -{ - current_ = 0; - dllist_ = &dll; -} - - template int -ACE_Double_Linked_List_Iterator_Base::go_head (void) -{ - this->current_ = ACE_static_cast (T*, dllist_->head_->next_); - return this->current_ ? 1 : 0; -} - -template int -ACE_Double_Linked_List_Iterator_Base::go_tail (void) -{ - this->current_ = ACE_static_cast (T*, dllist_->head_->prev_); - return this->current_ ? 1 : 0; -} - -template T * -ACE_Double_Linked_List_Iterator_Base::not_done (void) const -{ - if (this->current_ != this->dllist_->head_) - return this->current_; - else - return 0; -} - -template T * -ACE_Double_Linked_List_Iterator_Base::do_advance (void) -{ - if (this->not_done ()) - { - this->current_ = ACE_static_cast (T*, this->current_->next_); - return this->not_done (); - } - else - return 0; -} - -template T * -ACE_Double_Linked_List_Iterator_Base::do_retreat (void) -{ - if (this->not_done ()) - { - this->current_ = ACE_static_cast (T*, this->current_->prev_); - return this->not_done (); - } - else - return 0; -} - -template void -ACE_Double_Linked_List_Iterator_Base::dump_i (void) const -{ - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("current_ = %x"), this->current_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Iterator) - -template -ACE_Double_Linked_List_Iterator::ACE_Double_Linked_List_Iterator (ACE_Double_Linked_List &dll) - : ACE_Double_Linked_List_Iterator_Base (dll) -{ - this->current_ = ACE_static_cast (T*, dll.head_->next_); - // Advance current_ out of the null area and onto the first item in - // the list -} - -template void -ACE_Double_Linked_List_Iterator::reset (ACE_Double_Linked_List &dll) -{ - this->ACE_Double_Linked_List_Iterator_Base ::reset (dll); - this->current_ = ACE_static_cast (T*, dll.head_->next_); - // Advance current_ out of the null area and onto the first item in - // the list -} - -template int -ACE_Double_Linked_List_Iterator::first (void) -{ - return this->go_head (); -} - -template int -ACE_Double_Linked_List_Iterator::advance (void) -{ - return this->do_advance () ? 1 : 0; -} - -template T* -ACE_Double_Linked_List_Iterator::advance_and_remove (int dont_remove) -{ - T* item = 0; - if (dont_remove) - this->do_advance (); - else - { - item = this->next (); - this->do_advance (); - this->dllist_->remove (item); - } - return item; -} - -template void -ACE_Double_Linked_List_Iterator::dump (void) const -{ - this->dump_i (); -} - -// Prefix advance. - -template -ACE_Double_Linked_List_Iterator & -ACE_Double_Linked_List_Iterator::operator++ (void) -{ - this->do_advance (); - return *this; -} - - -// Postfix advance. - -template -ACE_Double_Linked_List_Iterator -ACE_Double_Linked_List_Iterator::operator++ (int) -{ - ACE_Double_Linked_List_Iterator retv (*this); - this->do_advance (); - return retv; -} - - -// Prefix reverse. - -template -ACE_Double_Linked_List_Iterator & -ACE_Double_Linked_List_Iterator::operator-- (void) -{ - this->do_retreat (); - return *this; -} - - -// Postfix reverse. - -template -ACE_Double_Linked_List_Iterator -ACE_Double_Linked_List_Iterator::operator-- (int) -{ - ACE_Double_Linked_List_Iterator retv (*this); - this->do_retreat (); - return retv; -} - - -//-------------------------------------------------- -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List_Reverse_Iterator) - - template -ACE_Double_Linked_List_Reverse_Iterator::ACE_Double_Linked_List_Reverse_Iterator (ACE_Double_Linked_List &dll) - : ACE_Double_Linked_List_Iterator_Base (dll) -{ - this->current_ = ACE_static_cast (T*, dll.head_->prev_); - // Advance current_ out of the null area and onto the last item in - // the list -} - -template void -ACE_Double_Linked_List_Reverse_Iterator::reset (ACE_Double_Linked_List &dll) -{ - this->ACE_Double_Linked_List_Iterator_Base ::reset (dll); - this->current_ = ACE_static_cast (T*, dll.head_->prev_); - // Advance current_ out of the null area and onto the last item in - // the list -} - -template int -ACE_Double_Linked_List_Reverse_Iterator::first (void) -{ - return this->go_tail (); -} - -template int -ACE_Double_Linked_List_Reverse_Iterator::advance (void) -{ - return this->do_retreat () ? 1 : 0; -} - -template T* -ACE_Double_Linked_List_Reverse_Iterator::advance_and_remove (int dont_remove) -{ - T* item = 0; - if (dont_remove) - this->do_retreat (); - else - { - item = this->next (); - this->do_retreat (); - this->dllist_->remove (item); - } - return item; -} - -template void -ACE_Double_Linked_List_Reverse_Iterator::dump (void) const -{ - this->dump_i (); -} - -// Prefix advance. - -template -ACE_Double_Linked_List_Reverse_Iterator & -ACE_Double_Linked_List_Reverse_Iterator::operator++ (void) -{ - this->do_retreat (); - return *this; -} - - -// Postfix advance. - -template -ACE_Double_Linked_List_Reverse_Iterator -ACE_Double_Linked_List_Reverse_Iterator::operator++ (int) -{ - ACE_Double_Linked_List_Reverse_Iterator retv (*this); - this->do_retreat (); - return retv; -} - - -// Prefix reverse. - -template -ACE_Double_Linked_List_Reverse_Iterator & -ACE_Double_Linked_List_Reverse_Iterator::operator-- (void) -{ - this->do_advance (); - return *this; -} - - -// Postfix reverse. - -template -ACE_Double_Linked_List_Reverse_Iterator -ACE_Double_Linked_List_Reverse_Iterator::operator-- (int) -{ - ACE_Double_Linked_List_Reverse_Iterator retv (*this); - this->do_advance (); - return retv; -} - - -ACE_ALLOC_HOOK_DEFINE(ACE_Double_Linked_List) - - template -ACE_Double_Linked_List:: ACE_Double_Linked_List (ACE_Allocator *alloc) - : size_ (0), allocator_ (alloc) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (T *) this->allocator_->malloc (sizeof (T)), - T); - this->init_head (); -} - -template -ACE_Double_Linked_List::ACE_Double_Linked_List (ACE_Double_Linked_List &cx) - : allocator_ (cx.allocator_) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (T *) this->allocator_->malloc (sizeof (T)), - T); - this->init_head (); - this->copy_nodes (cx); -} - -template void -ACE_Double_Linked_List::operator= (ACE_Double_Linked_List &cx) -{ - if (this != &cx) - { - this->delete_nodes (); - this->copy_nodes (cx); - } -} - -template -ACE_Double_Linked_List::~ACE_Double_Linked_List (void) -{ - this->delete_nodes (); - - ACE_DES_FREE (head_, - this->allocator_->free, - T); - - this->head_ = 0; -} - -template int -ACE_Double_Linked_List::is_empty (void) const -{ - return this->size () ? 0 : 1; -} - -template int -ACE_Double_Linked_List::is_full (void) const -{ - return 0; // We have no bound. -} - -template T * -ACE_Double_Linked_List::insert_tail (T *new_item) -{ - // Insert it before , i.e., at tail. - this->insert_element (new_item, 1); - return new_item; -} - -template T * -ACE_Double_Linked_List::insert_head (T *new_item) -{ - this->insert_element (new_item); // Insert it after , i.e., at head. - return new_item; -} - -template T * -ACE_Double_Linked_List::delete_head (void) -{ - T *temp; - - if (this->is_empty ()) - return 0; - - temp = ACE_static_cast (T *, - this->head_->next_); - // Detach it from the list. - this->remove_element (temp); - return temp; -} - -template T * -ACE_Double_Linked_List::delete_tail (void) -{ - T *temp; - - if (this->is_empty ()) - return 0; - - temp = ACE_static_cast (T *, - this->head_->prev_); - // Detach it from the list. - this->remove_element (temp); - return temp; -} - -template void -ACE_Double_Linked_List::reset (void) -{ - this->delete_nodes (); -} - -template int -ACE_Double_Linked_List::get (T *&item, size_t slot) -{ - ACE_Double_Linked_List_Iterator iter (*this); - - for (size_t i = 0; - i < slot && !iter.done (); - i++) - iter.advance (); - - item = iter.next (); - return item ? 0 : -1; -} - -template size_t -ACE_Double_Linked_List::size (void) const -{ - return this->size_; -} - -template void -ACE_Double_Linked_List::dump (void) const -{ - // Dump the state of an object. -} - -#if 0 -template T * -ACE_Double_Linked_List::find (const T &item) -{ - for (ACE_Double_Linked_List_Iterator iter (*this); - !iter.done (); - iter.advance ()) - { - T *temp = iter.next (); - - if (*temp == item) - return temp; - } - - return 0; -} - -template int -ACE_Double_Linked_List::remove (const T &item) -{ - T *temp = this->find (item); - - if (temp != 0) - return this->remove (temp); - else - return -1; -} -#endif /* 0 */ - -template int -ACE_Double_Linked_List::remove (T *n) -{ - return this->remove_element (n); -} - -template void -ACE_Double_Linked_List::delete_nodes (void) -{ - while (! this->is_empty ()) - { - T * temp = ACE_static_cast (T*, this->head_->next_); - this->remove_element (temp); - delete temp; - } -} - -template void -ACE_Double_Linked_List::copy_nodes (ACE_Double_Linked_List &c) -{ - for (ACE_Double_Linked_List_Iterator iter (c); - !iter.done (); - iter.advance ()) - { - T* temp = (T *) this->allocator_->malloc (sizeof (T)); - new (temp) T (*iter.next ()); - this->insert_tail (temp); - } -} - -template void -ACE_Double_Linked_List::init_head (void) -{ - this->head_->next_ = this->head_->prev_ = this->head_; -} - -template int -ACE_Double_Linked_List::insert_element (T *new_item, - int before, - T *old_item) -{ - if (old_item == 0) - old_item = this->head_; - - if (before) - old_item = ACE_static_cast (T *, - old_item->prev_); - - new_item->next_ = old_item->next_; - new_item->next_->prev_ = new_item; - new_item->prev_ = old_item; - old_item->next_ = new_item; - this->size_++; - return 0; // Well, what will cause errors here? -} - -template int -ACE_Double_Linked_List::remove_element (T *item) -{ - // Notice that you have to ensure that item is an element of this - // list. We can't do much checking here. - - if (item == this->head_ || item->next_ == 0 - || item->prev_ == 0 || this->size () == 0) // Can't remove head - return -1; - - item->prev_->next_ = item->next_; - item->next_->prev_ = item->prev_; - item->next_ = item->prev_ = 0; // reset pointers to prevent double removal. - this->size_--; - return 0; -} - -//-------------------------------------------------- - -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set) - - template size_t -ACE_Fixed_Set::size (void) const -{ - return this->cur_size_; -} - -template size_t -ACE_Bounded_Set::size (void) const -{ - ACE_TRACE ("ACE_Bounded_Set::size"); - return this->cur_size_; -} - -template void -ACE_Fixed_Set::dump (void) const -{ - ACE_TRACE ("ACE_Fixed_Set::dump"); -} - -template -ACE_Fixed_Set::~ACE_Fixed_Set (void) -{ - ACE_TRACE ("ACE_Fixed_Set::~ACE_Fixed_Set"); - this->cur_size_ = 0; -} - -template -ACE_Fixed_Set::ACE_Fixed_Set (const ACE_Fixed_Set &fs) - : cur_size_ (fs.cur_size_) -{ - ACE_TRACE ("ACE_Fixed_Set::ACE_Fixed_Set"); - - for (size_t i = 0; i < this->cur_size_; i++) - this->search_structure_[i] = fs.search_structure_[i]; -} - -template void -ACE_Fixed_Set::operator= (const ACE_Fixed_Set &fs) -{ - ACE_TRACE ("ACE_Fixed_Set::operator="); - - if (this != &fs) - { - this->cur_size_ = fs.cur_size_; - - for (size_t i = 0; i < this->cur_size_; i++) - this->search_structure_[i] = fs.search_structure_[i]; - } -} - -template -ACE_Fixed_Set::ACE_Fixed_Set (void) - : cur_size_ (0), - max_size_ (ACE_SIZE) -{ - ACE_TRACE ("ACE_Fixed_Set::ACE_Fixed_Set"); - for (size_t i = 0; i < this->max_size_; i++) - this->search_structure_[i].is_free_ = 1; -} - -template int -ACE_Fixed_Set::find (const T &item) const -{ - ACE_TRACE ("ACE_Fixed_Set::find"); - - for (size_t i = 0; i < this->cur_size_; i++) - if (this->search_structure_[i].item_ == item - && this->search_structure_[i].is_free_ == 0) - return 0; - - return -1; -} - -template int -ACE_Fixed_Set::insert (const T &item) -{ - ACE_TRACE ("ACE_Fixed_Set::insert"); - int first_free = -1; // Keep track of first free slot. - size_t i; - - for (i = 0; i < this->cur_size_; i++) - // First, make sure we don't allow duplicates. - - if (this->search_structure_[i].item_ == item - && this->search_structure_[i].is_free_ == 0) - return 1; - else if (this->search_structure_[i].is_free_ - && first_free == -1) - first_free = i; - - // If we found a free spot let's reuse it. - if (first_free > -1) - { - this->search_structure_[first_free].item_ = item; - this->search_structure_[first_free].is_free_ = 0; - return 0; - } - // Insert at the end of the active portion. - else if (i < this->max_size_) - { - this->search_structure_[i].item_ = item; - this->search_structure_[i].is_free_ = 0; - this->cur_size_++; - return 0; - } - else /* No more room! */ - { - errno = ENOMEM; - return -1; - } -} - -template int -ACE_Fixed_Set::remove (const T &item) -{ - ACE_TRACE ("ACE_Fixed_Set::remove"); - - for (size_t i = 0; i < this->cur_size_; i++) - if (this->search_structure_[i].item_ == item) - { - // Mark this entry as being free. - this->search_structure_[i].is_free_ = 1; - - // If we just unbound the highest entry, then we need to - // figure out where the next highest active entry is. - if (i + 1 == this->cur_size_) - { - while (i > 0 - && this->search_structure_[--i].is_free_) - continue; - - if (i == 0 - && this->search_structure_[i].is_free_) - this->cur_size_ = 0; - else - this->cur_size_ = i + 1; - } - return 0; - } - - return -1; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Fixed_Set_Iterator) - - template void -ACE_Fixed_Set_Iterator::dump (void) const -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::dump"); -} - -template -ACE_Fixed_Set_Iterator::ACE_Fixed_Set_Iterator (ACE_Fixed_Set &s) - : s_ (s), - next_ (-1) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::ACE_Fixed_Set_Iterator"); - this->advance (); -} - -template int -ACE_Fixed_Set_Iterator::advance (void) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::advance"); - - for (++this->next_; - ACE_static_cast(size_t, this->next_) < this->s_.cur_size_ - && this->s_.search_structure_[this->next_].is_free_; - ++this->next_) - continue; - - return ACE_static_cast(size_t, this->next_) < this->s_.cur_size_; -} - -template int -ACE_Fixed_Set_Iterator::first (void) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::first"); - - next_ = -1; - return this->advance (); -} - -template int -ACE_Fixed_Set_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::done"); - - return ACE_static_cast (ACE_CAST_CONST size_t, this->next_) >= - this->s_.cur_size_; -} - -template int -ACE_Fixed_Set_Iterator::next (T *&item) -{ - ACE_TRACE ("ACE_Fixed_Set_Iterator::next"); - if (ACE_static_cast (size_t, this->next_) < this->s_.cur_size_) - { - item = &this->s_.search_structure_[this->next_].item_; - return 1; - } - else - return 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Set) - - template void -ACE_Bounded_Set::dump (void) const -{ - ACE_TRACE ("ACE_Bounded_Set::dump"); -} - -template -ACE_Bounded_Set::~ACE_Bounded_Set (void) -{ - ACE_TRACE ("ACE_Bounded_Set::~ACE_Bounded_Set"); - delete [] this->search_structure_; -} - -template -ACE_Bounded_Set::ACE_Bounded_Set (void) - : cur_size_ (0), - max_size_ (ACE_static_cast(size_t, ACE_Bounded_Set::DEFAULT_SIZE)) -{ - ACE_TRACE ("ACE_Bounded_Set::ACE_Bounded_Set"); - - ACE_NEW (this->search_structure_, - ACE_TYPENAME ACE_Bounded_Set::Search_Structure[this->max_size_]); - - for (size_t i = 0; i < this->max_size_; i++) - this->search_structure_[i].is_free_ = 1; -} - -template -ACE_Bounded_Set::ACE_Bounded_Set (const ACE_Bounded_Set &bs) - : cur_size_ (bs.cur_size_), - max_size_ (bs.max_size_) -{ - ACE_TRACE ("ACE_Bounded_Set::ACE_Bounded_Set"); - - ACE_NEW (this->search_structure_, - ACE_TYPENAME ACE_Bounded_Set::Search_Structure[this->max_size_]); - - for (size_t i = 0; i < this->cur_size_; i++) - this->search_structure_[i] = bs.search_structure_[i]; -} - -template void -ACE_Bounded_Set::operator= (const ACE_Bounded_Set &bs) -{ - ACE_TRACE ("ACE_Bounded_Set::operator="); - - if (this != &bs) - { - if (this->max_size_ < bs.cur_size_) - { - delete [] this->search_structure_; - ACE_NEW (this->search_structure_, - ACE_TYPENAME ACE_Bounded_Set::Search_Structure[bs.cur_size_]); - this->max_size_ = bs.cur_size_; - } - - this->cur_size_ = bs.cur_size_; - - for (size_t i = 0; i < this->cur_size_; i++) - this->search_structure_[i] = bs.search_structure_[i]; - } -} - -template -ACE_Bounded_Set::ACE_Bounded_Set (size_t size) - : cur_size_ (0), - max_size_ (size) -{ - ACE_TRACE ("ACE_Bounded_Set::ACE_Bounded_Set"); - ACE_NEW (this->search_structure_, - ACE_TYPENAME ACE_Bounded_Set::Search_Structure[size]); - - for (size_t i = 0; i < this->max_size_; i++) - this->search_structure_[i].is_free_ = 1; -} - -template int -ACE_Bounded_Set::find (const T &item) const -{ - ACE_TRACE ("ACE_Bounded_Set::find"); - - for (size_t i = 0; i < this->cur_size_; i++) - if (this->search_structure_[i].item_ == item - && this->search_structure_[i].is_free_ == 0) - return 0; - - return -1; -} - -template int -ACE_Bounded_Set::insert (const T &item) -{ - ACE_TRACE ("ACE_Bounded_Set::insert"); - int first_free = -1; // Keep track of first free slot. - size_t i; - - for (i = 0; i < this->cur_size_; i++) - // First, make sure we don't allow duplicates. - - if (this->search_structure_[i].item_ == item - && this->search_structure_[i].is_free_ == 0) - return 1; - else if (this->search_structure_[i].is_free_ && first_free == -1) - first_free = i; - - if (first_free > -1) // If we found a free spot let's reuse it. - { - this->search_structure_[first_free].item_ = item; - this->search_structure_[first_free].is_free_ = 0; - return 0; - } - else if (i < this->max_size_) // Insert at the end of the active portion. - { - this->search_structure_[i].item_ = item; - this->search_structure_[i].is_free_ = 0; - this->cur_size_++; - return 0; - } - else /* No more room! */ - { - errno = ENOMEM; - return -1; - } -} - -template int -ACE_Bounded_Set::remove (const T &item) -{ - ACE_TRACE ("ACE_Bounded_Set::remove"); - for (size_t i = 0; i < this->cur_size_; i++) - if (this->search_structure_[i].item_ == item) - { - // Mark this entry as being free. - this->search_structure_[i].is_free_ = 1; - - // If we just unbound the highest entry, then we need to - // figure out where the next highest active entry is. - if (i + 1 == this->cur_size_) - { - while (i > 0 && this->search_structure_[--i].is_free_) - continue; - - if (i == 0 && this->search_structure_[i].is_free_) - this->cur_size_ = 0; - else - this->cur_size_ = i + 1; - } - return 0; - } - - return -1; -} - -#if defined (__Lynx__) -// LynxOS 3.0.0 native g++ compiler raises internal error with this inline. -template int -ACE_Bounded_Set::is_full (void) const -{ - ACE_TRACE ("ACE_Bounded_Set::is_full"); - return this->cur_size_ == this->max_size_; -} -#endif /* __Lynx__ */ - -ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Set_Iterator) - - template void -ACE_Bounded_Set_Iterator::dump (void) const -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::dump"); -} - -template -ACE_Bounded_Set_Iterator::ACE_Bounded_Set_Iterator (ACE_Bounded_Set &s) - : s_ (s), - next_ (-1) -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::ACE_Bounded_Set_Iterator"); - this->advance (); -} - -template int -ACE_Bounded_Set_Iterator::advance (void) -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::advance"); - - for (++this->next_; - ACE_static_cast(size_t, this->next_) < this->s_.cur_size_ - && this->s_.search_structure_[this->next_].is_free_; - ++this->next_) - continue; - - return ACE_static_cast(size_t, this->next_) < this->s_.cur_size_; -} - -template int -ACE_Bounded_Set_Iterator::first (void) -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::first"); - - next_ = -1; - return this->advance (); -} - -template int -ACE_Bounded_Set_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::done"); - - return ACE_static_cast (ACE_CAST_CONST size_t, this->next_) >= - this->s_.cur_size_; -} - -template int -ACE_Bounded_Set_Iterator::next (T *&item) -{ - ACE_TRACE ("ACE_Bounded_Set_Iterator::next"); - if (ACE_static_cast(size_t, this->next_) < this->s_.cur_size_) - { - item = &this->s_.search_structure_[this->next_].item_; - return 1; - } - else - return 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Node) - -# if ! defined (ACE_HAS_BROKEN_NOOP_DTORS) - template -ACE_Node::~ACE_Node (void) -{ -} -# endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */ - -template -ACE_Node::ACE_Node (const T &i, ACE_Node *n) - : next_ (n), - item_ (i) -{ - // ACE_TRACE ("ACE_Node::ACE_Node"); -} - -template -ACE_Node::ACE_Node (ACE_Node *n, int) - : next_ (n) -{ - // ACE_TRACE ("ACE_Node::ACE_Node"); -} - -template -ACE_Node::ACE_Node (const ACE_Node &s) - : next_ (s.next_), - item_ (s.item_) -{ - // ACE_TRACE ("ACE_Node::ACE_Node"); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_DNode) - - template -ACE_DNode::ACE_DNode (const T &i, ACE_DNode *n, ACE_DNode *p) - : next_ (n), prev_ (p), item_ (i) -{ -} - -# if ! defined (ACE_HAS_BROKEN_NOOP_DTORS) -template -ACE_DNode::~ACE_DNode (void) -{ -} -# endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */ - -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Set) - - template size_t -ACE_Unbounded_Set::size (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Set::size"); - return this->cur_size_; -} - -template int -ACE_Unbounded_Set::insert_tail (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::insert_tail"); - ACE_Node *temp; - - // Insert into the old dummy node location. - this->head_->item_ = item; - - // Create a new dummy node. - ACE_NEW_MALLOC_RETURN (temp, - (ACE_Node*) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node (this->head_->next_), - -1); - // Link this pointer into the list. - this->head_->next_ = temp; - - // Point the head to the new dummy node. - this->head_ = temp; - - this->cur_size_++; - return 0; -} - -template void -ACE_Unbounded_Set::reset (void) -{ - ACE_TRACE ("reset"); - - this->delete_nodes (); -} - -template void -ACE_Unbounded_Set::dump (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_ = %u"), this->head_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_->next_ = %u"), this->head_->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d\n"), this->cur_size_)); - - T *item = 0; -#if !defined (ACE_NLOGGING) - size_t count = 1; -#endif /* ! ACE_NLOGGING */ - - for (ACE_Unbounded_Set_Iterator iter (*(ACE_Unbounded_Set *) this); - iter.next (item) != 0; - iter.advance ()) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("count = %d\n"), count++)); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template void -ACE_Unbounded_Set::copy_nodes (const ACE_Unbounded_Set &us) -{ - for (ACE_Node *curr = us.head_->next_; - curr != us.head_; - curr = curr->next_) - this->insert_tail (curr->item_); -} - -template void -ACE_Unbounded_Set::delete_nodes (void) -{ - ACE_Node *curr = this->head_->next_; - - // Keep looking until we've hit the dummy node. - - while (curr != this->head_) - { - ACE_Node *temp = curr; - curr = curr->next_; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - this->cur_size_--; - } - - // Reset the list to be a circular list with just a dummy node. - this->head_->next_ = this->head_; -} - -template -ACE_Unbounded_Set::~ACE_Unbounded_Set (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set::~ACE_Unbounded_Set"); - - this->delete_nodes (); - - // Delete the dummy node. - ACE_DES_FREE_TEMPLATE (head_, - this->allocator_->free, - ACE_Node, - ); - this->head_ = 0; -} - -template -ACE_Unbounded_Set::ACE_Unbounded_Set (ACE_Allocator *alloc) - : head_ (0), - cur_size_ (0), - allocator_ (alloc) -{ - // ACE_TRACE ("ACE_Unbounded_Set::ACE_Unbounded_Set"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (ACE_Node*) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node); - // Make the list circular by pointing it back to itself. - this->head_->next_ = this->head_; -} - -template -ACE_Unbounded_Set::ACE_Unbounded_Set (const ACE_Unbounded_Set &us) - : head_ (0), - cur_size_ (0), - allocator_ (us.allocator_) -{ - ACE_TRACE ("ACE_Unbounded_Set::ACE_Unbounded_Set"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_NEW_MALLOC (this->head_, - (ACE_Node*) this->allocator_->malloc (sizeof (ACE_Node)), - ACE_Node); - this->head_->next_ = this->head_; - this->copy_nodes (us); -} - -template void -ACE_Unbounded_Set::operator= (const ACE_Unbounded_Set &us) -{ - ACE_TRACE ("ACE_Unbounded_Set::operator="); - - if (this != &us) - { - this->delete_nodes (); - this->copy_nodes (us); - } -} - -template int -ACE_Unbounded_Set::find (const T &item) const -{ - // ACE_TRACE ("ACE_Unbounded_Stack::find"); - // Set into the dummy node. - this->head_->item_ = item; - - ACE_Node *temp = this->head_->next_; - - // Keep looping until we find the item. - while (!(temp->item_ == item)) - temp = temp->next_; - - // If we found the dummy node then it's not really there, otherwise, - // it is there. - return temp == this->head_ ? -1 : 0; -} - -template int -ACE_Unbounded_Set::insert (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Set::insert"); - if (this->find (item) == 0) - return 1; - else - return this->insert_tail (item); -} - -template int -ACE_Unbounded_Set::remove (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Set::remove"); - - // Insert the item to be founded into the dummy node. - this->head_->item_ = item; - - ACE_Node *curr = this->head_; - - while (!(curr->next_->item_ == item)) - curr = curr->next_; - - if (curr->next_ == this->head_) - return -1; // Item was not found. - else - { - ACE_Node *temp = curr->next_; - // Skip over the node that we're deleting. - curr->next_ = temp->next_; - this->cur_size_--; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - return 0; - } -} - -template ACE_Unbounded_Set_Iterator -ACE_Unbounded_Set::begin (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set::begin"); - return ACE_Unbounded_Set_Iterator (*this); -} - -template ACE_Unbounded_Set_Iterator -ACE_Unbounded_Set::end (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set::end"); - return ACE_Unbounded_Set_Iterator (*this, 1); -} - - -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Set_Iterator) - - template void -ACE_Unbounded_Set_Iterator::dump (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Set_Iterator::dump"); -} - -template -ACE_Unbounded_Set_Iterator::ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set &s, int end) - : current_ (end == 0 ? s.head_->next_ : s.head_ ), - set_ (&s) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Iterator::ACE_Unbounded_Set_Iterator"); -} - -template int -ACE_Unbounded_Set_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Iterator::advance"); - this->current_ = this->current_->next_; - return this->current_ != this->set_->head_; -} - -template int -ACE_Unbounded_Set_Iterator::first (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Iterator::first"); - this->current_ = this->set_->head_->next_; - return this->current_ != this->set_->head_; -} - -template int -ACE_Unbounded_Set_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set_Iterator::done"); - - return this->current_ == this->set_->head_; -} - -template int -ACE_Unbounded_Set_Iterator::next (T *&item) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Iterator::next"); - if (this->current_ == this->set_->head_) - return 0; - else - { - item = &this->current_->item_; - return 1; - } -} - -template ACE_Unbounded_Set_Iterator -ACE_Unbounded_Set_Iterator::operator++ (int) -{ - //ACE_TRACE ("ACE_Unbounded_Set_Iterator::operator++ (int)"); - ACE_Unbounded_Set_Iterator retv (*this); - - // postfix operator - - this->advance (); - return retv; -} - -template ACE_Unbounded_Set_Iterator& -ACE_Unbounded_Set_Iterator::operator++ (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Iterator::operator++ (void)"); - - // prefix operator - - this->advance (); - return *this; -} - -template T& -ACE_Unbounded_Set_Iterator::operator* (void) -{ - //ACE_TRACE ("ACE_Unbounded_Set_Iterator::operator*"); - T *retv = 0; - - int result = this->next (retv); - ACE_ASSERT (result != 0); - ACE_UNUSED_ARG (result); - - return *retv; -} - -template int -ACE_Unbounded_Set_Iterator::operator== (const ACE_Unbounded_Set_Iterator &rhs) const -{ - //ACE_TRACE ("ACE_Unbounded_Set_Iterator::operator=="); - return (this->set_ == rhs.set_ && this->current_ == rhs.current_); -} - -template int -ACE_Unbounded_Set_Iterator::operator!= (const ACE_Unbounded_Set_Iterator &rhs) const -{ - //ACE_TRACE ("ACE_Unbounded_Set_Iterator::operator!="); - return (this->set_ != rhs.set_ || this->current_ != rhs.current_); -} - -template void -ACE_Unbounded_Stack_Iterator::dump (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::dump"); -} - -template -ACE_Unbounded_Stack_Iterator::ACE_Unbounded_Stack_Iterator (ACE_Unbounded_Stack &q) - : current_ (q.head_->next_), - stack_ (q) -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::ACE_Unbounded_Stack_Iterator"); -} - -template int -ACE_Unbounded_Stack_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::advance"); - this->current_ = this->current_->next_; - return this->current_ != this->stack_.head_; -} - -template int -ACE_Unbounded_Stack_Iterator::first (void) -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::first"); - this->current_ = this->stack_.head_->next_; - return this->current_ != this->stack_.head_; -} - -template int -ACE_Unbounded_Stack_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Unbounded_Stack_Iterator::done"); - - return this->current_ == this->stack_.head_; -} - -template int -ACE_Unbounded_Stack_Iterator::next (T *&item) -{ - // ACE_TRACE ("ACE_Unbounded_Stack_Iterator::next"); - if (this->current_ == this->stack_.head_) - return 0; - else - { - item = &this->current_->item_; - return 1; - } -} - - -ACE_ALLOC_HOOK_DEFINE(ACE_Ordered_MultiSet) - - - template -ACE_Ordered_MultiSet::ACE_Ordered_MultiSet (ACE_Allocator *alloc) - : head_ (0) - , tail_ (0) - , cur_size_ (0) - , allocator_ (alloc) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::ACE_Ordered_MultiSet"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); -} - -template -ACE_Ordered_MultiSet::ACE_Ordered_MultiSet (const ACE_Ordered_MultiSet &us) - : head_ (0) - , tail_ (0) - , cur_size_ (0) - , allocator_ (us.allocator_) -{ - ACE_TRACE ("ACE_Ordered_MultiSet::ACE_Ordered_MultiSet"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->copy_nodes (us); -} - -template -ACE_Ordered_MultiSet::~ACE_Ordered_MultiSet (void) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::~ACE_Ordered_MultiSet"); - - this->delete_nodes (); -} - - -template void -ACE_Ordered_MultiSet::operator= (const ACE_Ordered_MultiSet &us) -{ - ACE_TRACE ("ACE_Ordered_MultiSet::operator="); - - if (this != &us) - { - this->delete_nodes (); - this->copy_nodes (us); - } -} - - -template int -ACE_Ordered_MultiSet::insert (const T &item) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::insert"); - - return this->insert_from (item, this->head_, 0); -} - -template int -ACE_Ordered_MultiSet::insert (const T &item, - ACE_Ordered_MultiSet_Iterator &iter) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::insert using iterator"); - - return this->insert_from (item, iter.current_, &iter.current_); -} - -template int -ACE_Ordered_MultiSet::remove (const T &item) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::remove"); - - ACE_DNode *node = 0; - - int result = locate (item, 0, node); - - // if we found the node, remove from list and free it - if (node && (result == 0)) - { - if (node->prev_) - { - node->prev_->next_ = node->next_; - } - else - { - head_ = node->next_; - } - - if (node->next_) - { - node->next_->prev_ = node->prev_; - } - else - { - tail_ = node->prev_; - } - - this->cur_size_--; - - ACE_DES_FREE_TEMPLATE (node, - this->allocator_->free, - ACE_DNode, - ); - return 0; - } - - return -1; -} - -template int -ACE_Ordered_MultiSet::find (const T &item, - ACE_Ordered_MultiSet_Iterator &iter) const -{ - // search an occurance of item, using iterator's current position as a hint - ACE_DNode *node = iter.current_; - int result = locate (item, node, node); - - // if we found the node, update the iterator and indicate success - if (node && (result == 0)) - { - iter.current_ = node; - return 0; - } - - return -1; -} - - - -template void -ACE_Ordered_MultiSet::reset (void) -{ - ACE_TRACE ("reset"); - - this->delete_nodes (); -} - -template void -ACE_Ordered_MultiSet::dump (void) const -{ - // ACE_TRACE ("ACE_Ordered_MultiSet::dump"); - // - // ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_ = %u"), this->head_)); - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_->next_ = %u"), this->head_->next_)); - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d\n"), this->cur_size_)); - // - // T *item = 0; - // size_t count = 1; - // - // for (ACE_Ordered_MultiSet_Iterator iter (*(ACE_Ordered_MultiSet *) this); - // iter.next (item) != 0; - // iter.advance ()) - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("count = %d\n"), count++)); - // - // ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template int -ACE_Ordered_MultiSet::insert_from (const T &item, ACE_DNode *position, - ACE_DNode **new_position) -{ - // ACE_TRACE ("ACE_Unbounded_Queue::insert_tail"); - - // create a new node - ACE_DNode *temp; - ACE_NEW_MALLOC_RETURN (temp, - (ACE_DNode*) this->allocator_->malloc (sizeof (ACE_DNode)), - ACE_DNode (item), - -1); - // obtain approximate location of the node - int result = locate (item, position, position); - - // if there are nodes in the multiset - if (position) - { - switch (result) - { - // insert after the approximate position - case -1: - - // if there is a following node - if (position->next_) - { - // link up with the following node - position->next_->prev_ = temp; - temp->next_ = position->next_; - } - else - // appending to the end of the set - tail_ = temp; - - // link up with the preceeding node - temp->prev_ = position; - position->next_ = temp; - - break; - - // insert before the position - case 0: - case 1: - - // if there is a preceeding node - if (position->prev_) - { - // link up with the preceeding node - position->prev_->next_ = temp; - temp->prev_ = position->prev_; - } - else - // prepending to the start of the set - head_ = temp; - - // link up with the preceeding node - temp->next_ = position; - position->prev_ = temp; - - break; - - default: - return -1; - } - } - else - { - // point the head and tail to the new node. - this->head_ = temp; - this->tail_ = temp; - } - - this->cur_size_++; - if (new_position) - *new_position = temp; - - return 0; -} - -template int -ACE_Ordered_MultiSet::locate (const T &item, ACE_DNode *start_position, - ACE_DNode *&new_position) const -{ - if (! start_position) - start_position = this->head_; - - // If starting before the item, move forward until at or just before - // item. - while (start_position && start_position->item_ < item && - start_position->next_) - start_position = start_position->next_; - - // If starting after the item, move back until at or just after item - while (start_position && item < start_position->item_ && - start_position->prev_) - start_position = start_position->prev_; - - // Save the (approximate) location in the passed pointer. - new_position = start_position; - - // Show the location is after (1), before (-1) , or at (0) the item - if (!new_position) - return 1; - else if (item < new_position->item_) - return 1; - else if (new_position->item_ < item) - return -1; - else - return 0; -} - -// Looks for first occurance of in the ordered set, using the -// passed starting position as a hint: if there is such an instance, -// it updates the new_position pointer to point to one such node and -// returns 0; if there is no such node, then if there is a node before -// where the item would have been, it updates the new_position pointer -// to point to this node and returns -1; if there is no such node, -// then if there is a node after where the item would have been, it -// updates the new_position pointer to point to this node (or 0 if -// there is no such node) and returns 1; - -template void -ACE_Ordered_MultiSet::copy_nodes (const ACE_Ordered_MultiSet &us) -{ - ACE_DNode *insertion_point = this->head_; - - for (ACE_DNode *curr = us.head_; - curr != 0; - curr = curr->next_) - this->insert_from (curr->item_, insertion_point, &insertion_point); -} - -template void -ACE_Ordered_MultiSet::delete_nodes (void) -{ - // iterate through list, deleting nodes - for (ACE_DNode *curr = this->head_; - curr != 0; - ) - { - ACE_DNode *temp = curr; - curr = curr->next_; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_DNode, - ); - } - - this->head_ = 0; - this->tail_ = 0; - this->cur_size_ = 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Ordered_MultiSet_Iterator) - -template -ACE_Ordered_MultiSet_Iterator::ACE_Ordered_MultiSet_Iterator (ACE_Ordered_MultiSet &s) - : current_ (s.head_), - set_ (s) -{ - // ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::ACE_Ordered_MultiSet_Iterator"); -} - -template int -ACE_Ordered_MultiSet_Iterator::next (T *&item) const -{ - // ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::next"); - if (this->current_) - { - item = &this->current_->item_; - return 1; - } - - return 0; -} - -ACE_ALLOC_HOOK_DEFINE (ACE_DLList_Node) - -template T * -ACE_DLList::insert_tail (T *new_item) -{ - ACE_DLList_Node *temp1, *temp2; - ACE_NEW_MALLOC_RETURN (temp1, - (ACE_DLList_Node *) this->allocator_->malloc (sizeof (ACE_DLList_Node)), - ACE_DLList_Node ((void *&)new_item), - 0); - temp2 = ACE_DLList_Base::insert_tail (temp1); - return (T *) (temp2 ? temp2->item_ : 0); -} - -template T * -ACE_DLList::insert_head (T *new_item) -{ - ACE_DLList_Node *temp1; - ACE_NEW_MALLOC_RETURN ( - temp1, - (ACE_DLList_Node *) this->allocator_->malloc (sizeof (ACE_DLList_Node)), - ACE_DLList_Node ((void *&)new_item), 0); - ACE_DLList_Node *temp2 = - ACE_DLList_Base::insert_head (temp1); - return (T *) (temp2 ? temp2->item_ : 0); -} - -template T * -ACE_DLList::delete_head (void) -{ - ACE_DLList_Node *temp1 = ACE_DLList_Base::delete_head (); - T *temp2 = (T *) (temp1 ? temp1->item_ : 0); - ACE_DES_FREE (temp1, - this->allocator_->free, - ACE_DLList_Node); - - return temp2; -} - -template T * -ACE_DLList::delete_tail (void) -{ - ACE_DLList_Node *temp1 = ACE_DLList_Base::delete_tail (); - T *temp2 = (T *) (temp1 ? temp1->item_ : 0); - ACE_DES_FREE (temp1, - this->allocator_->free, - ACE_DLList_Node); - return temp2; -} - -// Dynamically initialize an array. - -template -ACE_Array_Base::ACE_Array_Base (size_t size, - ACE_Allocator *alloc) - : max_size_ (size), - cur_size_ (size), - allocator_ (alloc) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (size != 0) - { - ACE_ALLOCATOR (this->array_, - (T *) this->allocator_->malloc (size * sizeof (T))); - for (size_t i = 0; i < size; ++i) - new (&array_[i]) T; - } - else - this->array_ = 0; -} - -template -ACE_Array_Base::ACE_Array_Base (size_t size, - const T &default_value, - ACE_Allocator *alloc) - : max_size_ (size), - cur_size_ (size), - allocator_ (alloc) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (size != 0) - { - ACE_ALLOCATOR (this->array_, - (T *) this->allocator_->malloc (size * sizeof (T))); - for (size_t i = 0; i < size; ++i) - new (&array_[i]) T (default_value); - } - else - this->array_ = 0; -} - -// The copy constructor (performs initialization). - -template -ACE_Array_Base::ACE_Array_Base (const ACE_Array_Base &s) - : max_size_ (s.size ()), - cur_size_ (s.size ()), - allocator_ (s.allocator_) -{ - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - ACE_ALLOCATOR (this->array_, - (T *) this->allocator_->malloc (s.size () * sizeof (T))); - for (size_t i = 0; i < this->size (); i++) - new (&this->array_[i]) T (s.array_[i]); -} - -// Assignment operator (performs assignment). - -template void -ACE_Array_Base::operator= (const ACE_Array_Base &s) -{ - // Check for "self-assignment". - - if (this != &s) - { - if (this->max_size_ < s.size ()) - { - ACE_DES_ARRAY_FREE (this->array_, - this->max_size_, - this->allocator_->free, - T); - ACE_ALLOCATOR (this->array_, - (T *) this->allocator_->malloc (s.size () * sizeof (T))); - this->max_size_ = s.size (); - } - - this->cur_size_ = s.size (); - - for (size_t i = 0; i < this->size (); i++) - new (&this->array_[i]) T (s.array_[i]); - } -} - -// Set an item in the array at location slot. - -template int -ACE_Array_Base::set (const T &new_item, size_t slot) -{ - if (this->in_range (slot)) - { - this->array_[slot] = new_item; - return 0; - } - else - return -1; -} - -// Get an item in the array at location slot. - -template int -ACE_Array_Base::get (T &item, size_t slot) const -{ - if (this->in_range (slot)) - { - // Copies the item. If you don't want to copy, use operator [] - // instead (but then you'll be responsible for range checking). - item = this->array_[slot]; - return 0; - } - else - return -1; -} - -template int -ACE_Array_Base::max_size (size_t new_size) -{ - if (new_size > this->max_size_) - { - T *tmp; - - ACE_ALLOCATOR_RETURN (tmp, - (T *) this->allocator_->malloc (new_size * sizeof (T)), - -1); - for (size_t i = 0; i < this->cur_size_; ++i) - new (&tmp[i]) T (this->array_[i]); - - // Initialize the new portion of the array that exceeds the - // previously allocated section. - for (size_t j = this->cur_size_; j < new_size; j++) - new (&tmp[j]) T; - - ACE_DES_ARRAY_FREE (this->array_, - this->max_size_, - this->allocator_->free, - T); - this->array_ = tmp; - this->max_size_ = new_size; - this->cur_size_ = new_size; - } - - return 0; -} - -template int -ACE_Array_Base::size (size_t new_size) -{ - int r = this->max_size (new_size); - if (r != 0) - return r; - this->cur_size_ = new_size; - return 0; -} - -// **************************************************************** - -// Compare this array with for equality. - -template int -ACE_Array::operator== (const ACE_Array &s) const -{ - if (this == &s) - return 1; - else if (this->size () != s.size ()) - return 0; - - for (size_t slot = 0; slot < s.size (); slot++) - if ((*this)[slot] != s[slot]) - return 0; - - return 1; -} - -// **************************************************************** - - -template int -ACE_Array_Iterator::next (T *&item) -{ - // ACE_TRACE ("ACE_Array_Iterator::next"); - - if (this->done ()) - { - item = 0; - return 0; - } - else - { - item = &array_[current_]; - return 1; - } -} - -#endif /* ACE_CONTAINERS_T_C */ diff --git a/ace/Containers_T.h b/ace/Containers_T.h deleted file mode 100644 index aac5f1115ac..00000000000 --- a/ace/Containers_T.h +++ /dev/null @@ -1,1845 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Containers_T.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_CONTAINERS_T_H -#define ACE_CONTAINERS_T_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Need by ACE_DLList_Node. -#include "ace/Containers.h" - -class ACE_Allocator; - -template -class ACE_Bounded_Stack -{ - // = TITLE - // Implement a generic LIFO abstract data type. - // - // = DESCRIPTION - // This implementation of a Stack uses a bounded array - // that is allocated dynamically. -public: - // = Initialization, assignemnt, and termination methods. - - ACE_Bounded_Stack (size_t size); - // Initialize a new stack so that it is empty. - ACE_Bounded_Stack (const ACE_Bounded_Stack &s); - // The copy constructor (performs initialization). - - void operator= (const ACE_Bounded_Stack &s); - // Assignment operator (performs assignment). - - ~ACE_Bounded_Stack (void); - // Perform actions needed when stack goes out of scope. - - // = Classic Stack operations. - - int push (const T &new_item); - // Place a new item on top of the stack. Returns -1 if the stack - // is already full, 0 if the stack is not already full, and -1 if - // failure occurs. - - int pop (T &item); - // Remove and return the top stack item. Returns -1 if the stack is - // already empty, 0 if the stack is not already empty, and -1 if - // failure occurs. - - int top (T &item) const; - // Return top stack item without removing it. Returns -1 if the - // stack is already empty, 0 if the stack is not already empty, and - // -1 if failure occurs. - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - int is_full (void) const; - // Returns 1 if the container is full, otherwise returns 0. - - size_t size (void) const; - // The number of items in the stack. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - size_t size_; - // Size of the dynamically allocated data. - - size_t top_; - // Keeps track of the current top of stack. - - T *stack_; - // Holds the stack's contents. -}; - -//---------------------------------------- - -template -class ACE_Fixed_Stack -{ - // = TITLE - // Implement a generic LIFO abstract data type. - // - // = DESCRIPTION - // This implementation of a Stack uses a fixed array - // with the size fixed at instantiation time. -public: - // = Initialization, assignemnt, and termination methods. - ACE_Fixed_Stack (void); - // Initialize a new stack so that it is empty. - - ACE_Fixed_Stack (const ACE_Fixed_Stack &s); - // The copy constructor (performs initialization). - - void operator= (const ACE_Fixed_Stack &s); - // Assignment operator (performs assignment). - - ~ACE_Fixed_Stack (void); - // Perform actions needed when stack goes out of scope. - - // = Classic Stack operations. - - int push (const T &new_item); - // Place a new item on top of the stack. Returns -1 if the stack - // is already full, 0 if the stack is not already full, and -1 if - // failure occurs. - - int pop (T &item); - // Remove and return the top stack item. Returns -1 if the stack is - // already empty, 0 if the stack is not already empty, and -1 if - // failure occurs. - - int top (T &item) const; - // Return top stack item without removing it. Returns -1 if the - // stack is already empty, 0 if the stack is not already empty, and - // -1 if failure occurs. - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - int is_full (void) const; - // Returns 1 if the container is full, otherwise returns 0. - - size_t size (void) const; - // The number of items in the stack. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - size_t size_; - // Size of the allocated data. - - size_t top_; - // Keeps track of the current top of stack. - - T stack_[ACE_SIZE]; - // Holds the stack's contents. -}; - -//---------------------------------------- - -// Forward declarations. -template class ACE_Unbounded_Set; -template class ACE_Unbounded_Set_Iterator; -template class ACE_Unbounded_Queue; -template class ACE_Unbounded_Queue_Iterator; -template class ACE_Unbounded_Stack; -template class ACE_Unbounded_Stack_Iterator; -template class ACE_Ordered_MultiSet; -template class ACE_Ordered_MultiSet_Iterator; - -template -class ACE_Node -{ - // = TITLE - // Implementation element in a Queue, Set, and Stack. -public: - friend class ACE_Unbounded_Queue; - friend class ACE_Unbounded_Queue_Iterator; - friend class ACE_Unbounded_Set; - friend class ACE_Unbounded_Set_Iterator; - friend class ACE_Unbounded_Stack; - friend class ACE_Unbounded_Stack_Iterator; - -# if ! defined (ACE_HAS_BROKEN_NOOP_DTORS) - ~ACE_Node (void); - // This isn't necessary, but it keeps some compilers happy. -# endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */ - -private: - // = Initialization methods - ACE_Node (const T &i, ACE_Node *n); - ACE_Node (ACE_Node *n = 0, int = 0); - ACE_Node (const ACE_Node &n); - - ACE_Node *next_; - // Pointer to next element in the list of s. - - T item_; - // Current value of the item in this node. -}; - -template -class ACE_DNode -{ - // = TITLE - // Implementation element in a bilinked list. - friend class ACE_Ordered_MultiSet; - friend class ACE_Ordered_MultiSet_Iterator; - -public: - -# if ! defined (ACE_HAS_BROKEN_NOOP_DTORS) - ~ACE_DNode (void); - // This isn't necessary, but it keeps some compilers happy. -# endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */ - -private: - - // = Initialization methods - ACE_DNode (const T &i, ACE_DNode *n = 0, ACE_DNode *p = 0); - - ACE_DNode *next_; - // Pointer to next element in the list of s. - - ACE_DNode *prev_; - // Pointer to previous element in the list of s. - - T item_; - // Current value of the item in this node. -}; - - -template -class ACE_Unbounded_Stack -{ - // = TITLE - // Implement a generic LIFO abstract data type. - // - // = DESCRIPTION - // This implementation of an unbounded Stack uses a linked list. - // If you use the or methods you should keep - // in mind that duplicate entries aren't allowed. In general, - // therefore, you should avoid the use of these methods since - // they aren't really part of the ADT stack. -public: - friend class ACE_Unbounded_Stack_Iterator; - - // Trait definition. - typedef ACE_Unbounded_Stack_Iterator ITERATOR; - - // = Initialization, assignemnt, and termination methods. - ACE_Unbounded_Stack (ACE_Allocator *alloc = 0); - // Initialize a new stack so that it is empty. Use user defined - // allocation strategy if specified. - - ACE_Unbounded_Stack (const ACE_Unbounded_Stack &s); - // The copy constructor (performs initialization). - - void operator= (const ACE_Unbounded_Stack &s); - // Assignment operator (performs assignment). - - ~ACE_Unbounded_Stack (void); - // Perform actions needed when stack goes out of scope. - - // = Classic Stack operations. - - int push (const T &new_item); - // Place a new item on top of the stack. Returns -1 if the stack - // is already full, 0 if the stack is not already full, and -1 if - // failure occurs. - - int pop (T &item); - // Remove and return the top stack item. Returns -1 if the stack is - // already empty, 0 if the stack is not already empty, and -1 if - // failure occurs. - - int top (T &item) const; - // Return top stack item without removing it. Returns -1 if the - // stack is already empty, 0 if the stack is not already empty, and - // -1 if failure occurs. - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - int is_full (void) const; - // Returns 1 if the container is full, otherwise returns 0. - - // = Auxiliary methods (not strictly part of the Stack ADT). - - int insert (const T &new_item); - // Insert into the Stack at the head (but doesn't allow - // duplicates). Returns -1 if failures occur, 1 if item is already - // present (i.e., no duplicates are allowed), else 0. - - int remove (const T &item); - // Remove from the Stack. Returns 0 if it removes the item, - // -1 if it can't find the item, and -1 if a failure occurs. - - int find (const T &item) const; - // Finds if occurs the set. Returns 0 if finds, else -1. - - size_t size (void) const; - // The number of items in the stack. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - void delete_all_nodes (void); - // Delete all the nodes in the stack. - - void copy_all_nodes (const ACE_Unbounded_Stack &s); - // Copy all nodes from to . - - ACE_Node *head_; - // Head of the linked list of Nodes. - - size_t cur_size_; - // Current size of the stack. - - ACE_Allocator *allocator_; - // Allocation strategy of the stack. -}; - -template -class ACE_Unbounded_Stack_Iterator -{ - // = TITLE - // Implement an iterator over an unbounded Stack. -public: - // = Initialization method. - ACE_Unbounded_Stack_Iterator (ACE_Unbounded_Stack &stack); - // Move to the first element in the . - - // = Iteration methods. - - int next (T *&next_item); - // Pass back the that hasn't been seen in the Stack. - // Returns 0 when all items have been seen, else 1. - - int advance (void); - // Move forward by one element in the Stack. Returns 0 when all the - // items in the Stack have been seen, else 1. - - int first (void); - // Move to the first element in the Stack. Returns 0 if the - // Stack is empty, else 1. - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_Node *current_; - // Pointer to the current node in the iteration. - - ACE_Unbounded_Stack &stack_; - // Pointer to the Stack we're iterating over. -}; - -template -class ACE_Unbounded_Queue; - -template -class ACE_Unbounded_Queue_Iterator -{ - // = TITLE - // Implement an iterator over an unbounded queue. -public: - // = Initialization method. - ACE_Unbounded_Queue_Iterator (ACE_Unbounded_Queue &q, int end = 0); - - // = Iteration methods. - - int next (T *&next_item); - // Pass back the that hasn't been seen in the queue. - // Returns 0 when all items have been seen, else 1. - - int advance (void); - // Move forward by one element in the set. Returns 0 when all the - // items in the queue have been seen, else 1. - - int first (void); - // Move to the first element in the queue. Returns 0 if the - // queue is empty, else 1. - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_Node *current_; - // Pointer to the current node in the iteration. - - ACE_Unbounded_Queue &queue_; - // Pointer to the queue we're iterating over. -}; - -template -class ACE_Unbounded_Queue -{ - // = TITLE - // A Queue of "infinite" length. - // - // = DESCRIPTION - // This implementation of an unbounded queue uses a circular - // linked list with a dummy node. -public: - friend class ACE_Unbounded_Queue_Iterator; - - // Trait definition. - typedef ACE_Unbounded_Queue_Iterator ITERATOR; - - // = Initialization and termination methods. - ACE_Unbounded_Queue (ACE_Allocator *alloc = 0); - // construction. Use user specified allocation strategy - // if specified. - - ACE_Unbounded_Queue (const ACE_Unbounded_Queue &); - // Copy constructor. - - void operator= (const ACE_Unbounded_Queue &); - // Assignment operator. - - ~ACE_Unbounded_Queue (void); - // construction. - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - int is_full (void) const; - // Returns 1 if the container is full, otherwise returns 0. - - // = Classic queue operations. - - int enqueue_tail (const T &new_item); - // Adds to the tail of the queue. Returns 0 on success, - // -1 on failure. - - int enqueue_head (const T &new_item); - // Adds to the head of the queue. Returns 0 on success, - // -1 on failure. - - int dequeue_head (T &item); - // Removes and returns the first on the queue. Returns 0 on - // success, -1 if the queue was empty. - - // = Additional utility methods. - - void reset (void); - // Reset the to be empty and release all its - // dynamically allocated resources. - - int get (T *&item, size_t slot = 0) const; - // Get the th element in the set. Returns -1 if the element - // isn't in the range {0.. - 1}, else 0. - - int set (const T &item, size_t slot); - // Set the th element in the set. Will pad out the set with - // empty nodes if is beyond the range {0.. - 1}. - // Returns -1 on failure, 0 if isn't initially in range, and - // 0 otherwise. - - size_t size (void) const; - // The number of items in the queue. - - void dump (void) const; - // Dump the state of an object. - - // = STL-styled unidirectional iterator factory. - ACE_Unbounded_Queue_Iterator begin (void); - ACE_Unbounded_Queue_Iterator end (void); - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - void delete_nodes (void); - // Delete all the nodes in the queue. - - void copy_nodes (const ACE_Unbounded_Queue &); - // Copy nodes into this queue. - - ACE_Node *head_; - // Pointer to the dummy node in the circular linked Queue. - - size_t cur_size_; - // Current size of the queue. - - ACE_Allocator *allocator_; - // Allocation Strategy of the queue. -}; - -template -class ACE_Double_Linked_List; - -template -class ACE_Double_Linked_List_Iterator_Base -{ - // = TITLE - // Implements a common base class for iterators for a double - // linked list ADT -public: - // = Iteration methods. - - int next (T *&) const; - // Passes back the under the iterator. Returns 0 if the - // iteration has completed, otherwise 1 - - T *next (void) const; - // Return the address of next (current) unvisited item in the list. - // 0 if there is no more element available. - // DEPRECATED - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - T & operator* (void) const ; - // STL-like iterator dereference operator: returns a reference - // to the node underneath the iterator. - - void reset (ACE_Double_Linked_List &); - // Retasks the iterator to iterate over a new - // Double_Linked_List. This allows clients to reuse an iterator - // without incurring the constructor overhead. If you do use this, - // be aware that if there are more than one reference to this - // iterator, the other "clients" may be very bothered when their - // iterator changes. @@ Here be dragons. Comments? - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - // = Initialization methods. - - ACE_Double_Linked_List_Iterator_Base (ACE_Double_Linked_List &); - // Constructor - - ACE_Double_Linked_List_Iterator_Base (const - ACE_Double_Linked_List_Iterator_Base - &iter); - // Copy constructor. - - // = Iteration methods. - int go_head (void); - // Move to the first element of the list. Returns 0 if the list is - // empty, else 1. Note: the head of the ACE_DLList is actually a - // null entry, so the first element is actually the 2n'd entry - - int go_tail (void); - // Move to the last element of the list. Returns 0 if the list is - // empty, else 1. - - T *not_done (void) const ; - // Check if we reach the end of the list. Can also be used to get - // the *current* element in the list. Return the address of the - // current item if there are still elements left , 0 if we run out - // of element. - - T *do_advance (void); - // Advance to the next element in the list. Return the address of the - // next element if there are more, 0 otherwise. - - T *do_retreat (void); - // Retreat to the previous element in the list. Return the address - // of the previous element if there are more, 0 otherwise. - - void dump_i (void) const; - // Dump the state of an object. - - T *current_; - // Remember where we are. - - ACE_Double_Linked_List *dllist_; -}; - -template -class ACE_Double_Linked_List_Iterator : public ACE_Double_Linked_List_Iterator_Base -{ - // = TITLE - // Implements an iterator for a double linked list ADT - // - // = DESCRIPTION - // Iterate thru the double-linked list. This class provides - // an interface that let users access the internal element - // addresses directly. Notice must delcare - // ACE_Double_Linked_List, - // ACE_Double_Linked_List_Iterator_Base and - // ACE_Double_Linked_List_Iterator as friend classes and class T - // should also have data members T* next_ and T* prev_. -public: - // = Initialization method. - ACE_Double_Linked_List_Iterator (ACE_Double_Linked_List &); - - void reset (ACE_Double_Linked_List &); - // Retasks the iterator to iterate over a new - // Double_Linked_List. This allows clients to reuse an iterator - // without incurring the constructor overhead. If you do use this, - // be aware that if there are more than one reference to this - // iterator, the other "clients" may be very bothered when their - // iterator changes. - // @@ Here be dragons. Comments? - - int first (void); - // Move to the first element in the list. Returns 0 if the - // list is empty, else 1. - - int advance (void); - // Move forward by one element in the list. Returns 0 when all the - // items in the list have been seen, else 1. - - T* advance_and_remove (int dont_remove); - // Advance the iterator while removing the original item from the - // list. Return a pointer points to the original (removed) item. - // If equals 0, this function behaves like - // but return 0 (NULL) instead. - - // = STL-style iteration methods - - ACE_Double_Linked_List_Iterator & operator++ (void); - // Prefix advance. - - ACE_Double_Linked_List_Iterator operator++ (int); - // Postfix advance. - - ACE_Double_Linked_List_Iterator & operator-- (void); - // Prefix reverse. - - ACE_Double_Linked_List_Iterator operator-- (int); - // Postfix reverse. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -template -class ACE_Double_Linked_List_Reverse_Iterator : public ACE_Double_Linked_List_Iterator_Base -{ - // = TITLE - // Implements a reverse iterator for a double linked list ADT - // - // = DESCRIPTION - // Iterate backwards over the double-linked list. This class - // provide an interface that let users access the internal - // element addresses directly, which seems to break the - // encapsulation. Notice must delcare - // ACE_Double_Linked_List, - // ACE_Double_Linked_List_Iterator_Base and - // ACE_Double_Linked_List_Iterator as friend classes and class T - // should also have data members T* next_ and T* prev_. -public: - // = Initialization method. - ACE_Double_Linked_List_Reverse_Iterator (ACE_Double_Linked_List &); - - void reset (ACE_Double_Linked_List &); - // Retasks the iterator to iterate over a new - // Double_Linked_List. This allows clients to reuse an iterator - // without incurring the constructor overhead. If you do use this, - // be aware that if there are more than one reference to this - // iterator, the other "clients" may be very bothered when their - // iterator changes. - // @@ Here be dragons. Comments? - - int first (void); - // Move to the first element in the list. Returns 0 if the - // list is empty, else 1. - - int advance (void); - // Move forward by one element in the list. Returns 0 when all the - // items in the list have been seen, else 1. - - T* advance_and_remove (int dont_remove); - // Advance the iterator while removing the original item from the - // list. Return a pointer points to the original (removed) item. - // If equals 0, this function behaves like - // but return 0 (NULL) instead. - - // = STL-style iteration methods - - ACE_Double_Linked_List_Reverse_Iterator & operator++ (void); - // Prefix advance. - - ACE_Double_Linked_List_Reverse_Iterator operator++ (int); - // Postfix advance. - - ACE_Double_Linked_List_Reverse_Iterator & operator-- (void); - // Prefix reverse. - - ACE_Double_Linked_List_Reverse_Iterator operator-- (int); - // Postfix reverse. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -template -class ACE_Double_Linked_List -{ - // = TITLE - // A double-linked list implementation. - // - // = DESCRIPTION - // This implementation of an unbounded double-linked list uses a - // circular linked list with a dummy node. It is pretty much - // like the except that it allows removing - // of a specific element from a specific location. - // - // Notice that this class is an implementation of a very simply - // data structure.is *NOT* a container class. You can use the - // class to implement other contains classes but it is *NOT* a - // general purpose container class. - // - // The parameter class *MUST* has members T* prev and T* next - // and users of this class are responsible to follow the general - // rules of using double-linked lists to maintaining the list - // integrities. - // - // If you need a double linked container class, check out the - // DLList class in this file. -public: - friend class ACE_Double_Linked_List_Iterator_Base; - friend class ACE_Double_Linked_List_Iterator; - friend class ACE_Double_Linked_List_Reverse_Iterator; - - // Trait definition. - typedef ACE_Double_Linked_List_Iterator ITERATOR; - typedef ACE_Double_Linked_List_Reverse_Iterator REVERSE_ITERATOR; - - // = Initialization and termination methods. - ACE_Double_Linked_List (ACE_Allocator *alloc = 0); - // construction. Use user specified allocation strategy - // if specified. - - ACE_Double_Linked_List (ACE_Double_Linked_List &); - // Copy constructor. - - void operator= (ACE_Double_Linked_List &); - // Assignment operator. - - ~ACE_Double_Linked_List (void); - // Destructor. - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - int is_full (void) const; - // Returns 1 if the container is full, otherwise returns 0. - - // = Classic queue operations. - - T *insert_tail (T *new_item); - // Adds to the tail of the list. Returns the new item - // that was inserted. - - T *insert_head (T *new_item); - // Adds to the head of the list.Returns the new item that - // was inserted. - - T* delete_head (void); - // Removes and returns the first in the list. Returns - // internal node's address on success, 0 if the queue was empty. - // This method will *not* free the internal node. - - T *delete_tail (void); - // Removes and returns the last in the list. Returns - // internal nodes's address on success, 0 if the queue was - // empty. This method will *not* free the internal node. - - // = Additional utility methods. - - void reset (void); - // Reset the to be empty. - // Notice that since no one is interested in the items within, - // This operation will delete all items. - - int get (T *&item, size_t slot = 0); - // Get the th element in the set. Returns -1 if the element - // isn't in the range {0.. - 1}, else 0. - - size_t size (void) const; - // The number of items in the queue. - - void dump (void) const; - // Dump the state of an object. - - int remove (T *n); - // Use DNode address directly. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - void delete_nodes (void); - // Delete all the nodes in the list. - - void copy_nodes (ACE_Double_Linked_List &); - // Copy nodes into this list. - - void init_head (void); - // Setup header pointer. Called after we create the head node in ctor. - - int insert_element (T *new_item, - int before = 0, - T *old_item = 0); - // Insert a into the list. It will be added before - // or after . Default is to insert the new item *after* - // . Return 0 if succeed, -1 if error occured. - - int remove_element (T *item); - // Remove an from the list. Return 0 if succeed, -1 otherwise. - // Notice that this function checks if item is and either its - // or is NULL. The function resets item's and - // to 0 to prevent clobbering the double-linked list if a user - // tries to remove the same node again. - - T *head_; - // Head of the circular double-linked list. - - size_t size_; - // Size of this list. - - ACE_Allocator *allocator_; - // Allocation Strategy of the queue. -}; - - -template class ACE_DLList; -template class ACE_DLList_Iterator; -template class ACE_DLList_Reverse_Iterator; - -typedef ACE_Double_Linked_List ACE_DLList_Base; - -//typedef ACE_Double_Linked_List_Iterator -// ACE_DLList_Iterator_Base; -//typedef ACE_Double_Linked_List_Reverse_Iterator -// ACE_DLList_Reverse_Iterator_Base; -//@@ These two typedefs (inherited from James Hu's original design) -// have been removed because Sun CC 4.2 had problems with it. I guess -// having the DLList_Iterators inheriting from a class which is -// actually a typedef leads to problems. #define'ing rather than -// typedef'ing worked, but as per Carlos's reccomendation, I'm just -// replacing all references to the base classes with their actual -// type. Matt Braun (6/15/99) - -template -class ACE_DLList : public ACE_DLList_Base -{ - // = TITLE - // A double-linked list container class. - // - // = DESCRIPTION - // This implementation uses ACE_Double_Linked_List to perform - // the logic behind this container class. It delegates all of its - // calls to ACE_Double_Linked_List. - - friend class ACE_DLList_Node; - friend class ACE_Double_Linked_List_Iterator; - friend class ACE_DLList_Iterator; - friend class ACE_DLList_Reverse_Iterator; - -public: - - void operator= (ACE_DLList &l); - // Delegates to ACE_Double_Linked_List. - - // = Classic queue operations. - - T *insert_tail (T *new_item); - // Delegates to ACE_Double_Linked_List. - - T *insert_head (T *new_item); - // Delegates to ACE_Double_Linked_List. - - T *delete_head (void); - // Delegates to ACE_Double_Linked_List. - - T *delete_tail (void); - // Delegates to ACE_Double_Linked_List. - - // = Additional utility methods. - - int get (T *&item, size_t slot = 0); - // Delegates to , but where - // returns the node as the item, this get - // returns the contents of the node in item. - - void dump (void) const; - // Delegates to ACE_Double_Linked_List. - - int remove (ACE_DLList_Node *n); - // Delegates to ACE_Double_Linked_List. - - - // = Initialization and termination methods. - - ACE_DLList (ACE_Allocator *alloc = 0); - // Delegates to ACE_Double_Linked_List. - - ACE_DLList (ACE_DLList &l); - // Delegates to ACE_Double_Linked_List. - - ~ACE_DLList (void); - // Deletes the list starting from the head. -}; - -template -class ACE_DLList_Iterator : public ACE_Double_Linked_List_Iterator -{ - // = TITLE - // A double-linked list container class iterator. - // - // = DESCRIPTION - // This implementation uses ACE_Double_Linked_List_Iterator to - // perform the logic behind this container class. It delegates - // all of its calls to ACE_Double_Linked_List_Iterator. - - friend class ACE_DLList; - friend class ACE_DLList_Node; - -public: - - // = Initialization method. - ACE_DLList_Iterator (ACE_DLList &l); - - void reset (ACE_DLList &l); - // Retasks the iterator to iterate over a new - // Double_Linked_List. This allows clients to reuse an iterator - // without incurring the constructor overhead. If you do use this, - // be aware that if there are more than one reference to this - // iterator, the other "clients" may be very bothered when their - // iterator changes. - // @@ Here be dragons. Comments? - - // = Iteration methods. - int advance (void); - // Move forward by one element in the set. Returns 0 when all the - // items in the set have been seen, else 1. - - int next (T *&); - // Pass back the that hasn't been seen in the Stack. - // Returns 0 when all items have been seen, else 1. - - T *next (void) const; - // Delegates to ACE_Double_Linked_List_Iterator, except that whereas - // the Double_Linked_List version of next returns the node, this next - // returns the contents of the node - // DEPRECATED - - int remove (void); - // Removes the current item (i.e., ) from the list. - - void dump (void) const; - // Delegates to ACE_Double_Linked_List_Iterator. - -private: - ACE_DLList *list_; -}; - -template -class ACE_DLList_Reverse_Iterator : public ACE_Double_Linked_List_Reverse_Iterator -{ - // = TITLE - // A double-linked list container class iterator. - // - // = DESCRIPTION - // This implementation uses ACE_Double_Linked_List_Iterator to - // perform the logic behind this container class. It delegates - // all of its calls to ACE_Double_Linked_List_Iterator. - - friend class ACE_DLList; - friend class ACE_DLList_Node; - -public: - - // = Initialization method. - ACE_DLList_Reverse_Iterator (ACE_DLList &l); - - void reset (ACE_DLList &l); - // Retasks the iterator to iterate over a new - // Double_Linked_List. This allows clients to reuse an iterator - // without incurring the constructor overhead. If you do use this, - // be aware that if there are more than one reference to this - // iterator, the other "clients" may be very bothered when their - // iterator changes. - // @@ Here be dragons. Comments? - - // = Iteration methods. - int advance (void); - // Move forward by one element in the set. Returns 0 when all the - // items in the set have been seen, else 1. - - int next (T *&); - // Pass back the that hasn't been seen in the Stack. - // Returns 0 when all items have been seen, else 1. - - T *next (void) const; - // Delegates to ACE_Double_Linked_List_Iterator. - // DEPRECATED - - int remove (void); - // Removes the current item (i.e., ) from the list. - - void dump (void) const; - // Delegates to ACE_Double_Linked_List_Iterator. - -private: - ACE_DLList *list_; -}; - -template -class ACE_Unbounded_Set_Iterator -{ - // = TITLE - // Implement an iterator over an unbounded set. -public: - // = Initialization method. - ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set &s, int end = 0); - - // = Iteration methods. - - int next (T *&next_item); - // Pass back the that hasn't been seen in the Set. - // Returns 0 when all items have been seen, else 1. - - int advance (void); - // Move forward by one element in the set. Returns 0 when all the - // items in the set have been seen, else 1. - - int first (void); - // Move to the first element in the set. Returns 0 if the - // set is empty, else 1. - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - void dump (void) const; - // Dump the state of an object. - - // = STL styled iteration, compare, and reference functions. - - ACE_Unbounded_Set_Iterator operator++ (int); - // Postfix advance. - - ACE_Unbounded_Set_Iterator& operator++ (void); - // Prefix advance. - - T& operator* (void); - // Returns a reference to the interal element is pointing to. - - int operator== (const ACE_Unbounded_Set_Iterator &) const; - int operator!= (const ACE_Unbounded_Set_Iterator &) const; - // Check if two iterators point to the same position - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - - ACE_Node *current_; - // Pointer to the current node in the iteration. - - ACE_Unbounded_Set *set_; - // Pointer to the set we're iterating over. -}; - -template -class ACE_Unbounded_Set -{ - // = TITLE - // Implement a simple unordered set of of unbounded size. - // - // = DESCRIPTION - // This implementation of an unordered set uses a circular - // linked list with a dummy node. This implementation does not - // allow duplicates, but it maintains FIFO ordering of insertions. -public: - friend class ACE_Unbounded_Set_Iterator; - - // Trait definition. - typedef ACE_Unbounded_Set_Iterator ITERATOR; - typedef ACE_Unbounded_Set_Iterator iterator; - - // = Initialization and termination methods. - ACE_Unbounded_Set (ACE_Allocator *alloc = 0); - // Constructor. Use user specified allocation strategy - // if specified. - - ACE_Unbounded_Set (const ACE_Unbounded_Set &); - // Copy constructor. - - void operator= (const ACE_Unbounded_Set &); - // Assignment operator. - - ~ACE_Unbounded_Set (void); - // Destructor. - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - int is_full (void) const; - // Returns 1 if the container is full, otherwise returns 0. - - // = Classic unordered set operations. - - int insert (const T &new_item); - // Insert into the set (doesn't allow duplicates). - // Returns -1 if failures occur, 1 if item is already present, else - // 0. - - int remove (const T &item); - // Remove first occurrence of from the set. Returns 0 if - // it removes the item, -1 if it can't find the item, and -1 if a - // failure occurs. - - int find (const T &item) const; - // Finds if occurs in the set. Returns 0 if find succeeds, - // else -1. - - size_t size (void) const; - // Size of the set. - - void dump (void) const; - // Dump the state of an object. - - void reset (void); - // Reset the to be empty. - - // = STL-styled unidirectional iterator factory. - ACE_Unbounded_Set_Iterator begin (void); - ACE_Unbounded_Set_Iterator end (void); - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - int insert_tail (const T &item); - // Insert at the tail of the set (doesn't check for - // duplicates). - - void delete_nodes (void); - // Delete all the nodes in the Set. - - void copy_nodes (const ACE_Unbounded_Set &); - // Copy nodes into this set. - - ACE_Node *head_; - // Head of the linked list of Nodes. - - size_t cur_size_; - // Current size of the set. - - ACE_Allocator *allocator_; - // Allocation strategy of the set. -}; - -// Forward declaration. -template -class ACE_Fixed_Set; - -template -class ACE_Fixed_Set_Iterator -{ - // = TITLE - // Interates through an unordered set. - // - // = DESCRIPTION - // This implementation of an unordered set uses a fixed array. - // Allows deletions while iteration is occurring. -public: - // = Initialization method. - ACE_Fixed_Set_Iterator (ACE_Fixed_Set &s); - - // = Iteration methods. - - int next (T *&next_item); - // Pass back the that hasn't been seen in the Set. - // Returns 0 when all items have been seen, else 1. - - int advance (void); - // Move forward by one element in the set. Returns 0 when all the - // items in the set have been seen, else 1. - - int first (void); - // Move to the first element in the set. Returns 0 if the - // set is empty, else 1. - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_Fixed_Set &s_; - // Set we are iterating over. - - ssize_t next_; - // How far we've advanced over the set. -}; - -template -class ACE_Fixed_Set -{ - // = TITLE - // Implement a simple unordered set of with maximum . - // - // = DESCRIPTION - // This implementation of an unordered set uses a fixed array. - // This implementation does not allow duplicates... -public: - friend class ACE_Fixed_Set_Iterator; - - // Trait definition. - typedef ACE_Fixed_Set_Iterator ITERATOR; - - // = Initialization and termination methods. - ACE_Fixed_Set (void); - // Constructor. - - ACE_Fixed_Set (const ACE_Fixed_Set &); - // Copy constructor. - - void operator= (const ACE_Fixed_Set &); - // Assignment operator. - - ~ACE_Fixed_Set (void); - // Destructor. - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - int is_full (void) const; - // Returns 1 if the container is full, otherwise returns 0. - - // = Classic unordered set operations. - - int insert (const T &new_item); - // Insert into the set (doesn't allow duplicates). - // Returns -1 if failures occur, 1 if item is already present, else - // 0. - - int remove (const T &item); - // Remove first occurrence of from the set. Returns 0 if - // it removes the item, -1 if it can't find the item, and -1 if a - // failure occurs. - - int find (const T &item) const; - // Finds if occurs in the set. Returns 0 if finds, else -1. - - size_t size (void) const; - // Size of the set. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - struct - { - T item_; - // Item in the set. - - int is_free_; - // Keeps track of whether this item is in use or not. - } search_structure_[ACE_SIZE]; - // Holds the contents of the set. - - size_t cur_size_; - // Current size of the set. - - size_t max_size_; - // Maximum size of the set. -}; - -// Forward declaration. -template -class ACE_Bounded_Set; - -template -class ACE_Bounded_Set_Iterator -{ - // = TITLE - // Interates through an unordered set. - // - // = DESCRIPTION - // This implementation of an unordered set uses a Bounded array. - // Allows deletions while iteration is occurring. -public: - // = Initialization method. - ACE_Bounded_Set_Iterator (ACE_Bounded_Set &s); - - // = Iteration methods. - - int next (T *&next_item); - // Pass back the that hasn't been seen in the Set. - // Returns 0 when all items have been seen, else 1. - - int advance (void); - // Move forward by one element in the set. Returns 0 when all the - // items in the set have been seen, else 1. - - int first (void); - // Move to the first element in the set. Returns 0 if the - // set is empty, else 1. - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_Bounded_Set &s_; - // Set we are iterating over. - - ssize_t next_; - // How far we've advanced over the set. -}; - -template -class ACE_Bounded_Set -{ - // = TITLE - // Implement a simple unordered set of with maximum - // set at creation time. - // - // = DESCRIPTION - // This implementation of an unordered set uses a Bounded array. - // This implementation does not allow duplicates... -public: - friend class ACE_Bounded_Set_Iterator; - - // Trait definition. - typedef ACE_Bounded_Set_Iterator ITERATOR; - - enum - { - DEFAULT_SIZE = 10 - }; - - // = Initialization and termination methods. - ACE_Bounded_Set (void); - // Constructor. - - ACE_Bounded_Set (size_t size); - // Constructor. - - ACE_Bounded_Set (const ACE_Bounded_Set &); - // Copy constructor. - - void operator= (const ACE_Bounded_Set &); - // Assignment operator. - - ~ACE_Bounded_Set (void); - // Destructor - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - int is_full (void) const; - // Returns 1 if the container is full, otherwise returns 0. - - // = Classic unordered set operations. - - int insert (const T &new_item); - // Insert into the set (doesn't allow duplicates). - // Returns -1 if failures occur, 1 if item is already present, else - // 0. - - int remove (const T &item); - // Remove first occurrence of from the set. Returns 0 if it - // removes the item, -1 if it can't find the item, and -1 if a - // failure occurs. - - int find (const T &item) const; - // Finds if occurs in the set. Returns 0 if finds, else -1. - - size_t size (void) const; - // Size of the set. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - struct Search_Structure - { - T item_; - // Item in the set. - - int is_free_; - // Keeps track of whether this item is in use or not. - }; - - Search_Structure *search_structure_; - // Holds the contents of the set. - - size_t cur_size_; - // Current size of the set. - - size_t max_size_; - // Maximum size of the set. -}; - -template -class ACE_Ordered_MultiSet_Iterator -{ - // = TITLE - // Implement a bidirectional iterator over an ordered multiset. - // This class template requires that < operator semantics be - // defined for the parameterized type , but does not impose - // any restriction on how that ordering operator is implemented. -public: - friend class ACE_Ordered_MultiSet; - - // = Initialization method. - ACE_Ordered_MultiSet_Iterator (ACE_Ordered_MultiSet &s); - - // = Iteration methods. - - int next (T *&next_item) const; - // Pass back the that hasn't been seen in the ordered multiset. - // Returns 0 when all items have been seen, else 1. - - int first (void); - // Repositions the iterator at the first item in the ordered multiset - // Returns 0 if the list is empty else 1. - - int last (void); - // Repositions the iterator at the last item in the ordered multiset - // Returns 0 if the list is empty else 1. - - int advance (void); - // Move forward by one element in the set. Returns 0 when all the - // items in the set have been seen, else 1. - - int retreat (void); - // Move backward by one element in the set. Returns 0 when all the - // items in the set have been seen, else 1. - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - - ACE_DNode *current_; - // Pointer to the current node in the iteration. - - ACE_Ordered_MultiSet &set_; - // Pointer to the set we're iterating over. -}; - -template -class ACE_Ordered_MultiSet -{ - // = TITLE - // Implement a simple ordered multiset of of unbounded size. - // This class template requires that < operator semantics be - // defined for the parameterized type , but does not impose - // any restriction on how that ordering operator is implemented. - // - // = DESCRIPTION - // This implementation of an unordered set uses a circular - // linked list with a dummy node. This implementation does not - // allow duplicates, but it maintains FIFO ordering of - // insertions. -public: - friend class ACE_Ordered_MultiSet_Iterator; - - // Trait definition. - typedef ACE_Ordered_MultiSet_Iterator ITERATOR; - - // = Initialization and termination methods. - ACE_Ordered_MultiSet (ACE_Allocator *alloc = 0); - // Constructor. Use user specified allocation strategy - // if specified. - - ACE_Ordered_MultiSet (const ACE_Ordered_MultiSet &); - // Copy constructor. - - ~ACE_Ordered_MultiSet (void); - // Destructor. - - void operator= (const ACE_Ordered_MultiSet &); - // Assignment operator. - - // = Check boundary conditions. - - int is_empty (void) const; - // Returns 1 if the container is empty, otherwise returns 0. - - size_t size (void) const; - // Size of the set. - - // = Classic unordered set operations. - - int insert (const T &new_item); - // Insert into the ordered multiset. - // Returns -1 if failures occur, else 0. - - int insert (const T &new_item, ITERATOR &iter); - // Insert into the ordered multiset, starting its search at - // the node pointed to by the iterator, and if insetion was successful, - // updates the iterator to point to the newly inserted node. - // Returns -1 if failures occur, else 0. - - int remove (const T &item); - // Remove first occurrence of from the set. Returns 0 if - // it removes the item, -1 if it can't find the item. - - int find (const T &item, ITERATOR &iter) const; - // Finds first occurrance of in the multiset, using the iterator's - // current position as a hint to improve performance. If find succeeds, - // it positions the iterator at that node and returns 0, or if it cannot - // locate the node, it leaves the iterator alone and just returns -1. - - void reset (void); - // Reset the to be empty. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - - int insert_from (const T &item, ACE_DNode *start_position, - ACE_DNode **new_position); - // Insert , starting its search at the position given, - // and if successful updates the passed pointer to point to - // the newly inserted item's node. - - int locate (const T &item, ACE_DNode *start_position, - ACE_DNode *&new_position) const; - // looks for first occurance of in the ordered set, using the - // passed starting position as a hint: if there is such an instance, it - // updates the new_position pointer to point to this node and returns 0; - // if there is no such node, then if there is a node before where the - // item would have been, it updates the new_position pointer to point - // to this node and returns -1; if there is no such node, then if there - // is a node after where the item would have been, it updates the - // new_position pointer to point to this node (or 0 if there is no such - // node) and returns 1; - - void delete_nodes (void); - // Delete all the nodes in the Set. - - void copy_nodes (const ACE_Ordered_MultiSet &); - // Copy nodes into this set. - - ACE_DNode *head_; - // Head of the bilinked list of Nodes. - - ACE_DNode *tail_; - // Head of the bilinked list of Nodes. - - size_t cur_size_; - // Current size of the set. - - ACE_Allocator *allocator_; - // Allocation strategy of the set. -}; - -// **************************************************************** - -// Forward declaration. -template class ACE_Array_Iterator; - -template -class ACE_Array_Base -{ - // = TITLE - // Implement a simple dynamic array - // - // = DESCRIPTION - // This parametric class implements a simple dynamic array; - // resizing must be controlled by the user. No comparison or find - // operations are implemented. - // -public: - - // Define a "trait" - typedef T TYPE; - typedef ACE_Array_Iterator ITERATOR; - - // = Initialization and termination methods. - - ACE_Array_Base (size_t size = 0, - ACE_Allocator *alloc = 0); - // Dynamically create an uninitialized array. - - ACE_Array_Base (size_t size, - const T &default_value, - ACE_Allocator *alloc = 0); - // Dynamically initialize the entire array to the . - - ACE_Array_Base (const ACE_Array_Base &s); - // The copy constructor performs initialization by making an exact - // copy of the contents of parameter , i.e., *this == s will - // return true. - - void operator= (const ACE_Array_Base &s); - // Assignment operator performs an assignment by making an exact - // copy of the contents of parameter , i.e., *this == s will - // return true. Note that if the of is >= than - // we can copy it without reallocating. However, if - // is < we must delete the , - // reallocate a new , and then copy the contents of . - - ~ACE_Array_Base (void); - // Clean up the array (e.g., delete dynamically allocated memory). - - // = Set/get methods. - - T &operator [] (size_t slot); - // Set item in the array at location . Doesn't - // perform range checking. - - const T &operator [] (size_t slot) const; - // Get item in the array at location . Doesn't - // perform range checking. - - int set (const T &new_item, size_t slot); - // Set an item in the array at location . Returns - // -1 if is not in range, else returns 0. - - int get (T &item, size_t slot) const; - // Get an item in the array at location . Returns -1 if - // is not in range, else returns 0. Note that this function - // copies the item. If you want to avoid the copy, you can use - // the const operator [], but then you'll be responsible for range checking. - - size_t size (void) const; - // Returns the of the array. - - int size (size_t new_size); - // Changes the size of the array to match . - // It copies the old contents into the new array. - // Return -1 on failure. - - size_t max_size (void) const; - // Returns the of the array. - - int max_size (size_t new_size); - // Changes the size of the array to match . - // It copies the old contents into the new array. - // Return -1 on failure. - // It does not affect new_size - -private: - int in_range (size_t slot) const; - // Returns 1 if is within range, i.e., 0 >= < - // , else returns 0. - - size_t max_size_; - // Maximum size of the array, i.e., the total number of elements - // in . - - size_t cur_size_; - // Current size of the array. This starts out being == to - // . However, if we are assigned a smaller array, then - // will become less than . The purpose of - // keeping track of both sizes is to avoid reallocating memory if we - // don't have to. - - T *array_; - // Pointer to the array's storage buffer. - - ACE_Allocator *allocator_; - // Allocation strategy of the ACE_Array_Base. - - friend class ACE_Array_Iterator; -}; - -// **************************************************************** - -template -class ACE_Array : public ACE_Array_Base -{ - // = TITLE - // Implement a dynamic array class. - // - // = DESCRIPTION - // This class extends ACE_Array_Base, it provides comparison - // operators. -public: - // Define a "trait" - typedef T TYPE; - - typedef ACE_Array_Iterator ITERATOR; - - // = Exceptions. - - // = Initialization and termination methods. - - ACE_Array (size_t size = 0, - ACE_Allocator* alloc = 0); - // Dynamically create an uninitialized array. - - ACE_Array (size_t size, - const T &default_value, - ACE_Allocator* alloc = 0); - // Dynamically initialize the entire array to the . - - ACE_Array (const ACE_Array &s); - // The copy constructor performs initialization by making an exact - // copy of the contents of parameter , i.e., *this == s will - // return true. - - void operator= (const ACE_Array &s); - // Assignment operator performs an assignment by making an exact - // copy of the contents of parameter , i.e., *this == s will - // return true. Note that if the of is >= than - // we can copy it without reallocating. However, if - // is < we must delete the , - // reallocate a new , and then copy the contents of . - - // = Compare operators - - int operator== (const ACE_Array &s) const; - // Compare this array with for equality. Two arrays are equal - // if their 's are equal and all the elements from 0 .. - // are equal. - - int operator!= (const ACE_Array &s) const; - // Compare this array with for inequality such that <*this> != - // is always the complement of the boolean return value of - // <*this> == . -}; - -template -class ACE_Array_Iterator -{ - // = TITLE - // Implement an iterator over an ACE_Array. - // - // = DESCRIPTION - // This iterator is safe in the face of array element deletions. - // But it is NOT safe if the array is resized (via the ACE_Array - // assignment operator) during iteration. That would be very - // odd, and dangerous. -public: - // = Initialization method. - ACE_Array_Iterator (ACE_Array_Base &); - - // = Iteration methods. - - int next (T *&next_item); - // Pass back the that hasn't been seen in the Array. - // Returns 0 when all items have been seen, else 1. - - int advance (void); - // Move forward by one element in the Array. Returns 0 when all the - // items in the Array have been seen, else 1. - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - u_int current_; - // Pointer to the current item in the iteration. - - ACE_Array_Base &array_; - // Pointer to the Array we're iterating over. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Containers_T.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Containers_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Containers_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_CONTAINERS_T_H */ diff --git a/ace/Containers_T.i b/ace/Containers_T.i deleted file mode 100644 index f1835efacbe..00000000000 --- a/ace/Containers_T.i +++ /dev/null @@ -1,585 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Containers.i - -template ACE_INLINE int -ACE_Bounded_Stack::is_empty (void) const -{ - ACE_TRACE ("ACE_Bounded_Stack::is_empty"); - return this->top_ == 0; -} - -template ACE_INLINE int -ACE_Bounded_Stack::is_full (void) const -{ - ACE_TRACE ("ACE_Bounded_Stack::is_full"); - return this->top_ >= this->size_; -} - -template ACE_INLINE int -ACE_Bounded_Stack::push (const T &new_item) -{ - ACE_TRACE ("ACE_Bounded_Stack::push"); - if (this->is_full () == 0) - { - this->stack_[this->top_++] = new_item; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Bounded_Stack::pop (T &item) -{ - ACE_TRACE ("ACE_Bounded_Stack::pop"); - if (this->is_empty () == 0) - { - item = this->stack_[--this->top_]; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Bounded_Stack::top (T &item) const -{ - ACE_TRACE ("ACE_Bounded_Stack::top"); - if (this->is_empty () == 0) - { - item = this->stack_[this->top_ - 1]; - return 0; - } - else - return -1; -} - -template ACE_INLINE size_t -ACE_Bounded_Stack::size (void) const -{ - return this->size_; -} - -//---------------------------------------- - -template ACE_INLINE int -ACE_Fixed_Stack::is_empty (void) const -{ - ACE_TRACE ("ACE_Fixed_Stack::is_empty"); - return this->top_ == 0; -} - -template ACE_INLINE int -ACE_Fixed_Stack::is_full (void) const -{ - ACE_TRACE ("ACE_Fixed_Stack::is_full"); - return this->top_ >= this->size_; -} - -template ACE_INLINE int -ACE_Fixed_Stack::push (const T &new_item) -{ - ACE_TRACE ("ACE_Fixed_Stack::push"); - if (this->is_full () == 0) - { - this->stack_[this->top_++] = new_item; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Fixed_Stack::pop (T &item) -{ - ACE_TRACE ("ACE_Fixed_Stack::pop"); - if (this->is_empty () == 0) - { - item = this->stack_[--this->top_]; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Fixed_Stack::top (T &item) const -{ - ACE_TRACE ("ACE_Fixed_Stack::top"); - if (this->is_empty () == 0) - { - item = this->stack_[this->top_ - 1]; - return 0; - } - else - return -1; -} - -template ACE_INLINE size_t -ACE_Fixed_Stack::size (void) const -{ - return this->size_; -} - -template ACE_INLINE int -ACE_Unbounded_Stack::is_empty (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Stack::is_empty"); - return this->head_ == this->head_->next_; -} - -template ACE_INLINE int -ACE_Unbounded_Stack::top (T &item) const -{ - ACE_TRACE ("ACE_Unbounded_Stack::top"); - if (this->is_empty () == 0) - { - item = this->head_->next_->item_; - return 0; - } - else - return -1; -} - -template ACE_INLINE int -ACE_Unbounded_Stack::is_full (void) const -{ - ACE_TRACE ("ACE_Unbounded_Stack::is_full"); - return 0; // ??? -} - -template ACE_INLINE size_t -ACE_Unbounded_Stack::size (void) const -{ - return this->cur_size_; -} - -// --- - -template ACE_INLINE size_t -ACE_Unbounded_Queue::size (void) const -{ - return this->cur_size_; -} - -template ACE_INLINE int -ACE_Unbounded_Queue::is_empty (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Queue::is_empty"); - return this->head_ == this->head_->next_; -} - -template ACE_INLINE int -ACE_Unbounded_Queue::is_full (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Queue::is_full"); - return 0; // We should implement a "node of last resort for this..." -} - -// --- - -template ACE_INLINE int -ACE_Unbounded_Set::is_empty (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set::is_empty"); - return this->head_ == this->head_->next_; -} - -template ACE_INLINE int -ACE_Unbounded_Set::is_full (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set::is_full"); - return 0; // We should implement a "node of last resort for this..." -} - -// --- - -template ACE_INLINE int -ACE_Fixed_Set::is_empty (void) const -{ - ACE_TRACE ("ACE_Fixed_Set::is_empty"); - return this->cur_size_ == 0; -} - -template ACE_INLINE int -ACE_Fixed_Set::is_full (void) const -{ - ACE_TRACE ("ACE_Fixed_Set::is_full"); - return this->cur_size_ == this->max_size_; -} - -// --- - -template ACE_INLINE int -ACE_Bounded_Set::is_empty (void) const -{ - ACE_TRACE ("ACE_Bounded_Set::is_empty"); - return this->cur_size_ == 0; -} - -#if !defined (__Lynx__) - // LynxOS 3.0.0 native g++ compiler raises internal error with this inline. -template ACE_INLINE int -ACE_Bounded_Set::is_full (void) const -{ - ACE_TRACE ("ACE_Bounded_Set::is_full"); - return this->cur_size_ == this->max_size_; -} -#endif /* ! __Lynx__ */ - -// -- - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::first (void) -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::first"); - current_ = set_.head_; - - return (current_ ? 1 : 0); -} - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::last (void) -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::last"); - current_ = set_.tail_; - - return (current_ ? 1 : 0); -} - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::advance (void) -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::advance"); - - current_ = current_ ? current_->next_ : 0; - - return (current_ ? 1 : 0); -} - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::retreat (void) -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::retreat"); - - current_ = current_ ? current_->prev_ : 0; - - return (current_ ? 1 : 0); -} - -template ACE_INLINE int -ACE_Ordered_MultiSet_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::done"); - - return (current_ ? 0 : 1); -} - -template ACE_INLINE void -ACE_Ordered_MultiSet_Iterator::dump (void) const -{ -// ACE_TRACE ("ACE_Ordered_MultiSet_Iterator::dump"); -} - - - -// -- - -template ACE_INLINE int -ACE_Ordered_MultiSet::is_empty (void) const -{ - ACE_TRACE ("ACE_Ordered_MultiSet::is_empty"); - return this->cur_size_ > 0 ? 0 : 1; -} - -template ACE_INLINE size_t -ACE_Ordered_MultiSet::size (void) const -{ -// ACE_TRACE ("ACE_Ordered_MultiSet::size"); - return this->cur_size_; -} - -// **************************************************************** - -// Clean up the array (e.g., delete dynamically allocated memory). - -template ACE_INLINE -ACE_Array_Base::~ACE_Array_Base (void) -{ - ACE_DES_ARRAY_FREE (this->array_, - this->max_size_, - this->allocator_->free, - T); -} - -template ACE_INLINE size_t -ACE_Array_Base::size (void) const -{ - return this->cur_size_; -} - -template ACE_INLINE size_t -ACE_Array_Base::max_size (void) const -{ - return this->max_size_; -} - -template ACE_INLINE int -ACE_Array_Base::in_range (size_t index) const -{ - return index < this->cur_size_; -} - -template ACE_INLINE T & -ACE_Array_Base::operator[] (size_t index) -{ - return this->array_[index]; -} - -template ACE_INLINE const T & -ACE_Array_Base::operator[] (size_t index) const -{ - return this->array_[index]; -} - -// **************************************************************** - -template ACE_INLINE -ACE_Array::ACE_Array (size_t size, - ACE_Allocator *alloc) - : ACE_Array_Base (size, alloc) -{ -} - -template ACE_INLINE -ACE_Array::ACE_Array (size_t size, - const T &default_value, - ACE_Allocator *alloc) - : ACE_Array_Base (size, default_value, alloc) -{ -} - -// The copy constructor (performs initialization). - -template ACE_INLINE -ACE_Array::ACE_Array (const ACE_Array &s) - : ACE_Array_Base (s) -{ -} - -// Assignment operator (performs assignment). - -template ACE_INLINE void -ACE_Array::operator= (const ACE_Array &s) -{ - // Check for "self-assignment". - - if (this != &s) - this->ACE_Array_Base::operator= (s); -} - -// Compare this array with for inequality. - -template ACE_INLINE int -ACE_Array::operator!= (const ACE_Array &s) const -{ - return !(*this == s); -} - -// **************************************************************** - -template ACE_INLINE void -ACE_Array_Iterator::dump (void) const -{ - // ACE_TRACE ("ACE_Array_Iterator::dump"); -} - -template ACE_INLINE -ACE_Array_Iterator::ACE_Array_Iterator (ACE_Array_Base &a) - : current_ (0), - array_ (a) -{ - // ACE_TRACE ("ACE_Array_Iterator::ACE_Array_Iterator"); -} - -template ACE_INLINE int -ACE_Array_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Array_Iterator::advance"); - - if (this->current_ < array_.size ()) - { - ++this->current_; - return 1; - } - else - { - // Already finished iterating. - return 0; - } -} - -template ACE_INLINE int -ACE_Array_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Array_Iterator::done"); - - return this->current_ >= array_.size (); -} - -// **************************************************************** - -template ACE_INLINE void -ACE_DLList::operator= (ACE_DLList &l) -{ - *(ACE_DLList_Base *) this = l; -} - -template ACE_INLINE int -ACE_DLList::get (T *&item, size_t index) -{ - ACE_DLList_Node *node; - int result = ACE_DLList_Base::get (node, index); - if (result != -1) - item = (T *) node->item_; - return result; -} - -template ACE_INLINE void -ACE_DLList::dump (void) const -{ - ACE_DLList_Base::dump (); -} - -template ACE_INLINE int -ACE_DLList::remove (ACE_DLList_Node *n) -{ - int result = ACE_DLList_Base::remove (n); - ACE_DES_FREE (n, - this->allocator_->free, - ACE_DLList_Node); - return result; -} - -template ACE_INLINE -ACE_DLList::ACE_DLList (ACE_Allocator *alloc ) - : ACE_DLList_Base (alloc) -{ -} - -template ACE_INLINE -ACE_DLList::ACE_DLList (ACE_DLList &l) - : ACE_DLList_Base ((ACE_DLList &) l) -{ -} - -template ACE_INLINE -ACE_DLList::~ACE_DLList (void) -{ - while (this->delete_head ()) ; -} - -template ACE_INLINE int -ACE_DLList_Iterator::remove (void) -{ - ACE_DLList_Node *temp = this->ACE_Double_Linked_List_Iterator ::next (); - this->ACE_Double_Linked_List_Iterator ::advance (); - return list_->remove (temp); -} - -template ACE_INLINE -ACE_DLList_Iterator::ACE_DLList_Iterator (ACE_DLList &l) - : ACE_Double_Linked_List_Iterator ((ACE_DLList_Base &)l), - list_ (&l) -{ -} - -template ACE_INLINE void -ACE_DLList_Iterator::reset (ACE_DLList &l) -{ - list_ = &l; - this->ACE_Double_Linked_List_Iterator ::reset ((ACE_DLList_Base &)l); -} - -template ACE_INLINE int -ACE_DLList_Iterator::next (T *&ptr) -{ - ACE_DLList_Node *temp = - ACE_Double_Linked_List_Iterator ::next (); - if (temp) - ptr = (T *) temp->item_; - return temp ? 1 : 0; -} - -template ACE_INLINE T * -ACE_DLList_Iterator::next (void) const -{ - ACE_DLList_Node *temp = ACE_Double_Linked_List_Iterator ::next (); - return (T *) (temp ? temp->item_ : 0); -} - -template ACE_INLINE int -ACE_DLList_Iterator::advance (void) -{ - return this->ACE_Double_Linked_List_Iterator ::advance (); -} - -template ACE_INLINE void -ACE_DLList_Iterator::dump (void) const -{ - ACE_Double_Linked_List_Iterator ::dump (); -} - - -template ACE_INLINE int -ACE_DLList_Reverse_Iterator::remove (void) -{ - ACE_DLList_Node *temp = ACE_Double_Linked_List_Reverse_Iterator ::next (); - this->ACE_Double_Linked_List_Reverse_Iterator ::advance (); - return list_->remove (temp); -} - -template ACE_INLINE -ACE_DLList_Reverse_Iterator::ACE_DLList_Reverse_Iterator (ACE_DLList &l) - : ACE_Double_Linked_List_Reverse_Iterator ((ACE_DLList_Base &)l), - list_ (&l) -{ -} - -template ACE_INLINE void -ACE_DLList_Reverse_Iterator::reset (ACE_DLList &l) -{ - list_ = &l; - this->ACE_Double_Linked_List_Reverse_Iterator ::reset ((ACE_DLList_Base &)l); -} - -template ACE_INLINE int -ACE_DLList_Reverse_Iterator::advance (void) -{ - return ACE_Double_Linked_List_Reverse_Iterator ::advance (); -} - -template ACE_INLINE int -ACE_DLList_Reverse_Iterator::next (T *&ptr) -{ - ACE_DLList_Node *temp = - ACE_Double_Linked_List_Reverse_Iterator ::next (); - ptr = (T *) temp->item_; - return ptr ? 1 : 0; -} - -template ACE_INLINE T * -ACE_DLList_Reverse_Iterator::next (void) const -{ - ACE_DLList_Node *temp = ACE_Double_Linked_List_Reverse_Iterator ::next (); - return (T *) (temp ? temp->item_ : 0); -} - - -template ACE_INLINE void -ACE_DLList_Reverse_Iterator::dump (void) const -{ - ACE_Double_Linked_List_Reverse_Iterator ::dump (); -} diff --git a/ace/DEV.cpp b/ace/DEV.cpp deleted file mode 100644 index 0aa66003edb..00000000000 --- a/ace/DEV.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// DEV.cpp -// $Id$ - - -#include "ace/DEV.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/DEV.i" -#endif - -ACE_RCSID(ace, DEV, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_DEV) - -void -ACE_DEV::dump (void) const -{ - ACE_TRACE ("ACE_DEV::dump"); -} - -// This is the do-nothing constructor. - -ACE_DEV::ACE_DEV (void) -{ - ACE_TRACE ("ACE_DEV::ACE_DEV"); -} - -// Close the device - -int -ACE_DEV::close (void) -{ - ACE_TRACE ("ACE_DEV::close"); - int result = ACE_OS::close (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - return result; -} diff --git a/ace/DEV.h b/ace/DEV.h deleted file mode 100644 index 7dea7fed39f..00000000000 --- a/ace/DEV.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// DEV.h -// -// = AUTHOR -// Gerhard Lenzer -// -// ============================================================================ - -#ifndef ACE_DEV_H -#define ACE_DEV_H -#include "ace/pre.h" - -#include "ace/IO_SAP.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/DEV_Addr.h" - -// The following is necessary since many C++ compilers don't support -// typedef'd types inside of classes used as formal template -// arguments... ;-(. Luckily, using the C++ preprocessor I can hide -// most of this nastiness! - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) -#define ACE_DEV_CONNECTOR ACE_DEV_Connector -#define ACE_DEV_STREAM ACE_DEV_Stream -#else /* TEMPLATES are broken (must be a cfront-based compiler...) */ -#define ACE_DEV_CONNECTOR ACE_DEV_Connector, ACE_DEV_Addr -#define ACE_DEV_STREAM ACE_DEV_Stream, ACE_DEV_Addr -#endif /* ACE_TEMPLATE_TYPEDEFS */ - -class ACE_Export ACE_DEV : public ACE_IO_SAP -{ - // = TITLE - // Defines the member functions for the base class of the - // ACE_DEV abstraction. -public: - int close (void); - // Close down the DEVICE - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - int disable (int signum) const ; - // Disable signal - // This is here to prevent Win32 from - // disabling SPIPE using socket calls - -protected: - ACE_DEV (void); - // Ensure that this class is an abstract base class -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/DEV.i" -#endif - -#include "ace/post.h" -#endif /* ACE_DEV_H */ diff --git a/ace/DEV.i b/ace/DEV.i deleted file mode 100644 index 529824f129c..00000000000 --- a/ace/DEV.i +++ /dev/null @@ -1,15 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// DEV.i - -ASYS_INLINE int -ACE_DEV::disable (int signum) const -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (signum) ; - return 0 ; -#else /* ACE_WIN32 */ - return ACE_IO_SAP::disable (signum) ; -#endif /* ACE_WIN32 */ -} diff --git a/ace/DEV_Addr.cpp b/ace/DEV_Addr.cpp deleted file mode 100644 index f7a11c2f07c..00000000000 --- a/ace/DEV_Addr.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// DEV_Addr.cpp -// $Id$ - -#include "ace/DEV_Addr.h" - -#if !defined (__ACE_INLINE__) -#include "ace/DEV_Addr.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, DEV_Addr, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_DEV_Addr) - -void -ACE_DEV_Addr::dump (void) const -{ - ACE_TRACE ("ACE_DEV_Addr::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("devname_ = %s"), this->devname_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// Do nothing constructor. - -ACE_DEV_Addr::ACE_DEV_Addr (void) - : ACE_Addr (AF_DEV, sizeof this->devname_) -{ - ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr"); - - (void) ACE_OS::memset ((void *) &this->devname_, - 0, sizeof this->devname_); -} - -int -ACE_DEV_Addr::set (const ACE_DEV_Addr &sa) -{ - this->base_set (sa.get_type (), sa.get_size ()); - - if (sa.get_type () == AF_ANY) - (void) ACE_OS::memset ((void *) &this->devname_, - 0, - sizeof this->devname_); - else - (void) ACE_OS::memcpy ((void *) &this->devname_, - (void *) &sa.devname_, - sa.get_size ()); - return 0; -} - -// Copy constructor. - -ACE_DEV_Addr::ACE_DEV_Addr (const ACE_DEV_Addr &sa) - : ACE_Addr (AF_DEV, sizeof this->devname_) -{ - ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr"); - - this->set (sa); -} - -ACE_DEV_Addr::ACE_DEV_Addr (const ACE_TCHAR *devname) - : ACE_Addr (AF_DEV, sizeof this->devname_) -{ - ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr"); - - this->set (devname); -} - -ACE_DEV_Addr & -ACE_DEV_Addr::operator= (const ACE_DEV_Addr &sa) -{ - ACE_TRACE ("ACE_DEV_Addr::operator="); - - if (this != &sa) - (void) ACE_OS::memcpy ((void *) &this->devname_, - (void *) &sa.devname_, - sa.get_size ()); - return *this; -} - diff --git a/ace/DEV_Addr.h b/ace/DEV_Addr.h deleted file mode 100644 index 376587a0699..00000000000 --- a/ace/DEV_Addr.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// DEV_Addr.h -// -// = AUTHOR -// Gerhard Lenzer and Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_DEV_ADDR_H -#define ACE_DEV_ADDR_H -#include "ace/pre.h" - -#include "ace/Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/ACE.h" - -class ACE_Export ACE_DEV_Addr : public ACE_Addr -{ - // = TITLE - // Defines device address family address format. -public: - // = Initialization methods. - ACE_DEV_Addr (void); - // Default constructor. - - ACE_DEV_Addr (const ACE_DEV_Addr &sa); - // Copy constructor. - - int set (const ACE_DEV_Addr &sa); - // Acts like a copy constructor. - - ACE_DEV_Addr (const ACE_TCHAR *devname); - // Create a ACE_DEV_Addr from a device name. - - void set (const ACE_TCHAR *devname); - // Create a ACE_Addr from a ACE_DEV pathname. - - ACE_DEV_Addr &operator= (const ACE_DEV_Addr &); - // Assignment operator. - - virtual void *get_addr (void) const; - // Return a pointer to the address. - - virtual int addr_to_string (ACE_TCHAR *addr, size_t) const; - // Transform the current address into string format. - - int operator == (const ACE_DEV_Addr &SAP) const; - // Compare two addresses for equality. - - int operator != (const ACE_DEV_Addr &SAP) const; - // Compare two addresses for inequality. - - const ACE_TCHAR *get_path_name (void) const; - // Return the path name used for the rendezvous point. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_TCHAR devname_[MAXNAMLEN + 1]; - // Name of the device. -}; - -#if defined (__ACE_INLINE__) -#include "ace/DEV_Addr.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_DEV_ADDR_H */ diff --git a/ace/DEV_Addr.i b/ace/DEV_Addr.i deleted file mode 100644 index 7ada0c3dd18..00000000000 --- a/ace/DEV_Addr.i +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/SString.h" - -ACE_INLINE void -ACE_DEV_Addr::set (const ACE_TCHAR *devname) -{ - ACE_TRACE ("ACE_DEV_Addr::set"); - - this->ACE_Addr::base_set (AF_DEV, ACE_OS::strlen (devname)); - ACE_OS::strncpy (this->devname_, devname, MAXNAMLEN); -} - -// Transform the current address into string format. - -ACE_INLINE int -ACE_DEV_Addr::addr_to_string (ACE_TCHAR *s, size_t len) const -{ - ACE_TRACE ("ACE_DEV_Addr::addr_to_string"); - - ACE_OS::strncpy (s, this->devname_, len); - return 0; -} - -// Return a pointer to the address. - -ACE_INLINE void * -ACE_DEV_Addr::get_addr (void) const -{ - ACE_TRACE ("ACE_DEV_Addr::get_addr"); - - return (void *) &this->devname_; -} - -// Compare two addresses for equality. - -ACE_INLINE int -ACE_DEV_Addr::operator == (const ACE_DEV_Addr &sap) const -{ - ACE_TRACE ("ACE_DEV_Addr::operator="); - - return ACE_OS::strcmp (this->devname_, sap.devname_) == 0; -} - -// Compare two addresses for inequality. - -ACE_INLINE int -ACE_DEV_Addr::operator != (const ACE_DEV_Addr &sap) const -{ - ACE_TRACE ("ACE_DEV_Addr::operator!="); - - return !((*this) == sap); // This is lazy, of course... ;-). -} - -// Return the path name used for the rendezvous point. - -ACE_INLINE const ACE_TCHAR * -ACE_DEV_Addr::get_path_name (void) const -{ - ACE_TRACE ("ACE_DEV_Addr::get_path_name"); - - return this->devname_; -} diff --git a/ace/DEV_Connector.cpp b/ace/DEV_Connector.cpp deleted file mode 100644 index 70f605762a9..00000000000 --- a/ace/DEV_Connector.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// DEV_Connector.cpp -// $Id$ - -#include "ace/DEV_Connector.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/DEV_Connector.i" -#endif - -ACE_RCSID(ace, DEV_Connector, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_DEV_Connector) - -void -ACE_DEV_Connector::dump (void) const -{ - ACE_TRACE ("ACE_DEV_Connector::dump"); -} - -ACE_DEV_Connector::ACE_DEV_Connector (void) -{ - ACE_TRACE ("ACE_DEV_Connector::ACE_DEV_Connector"); -} - -int -ACE_DEV_Connector::connect (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &, - int, - int flags, - int perms) -{ - ACE_TRACE ("ACE_DEV_Connector::connect"); - - ACE_HANDLE handle = ACE::handle_timed_open (timeout, - remote_sap.get_path_name (), - flags, perms); - new_io.set_handle (handle); - new_io.addr_ = remote_sap; // class copy. - return handle == ACE_INVALID_HANDLE ? -1 : 0; -} - diff --git a/ace/DEV_Connector.h b/ace/DEV_Connector.h deleted file mode 100644 index cde72dc39ac..00000000000 --- a/ace/DEV_Connector.h +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// DEV_Connector.h -// -// = AUTHOR -// Gerhard Lenzer and Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_DEV_CONNECTOR_H -#define ACE_DEV_CONNECTOR_H -#include "ace/pre.h" - -#include "ace/DEV_IO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_DEV_Connector -{ - // = TITLE - // Defines an active connection factory for the ACE_DEV wrappers. -public: - ACE_DEV_Connector (void); - // Default constructor. - - ACE_DEV_Connector (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - // The and arguments are passed down to the - // method. - - int connect (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - // The and arguments are passed down to the - // method. - - int reset_new_handle (ACE_HANDLE handle); - // Resets any event associations on this handle - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - // = Meta-type info - typedef ACE_DEV_Addr PEER_ADDR; - typedef ACE_DEV_IO PEER_STREAM; -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/DEV_Connector.i" -#endif - -#include "ace/post.h" -#endif /* ACE_DEV_CONNECTOR_H */ diff --git a/ace/DEV_Connector.i b/ace/DEV_Connector.i deleted file mode 100644 index 45ed1b0c82c..00000000000 --- a/ace/DEV_Connector.i +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// DEV_Connector.i - -// Creates a Local ACE_DEV. - -ASYS_INLINE -ACE_DEV_Connector::ACE_DEV_Connector (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_DEV_Connector::ACE_DEV_Connector"); - if (this->connect (new_io, remote_sap, timeout, local_sap, - reuse_addr, flags, perms) == ACE_IO_SAP::INVALID_HANDLE - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("address %s, %p\n"), - remote_sap.get_path_name (), ACE_TEXT ("ACE_DEV_IO"))); -} - -ASYS_INLINE int -ACE_DEV_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_UNUSED_ARG (handle); - // Nothing to do here since the handle is not a socket - return 0; -} - diff --git a/ace/DEV_IO.cpp b/ace/DEV_IO.cpp deleted file mode 100644 index 2903697d854..00000000000 --- a/ace/DEV_IO.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// DEV_IO.cpp -// $Id$ - -#include "ace/DEV_IO.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/DEV_IO.i" -#endif - -ACE_RCSID(ace, DEV_IO, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_DEV_IO) - -// Return the local endpoint address. - -int -ACE_DEV_IO::get_local_addr (ACE_DEV_Addr &addr) const -{ - ACE_TRACE ("ACE_DEV_IO::get_local_addr"); - - addr = this->addr_; - return 0; -} - -// Return the address of the remotely connected peer (if there is -// one). - -int -ACE_DEV_IO::get_remote_addr (ACE_DEV_Addr &addr) const -{ - ACE_TRACE ("ACE_DEV_IO::get_remote_addr"); - addr = this->addr_; - return 0; -} - -void -ACE_DEV_IO::dump (void) const -{ - ACE_TRACE ("ACE_DEV_IO::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->addr_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// Simple-minded do nothing constructor. - -ACE_DEV_IO::ACE_DEV_IO (void) -{ - ACE_TRACE ("ACE_DEV_IO::ACE_DEV_IO"); -} - -// Send N char *ptrs and int lengths. Note that the char *'s precede -// the ints (basically, an varargs version of writev). The count N is -// the *total* number of trailing arguments, *not* a couple of the -// number of tuple pairs! - -ssize_t -ACE_DEV_IO::send (size_t n, ...) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// This is basically an interface to ACE_OS::readv, that doesn't use the -// struct iovec explicitly. The ... can be passed as an arbitrary -// number of (char *ptr, int len) tuples. However, the count N is the -// *total* number of trailing arguments, *not* a couple of the number -// of tuple pairs! - -ssize_t -ACE_DEV_IO::recv (size_t n, ...) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - diff --git a/ace/DEV_IO.h b/ace/DEV_IO.h deleted file mode 100644 index 85410750b01..00000000000 --- a/ace/DEV_IO.h +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// DEV_IO.h -// -// = AUTHOR -// Gerhard Lenzer and Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_DEV_IO_H -#define ACE_DEV_IO_H -#include "ace/pre.h" - -#include "ace/DEV.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/DEV_Addr.h" - -class ACE_Export ACE_DEV_IO : public ACE_DEV -{ - // = TITLE - // Read/Write operations on Devices. -public: - friend class ACE_DEV_Connector; - - ACE_DEV_IO (void); - // Default constructor. - - // = Various send operations. - ssize_t send (const void *buf, size_t n) const; - // send upto bytes in . - - ssize_t recv (void *buf, size_t n) const; - // Recv upto bytes in . - - ssize_t send_n (const void *buf, size_t n) const; - // Send n bytes, keep trying until n are sent. - - ssize_t recv_n (void *buf, size_t n) const; - // Recv n bytes, keep trying until n are received. - -#if defined (ACE_HAS_STREAM_PIPES) - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *band, - int *flags) const; - // Recv bytes via STREAM pipes using "band" mode. - - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int band, - int flags) const; - // Send bytes via STREAM pipes using "band" mode. - - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *flags) const; - // Recv and via STREAM pipes. - - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int flags = 0) const; - // Send and via STREAM pipes. -#endif /* ACE_HAS_STREAM_PIPES */ - - ssize_t send (const iovec iov[], size_t n) const; - // Send iovecs via <::writev>. - - ssize_t recv (iovec iov[], size_t n) const; - // Recv iovecs via <::readv>. - - ssize_t send (size_t n, ...) const; - // Send N char *ptrs and int lengths. Note that the char *'s - // precede the ints (basically, an varargs version of writev). The - // count N is the *total* number of trailing arguments, *not* a - // couple of the number of tuple pairs! - - ssize_t recv (size_t n, ...) const; - // This is an interface to ::readv, that doesn't use the struct - // iovec explicitly. The ... can be passed as an arbitrary number - // of (char *ptr, int len) tuples. However, the count N is the - // *total* number of trailing arguments, *not* a couple of the - // number of tuple pairs! - - ssize_t send (const void *buf, size_t n, ACE_OVERLAPPED *overlapped) const; - // Send bytes via Win32 WriteFile using overlapped I/O. - - ssize_t recv (void *buf, size_t n, ACE_OVERLAPPED *overlapped) const; - // Recv bytes via Win32 ReadFile using overlapped I/O. - - void dump (void) const; - // Dump the state of an object. - - // = The following two methods are no-ops to keep the - // happy. - int get_local_addr (ACE_DEV_Addr &) const; - // Return the local endpoint address. - - int get_remote_addr (ACE_DEV_Addr &) const; - // Return the address of the remotely connected peer (if there is - // one). - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - // = Meta-type info - typedef ACE_DEV_Addr PEER_ADDR; - -private: - ACE_DEV_Addr addr_; - // Address of device we are connected to. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/DEV_IO.i" -#endif - -#include "ace/post.h" -#endif /* ACE_DEV_IO_H */ diff --git a/ace/DEV_IO.i b/ace/DEV_IO.i deleted file mode 100644 index 90c825ebf50..00000000000 --- a/ace/DEV_IO.i +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// DEV_IO.i - -// Send exactly N bytes from BUF to this device. Keeping trying until -// this many bytes are sent. - -ASYS_INLINE ssize_t -ACE_DEV_IO::send_n (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::send_n"); - return ACE::write_n (this->get_handle (), buf, n); -} - -// Receive exactly N bytes from this file into BUF. Keep trying until -// this many bytes are received. - -ASYS_INLINE ssize_t -ACE_DEV_IO::recv_n (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::recv_n"); - return ACE::read_n (this->get_handle (), buf, n); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::send (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::write (this->get_handle (), (const char *) buf, n); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::recv (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, n); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::send (const iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::writev (this->get_handle (), iov, n); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::recv (iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::readv (this->get_handle (), iov, n); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::send (const void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::write (this->get_handle (), - (const char *) buf, n, - overlapped); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::recv (void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, n, - overlapped); -} - -#if defined (ACE_HAS_STREAM_PIPES) -ASYS_INLINE ssize_t -ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const -{ - ACE_TRACE ("ACE_DEV_IO::recv"); - return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} - -ASYS_INLINE ssize_t -ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const -{ - ACE_TRACE ("ACE_DEV_IO::send"); - return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/ace/DLL.cpp b/ace/DLL.cpp deleted file mode 100644 index f186308611d..00000000000 --- a/ace/DLL.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// DLL.cpp -// $Id$ - -#include "ace/DLL.h" - -#include "ace/ACE.h" - -ACE_RCSID(ace, DLL, "$Id$") - -// Default constructor. Also, by default, the object will be closed -// before it is destroyed. - -ACE_DLL::ACE_DLL (int close_on_destruction) - : handle_ (ACE_SHLIB_INVALID_HANDLE), - close_on_destruction_ (close_on_destruction) -{ -} - -// If the library name and the opening mode are specified than on -// object creation the library is implicitly opened. - -ACE_DLL::ACE_DLL (const ACE_TCHAR *dll_name, - int open_mode, - int close_on_destruction) - : handle_ (ACE_OS::dlopen (dll_name, - open_mode)), - close_on_destruction_ (close_on_destruction) -{ - if (this->handle_ == ACE_SHLIB_INVALID_HANDLE) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%s\n"), - this->error ())); -} - -// The library is closed before the class gets destroyed depending on -// the close_on_destruction value specified which is stored in -// close_on_destruction_. - -ACE_DLL::~ACE_DLL (void) -{ - // CLose the library only if it hasn't been already. - this->close (); -} - -// This method opens the library based on the mode specified using the -// ACE_SHLIB_HANDLE which is obtained on making the ACE_OS::dlopen call. -// The default mode is: -// RTLD_LAZY Only references to data symbols are relocate when the -// object is first loaded. -// The other modes include: -// RTLD_NOW All necessary relocations are performed when the -// object is first loaded. -// RTLD_GLOBAL The object symbols are made available for the -// relocation processing of any other object. - -int -ACE_DLL::open (const ACE_TCHAR *dll_filename, - int open_mode, - int close_on_destruction) -{ - // This check is necessary as the library could be opened more than - // once without closing it which would cause handle memory leaks. - this->close (); - - // Reset the flag - this->close_on_destruction_ = close_on_destruction; - - // Find out where the library is - ACE_TCHAR dll_pathname[MAXPATHLEN + 1]; - - // Transform the pathname into the appropriate dynamic link library - // by searching the ACE_LD_SEARCH_PATH. - int result = ACE::ldfind (dll_filename, - dll_pathname, - (sizeof dll_pathname / sizeof (ACE_TCHAR))); - // Check for errors - if (result != 0) - return result; - - // The ACE_SHLIB_HANDLE object is obtained. - this->handle_ = ACE_OS::dlopen (dll_pathname, - open_mode); - - if (this->handle_ == ACE_SHLIB_INVALID_HANDLE) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%s\n"), this->error ()), - -1); - return 0; -} - -// The symbol refernce of the name specified is obtained. - -void * -ACE_DLL::symbol (const ACE_TCHAR *sym_name) -{ - return ACE_OS::dlsym (this->handle_, sym_name); -} - -// The library is closed using the ACE_SHLIB_HANDLE obejct. i.e. The -// shared object is now disassociated form the current process. - -int -ACE_DLL::close (void) -{ - int retval = 0; - - // The handle is checked to see whether the library is closed - // already and the flag is specified. If - // not, it is closed and the handle is made invalid to indicate that - // it's now closed. - if (this->close_on_destruction_ != 0 && - this->handle_ != ACE_SHLIB_INVALID_HANDLE) - { - retval = ACE_OS::dlclose (this->handle_); - } - - this->handle_ = ACE_SHLIB_INVALID_HANDLE; - return retval; -} - -// This method is used on error in an library operation. - -ACE_TCHAR * -ACE_DLL::error (void) -{ - return ACE_OS::dlerror (); -} - -// Return the handle to the user either temporarily or forever, thus -// orphaning it. If 0 means the user wants the handle forever and if 1 -// means the user temporarily wants to take the handle. - -ACE_SHLIB_HANDLE -ACE_DLL::get_handle (int become_owner) -{ - // Since the caller is becoming the owner of the handle we lose - // rights to close it on destruction. The new controller has to do - // it explicitly. - if (become_owner) - this->close_on_destruction_ = 0; - - // Return the handle requested by the user. - return this->handle_; -} - -// Set the handle for the DLL. By default, the object will be closed -// before it is destroyed. - -int -ACE_DLL::set_handle (ACE_SHLIB_HANDLE handle, - int close_on_destruction) -{ - // Close the handle in use before accepting the next one. - if (this->close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%s\n"), this->error ()), - -1); - - this->handle_ = handle; - this->close_on_destruction_ = close_on_destruction; - - return 0; -} diff --git a/ace/DLL.h b/ace/DLL.h deleted file mode 100644 index e1cbe76f70d..00000000000 --- a/ace/DLL.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// DLL.h -// -// = AUTHOR -// Kirthika Parameswaran -// -// ============================================================================ - -#ifndef ACE_DLL_H -#define ACE_DLL_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_DLL -{ - // = TITLE - // Provides an abstract interface for handling various DLL - // operations. - // - // = DESCRIPTION - // This class is an wrapper over the various methods for utilizing - // a dynamically linked library (DLL), which is called a shared - // library on some platforms. Operations , , and - // have been implemented to help opening/closing and - // extracting symbol information from a DLL, respectively. -public: - // = Initialization and termination methods. - - ACE_DLL (int close_on_destruction = 1); - // Default constructor. By default, the operation on the - // object will be invoked before it is destroyed. - - ACE_DLL (const ACE_TCHAR *dll_name, - int open_mode = ACE_DEFAULT_SHLIB_MODE, - int close_on_destruction = 1); - // This constructor opens and dynamically links . The - // default mode is , which loads identifier symbols but - // not the symbols for functions, which are loaded dynamically - // on-demand. Other supported modes include: , which - // performs all necessary relocations when is first - // loaded and , which makes symbols available for - // relocation processing of any other DLLs. - - int open (const ACE_TCHAR *dll_name, - int open_mode = ACE_DEFAULT_SHLIB_MODE, - int close_on_destruction = 1); - // This method opens and dynamically links . The default - // mode is , which loads identifier symbols but not the - // symbols for functions, which are loaded dynamically on-demand. - // Other supported modes include: , which performs all - // necessary relocations when is first loaded and - // , which makes symbols available for relocation - // processing of any other DLLs. Returns -1 on failure and 0 on - // success. - - int close (void); - // Call to close the DLL object. - - ~ACE_DLL (void); - // Called when the DLL object is destroyed -- invokes if the - // flag is set in the constructor or - // method. - - void *symbol (const ACE_TCHAR *symbol_name); - // If is in the symbol table of the DLL a pointer to - // the is returned. Otherwise, returns 0. - - ACE_TCHAR *error (void); - // Returns a pointer to a string explaining why or - // failed. - - ACE_SHLIB_HANDLE get_handle (int become_owner = 0); - // Return the handle to the caller. If is non-0 then - // caller assumes ownership of the handle and the object - // won't call when it goes out of scope, even if - // is set. - - int set_handle (ACE_SHLIB_HANDLE handle, int close_on_destruction = 1); - // Set the handle for the DLL object. By default, the operation on the - // object will be invoked before it is destroyed. -private: - ACE_SHLIB_HANDLE handle_; - // This is a handle to the DLL. - - int close_on_destruction_; - // This flag keeps track of whether we should close the handle - // automatically when the destructor runs. - - // = Disallow copying and assignment since we don't handle these. - ACE_UNIMPLEMENTED_FUNC (ACE_DLL (const ACE_DLL &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_DLL &)) -}; - -#include "ace/post.h" -#endif /* ACE_DLL_H */ diff --git a/ace/Date_Time.cpp b/ace/Date_Time.cpp deleted file mode 100644 index 7eaa91b3f15..00000000000 --- a/ace/Date_Time.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// Date_Time.cpp -// $Id$ - -#include "ace/Date_Time.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/Date_Time.i" -#endif - -ACE_RCSID(ace, Date_Time, "$Id$") diff --git a/ace/Date_Time.h b/ace/Date_Time.h deleted file mode 100644 index bd16b791da6..00000000000 --- a/ace/Date_Time.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// ACE_Date_Time.h -// -// = AUTHOR -// Tim Harrison (harrison@cs.wustl.edu) (and he's darn proud of this ;-)) -// -// ============================================================================ - -#ifndef ACE_DATE_TIME_H -#define ACE_DATE_TIME_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_Date_Time -{ - // = TITLE - // System independent representation of date and time. -public: - // constructor with init values, no check for validy - ACE_Date_Time (long day = 0, - long month = 0, - long year = 0, - long hour = 0, - long minute = 0, - long second = 0, - long microsec = 0); - // Set/get portions of ACE_Date_Time, no check for validity. - - long day (void); - // Get day. - - void day (long day); - // Set day. - - long month (void); - // Get month. - - void month (long month); - // Set month. - - long year (void); - // Get year. - - void year (long year); - // Set year. - - long hour (void); - // Get hour. - - void hour (long hour); - // Set hour. - - long minute (void); - // Get minute. - - void minute (long minute); - // Set minute. - - long second (void); - // Get second. - - void second (long second); - // Set second. - - long microsec (void); - // Get microsec. - - void microsec (long microsec); - // Set microsec. - -private: - long day_; - long month_; - long year_; - long hour_; - long minute_; - long second_; - long microsec_; -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/Date_Time.i" -#endif - -#include "ace/post.h" -#endif /* ACE_DATE_TIME_H */ diff --git a/ace/Date_Time.i b/ace/Date_Time.i deleted file mode 100644 index bfae34af0a3..00000000000 --- a/ace/Date_Time.i +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Date_Time.i - -// constructor with init values, no check for validy -ASYS_INLINE -ACE_Date_Time::ACE_Date_Time(long day, - long month, - long year, - long hour, - long minute, - long second, - long microsec) -: day_ (day), - month_ (month), - year_ (year), - hour_ (hour), - minute_ (minute), - second_ (second), - microsec_ (microsec) -{ - ACE_TRACE ("ACE_Date_Time::ACE_Date_Time"); -} - -// set/get portions of ACE_Date_Time, no check for validy - -// get day -ASYS_INLINE long -ACE_Date_Time::day (void) -{ - ACE_TRACE ("ACE_Date_Time::day"); - return day_; -} - -// set day -ASYS_INLINE void -ACE_Date_Time::day (long day) -{ - ACE_TRACE ("ACE_Date_Time::day"); - day_ = day; -} - -// get month -ASYS_INLINE long -ACE_Date_Time::month (void) -{ - ACE_TRACE ("ACE_Date_Time::month"); - return month_; -} - -// set month -ASYS_INLINE void -ACE_Date_Time::month (long month) -{ - ACE_TRACE ("ACE_Date_Time::month"); - month_ = month; -} - -// get year -ASYS_INLINE long -ACE_Date_Time::year (void) -{ - ACE_TRACE ("ACE_Date_Time::year"); - return year_; -} - -// set year -ASYS_INLINE void -ACE_Date_Time::year (long year) -{ - ACE_TRACE ("ACE_Date_Time::year"); - year_ = year; -} - -// get hour -ASYS_INLINE long -ACE_Date_Time::hour (void) -{ - ACE_TRACE ("ACE_Date_Time::hour"); - return hour_; -} - -// set hour -ASYS_INLINE void -ACE_Date_Time::hour (long hour) -{ - ACE_TRACE ("ACE_Date_Time::hour"); - hour_ = hour; -} - -// get minute -ASYS_INLINE long -ACE_Date_Time::minute (void) -{ - ACE_TRACE ("ACE_Date_Time::minute"); - return minute_; -} - -// set minute -ASYS_INLINE void -ACE_Date_Time::minute (long minute) -{ - ACE_TRACE ("ACE_Date_Time::minute"); - minute_ = minute; -} - -// get second -ASYS_INLINE long -ACE_Date_Time::second (void) -{ - ACE_TRACE ("ACE_Date_Time::second"); - return second_; -} - -// set second -ASYS_INLINE void -ACE_Date_Time::second (long second) -{ - ACE_TRACE ("ACE_Date_Time::second"); - second_ = second; -} - -// get microsec -ASYS_INLINE long -ACE_Date_Time::microsec (void) -{ - ACE_TRACE ("ACE_Date_Time::microsec"); - return microsec_; -} - -// set microsec -ASYS_INLINE void -ACE_Date_Time::microsec (long microsec) -{ - ACE_TRACE ("ACE_Date_Time::microsec"); - microsec_ = microsec; -} - - diff --git a/ace/Dirent.cpp b/ace/Dirent.cpp deleted file mode 100644 index d8a283a7368..00000000000 --- a/ace/Dirent.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// $Id$ - -#include "ace/Dirent.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Dirent.i" -#else -#if defined (__hpux) && !defined (__GNUG__) -static int shut_up_aCC = 0; -#endif /* HPUX && !g++ */ -#endif /* __ACE_INLINE__ */ diff --git a/ace/Dirent.h b/ace/Dirent.h deleted file mode 100644 index 651d475c88e..00000000000 --- a/ace/Dirent.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Dirent.h -// -// = DESCRIPTION -// Define a portable directory-entry manipulation interface. -// -// = AUTHOR -// Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_DIRENT_H -#define ACE_DIRENT_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_Dirent -{ - // = TITLE - // Define a portable UNIX directory-entry iterator. -public: - // = Initialization and termination methods. - ACE_Dirent (void); - // Default constructor. - - ACE_Dirent (const ACE_TCHAR *dirname); - // Constructor calls - - int open (const ACE_TCHAR *filename); - // Opens the directory named by filename and associates a directory - // stream with it. - - ~ACE_Dirent (void); - // Destructor calls . - - void close (void); - // Closes the directory stream and frees the DIR structure. - - // = Iterator methods. - dirent *read (void); - // Returns a pointer to a structure representing the directory entry - // at the current position in the directory stream to which dirp - // refers, and positions the directory stream at the next entry, - // except on read-only filesystems. It returns a NULL pointer upon - // reaching the end of the directory stream, or upon detecting an - // invalid location in the directory. shall not return - // directory entries containing empty names. It is unspecified - // whether entries are returned for dot or dot-dot. The pointer - // returned by points to data that may be overwritten by - // another call to on the same directory stream. This - // data shall not be overwritten by another call to on a - // different directory stream. may buffer several - // directory entries per actual read operation; marks for - // update the st_atime field of the directory each time the - // directory is actually read. - - int read (struct dirent *entry, - struct dirent **result); - // Has the equivalent functionality as except that an - // and buffer must be supplied by the caller to - // store the result. - - // = Manipulators. - long tell (void); - // Returns the current location associated with the directory - // stream. - - void seek (long loc); - // Sets the position of the next operation on the - // directory stream. The new position reverts to the position - // associated with the directory stream at the time the - // operation that provides loc was performed. Values returned by - // are good only for the lifetime of the DIR pointer from - // which they are derived. If the directory is closed and then - // reopened, the value may be invalidated due to - // undetected directory compaction. It is safe to use a previous - // value immediately after a call to and before - // any calls to readdir. - - void rewind (void); - // Resets the position of the directory stream to the beginning of - // the directory. It also causes the directory stream to refer to - // the current state of the corresponding directory, as a call to - // would. - -private: - DIR *dirp_; - // Pointer to the directory stream. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Dirent.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_DIRENT_H */ diff --git a/ace/Dirent.i b/ace/Dirent.i deleted file mode 100644 index a42fcbd3c45..00000000000 --- a/ace/Dirent.i +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE int -ACE_Dirent::open (const ACE_TCHAR *dirname) -{ - // If the directory stream is already open, close it to prevent - // possible resource leaks. - - if (this->dirp_ != 0) - { - ACE_OS::closedir (this->dirp_); - this->dirp_ = 0; - } - - this->dirp_ = ACE_OS::opendir (dirname); - - if (this->dirp_ == 0) - return -1; - else - return 0; -} - -ACE_INLINE -ACE_Dirent::ACE_Dirent (void) - : dirp_ (0) -{ -} - -ACE_INLINE -ACE_Dirent::ACE_Dirent (const ACE_TCHAR *dirname) - : dirp_ (0) -{ - if (this->open (dirname) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("Dirent::Dirent"))); -} - -ACE_INLINE -ACE_Dirent::~ACE_Dirent (void) -{ - if (this->dirp_ != 0) - ACE_OS::closedir (this->dirp_); -} - -ACE_INLINE dirent * -ACE_Dirent::read (void) -{ - return this->dirp_ ? ACE_OS::readdir (this->dirp_) : 0; -} - -ACE_INLINE int -ACE_Dirent::read (struct dirent *entry, - struct dirent **result) -{ - return this->dirp_ - ? ACE_OS::readdir_r (this->dirp_, entry, result) - : 0; -} - -ACE_INLINE void -ACE_Dirent::close (void) -{ - if (this->dirp_ != 0) - { - ACE_OS::closedir (this->dirp_); - - // Prevent double closure - this->dirp_ = 0; - } -} - -ACE_INLINE void -ACE_Dirent::rewind (void) -{ - if (this->dirp_) - ACE_OS::rewinddir (this->dirp_); -} - -ACE_INLINE void -ACE_Dirent::seek (long loc) -{ - if (this->dirp_) - ACE_OS::seekdir (this->dirp_, loc); -} - -ACE_INLINE long -ACE_Dirent::tell (void) -{ - return this->dirp_ ? ACE_OS::telldir (this->dirp_) : 0; -} - diff --git a/ace/Dump.cpp b/ace/Dump.cpp deleted file mode 100644 index 6cbca54518c..00000000000 --- a/ace/Dump.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// $Id$ - -#include "ace/Synch_T.h" -#include "ace/Dump.h" -#include "ace/Object_Manager.h" - -ACE_RCSID(ace, Dump, "$Id$") - -// Implementations (very simple for now...) - -ACE_Dumpable::~ACE_Dumpable (void) -{ - ACE_TRACE ("ACE_Dumpable::~ACE_Dumpable"); -} - -ACE_Dumpable::ACE_Dumpable (const void *this_ptr) - : this_ (this_ptr) -{ - ACE_TRACE ("ACE_Dumpable::ACE_Dumpable"); -} - -ACE_Dumpable_Ptr::ACE_Dumpable_Ptr (const ACE_Dumpable *dumper) - : dumper_ (dumper) -{ - ACE_TRACE ("ACE_Dumpable_Ptr::ACE_Dumpable_Ptr"); -} - -const ACE_Dumpable * -ACE_Dumpable_Ptr::operator->() const -{ - ACE_TRACE ("ACE_Dumpable_Ptr::operator->"); - return this->dumper_; -} - -void -ACE_Dumpable_Ptr::operator= (const ACE_Dumpable *dumper) const -{ - ACE_TRACE ("ACE_Dumpable_Ptr::operator="); - if (this->dumper_ != dumper) - { - delete (ACE_Dumpable *) this->dumper_; - ((ACE_Dumpable_Ptr *) this)->dumper_ = dumper; - } -} - -ACE_ODB::ACE_ODB (void) - // Let the Tuple default constructor initialize object_table_ - : current_size_ (0) -{ - ACE_TRACE ("ACE_ODB::ACE_ODB"); -} - -ACE_ODB * -ACE_ODB::instance (void) -{ - ACE_TRACE ("ACE_ODB::instance"); - - if (ACE_ODB::instance_ == 0) - { - ACE_MT (ACE_Thread_Mutex *lock = - ACE_Managed_Object::get_preallocated_object - (ACE_Object_Manager::ACE_DUMP_LOCK); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, *lock, 0)); - - if (ACE_ODB::instance_ == 0) - ACE_NEW_RETURN (ACE_ODB::instance_, - ACE_ODB, - 0); - } - - return ACE_ODB::instance_; -} - -void -ACE_ODB::dump_objects (void) -{ - ACE_TRACE ("ACE_ODB::dump_objects"); - for (int i = 0; i < this->current_size_; i++) - { - if (this->object_table_[i].this_ != 0) - // Dump the state of the object. - this->object_table_[i].dumper_->dump (); - } -} - -// This method registers a new . It detects -// duplicates and simply overwrites them. - -void -ACE_ODB::register_object (const ACE_Dumpable *dumper) -{ - ACE_TRACE ("ACE_ODB::register_object"); - int i; - int slot = 0; - - for (i = 0; i < this->current_size_; i++) - { - if (this->object_table_[i].this_ == 0) - slot = i; - else if (this->object_table_[i].this_ == dumper->this_) - { - slot = i; - break; - } - } - - if (i == this->current_size_) - { - slot = this->current_size_++; - ACE_ASSERT (this->current_size_ < ACE_ODB::MAX_TABLE_SIZE); - } - this->object_table_[slot].this_ = dumper->this_; - this->object_table_[slot].dumper_ = dumper; -} - -void -ACE_ODB::remove_object (const void *this_ptr) -{ - ACE_TRACE ("ACE_ODB::remove_object"); - int i; - - for (i = 0; i < this->current_size_; i++) - { - if (this->object_table_[i].this_ == this_ptr) - break; - } - - if (i < this->current_size_) - { - this->object_table_[i].this_ = 0; - this->object_table_[i].dumper_ = 0; - } -} - -ACE_ODB *ACE_ODB::instance_ = 0; diff --git a/ace/Dump.h b/ace/Dump.h deleted file mode 100644 index 5c1ea0f357d..00000000000 --- a/ace/Dump.h +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Dump.h -// -// = DESCRIPTION -// -// A prototype mechanism that allow all ACE objects to be registered -// with a central in-memory "database" that can dump the state of all -// live ACE objects (e.g., from within a debugger). -// -// To turn on this feature simply compile with -DACE_NDEBUG -// -// There are several interesting aspects to this design: -// -// 1. It uses the External Polymorphism pattern to avoid having to -// derive all ACE classes from a common base class that has virtual -// methods (this is crucial to avoid unnecessary overhead). In -// addition, there is no additional space added to ACE objects -// (this is crucial to maintain binary layout compatibility). -// -// 2. This mechanism can be conditionally compiled in order to -// completely disable this feature entirely. Moreover, by -// using macros there are relatively few changes to ACE code. -// -// 3. This mechanism copes with single-inheritance hierarchies of -// dumpable classes. In such cases we typically want only one -// dump, corresponding to the most derived instance. Thanks to -// Christian Millour (chris@etca.fr) for illustrating how to do -// this. Note, however, that this scheme doesn't generalize to -// work with multiple-inheritance or virtual base classes. -// -// Future work includes: -// -// 1. Using a dynamic object table rather than a static table -// -// 2. Adding support to allow particular classes of objects to -// be selectively dumped. -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_DUMP_H -#define ACE_DUMP_H -#include "ace/pre.h" - -#include "ace/Synch.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_Dumpable -{ - // = TITLE - // Base class that defines a uniform interface for all object - // dumping. -public: - friend class ACE_ODB; - friend class ACE_Dumpable_Ptr; - - ACE_Dumpable (const void *); - // Constructor. - - virtual void dump (void) const = 0; - // This pure virtual method must be filled in by a subclass. - -protected: - virtual ~ACE_Dumpable (void); - -private: - const void *this_; - // Pointer to the object that is being stored. -}; - -class ACE_Export ACE_Dumpable_Ptr -{ - // = TITLE - // A smart pointer stored in the in-memory object database - // ACE_ODB. The pointee (if any) is deleted when reassigned. -public: - ACE_Dumpable_Ptr (const ACE_Dumpable *dumper = 0); - const ACE_Dumpable *operator->() const; - void operator= (const ACE_Dumpable *dumper) const; - -private: - const ACE_Dumpable *dumper_; - // "Real" pointer to the underlying abstract base class - // pointer that does the real work. -}; - -class ACE_Export ACE_ODB -{ - // = TITLE - // This is the object database (ODB) that keeps track of all - // live ACE objects. -public: - enum {MAX_TABLE_SIZE = 100000}; // This is clearly inadequate and should be dynamic... - - void dump_objects (void); - // Iterates through the entire set of registered objects and - // dumps their state. - - void register_object (const ACE_Dumpable *dumper); - // Add the tuple to the list of registered ACE objects. - - void remove_object (const void *this_); - // Use to locate and remove the associated from the - // list of registered ACE objects. - - static ACE_ODB *instance (void); - // Interface to the Singleton instance of the object database. - -private: - ACE_ODB (void); // Ensure we have a Singleton... - - struct Tuple - { - const void *this_; - // Pointer to the object that is registered. - - const ACE_Dumpable_Ptr dumper_; - // Smart pointer to the ACE_Dumpable object associated with this_. - // This uses an ACE_Dumpable_Ptr, instead of a bare pointer, to - // cope with hierarchies of dumpable classes. In such cases we - // typically want only one dump, corresponding to the most derived - // instance. To achieve this, the handle registered for the - // subobject corresponding to the base class is destroyed (hence - // on destruction of the subobject its handle won't exist anymore - // and we'll have to check for that). - - Tuple (void) : dumper_(0) {} - }; - - static ACE_ODB *instance_; - // Singleton instance of this class. - - Tuple object_table_[ACE_ODB::MAX_TABLE_SIZE]; - // The current implementation is very simple-minded and will be - // changed to be dynamic. - - int current_size_; - // Current size of . -}; - -// Include the templates classes at this point. -#include "ace/Dump_T.h" - -#include "ace/post.h" -#endif /* ACE_DUMP_H */ diff --git a/ace/Dump_T.cpp b/ace/Dump_T.cpp deleted file mode 100644 index 97386d4ba31..00000000000 --- a/ace/Dump_T.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// Dump_T.cpp -// $Id$ - -#ifndef ACE_DUMP_T_C -#define ACE_DUMP_T_C - -#include "ace/Dump_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(ace, Dump_T, "$Id$") - -template -ACE_Dumpable_Adapter::~ACE_Dumpable_Adapter (void) -{ - ACE_TRACE ("ACE_Dumpable_Adapter::~ACE_Dumpable_Adapter"); -} - -template -ACE_Dumpable_Adapter::ACE_Dumpable_Adapter (const Concrete *t) - : ACE_Dumpable ((const void *) t), this_ (t) -{ - ACE_TRACE ("ACE_Dumpable_Adapter::ACE_Dumpable_Adapter"); -} - -template Concrete * -ACE_Dumpable_Adapter::operator->() const -{ - return (Concrete *) this->this_; -} - -template void -ACE_Dumpable_Adapter::dump (void) const -{ - ACE_TRACE ("ACE_Dumpable_Adapter::dump"); - this->this_->dump (); -} - -#endif /* ACE_DUMP_T_C */ diff --git a/ace/Dump_T.h b/ace/Dump_T.h deleted file mode 100644 index 88b2765f721..00000000000 --- a/ace/Dump_T.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Dump.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_DUMP_T_H -#define ACE_DUMP_T_H -#include "ace/pre.h" - -#include "ace/Dump.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -template -class ACE_Dumpable_Adapter : public ACE_Dumpable -{ - // = TITLE - // This class inherits the interface of the abstract ACE_Dumpable - // class and is instantiated with the implementation of the - // concrete component class . - // - // = DESCRIPTION - // This design is similar to the Adapter and Decorator patterns - // from the ``Gang of Four'' book. Note that - // need not inherit from a common class since ACE_Dumpable - // provides the uniform virtual interface! -public: - // = Initialization and termination methods. - ACE_Dumpable_Adapter (const Concrete *t); - ~ACE_Dumpable_Adapter (void); - - virtual void dump (void) const; - // Concrete dump method (simply delegates to the method of - // ). - - Concrete *operator->() const; - // Delegate to methods in the Concrete class. - -private: - const Concrete *this_; - // Pointer to of . -}; - -// Some useful macros for conditionally compiling this feature... -#if defined (ACE_NDEBUG) -#define ACE_REGISTER_OBJECT(CLASS) -#define ACE_REMOVE_OBJECT -#else -#define ACE_REGISTER_OBJECT(CLASS) \ - ACE_ODB::instance ()->register_object \ - (new ACE_Dumpable_Adapter (this)); -#define ACE_REMOVE_OBJECT \ - ACE_ODB::instance ()->remove_object \ - ((void *) this); -#endif /* ACE_NDEBUG */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Dump_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Dump_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_DUMP_T_H */ diff --git a/ace/Dynamic.cpp b/ace/Dynamic.cpp deleted file mode 100644 index 8edf58ef62e..00000000000 --- a/ace/Dynamic.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// Dynamic.cpp -// $Id$ - -#include "ace/Dynamic.h" -#include "ace/Singleton.h" -#include "ace/Synch_T.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Dynamic.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Dynamic, "$Id$") - -ACE_Dynamic::ACE_Dynamic (void) - : is_dynamic_ (0) -{ - ACE_TRACE ("ACE_Dynamic::ACE_Dynamic"); -} - -/* static */ ACE_Dynamic * -ACE_Dynamic::instance (void) -{ - return ACE_TSS_Singleton::instance (); -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - template class ACE_TSS_Singleton; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - #pragma instantiate ACE_TSS_Singleton -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/Dynamic.h b/ace/Dynamic.h deleted file mode 100644 index 3d16a9a8ca7..00000000000 --- a/ace/Dynamic.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Dynamic.h -// -// = AUTHOR -// Doug Schmidt and Irfan Pyrarli. -// -// ============================================================================ - -#ifndef ACE_DYNAMIC_H -#define ACE_DYNAMIC_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Synch_T.h" -#include "ace/Singleton.h" - -class ACE_Export ACE_Dynamic -{ - // = TITLE - // Checks to see if an object was dynamically allocated. - // - // = DESCRIPTION - // This class holds the pointer in a thread-safe manner between - // the call to operator new and the call to the constructor. -public: - // = Initialization and termination method. - ACE_Dynamic (void); - // Constructor. - - ~ACE_Dynamic (void); - // Destructor. - - void set (void); - // Sets a flag that indicates that the object was dynamically - // created. This method is usually called in operator new and then - // checked and reset in the constructor. - - int is_dynamic (void); - // 1 if we were allocated dynamically, else 0. - - void reset (void); - // Resets state flag. - - static ACE_Dynamic *instance (void); - -private: - int is_dynamic_; - // Flag that indicates that the object was dynamically created. This - // method is usually called in operator new and then checked and - // reset in the constructor. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Dynamic.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_DYNAMIC_H */ diff --git a/ace/Dynamic.i b/ace/Dynamic.i deleted file mode 100644 index 6a32b94d4e6..00000000000 --- a/ace/Dynamic.i +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Dynamic.i - -ACE_INLINE -ACE_Dynamic::~ACE_Dynamic (void) -{ - ACE_TRACE ("ACE_Dynamic::~ACE_Dynamic"); -} - -ACE_INLINE void -ACE_Dynamic::set (void) -{ - ACE_TRACE ("ACE_Dynamic::set"); - this->is_dynamic_ = 1; -} - -ACE_INLINE int -ACE_Dynamic::is_dynamic () -{ - ACE_TRACE ("ACE_Dynamic::is_dynamic"); - return this->is_dynamic_; -} - -ACE_INLINE void -ACE_Dynamic::reset (void) -{ - ACE_TRACE ("ACE_Dynamic::set"); - this->is_dynamic_ = 0; -} - diff --git a/ace/Dynamic_Service.cpp b/ace/Dynamic_Service.cpp deleted file mode 100644 index 1b8c831103b..00000000000 --- a/ace/Dynamic_Service.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// Dynamic_Service.cpp -// $Id$ - -#ifndef ACE_DYNAMIC_SERVICE_C -#define ACE_DYNAMIC_SERVICE_C - -#include "ace/Service_Config.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Repository.h" -#include "ace/Dynamic_Service.h" - -ACE_RCSID(ace, Dynamic_Service, "$Id$") - -template void -ACE_Dynamic_Service::dump (void) const -{ - ACE_TRACE ("ACE_Dynamic_Service::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// Get the instance using . - -template SERVICE * -ACE_Dynamic_Service::instance (const ACE_TCHAR *name) -{ - ACE_TRACE ("ACE_Dynamic_Service::instance"); - const ACE_Service_Type *svc_rec; - - if (ACE_Service_Repository::instance ()->find (name, - &svc_rec) == -1) - return 0; - - const ACE_Service_Type_Impl *type = svc_rec->type (); - - if (type == 0) - return 0; - else - { - void *obj = type->object (); - return ACE_reinterpret_cast (SERVICE *, obj); - } -} - -#endif /* ACE_DYNAMIC_SERVICE_C */ diff --git a/ace/Dynamic_Service.h b/ace/Dynamic_Service.h deleted file mode 100644 index b06f73b2ec3..00000000000 --- a/ace/Dynamic_Service.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Dynamic_Service.h -// -// = AUTHOR -// Prashant Jain, Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_DYNAMIC_SERVICE_H -#define ACE_DYNAMIC_SERVICE_H -#include "ace/pre.h" - -#include "ace/OS.h" - -template -class ACE_Dynamic_Service -{ - // = TITLE - // Provides a general interface to retrieve arbitrary objects - // from the ACE service repository. - // - // = DESCRIPTION - // Uses "name" for lookup in the ACE service repository. Obtains - // the object and returns it as the appropriate type. -public: - static SERVICE *instance (const ACE_TCHAR *name); - // Return instance using to search the Service_Repository. - - void dump (void) const; - // Dump the current state of the object. -}; - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -# include "ace/Dynamic_Service.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -# pragma implementation ("Dynamic_Service.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_DYNAMIC_SERVICE_H */ diff --git a/ace/Dynamic_Service.i b/ace/Dynamic_Service.i deleted file mode 100644 index a29b996d459..00000000000 --- a/ace/Dynamic_Service.i +++ /dev/null @@ -1,4 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Dynamic_Service.i diff --git a/ace/Env_Value_T.cpp b/ace/Env_Value_T.cpp deleted file mode 100644 index d99819ec6b9..00000000000 --- a/ace/Env_Value_T.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ - -#if !defined (ACE_ENV_VALUE_T_C) -#define ACE_ENV_VALUE_T_C - -#include "ace/Env_Value_T.h" - -#if ! defined (__ACE_INLINE__) -#include "ace/Env_Value_T.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Env_Value_T, "$Id$") - -#endif /* ACE_ENV_VALUE_T_C */ diff --git a/ace/Env_Value_T.h b/ace/Env_Value_T.h deleted file mode 100644 index 0005d734c1f..00000000000 --- a/ace/Env_Value_T.h +++ /dev/null @@ -1,158 +0,0 @@ -/* This may look like C, but it's really -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = DESCRIPTION -// Template to encapsulate getting a value from an environment variable -// and using a supplied default value if not in the environment. -// -// = AUTHOR -// Chris Cleeland (derived from work by Carlos O'Ryan) -// -// ============================================================================ - -#ifndef ACE_ENV_VALUE_T_H -#define ACE_ENV_VALUE_T_H -#include "ace/pre.h" - -#include "ace/OS.h" // Need to get ACE_static_cast definition - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -template -class ACE_Env_Value -{ - // = TITLE - // Enviroment Variable Value - // - // = DESCRIPTION - // Reads a variable from the user enviroment, providing a default - // value. - // - // = AUTHOR - // Chris Cleeland, Carlos O'Ryan -public: - ACE_Env_Value (void); - // Default constructor which isn't bound to a specific environment - // variable name or a default value. Before being useful it must - // 'd. - - ACE_Env_Value (const ACE_TCHAR *varname, - const T &vardefault); - // Constructor that calls . - - ~ACE_Env_Value (void); - // Destroy the value. - - operator T (void); - // Returns the value as type T. - - void open (const ACE_TCHAR *varname, const T &defval); - // The constructor, read from the enviroment, using - // as its value if it is not defined. - - const ACE_TCHAR *varname (void) const; - // Returns the name of the variable being tracked. - -private: - ACE_UNIMPLEMENTED_FUNC (ACE_Env_Value(const ACE_Env_Value &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Env_Value operator=(const ACE_Env_Value &)) - // Disallow copying and assignment. - - void fetch_value (void); - - const ACE_TCHAR *varname_; - T value_; -}; - -template void ACE_Convert (const ACE_TCHAR *s, T &t); -// Function to convert a string into type . - -#if defined (__ACE_INLINE__) -#include "ace/Env_Value_T.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Env_Value_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - - -// Default calls a CTOR on type T of the form 'T::T(const char*)', but -// users can feel free to create their own specialized conversion -// functions if necessary, as shown below. Note that for 'char*' the -// default is used because a simple cast will be performed and no -// conversion will be necessary. - -template inline void -ACE_Convert (const ACE_TCHAR *s, T &t) -{ - t = T (s); -} - -inline void -ACE_Convert (const ACE_TCHAR *s, ACE_TCHAR *&v) -{ - v = (ACE_TCHAR *) s; -} - -inline void -ACE_Convert (const ACE_TCHAR *s, const ACE_TCHAR *&v) -{ - v = (const ACE_TCHAR *) s; -} - -inline void -ACE_Convert (const ACE_TCHAR *s, short &si) -{ - si = ACE_static_cast (short, ACE_OS::strtol (s, 0, 10)); -} - -inline void -ACE_Convert (const ACE_TCHAR *s, u_short &us) -{ - us = ACE_static_cast (u_short, ACE_OS::strtol (s, 0, 10)); -} - -inline void -ACE_Convert (const ACE_TCHAR *s, u_int &i) -{ - i = ACE_static_cast (u_int, - ACE_OS::strtol (s, 0, 10)); -} - -inline void -ACE_Convert (const ACE_TCHAR *s, long &l) -{ - l = ACE_OS::strtol (s, 0, 10); -} - -inline void -ACE_Convert (const ACE_TCHAR *s, int &i) -{ - i = ACE_static_cast (int, ACE_OS::strtol (s, 0, 10)); -} - -inline void -ACE_Convert (const ACE_TCHAR *s, u_long &ul) -{ - ul = ACE_OS::strtoul (s, 0, 10); -} - -inline void -ACE_Convert (const ACE_TCHAR *s, double &d) -{ - d = ACE_OS::strtod (s, 0); -} - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Env_Value_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_ENV_VALUE_T_H */ diff --git a/ace/Env_Value_T.i b/ace/Env_Value_T.i deleted file mode 100644 index 9f98f0fdb45..00000000000 --- a/ace/Env_Value_T.i +++ /dev/null @@ -1,51 +0,0 @@ -// $Id$ - -template ACE_INLINE -ACE_Env_Value::operator T (void) -{ - return value_; -} - -template ACE_INLINE -ACE_Env_Value::ACE_Env_Value (void) - : varname_ (0) -{ -} - -template ACE_INLINE -ACE_Env_Value::ACE_Env_Value (const ACE_TCHAR *varname, - const T &defval) - : varname_ (varname), - value_(defval) -{ - this->fetch_value (); -} - -template ACE_INLINE void -ACE_Env_Value::open (const ACE_TCHAR *varname, - const T &defval) -{ - varname_ = varname; - value_ = defval; - this->fetch_value (); -} - -template ACE_INLINE void -ACE_Env_Value::fetch_value (void) -{ - const ACE_TCHAR *env = ACE_OS::getenv (varname_); - - if (env != 0) - ACE_Convert (env, value_); -} - -template ACE_INLINE const ACE_TCHAR* -ACE_Env_Value::varname (void) const -{ - return varname_; -} - -template ACE_INLINE -ACE_Env_Value::~ACE_Env_Value (void) -{ -} diff --git a/ace/Event_Handler.cpp b/ace/Event_Handler.cpp deleted file mode 100644 index 6e9d728c002..00000000000 --- a/ace/Event_Handler.cpp +++ /dev/null @@ -1,237 +0,0 @@ -// Event_Handler.cpp -// $Id$ - -#include "ace/Event_Handler.h" -#include "ace/Message_Block.h" -#include "ace/Reactor.h" -#include "ace/Thread_Manager.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Event_Handler.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Event_Handler, "$Id$") - -// Implement conceptually abstract virtual functions in the base class -// so derived classes don't have to implement unused ones. - -ACE_Event_Handler::ACE_Event_Handler (ACE_Reactor *r, - int p) - : priority_ (p), - reactor_ (r) -{ - // ACE_TRACE ("ACE_Event_Handler::ACE_Event_Handler"); -} - -ACE_Event_Handler::~ACE_Event_Handler (void) -{ - // ACE_TRACE ("ACE_Event_Handler::~ACE_Event_Handler"); -} - -// Gets the file descriptor associated with this I/O device. - -ACE_HANDLE -ACE_Event_Handler::get_handle (void) const -{ - ACE_TRACE ("ACE_Event_Handler::get_handle"); - return ACE_INVALID_HANDLE; -} - -// Sets the file descriptor associated with this I/O device. - -void -ACE_Event_Handler::set_handle (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::set_handle"); -} - -// Gets the priority of this handler. - -int -ACE_Event_Handler::priority (void) const -{ - ACE_TRACE ("ACE_Event_Handler::priority"); - return this->priority_; -} - -// Sets the priority - -void -ACE_Event_Handler::priority (int priority) -{ - ACE_TRACE ("ACE_Event_Handler::priority"); - this->priority_ = priority; -} - -// Called when the object is about to be removed from the Dispatcher -// tables. - -int -ACE_Event_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask) -{ - ACE_TRACE ("ACE_Event_Handler::handle_close"); - return -1; -} - -// Called when input becomes available on fd. - -int -ACE_Event_Handler::handle_input (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_input"); - return -1; -} - -// Called when output is possible on fd. - -int -ACE_Event_Handler::handle_output (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_output"); - return -1; -} - -// Called when urgent data is available on fd. - -int -ACE_Event_Handler::handle_exception (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_exception"); - return -1; -} - -// Called when timer expires, TV stores the current time. - -int -ACE_Event_Handler::handle_timeout (const ACE_Time_Value &, const void *) -{ - ACE_TRACE ("ACE_Event_Handler::handle_timeout"); - return -1; -} - -// Called when a monitored Process exits - -int -ACE_Event_Handler::handle_exit (ACE_Process *) -{ - ACE_TRACE ("ACE_Event_Handler::handle_exit"); - return -1; -} - -// Called when a registered signal occurs. - -int -ACE_Event_Handler::handle_signal (int, siginfo_t *, ucontext_t *) -{ - ACE_TRACE ("ACE_Event_Handler::handle_signal"); - return -1; -} - -int -ACE_Event_Handler::handle_qos (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_qos"); - return -1; -} - -int -ACE_Event_Handler::handle_group_qos (ACE_HANDLE) -{ - ACE_TRACE ("ACE_Event_Handler::handle_group_qos"); - return -1; -} - -void -ACE_Event_Handler::reactor (ACE_Reactor *reactor) -{ - ACE_TRACE ("ACE_Event_Handler::reactor"); - this->reactor_ = reactor; -} - -ACE_Reactor * -ACE_Event_Handler::reactor (void) const -{ - ACE_TRACE ("ACE_Event_Handler::reactor"); - return this->reactor_; -} - -#if !defined (ACE_HAS_WINCE) - -// Used to read from non-socket ACE_HANDLEs in our own thread to work -// around Win32 limitations that don't allow us to select() on -// non-sockets (such as ACE_STDIN). This is commonly used in -// situations where the Reactor is used to demultiplex read events on -// ACE_STDIN on UNIX. Note that must be a subclass of -// . If the method of this event -// handler returns we default to reading from -// ACE_STDIN. - -void * -ACE_Event_Handler::read_adapter (void *args) -{ - ACE_Event_Handler *this_ptr = (ACE_Event_Handler *) args; - ACE_HANDLE handle = ACE_STDIN; - - while (this_ptr->handle_input (handle) != -1) - continue; - - this_ptr->handle_close (handle, - ACE_Event_Handler::READ_MASK); - this_ptr->reactor ()->notify (); - - return 0; -} - -int -ACE_Event_Handler::register_stdin_handler (ACE_Event_Handler *eh, - ACE_Reactor *reactor, - ACE_Thread_Manager *thr_mgr, - int flags) -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (reactor); - - eh->reactor (reactor); - return thr_mgr->spawn (&read_adapter, (void *) eh, flags); -#else - // Keep compilers happy. - ACE_UNUSED_ARG (flags); - ACE_UNUSED_ARG (thr_mgr); - return reactor->register_handler (ACE_STDIN, - eh, - ACE_Event_Handler::READ_MASK); -#endif /* ACE_WIN32 */ -} - -int -ACE_Event_Handler::remove_stdin_handler (ACE_Reactor *reactor, - ACE_Thread_Manager *thr_mgr) -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (reactor); - ACE_UNUSED_ARG (thr_mgr); - - // What should we do here? - ACE_NOTSUP_RETURN (-1); -#else - // Keep compilers happy. - ACE_UNUSED_ARG (thr_mgr); - return reactor->remove_handler (ACE_STDIN, - ACE_Event_Handler::READ_MASK); -#endif /* ACE_WIN32 */ -} - -#endif /* ACE_HAS_WINCE */ - -ACE_Notification_Buffer::ACE_Notification_Buffer (void) -{ - ACE_TRACE ("ACE_Notification_Buffer::ACE_Notification_Buffer"); -} - -ACE_Notification_Buffer::ACE_Notification_Buffer (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask) - : eh_ (eh), - mask_ (mask) -{ - ACE_TRACE ("ACE_Notification_Buffer::ACE_Notification_Buffer"); -} diff --git a/ace/Event_Handler.h b/ace/Event_Handler.h deleted file mode 100644 index 0f2f719960c..00000000000 --- a/ace/Event_Handler.h +++ /dev/null @@ -1,198 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Event_Handler.h -// -// = AUTHOR -// Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_EVENT_HANDLER_H -#define ACE_EVENT_HANDLER_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Forward declaration. -class ACE_Message_Block; -class ACE_Reactor; -class ACE_Thread_Manager; -class ACE_Process; - -typedef u_long ACE_Reactor_Mask; - -class ACE_Export ACE_Event_Handler -{ - // = TITLE - // Provides an abstract interface for handling various types of - // I/O, timer, and signal events. - // - // = DESCRIPTION - // Subclasses read/write input/output on an I/O descriptor, - // handle an exception raised on an I/O descriptor, handle a - // timer's expiration, or handle a signal. -public: - enum - { - LO_PRIORITY = 0, - HI_PRIORITY = 10, - NULL_MASK = 0, -#if defined (ACE_USE_POLL) - READ_MASK = POLLIN, - WRITE_MASK = POLLOUT, - EXCEPT_MASK = POLLPRI, -#else /* USE SELECT */ - READ_MASK = (1 << 0), - WRITE_MASK = (1 << 1), - EXCEPT_MASK = (1 << 2), -#endif /* ACE_USE_POLL */ - ACCEPT_MASK = (1 << 3), - CONNECT_MASK = (1 << 4), - TIMER_MASK = (1 << 5), - QOS_MASK = (1 << 6), - GROUP_QOS_MASK = (1 << 7), - SIGNAL_MASK = (1 << 8), - ALL_EVENTS_MASK = READ_MASK | - WRITE_MASK | - EXCEPT_MASK | - ACCEPT_MASK | - CONNECT_MASK | - TIMER_MASK | - QOS_MASK | - GROUP_QOS_MASK | - SIGNAL_MASK, - RWE_MASK = READ_MASK | - WRITE_MASK | - EXCEPT_MASK, - DONT_CALL = (1 << 9) - }; - - virtual ~ACE_Event_Handler (void); - // Destructor is virtual to enable proper cleanup. - - virtual ACE_HANDLE get_handle (void) const; - // Get the I/O handle. - virtual void set_handle (ACE_HANDLE); - // Set the I/O handle. - - // = Get/set priority - - // Priorities run from MIN_PRIORITY (which is the "lowest priority") - // to MAX_PRIORITY (which is the "highest priority"). - virtual int priority (void) const; - // Get the priority of the Event_Handler. - virtual void priority (int priority); - // Set the priority of the Event_Handler. - - virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); - // Called when input events occur (e.g., connection or data). - - virtual int handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE); - // Called when output events are possible (e.g., flow control - // abates). - - virtual int handle_exception (ACE_HANDLE fd = ACE_INVALID_HANDLE); - // Called when execption events occur (e.g., SIGURG). - - virtual int handle_timeout (const ACE_Time_Value ¤t_time, - const void *act = 0); - // Called when timer expires. represents the current - // time that the was selected for timeout - // dispatching and is the asynchronous completion token that - // was passed in when was invoked. - - virtual int handle_exit (ACE_Process *); - // Called when a process exits. - - virtual int handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask close_mask); - // Called when object is removed from the . - - virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); - // Called when object is signaled by OS (either via UNIX signals or - // when a Win32 object becomes signaled). - - virtual int handle_qos (ACE_HANDLE = ACE_INVALID_HANDLE); - virtual int handle_group_qos (ACE_HANDLE = ACE_INVALID_HANDLE); - - // = Accessors to set/get the various event demultiplexors. - virtual void reactor (ACE_Reactor *reactor); - virtual ACE_Reactor *reactor (void) const; - -#if !defined (ACE_HAS_WINCE) - static void *read_adapter (void *event_handler); - // Used to read from non-socket ACE_HANDLEs in our own thread to - // work around Win32 limitations that don't allow us to 'able on - // Win32. - - static int remove_stdin_handler (ACE_Reactor *reactor, - ACE_Thread_Manager *thr_mgr); - // Performs the inverse of the method. -#endif /* ACE_HAS_WINCE */ - -protected: - ACE_Event_Handler (ACE_Reactor * = 0, - int priority = ACE_Event_Handler::LO_PRIORITY); - // Force ACE_Event_Handler to be an abstract base class. - -private: - - int priority_; - // Priority of this Event_Handler. - - // = Pointers to the various event demultiplexors. - ACE_Reactor *reactor_; -}; - -class ACE_Export ACE_Notification_Buffer -{ - // = TITLE - // Simple wrapper for passing s and - // s between threads. -public: - ACE_Notification_Buffer (void); - - ACE_Notification_Buffer (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - - ~ACE_Notification_Buffer (void); - // Default dtor. - - ACE_Event_Handler *eh_; - // Pointer to the Event_Handler that will be dispatched - // by the main event loop. - - ACE_Reactor_Mask mask_; - // Mask that indicates which method to call. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Event_Handler.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_EVENT_HANDLER_H */ diff --git a/ace/Event_Handler.i b/ace/Event_Handler.i deleted file mode 100644 index 6ecccb4b1db..00000000000 --- a/ace/Event_Handler.i +++ /dev/null @@ -1,10 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Event_Handler.i - -ACE_INLINE -ACE_Notification_Buffer::~ACE_Notification_Buffer (void) -{ -} - diff --git a/ace/Event_Handler_T.cpp b/ace/Event_Handler_T.cpp deleted file mode 100644 index f0efd27b43f..00000000000 --- a/ace/Event_Handler_T.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// Event_Handler_T.cpp -// $Id$ - -#ifndef EVENT_HANDLER_T_C -#define EVENT_HANDLER_T_C - -#include "ace/Event_Handler_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(ace, Event_Handler_T, "$Id$") - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) - -#if !defined (__ACE_INLINE__) -#include "ace/Event_Handler_T.i" -#endif /* __ACE_INLINE__ */ - -ACE_ALLOC_HOOK_DEFINE(ACE_Event_Handler_T) - -template void -ACE_Event_Handler_T::dump (void) const -{ - ACE_TRACE ("ACE_Event_Handler_T::dump"); -} - -template -ACE_Event_Handler_T::~ACE_Event_Handler_T (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::~ACE_Event_Handler_T"); - if (this->delete_handler_) - delete this->op_handler_; -} - -template -ACE_Event_Handler_T::ACE_Event_Handler_T (T *op_handler, int delete_handler, - GET_HANDLE get_handle, - IO_HANDLER input_h, - CL_HANDLER close_h, - SIG_HANDLER sig_h, - TO_HANDLER timeout_h, - IO_HANDLER output_h, - SET_HANDLE set_handle, - IO_HANDLER except_h) - : op_handler_ (op_handler), - input_handler_ (input_h), - output_handler_ (output_h), - except_handler_ (except_h), - to_handler_ (timeout_h), - cl_handler_ (close_h), - sig_handler_ (sig_h), - delete_handler_ (delete_handler), - set_handle_ (set_handle), - get_handle_ (get_handle) -{ - ACE_TRACE ("ACE_Event_Handler_T::ACE_Event_Handler_T"); -} - -#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ - -#endif /* EVENT_HANDLER_T_C */ diff --git a/ace/Event_Handler_T.h b/ace/Event_Handler_T.h deleted file mode 100644 index 0ba36bf27ac..00000000000 --- a/ace/Event_Handler_T.h +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Event_Handler_T.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_EVENT_HANDLER_T_H -#define ACE_EVENT_HANDLER_T_H -#include "ace/pre.h" - -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) - -template -class ACE_Event_Handler_T : public ACE_Event_Handler -{ - // = TITLE - // Enable a class that doesn't inherit from the - // ACE_Event_Handler to be incorporated into the ACE_Reactor - // framework. Thanks to Greg Lavender (g.lavender@isode.com) - // for sharing this idea. - // - // = DESCRIPTION - // It is sometimes the case that an application has a hierarchy - // of operation dispatcher classes that have their own - // inheritance hierarchy but also would like to integrate with - // the ACE_Reactor. Rather than adopt a "mixin" approach, it is - // often cleaner to define a template as a subclass of - // ACE_Event_Handler and paramterize it with an operation - // dispatcher type. - // - // When constructing an instantiation of the ACE_Event_Handler_T - // object, a set of pointers to member functions must be - // provided so that when one of the handle_* methods is called - // by the ACE_Reactor, the appropriate method is called on the - // underlying operations object. This is done since in some - // cases it is useful to map any event that happens to the same - // method on an object. - // - // The ACE_Event_Handler_T template is instantiated by an - // operations object and registered with the ACE_Reactor, and it - // then calls the appropriate op_handler. So, it's basically - // just another level of indirection in event dispatching. The - // coupling betweent the ultimate handler of the event and the - // ACE_Event_Handler class is relaxed a bit by have this - // intermediate object of type around. The - // client object can then dynamically change the bindings for - // the various handlers so that during the life of one of the - // operation objects, it can change how it wants events to be - // handled. It just instantiates a new instance of the template - // with different bindings and reregisters this new object with - // the ACE_Reactor. -public: - // = Typedefs to simplify pointer-to-member-function registration. - - // Get/set the underlying handle. - typedef ACE_HANDLE (T::*GET_HANDLE) (void) const; - typedef void (T::*SET_HANDLE) (ACE_HANDLE); - - typedef int (T::*IO_HANDLER) (ACE_HANDLE); - // Handle I/O events. - - typedef int (T::*TO_HANDLER) (const ACE_Time_Value &, const void *); - // Handle timeout events. - - typedef int (T::*CL_HANDLER) (ACE_HANDLE, ACE_Reactor_Mask); - // Handle close events. - - typedef int (T::*SIG_HANDLER) (ACE_HANDLE, siginfo_t*, ucontext_t*); - // = Initialization and termination methods. - - ACE_Event_Handler_T (T *op_handler, - int delete_handler, - GET_HANDLE get_handle = 0, - IO_HANDLER input = 0, - CL_HANDLER close = 0, - SIG_HANDLER sig = 0, - TO_HANDLER timeout = 0, - IO_HANDLER output = 0, - SET_HANDLE set_handle = 0, - IO_HANDLER except = 0); - // Initialize the op_handler. - - ~ACE_Event_Handler_T (void); - // Close down and delete the - - // = Override all the ACE_Event_Handler methods. - - // These methods all delegate down to the operations handler. - virtual ACE_HANDLE get_handle (void) const; - virtual void set_handle (ACE_HANDLE); - virtual int handle_input (ACE_HANDLE fd = -1); - virtual int handle_output (ACE_HANDLE fd = -1); - virtual int handle_exception (ACE_HANDLE fd = -1); - virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0); - virtual int handle_close (ACE_HANDLE fd, ACE_Reactor_Mask close_mask); - virtual int handle_signal (ACE_HANDLE signum, siginfo_t * = 0, ucontext_t * = 0); - - // = Get/set the operations handler. - T *op_handler (void); - void op_handler (T *); - - // = Get/set the target pointer-to-method used for dispatching. - - GET_HANDLE handle_get (void); - void handle_get (GET_HANDLE); - - SET_HANDLE handle_set (void); - void handle_set (SET_HANDLE); - - IO_HANDLER input_handler (void); - void input_handler (IO_HANDLER); - - IO_HANDLER output_handler (void); - void output_handler (IO_HANDLER); - - IO_HANDLER except_handler (void); - void except_handler (IO_HANDLER); - - TO_HANDLER to_handler (void); - void to_handler (TO_HANDLER); - - CL_HANDLER cl_handler (void); - void cl_handler (CL_HANDLER); - - SIG_HANDLER sig_handler (void); - void sig_handler (SIG_HANDLER); - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - T *op_handler_; - // Pointer to the object that handles all the delegated operations. - - // = Handle input, output, and exception events. - IO_HANDLER input_handler_; - IO_HANDLER output_handler_; - IO_HANDLER except_handler_; - - TO_HANDLER to_handler_; - // Handle timeout events. - - CL_HANDLER cl_handler_; - // Handle close events. - - SIG_HANDLER sig_handler_; - // Handle signal events. - - int delete_handler_; - // Keeps track of whether we need to delete the handler in the - // destructor. - - // = Get/set underlying handle. - SET_HANDLE set_handle_; - GET_HANDLE get_handle_; -}; - -#if defined (__ACE_INLINE__) -#include "ace/Event_Handler_T.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Event_Handler_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Event_Handler_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ -#include "ace/post.h" -#endif /* ACE_EVENT_HANDLER_H */ diff --git a/ace/Event_Handler_T.i b/ace/Event_Handler_T.i deleted file mode 100644 index 4f2dc0374ae..00000000000 --- a/ace/Event_Handler_T.i +++ /dev/null @@ -1,185 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -template ACE_INLINE void -ACE_Event_Handler_T::op_handler (T *op) -{ - ACE_TRACE ("ACE_Event_Handler_T::op_handler"); - this->op_handler_ = op; -} - -template ACE_INLINE T * -ACE_Event_Handler_T::op_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::op_handler"); - return this->op_handler_; -} - -template ACE_INLINE ACE_HANDLE -ACE_Event_Handler_T::get_handle (void) const -{ - ACE_TRACE ("ACE_Event_Handler_T::get_handle"); - return this->get_handle_ == 0 ? -1 : (this->op_handler_->*get_handle_) (); -} - -template ACE_INLINE void -ACE_Event_Handler_T::set_handle (ACE_HANDLE h) -{ - ACE_TRACE ("ACE_Event_Handler_T::set_handle"); - if (this->set_handle_ != 0) - (this->op_handler_->*set_handle_) (h); -} - -template ACE_INLINE int -ACE_Event_Handler_T::handle_input (ACE_HANDLE fd) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_input"); - return this->input_handler_ == 0 ? 0 : (this->op_handler_->*input_handler_) (fd); -} - -template ACE_INLINE int -ACE_Event_Handler_T::handle_output (ACE_HANDLE fd) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_output"); - return this->output_handler_ == 0 ? 0 : (this->op_handler_->*output_handler_) (fd); -} - -template ACE_INLINE int -ACE_Event_Handler_T::handle_exception (ACE_HANDLE fd) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_exception"); - return this->except_handler_ == 0 ? 0 : (this->op_handler_->*except_handler_) (fd); -} - -template ACE_INLINE int -ACE_Event_Handler_T::handle_timeout (const ACE_Time_Value &tv, const void *arg) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_timeout"); - return this->to_handler_ == 0 ? 0 : (this->op_handler_->*to_handler_) (tv, arg); -} - -template ACE_INLINE int -ACE_Event_Handler_T::handle_close (ACE_HANDLE fd, ACE_Reactor_Mask close_mask) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_close"); - return this->cl_handler_ == 0 ? 0 : (this->op_handler_->*cl_handler_) (fd, close_mask); -} - -template ACE_INLINE int -ACE_Event_Handler_T::handle_signal (ACE_HANDLE signum, siginfo_t *s, ucontext_t *u) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_signal"); - return this->sig_handler_ == 0 ? 0 : (this->op_handler_->*sig_handler_) (signum, s, u); -} - -template ACE_INLINE ACE_TYPENAME ACE_Event_Handler_T::GET_HANDLE -ACE_Event_Handler_T::handle_get (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_get"); - return this->get_handle_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::handle_get (ACE_TYPENAME ACE_Event_Handler_T::GET_HANDLE h) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_get"); - this->get_handle_ = h; -} - -template ACE_INLINE ACE_TYPENAME ACE_Event_Handler_T::SET_HANDLE -ACE_Event_Handler_T::handle_set (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_set"); - return this->set_handle_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::handle_set (ACE_TYPENAME ACE_Event_Handler_T::SET_HANDLE h) -{ - ACE_TRACE ("ACE_Event_Handler_T::handle_set"); - this->set_handle_ = h; -} - -template ACE_INLINE ACE_TYPENAME ACE_Event_Handler_T::IO_HANDLER -ACE_Event_Handler_T::input_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::input_handler"); - return this->input_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::input_handler (ACE_TYPENAME ACE_Event_Handler_T::IO_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::input_handler"); - this->input_handler_ = h; -} - -template ACE_INLINE ACE_TYPENAME ACE_Event_Handler_T::IO_HANDLER -ACE_Event_Handler_T::output_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::output_handler"); - return this->output_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::output_handler (ACE_TYPENAME ACE_Event_Handler_T::IO_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::output_handler"); - this->output_handler_ = h; -} - -template ACE_INLINE ACE_TYPENAME ACE_Event_Handler_T::IO_HANDLER -ACE_Event_Handler_T::except_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::except_handler"); - return this->except_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::except_handler (ACE_TYPENAME ACE_Event_Handler_T::IO_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::except_handler"); - this->except_handler_ = h; -} - -template ACE_INLINE ACE_TYPENAME ACE_Event_Handler_T::TO_HANDLER -ACE_Event_Handler_T::to_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::to_handler"); - return this->to_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::to_handler (ACE_TYPENAME ACE_Event_Handler_T::TO_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::to_handler"); - this->to_handler_ = h; -} - -template ACE_INLINE ACE_TYPENAME ACE_Event_Handler_T::CL_HANDLER -ACE_Event_Handler_T::cl_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::cl_handler"); - return this->cl_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::cl_handler (ACE_TYPENAME ACE_Event_Handler_T::CL_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::cl_handler"); - this->cl_handler_ = h; -} - -template ACE_INLINE ACE_TYPENAME ACE_Event_Handler_T::SIG_HANDLER -ACE_Event_Handler_T::sig_handler (void) -{ - ACE_TRACE ("ACE_Event_Handler_T::sig_handler"); - return this->sig_handler_; -} - -template ACE_INLINE void -ACE_Event_Handler_T::sig_handler (ACE_TYPENAME ACE_Event_Handler_T::SIG_HANDLER h) -{ - ACE_TRACE ("ACE_Event_Handler_T::sig_handler"); - this->sig_handler_ = h; -} diff --git a/ace/FIFO.cpp b/ace/FIFO.cpp deleted file mode 100644 index 588b00b318d..00000000000 --- a/ace/FIFO.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// FIFO.cpp -// $Id$ - -/* -*- C++ -*- */ - -#include "ace/FIFO.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FIFO.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FIFO, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO) - -void -ACE_FIFO::dump (void) const -{ - ACE_TRACE ("ACE_FIFO::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("rendezvous_ = %s"), this->rendezvous_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -int -ACE_FIFO::open (const ACE_TCHAR *r, int flags, int perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO::open"); - ACE_OS::strncpy (this->rendezvous_, r, MAXPATHLEN); - -#if defined (ACE_PSOS_DIAB_MIPS) - if ( ACE_OS::mkfifo (this->rendezvous_, perms) == -1 - && !(errno == EEXIST)) - return -1; -#else - if ((flags & O_CREAT) != 0 - && ACE_OS::mkfifo (this->rendezvous_, perms) == -1 - && !(errno == EEXIST)) - return -1; -#endif - - this->set_handle (ACE_OS::open (this->rendezvous_, flags, 0, sa)); - return this->get_handle () == ACE_INVALID_HANDLE ? -1 : 0; -} - -ACE_FIFO::ACE_FIFO (const ACE_TCHAR *fifo_name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO::ACE_FIFO"); - if (this->open (fifo_name, flags, perms, sa) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO"))); -} - -ACE_FIFO::ACE_FIFO (void) -{ -// ACE_TRACE ("ACE_FIFO::ACE_FIFO"); -} - -int -ACE_FIFO::close (void) -{ - ACE_TRACE ("ACE_FIFO::close"); - int result = 0; - - if (this->get_handle () != ACE_INVALID_HANDLE) - { - result = ACE_OS::close (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - } - return result; -} diff --git a/ace/FIFO.h b/ace/FIFO.h deleted file mode 100644 index 8f0f44a9321..00000000000 --- a/ace/FIFO.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FIFO.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_FIFO_H -#define ACE_FIFO_H -#include "ace/pre.h" - -#include "ace/IPC_SAP.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_FIFO : public ACE_IPC_SAP -{ - // = TITLE - // Abstract base class for UNIX FIFOs - // - // = DESCRIPTION - // UNIX FIFOs are also known Named Pipes, which are totally - // unrelated to Win32 Named Pipes. If you want to use a local - // IPC mechanism that will be portable to both UNIX and Win32, - // take a look at the classes. -public: - int open (const ACE_TCHAR *rendezvous, int flags, int perms, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up the named pipe on the in accordance with the - // flags. - - int close (void); - // Close down the ACE_FIFO without removing the rendezvous point. - - int remove (void); - // Close down the ACE_FIFO and remove the rendezvous point from the - // file system. - - int get_local_addr (const ACE_TCHAR *&rendezvous) const; - // Return the local address of this endpoint. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - // = Make these protected to ensure that the class is "abstract." - ACE_FIFO (void); - // Default constructor. - - ACE_FIFO (const ACE_TCHAR *rendezvous, int flags, int perms, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up the named pipe on the in accordance with the - // flags. - -private: - ACE_TCHAR rendezvous_[MAXPATHLEN + 1]; - // Rendezvous point in the file system. -}; - -#if defined (__ACE_INLINE__) -#include "ace/FIFO.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_FIFO_H */ diff --git a/ace/FIFO.i b/ace/FIFO.i deleted file mode 100644 index d640bb8141f..00000000000 --- a/ace/FIFO.i +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FIFO.i - -ACE_INLINE int -ACE_FIFO::get_local_addr (const ACE_TCHAR *&r) const -{ - ACE_TRACE ("ACE_FIFO::get_local_addr"); - r = this->rendezvous_; - return 0; -} - -ACE_INLINE int -ACE_FIFO::remove (void) -{ - ACE_TRACE ("ACE_FIFO::remove"); - int result = this->close (); - return ACE_OS::unlink (this->rendezvous_) == -1 || result == -1 ? -1 : 0; -} diff --git a/ace/FIFO_Recv.cpp b/ace/FIFO_Recv.cpp deleted file mode 100644 index a2240f35b46..00000000000 --- a/ace/FIFO_Recv.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// FIFO_Recv.cpp -// $Id$ - -/* -*- C++ -*- */ - -#include "ace/FIFO_Recv.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FIFO_Recv.i" -#endif - -ACE_RCSID(ace, FIFO_Recv, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Recv) - -void -ACE_FIFO_Recv::dump (void) const -{ - ACE_TRACE ("ACE_FIFO_Recv::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_FIFO::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("aux_handle_ = %d"), this->aux_handle_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -int -ACE_FIFO_Recv::close (void) -{ - ACE_TRACE ("ACE_FIFO_Recv::close"); - int result = ACE_FIFO::close (); - - if (this->aux_handle_ != ACE_INVALID_HANDLE) - return ACE_OS::close (this->aux_handle_); - else - return result; -} - -// Note that persistent means "open fifo for writing, as well as -// reading." This ensures that the fifo never gets EOF, even if there -// aren't any writers at the moment! - -int -ACE_FIFO_Recv::open (const ACE_TCHAR *fifo_name, - int flags, - int perms, - int persistent, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Recv::open"); - - if (ACE_FIFO::open (fifo_name, ACE_NONBLOCK | flags, perms, sa) == -1) - return -1; - else if (this->disable (ACE_NONBLOCK) == -1) - return -1; - else if (persistent - && (this->aux_handle_ = ACE_OS::open (fifo_name, O_WRONLY, 0, sa)) == ACE_INVALID_HANDLE) - return -1; - else - return this->get_handle () == ACE_INVALID_HANDLE ? -1 : 0; -} - -ACE_FIFO_Recv::ACE_FIFO_Recv (void) - : aux_handle_ (ACE_INVALID_HANDLE) -{ - ACE_TRACE ("ACE_FIFO_Recv::ACE_FIFO_Recv"); -} - -ACE_FIFO_Recv::ACE_FIFO_Recv (const ACE_TCHAR *fifo_name, - int flags, - int perms, - int persistent, - LPSECURITY_ATTRIBUTES sa) - : aux_handle_ (ACE_INVALID_HANDLE) -{ - ACE_TRACE ("ACE_FIFO_Recv::ACE_FIFO_Recv"); - - if (this->ACE_FIFO_Recv::open (fifo_name, - flags, - perms, - persistent, - sa) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO_Recv"))); -} diff --git a/ace/FIFO_Recv.h b/ace/FIFO_Recv.h deleted file mode 100644 index c035343fb60..00000000000 --- a/ace/FIFO_Recv.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FIFO_Recv.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_FIFO_RECV_H -#define ACE_FIFO_RECV_H -#include "ace/pre.h" - -#include "ace/FIFO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_FIFO_Recv : public ACE_FIFO -{ - // = TITLE - // Receiver side of the bytestream C++ wrapper for UNIX - // FIFOs. -public: - // = Initialization methods. - ACE_FIFO_Recv (void); - // Default constructor. - - ACE_FIFO_Recv (const ACE_TCHAR *rendezvous, - int flags = O_CREAT | O_RDONLY, - int perms = ACE_DEFAULT_FILE_PERMS, - int persistent = 1, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up a bytestream named pipe for reading. - - int open (const ACE_TCHAR *rendezvous, - int flags = O_CREAT | O_RDONLY, - int perms = ACE_DEFAULT_FILE_PERMS, - int persistent = 1, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up a bytestream named pipe for reading. - - int close (void); - // Close down the named pipe. - - ssize_t recv (void *buf, size_t len); - // Recv of up to bytes. - - ssize_t recv_n (void *buf, size_t len); - // Recv of exactly bytes (block until done). - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_HANDLE aux_handle_; - // Auxiliary handle that is used to implement persistent FIFOs. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FIFO_Recv.i" -#endif - -#include "ace/post.h" -#endif /* ACE_FIFO_RECV_H */ diff --git a/ace/FIFO_Recv.i b/ace/FIFO_Recv.i deleted file mode 100644 index 693b2a944fe..00000000000 --- a/ace/FIFO_Recv.i +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FIFO_Recv.i - -ASYS_INLINE ssize_t -ACE_FIFO_Recv::recv (void *buf, size_t len) -{ - ACE_TRACE ("ACE_FIFO_Recv::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, len); -} - -ASYS_INLINE ssize_t -ACE_FIFO_Recv::recv_n (void *buf, size_t n) -{ - ACE_TRACE ("ACE_FIFO_Recv::recv_n"); - return ACE::recv_n (this->get_handle (), buf, n); -} diff --git a/ace/FIFO_Recv_Msg.cpp b/ace/FIFO_Recv_Msg.cpp deleted file mode 100644 index 7f086e4b101..00000000000 --- a/ace/FIFO_Recv_Msg.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// FIFO_Recv_Msg.cpp -// $Id$ - -/* -*- C++ -*- */ - -#include "ace/FIFO_Recv_Msg.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FIFO_Recv_Msg.i" -#endif - -ACE_RCSID(ace, FIFO_Recv_Msg, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Recv_Msg) - -void -ACE_FIFO_Recv_Msg::dump (void) const -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::dump"); - ACE_FIFO_Recv::dump (); -} - -// Note that persistent means "open FIFO for writing, as well as -// reading." This ensures that the FIFO never gets EOF, even if there -// aren't any writers at the moment! - -int -ACE_FIFO_Recv_Msg::open (const ACE_TCHAR *fifo_name, - int flags, - int perms, - int persistent, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::open"); - - return ACE_FIFO_Recv::open (fifo_name, - flags, - perms, - persistent, - sa); -} - -ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (void) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg"); -} - -ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (const ACE_TCHAR *fifo_name, - int flags, - int perms, - int persistent, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg"); - - if (this->ACE_FIFO_Recv_Msg::open (fifo_name, - flags, - perms, - persistent, - sa) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO_Recv_Msg"))); -} diff --git a/ace/FIFO_Recv_Msg.h b/ace/FIFO_Recv_Msg.h deleted file mode 100644 index 4cc19ff2675..00000000000 --- a/ace/FIFO_Recv_Msg.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FIFO_Recv_Msg.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_FIFO_RECV_MSG_H -#define ACE_FIFO_RECV_MSG_H -#include "ace/pre.h" - -#include "ace/FIFO_Recv.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_FIFO_Recv_Msg : public ACE_FIFO_Recv -{ - // = TITLE - // Receiver side for the record oriented C++ wrapper for UNIX FIFOs. -public: - // = Initialization methods. - ACE_FIFO_Recv_Msg (void); - // Default constructor. - - ACE_FIFO_Recv_Msg (const ACE_TCHAR *rendezvous, - int flags = O_CREAT | O_RDONLY, - int perms = ACE_DEFAULT_FILE_PERMS, - int persistent = 1, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up a record-oriented named pipe for reading. - - int open (const ACE_TCHAR *rendezvous, - int flags = O_CREAT | O_RDONLY, - int perms = ACE_DEFAULT_FILE_PERMS, - int persistent = 1, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up a record-oriented named pipe for reading. - - ssize_t recv (ACE_Str_Buf &msg); - // Recv as an ACE_Str_Buf. - - ssize_t recv (void *buf, size_t len); - // Recv as a buffer. - -#if defined (ACE_HAS_STREAM_PIPES) - ssize_t recv (ACE_Str_Buf *data, - ACE_Str_Buf *cntl, - int *flags); - // Recv and message via Stream pipes. - - ssize_t recv (int *band, - ACE_Str_Buf *data, - ACE_Str_Buf *cntl, - int *flags); - // Recv and message via Stream pipes in "band" mode. -#endif /* ACE_HAS_STREAM_PIPES */ - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FIFO_Recv_Msg.i" -#endif - -#include "ace/post.h" -#endif /* ACE_FIFO_RECV_MSG_H */ diff --git a/ace/FIFO_Recv_Msg.i b/ace/FIFO_Recv_Msg.i deleted file mode 100644 index dce1d06e29a..00000000000 --- a/ace/FIFO_Recv_Msg.i +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FIFO_Recv_Msg.i - -// Note that the return values mean different things if -// ACE_HAS_STREAM_PIPES vs. if it doesn't... See the manual page on -// getmsg(2) and read(2) for more details. - -ASYS_INLINE ssize_t -ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf &recv_msg) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); -#if defined (ACE_HAS_STREAM_PIPES) - int i = 0; - return ACE_OS::getmsg (this->get_handle (), - (strbuf *) 0, - (strbuf *) &recv_msg, - &i); -#else /* Do the ol' 2-read trick... */ - if (ACE_OS::read (this->get_handle (), - (char *) &recv_msg.len, - sizeof recv_msg.len) != sizeof recv_msg.len) - return -1; - else - return ACE_OS::read (this->get_handle (), - (char *) recv_msg.buf, - (int) recv_msg.len); -#endif /* ACE_HAS_STREAM_PIPES */ -} - -ASYS_INLINE ssize_t -ACE_FIFO_Recv_Msg::recv (void *buf, size_t max_len) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - ACE_Str_Buf recv_msg ((char *) buf, 0, max_len); - - return this->recv (recv_msg); -} - -#if defined (ACE_HAS_STREAM_PIPES) -ASYS_INLINE ssize_t -ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf *data, - ACE_Str_Buf *cntl, - int *flags) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - return ACE_OS::getmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - flags); -} - -ASYS_INLINE ssize_t -ACE_FIFO_Recv_Msg::recv (int *band, - ACE_Str_Buf *data, - ACE_Str_Buf *cntl, - int *flags) -{ - ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - return ACE_OS::getpmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - band, - flags); -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/ace/FIFO_Send.cpp b/ace/FIFO_Send.cpp deleted file mode 100644 index da38a6857b6..00000000000 --- a/ace/FIFO_Send.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// FIFO_Send.cpp -// $Id$ - -/* -*- C++ -*- */ - -#include "ace/FIFO_Send.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FIFO_Send.i" -#endif - -ACE_RCSID(ace, FIFO_Send, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Send) - -void -ACE_FIFO_Send::dump (void) const -{ - ACE_TRACE ("ACE_FIFO_Send::dump"); - ACE_FIFO::dump (); -} - -ACE_FIFO_Send::ACE_FIFO_Send (void) -{ -// ACE_TRACE ("ACE_FIFO_Send::ACE_FIFO_Send"); -} - -int -ACE_FIFO_Send::open (const ACE_TCHAR *rendezvous_name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Send::open"); - return ACE_FIFO::open (rendezvous_name, - flags | O_WRONLY, - perms, - sa); -} - -ACE_FIFO_Send::ACE_FIFO_Send (const ACE_TCHAR *fifo_name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Send::ACE_FIFO_Send"); - if (this->ACE_FIFO_Send::open (fifo_name, - flags, - perms, - sa) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_FIFO_Send::ACE_FIFO_Send"))); -} diff --git a/ace/FIFO_Send.h b/ace/FIFO_Send.h deleted file mode 100644 index a9733f8d478..00000000000 --- a/ace/FIFO_Send.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FIFO_Send.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_FIFO_SEND_H -#define ACE_FIFO_SEND_H -#include "ace/pre.h" - -#include "ace/FIFO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_FIFO_Send : public ACE_FIFO -{ - // = TITLE - // Sender side for the bytestream C++ wrapper for UNIX FIFOs -public: - // = Initialization methods. - ACE_FIFO_Send (void); - // Default constructor. - - ACE_FIFO_Send (const ACE_TCHAR *rendezvous, - int flags = O_WRONLY, - int perms = ACE_DEFAULT_FILE_PERMS, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up a bytestream named pipe for writing. - - int open (const ACE_TCHAR *rendezvous, - int flags = O_WRONLY, - int perms = ACE_DEFAULT_FILE_PERMS, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up a bytestream named pipe for writing. - - ssize_t send (const void *buf, size_t len); - // Send of up to bytes. - - ssize_t send_n (const void *buf, size_t len); - // Send of exactly bytes (block until done). - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FIFO_Send.i" -#endif - -#include "ace/post.h" -#endif /* ACE_FIFO_SEND_H */ diff --git a/ace/FIFO_Send.i b/ace/FIFO_Send.i deleted file mode 100644 index c7e20eae8d2..00000000000 --- a/ace/FIFO_Send.i +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FIFO_Send.i - -ASYS_INLINE ssize_t -ACE_FIFO_Send::send (const void *buf, size_t len) -{ - ACE_TRACE ("ACE_FIFO_Send::send"); - return ACE_OS::write (this->get_handle (), (const char *) buf, len); -} - -ASYS_INLINE ssize_t -ACE_FIFO_Send::send_n (const void *buf, size_t n) -{ - ACE_TRACE ("ACE_FIFO_Send::send_n"); - return ACE::send_n (this->get_handle (), buf, n); -} diff --git a/ace/FIFO_Send_Msg.cpp b/ace/FIFO_Send_Msg.cpp deleted file mode 100644 index d1c4455e9b8..00000000000 --- a/ace/FIFO_Send_Msg.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// FIFO_Send_Msg.cpp -// $Id$ - -/* -*- C++ -*- */ - -#include "ace/FIFO_Send_Msg.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FIFO_Send_Msg.i" -#endif - -ACE_RCSID(ace, FIFO_Send_Msg, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Send_Msg) - -void -ACE_FIFO_Send_Msg::dump (void) const -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::dump"); - ACE_FIFO_Send::dump (); -} - -ssize_t -ACE_FIFO_Send_Msg::send (const ACE_Str_Buf &send_msg) -{ - // ACE_TRACE ("ACE_FIFO_Send_Msg::send"); -#if defined (ACE_HAS_STREAM_PIPES) - return ACE_OS::putmsg (this->get_handle (), - (strbuf *) 0, - (strbuf *) &send_msg, - 0); -#else - iovec iov[2]; - - iov[0].iov_base = (char *) &send_msg.len; - iov[0].iov_len = sizeof send_msg.len; - - iov[1].iov_base = (char *) send_msg.buf; - iov[1].iov_len = int (send_msg.len); - - return ACE_OS::writev (this->get_handle (), iov, 2); -#endif /* ACE_HAS_STREAM_PIPES */ -} - -ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (void) -{ -// ACE_TRACE ("ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg"); -} - -int -ACE_FIFO_Send_Msg::open (const ACE_TCHAR *fifo_name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::open"); - return ACE_FIFO_Send::open (fifo_name, flags | O_WRONLY, perms, sa); -} - -ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (const ACE_TCHAR *fifo_name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg"); - if (this->ACE_FIFO_Send_Msg::open (fifo_name, flags, perms, sa) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_FIFO_Send_Msg"))); -} diff --git a/ace/FIFO_Send_Msg.h b/ace/FIFO_Send_Msg.h deleted file mode 100644 index 0ed9ce9a707..00000000000 --- a/ace/FIFO_Send_Msg.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FIFO_Send_Msg.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_FIFO_SEND_MSG_H -#define ACE_FIFO_SEND_MSG_H -#include "ace/pre.h" - -#include "ace/FIFO_Send.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_FIFO_Send_Msg : public ACE_FIFO_Send -{ - // = TITLE - // Sender side for the Record oriented C++ wrapper for UNIX - // FIFOs. -public: - // = Initialization methods. - ACE_FIFO_Send_Msg (void); - // Default constructor. - - ACE_FIFO_Send_Msg (const ACE_TCHAR *rendezvous, - int flags = O_WRONLY, - int perms = ACE_DEFAULT_FILE_PERMS, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up a record-oriented named pipe for writing. - - int open (const ACE_TCHAR *rendezvous, - int flags = O_WRONLY, - int perms = ACE_DEFAULT_FILE_PERMS, - LPSECURITY_ATTRIBUTES sa = 0); - // Open up a record-oriented named pipe for writing. - - ssize_t send (const ACE_Str_Buf &msg); - // Send of up to bytes. - - ssize_t send (const void *buf, size_t len); - // Send of exactly bytes (block until done). - -#if defined (ACE_HAS_STREAM_PIPES) - ssize_t send (const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl = 0, - int flags = 0); - // Send and message via Stream pipes. - - ssize_t send (int band, - const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl = 0, - int flags = MSG_BAND); - // Send and message via Stream pipes in "band" mode. -#endif /* ACE_HAS_STREAM_PIPES */ - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FIFO_Send_Msg.i" -#endif - -#include "ace/post.h" -#endif /* ACE_FIFO_SEND_MSG_H */ diff --git a/ace/FIFO_Send_Msg.i b/ace/FIFO_Send_Msg.i deleted file mode 100644 index e81484983c2..00000000000 --- a/ace/FIFO_Send_Msg.i +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FIFO_Send_Msg.i - -ASYS_INLINE ssize_t -ACE_FIFO_Send_Msg::send (const void *buf, size_t len) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - ACE_Str_Buf send_msg ((char *) buf, len); - - return this->send (send_msg); -} - -#if defined (ACE_HAS_STREAM_PIPES) -ASYS_INLINE ssize_t -ACE_FIFO_Send_Msg::send (const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl, - int flags) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - return ACE_OS::putmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - flags); -} - -ASYS_INLINE ssize_t -ACE_FIFO_Send_Msg::send (int band, - const ACE_Str_Buf *data, - const ACE_Str_Buf *cntl, - int flags) -{ - ACE_TRACE ("ACE_FIFO_Send_Msg::send"); - return ACE_OS::putpmsg (this->get_handle (), - (strbuf *) cntl, - (strbuf *) data, - band, - flags); -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/ace/FILE.cpp b/ace/FILE.cpp deleted file mode 100644 index a3d6d5a5e52..00000000000 --- a/ace/FILE.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// FILE.cpp -// $Id$ - -/* Defines the member functions for the base class of the ACE_IO_SAP - ACE_FILE abstraction. */ - -#include "ace/FILE.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FILE.i" -#endif - -ACE_RCSID(ace, FILE, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE) - -void -ACE_FILE::dump (void) const -{ - ACE_TRACE ("ACE_FILE::dump"); - ACE_IO_SAP::dump (); -} - -// This is the do-nothing constructor. - -ACE_FILE::ACE_FILE (void) -{ - ACE_TRACE ("ACE_FILE::ACE_FILE"); -} - -// Close the file - -int -ACE_FILE::close (void) -{ - ACE_TRACE ("ACE_FILE::close"); - int result = ACE_OS::close (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - return result; -} - -int -ACE_FILE::get_info (ACE_FILE_Info *finfo) -{ - ACE_TRACE ("ACE_FILE::get_info"); - struct stat filestatus; - - int result = ACE_OS::fstat (this->get_handle (), - &filestatus); - - if (result == 0) - { - finfo->mode_ = filestatus.st_mode; - finfo->nlink_ = filestatus.st_nlink; - finfo->size_ = filestatus.st_size; - } - - return result; -} - -int -ACE_FILE::get_info (ACE_FILE_Info &finfo) -{ - ACE_TRACE ("ACE_FILE::get_info"); - - return this->get_info (&finfo); -} - -int -ACE_FILE::truncate (off_t length) -{ - ACE_TRACE ("ACE_FILE::truncate"); - return ACE_OS::ftruncate (this->get_handle(), length); -} - -off_t -ACE_FILE::seek (off_t offset, int startpos) -{ - return ACE_OS::lseek (this->get_handle (), - offset, - startpos); -} - -off_t -ACE_FILE::position (long offset, int startpos) -{ - ACE_TRACE ("ACE_FILE::position"); - return this->seek (offset, startpos); -} - -off_t -ACE_FILE::tell (void) -{ - ACE_TRACE ("ACE_FILE::position"); - return ACE_OS::lseek (this->get_handle (), 0, SEEK_CUR); -} - -off_t -ACE_FILE::position (void) -{ - ACE_TRACE ("ACE_FILE::position"); - return this->tell (); -} - -// Return the local endpoint address. - -int -ACE_FILE::get_local_addr (ACE_Addr &addr) const -{ - ACE_TRACE ("ACE_FILE::get_local_addr"); - - // Perform the downcast since had better be an - // . - ACE_FILE_Addr *file_addr = - ACE_dynamic_cast (ACE_FILE_Addr *, &addr); - - if (file_addr == 0) - return -1; - else - { - *file_addr = this->addr_; - return 0; - } -} - -// Return the same result as . - -int -ACE_FILE::get_remote_addr (ACE_Addr &addr) const -{ - ACE_TRACE ("ACE_FILE::get_remote_addr"); - - return this->get_local_addr (addr); -} - -int -ACE_FILE::remove (void) -{ - ACE_TRACE ("ACE_FILE::remove"); - - this->close (); - return ACE_OS::unlink (this->addr_.get_path_name ()); -} - -int -ACE_FILE::unlink (void) -{ - ACE_TRACE ("ACE_FILE::unlink"); - - return ACE_OS::unlink (this->addr_.get_path_name ()); -} diff --git a/ace/FILE.h b/ace/FILE.h deleted file mode 100644 index 92f60ab7abb..00000000000 --- a/ace/FILE.h +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FILE.h -// -// = AUTHOR -// Gerhard Lenzer -// -// ============================================================================ - -#ifndef ACE_FILE_H -#define ACE_FILE_H -#include "ace/pre.h" - -#include "ace/IO_SAP.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/FILE_Addr.h" - -// The following is necessary since many C++ compilers don't support -// typedef'd types inside of classes used as formal template -// arguments... ;-(. Luckily, using the C++ preprocessor I can hide -// most of this nastiness! - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) -#define ACE_FILE_CONNECTOR ACE_FILE_Connector -#define ACE_FILE_STREAM ACE_FILE_IO -#else /* TEMPLATES are broken (must be a cfront-based compiler...) */ -#define ACE_FILE_CONNECTOR ACE_FILE_Connector, ACE_FILE_Addr -#define ACE_FILE_STREAM ACE_FILE_IO, ACE_FILE_Addr -#endif /* ACE_TEMPLATE_TYPEDEFS */ - -class ACE_Export ACE_FILE_Info -{ - // = TITLE - // Abstracts basic OS FILE information. -public: - mode_t mode_; - // mode of file - - nlink_t nlink_; - // no of links - - off_t size_; - // size of file -}; - -class ACE_Export ACE_FILE : public ACE_IO_SAP -{ - // = TITLE - // Defines the core methods of the abstraction. -public: - int close (void); - // Close the handle without removing the from - // the file system. - - int remove (void); - // Close and remove the from the file system. - - int unlink (void); - // Remove the from the file system without closing the - // handle. - - int get_info (ACE_FILE_Info *finfo); - // Get information on this . - - int get_info (ACE_FILE_Info &finfo); - // Get information on this . - - int truncate (off_t length); - // Set filesize to length byte. - - off_t seek (off_t offset, - int whence = SEEK_CUR); - // Sets the file pointer as follows: - // o If is , the pointer is set to - // bytes. - // - // o If is , the pointer is set to its - // current location plus . - // - // o If is , the pointer is set to the size - // of the file plus offset. - off_t position (long offset, int startpos); - // Same as , but is deprecated. - - off_t tell (void); - // Return an offset for the file handle. - - off_t position (void); - // Same as , but is deprecated. - - int disable (int signum) const ; - // Disable signal - // This is here to prevent Win32 from - // disabling SPIPE using socket calls - - int get_local_addr (ACE_Addr &) const; - // Return the local endpoint address in the referenced . - // Returns 0 if successful, else -1. - - int get_remote_addr (ACE_Addr &) const; - // Return the same thing as . - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - ACE_FILE (void); - // Ensure that this class is only created by the - // . - - ACE_FILE_Addr addr_; - // File we are "connected" with... -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FILE.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/post.h" -#endif /* ACE_FILE_H */ diff --git a/ace/FILE.i b/ace/FILE.i deleted file mode 100644 index cf1f4986479..00000000000 --- a/ace/FILE.i +++ /dev/null @@ -1,16 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FILE.i - -ASYS_INLINE int -ACE_FILE::disable (int signum) const -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (signum) ; - return 0 ; -#else /* ACE_WIN32 */ - return ACE_IO_SAP::disable (signum) ; -#endif /* ACE_WIN32 */ -} - diff --git a/ace/FILE_Addr.cpp b/ace/FILE_Addr.cpp deleted file mode 100644 index 1e27092a4ec..00000000000 --- a/ace/FILE_Addr.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// $Id$ - -#include "ace/FILE_Addr.h" - -#if !defined (__ACE_INLINE__) -#include "ace/FILE_Addr.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, FILE_Addr, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE_Addr) - -ACE_FILE_Addr::ACE_FILE_Addr (void) - : ACE_Addr (AF_FILE, sizeof this->filename_) -{ - this->filename_[0] = '\0'; -} - -int -ACE_FILE_Addr::set (const ACE_FILE_Addr &sa) -{ - if (sa.get_type () == AF_ANY) - { -#if defined (ACE_DEFAULT_TEMP_FILE) - // Create a temporary file. - ACE_OS::strcpy (this->filename_, - ACE_DEFAULT_TEMP_FILE); -#else /* ACE_DEFAULT_TEMP_FILE */ - if (ACE::get_temp_dir (this->filename_, - MAXPATHLEN - 15) == -1) // -15 for ace-file-XXXXXX - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Temporary path too long, ") - ACE_TEXT ("defaulting to current directory\n"))); - this->filename_[0] = 0; - } - - // Add the filename to the end - ACE_OS::strcat (this->filename_, ACE_TEXT ("ace-file-XXXXXX")); - -#endif /* ACE_DEFAULT_TEMP_FILE */ - - ACE_OS::mktemp (this->filename_); - this->base_set (AF_FILE, - ACE_OS::strlen (this->filename_) + 1); - } - else - { - (void) ACE_OS::strncpy (this->filename_, - sa.filename_, - sa.get_size ()); - - this->base_set (sa.get_type (), - sa.get_size ()); - } - return 0; -} - -// Copy constructor. - -ACE_FILE_Addr::ACE_FILE_Addr (const ACE_FILE_Addr &sa) - : ACE_Addr (AF_FILE, sizeof this->filename_) -{ - this->set (sa); -} - -int -ACE_FILE_Addr::set (const ACE_TCHAR *filename) -{ - this->ACE_Addr::base_set (AF_FILE, - ACE_OS::strlen (filename) + 1); - (void) ACE_OS::strncpy (this->filename_, - filename, - sizeof this->filename_); - return 0; -} - -ACE_FILE_Addr & -ACE_FILE_Addr::operator= (const ACE_FILE_Addr &sa) -{ - if (this != &sa) - this->set (sa); - return *this; -} - -// Create a ACE_Addr from a ACE_FILE pathname. - -ACE_FILE_Addr::ACE_FILE_Addr (const ACE_TCHAR *filename) -{ - this->set (filename); -} - -int -ACE_FILE_Addr::addr_to_string (ACE_TCHAR *s, size_t len) const -{ - ACE_OS::strncpy (s, this->filename_, len); - return 0; -} - -void -ACE_FILE_Addr::dump (void) const -{ - ACE_TRACE ("ACE_FILE_Addr::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("filename_ = %s"), this->filename_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} diff --git a/ace/FILE_Addr.h b/ace/FILE_Addr.h deleted file mode 100644 index 1100c1f23e2..00000000000 --- a/ace/FILE_Addr.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FILE_Addr.h -// -// = AUTHOR -// Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_FILE_ADDR_H -#define ACE_FILE_ADDR_H -#include "ace/pre.h" - -#include "ace/Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/ACE.h" - -class ACE_Export ACE_FILE_Addr : public ACE_Addr -{ - // = TITLE - // Defines the FILE address family address format. -public: - // = Initialization methods. - ACE_FILE_Addr (void); - // Default constructor. - - ACE_FILE_Addr (const ACE_FILE_Addr &sa); - // Copy constructor. - - int set (const ACE_FILE_Addr &sa); - // Acts like a copy constructor. If == ACE_Addr::sap_any then - // create a temporary filename using . - - ACE_FILE_Addr (const ACE_TCHAR *filename); - // Create a ACE_FILE_Addr from a pathname. - - int set (const ACE_TCHAR *filename); - // Create a ACE_FILE_Addr from a pathname. - - ACE_FILE_Addr &operator= (const ACE_FILE_Addr &); - // Assignment operator. - - virtual void *get_addr (void) const; - // Return a pointer to the address. - - virtual int addr_to_string (ACE_TCHAR *addr, size_t) const; - // Transform the current address into string format. - - int operator == (const ACE_FILE_Addr &SAP) const; - // Compare two addresses for equality. - - int operator != (const ACE_FILE_Addr &SAP) const; - // Compare two addresses for inequality. - - const ACE_TCHAR *get_path_name (void) const; - // Return the path name used for the rendezvous point. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_TCHAR filename_[MAXNAMLEN + 1]; - // Name of the file. -}; - -#if defined (__ACE_INLINE__) -#include "ace/FILE_Addr.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_FILE_ADDR_H */ diff --git a/ace/FILE_Addr.i b/ace/FILE_Addr.i deleted file mode 100644 index 6acce0515b8..00000000000 --- a/ace/FILE_Addr.i +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FILE_Addr.i - -// Do nothing constructor. - -// Transform the current address into string format. - -#include "ace/SString.h" - -// Return the address. - -ACE_INLINE void * -ACE_FILE_Addr::get_addr (void) const -{ - return (void *) &this->filename_; -} - -// Compare two addresses for equality. - -ACE_INLINE int -ACE_FILE_Addr::operator == (const ACE_FILE_Addr &sap) const -{ - return ACE_OS::strcmp (this->filename_, sap.filename_) == 0; -} - -// Compare two addresses for inequality. - -ACE_INLINE int -ACE_FILE_Addr::operator != (const ACE_FILE_Addr &sap) const -{ - return !((*this) == sap); // This is lazy, of course... ;-) -} - -// Return the path name used for the rendezvous point. - -ACE_INLINE const ACE_TCHAR * -ACE_FILE_Addr::get_path_name (void) const -{ - return this->filename_; -} - diff --git a/ace/FILE_Connector.cpp b/ace/FILE_Connector.cpp deleted file mode 100644 index 7e28fcfe791..00000000000 --- a/ace/FILE_Connector.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// FILE_Connector.cpp -// $Id$ - -#include "ace/FILE_Connector.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FILE_Connector.i" -#endif - -ACE_RCSID(ace, FILE_Connector, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE_Connector) - -void -ACE_FILE_Connector::dump (void) const -{ - ACE_TRACE ("ACE_FILE_Connector::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_FILE_Connector::ACE_FILE_Connector (void) -{ - ACE_TRACE ("ACE_FILE_Connector::ACE_FILE_Connector"); -} - -int -ACE_FILE_Connector::connect (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &, - int, - int flags, - int perms) -{ - ACE_TRACE ("ACE_FILE_Connector::connect"); - ACE_ASSERT (new_io.get_handle () == ACE_INVALID_HANDLE); - - // Check to see if caller has requested that we create the filename. - if (ACE_reinterpret_cast (const ACE_Addr &, - ACE_const_cast (ACE_FILE_Addr &, - remote_sap)) == ACE_Addr::sap_any) - // Create a new temporary file. - new_io.addr_ = - ACE_FILE_Addr (ACE_sap_any_cast (ACE_FILE_Addr &)); // class copy. - else - new_io.addr_ = remote_sap; // class copy. - - ACE_HANDLE handle = ACE::handle_timed_open (timeout, - new_io.addr_.get_path_name (), - flags, - perms); - new_io.set_handle (handle); - return handle == ACE_INVALID_HANDLE ? -1 : 0; -} - diff --git a/ace/FILE_Connector.h b/ace/FILE_Connector.h deleted file mode 100644 index 8a52471d059..00000000000 --- a/ace/FILE_Connector.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FILE_Connector.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_FILE_CONNECTOR_H -#define ACE_FILE_CONNECTOR_H -#include "ace/pre.h" - -#include "ace/FILE_IO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_FILE_Connector -{ - // = TITLE - // Defines an active connection factory for the ACE_FILE wrappers. -public: - // = Initialization methods. - ACE_FILE_Connector (void); - // Default constructor. - - ACE_FILE_Connector (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR | O_CREAT, - int perms = ACE_DEFAULT_FILE_PERMS); - // Actively ``connect'' and produce a object - // if things go well. The is the file that we are - // trying to create/open. If it's the default value of - // then the user is letting the OS create the - // filename (via ). The is the amount of - // time to wait to create/open the file. If it's 0 then we block - // indefinitely. If *timeout == {0, 0} then the file is created - // using non-blocking mode. In this case, if the create/open can't - // be done immediately the value of -1 is returned with . If *timeout > {0, 0} then this is the amount of - // time to wait before timing out. If the time expires before the - // connection is made . The and - // parameters are ignored. The and - // arguments are passed down to the method. - - int connect (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR | O_CREAT, - int perms = ACE_DEFAULT_FILE_PERMS); - // Actively ``connect'' and produce a object - // if things go well. The is the file that we are - // trying to create/open. If it's the default value of - // then the user is letting the OS create the - // filename (via ). The is the amount of - // time to wait to create/open the file. If it's 0 then we block - // indefinitely. If *timeout == {0, 0} then the file is created - // using non-blocking mode. In this case, if the create/open can't - // be done immediately the value of -1 is returned with . If *timeout > {0, 0} then this is the amount of - // time to wait before timing out. If the time expires before the - // connection is made . The and - // parameters are ignored. The and - // arguments are passed down to the method. - - int reset_new_handle (ACE_HANDLE handle); - // Resets any event associations on this handle - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - // = Meta-type "trait" information. - typedef ACE_FILE_Addr PEER_ADDR; - typedef ACE_FILE_IO PEER_STREAM; -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FILE_Connector.i" -#endif - -#include "ace/post.h" -#endif /* ACE_FILE_CONNECTOR_H */ diff --git a/ace/FILE_Connector.i b/ace/FILE_Connector.i deleted file mode 100644 index 27c4d94a080..00000000000 --- a/ace/FILE_Connector.i +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FILE_Connector.i - -// Creates a Local ACE_FILE. - -ASYS_INLINE -ACE_FILE_Connector::ACE_FILE_Connector (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_FILE_Connector::ACE_FILE_Connector"); - if (this->connect (new_io, remote_sap, timeout, local_sap, - reuse_addr, flags, perms) == ACE_IO_SAP::INVALID_HANDLE - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("address %s, %p\n"), - remote_sap.get_path_name (), - ACE_TEXT ("ACE_FILE_IO"))); -} - -ASYS_INLINE int -ACE_FILE_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_UNUSED_ARG (handle); - // Nothing to do here since the handle is not a socket - return 0; -} diff --git a/ace/FILE_IO.cpp b/ace/FILE_IO.cpp deleted file mode 100644 index 14dcb6d2fed..00000000000 --- a/ace/FILE_IO.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// FILE_IO.cpp -// $Id$ - -#include "ace/FILE_IO.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FILE_IO.i" -#endif - -ACE_RCSID(ace, FILE_IO, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE_IO) - -void -ACE_FILE_IO::dump (void) const -{ - ACE_TRACE ("ACE_FILE_IO::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->addr_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// Simple-minded do nothing constructor. - -ACE_FILE_IO::ACE_FILE_IO (void) -{ - ACE_TRACE ("ACE_FILE_IO::ACE_FILE_IO"); -} - -// Send N char *ptrs and int lengths. Note that the char *'s precede -// the ints (basically, an varargs version of writev). The count N is -// the *total* number of trailing arguments, *not* a couple of the -// number of tuple pairs! - -ssize_t -ACE_FILE_IO::send (size_t n, ...) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::writev (this->get_handle (), - iovp, - total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// This is basically an interface to ACE_OS::readv, that doesn't use -// the struct iovec explicitly. The ... can be passed as an arbitrary -// number of (char *ptr, int len) tuples. However, the count N is the -// *total* number of trailing arguments, *not* a couple of the number -// of tuple pairs! - -ssize_t -ACE_FILE_IO::recv (size_t n, ...) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::readv (this->get_handle (), - iovp, - total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// Allows a client to read from a file without having to provide a -// buffer to read. This method determines how much data is in the -// file, allocates a buffer of this size, reads in the data, and -// returns the number of bytes read. - -ssize_t -ACE_FILE_IO::recvv (iovec *io_vec) -{ - ACE_TRACE ("ACE_FILE_IO::recvv"); - - io_vec->iov_base = 0; - long length = ACE_OS::filesize (this->get_handle ()); - - if (length > 0) - { - ACE_NEW_RETURN (io_vec->iov_base, - char[length], - -1); - io_vec->iov_len = this->recv_n (io_vec->iov_base, - length); - return io_vec->iov_len; - } - else - return length; -} diff --git a/ace/FILE_IO.h b/ace/FILE_IO.h deleted file mode 100644 index a1458ad3aa0..00000000000 --- a/ace/FILE_IO.h +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// FILE_IO.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_FILE_IO_H -#define ACE_FILE_IO_H -#include "ace/pre.h" - -#include "ace/FILE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/FILE_Addr.h" - -class ACE_Export ACE_FILE_IO : public ACE_FILE -{ - // = TITLE - // Read/Write operations on Files -public: - friend class ACE_FILE_Connector; - - // = Initialization method. - ACE_FILE_IO (void); - // Default constructor. - - ssize_t send (const void *buf, size_t n) const; - // send upto bytes in . - - ssize_t recv (void *buf, size_t n) const; - // Recv upto bytes in . - - ssize_t send_n (const void *buf, size_t n) const; - // Send n bytes, keep trying until n are sent. - - ssize_t recv_n (void *buf, size_t n) const; - // Recv n bytes, keep trying until n are received. - -#if defined (ACE_HAS_STREAM_PIPES) - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int flags = 0) const; - // Send bytes via STREAM pipes. - - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *flags) const; - // Recv bytes via STREAM pipes. - - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int band, - int flags) const; - // Send bytes via STREAM pipes using "band" mode. - - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *band, - int *flags) const; - // Recv bytes via STREAM pipes using "band" mode. - -#endif /* ACE_HAS_STREAM_PIPES */ - - ssize_t send (const iovec iov[], size_t n) const; - // Send iovecs via <::writev>. - - ssize_t recv (iovec iov[], size_t n) const; - // Recv iovecs via <::readv>. - - ssize_t send (size_t n, ...) const; - // Send N char *ptrs and int lengths. Note that the char *'s - // precede the ints (basically, an varargs version of writev). The - // count N is the *total* number of trailing arguments, *not* a - // couple of the number of tuple pairs! - - ssize_t recv (size_t n, ...) const; - // This is an interface to ::readv, that doesn't use the struct - // iovec explicitly. The ... can be passed as an arbitrary number - // of (char *ptr, int len) tuples. However, the count N is the - // *total* number of trailing arguments, *not* a couple of the - // number of tuple pairs! - - ssize_t send (const void *buf, - size_t n, - ACE_OVERLAPPED *overlapped) const; - // Send bytes via Win32 WriteFile using overlapped I/O. - - ssize_t recv (void *buf, - size_t n, - ACE_OVERLAPPED *overlapped) const; - // Recv bytes via Win32 ReadFile using overlapped I/O. - - ssize_t sendv (const iovec iov[], - size_t n) const; - // Send an of size to the file. - - ssize_t recvv (iovec *io_vec); - // Allows a client to read from a file without having to provide a - // buffer to read. This method determines how much data is in the - // file, allocates a buffer of this size, reads in the data, and - // returns the number of bytes read. The caller is responsible for - // deleting the member in the field of using - // delete [] io_vec->iov_base. - - ssize_t sendv_n (const iovec iov[], - size_t n) const; - // Send an of size to the file. Will block until all - // bytes are sent or an error occurs. - - ssize_t recvv_n (iovec iov[], - size_t n) const; - // Receive an of size to the file. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - // = Meta-type info - typedef ACE_FILE_Addr PEER_ADDR; -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FILE_IO.i" -#endif - -#include "ace/post.h" -#endif /* ACE_FILE_IO_H */ diff --git a/ace/FILE_IO.i b/ace/FILE_IO.i deleted file mode 100644 index ab5956c468c..00000000000 --- a/ace/FILE_IO.i +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// FILE_IO.i - -ASYS_INLINE ssize_t -ACE_FILE_IO::sendv_n (const iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::sendv_n"); - return ACE::writev_n (this->get_handle (), - iov, - n); -} - -// Recv an n byte message from the file. - -ASYS_INLINE ssize_t -ACE_FILE_IO::recvv_n (iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::recvv_n"); - // @@ Carlos, can you please update this to call the - // new ACE::recvv_n() method that you write? - return ACE_OS::readv (this->get_handle (), - iov, - n); -} - -// Send an of size to the file. - -ASYS_INLINE ssize_t -ACE_FILE_IO::sendv (const iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::sendv"); - return ACE_OS::writev (this->get_handle (), iov, n); -} - -// Send exactly N bytes from BUF to this file. Keeping trying until -// this many bytes are sent. - -ASYS_INLINE ssize_t -ACE_FILE_IO::send_n (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::send_n"); - return ACE::write_n (this->get_handle (), buf, n); -} - -// Receive exactly N bytes from this file into BUF. Keep trying until -// this many bytes are received. - -ASYS_INLINE ssize_t -ACE_FILE_IO::recv_n (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::recv_n"); - return ACE::read_n (this->get_handle (), buf, n); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::send (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::write (this->get_handle (), (const char *) buf, n); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::recv (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, n); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::send (const iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::writev (this->get_handle (), iov, n); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::recv (iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::readv (this->get_handle (), iov, n); -} - -#if defined (ACE_HAS_STREAM_PIPES) -ASYS_INLINE ssize_t -ACE_FILE_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::send (const void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - return ACE_OS::write (this->get_handle (), - (const char *) buf, n, - overlapped); -} - -ASYS_INLINE ssize_t -ACE_FILE_IO::recv (void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, n, - overlapped); -} - -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/ace/Filecache.cpp b/ace/Filecache.cpp deleted file mode 100644 index 1a0c37cdcb0..00000000000 --- a/ace/Filecache.cpp +++ /dev/null @@ -1,773 +0,0 @@ -// $Id$ - -#include "ace/Filecache.h" -#include "ace/Object_Manager.h" - -ACE_RCSID(ace, Filecache, "$Id$") - -#if defined (__BORLANDC__) //VSB -// Third parameter will be ignored in ACE_OS::open -static const int R_MASK = 0; -static const int W_MASK = 0; -#else -static const int R_MASK = S_IRUSR|S_IRGRP|S_IROTH; -static const int W_MASK = S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR|S_IWGRP|S_IWOTH; -#endif /* __BORLANDC__ */ - -#if defined (ACE_WIN32) -// See if you can get rid of some of these. -static const int READ_FLAGS = (FILE_FLAG_SEQUENTIAL_SCAN | - FILE_FLAG_OVERLAPPED | - O_RDONLY); -// static const int RCOPY_FLAGS = (FILE_FLAG_SEQUENTIAL_SCAN | -// O_RDONLY); -static const int WRITE_FLAGS = (FILE_FLAG_SEQUENTIAL_SCAN | - FILE_FLAG_OVERLAPPED | - O_RDWR | O_CREAT | O_TRUNC); -// static const int WCOPY_FLAGS = (FILE_FLAG_SEQUENTIAL_SCAN | -// O_RDWR | O_CREAT | O_TRUNC); -#else -static const int READ_FLAGS = O_RDONLY; -// static const int RCOPY_FLAGS = O_RDONLY; -static const int WRITE_FLAGS = O_RDWR | O_CREAT | O_TRUNC; -// static const int WCOPY_FLAGS = O_RDWR | O_CREAT | O_TRUNC; -#endif /* ACE_WIN32 */ - -// static data members -ACE_Filecache *ACE_Filecache::cvf_ = 0; - -void -ACE_Filecache_Handle::init (void) -{ - this->file_ = 0; - this->handle_ = ACE_INVALID_HANDLE; -} - -ACE_Filecache_Handle::ACE_Filecache_Handle (void) - : file_ (0), handle_ (0), mapit_ (0) -{ - this->init (); -} - -ACE_Filecache_Handle::ACE_Filecache_Handle (const ACE_TCHAR *filename, - ACE_Filecache_Flag mapit) - : file_ (0), handle_ (0), mapit_ (mapit) -{ - this->init (); - // Fetch the file from the Virtual_Filesystem let the - // Virtual_Filesystem do the work of cache coherency. - - // Filecache will also do the acquire, since it holds the lock at - // that time. - this->file_ = ACE_Filecache::instance ()->fetch (filename, mapit); -} - -ACE_Filecache_Handle::ACE_Filecache_Handle (const ACE_TCHAR *filename, - int size, - ACE_Filecache_Flag mapit) - : file_ (0), handle_ (0), mapit_ (mapit) -{ - this->init (); - - if (size == 0) - ACE_Filecache::instance ()->remove (filename); - else - { - // Since this is being opened for a write, simply create a new - // ACE_Filecache_Object now, and let the destructor add it into CVF - // later - - // Filecache will also do the acquire, since it holds the lock at - // that time. - this->file_ = ACE_Filecache::instance ()->create (filename, size); - } -} - -ACE_Filecache_Handle::~ACE_Filecache_Handle (void) -{ - if (this->handle_ != ACE_INVALID_HANDLE) - // this was dup ()'d - ACE_OS::close (this->handle_); - - ACE_Filecache::instance ()->finish (this->file_); -} - -void * -ACE_Filecache_Handle::address (void) const -{ - return this->file_ == 0 ? 0 : this->file_->address (); -} - -ACE_HANDLE -ACE_Filecache_Handle::handle (void) const -{ - if (this->handle_ == ACE_INVALID_HANDLE && this->file_ != 0) - { - ACE_Filecache_Handle *mutable_this = - (ACE_Filecache_Handle *) this; - mutable_this->handle_ = ACE_OS::dup (this->file_->handle ()); - } - return this->handle_; -} - -int -ACE_Filecache_Handle::error (void) const -{ - if (this->file_ == 0) - return -1; - else - return this->file_->error (); -} - -size_t -ACE_Filecache_Handle::size (void) const -{ - if (this->file_ == 0) - return (size_t) -1; - else - return this->file_->size (); -} - -// ------------------ -// ACE_Filecache_Hash -// ------------------ - -#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) - -#define ACE_Filecache_Hash \ - ACE_Hash_Map_Manager -#define ACE_Filecache_Hash_Entry \ - ACE_Hash_Map_Entry - -ACE_TEMPLATE_SPECIALIZATION -ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (const ACE_TCHAR *const &ext_id, - ACE_Filecache_Object *const &int_id, - ACE_Filecache_Hash_Entry *next, - ACE_Filecache_Hash_Entry *prev) - : ext_id_ (ext_id ? ACE_OS::strdup (ext_id) : ACE_OS::strdup (ACE_TEXT (""))), - int_id_ (int_id), - next_ (next), - prev_ (prev) -{ -} - -ACE_TEMPLATE_SPECIALIZATION -ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (ACE_Filecache_Hash_Entry *next, - ACE_Filecache_Hash_Entry *prev) - : ext_id_ (0), - next_ (next), - prev_ (prev) -{ -} - -ACE_TEMPLATE_SPECIALIZATION -ACE_Filecache_Hash_Entry::~ACE_Hash_Map_Entry (void) -{ - ACE_OS::free ((void *) ext_id_); -} - -// We need these template specializations since KEY is defined as a -// ACE_TCHAR*, which doesn't have a hash() or equal() method defined on it. - -ACE_TEMPLATE_SPECIALIZATION -unsigned long -ACE_Filecache_Hash::hash (const ACE_TCHAR *const &ext_id) -{ - return ACE::hash_pjw (ext_id); -} - -ACE_TEMPLATE_SPECIALIZATION -int -ACE_Filecache_Hash::equal (const ACE_TCHAR *const &id1, const ACE_TCHAR *const &id2) -{ - return ACE_OS::strcmp (id1, id2) == 0; -} - -#undef ACE_Filecache_Hash -#undef ACE_Filecache_Hash_Entry - -#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ - - -// ------------- -// ACE_Filecache -// ------------- - -ACE_Filecache * -ACE_Filecache::instance (void) -{ - // Double check locking pattern. - if (ACE_Filecache::cvf_ == 0) - { - ACE_SYNCH_RW_MUTEX &lock = - *ACE_Managed_Object::get_preallocated_object - (ACE_Object_Manager::ACE_FILECACHE_LOCK); - ACE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, ace_mon, lock, 0); - - // @@ James, please check each of the ACE_NEW_RETURN calls to - // make sure that it is safe to return if allocation fails. - if (ACE_Filecache::cvf_ == 0) - ACE_NEW_RETURN (ACE_Filecache::cvf_, - ACE_Filecache, - 0); - } - - return ACE_Filecache::cvf_; -} - -ACE_Filecache::ACE_Filecache (void) - : size_ (ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE), - hash_ (this->size_) -{ -} - -ACE_Filecache::~ACE_Filecache (void) -{ -} - -ACE_Filecache_Object * -ACE_Filecache::insert_i (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &filelock, - int mapit) -{ - ACE_Filecache_Object *handle = 0; - - if (this->hash_.find (filename, handle) == -1) - { - ACE_NEW_RETURN (handle, - ACE_Filecache_Object (filename, filelock, 0, mapit), - 0); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (%t) CVF: creating %s\n"), filename)); - - if (this->hash_.bind (filename, handle) == -1) - { - delete handle; - handle = 0; - } - } - else - handle = 0; - - return handle; -} - -ACE_Filecache_Object * -ACE_Filecache::remove_i (const ACE_TCHAR *filename) -{ - ACE_Filecache_Object *handle = 0; - - // Disassociate file from the cache. - if (this->hash_.unbind (filename, handle) == 0) - { - handle->stale_ = 1; - - // Try a lock. If it succeds, we can delete it now. - // Otherwise, it will clean itself up later. - if (handle->lock_.tryacquire_write () == 0) - { - delete handle; - handle = 0; - } - } - else - handle = 0; - - return handle; -} - -ACE_Filecache_Object * -ACE_Filecache::update_i (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &filelock, - int mapit) -{ - ACE_Filecache_Object *handle = 0; - - handle = this->remove_i (filename); - handle = this->insert_i (filename, filelock, mapit); - - return handle; -} - -int -ACE_Filecache::find (const ACE_TCHAR *filename) -{ - return this->hash_.find (filename); -} - - -ACE_Filecache_Object * -ACE_Filecache::remove (const ACE_TCHAR *filename) -{ - ACE_Filecache_Object *handle = 0; - - u_long loc = ACE::hash_pjw (filename) % this->size_; - ACE_SYNCH_RW_MUTEX &hashlock = this->hash_lock_[loc]; - // ACE_SYNCH_RW_MUTEX &filelock = this->file_lock_[loc]; - - if (this->hash_.find (filename, handle) != -1) - { - ACE_WRITE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, - ace_mon, - hashlock, - 0); - - return this->remove_i (filename); - } - - return 0; -} - - -ACE_Filecache_Object * -ACE_Filecache::fetch (const ACE_TCHAR *filename, int mapit) -{ - ACE_Filecache_Object *handle = 0; - - u_long loc = ACE::hash_pjw (filename) % this->size_; - ACE_SYNCH_RW_MUTEX &hashlock = this->hash_lock_[loc]; - ACE_SYNCH_RW_MUTEX &filelock = this->file_lock_[loc]; - - filelock.acquire_read (); - - if (this->hash_.find (filename, handle) == -1) - { - ACE_WRITE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, - ace_mon, - hashlock, - 0); - - // Second check in the method call - handle = this->insert_i (filename, filelock, mapit); - - if (handle == 0) - filelock.release (); - } - else - { - if (handle->update ()) - { - { - // Double check locking pattern - ACE_WRITE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, - ace_mon, - hashlock, - 0); - - // Second check in the method call - handle = this->update_i (filename, filelock, mapit); - - if (handle == 0) - filelock.release (); - } - } - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (%t) CVF: found %s\n"), filename)); - } - - return handle; -} - -ACE_Filecache_Object * -ACE_Filecache::create (const ACE_TCHAR *filename, int size) -{ - ACE_Filecache_Object *handle = 0; - - u_long loc = ACE::hash_pjw (filename) % this->size_; - ACE_SYNCH_RW_MUTEX &filelock = this->file_lock_[loc]; - - ACE_NEW_RETURN (handle, - ACE_Filecache_Object (filename, size, filelock), - 0); - handle->acquire (); - - return handle; -} - -ACE_Filecache_Object * -ACE_Filecache::finish (ACE_Filecache_Object *&file) -{ - if (file == 0) - return file; - - u_long loc = ACE::hash_pjw (file->filename_) % this->size_; - ACE_SYNCH_RW_MUTEX &hashlock = this->hash_lock_[loc]; - - if (file != 0) - switch (file->action_) - { - case ACE_Filecache_Object::ACE_WRITING: - { - ACE_WRITE_GUARD_RETURN (ACE_SYNCH_RW_MUTEX, - ace_mon, - hashlock, - 0); - - file->release (); - - this->remove_i (file->filename_); -#if 0 - int result = this->hash_.bind (file->filename (), file); - - if (result == 0) - file->acquire (); -#else - // Last one using a stale file is resposible for deleting it. - if (file->stale_) - { - // Try a lock. If it succeds, we can delete it now. - // Otherwise, it will clean itself up later. - if (file->lock_.tryacquire_write () == 0) - { - delete file; - file = 0; - } - } -#endif - } - - break; - default: - file->release (); - - // Last one using a stale file is resposible for deleting it. - if (file->stale_) - { - // Try a lock. If it succeds, we can delete it now. - // Otherwise, it will clean itself up later. - if (file->lock_.tryacquire_write () == 0) - { - delete file; - file = 0; - } - } - - break; - } - - return file; -} - -void -ACE_Filecache_Object::init (void) -{ - this->filename_[0] = '\0'; - this->handle_ = ACE_INVALID_HANDLE; - this->error_ = ACE_SUCCESS; - this->tempname_ = 0; - this->size_ = 0; - - ACE_OS::memset (&(this->stat_), 0, sizeof (this->stat_)); -} - -ACE_Filecache_Object::ACE_Filecache_Object (void) - : tempname_ (0), - mmap_ (), - handle_ (0), - // stat_ (), - size_ (0), - action_ (0), - error_ (0), - stale_ (0), - // sa_ (), - junklock_ (), - lock_ (junklock_) -{ - this->init (); -} - -ACE_Filecache_Object::ACE_Filecache_Object (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &lock, - LPSECURITY_ATTRIBUTES sa, - int mapit) - : tempname_ (0), - mmap_ (), - handle_ (0), - // stat_ (), - size_ (0), - action_ (0), - error_ (0), - stale_ (0), - sa_ (sa), - junklock_ (), - lock_ (lock) -{ - this->init (); - - // ASSERT strlen(filename) < sizeof (this->filename_) - ACE_OS::strcpy (this->filename_, filename); - this->action_ = ACE_Filecache_Object::ACE_READING; - // place ourselves into the READING state - - // Can we access the file? - if (ACE_OS::access (this->filename_, R_OK) == -1) - { - this->error_i (ACE_Filecache_Object::ACE_ACCESS_FAILED); - return; - } - - // Can we stat the file? - if (ACE_OS::stat (this->filename_, &this->stat_) == -1) - { - this->error_i (ACE_Filecache_Object::ACE_STAT_FAILED); - return; - } - - this->size_ = this->stat_.st_size; - this->tempname_ = this->filename_; - - // Can we open the file? - this->handle_ = ACE_OS::open (this->tempname_, - READ_FLAGS, R_MASK, this->sa_); - if (this->handle_ == ACE_INVALID_HANDLE) - { - this->error_i (ACE_Filecache_Object::ACE_OPEN_FAILED, - ACE_TEXT ("ACE_Filecache_Object::ctor: open")); - return; - } - - if (mapit) - { - // Can we map the file? - if (this->mmap_.map (this->handle_, -1, - PROT_READ, ACE_MAP_PRIVATE, 0, 0, this->sa_) != 0) - { - this->error_i (ACE_Filecache_Object::ACE_MEMMAP_FAILED, - ACE_TEXT ("ACE_Filecache_Object::ctor: map")); - ACE_OS::close (this->handle_); - this->handle_ = ACE_INVALID_HANDLE; - return; - } - } - - // Ok, finished! - this->action_ = ACE_Filecache_Object::ACE_READING; -} - -ACE_Filecache_Object::ACE_Filecache_Object (const ACE_TCHAR *filename, - int size, - ACE_SYNCH_RW_MUTEX &lock, - LPSECURITY_ATTRIBUTES sa) - : stale_ (0), - sa_ (sa), - lock_ (lock) -{ - this->init (); - - this->size_ = size; - ACE_OS::strcpy (this->filename_, filename); - this->action_ = ACE_Filecache_Object::ACE_WRITING; - - // Can we access the file? - if (ACE_OS::access (this->filename_, R_OK|W_OK) == -1 - // Does it exist? - && ACE_OS::access (this->filename_, F_OK) != -1) - { - // File exists, but we cannot access it. - this->error_i (ACE_Filecache_Object::ACE_ACCESS_FAILED); - return; - } - - this->tempname_ = this->filename_; - - // Can we open the file? - this->handle_ = ACE_OS::open (this->tempname_, WRITE_FLAGS, W_MASK, this->sa_); - if (this->handle_ == ACE_INVALID_HANDLE) - { - this->error_i (ACE_Filecache_Object::ACE_OPEN_FAILED, - ACE_TEXT ("ACE_Filecache_Object::acquire: open")); - return; - } - - // Can we write? - if (ACE_OS::pwrite (this->handle_, "", 1, this->size_ - 1) != 1) - { - this->error_i (ACE_Filecache_Object::ACE_WRITE_FAILED, - ACE_TEXT ("ACE_Filecache_Object::acquire: write")); - ACE_OS::close (this->handle_); - return; - } - - // Can we map? - if (this->mmap_.map (this->handle_, this->size_, PROT_RDWR, MAP_SHARED, - 0, 0, this->sa_) != 0) - { - this->error_i (ACE_Filecache_Object::ACE_MEMMAP_FAILED, - ACE_TEXT ("ACE_Filecache_Object::acquire: map")); - ACE_OS::close (this->handle_); - } - - // Ok, done! -} - -ACE_Filecache_Object::~ACE_Filecache_Object (void) -{ - if (this->error_ == ACE_SUCCESS) - { - this->mmap_.unmap (); - ACE_OS::close (this->handle_); - this->handle_ = ACE_INVALID_HANDLE; - } -} - -int -ACE_Filecache_Object::acquire (void) -{ - return this->lock_.tryacquire_read (); -} - -int -ACE_Filecache_Object::release (void) -{ - if (this->action_ == ACE_WRITING) - { - // We are safe since only one thread has a writable Filecache_Object - -#if 0 - ACE_HANDLE original = ACE_OS::open (this->filename_, WRITE_FLAGS, W_MASK, - this->sa_); - if (original == ACE_INVALID_HANDLE) - this->error_ = ACE_Filecache_Object::ACE_OPEN_FAILED; - else if (ACE_OS::write (original, this->mmap_.addr (), - this->size_) == -1) - { - this->error_ = ACE_Filecache_Object::ACE_WRITE_FAILED; - ACE_OS::close (original); - ACE_OS::unlink (this->filename_); - } - else if (ACE_OS::stat (this->filename_, &this->stat_) == -1) - this->error_ = ACE_Filecache_Object::ACE_STAT_FAILED; -#endif - - this->mmap_.unmap (); - ACE_OS::close (this->handle_); - this->handle_ = ACE_INVALID_HANDLE; - -#if 0 - // Leave the file in an acquirable state. - this->handle_ = ACE_OS::open (this->tempname_, READ_FLAGS, R_MASK); - if (this->handle_ == ACE_INVALID_HANDLE) - { - this->error_i (ACE_Filecache_Object::ACE_OPEN_FAILED, - "ACE_Filecache_Object::acquire: open"); - } - else if (this->mmap_.map (this->handle_, -1, - PROT_READ, - ACE_MAP_PRIVATE, - 0, - 0, - this->sa_) != 0) - { - this->error_i (ACE_Filecache_Object::ACE_MEMMAP_FAILED, - "ACE_Filecache_Object::acquire: map"); - ACE_OS::close (this->handle_); - this->handle_ = ACE_INVALID_HANDLE; - } - - this->action_ = ACE_Filecache_Object::ACE_READING; -#endif - } - - return this->lock_.release (); -} - -int -ACE_Filecache_Object::error (void) const -{ - // The existence of the object means a read lock is being held. - return this->error_; -} - -int -ACE_Filecache_Object::error_i (int error_value, const ACE_TCHAR *s) -{ - s = s; - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p.\n"), s)); - this->error_ = error_value; - return error_value; -} - -const ACE_TCHAR * -ACE_Filecache_Object::filename (void) const -{ - // The existence of the object means a read lock is being held. - return this->filename_; -} - -size_t -ACE_Filecache_Object::size (void) const -{ - // The existence of the object means a read lock is being held. - return this->size_; -} - -ACE_HANDLE -ACE_Filecache_Object::handle (void) const -{ - // The existence of the object means a read lock is being held. - return this->handle_; -} - -void * -ACE_Filecache_Object::address (void) const -{ - // The existence of the object means a read lock is being held. - return this->mmap_.addr (); -} - -int -ACE_Filecache_Object::update (void) const -{ - // The existence of the object means a read lock is being held. - int result; - struct stat statbuf; - - if (ACE_OS::stat (this->filename_, &statbuf) == -1) - result = 1; - else - // non-portable code may follow - result = ACE_OS::difftime (this->stat_.st_mtime, statbuf.st_mtime) < 0; - - return result; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) -template class ACE_Hash_Map_Entry; -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Iterator; -template class ACE_Hash_Map_Reverse_Iterator; -template class ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -#else -template class ACE_Hash_Map_Entry; -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Iterator; -template class ACE_Hash_Map_Reverse_Iterator; -template class ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) -#pragma instantiate ACE_Hash_Map_Entry -#pragma instantiate ACE_Hash_Map_Manager -#pragma instantiate ACE_Hash_Map_Iterator -#pragma instantiate ACE_Hash_Map_Reverse_Iterator -#pragma instantiate ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex> -#else -#pragma instantiate ACE_Hash_Map_Entry -#pragma instantiate ACE_Hash_Map_Manager -#pragma instantiate ACE_Hash_Map_Iterator -#pragma instantiate ACE_Hash_Map_Reverse_Iterator -#pragma instantiate ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex> -#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/Filecache.h b/ace/Filecache.h deleted file mode 100644 index 7f636f09795..00000000000 --- a/ace/Filecache.h +++ /dev/null @@ -1,353 +0,0 @@ -/* -*- c++ -*- */ -// Hey, Emacs! This is a C++ file! -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Filecache.h -// -// = AUTHOR -// James Hu -// -// ============================================================================ - -#ifndef ACE_FILECACHE_H -#define ACE_FILECACHE_H -#include "ace/pre.h" - -#include "ace/Mem_Map.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Synch_T.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/SString.h" - -enum ACE_Filecache_Flag -{ - ACE_NOMAP = 0, - ACE_MAPIT = 1 -}; - -class ACE_Filecache_Object; - -class ACE_Export ACE_Filecache_Handle -{ - // = TITLE - // Abstraction over a real file. This is meant to be the entry - // point into the Cached Virtual Filesystem. - // - // = DESCRIPTION - // This is a cached filesystem implementation based loosely on the - // implementation of JAWS_File. The interfaces will be nearly the - // same. The under-the-hood implementation should hopefully be a - // much faster thing. - // - // These will be given their own implementations later. For now, we - // borrow the implementation provided by JAWS. - // - // On creation, the cache is checked, and reference count is - // incremented. On destruction, reference count is decremented. If - // the reference count is 0, the file is removed from the cache. - // - // E.g. 1, - // { - // ACE_Filecache_Handle foo("foo.html"); - // this->peer ().send (foo.address (), foo.size ()); - // } - // - // E.g. 2, - // { - // ACE_Filecache_Handle foo("foo.html"); - // io->transmitfile (foo.handle (), this->peer ().handle ()); - // } - // - // E.g. 3, - // { - // ACE_Filecache_Handle foo("foo.html", content_length); - // this->peer ().recv (foo.address (), content_length); - // } - // - // TODO: - - // (1) Get rid of the useless copying of files when reading. Although - // it does make sure the file you send isn't being changed, it doesn't - // make sure the file is in a sensible state before sending it. - - // Alternative: if the file get's trashed while it is being shipped, let - // the client request the file again. The cache should have an updated - // copy by that point. - - // (2) Use hashing for locating files. This means I need a hastable - // implementation with buckets. - - // (3) Only lock when absolutely necessary. JAWS_Virtual_Filesystem was - // rather conservative, but for some reason it still ran into problems. - // Since this design should be simpler, problems should be easier to spot. - // -public: - - ACE_Filecache_Handle (const ACE_TCHAR *filename, - ACE_Filecache_Flag mapit = ACE_MAPIT); - // Query cache for file, and acquire it. Assumes the file is being - // opened for reading. - - ACE_Filecache_Handle (const ACE_TCHAR *filename, - int size, - ACE_Filecache_Flag mapit = ACE_MAPIT); - // Create new entry, and acquire it. Presence of SIZE assumes the - // file is being opened for writing. If SIZE is zero, assumes the - // file is to be removed from the cache. - - ~ACE_Filecache_Handle (void); - // Closes any open handles, release acquired file. - - void *address (void) const; - // Base address of memory mapped file. - - ACE_HANDLE handle (void) const; - // A handle (e.g., UNIX file descriptor, or NT file handle). - - int error (void) const; - // Any associated error in handle creation and acquisition. - - size_t size (void) const; - // The size of the file. - -protected: - ACE_Filecache_Handle (void); - // Default do nothing constructor. Prevent it from being called. - - void init (void); - // Common initializations for constructors. - -public: - // = These come from ACE_Filecache_Object, which is an internal class. - enum - { - ACE_SUCCESS = 0, - ACE_ACCESS_FAILED, - ACE_OPEN_FAILED, - ACE_COPY_FAILED, - ACE_STAT_FAILED, - ACE_MEMMAP_FAILED, - ACE_WRITE_FAILED - }; - -private: - ACE_Filecache_Object *file_; - // A reference to the low level instance. - - ACE_HANDLE handle_; - // A 'd version of the one from . - - int mapit_; -}; - -#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) -typedef ACE_Hash_Map_Entry - ACE_Filecache_Hash_Entry; - -typedef ACE_Hash_Map_Manager - ACE_Filecache_Hash; -#else -typedef ACE_Hash_Map_Entry - ACE_Filecache_Hash_Entry; - -typedef ACE_Hash_Map_Manager - ACE_Filecache_Hash; -#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ - -class ACE_Export ACE_Filecache -{ - // = TITLE - // A hash table holding the information about entry point into - // the Cached Virtual Filesystem. On insertion, the reference - // count is incremented. On destruction, reference count is - // decremented. -public: - static ACE_Filecache *instance (void); - // Singleton pattern. - - ~ACE_Filecache (void); - - int find (const ACE_TCHAR *filename); - // Returns 0 if the file associated with ``filename'' is in the cache, - // or -1 if not. - - ACE_Filecache_Object *fetch (const ACE_TCHAR *filename, int mapit = 1); - // Return the file associated with ``filename'' if it is in the cache, - // or create if not. - - ACE_Filecache_Object *remove (const ACE_TCHAR *filename); - // Remove the file associated with ``filename'' from the cache. - - ACE_Filecache_Object *create (const ACE_TCHAR *filename, int size); - // Create a new Filecache_Object, returns it. - - ACE_Filecache_Object *finish (ACE_Filecache_Object *&new_file); - // Release an acquired Filecache_Object, returns it again or NULL if it - // was deleted. - -protected: - ACE_Filecache_Object *insert_i (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &filelock, - int mapit); - ACE_Filecache_Object *remove_i (const ACE_TCHAR *filename); - ACE_Filecache_Object *update_i (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &filelock, - int mapit); - -public: - - enum - { - ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE = 512, - // For this stupid implementation, use an array. Someday, use a - // balanced search tree, or real hash table. - - ACE_DEFAULT_VIRTUAL_FILESYSTEM_CACHE_SIZE = 20 - // This determines the highwater mark in megabytes for the cache. - // This will be ignored for now. - }; - -protected: - ACE_Filecache (void); - // Prevent it from being called. - -private: - int size_; - - ACE_Filecache_Hash hash_; - // The hash table - - static ACE_Filecache *cvf_; - // The reference to the instance - - // = Synchronization variables. - ACE_SYNCH_RW_MUTEX hash_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE]; - ACE_SYNCH_RW_MUTEX file_lock_[ACE_DEFAULT_VIRTUAL_FILESYSTEM_TABLE_SIZE]; -}; - -class ACE_Export ACE_Filecache_Object -{ - // = TITLE - // Abstraction over a real file. This is what the Virtual - // Filesystem contains. This class is not intended for general - // consumption. Please consult a physician before attempting to - // use this class. -public: - friend class ACE_Filecache; - - ACE_Filecache_Object (const ACE_TCHAR *filename, - ACE_SYNCH_RW_MUTEX &lock, - LPSECURITY_ATTRIBUTES sa = 0, - int mapit = 1); - // Creates a file for reading. - - ACE_Filecache_Object (const ACE_TCHAR *filename, - int size, - ACE_SYNCH_RW_MUTEX &lock, - LPSECURITY_ATTRIBUTES sa = 0); - // Creates a file for writing. - - ~ACE_Filecache_Object (void); - // Only if reference count is zero should this be called. - - int acquire (void); - // Increment the reference_count_. - - int release (void); - // Decrement the reference_count_. - - // = error_ accessors - int error (void) const; - int error (int error_value, - const ACE_TCHAR *s = ACE_TEXT ("ACE_Filecache_Object")); - - const ACE_TCHAR *filename (void) const; - // filename_ accessor - - ACE_HANDLE handle (void) const; - // handle_ accessor. - - void *address (void) const; - // Base memory address for memory mapped file. - - size_t size (void) const; - // size_ accessor. - - int update (void) const; - // True if file on disk is newer than cached file. - -protected: - ACE_Filecache_Object (void); - // Prevent from being called. - - void init (void); - // Common initialization code, - -private: - int error_i (int error_value, - const ACE_TCHAR *s = ACE_TEXT ("ACE_Filecache_Object")); - // Internal error logging method, no locking. - -public: - - enum Creation_States - { - ACE_READING = 1, - ACE_WRITING = 2 - }; - - enum Error_Conditions - { - ACE_SUCCESS = 0, - ACE_ACCESS_FAILED, - ACE_OPEN_FAILED, - ACE_COPY_FAILED, - ACE_STAT_FAILED, - ACE_MEMMAP_FAILED, - ACE_WRITE_FAILED - }; - -private: - ACE_TCHAR *tempname_; - ACE_TCHAR filename_[MAXPATHLEN + 1]; - // The temporary file name and the real file name. The real file is - // copied into the temporary file for safety reasons. - - ACE_Mem_Map mmap_; - ACE_HANDLE handle_; - // mmap_ holds the memory mapped version of the temporary file. - // handle_ is the descriptor to the temporary file. - - struct stat stat_; - size_t size_; - // Used to compare against the real file to test if an update is needed. - - int action_; - int error_; - // Status indicators. - - int stale_; - // If set to 1, means the object is flagged for removal. - - LPSECURITY_ATTRIBUTES sa_; - // Security attribute object. - - ACE_SYNCH_RW_MUTEX junklock_; - ACE_SYNCH_RW_MUTEX &lock_; - // lock_ provides a bookkeeping mechanism for users of this object. - // junklock_ is the default initializer -}; - - -#include "ace/post.h" -#endif /* ACE_FILECACHE_H */ diff --git a/ace/FlReactor.cpp b/ace/FlReactor.cpp deleted file mode 100644 index 60fcc5ca380..00000000000 --- a/ace/FlReactor.cpp +++ /dev/null @@ -1,331 +0,0 @@ -// $Id$ - -#include "ace/FlReactor.h" -#include "ace/Synch_T.h" - -ACE_RCSID(ace, FlReactor, "$Id$") - -#if defined (ACE_HAS_FL) - -#include - -ACE_ALLOC_HOOK_DEFINE (ACE_FlReactor) - -// Must be called with lock held -ACE_FlReactor::ACE_FlReactor (size_t size, - int restart, - ACE_Sig_Handler *h) - : ACE_Select_Reactor (size, restart, h) -{ - // When the ACE_Select_Reactor is constructed it creates the notify - // pipe and registers it with the register_handler_i() method. The - // FlReactor overloads this method BUT because the - // register_handler_i occurs when constructing the base class - // ACE_Select_Reactor, the ACE_Select_Reactor register_handler_i() - // is called not the FlReactor register_handler_i(). This means - // that the notify pipe is registered with the ACE_Select_Reactor - // event handling code not the FlReactor and so notfications don't - // work. To get around this we simply close and re-opened the - // notification handler in the constructor of the FlReactor. - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - this->notify_handler_->close (); - this->notify_handler_->open (this, 0); -#endif /* ACE_MT_SAFE */ -} - -ACE_FlReactor::~ACE_FlReactor (void) -{ -} - -// This is just the from ace/Reactor.cpp -// but we use the Fl functions to wait for an event, not , just use the Fl mechanism - // to wait for one or more events... - - // Wait for something to happen. - double t = 0; - if (max_wait_time != 0) - t = max_wait_time->sec () + max_wait_time->usec () / 1000000.0F; - - while (t > 0) { - t = Fl::wait (t); - } - - // Reset the width, in case it changed during the upcalls. - width = this->handler_rep_.max_handlep1 (); - - // Now actually read the result needed by the - // using . - -#if defined (ACE_HAS_WINCE) - ~ACE_Handle_Set (void); - // Default dtor. -#endif /* ACE_HAS_WINCE */ - - // = Methods for manipulating bitsets. - void reset (void); - // Initialize the bitmask to all 0s and reset the associated fields. - - int is_set (ACE_HANDLE handle) const; - // Checks whether is enabled. No range checking is - // performed so must be less than - // . - - void set_bit (ACE_HANDLE handle); - // Enables the . No range checking is performed so - // must be less than . - - void clr_bit (ACE_HANDLE handle); - // Disables the . No range checking is performed so - // must be less than . - - int num_set (void) const; - // Returns a count of the number of enabled bits. - - ACE_HANDLE max_set (void) const; - // Returns the number of the large bit. - - void sync (ACE_HANDLE max); - // Rescan the underlying up to handle to find the new - // (highest bit set) and (how many bits set) values. - // This is useful for evaluating the changes after the handle set has - // been manipulated in some way other than member functions; for example, - // after , , or . - // makes the use of these mechanisms portable - // across OS platforms, -public: - // = Useful constants. - - static const ACE_Time_Value zero; - // Constant "0". - - static const ACE_Time_Value max_time; - // Constant for maximum time representable. Note that this time is - // not intended for use with . - return ACE_OS::select(width, - wait_set.rd_mask_, - wait_set.wr_mask_, - wait_set.ex_mask_, - (ACE_Time_Value *) &ACE_Time_Value::zero); -} - -int -ACE_QtReactor::register_handler_i (ACE_HANDLE handle , - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_QtReactor::register_handler_i"); - - int result; - if ((result = ACE_Select_Reactor::register_handler_i(handle, - handler, - mask )) - == -1) - return -1; - - if (ACE_BIT_ENABLED(mask, ACE_Event_Handler::READ_MASK) || - ACE_BIT_ENABLED( mask, ACE_Event_Handler::ACCEPT_MASK)) - { - // We check for any unused handles. - MAP::ITERATOR read_iter = this->read_notifier_.end (); - QSocketNotifier *qsock_read_notifier = 0; - - // We check whether we have a data against the present - // handle. If so we need to unbind the data. - if ((this->read_notifier_.find (handle, - qsock_read_notifier) != -1)) - { - if (qsock_read_notifier != (*read_iter).int_id_) - { - this->read_notifier_.unbind (handle, - qsock_read_notifier); - delete qsock_read_notifier; - } - } - - ACE_NEW_RETURN (qsock_read_notifier, - QSocketNotifier (handle, QSocketNotifier::Read), - -1); - - this->read_notifier_.bind (handle, - qsock_read_notifier); - - QObject::connect (qsock_read_notifier, - SIGNAL (activated (int)), - this, - SLOT (read_event (int))) ; - } - - if (ACE_BIT_ENABLED( mask, ACE_Event_Handler::WRITE_MASK) || - ACE_BIT_ENABLED( mask, ACE_Event_Handler::ACCEPT_MASK) || - ACE_BIT_ENABLED( mask, ACE_Event_Handler::CONNECT_MASK)) - { - // We check for any unused handles. - MAP::ITERATOR write_iter = this->write_notifier_.end (); - QSocketNotifier *qsock_write_notifier = 0; - - // We check whether we have a data against the present - // handle. If so we need to unbind the data. - if ((this->write_notifier_.find (handle, - qsock_write_notifier) != -1)) - { - if (qsock_write_notifier != (*write_iter).int_id_) - { - this->write_notifier_.unbind (handle, - qsock_write_notifier); - delete qsock_write_notifier; - } - } - - ACE_NEW_RETURN (qsock_write_notifier, - QSocketNotifier (handle, QSocketNotifier::Write), - -1); - - this->write_notifier_.bind (handle, - qsock_write_notifier); - - QObject::connect (qsock_write_notifier, - SIGNAL (activated (int)), - this, - SLOT (write_event (int))); - } - - if (ACE_BIT_ENABLED( mask, - ACE_Event_Handler::EXCEPT_MASK)) - { - // We check for any unused handles. - MAP::ITERATOR excpt_iter = this->exception_notifier_.end (); - QSocketNotifier *qsock_excpt_notifier = 0; - - // We check whether we have a data against the present - // handle. If so we need to unbind the data. - if ((this->exception_notifier_.find (handle, - qsock_excpt_notifier) != -1)) - { - if (qsock_excpt_notifier != (*excpt_iter).int_id_) - { - this->exception_notifier_.unbind (handle, - qsock_excpt_notifier); - delete qsock_excpt_notifier; - } - } - - ACE_NEW_RETURN (qsock_excpt_notifier, - QSocketNotifier (handle, QSocketNotifier::Exception), - -1); - - this->exception_notifier_.bind (handle, - qsock_excpt_notifier); - - QObject::connect (qsock_excpt_notifier, - SIGNAL (activated (int)), - this, - SLOT (exception_event (int))) ; - } - - return 0; -} - -int -ACE_QtReactor::register_handler_i (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - return ACE_Select_Reactor::register_handler_i(handles, - handler, - mask); -} - -int ACE_QtReactor::remove_handler_i (ACE_HANDLE handle , - ACE_Reactor_Mask mask ) -{ - ACE_TRACE ("ACE_XtReactor::remove_handler_i"); - - QSocketNotifier *qsock_notifier = 0; - - // Looks for the handle in the maps and removes them. - MAP::ITERATOR iter = this->read_notifier_.end (); - - if ((this->read_notifier_.find (handle, - qsock_notifier) != -1)) - { - this->read_notifier_.unbind (handle, - qsock_notifier); - delete qsock_notifier; - } - - iter = this->write_notifier_.end (); - if ((this->write_notifier_.find (handle, - qsock_notifier) != -1)) - { - this->write_notifier_.unbind (handle, - qsock_notifier); - delete qsock_notifier; - } - - iter = this->exception_notifier_.end (); - if ((this->exception_notifier_.find (handle, - qsock_notifier) != -1)) - { - this->exception_notifier_.unbind (handle, - qsock_notifier); - delete qsock_notifier; - } - - // Now let the reactor do its work. - return ACE_Select_Reactor::remove_handler_i (handle, mask); -} - - -int -ACE_QtReactor::remove_handler_i (const ACE_Handle_Set &handles, - ACE_Reactor_Mask mask) -{ - return ACE_Select_Reactor::remove_handler_i (handles, - mask); -} - -// The following functions ensure that there is an Qt timeout for the -// first timeout in the Reactor's Timer_Queue. - -void -ACE_QtReactor::reset_timeout (void) -{ - if (this->qtime_ != 0) - { - delete this->qtime_; - this->qtime_ = 0; - } - - ACE_Time_Value *max_wait_time = - this->timer_queue_->calculate_timeout (0) ; - - if (max_wait_time) - { - ACE_NEW (this->qtime_, - QTimer); - - QObject::connect (qtime_, - SIGNAL (timeout ()), - this, - SLOT (timeout_event ())); - - qtime_->start(max_wait_time->msec(), 1); - } - -} - - -long -ACE_QtReactor::schedule_timer (ACE_Event_Handler *handler, - const void *arg, - const ACE_Time_Value &delta_time, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_XtReactor::schedule_timer"); - ACE_MT (ACE_GUARD_RETURN (ACE_Select_Reactor_Token, - ace_mon, - this->token_, - -1)); - - long result; - if ((result = ACE_Select_Reactor::schedule_timer(handler, - arg, - delta_time, - interval)) == -1 ) - return -1; - else - { - this->reset_timeout (); - return result; - } -} - -int -ACE_QtReactor::cancel_timer (ACE_Event_Handler *handler, - int dont_call_handle_close) -{ - ACE_TRACE ("ACE_XtReactor::cancel_timer"); - - if (ACE_Select_Reactor::cancel_timer (handler, - dont_call_handle_close ) == -1 ) - return -1 ; - else - { - this->reset_timeout( ) ; - return 0 ; - } -} - -int ACE_QtReactor::cancel_timer (long timer_id, - const void **arg, - int dont_call_handle_close ) -{ - ACE_TRACE( "ACE_XtReactor::cancel_timer" ) ; - - if (ACE_Select_Reactor::cancel_timer (timer_id, - arg, - dont_call_handle_close ) == -1 ) - return -1 ; - else - { - this->reset_timeout( ) ; - return 0 ; - } -} - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Map_Entry; -template class ACE_Map_Manager; -template class ACE_Map_Iterator_Base; -template class ACE_Map_Iterator; -template class ACE_Map_Reverse_Iterator; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Map_Entry -#pragma instantiate ACE_Map_Manager -#pragma instantiate ACE_Map_Iterator_Base -#pragma instantiate ACE_Map_Iterator -#pragma instantiate ACE_Map_Reverse_Iterator -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /*ACE_HAS_QT */ diff --git a/ace/QtReactor.h b/ace/QtReactor.h deleted file mode 100644 index e2afc998db0..00000000000 --- a/ace/QtReactor.h +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// QtReactor.h -// -// = AUTHOR -// Hamish Friedlander -// integrated in to ACE by Balachandran Natarajan -// ============================================================================ -#ifndef ACE_QTREACTOR_H -#define ACE_QTREACTOR_H -#include "ace/pre.h" - - -#include "ace/Select_Reactor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_QT) -#include "ace/Map_Manager.h" - -// Qttoolkit specific includes. -#include -#include -#include -#include - -class ACE_Export ACE_QtReactor : public QObject, public ACE_Select_Reactor -{ - // = TITLE - // An object-oriented event demultiplexor and event handler - // dispatcher that uses the Qt Library. This class declaration - // also uses the extnsion facilities provided by the Qt. So, - // readers of the class declaration should not be upset with - // the appearence of the Keywords like Q_OBJECT, private slots - // etc. They are specific to Qt which uses these as a call back - // methods implementation mechanism. - - Q_OBJECT - - public: - // = Initialization and termination methods. - ACE_QtReactor (QApplication *qapp = NULL, - size_t size = DEFAULT_SIZE, - int restart = 0, - ACE_Sig_Handler *handler = 0); - - virtual ~ACE_QtReactor (void); - - void qapplication (QApplication *qapp); - - // = Timer operations. - virtual long schedule_timer (ACE_Event_Handler *handler, - const void *arg, - const ACE_Time_Value &delta_time, - const ACE_Time_Value &interval); - - virtual int cancel_timer (ACE_Event_Handler *handler, - int dont_call_handle_close = 1); - - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1); - - protected: - - // = Register timers/handles with Qt - - virtual int register_handler_i (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - // Register a single . - - virtual int register_handler_i (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - // Register a set of with Qt. - - - virtual int remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - // Remove the associated with this . - - virtual int remove_handler_i (const ACE_Handle_Set &handles, - ACE_Reactor_Mask mask); - // Remove a set of . - - virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &handle_set, - ACE_Time_Value *max_wait_time); - // Wait for events to occur. - - virtual int QtWaitForMultipleEvents (int width, - ACE_Select_Reactor_Handle_Set &wait_set, - ACE_Time_Value *max_wait_time); - - // Wait for Qt events to occur - - QApplication *qapp_ ; - // Some Qt stuff that we need to have - - typedef ACE_Map_Manager MAP; - // Typedef of a map. - - MAP read_notifier_; - // A notifier for a read - - MAP write_notifier_; - // A write notifier - - MAP exception_notifier_; - // An exception notifier - - QTimer *qtime_ ; - // The timer class that would provide timer-sgnals & single-shot timers - - private: - void reset_timeout (void); - // This method ensures there's an Qt timeout for the first timeout - // in the Reactor's Timer_Queue. - - ACE_QtReactor (const ACE_QtReactor &); - ACE_QtReactor &operator= (const ACE_QtReactor &); - // Deny access since member-wise won't work... - - private slots: - - // These are all part of the communication mechanism adopted in Qt. - void read_event (int FD); - // Dispatch a Read Event - - void write_event (int FD); - // Dispatch a Write Event - - void exception_event (int FD); - // Dispatch an exception event - - void timeout_event (void); - // Dispach a timeout event -}; - -#endif /*ACE_HAS_QT */ - -#include "ace/post.h" -#endif /* ACE_QTREACTOR_H */ diff --git a/ace/RB_Tree.cpp b/ace/RB_Tree.cpp deleted file mode 100644 index 7a95a277662..00000000000 --- a/ace/RB_Tree.cpp +++ /dev/null @@ -1,932 +0,0 @@ -// $Id$ - -// RB_Tree.cpp - -#ifndef ACE_RB_TREE_C -#define ACE_RB_TREE_C - -#include "ace/RB_Tree.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/RB_Tree.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, RB_Tree, "$Id$") - -// Constructor. - -template -ACE_RB_Tree_Node::ACE_RB_Tree_Node (const EXT_ID &k, const INT_ID &t) - : k_ (k), - t_ (t), - color_ (RED), - parent_ (0), - left_ (0), - right_ (0) -{ - ACE_TRACE ("ACE_RB_Tree_Node::ACE_RB_Tree_Node (const EXT_ID &k, const INT_ID &t)"); -} - - -// Destructor. - -template -ACE_RB_Tree_Node::~ACE_RB_Tree_Node (void) -{ - ACE_TRACE ("ACE_RB_Tree_Node::~ACE_RB_Tree_Node"); - - // Delete left sub-tree. - delete left_; - - // Delete right sub_tree. - delete right_; -} - -// Constructor. - -template -ACE_RB_Tree::ACE_RB_Tree (ACE_Allocator *alloc) - : allocator_ (alloc), - root_ (0), - current_size_ (0) -{ - ACE_TRACE ("ACE_RB_Tree::" - "ACE_RB_Tree (ACE_Allocator *alloc)"); - if (this->open (alloc) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_RB_Tree::ACE_RB_Tree\n"))); -} - -// Copy constructor. - -template -ACE_RB_Tree::ACE_RB_Tree (const ACE_RB_Tree &rbt) - : allocator_ (rbt.allocator_), - root_ (0), - current_size_ (0) -{ - ACE_TRACE ("ACE_RB_Tree::" - "ACE_RB_Tree (const ACE_RB_Tree &rbt)"); - ACE_WRITE_GUARD (ACE_LOCK, ace_mon, this->lock_); - - // Make a deep copy of the passed tree. - ACE_RB_Tree_Iterator iter(rbt); - - for (iter.first (); - - iter.is_done () == 0; iter.next ()) - insert_i (*(iter.key ()), - *(iter.item ())); -} - -// Destructor. - -template -ACE_RB_Tree::~ACE_RB_Tree () -{ - ACE_TRACE ("ACE_RB_Tree::~ACE_RB_Tree"); - - // Use the locked public method, to be totally safe, as the class - // can be used with an allocator and placement new. - this->close (); -} - -// Assignment operator. - -template void -ACE_RB_Tree::operator = (const ACE_RB_Tree &rbt) -{ - ACE_TRACE ("ACE_RB_Tree::operator ="); - ACE_WRITE_GUARD (ACE_LOCK, ace_mon, this->lock_); - - // Clear out the existing tree. - close_i (); - - // Make a deep copy of the passed tree. - ACE_RB_Tree_Iterator iter(rbt); - - for (iter.first (); - iter.is_done () == 0; - iter.next ()) - insert_i (*(iter.key ()), - *(iter.item ())); - - // Use the same allocator as the rhs. - allocator_ = rbt.allocator_; -} - -// Less than comparison function for keys, default functor -// implementation returns 1 if k1 < k2, 0 otherwise. - -template int -ACE_RB_Tree::lessthan (const EXT_ID &k1, const EXT_ID &k2) -{ - ACE_TRACE ("ACE_RB_Tree::lessthan"); - return this->compare_keys_ (k1, k2); -} - -// Method for right rotation of the tree about a given node. - -template void -ACE_RB_Tree::RB_rotate_right (ACE_RB_Tree_Node * x) -{ - ACE_TRACE ("ACE_RB_Tree::RB_rotate_right"); - - if (! x) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nerror: x is a null pointer in ") - ACE_TEXT ("ACE_RB_Tree::RB_rotate_right\n"))); - else if (! (x->left())) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nerror: x->left () is a null pointer in ") - ACE_TEXT ("ACE_RB_Tree::RB_rotate_right\n"))); - else - { - ACE_RB_Tree_Node * y; - y = x->left (); - x->left (y->right ()); - if (y->right ()) - y->right ()->parent (x); - y->parent (x->parent ()); - if (x->parent ()) - { - if (x == x->parent ()->right ()) - x->parent ()->right (y); - else - x->parent ()->left (y); - } - else - root_ = y; - y->right (x); - x->parent (y); - } -} - -// Method for left rotation of the tree about a given node. - -template void -ACE_RB_Tree::RB_rotate_left (ACE_RB_Tree_Node * x) -{ - ACE_TRACE ("ACE_RB_Tree::RB_rotate_left"); - - if (! x) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nerror: x is a null pointer in ") - ACE_TEXT ("ACE_RB_Tree::RB_rotate_left\n"))); - else if (! (x->right())) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nerror: x->right () is a null pointer ") - ACE_TEXT ("in ACE_RB_Tree::RB_rotate_left\n"))); - else - { - ACE_RB_Tree_Node * y; - y = x->right (); - x->right (y->left ()); - if (y->left ()) - y->left ()->parent (x); - y->parent (x->parent ()); - if (x->parent ()) - { - if (x == x->parent ()->left ()) - x->parent ()->left (y); - else - x->parent ()->right (y); - } - else - root_ = y; - y->left (x); - x->parent (y); - } -} - -// Method for restoring Red-Black properties after deletion. - -template void -ACE_RB_Tree::RB_delete_fixup (ACE_RB_Tree_Node *x) -{ - ACE_TRACE ("ACE_RB_Tree::RB_delete_fixup"); - - while (x != 0 - && x->parent () - && x->color () == ACE_RB_Tree_Node_Base::BLACK) - { - if (x == x->parent ()->left ()) - { - ACE_RB_Tree_Node *w = x->parent ()->right (); - if (w && w->color () == ACE_RB_Tree_Node_Base::RED) - { - w->color (ACE_RB_Tree_Node_Base::BLACK); - x->parent ()->color (ACE_RB_Tree_Node_Base::RED); - RB_rotate_left (x->parent ()); - w = x->parent ()->right (); - } - // CLR pp. 263 says that nil nodes are implicitly colored BLACK - if ((w) && - (!w->left () - || w->left ()->color () == ACE_RB_Tree_Node_Base::BLACK) - && (!w->right () - || w->right ()->color () == ACE_RB_Tree_Node_Base::BLACK)) - { - w->color (ACE_RB_Tree_Node_Base::RED); - x = x->parent (); - } - else - { - // CLR pp. 263 says that nil nodes are implicitly colored BLACK - if (w && - (!w->right () - || w->right ()->color () == ACE_RB_Tree_Node_Base::BLACK)) - { - if (w->left ()) - w->left ()->color (ACE_RB_Tree_Node_Base::BLACK); - w->color (ACE_RB_Tree_Node_Base::RED); - RB_rotate_right (w); - w = x->parent ()->right (); - } - if (w) - { - w->color (x->parent ()->color ()); - if (w->right ()) - w->right ()->color (ACE_RB_Tree_Node_Base::BLACK); - } - x->parent ()->color (ACE_RB_Tree_Node_Base::BLACK); - RB_rotate_left (x->parent ()); - x = root_; - } - } - else - { - ACE_RB_Tree_Node *w = x->parent ()->left (); - if (w && w->color () == ACE_RB_Tree_Node_Base::RED) - { - w->color (ACE_RB_Tree_Node_Base::BLACK); - x->parent ()->color (ACE_RB_Tree_Node_Base::RED); - RB_rotate_right (x->parent ()); - w = x->parent ()->left (); - } - // CLR pp. 263 says that nil nodes are implicitly colored BLACK - if (w && - (!w->left () - || w->left ()->color () == ACE_RB_Tree_Node_Base::BLACK) - && (!w->right () - || w->right ()->color () == ACE_RB_Tree_Node_Base::BLACK)) - { - w->color (ACE_RB_Tree_Node_Base::RED); - x = x->parent (); - } - else - { - // CLR pp. 263 says that nil nodes are implicitly colored BLACK - if (w && - (!w->left () - || w->left ()->color () == ACE_RB_Tree_Node_Base::BLACK)) - { - w->color (ACE_RB_Tree_Node_Base::RED); - if (w->right ()) - w->right ()->color (ACE_RB_Tree_Node_Base::BLACK); - RB_rotate_left (w); - w = x->parent ()->left (); - } - if (w) - { - w->color (x->parent ()->color ()); - if (w->left ()) - w->left ()->color (ACE_RB_Tree_Node_Base::BLACK); - } - x->parent ()->color (ACE_RB_Tree_Node_Base::BLACK); - RB_rotate_right (x->parent ()); - x = root_; - } - } - } - - if (x) - x->color (ACE_RB_Tree_Node_Base::BLACK); -} - -// Return a pointer to a matching node if there is one, a pointer to -// the node under which to insert the item if the tree is not empty -// and there is no such match, or 0 if the tree is empty. - -template ACE_RB_Tree_Node * -ACE_RB_Tree::find_node (const EXT_ID &k, ACE_RB_Tree_Base::RB_SearchResult &result) -{ - ACE_TRACE ("ACE_RB_Tree::find_node"); - - // Start at the root. - ACE_RB_Tree_Node *current = root_; - - while (current) - { - // While there are more nodes to examine. - if (this->lessthan (current->key (), k)) - { - // If the search key is greater than the current node's key. - if (current->right ()) - // If the right subtree is not empty, search to the right. - current = current->right (); - else - { - // If the right subtree is empty, we're done searching, - // and are positioned to the left of the insertion point. - result = LEFT; - break; - } - } - else if (this->lessthan (k, current->key ())) - { - // Else if the search key is less than the current node's key. - if (current->left ()) - // If the left subtree is not empty, search to the left. - current = current->left (); - else - { - // If the left subtree is empty, we're done searching, - // and are positioned to the right of the insertion point. - result = RIGHT; - break; - } - } - else - { - // If the keys match exactly, we're done as well. - result = EXACT; - break; - } - } - - return current; -} - -// Rebalance the tree after insertion of a node. - -template void -ACE_RB_Tree::RB_rebalance (ACE_RB_Tree_Node * x) -{ - ACE_TRACE ("ACE_RB_Tree::RB_rebalance"); - - ACE_RB_Tree_Node *y = 0; - - while (x && - x->parent () - && x->parent ()->color () == ACE_RB_Tree_Node_Base::RED) - { - if (! x->parent ()->parent ()) - { - // If we got here, something is drastically wrong! - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nerror: parent's parent is null in ") - ACE_TEXT ("ACE_RB_Tree::RB_rebalance\n"))); - return; - } - - if (x->parent () == x->parent ()->parent ()->left ()) - { - y = x->parent ()->parent ()->right (); - if (y && y->color () == ACE_RB_Tree_Node_Base::RED) - { - // Handle case 1 (see CLR book, pp. 269). - x->parent ()->color (ACE_RB_Tree_Node_Base::BLACK); - y->color (ACE_RB_Tree_Node_Base::BLACK); - x->parent ()->parent ()->color (ACE_RB_Tree_Node_Base::RED); - x = x->parent ()->parent (); - } - else - { - if (x == x->parent ()->right ()) - { - // Transform case 2 into case 3 (see CLR book, pp. 269). - x = x->parent (); - RB_rotate_left (x); - } - - // Handle case 3 (see CLR book, pp. 269). - x->parent ()->color (ACE_RB_Tree_Node_Base::BLACK); - x->parent ()->parent ()->color (ACE_RB_Tree_Node_Base::RED); - RB_rotate_right (x->parent ()->parent ()); - } - } - else - { - y = x->parent ()->parent ()->left (); - if (y && y->color () == ACE_RB_Tree_Node_Base::RED) - { - // Handle case 1 (see CLR book, pp. 269). - x->parent ()->color (ACE_RB_Tree_Node_Base::BLACK); - y->color (ACE_RB_Tree_Node_Base::BLACK); - x->parent ()->parent ()->color (ACE_RB_Tree_Node_Base::RED); - x = x->parent ()->parent (); - } - else - { - if (x == x->parent ()->left ()) - { - // Transform case 2 into case 3 (see CLR book, pp. 269). - x = x->parent (); - RB_rotate_right (x); - } - - // Handle case 3 (see CLR book, pp. 269). - x->parent ()->color (ACE_RB_Tree_Node_Base::BLACK); - x->parent ()->parent ()->color (ACE_RB_Tree_Node_Base::RED); - RB_rotate_left (x->parent ()->parent ()); - } - } - } -} - -// Method to find the successor node of the given node in the tree. - -template ACE_RB_Tree_Node * -ACE_RB_Tree::RB_tree_successor (ACE_RB_Tree_Node *x) const -{ - ACE_TRACE ("ACE_RB_Tree::RB_tree_successor"); - - if (x->right ()) - return RB_tree_minimum (x->right ()); - - ACE_RB_Tree_Node *y = x->parent (); - while ((y) && (x == y->right ())) - { - x = y; - y = y->parent (); - } - - return y; -} - -// Method to find the predecessor node of the given node in the tree. - -template ACE_RB_Tree_Node * -ACE_RB_Tree::RB_tree_predecessor (ACE_RB_Tree_Node *x) const -{ - ACE_TRACE ("ACE_RB_Tree::RB_tree_predecessor"); - - if (x->left ()) - return RB_tree_maximum (x->left ()); - - ACE_RB_Tree_Node *y = x->parent (); - - while ((y) && (x == y->left ())) - { - x = y; - y = y->parent (); - } - - return y; -} - -// Method to find the minimum node of the subtree rooted at the given node. - -template ACE_RB_Tree_Node * -ACE_RB_Tree::RB_tree_minimum (ACE_RB_Tree_Node *x) const -{ - ACE_TRACE ("ACE_RB_Tree::RB_tree_minimum"); - - while ((x) && (x->left ())) - x = x->left (); - - return x; -} - -// Method to find the maximum node of the subtree rooted at the given node. - -template ACE_RB_Tree_Node * -ACE_RB_Tree::RB_tree_maximum (ACE_RB_Tree_Node *x) const -{ - ACE_TRACE ("ACE_RB_Tree::RB_tree_maximum"); - - while ((x) && (x->right ())) - x = x->right (); - - return x; -} - -// Close down an RB_Tree. this method should only be called with -// locks already held. - -template int -ACE_RB_Tree::close_i () -{ - ACE_TRACE ("ACE_RB_Tree::close_i"); - - delete root_; - current_size_ = 0; - root_ = 0; - - return 0; -} - -// Returns a pointer to the item corresponding to the given key, or 0 -// if it cannot find the key in the tree. This method should only be -// called with locks already held. - -template int -ACE_RB_Tree::find_i (const EXT_ID &k, - ACE_RB_Tree_Node* &entry) -{ - ACE_TRACE ("ACE_RB_Tree::find_i"); - - // Try to find a match. - RB_SearchResult result = LEFT; - ACE_RB_Tree_Node *current = find_node (k, result); - - if (current && result == EXACT) - { - // Found an exact match: return a pointer to the node. - entry = current; - return 0; - } - else - // The node is not there. - return -1; -} - -// Inserts a *copy* of the key and the item into the tree: both the -// key type EXT_ID and the item type INT_ID must have well defined -// semantics for copy construction and < comparison. This method -// returns a pointer to the inserted item copy, or 0 if an error -// occurred. NOTE: if an identical key already exists in the tree, no -// new item is created, and the returned pointer addresses the -// existing item associated with the existing key. This method should -// only be called with locks already held. - -template INT_ID * -ACE_RB_Tree::insert_i (const EXT_ID &k, const INT_ID &t) -{ - ACE_TRACE ("ACE_RB_Tree::insert_i (const EXT_ID &k, const INT_ID &t)"); - - // Find the closest matching node, if there is one. - RB_SearchResult result = LEFT; - ACE_RB_Tree_Node *current = find_node (k, result); - if (current) - { - // If the keys match, just return a pointer to the node's item. - if (result == EXACT) - return ¤t->item (); - - // Otherwise if we're to the left of the insertion point, insert - // into the right subtree. - else if (result == LEFT) - { - if (current->right ()) - // If there is already a right subtree, complain. - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nright subtree already present in ") - ACE_TEXT ("ACE_RB_Tree::insert_i\n")), - 0); - else - { - // The right subtree is empty: insert new node there. - ACE_RB_Tree_Node *tmp = 0; - - ACE_NEW_RETURN (tmp, - (ACE_RB_Tree_Node) (k, t), - 0); - current->right (tmp); - - // If the node was successfully inserted, set its - // parent, rebalance the tree, color the root black, and - // return a pointer to the inserted item. - INT_ID *item = &(current->right ()->item ()); - current->right ()->parent (current); - RB_rebalance (current->right ()); - root_->color (ACE_RB_Tree_Node_Base::BLACK); - ++current_size_; - return item; - } - } - // Otherwise, we're to the right of the insertion point, so - // insert into the left subtree. - else // (result == RIGHT) - { - if (current->left ()) - // If there is already a left subtree, complain. - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nleft subtree already present in ") - ACE_TEXT ("ACE_RB_Tree::insert_i\n")), - 0); - else - { - // The left subtree is empty: insert new node there. - ACE_RB_Tree_Node *tmp = 0; - ACE_NEW_RETURN (tmp, - (ACE_RB_Tree_Node) (k, t), - 0); - current->left (tmp); - - // If the node was successfully inserted, set its - // parent, rebalance the tree, color the root black, and - // return a pointer to the inserted item. - INT_ID *item = ¤t->left ()->item (); - current->left ()->parent (current); - RB_rebalance (current->left ()); - root_->color (ACE_RB_Tree_Node_Base::BLACK); - ++current_size_; - return item; - } - } - } - else - { - // The tree is empty: insert at the root and color the root - // black. - ACE_NEW_RETURN (root_, - (ACE_RB_Tree_Node) (k, t), - 0); - if (root_) - { - root_->color (ACE_RB_Tree_Node_Base::BLACK); - ++current_size_; - return &root_->item (); - } - } - return 0; -} - -// Inserts a *copy* of the key and the item into the tree: both the -// key type EXT_ID and the item type INT_ID must have well defined -// semantics for copy construction. The default implementation also -// requires that the key type support well defined < semantics. This -// method passes back a pointer to the inserted (or existing) node, -// and the search status. If the node already exists, the method -// returns 1. If the node does not exist, and a new one is -// successfully created, and the method returns 0. If there was an -// error, the method returns -1. - -template int -ACE_RB_Tree::insert_i (const EXT_ID &k, - const INT_ID &t, - ACE_RB_Tree_Node *&entry) -{ - ACE_TRACE ("ACE_RB_Tree::insert_i (const EXT_ID &k, const INT_ID &t, " - "ACE_RB_Tree_Node *&entry)"); - - // Find the closest matching node, if there is one. - RB_SearchResult result = LEFT; - ACE_RB_Tree_Node *current = find_node (k, result); - if (current) - { - // If the keys match, just return a pointer to the node's item. - if (result == EXACT) - { - entry = current; - return 1; - } - // Otherwise if we're to the left of the insertion - // point, insert into the right subtree. - else if (result == LEFT) - { - if (current->right ()) - { - // If there is already a right subtree, complain. - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nright subtree already present in ") - ACE_TEXT ("ACE_RB_Tree::insert_i\n")), - -1); - } - else - { - // The right subtree is empty: insert new node there. - ACE_RB_Tree_Node *tmp = 0; - ACE_NEW_RETURN (tmp, - (ACE_RB_Tree_Node) (k, t), - -1); - current->right (tmp); - - // If the node was successfully inserted, set its parent, rebalance - // the tree, color the root black, and return a pointer to the - // inserted item. - entry = current->right (); - current->right ()->parent (current); - RB_rebalance (current->right ()); - root_->color (ACE_RB_Tree_Node_Base::BLACK); - ++current_size_; - return 0; - } - } - // Otherwise, we're to the right of the insertion point, so - // insert into the left subtree. - else // (result == RIGHT) - { - if (current->left ()) - // If there is already a left subtree, complain. - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("\nleft subtree already present in ") - ACE_TEXT ("ACE_RB_Tree::insert_i\n")), - -1); - else - { - // The left subtree is empty: insert new node there. - ACE_RB_Tree_Node *tmp = 0; - ACE_NEW_RETURN (tmp, - (ACE_RB_Tree_Node) (k, t), - -1); - current->left (tmp); - // If the node was successfully inserted, set its - // parent, rebalance the tree, color the root black, and - // return a pointer to the inserted item. - entry = current->left (); - current->left ()->parent (current); - RB_rebalance (current->left ()); - root_->color (ACE_RB_Tree_Node_Base::BLACK); - ++current_size_; - return 0; - } - } - } - else - { - // The tree is empty: insert at the root and color the root black. - ACE_NEW_RETURN (root_, - (ACE_RB_Tree_Node) (k, t), - -1); - root_->color (ACE_RB_Tree_Node_Base::BLACK); - ++current_size_; - entry = root_; - return 0; - } -} - -// Removes the item associated with the given key from the tree and -// destroys it. Returns 1 if it found the item and successfully -// destroyed it, 0 if it did not find the item, or -1 if an error -// occurred. This method should only be called with locks already -// held. - -template int -ACE_RB_Tree::remove_i (const EXT_ID &k, INT_ID &i) -{ - ACE_TRACE ("ACE_RB_Tree::remove_i (const EXT_ID &k, INT_ID &i)"); - - // Find a matching node, if there is one. - ACE_RB_Tree_Node *z; - RB_SearchResult result = LEFT; - z = find_node (k, result); - - // If there is a matching node: remove and destroy it. - if (z && result == EXACT) - { - // Return the internal id stored in the deleted node. - i = z->item (); - return -1 == this->remove_i (z) ? -1 : 1; - } - else - { - // No matching node was found: return 0. - return 0; - } -} - -template int -ACE_RB_Tree::remove_i (ACE_RB_Tree_Node *z) -{ - ACE_TRACE ("ACE_RB_Tree::remove_i (ACE_RB_Tree_Node *z)"); - - // Delete the node and reorganize the tree to satisfy the Red-Black - // properties. - - ACE_RB_Tree_Node *x; - ACE_RB_Tree_Node *y; - - if (z->left () && z->right ()) - y = RB_tree_successor (z); - else - y = z; - - if (y->left ()) - x = y->left (); - else - x = y->right (); - - if (x) - x->parent (y->parent ()); - - if (y->parent ()) - { - if (y == y->parent ()->left ()) - y->parent ()->left (x); - else - y->parent ()->right (x); - } - else - root_ = x; - - if (y != z) - { - // Copy the elements of y into z. - z->key () = y->key (); - z->item () = y->item (); - } - - // CLR pp. 263 says that nil nodes are implicitly colored BLACK - if (!y || y->color () == ACE_RB_Tree_Node_Base::BLACK) - RB_delete_fixup (x); - - y->parent (0); - y->right (0); - y->left (0); - delete y; - --current_size_; - - return 0; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_RB_Tree_Iterator_Base) - -// Constructor. - -template -ACE_RB_Tree_Iterator_Base::ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree &tree, int set_first) - : tree_ (&tree), node_ (0) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::ACE_RB_Tree_Iterator_Base (ACE_RB_Tree, int)"); - - // Position the iterator at the first (or last) node in the tree. - if (set_first) - node_ = tree_->RB_tree_minimum (tree_->root_); - else - node_ = tree_->RB_tree_maximum (tree_->root_); -} - -// Copy constructor. - -template -ACE_RB_Tree_Iterator_Base::ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree_Iterator_Base &iter) - : tree_ (iter.tree_), - node_ (iter.node_) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::ACE_RB_Tree_Iterator_Base (ACE_RB_Tree_Iterator_Base)"); -} - -// Assignment operator. - -template void -ACE_RB_Tree_Iterator_Base::operator= (const ACE_RB_Tree_Iterator_Base &iter) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::operator="); - tree_ = iter.tree_; - node_ = iter.node_; -} - -// Destructor. - -template -ACE_RB_Tree_Iterator_Base::~ACE_RB_Tree_Iterator_Base () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::~ACE_RB_Tree_Iterator_Base"); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_RB_Tree_Iterator) - -// Constructor. - -template -ACE_RB_Tree_Iterator::ACE_RB_Tree_Iterator (const ACE_RB_Tree &tree, - int set_first) - : ACE_RB_Tree_Iterator_Base (tree, set_first) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::ACE_RB_Tree_Iterator"); -} - -// Destructor. - -template -ACE_RB_Tree_Iterator::~ACE_RB_Tree_Iterator () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::~ACE_RB_Tree_Iterator"); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_RB_Tree_Reverse_Iterator) - -// Constructor. - -template -ACE_RB_Tree_Reverse_Iterator::ACE_RB_Tree_Reverse_Iterator (const ACE_RB_Tree &tree, int set_last) - : ACE_RB_Tree_Iterator_Base (tree, set_last ? 0 : 1) -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::ACE_RB_Tree_Reverse_Iterator"); -} - -// Destructor. - -template -ACE_RB_Tree_Reverse_Iterator::~ACE_RB_Tree_Reverse_Iterator () -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::~ACE_RB_Tree_Reverse_Iterator"); -} - -#endif /* !defined (ACE_RB_TREE_C) */ diff --git a/ace/RB_Tree.h b/ace/RB_Tree.h deleted file mode 100644 index d42b92d1da6..00000000000 --- a/ace/RB_Tree.h +++ /dev/null @@ -1,710 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RB_Tree.h -// -// = AUTHOR -// Chris Gill -// -// ============================================================================ - -#ifndef ACE_RB_TREE_H -#define ACE_RB_TREE_H -#include "ace/pre.h" - -#include "ace/OS.h" -#include "ace/Functor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Forward decl. -template -class ACE_RB_Tree_Iterator_Base; - -// Forward decl. -template -class ACE_RB_Tree_Iterator; - -// Forward decl. -template -class ACE_RB_Tree_Reverse_Iterator; - -// Forward decl. -class ACE_Allocator; - -class ACE_RB_Tree_Node_Base -{ -public: - enum RB_Tree_Node_Color {RED, BLACK}; -}; - -template -class ACE_RB_Tree_Node : public ACE_RB_Tree_Node_Base -{ - // = TITLE - // Implements a node in a Red-Black Tree ADT. - // -public: - // = Initialization and termination methods. - - ACE_RB_Tree_Node (const EXT_ID &k, const INT_ID &t); - // Constructor. - - ~ACE_RB_Tree_Node (void); - // Destructor. - - EXT_ID &key (void); - // Key accessor. - - INT_ID &item (void); - // Item accessor. - - void color (RB_Tree_Node_Color c); - // Set color of the node. - - RB_Tree_Node_Color color (void); - // Get color of the node. - - ACE_RB_Tree_Node *parent (void); - // Accessor for node's parent pointer. - - void parent (ACE_RB_Tree_Node * p); - // Mutator for node's parent pointer. - - ACE_RB_Tree_Node *left (void); - // Accessor for node's left child pointer. - - void left (ACE_RB_Tree_Node *l); - // Mutator for node's left child pointer. - - ACE_RB_Tree_Node *right (void); - // Accessor for node's right child pointer. - - void right (ACE_RB_Tree_Node * r); - // Mutator for node's right child pointer - -private: - - EXT_ID k_; - // The key. - - INT_ID t_; - // The item. - - RB_Tree_Node_Color color_; - // Color of the node. - - ACE_RB_Tree_Node *parent_; - // Pointer to node's parent. - - ACE_RB_Tree_Node *left_; - // Pointer to node's left child. - - ACE_RB_Tree_Node *right_; - // Pointer to node's right child. -}; - -class ACE_RB_Tree_Base -{ -public: - // = Search result enumeration. - enum RB_SearchResult {LEFT, EXACT, RIGHT}; -}; - -template -class ACE_RB_Tree : public ACE_RB_Tree_Base -{ - // = TITLE - // Implements a Red-Black Tree ADT, according to T. H. Corman, - // C. E. Leiserson, and R. L. Rivest, "Introduction to Algorithms" - // 1990, MIT, chapter 14. - // - // = Description - // A number of Changes have been made to this class template - // in order to conform to the ACE_Hash_Map_Manager_Ex - // interface. All previously supported public methods are - // still part of this class. However, these are marked as - // DEPRECATED and will be removed from this class in - // a future version of ACE. Please migrate your code - // to the appropriate public methods indicated in the - // method deprecation comments. - // - // This class uses an to allocate memory. The - // user can make this a persistent class by providing an - // with a persistable memory pool. - -public: - friend class ACE_RB_Tree_Iterator_Base; - friend class ACE_RB_Tree_Iterator; - friend class ACE_RB_Tree_Reverse_Iterator; - - typedef EXT_ID KEY; - typedef INT_ID VALUE; - typedef ACE_RB_Tree_Node ENTRY; - - // = ACE-style iterator typedefs. - typedef ACE_RB_Tree_Iterator ITERATOR; - typedef ACE_RB_Tree_Reverse_Iterator REVERSE_ITERATOR; - - // = STL-style iterator typedefs. - typedef ACE_RB_Tree_Iterator iterator; - typedef ACE_RB_Tree_Reverse_Iterator reverse_iterator; - - // = Initialization and termination methods. - - ACE_RB_Tree (ACE_Allocator *alloc = 0); - // Constructor. - - ACE_RB_Tree (const ACE_RB_Tree &rbt); - // Copy constructor. - - int open (ACE_Allocator *alloc = 0); - // Initialize an RB Tree. - - int close (void); - // Close down an RB_Tree and release dynamically allocated - // resources. - - virtual ~ACE_RB_Tree (void); - // Destructor. - - // = insertion, removal, and search methods. - - int bind (const EXT_ID &item, - const INT_ID &int_id); - // Associate with . If is already in the - // tree then the is not changed. Returns 0 if a - // new entry is bound successfully, returns 1 if an attempt is made - // to bind an existing entry, and returns -1 if failures occur. - - int bind (const EXT_ID &ext_id, - const INT_ID &int_id, - ACE_RB_Tree_Node *&entry); - // Same as a normal bind, except the tree entry is also passed back - // to the caller. The entry in this case will either be the newly - // created entry, or the existing one. - - - int trybind (const EXT_ID &ext_id, - INT_ID &int_id); - // Associate with if and only if is not - // in the tree. If is already in the tree then the - // parameter is assigned the existing value in the tree. Returns 0 - // if a new entry is bound successfully, returns 1 if an attempt is - // made to bind an existing entry, and returns -1 if failures occur. - - int trybind (const EXT_ID &ext_id, - INT_ID &int_id, - ACE_RB_Tree_Node *&entry); - // Same as a normal trybind, except the tree entry is also passed - // back to the caller. The entry in this case will either be the - // newly created entry, or the existing one. - - int rebind (const EXT_ID &ext_id, - const INT_ID &int_id); - // Reassociate with . If is not in the - // tree then behaves just like . Returns 0 if a new entry is - // bound successfully, returns 1 if an existing entry was rebound, - // and returns -1 if failures occur. - - int rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - ACE_RB_Tree_Node *&entry); - // Same as a normal rebind, except the tree entry is also passed back - // to the caller. The entry in this case will either be the newly - // created entry, or the existing one. - - int rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - INT_ID &old_int_id); - // Associate with . If is not in the tree - // then behaves just like . Otherwise, store the old value of - // into the "out" parameter and rebind the new parameters. - // Returns 0 if a new entry is bound successfully, returns 1 if an - // existing entry was rebound, and returns -1 if failures occur. - - int rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - INT_ID &old_int_id, - ACE_RB_Tree_Node *&entry); - // Same as a normal rebind, except the tree entry is also passed back - // to the caller. The entry in this case will either be the newly - // created entry, or the existing one. - - int rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - EXT_ID &old_ext_id, - INT_ID &old_int_id); - // Associate with . If is not in the tree - // then behaves just like . Otherwise, store the old values - // of and into the "out" parameters and rebind the - // new parameters. This is very useful if you need to have an - // atomic way of updating and you also need - // full control over memory allocation. Returns 0 if a new entry is - // bound successfully, returns 1 if an existing entry was rebound, - // and returns -1 if failures occur. - - int rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - EXT_ID &old_ext_id, - INT_ID &old_int_id, - ACE_RB_Tree_Node *&entry); - // Same as a normal rebind, except the tree entry is also passed back - // to the caller. The entry in this case will either be the newly - // created entry, or the existing one. - - int find (const EXT_ID &ext_id, - INT_ID &int_id); - // Locate and pass out parameter via . If found, - // return 0, returns -1 if not found. - - int find (const EXT_ID &ext_id, - ACE_RB_Tree_Node *&entry); - // Locate and pass out parameter via . If found, - // return 0, returns -1 if not found. - - int unbind (const EXT_ID &ext_id); - // Unbind (remove) the from the tree. Don't return the - // to the caller (this is useful for collections where the - // s are *not* dynamically allocated...) - - int unbind (const EXT_ID &ext_id, - INT_ID &int_id); - // Break any association of . Returns the value of - // in case the caller needs to deallocate memory. - - int unbind (ACE_RB_Tree_Node *entry); - // Remove entry from tree. This method should be used with *extreme* - // caution, and only for optimization purposes. The node being passed - // in had better have been allocated by the tree that is unbinding it. - - // = Public helper methods. - - size_t current_size (void) const; - // Returns the current number of nodes in the tree. - - void operator= (const ACE_RB_Tree &rbt); - // Assignment operator. - - virtual int lessthan (const EXT_ID &k1, const EXT_ID &k2); - // Less than comparison function for keys, using comparison functor. - - ACE_LOCK &mutex (void); - // Returns a reference to the underlying . This makes it - // possible to acquire the lock explicitly, which can be useful in - // some cases if you instantiate the with an - // or , or if you need to - // guard the state of an iterator. NOTE: the right name would be - // , but HP/C++ will choke on that! - - void dump (void) const; - // Dump the state of an object. - - // = STL styled iterator factory functions. - - ACE_RB_Tree_Iterator begin (void); - // Return forward iterator positioned at first node in tree. - - ACE_RB_Tree_Iterator end (void); - // Return forward iterator positioned at last node in tree. - - ACE_RB_Tree_Reverse_Iterator rbegin (void); - // Return reverse iterator positioned at last node in tree. - - ACE_RB_Tree_Reverse_Iterator rend (void); - // Return reverse iterator positioned at first node in tree. - - // = DEPRECATED methods. Please migrate your code to use the new methods instead - - INT_ID* find (const EXT_ID &k); - // Returns a pointer to the item corresponding to the - // given key, or 0 if it cannot find the key in the tree. - // - // DEPRECATED: signature will change to become - // int find (const EXT_ID &ext_id); which will return - // 0 if the is in the tree, otherwise -1. - - - - INT_ID* insert (const EXT_ID &k, const INT_ID &t); - // Inserts a *copy* of the key and the item into the tree: both the - // key type EXT_ID and the item type INT_ID must have well defined semantics - // for copy construction. The default implementation also requires that - // the key type support well defined < semantics. This method returns a - // pointer to the inserted item copy, or 0 if an error occurred. - // NOTE: if an identical key already exists in the tree, no new item - // is created, and the returned pointer addresses the existing item - // associated with the existing key. - // DEPRECATED - - int remove (const EXT_ID &k); - // Removes the item associated with the given key from the tree and - // destroys it. Returns 1 if it found the item and successfully - // destroyed it, 0 if it did not find the item, or -1 if an error - // occurred. - // DEPRECATED - - void clear (void); - // Destroys all nodes and sets the root pointer null. - // DEPRECATED - -protected: - - // = Protected methods. These should only be called with locks held. - - void RB_rotate_right (ACE_RB_Tree_Node * x); - // Method for right rotation of the tree about a given node. - - void RB_rotate_left (ACE_RB_Tree_Node * x); - // Method for left rotation of the tree about a given node. - - void RB_delete_fixup (ACE_RB_Tree_Node * x); - // Method for restoring Red-Black properties after deletion. - - ACE_RB_Tree_Node * - RB_tree_successor (ACE_RB_Tree_Node *x) const; - // Method to find the successor node of the given node in the tree. - - ACE_RB_Tree_Node * - RB_tree_predecessor (ACE_RB_Tree_Node *x) const; - // Method to find the predecessor node of the given node in the - // tree. - - ACE_RB_Tree_Node * - RB_tree_minimum (ACE_RB_Tree_Node *x) const; - // Method to find the minimum node of the subtree rooted at the - // given node. - - ACE_RB_Tree_Node * - RB_tree_maximum (ACE_RB_Tree_Node *x) const; - // Method to find the maximum node of the subtree rooted at the - // given node. - - ACE_RB_Tree_Node * - find_node (const EXT_ID &k, RB_SearchResult &result); - // Returns a pointer to a matching node if there is one, a pointer - // to the node under which to insert the item if the tree is not - // empty and there is no such match, or 0 if the tree is empty. - // It stores the result of the search in the result argument: - // LEFT if the node is to the left of the node to be inserted, - // RIGHT if the node is to the right of the node to be inserted, - // or EXACT if an exactly matching node already exists. - - void RB_rebalance (ACE_RB_Tree_Node * x); - // Rebalance the tree after insertion of a node. - - int close_i (void); - // Close down an RB_Tree. this method should - // only be called with locks already held. - - int find_i (const EXT_ID &ext_id, ACE_RB_Tree_Node* &entry); - // Retrieves a pointer to the item corresponding to the - // given key. Returns 0 for success, or -1 if it cannot find the key - // in the tree. - - INT_ID* insert_i (const EXT_ID &k, const INT_ID &t); - // Inserts a *copy* of the key and the item into the tree: both the - // key type EXT_ID and the item type INT_ID must have well defined semantics - // for copy construction. The default implementation also requires that - // the key type support well defined < semantics. This method returns a - // pointer to the inserted item copy, or 0 if an error occurred. - // NOTE: if an identical key already exists in the tree, no new item - // is created, and the returned pointer addresses the existing item - // associated with the existing key. - - int insert_i (const EXT_ID &k, const INT_ID &t, - ACE_RB_Tree_Node *&entry); - // Inserts a *copy* of the key and the item into the tree: both the - // key type EXT_ID and the item type INT_ID must have well defined semantics - // for copy construction. The default implementation also requires that - // the key type support well defined < semantics. This method passes back - // a pointer to the inserted (or existing) node, and the search status. If - // the node already exists, the method returns 1. If the node does not - // exist, and a new one is successfully created, and the method returns 0. - // If there was an error, the method returns -1. - - int remove_i (const EXT_ID &k, INT_ID &i); - // Removes the item associated with the given key from the tree and - // destroys it. Returns 1 if it found the item and successfully - // destroyed it, 0 if it did not find the item, or -1 if an error - // occurred. Returns the stored internal id in the second argument. - - int remove_i (ACE_RB_Tree_Node *z); - // Removes the item associated with the given key from the tree and - // destroys it. - -private: - - // = Private members. - - ACE_Allocator *allocator_; - // Pointer to a memory allocator. - - ACE_LOCK lock_; - // Synchronization variable for the MT_SAFE . - - ACE_RB_Tree_Node *root_; - // The root of the tree. - - COMPARE_KEYS compare_keys_; - // Comparison functor for comparing nodes in the tree. - - size_t current_size_; - // The current number of nodes in the tree. -}; - -template -class ACE_RB_Tree_Iterator_Base -{ - // = TITLE - // Implements a common base class for iterators for a Red-Black Tree ADT. - -public: - - void operator= (const ACE_RB_Tree_Iterator_Base &iter); - // Assignment operator: copies both the tree reference and the position in the tree. - - // = Iteration methods. - - int done (void) const; - // Returns 1 when the iteration has completed, otherwise 0. - - ACE_RB_Tree_Node & operator* (void) const; - // STL-like iterator dereference operator: returns a reference - // to the node underneath the iterator. - - const ACE_RB_Tree &tree (void); - // Returns a const reference to the tree over which we're iterating. - - int operator== (const ACE_RB_Tree_Iterator_Base &) const; - // Comparison operator: returns 1 if both iterators point to the same position, otherwise 0. - - int operator!= (const ACE_RB_Tree_Iterator_Base &) const; - // Comparison operator: returns 1 if the iterators point to different positions, otherwise 0. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - - // = Initialization and termination methods. - - ACE_RB_Tree_Iterator_Base (void); - // Create the singular iterator. No valid iterator can be equal to - // it, it is illegal to dereference a singular iterator, etc. etc. - - ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree &tree, - int set_first); - // Constructor. Takes an ACE_RB_Tree over which to iterate, and - // an integer indicating (if non-zero) to position the iterator - // at the first element in the tree (if this integer is 0, the - // iterator is positioned at the last element in the tree). - - ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree_Iterator_Base &iter); - // Copy constructor. - - ~ACE_RB_Tree_Iterator_Base (void); - // Destructor. - - // = Internal methods - - int forward_i (void); - // Move forward by one element in the tree. Returns 0 when - // there are no more elements in the tree, otherwise 1. - - int reverse_i (void); - // Move back by one element in the tree. Returns 0 when - // there are no more elements in the tree, otherwise 1. - - void dump_i (void) const; - // Dump the state of an object. - - // = Protected members. - - const ACE_RB_Tree *tree_; - // Reference to the ACE_RB_Tree over which we're iterating. - - ACE_RB_Tree_Node *node_; - // Pointer to the node currently under the iterator. - -}; - -template -class ACE_RB_Tree_Iterator : public ACE_RB_Tree_Iterator_Base -{ - // = TITLE - // Implements an iterator for a Red-Black Tree ADT. - -public: - - // = Initialization and termination methods. - ACE_RB_Tree_Iterator (void); - // Create the singular iterator. - // It is illegal to deference the iterator, no valid iterator is - // equal to a singular iterator, etc. etc. - - ACE_RB_Tree_Iterator (const ACE_RB_Tree &tree, - int set_first = 1); - // Constructor. Takes an ACE_RB_Tree over which to iterate, and - // an integer indicating (if non-zero) to position the iterator - // at the first element in the tree (if this integer is 0, the - // iterator is positioned at the last element in the tree). - - ~ACE_RB_Tree_Iterator (void); - // Destructor. - - // = ACE-style iteration methods. - - int advance (void); - // Move forward by one element in the tree. Returns - // 0 when all elements have been seen, else 1. - - void dump (void) const; - // Dump the state of an object. - - // = STL-style iteration methods. - - ACE_RB_Tree_Iterator & operator++ (void); - // Prefix advance. - - ACE_RB_Tree_Iterator operator++ (int); - // Postfix advance. - - ACE_RB_Tree_Iterator & operator-- (void); - // Prefix reverse. - - ACE_RB_Tree_Iterator operator-- (int); - // Postfix reverse. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - int next (ACE_RB_Tree_Node *&next_entry) const; - // Passes back the under the iterator. Returns 0 if - // the iteration has completed, otherwise 1. This method must - // be declared and defined in both the derived forward and - // reverse iterator classes rather than in the base iterator - // class because of a method signature resolution problem - // caused by the existence of the deprecated next (void) - // method in the derived forward iterator class. When that - // deprecated method is removed, this method should be removed - // from the derived classes and placed in the base class. - - // = DEPRECATED methods. Please migrate your code to use the new methods instead - - EXT_ID *key (void); - // Accessor for key of node under iterator (if any). - // DEPRECATED - - INT_ID *item (void); - // Accessor for item of node under iterator (if any). - // DEPRECATED - - int first (void); - // Move to the first item in the iteration (and in the tree). - // DEPRECATED - - int last (void); - // Move to the last item in the iteration (and in the tree). - // DEPRECATED - - int next (void); - // Move to the next item in the iteration (and in the tree). - // DEPRECATED - - int previous (void); - // Move to the previous item in the iteration (and in the tree). - // DEPRECATED - - int is_done (void); - // Returns 0 if the iterator is positioned over a valid ACE_RB_Tree - // node, returns 1 if not. - // DEPRECATED: use the base class method instead. - -}; - -template -class ACE_RB_Tree_Reverse_Iterator : public ACE_RB_Tree_Iterator_Base -{ - // = TITLE - // Implements a reverse iterator for a Red-Black Tree ADT. - -public: - - // = Initialization and termination methods. - ACE_RB_Tree_Reverse_Iterator (void); - // Create the singular iterator. - // It is illegal to deference the iterator, no valid iterator is - // equal to a singular iterator, etc. etc. - - ACE_RB_Tree_Reverse_Iterator (const ACE_RB_Tree &tree, - int set_last = 1); - // Constructor. Takes an ACE_RB_Tree over which to iterate, and - // an integer indicating (if non-zero) to position the iterator - // at the last element in the tree (if this integer is 0, the - // iterator is positioned at the first element in the tree). - - ~ACE_RB_Tree_Reverse_Iterator (void); - // Destructor. - - // = ACE-style iteration methods. - - int advance (void); - // Move forward by one element in the tree. Returns - // 0 when all elements have been seen, else 1. - - void dump (void) const; - // Dump the state of an object. - - // = STL-style iteration methods. - - ACE_RB_Tree_Reverse_Iterator & operator++ (void); - // Prefix advance. - - ACE_RB_Tree_Reverse_Iterator operator++ (int); - // Postfix advance. - - ACE_RB_Tree_Reverse_Iterator & operator-- (void); - // Prefix reverse. - - ACE_RB_Tree_Reverse_Iterator operator-- (int); - // Postfix reverse. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - int next (ACE_RB_Tree_Node *&next_entry) const; - // Passes back the under the iterator. Returns 0 if - // the iteration has completed, otherwise 1. This method must - // be declared and defined in both the derived forward and - // reverse iterator classes rather than in the base iterator - // class because of a method signature resolution problem - // caused by the existence of the deprecated next (void) - // method in the derived forward iterator class. When that - // deprecated method is removed, this method should be removed - // from the derived classes and placed in the base class. - -}; - -#if defined (__ACE_INLINE__) -#include "ace/RB_Tree.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/RB_Tree.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("RB_Tree.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ! defined (ACE_RB_TREE_H) */ diff --git a/ace/RB_Tree.i b/ace/RB_Tree.i deleted file mode 100644 index 23014a4ffc3..00000000000 --- a/ace/RB_Tree.i +++ /dev/null @@ -1,1153 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/Synch.h" -#include "ace/Malloc.h" - -///////////////////////////////////////////////////// -// template class ACE_RB_Tree_Node // -///////////////////////////////////////////////////// - -// Key accessor. - -template -ACE_INLINE EXT_ID & -ACE_RB_Tree_Node::key () -{ - ACE_TRACE ("ACE_RB_Tree_Node::key"); - return k_; -} - - -// Item accessor. - -template -ACE_INLINE INT_ID & -ACE_RB_Tree_Node::item () -{ - ACE_TRACE ("ACE_RB_Tree_Node:item"); - return t_; -} - - -// Set color of the node. - -template -ACE_INLINE void -ACE_RB_Tree_Node::color (ACE_RB_Tree_Node_Base::RB_Tree_Node_Color c) -{ - ACE_TRACE ("ACE_RB_Tree_Node::color mutator"); - color_ = c; -} - - -// Get color of the node. - -template -ACE_INLINE ACE_RB_Tree_Node_Base::RB_Tree_Node_Color -ACE_RB_Tree_Node::color () -{ - ACE_TRACE ("ACE_RB_Tree_Node::color accessor"); - return color_; -} - - -// Accessor for node's parent pointer. - -template -ACE_INLINE ACE_RB_Tree_Node * -ACE_RB_Tree_Node::parent () -{ - ACE_TRACE ("ACE_RB_Tree_Node::parent accessor"); - return parent_; -} - - -// Mutator for node's parent pointer. - -template -ACE_INLINE void -ACE_RB_Tree_Node::parent (ACE_RB_Tree_Node * p) -{ - ACE_TRACE ("ACE_RB_Tree_Node::parent mutator"); - parent_ = p; -} - - - -// Accessor for node's left child pointer. - -template -ACE_INLINE ACE_RB_Tree_Node * -ACE_RB_Tree_Node::left () -{ - ACE_TRACE ("ACE_RB_Tree_Node::left accessor"); - return left_; -} - - -// Mutator for node's left child pointer. - -template -ACE_INLINE void -ACE_RB_Tree_Node::left (ACE_RB_Tree_Node * l) -{ - ACE_TRACE ("ACE_RB_Tree_Node::left mutator"); - left_ = l; -} - - -// Accessor for node's right child pointer. - -template -ACE_INLINE ACE_RB_Tree_Node * -ACE_RB_Tree_Node::right () -{ - ACE_TRACE ("ACE_RB_Tree_Node::right accessor"); - return right_; -} - - -// Mutator for node's right child pointer. - -template -ACE_INLINE void -ACE_RB_Tree_Node::right (ACE_RB_Tree_Node * r) -{ - ACE_TRACE ("ACE_RB_Tree_Node::right mutator"); - right_ = r; -} - - - -//////////////////////////////////////////////////////////////////////// -// template class ACE_RB_Tree // -//////////////////////////////////////////////////////////////////////// - - -// Initialize an RB Tree. - -template -ACE_INLINE int -ACE_RB_Tree::open (ACE_Allocator *alloc) -{ - ACE_TRACE ("ACE_RB_Tree::open"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - // Calling this->close_i () ensures we release previously allocated - // memory before allocating new memory. - this->close_i (); - - // If we were passed an allocator use it, - // otherwise use the default instance. - - if (alloc == 0) - alloc = ACE_Allocator::instance (); - - this->allocator_ = alloc; - - return 0; -} - -// Close down an RB_Tree and release dynamically allocated -// resources. - -template -ACE_INLINE int -ACE_RB_Tree::close (void) -{ - ACE_TRACE ("ACE_RB_Tree::close"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - return this->close_i (); -} - - -// Associate with . If is already in the -// tree then the is not changed. Returns 0 if a -// new entry is bound successfully, returns 1 if an attempt is made -// to bind an existing entry, and returns -1 if failures occur. - -template -ACE_INLINE int -ACE_RB_Tree::bind (const EXT_ID &ext_id, - const INT_ID &int_id) -{ - ACE_TRACE ("ACE_RB_Tree::bind (const EXT_ID &item, const INT_ID &int_id)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - ACE_RB_Tree_Node *entry; - return this->insert_i (ext_id, int_id, entry); -} - - -// Same as a normal bind, except the tree entry is also passed back -// to the caller. The entry in this case will either be the newly -// created entry, or the existing one. - -template -ACE_INLINE int -ACE_RB_Tree::bind (const EXT_ID &ext_id, - const INT_ID &int_id, - ACE_RB_Tree_Node *&entry) -{ - ACE_TRACE ("ACE_RB_Tree" - "::bind (const EXT_ID &ext_id, const INT_ID &int_id, " - "ACE_RB_Tree_Node *&entry)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - return this->insert_i (ext_id, int_id, entry); -} - - -// Associate with if and only if is not -// in the tree. If is already in the tree then the -// parameter is assigned the existing value in the tree. Returns 0 -// if a new entry is bound successfully, returns 1 if an attempt is -// made to bind an existing entry, and returns -1 if failures occur. - -template -ACE_INLINE int -ACE_RB_Tree::trybind (const EXT_ID &ext_id, - INT_ID &int_id) -{ - ACE_TRACE ("ACE_RB_Tree::" - "trybind (const EXT_ID &ext_id, INT_ID &int_id)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - ACE_RB_Tree_Node *entry; - int result = this->insert_i (ext_id, int_id, entry); - - if (result == 1) - { - int_id = entry->item (); - } - - return result; -} - - -// Same as a normal trybind, except the tree entry is also passed -// back to the caller. The entry in this case will either be the -// newly created entry, or the existing one. - -template -ACE_INLINE int -ACE_RB_Tree::trybind (const EXT_ID &ext_id, - INT_ID &int_id, - ACE_RB_Tree_Node *&entry) -{ - ACE_TRACE ("ACE_RB_Tree::" - "trybind (const EXT_ID &ext_id, INT_ID &int_id, " - "ACE_RB_Tree_Node *&entry)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - int result = this->insert_i (ext_id, int_id, entry); - - if (result == 1) - { - int_id = entry->item (); - } - - - return result; -} - - -// Reassociate with . If is not in the -// tree then behaves just like . Returns 0 if a new entry is -// bound successfully, returns 1 if an existing entry was rebound, -// and returns -1 if failures occur. - -template -ACE_INLINE int -ACE_RB_Tree::rebind (const EXT_ID &ext_id, - const INT_ID &int_id) -{ - ACE_TRACE ("ACE_RB_Tree::" - "rebind (const EXT_ID &ext_id, const INT_ID &int_id)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - ACE_RB_Tree_Node *entry; - int result = this->insert_i (ext_id, int_id, entry); - - if (result == 1) - { - entry->key () = ext_id; - entry->item () = int_id; - } - - return result; -} - - -// Same as a normal rebind, except the tree entry is also passed back -// to the caller. The entry in this case will either be the newly -// created entry, or the existing one. - -template -ACE_INLINE int -ACE_RB_Tree::rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - ACE_RB_Tree_Node *&entry) -{ - ACE_TRACE ("ACE_RB_Tree::" - "rebind (const EXT_ID &ext_id, const INT_ID &int_id, " - "ACE_RB_Tree_Node *&entry)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - int result = this->insert_i (ext_id, int_id, entry); - - if (result == 1) - { - entry->key () = ext_id; - entry->item () = int_id; - } - - return result; -} - - -// Associate with . If is not in the tree -// then behaves just like . Otherwise, store the old value of -// into the "out" parameter and rebind the new parameters. -// Returns 0 if a new entry is bound successfully, returns 1 if an -// existing entry was rebound, and returns -1 if failures occur. - -template -ACE_INLINE int -ACE_RB_Tree::rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - INT_ID &old_int_id) -{ - ACE_TRACE ("ACE_RB_Tree::" - "rebind (const EXT_ID &ext_id, const INT_ID &int_id, INT_ID &old_int_id)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - ACE_RB_Tree_Node *entry; - int result = this->insert_i (ext_id, int_id, entry); - - if (result == 1) - { - old_int_id = entry->item (); - entry->key () = ext_id; - entry->item () = int_id; - } - - return result; -} - - -// Same as a normal rebind, except the tree entry is also passed back -// to the caller. The entry in this case will either be the newly -// created entry, or the existing one. - -template -ACE_INLINE int -ACE_RB_Tree::rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - INT_ID &old_int_id, - ACE_RB_Tree_Node *&entry) -{ - ACE_TRACE ("ACE_RB_Tree::" - "rebind (const EXT_ID &ext_id, const INT_ID &int_id," - "INT_ID &old_int_id, ACE_RB_Tree_Node *&entry)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - int result = this->insert_i (ext_id, int_id, entry); - - if (result == 1) - { - old_int_id = entry->item (); - entry->key () = ext_id; - entry->item () = int_id; - } - - return result; -} - - -// Associate with . If is not in the tree -// then behaves just like . Otherwise, store the old values -// of and into the "out" parameters and rebind the -// new parameters. This is very useful if you need to have an -// atomic way of updating and you also need -// full control over memory allocation. Returns 0 if a new entry is -// bound successfully, returns 1 if an existing entry was rebound, -// and returns -1 if failures occur. - -template -ACE_INLINE int -ACE_RB_Tree::rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - EXT_ID &old_ext_id, - INT_ID &old_int_id) -{ - ACE_TRACE ("ACE_RB_Tree::" - "rebind (const EXT_ID &ext_id, const INT_ID &int_id," - "EXT_ID &old_ext_id, INT_ID &old_int_id)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - ACE_RB_Tree_Node *entry; - int result = this->insert_i (ext_id, int_id, entry); - - if (result == 1) - { - old_ext_id = entry->key (); - old_int_id = entry->item (); - entry->key () = ext_id; - entry->item () = int_id; - } - - return result; -} - - -// Same as a normal rebind, except the tree entry is also passed back -// to the caller. The entry in this case will either be the newly -// created entry, or the existing one. - -template -ACE_INLINE int -ACE_RB_Tree::rebind (const EXT_ID &ext_id, - const INT_ID &int_id, - EXT_ID &old_ext_id, - INT_ID &old_int_id, - ACE_RB_Tree_Node *&entry) -{ - ACE_TRACE ("ACE_RB_Tree::" - "rebind (const EXT_ID &ext_id, const INT_ID &int_id, " - "EXT_ID &old_ext_id, INT_ID &old_int_id, " - "ACE_RB_Tree_Node *&entry)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - int result = this->insert_i (ext_id, int_id, entry); - - if (result == 1) - { - old_ext_id = entry->key (); - old_int_id = entry->item (); - entry->key () = ext_id; - entry->item () = int_id; - } - - return result; -} - - -// Locate and pass out parameter via . If found, -// return 0, returns -1 if not found. - -template -ACE_INLINE int -ACE_RB_Tree::find (const EXT_ID &ext_id, - INT_ID &int_id) -{ - ACE_TRACE ("ACE_RB_Tree::" - "find (const EXT_ID &ext_id, INT_ID &int_id)"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - ACE_RB_Tree_Node *entry = 0; - - int result = this->find_i (ext_id, entry); - if (result == 0) - { - int_id = entry->item (); - } - - return result; -} - -// Locate and pass out parameter via . If found, -// return 0, returns -1 if not found. - -template -ACE_INLINE int -ACE_RB_Tree::find (const EXT_ID &ext_id, - ACE_RB_Tree_Node *&entry) -{ - ACE_TRACE ("ACE_RB_Tree::" - "find (const EXT_ID &ext_id, ACE_RB_Tree_Node *&entry)"); - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - return this->find_i (ext_id, entry); -} - - -// Unbind (remove) the from the tree. Don't return the -// to the caller (this is useful for collections where the -// s are *not* dynamically allocated...). - -template -ACE_INLINE int -ACE_RB_Tree::unbind (const EXT_ID &ext_id) -{ - ACE_TRACE ("ACE_RB_Tree::unbind (const EXT_ID &ext_id)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - INT_ID int_id; - int result = this->remove_i (ext_id, int_id); - - // Remap the return codes from the internal method: this - // is maintained this way in support of deprecated methods, - // and will be cleaned up when these methods are removed. - switch (result) - { - case 1: - // If the node was found and deleted, return success. - return 0; - case 0: - // If nothing was found, set errno and break. - errno = ENOENT; - break; - case -1: - // If an error happened, just break. - break; - } - - // Return an error if we didn't already return success. - return -1; -} - - -// Break any association of . Returns the value of -// in case the caller needs to deallocate memory. - -template -ACE_INLINE int -ACE_RB_Tree::unbind (const EXT_ID &ext_id, - INT_ID &int_id) -{ - ACE_TRACE ("ACE_RB_Tree::" - "unbind (const EXT_ID &ext_id, INT_ID &int_id)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - int result = this->remove_i (ext_id, int_id); - - // Remap the return codes from the internal method: this - // is maintained this way in support of deprecated methods, - // and will be cleaned up when these methods are removed. - switch (result) - { - case 1: - // If the node was found and deleted, return success. - return 0; - case 0: - // If nothing was found, set errno and break. - errno = ENOENT; - break; - case -1: - // If an error happened, just break. - break; - } - - // Return an error if we didn't already return success. - return -1; -} - - -// Remove entry from the tree. This method should be used with *extreme* -// caution, and only for optimization purposes. The node being passed -// in had better have been allocated by the tree that is unbinding it. -template -ACE_INLINE int -ACE_RB_Tree::unbind (ACE_RB_Tree_Node *entry) -{ - ACE_TRACE ("ACE_RB_Tree::unbind (ACE_RB_Tree_Node *entry)"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - return this->remove_i (entry); -} - - -// Returns a reference to the underlying . This makes it -// possible to acquire the lock explicitly, which can be useful in -// some cases if you instantiate the with an -// or , or if you need to -// guard the state of an iterator. NOTE: the right name would be -// , but HP/C++ will choke on that! - -template -ACE_INLINE ACE_LOCK & -ACE_RB_Tree::mutex (void) -{ - ACE_TRACE ("ACE_RB_Tree::mutex"); - return this->lock_; -} - - -// Dump the state of an object. - -template -ACE_INLINE void -ACE_RB_Tree::dump (void) const -{ - ACE_TRACE ("ACE_RB_Tree::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncurrent_size_ = %d"), this->current_size_)); - this->allocator_->dump (); - this->lock_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - - -// Return forward iterator positioned at first node in tree. - -template -ACE_INLINE ACE_RB_Tree_Iterator -ACE_RB_Tree::begin (void) -{ - ACE_TRACE ("ACE_RB_Tree::begin"); - - return ACE_RB_Tree_Iterator (*this); -} - - -// Return forward iterator positioned at last node in tree. - -template -ACE_INLINE ACE_RB_Tree_Iterator -ACE_RB_Tree::end (void) -{ - ACE_TRACE ("ACE_RB_Tree::end"); - - return ACE_RB_Tree_Iterator (); -} - - -// Return reverse iterator positioned at last node in tree. - -template -ACE_INLINE ACE_RB_Tree_Reverse_Iterator -ACE_RB_Tree::rbegin (void) -{ - ACE_TRACE ("ACE_RB_Tree::rbegin"); - - return ACE_RB_Tree_Reverse_Iterator (*this); -} - - -// Return reverse iterator positioned at first node in tree. - -template -ACE_INLINE ACE_RB_Tree_Reverse_Iterator -ACE_RB_Tree::rend (void) -{ - ACE_TRACE ("ACE_RB_Tree::rend"); - - return ACE_RB_Tree_Reverse_Iterator (); -} - - -// Returns a pointer to the item corresponding to the given key, -// or 0 if it cannot find the key in the tree. DEPRECATED. - -template -ACE_INLINE INT_ID* -ACE_RB_Tree::find (const EXT_ID &k) -{ - ACE_TRACE ("ACE_RB_Tree::find (const EXT_ID &k)"); - - // The reinterpret cast is to ensure that when this deprecated method is removed, and - // is replaced (as planned) by a find method that takes the same argument signature - // but returns an int, that the compiler will cough if this return macro is not - // changed to just return an int (whose value will be -1). Please leave this as is. - ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, ACE_reinterpret_cast(INT_ID*, 0L)); - - ACE_RB_Tree_Node *entry; - int result = this->find_i (k, entry); - return (result == 0) ? &(entry->item ()) : 0; -} - -// Inserts a *copy* of the key and the item into the tree: -// both the key type EXT_ID and the item type INT_ID must have well -// defined semantics for copy construction and < comparison. -// This method returns a pointer to the inserted item copy, -// or 0 if an error occurred. NOTE: if an identical key -// already exists in the tree, no new item is created, and -// the returned pointer addresses the existing item -// associated with the existing key. DEPRECATED. - -template -ACE_INLINE INT_ID* -ACE_RB_Tree::insert (const EXT_ID &k, const INT_ID &t) -{ - ACE_TRACE ("ACE_RB_Tree::insert"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, ACE_reinterpret_cast(INT_ID*, 0L)); - - return this->insert_i (k, t); -} - - -// Removes the item associated with the given key from the -// tree and destroys it. Returns 1 if it found the item -// and successfully destroyed it, 0 if it did not find the -// item, or -1 if an error occurred. DEPRECATED. - -template -ACE_INLINE int -ACE_RB_Tree::remove (const EXT_ID &k) -{ - ACE_TRACE ("ACE_RB_Tree::remove"); - ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - INT_ID i; - return this->remove_i (k, i); -} - - -// Destroys all nodes and sets the root pointer null. DEPRECATED - -template -ACE_INLINE void -ACE_RB_Tree::clear () -{ - ACE_TRACE ("ACE_RB_Tree::clear"); - ACE_WRITE_GUARD (ACE_LOCK, ace_mon, this->lock_); - - this->close_i (); -} - -// Returns the current number of nodes in the tree. - -template -ACE_INLINE size_t -ACE_RB_Tree::current_size () const -{ - ACE_TRACE ("ACE_RB_Tree::current_size"); - return current_size_; -} - - -/////////////////////////////////////////////////////////////////////// -// template class // -// ACE_RB_Tree_Iterator_Base // -/////////////////////////////////////////////////////////////////////// - -template -ACE_INLINE -ACE_RB_Tree_Iterator_Base::ACE_RB_Tree_Iterator_Base (void) - : tree_ (0), node_ (0) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::ACE_RB_Tree_Iterator_Base (void)"); -} - -// Returns 1 when the iteration has completed, otherwise 0. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator_Base::done (void) const -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::done"); - - return node_ ? 0 : 1; -} - - -// STL-like iterator dereference operator: returns a reference -// to the node underneath the iterator. - -template -ACE_INLINE ACE_RB_Tree_Node & -ACE_RB_Tree_Iterator_Base::operator* (void) const -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::operator*"); - return *(this->node_); -} - - -// Returns a reference to the tree over which we're iterating. - -template ACE_INLINE const ACE_RB_Tree & -ACE_RB_Tree_Iterator_Base::tree (void) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::tree"); - return *tree_; -} - - -// Comparison operator: returns 1 if both iterators point to the same position, otherwise 0. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator_Base::operator== - (const ACE_RB_Tree_Iterator_Base &rbt) const -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::operator=="); - return (this->node_ == rbt.node_) ? 1 : 0; -} - - -// Comparison operator: returns 1 if the iterators point to different positions, otherwise 0. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator_Base::operator!= - (const ACE_RB_Tree_Iterator_Base &rbt) const -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::operator!="); - return (this->node_ == rbt.node_) ? 0 : 1; -} - - -// Move forward by one element in the tree. Returns 0 when -// there are no more elements in the tree, otherwise 1. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator_Base::forward_i (void) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::forward_i"); - - node_ = tree_->RB_tree_successor (node_); - return node_ ? 1 : 0; -} - - -// Move back by one element in the tree. Returns 0 when -// there are no more elements in the tree, otherwise 1. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator_Base::reverse_i (void) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::reverse_i"); - - node_ = tree_->RB_tree_predecessor (node_); - return node_ ? 1 : 0; -} - - -// Dump the state of an object. - -template -ACE_INLINE void -ACE_RB_Tree_Iterator_Base::dump_i (void) const -{ - ACE_TRACE ("ACE_RB_Tree_Iterator_Base::dump_i"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("node_ = %x"), this->node_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - - -////////////////////////////////////////////////////////////////// -// template class // -// ACE_RB_Tree_Iterator // -////////////////////////////////////////////////////////////////// - -template -ACE_INLINE -ACE_RB_Tree_Iterator::ACE_RB_Tree_Iterator (void) - : ACE_RB_Tree_Iterator_Base () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::ACE_RB_Tree_Iterator (void)"); -} - -// Move forward by one element in the tree. Returns -// 0 when all elements have been seen, else 1. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator::advance (void) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::advance"); - - return this->forward_i (); -} - - -// Dump the state of an object. - -template -ACE_INLINE void -ACE_RB_Tree_Iterator::dump (void) const -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::dump"); - - this->dump_i (); -} - - -// Prefix advance. - -template -ACE_INLINE ACE_RB_Tree_Iterator & -ACE_RB_Tree_Iterator::operator++ (void) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator operator++ (void)"); - - this->forward_i (); - return *this; -} - - -// Postfix advance. - -template -ACE_INLINE ACE_RB_Tree_Iterator -ACE_RB_Tree_Iterator::operator++ (int) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator operator++ (int)"); - - ACE_RB_Tree_Iterator retv (*this); - this->forward_i (); - return retv; -} - - -// Prefix reverse. - -template -ACE_INLINE ACE_RB_Tree_Iterator & -ACE_RB_Tree_Iterator::operator-- (void) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator operator-- (void)"); - - this->reverse_i (); - return *this; -} - - -// Postfix reverse. - -template -ACE_INLINE ACE_RB_Tree_Iterator -ACE_RB_Tree_Iterator::operator-- (int) -{ - ACE_TRACE ("ACE_RB_Tree_Iterator operator-- (int)"); - - ACE_RB_Tree_Iterator retv (*this); - this->reverse_i (); - return retv; -} - - -// Passes back the under the iterator. Returns 0 if -// the iteration has completed, otherwise 1. This method must -// be declared and defined in both the derived forward and -// reverse iterator classes rather than in the base iterator -// class because of a method signature resolution problem -// caused by the existence of the deprecated next (void) -// method in the derived forward iterator class. When that -// deprecated method is removed, this method should be removed -// from the derived classes and placed in the base class. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator::next (ACE_RB_Tree_Node *&next_entry) const -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::next"); - - if (this->node_) - { - next_entry = this->node_; - return 1; - } - - return 0; -} - - -// Accessor for key of node under iterator (if any). DEPRECATED. - -template -ACE_INLINE EXT_ID * -ACE_RB_Tree_Iterator::key () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::key"); - return this->node_ ? (&(this->node_->key ())) : 0; -} - - -// Accessor for item of node under iterator (if any). DEPRECATED. - -template -ACE_INLINE INT_ID * -ACE_RB_Tree_Iterator::item () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::item"); - return this->node_ ? (&(this->node_->item ())) : 0; -} - - -// Move to the first item in the tree. DEPRECATED. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator::first () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::first"); - this->node_ = this->tree_->RB_tree_minimum (this->tree_->root_); - return this->node_ ? 1 : 0; -} - - -// Move to the last item in the tree. DEPRECATED. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator::last () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::last"); - this->node_ = this->tree_->RB_tree_maximum (this->tree_->root_); - return this->node_ ? 1 : 0; -} - - -// Moves to the next item in the tree, -// returns 1 if there is a next item, 0 otherwise. DEPRECATED. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator::next () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::next"); - this->node_ = this->tree_->RB_tree_successor (this->node_); - return this->node_ ? 1 : 0; -} - - -// Moves to the previous item in the tree, -// returns 1 if there is a previous item, 0 otherwise. DEPRECATED. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator::previous () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::previous"); - this->node_ = this->tree_->RB_tree_predecessor (this->node_); - return this->node_ ? 1 : 0; -} - - -// Returns 0 if the iterator is positioned over a valid ACE_RB_Tree -// node, returns 1 if not. DEPRECATED. - -template -ACE_INLINE int -ACE_RB_Tree_Iterator::is_done () -{ - ACE_TRACE ("ACE_RB_Tree_Iterator::is_done"); - return this->node_ ? 0 : 1; -} - - -////////////////////////////////////////////////////////////////////////// -// template class // -// ACE_RB_Tree_Reverse_Iterator // -////////////////////////////////////////////////////////////////////////// - - -template -ACE_INLINE -ACE_RB_Tree_Reverse_Iterator::ACE_RB_Tree_Reverse_Iterator (void) - : ACE_RB_Tree_Iterator_Base () -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::ACE_RB_Tree_Reverse_Iterator (void)"); -} - -// Move forward by one element in the tree. Returns -// 0 when all elements have been seen, else 1. - -template -ACE_INLINE int -ACE_RB_Tree_Reverse_Iterator::advance (void) -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::advance"); - - return this->reverse_i (); -} - - -// Dump the state of an object. - -template -ACE_INLINE void -ACE_RB_Tree_Reverse_Iterator::dump (void) const -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::dump"); - - this->dump_i (); -} - - -// Prefix advance. - -template -ACE_INLINE ACE_RB_Tree_Reverse_Iterator & -ACE_RB_Tree_Reverse_Iterator::operator++ (void) -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::operator++ (void)"); - - this->reverse_i (); - return *this; -} - - -// Postfix advance. - -template -ACE_INLINE ACE_RB_Tree_Reverse_Iterator -ACE_RB_Tree_Reverse_Iterator::operator++ (int) -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::operator++ (int)"); - - ACE_RB_Tree_Reverse_Iterator retv (*this); - this->reverse_i (); - return retv; -} - - -// Prefix reverse. - -template -ACE_INLINE ACE_RB_Tree_Reverse_Iterator & -ACE_RB_Tree_Reverse_Iterator::operator-- (void) -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::operator-- (void)"); - - this->forward_i (); - return *this; -} - - -// Postfix reverse. - -template -ACE_INLINE ACE_RB_Tree_Reverse_Iterator -ACE_RB_Tree_Reverse_Iterator::operator-- (int) -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::operator-- (int)"); - - ACE_RB_Tree_Reverse_Iterator retv (*this); - this->forward_i (); - return retv; -} - - -// Passes back the under the iterator. Returns 0 if -// the iteration has completed, otherwise 1. This method must -// be declared and defined in both the derived forward and -// reverse iterator classes rather than in the base iterator -// class because of a method signature resolution problem -// caused by the existence of the deprecated next (void) -// method in the derived forward iterator class. When that -// deprecated method is removed, this method should be removed -// from the derived classes and placed in the base class. - -template -ACE_INLINE int -ACE_RB_Tree_Reverse_Iterator::next (ACE_RB_Tree_Node *&next_entry) const -{ - ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator::next"); - - if (this->node_) - { - next_entry = this->node_; - return 1; - } - - return 0; -} diff --git a/ace/README b/ace/README deleted file mode 100644 index b101fddf2dc..00000000000 --- a/ace/README +++ /dev/null @@ -1,1502 +0,0 @@ -// $Id$ - -ACE Portability Macros ----------------------- - -The following describes the meaning of the C++ compiler macros that -can be set in the config*.h file. When you port ACE to a new platform -and/or C++ compiler, make sure that you check to see which of these -need to be defined. It's helpful to check the various config*.h files -in this directory to see what's already been defined. If you need to -add new macros, please send them to me and I'll add them to this file. - -Eventually, most of this information should be auto-discovered via GNU -autoconf, which Ossama Othman is working on, at -http://www.cs.wustl.edu/~othman/aceconf/. - -Macro Description ------ ----------- - -ACE_CAST_CONST Used to work around broken - SunCC ANSI casts that require - an extra const. -ACE_DEFINES_DEFAULT_WIN32_SECURITY_ATTRIBUTES - Win32 only. Users want to use - a predefined security - attributes defined in - ACE_OS::default_win32_security_attributes - as the default security - object. -ACE_DISABLE_DEBUG_DLL_CHECK Define this if you don't want - debug version ACE search for - debug version DLLs first - before looking for the DLL - names specified. -ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER - Application will allocate its - own object manager. This - implicitly defines - ACE_HAS_NONSTATIC_OBJECT_MANAGER. - Usually used with MFC - applications. -ACE_MAIN Renames "main (int, char *[])", - for platforms such as g++/VxWorks - that don't allow "main". Requires - the use of - ACE_HAS_NONSTATIC_OBJECT_MANAGER. -ACE_MT_SAFE Compile using multi-thread libraries -ACE_NDEBUG Turns off debugging features -ACE_NEW_THROWS_EXCEPTIONS Compiler's 'new' throws exception on - failure (ANSI C++ behavior). -ACE_NLOGGING Turns off the LM_DEBUG and - LM_ERROR logging macros... -ACE_NTRACE Turns off the tracing feature. -ACE_PAGE_SIZE Defines the page size of the - system (not used on Win32 or - with ACE_HAS_GETPAGESIZE). -ACE_REDEFINES_XTI_FUNCTIONS Platform redefines the t_... names (UnixWare) -ACE_SELECT_USES_INT Platform uses int for select() - rather than fd_set -ACE_TEMPLATES_REQUIRE_PRAGMA Compiler's template mechanism - must use a pragma This is used - for AIX's C++ compiler. -ACE_TEMPLATES_REQUIRE_SOURCE Compiler's template mechanim - must see source code (i.e., - .cpp files). This is used for - GNU G++. -ACE_TIMER_SKEW If a timed ::select () can return - early, then ACE_TIMER_SKEW is the - maximum adjustment, in microseconds, - that ACE_Timer_Queue uses to - compensate for the early return. -ACE_TLI_TCP_DEVICE Device the platform uses for TCP on - TLI. Only needed if not /dev/tcp. -ACE_USE_POLL The OS platform supports the - poll() event demultiplexor -ACE_USES_ASM_SYMBOL_IN_DLSYM Platform uses assembly symbols - instead of C symbols in - dlsym() -ACE_USES_STATIC_MFC When linking MFC as a static library is desired -ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB Platform has its standard c++ - library in the namespace std. -ACE_WSOCK_VERSION A parameter list indicating - the version of WinSock (e.g., - "1, 1" is version 1.1). - -ACE_HAS_AIO_CALLS Platform supports POSIX aio* calls. -ACE_HAS_ALT_CUSERID Use ACE's alternate cuserid() - implementation since a system - cuserid() may not exist, or it - is not desirable to use it. - The implementation requires - ACE_LACKS_PWD_FUNCTIONS to be - undefined and that the - geteuid() system call exists. -ACE_HAS_ANSI_CASTS Platform supports new C++ - style casts (dynamic_cast, - static_cast, reinterpret_cast - and const_cast) -ACE_DEFAULT_THREAD_KEYS Number of TSS keys, with - ACE_HAS_TSS_EMULATION _only_. - Defaults to 64. -ACE_DEFAULT_LD_SEARCH_PATH Specify the platform default search - paths. This macro should only be - defined on platforms that don't - support environment variables at all - (i.e., Windows CE.) -ACE_THREADS_DONT_INHERIT_LOG_MSG Specify this if you don't want - threads to inherit parent - thread's ACE_Log_Msg - properties. -ACE_THREAD_MANAGER_USES_SAFE_SPAWN Disable the "check before lock" feature - in ACE_Thread_Manager. Defining this - macro avoids a potential race condition - on platforms with aggressive read/write - reordering. -ACE_HAS_GNUG_PRE_2_8 Compiling with g++ prior to - version 2.8.0. -ACE_HAS_ONE_DEFINITION_RULE Compiler enforces C++ One - Definition Rule -ACE_HAS_PRIOCNTL OS has priocntl (2). -ACE_HAS_RECURSIVE_MUTEXES Mutexes are inherently recursive (e.g., Win32) -ACE_HAS_RECV_TIMEDWAIT Platform has the MIT pthreads - APIs for -ACE_HAS_RECVFROM_TIMEDWAIT timed send/recv operations -ACE_HAS_RECVMSG_TIMEDWAIT -ACE_HAS_RLIMIT_RESOURCE_ENUM Platform has enum instead of - int for first argument to - ::{get,set}rlimit (). The - value of this macro is the - enum definition, e.g., enum - __rlimit_resource, for Linux - glibc 2.0. -ACE_HAS_RUSAGE_WHO_ENUM Platform has enum instead of - int for first argument to - ::getrusage (). The value of - this macro is the enum - definition, e.g., enum - __rusage_who, for Linux glibc - 2.0. -ACE_HAS_SEND_TIMEDWAIT -ACE_HAS_SENDTO_TIMEDWAIT -ACE_HAS_SENDMSG_TIMEDWAIT -ACE_HAS_STDARG_THR_DEST Platform has void (*)(...) - prototype for - pthread_key_create() - destructor (e.g., LynxOS). -ACE_HAS_STL_MAP_CONFLICT Used when users want to - compile ACE with STL and STL - map class conflicts with - map struct. -ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS Platform/compiler supports - Win32 structural exceptions -ACE_HAS_READ_TIMEDWAIT -ACE_HAS_READV_TIMEDWAIT -ACE_HAS_WRITE_TIMEDWAIT -ACE_HAS_WRITEV_TIMEDWAIT -ACE_HAS_4_4BSD_SENDMSG_RECVMSG Platform has BSD 4.4 - sendmsg()/recvmsg() APIs. -ACE_HAS_P_READ_WRITE Platform has pread() and - pwrite() support -ACE_HAS_64BIT_LONGS Platform has 64bit longs and - 32bit ints. NOTE: this macro - is deprecated. Instead, use - ACE_SIZEOF_LONG == 8. -ACE_HAS_AIX_BROKEN_SOCKET_HEADER Platform, such as AIX4, needs - to wrap #include of - sys/socket.h with - #undef/#define of - __cplusplus. -ACE_HAS_AIX_HI_RES_TIMER Platform has AIX4 - ::read_real_time () -ACE_HAS_ALLOCA Compiler/platform supports - alloca() -ACE_HAS_ALLOCA_H Compiler/platform has - -ACE_HAS_ALPHA_TIMER CPU is an Alpha, with the rpcc - instruction to read the tick timer. - Limited to 32 bits, so not recommended. -ACE_HAS_AUTOMATIC_INIT_FINI Compiler/platform correctly - calls init()/fini() for shared - libraries -ACE_HAS_BIG_FD_SET Compiler/platform has typedef - u_long fdmask (e.g., Linux and - SCO). -ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR - Compiler handles explicit calling of - template destructor correctly. See - "ace/OS.h" for details. -ACE_HAS_BROKEN_ACCEPT_ADDR Platform can't correctly deal - with a NULL addr to accept() - (e.g, VxWorks). -ACE_HAS_BROKEN_NAMESPACES Compiler/platform doesn't - support namespaces (or the - support is not fully - implemented.) -ACE_HAS_BROKEN_BITSHIFT Compiler has integer overflow - problem with bit-shift - operations. -ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS Compiler can't handle const char * - as rvalue in conditional operator. -ACE_HAS_BROKEN_CONVERSIONS Compiler can't handle calls - like foo->operator T *() -ACE_HAS_BROKEN_CTIME Compiler/platform uses macro - for ctime (e.g., MVS) -ACE_HAS_BROKEN_DGRAM_SENDV Platform sendv() does not work - properly with datagrams, - i.e. it fails when the iovec - size is IOV_MAX. -ACE_HAS_BROKEN_ENUMS Compiler can't handle large - enums (e.g., HP/UX C++) -ACE_HAS_BROKEN_HPUX_TEMPLATES Earlier versions of HP/UX C++ - are damned... -ACE_HAS_BROKEN_MAP_FAILED Platform doesn't cast MAP_FAILED - to a void *. -ACE_HAS_BROKEN_MSG_H Platform headers don't support - prototypes -ACE_HAS_BROKEN_MMAP_H HP/UX does not wrap the - mmap(2) header files with - extern "C". -ACE_HAS_BROKEN_NESTED_TEMPLATES MSVC has trouble with defining - STL containers for nested - structs and classes -ACE_HAS_BROKEN_NON_BLOCKING_CONNECTS Platform has a bug with - non-blocking connects (e.g., - WinNT 4.0) -ACE_HAS_BROKEN_POSIX_TIME Platform defines struct - timespec in -ACE_HAS_BROKEN_RANDR OS/compiler's header files are - inconsistent with libC - definition of rand_r(). -ACE_HAS_BROKEN_READV() OS/Compiler's header files are - not consistent with readv() - definition. -ACE_HAS_BROKEN_SAP_ANY Compiler can't handle the - static ACE_Addr::sap_any - construct. -ACE_HAS_BROKEN_SENDMSG OS/compiler omits the const - from the sendmsg() prototype. -ACE_HAS_BROKEN_SETRLIMIT OS/compiler omits the const - from the rlimit parameter in - the setrlimit() prototype. -ACE_HAS_BROKEN_T_ERROR Compiler/platform has the wrong - prototype for t_error(), i.e., - t_error(char *) rather than - t_error(const char *). -ACE_HAS_BROKEN_TIMESPEC_MEMBERS platform define struct - timespec members as ts_sec and - ts_nsec instead of tv_sec and - tv_nsec. This is highly - non-portable. Currently only - FreeBSD 2.1.x uses it. -ACE_HAS_BROKEN_WRITEV OS/compiler omits the const - from the iovec parameter in - the writev() prototype. -ACE_HAS_BROKEN_XTI_MACROS OS header files have some - problems with XTI (HP/UX 11). -ACE_HAS_BSTRING Platform has - (which contains bzero() - prototype) -ACE_HAS_BYTESEX_H Platform has . -ACE_HAS_CANCEL_IO Platform supports the Win32 - CancelIO() function (WinNT 4.0 - and beyond). -ACE_HAS_CHARPTR_DL OS/platform uses char * for - dlopen/dlsym args, rather than - const char *. -ACE_HAS_CHARPTR_SOCKOPT OS/platform uses char * for - sockopt, rather than const - char * -ACE_HAS_CHARPTR_SPRINTF sprintf() returns char * - rather than int (e.g., SunOS - 4.x) -ACE_HAS_CLOCK_GETTIME Platform supports POSIX 1.b - clock_gettime () -ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES Prototypes for both signal() - and struct sigaction are - consistent. -ACE_HAS_CPLUSPLUS_HEADERS Compiler/platform has - correctly prototyped header - files -ACE_HAS_CYGWIN32_SOCKET_H Platform has cygwin32 socket.h -ACE_HAS_DIRENT Compiler/platform has Dirent - iterator functions -ACE_HAS_DLFCN_H_BROKEN_EXTERN_C For platforms, e.g., RedHat - 4.2/Linux 2.0.30/Alpha, that - don't declare dl* functions as - extern "C" in dlfcn.h. -ACE_HAS_DLL Build ACE using the frigging - PC DLL nonsense... -ACE_HAS_EXCEPTIONS Compiler supports C++ - exception handling -ACE_HAS_EXPLICIT_KEYWORD Compiler support explicit constructors. -ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION Compiler's template - instantiation mechanism - supports the use of explicit - C++ specializations for all - used templates. This is also - used for GNU G++ if you don't - use the "repo" patches. -ACE_HAS_GETPAGESIZE Platform supports - getpagesize() call (otherwise, - ACE_PAGE_SIZE must be defined, - except on Win32) -ACE_HAS_GETRUSAGE Platform supports the - getrusage() system call. -ACE_HAS_GETRUSAGE_PROTO Platform has a getrusage () - prototype in sys/resource.h - that differs from the one in - ace/OS.i. -ACE_HAS_GNUC_BROKEN_TEMPLATE_INLINE_FUNCTIONS GNUC 2.7.3 mistakenly - takes the template definition - as the place where an inline - function of an argument class - is first used. -ACE_HAS_BROKEN_EXTENDED_TEMPLATES GNU CC < 2.8 is broken for - template classes. This label - shortens the template parameter - list by removing the iterator - functionality in the - Cache_Map_Manager class. -ACE_HAS_GNU_CSTRING_H Denotes that GNU has cstring.h - as standard which redefines - memchr() -ACE_HAS_GPERF The GPERF utility is compiled - for this platform -ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT Optimize - ACE_Handle_Set::count_bits for - select() operations (common - case) -ACE_HAS_LLSEEK Platform supports llseek. -ACE_HAS_HI_RES_TIMER Compiler/platform supports - SunOS high resolution timers -ACE_HAS_IDTYPE_T Compiler/platform supports - idtype_t. -ACE_HAS_INLINED_OSCALLS Inline all the static class OS - methods to remove call - overhead -ACE_HAS_IP_MULTICAST Platform supports IP multicast -ACE_HAS_IP6 Platform supports IPv6. -ACE_HAS_IRIX62_THREADS Platform supports the very odd - IRIX 6.2 threads... -ACE_HAS_NONSTATIC_OBJECT_MANAGER Causes the ACE_Object_Manager - instance to be created in main - (int, char *[]), instead of as - a static (global) instance. -ACE_HAS_THR_KEYDELETE Platform supports - thr_keydelete (e.g,. UNIXWARE) -ACE_HAS_THR_MINSTACK Platform calls thr_minstack() - rather than thr_min_stack() - (e.g., Tandem). -ACE_HAS_LIMITED_RUSAGE_T The rusage_t structure has - only two fields. -ACE_HAS_LIMITED_SELECT The select is unable to deal with - large file descriptors. -ACE_HAS_LONG_MAP_FAILED Platform defines MAP_FAILED as - a long constant. -ACE_HAS_MALLOC_STATS Enabled malloc statistics - collection. -ACE_HAS_MEMCHR Use native implementation of memchr. -ACE_HAS_MINIMAL_ACE_OS Disables some #includes in ace/OS.*. -ACE_HAS_MINIMUM_IOSTREAMH_INCLUSION Avoid #including ace/streams.h - in OS.h. Users must include - ace/streams.h, , or - explicitly in - their code. Some platforms, - such as g++/VxWorks, have - trouble compiling templates - and iostreams header because - of static variables in the - stream headers. This flag - will also avoid extra - compilation and runtime - overheads on some platforms. -ACE_HAS_MFC Platform supports Microsoft - Foundation Classes -ACE_HAS_MSG Platform supports recvmsg and - sendmsg -ACE_HAS_MT_SAFE_MKTIME Platform supports MT safe - mktime() call (do any of - them?) -ACE_HAS_MUTABLE_KEYWORD Compiler supports mutable. -ACE_HAS_NONCONST_GETBY Platform uses non-const char * - in calls to gethostbyaddr, - gethostbyname, getservbyname -ACE_HAS_NONCONST_MSGSND Platform has a non-const - parameter to msgsend() (e.g., - SCO). -ACE_HAS_NONCONST_SELECT_TIMEVAL Platform's select() uses - non-const timeval* (only found - on Linux right now) -ACE_HAS_OLD_MALLOC Compiler/platform uses old - malloc()/free() prototypes - (ugh) -ACE_HAS_ONLY_SCHED_OTHER Platform, e.g., Solaris 2.5, - only supports SCHED_OTHER - POSIX scheduling policy. -ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R Uses ctime_r & asctime_r with - only two parameters - vs. three. -ACE_HAS_OPTIMIZED_MESSAGE_QUEUE Use the semaphore - implementation of - ACE_Message_Queue rather than - the emulated condition - variable (NT and VxWorks). -ACE_HAS_ORBIX Platform has Orbix CORBA - implementation -ACE_HAS_OSF_TIMOD_H Platform supports the OSF TLI - timod STREAMS module -ACE_HAS_PENTIUM Platform is an Intel Pentium - microprocessor. -ACE_HAS_POLL Platform contains -ACE_HAS_POSITION_INDEPENDENT_POINTERS Platform supports - "position-independent" features - provided by ACE_Based_Pointer<>. -ACE_HAS_POSIX_NONBLOCK Platform supports POSIX - O_NONBLOCK semantics -ACE_HAS_POSIX_SEM Platform supports POSIX - real-time semaphores (e.g., - VxWorks and Solaris) -ACE_HAS_POSIX_TIME Platform supports the POSIX - struct timespec type -ACE_HAS_PROC_FS Platform supports the /proc - file system and defines tid_t - in -ACE_HAS_POWERPC_TIMER Platform supports PowerPC - time-base register. -ACE_HAS_PRUSAGE_T Platform supports the - prusage_t struct -ACE_HAS_PTHREADS Platform supports POSIX - Pthreads, of one form or - another. This macro says the - platform has a pthreads - variety - should also define - one of the below to say which - one. Also may need some - ACE_HAS_... thing for - extensions. -ACE_HAS_PTHREADS_DRAFT4 Platform's 'Pthreads' is .4a draft 4 -ACE_HAS_PTHREADS_DRAFT6 Platform's 'Pthreads' is .4a draft 6 -ACE_HAS_PTHREADS_DRAFT7 Platform's 'Pthreads' is .1c draft 7 -ACE_HAS_PTHREADS_STD Platform supports POSIX.1c-1995 threads - (This is the final standard - Pthreads). -ACE_HAS_PTHREADS_UNIX98_EXT Platform has the UNIX98 extensions to - Pthreads (susp/cont, rwlocks) -ACE_HAS_PTHREAD_CONDATTR_SETKIND_NP Platform has pthread_condattr_setkind_np(). -ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP Platform has - pthread_mutexattr_setkind_np(). -ACE_HAS_PTHREAD_PROCESS_ENUM pthread.h declares an enum with - PTHREAD_PROCESS_PRIVATE and - PTHREAD_PROCESS_SHARED values. -ACE_HAS_PURIFY Purify'ing. Set by wrapper_macros.GNU. -ACE_HAS_QUANTIFY Quantify'ing. Set by wrapper_macros.GNU. -ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS Platform will recurse - infinitely on thread exits - from TSS cleanup routines - (e.g., AIX). -ACE_HAS_REENTRANT_FUNCTIONS Platform supports reentrant - functions (i.e., all the POSIX - *_r functions). -ACE_HAS_XPG4_MULTIBYTE_CHAR Platform has support for - multi-byte character support - compliant with the XPG4 - Worldwide Portability - Interface wide-character - classification. -ACE_HAS_REGEX Platform supports the POSIX - regular expression library -ACE_HAS_SELECT_H Platform has special header for select(). -ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL For Win32: Use Select_Reactor - as default implementation of - Reactor instead of - WFMO_Reactor. -ACE_HAS_SEMUN Compiler/platform defines a - union semun for SysV shared - memory -ACE_HAS_SET_T_ERRNO Platform has a function to set - t_errno (e.g., Tandem). -ACE_HAS_SIGINFO_T Platform supports SVR4 - extended signals -ACE_HAS_SIGSUSPEND Platform supports sigsuspend() -ACE_HAS_SIGISMEMBER_BUG Platform has bug with - sigismember() (HP/UX 11). -ACE_HAS_SIG_MACROS Platform/compiler has macros - for sig{empty,fill,add,del}set - (e.g., SCO and FreeBSD) -ACE_HAS_SIGNAL_OBJECT_AND_WAIT Platform supports the Win32 - SignalObjectAndWait() function - (WinNT 4.0 and beyond). -ACE_HAS_SIGNAL_SAFE_OS_CALLS Automatically restart OS - system calls when EINTR occurs -ACE_HAS_SIGWAIT Platform/compiler has the - sigwait(2) prototype -ACE_HAS_SIG_ATOMIC_T Compiler/platform defines the - sig_atomic_t typedef -ACE_HAS_SIG_C_FUNC Compiler requires extern "C" - functions for signals. -ACE_HAS_SIN_LEN Platform supports new BSD - inet_addr len field. -ACE_HAS_SIZET_SOCKET_LEN OS/compiler uses size_t * - rather than int * for socket - lengths -ACE_HAS_SOCKADDR_MSG_NAME Platform requires (struct - sockaddr *) for msg_name field - of struct msghdr. -ACE_HAS_SOCKIO_H Compiler/platform provides the - sockio.h file -ACE_HAS_SOCKLEN_T Platform provides socklen_t - type, such as Linux with - glibc2. -ACE_HAS_SPARCWORKS_401_SIGNALS Compiler has brain-damaged - SPARCwork SunOS 4.x signal - prototype... -ACE_HAS_SSIZE_T Compiler supports the ssize_t - typedef -ACE_HAS_STRPTIME Enables ACE_OS::strptime (). -ACE_HAS_STHREADS Platform supports Solaris - threads -ACE_HAS_STANDARD_CPP_LIBRARY Platform/compiler supports - Standard C++ Library -ACE_HAS_STRBUF_T Compiler/platform supports - struct strbuf -ACE_HAS_STRDUP_EMULATION Platform/compiler lacks - strdup() (e.g., VxWorks, - Chorus, WinCE) -ACE_HAS_STREAMS Platform supports STREAMS -ACE_HAS_STREAM_PIPES Platform supports STREAM pipes -ACE_HAS_STRERROR Compiler/platform supports strerror () -ACE_HAS_STRICT Use the STRICT compilation mode on Win32. -ACE_HAS_STRING_CLASS Platform/Compiler supports a - String class (e.g., GNU or - Win32). -ACE_HAS_STRUCT_NETDB_DATA Compiler/platform has strange - hostent API for socket *_r() - calls -ACE_HAS_SUNOS4_GETTIMEOFDAY SunOS 4 style prototype. -ACE_HAS_SUNOS4_SIGNAL_T Compiler has horrible SunOS - 4.x signal handlers... -ACE_HAS_SVR4_DYNAMIC_LINKING Compiler/platform supports - SVR4 dynamic linking semantics -ACE_HAS_SVR4_GETTIMEOFDAY Compiler/platform supports - SVR4 gettimeofday() prototype -ACE_HAS_SVR4_SIGNAL_T Compiler/platform supports - SVR4 signal typedef -ACE_HAS_SVR4_TLI Compiler/platform supports - SVR4 TLI (in particular, - T_GETNAME stuff)... -ACE_HAS_SYSCALL_GETRUSAGE HP/UX has an undefined syscall - for GETRUSAGE... -ACE_HAS_SYSCALL_H Compiler/platform contains the - file. -ACE_HAS_SYSENT_H Platform provides - header -ACE_HAS_SYSINFO Platform supports system - configuration information -ACE_HAS_SYSV_IPC Platform supports System V IPC - (most versions of UNIX, but - not Win32) -ACE_HAS_SYS_ERRLIST Platform/compiler supports - _sys_errlist symbol -ACE_HAS_SYS_FILIO_H Platform provides - header -ACE_HAS_SYS_SIGLIST Compiler/platform supports - _sys_siglist array -ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA Compiler's template - instantiation mechanism - supports the use of "#pragma - instantiate". Edison Design - Group compilers, e.g., SGI C++ - and Green Hills 1.8.8 and - later, support this. -ACE_HAS_TEMPLATE_SPECIALIZATION Compiler implements template - specialization -ACE_HAS_TEMPLATE_TYPEDEFS Compiler implements templates - that support typedefs inside - of classes used as formal - arguments to a template - class. -ACE_HAS_TERM_IOCTLS Platform has terminal ioctl - flags like TCGETS and TCSETS. -ACE_HAS_LAZY_MAP_MANAGER ACE supports lazy Map Managers - that allow deletion of entries - during active iteration. -ACE_HAS_THREADS Platform supports threads -ACE_HAS_THREAD_SAFE_ACCEPT Platform allows multiple - threads to call accept() on - the same port (e.g., WinNT). -ACE_HAS_THREAD_SELF Platform has thread_self() - rather than pthread_self() - (e.g., DCETHREADS and AIX) -ACE_HAS_THREAD_SPECIFIC_STORAGE Compiler/platform has - thread-specific storage -ACE_HAS_THR_C_DEST The pthread_keycreate() - routine *must* take extern C - functions. -ACE_HAS_THR_C_FUNC The pthread_create() routine - *must* take extern C - functions. -ACE_HAS_TIMEZONE_GETTIMEOFDAY Platform/compiler supports - timezone * as second parameter - to gettimeofday() -ACE_HAS_TIMOD_H Platform supports TLI timod - STREAMS module -ACE_HAS_TIUSER_H Platform supports TLI tiuser - header -ACE_HAS_TLI Platform supports TLI. Also - see ACE_TLI_TCP_DEVICE. -ACE_HAS_TLI_PROTOTYPES Platform provides TLI function - prototypes -ACE_HAS_TSS_EMULATION ACE provides TSS emulation. - See also - ACE_DEFAULT_THREAD_KEYS. -ACE_HAS_UALARM Platform supports ualarm() -ACE_HAS_UCONTEXT_T Platform supports ucontext_t - (which is used in the extended - signal API). -ACE_HAS_UNION_WAIT The wait() system call takes a - (union wait *) rather than int - * -ACE_HAS_UNIXWARE_SVR4_SIGNAL_T Has inconsistent SVR4 signal - stuff, but not the same as the - other platforms -ACE_HAS_USING_KEYWORD Compiler supports the new - using keyword for C++ - namespaces. -ACE_HAS_VERBOSE_NOTSUP Prints out console message in - ACE_NOTSUP. Useful for - tracking down origin of - ACE_NOTSUP. -ACE_HAS_VOIDPTR_MMAP Platform requires void * for - mmap(). -ACE_HAS_VOIDPTR_SOCKOPT OS/compiler uses void * arg 4 - setsockopt() rather than const - char * -ACE_HAS_WIN32_TRYLOCK The Win32 platform support - TryEnterCriticalSection() - (WinNT 4.0 and beyond) -ACE_HAS_WINSOCK2 The Win32 platform supports - WinSock 2.0 -ACE_HAS_XLI Platform has the XLI version - of TLI -ACE_HAS_XT Platform has Xt and Motif -ACE_HAS_XTI Platform has XTI - (X/Open-standardized superset - of TLI). Implies ACE_HAS_TLI - but uses a different header - file. -ACE_LACKS_ACCESS Platform lacks access() (e.g., - VxWorks and Chorus) -ACE_LACKS_ACE_IOSTREAM Platform can not build - ace/IOStream{,_T}.cpp. This - does not necessarily mean that - the platform does not support - iostreams. -ACE_LACKS_AUTO_MMAP_REPLACEMENT No system support for replacing any - previous mappings. -ACE_LACKS_BSEARCH Compiler/platform lacks the - standard C library bsearch() - function -ACE_LACKS_CMSG_DATA_MACRO Platform has - ACE_HAS_4_4BSD_SENDMSG_RECVMSG but does - not define CMSG_DATA (cmsg) macro. -ACE_LACKS_CMSG_DATA_MEMBER Platform has - ACE_HAS_4_4BSD_SENDMSG_RECVMSG but its - cmsghdr structure does not contain - an 'unsigned char cmsg_data[0]' - member. (This may be - 'unsigned char __cmsg_data[0]' on some - platforms, in which case we need - another macro.) -ACE_LACKS_COND_TIMEDWAIT_RESET pthread_cond_timedwait does - *not* reset the time argument - when the lock is acquired. -ACE_LACKS_CONST_STRBUF_PTR Platform uses struct strbuf * - rather than const struct - strbuf * (e.g., HP/UX 10.x) -ACE_LACKS_CONST_TIMESPEC_PTR Platform forgot const in - cond_timewait (e.g., HP/UX). -ACE_LACKS_COND_T Platform lacks condition - variables (e.g., Win32 and - VxWorks) -ACE_LACKS_CONDATTR_PSHARED Platform has no implementation - of - pthread_condattr_setpshared(), - even though it supports - pthreads! -ACE_LACKS_DIFFTIME Platform lacks difftime() implementation -ACE_LACKS_FCNTL Platform lacks POSIX-style fcntl (). -ACE_LACKS_FSYNC Platform lacks fsync(). -ACE_LACKS_INLINE_FUNCTIONS Platform can't handle "inline" - keyword correctly. -ACE_LACKS_EXEC Platform lacks the exec() - family of system calls (e.g., - Win32, VxWorks, Chorus) -ACE_LACKS_FILELOCKS Platform lacks file locking - mechanism -ACE_LACKS_FLOATING_POINT Platform does not support - floating point operations - (e.g., certain Chorus hardware - platforms) -ACE_LACKS_FORK Platform lacks the fork() - system call (e.g., Win32, - VxWorks, Chorus) -ACE_LACKS_GETOPT_PROTO Platform lacks the getopt() - prototype (e.g., LynxOS) -ACE_LACKS_GETPGID Platform lacks getpgid() call - (e.g., Win32, Chorus, and - FreeBSD). -ACE_LACKS_GETSERVBYNAME Platforms lacks - getservbyname() (e.g., VxWorks - and Chorus). -ACE_LACKS_IOSTREAMS_TOTALLY Iostreams are not supported - adequately on the given platform. -ACE_LACKS_IOSTREAM_FX iostream header does not - declare ipfx (), opfx (), - etc. -ACE_LACKS_KEY_T Platform lacks key_t (e.g., - Chorus, VxWorks, Win32) -ACE_LACKS_LINEBUFFERED_STREAMBUF Platform lacks streambuf - "linebuffered ()". -ACE_LACKS_LONGLONG_T Compiler/platform does no - supports the unsigned long - long datatype. -ACE_LACKS_LSTAT Platform lacks the lstat() function. -ACE_LACKS_MADVISE Platform lacks madvise() - (e.g., Linux) -ACE_LACKS_MALLOC_H Platform lacks malloc.h -ACE_LACKS_MEMORY_H Platform lacks memory.h (e.g., - VxWorks and Chorus) -ACE_LACKS_MKFIFO Platform lacks mkfifo() e.g., - VxWorks, Chorus, pSoS, and WinNT. -ACE_LACKS_MKTEMP ACE has no mktemp() -ACE_LACKS_MMAP The platform doesn't have - mmap(2) (e.g., SCO UNIX). -ACE_LACKS_MODE_MASKS Platform/compiler doesn't have - open() mode masks. -ACE_LACKS_MPROTECT The platform doesn't have - mprotect(2) (e.g., EPLX real - time OS from CDC (based on - LYNX)) -ACE_LACKS_MSG_ACCRIGHTS Platform defines ACE_HAS_MSG, - but lacks msg_accrights{,len}. -ACE_LACKS_MSGBUF_T Platform lacks struct msgbuf - (e.g., NT and MSV). -ACE_LACKS_MSYNC Platform lacks msync() (e.g., - Linux) -ACE_LACKS_MUTEXATTR_PSHARED Platform lacks - pthread_mutexattr_setpshared(). -ACE_LACKS_NAMED_POSIX_SEM Platform lacks named POSIX - semaphores (e.g., Chorus) -ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support - reentrant netdb functions - (getprotobyname_r, - getprotobynumber_r, - gethostbyaddr_r, - gethostbyname_r, - getservbyname_r). -ACE_LACKS_NEW_H OS doesn't have, or we don't want to - use, new.h. -ACE_LACKS_NULL_PTHREAD_STATUS OS requires non-null status pointer - for ::pthread_join (). -ACE_LACKS_PARAM_H Platform lacks - (e.g., MVS) -ACE_LACKS_POSIX_PROTOTYPES Platform lacks POSIX - prototypes for certain System - V functions like shared memory - and message queues. -ACE_LACKS_PRAGMA_ONCE Compiler complains about #pragma once -ACE_LACKS_PRI_T Platform lacks pri_t (e.g., - Tandem NonStop UNIX). -ACE_LACKS_PTHREAD_CANCEL Platform lacks - pthread_cancel(). -ACE_LACKS_PTHREAD_SIGMASK Platform lacks pthread_sigmask (). -ACE_LACKS_PTHREAD_THR_SIGSETMASK Platform lacks - pthread_thr_sigsetmask (e.g., - MVS, HP/UX, and OSF/1 3.2) -ACE_LACKS_PWD_REENTRANT_FUNCTIONS Platform lacks getpwnam_r() - methods (e.g., SGI 6.2). -ACE_LACKS_QSORT Compiler/platform lacks the - standard C library qsort() - function -ACE_LACKS_RAND_REENTRANT_FUNCTIONS Platform lacks rand_r() -ACE_LACKS_READLINK Platform lacks the readlink() function. -ACE_LACKS_READV Platform doesn't define readv, - so use our own -ACE_LACKS_RENAME Platform lacks rename(). -ACE_LACKS_RLIMIT Platform/compiler lacks - {get,set}rlimit() function - (e.g., VxWorks, Chorus, and - SCO UNIX) -ACE_LACKS_RLIMIT_PROTOTYPE Platform/compiler lacks - {get,set}rlimit() prototypes - (e.g., Tandem) -ACE_LACKS_RTTI Compiler does not support - dynamic_cast. Usually used - with ACE_HAS_ANSI_CASTS. -ACE_LACKS_READDIR_R Platform uses ACE_HAS_DIRENT - but does not have readdir_r - (). -ACE_LACKS_RECVMSG Platform lacks recvmsg() - (e.g., Linux) -ACE_LACKS_RWLOCK_T Platform lacks readers/writer - locks. -ACE_LACKS_SBRK Platform lacks a working - sbrk() (e.g., Win32 and - VxWorks) -ACE_LACKS_SEEKDIR Platform uses ACE_HAS_DIRENT - but does not have seekdir (). -ACE_LACKS_SEMBUF_T Platform lacks struct sembuf - (e.g., Win32 and VxWorks) -ACE_LACKS_SETDETACH Platform lacks - pthread_attr_setdetachstate() - (e.g., HP/UX 10.x) -ACE_LACKS_SETSCHED Platform lacks - pthread_attr_setsched() - (e.g. MVS) -ACE_LACKS_SIGACTION Platform lacks struct - sigaction (e.g., Win32 and - Chorus) -ACE_LACKS_SIGNED_CHAR Platform lacks "signed char" - type (broken!) -ACE_LACKS_SIGSET Platform lacks signal sets - (e.g., Chorus and Win32) -ACE_LACKS_SOME_POSIX_PROTOTYPES Platform lacks POSIX - prototypes for certain System - V functions like shared memory - and message queues. -ACE_LACKS_NATIVE_STRPTIME Platform/compiler lacks the strptime() - function. -ACE_LACKS_STRRCHR Platform/compiler lacks - strrchr () function. -ACE_LACKS_WCSRCHR Platform/compiler lacks wcsrchr () - function -ACE_LACKS_SYS_NERR Platforms/compiler lacks the - sys_nerr variable (e.g., - VxWorks and MVS). -ACE_LACKS_SYSTIME_H doesn't automatically - #include /**/ -ACE_LACKS_SYSV_MSG_H Platform lacks sys/msg.h - (e.g., Chorus and VxWorks) -ACE_LACKS_SENDMSG Platform lacks sendmsg() - (e.g., Linux) -ACE_LACKS_SI_ADDR Platform lacks the si_addr - field of siginfo_t (e.g., - VxWorks and HP/UX 10.x) -ACE_LACKS_SYSV_SHMEM Platform lacks System V shared - memory (e.g., Win32 and - VxWorks) -ACE_LACKS_SIGINFO_H Platform lacks the siginfo.h - include file (e.g., MVS) -ACE_LACKS_SOCKET_BUFSIZ Platform doesn't support - SO_SNDBUF/SO_RCVBUF -ACE_LACKS_SOCKETPAIR Platform lacks the - socketpair() call (e.g., SCO - UNIX) -ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES Compiler doesn't support - static data member templates -ACE_LACKS_STRCASECMP Compiler/platform lacks - strcasecmp() (e.g., DG/UX, - UNIXWARE, VXWORKS) -ACE_LACKS_STRRECVFD Platform doesn't define struct - strrecvfd. -ACE_LACKS_SYSCALL Platform doesn't have - syscall() prototype -ACE_LACKS_T_ERRNO Header files lack t_errno for - TLI -ACE_LACKS_TCP_H Platform doesn't have - netinet/tcp.h -ACE_LACKS_TCP_NODELAY OS does not support TCP_NODELAY. -ACE_LACKS_TELLDIR Platform uses ACE_HAS_DIRENT - but does not have telldir (). -ACE_LACKS_THREAD_STACK_SIZE Platform lacks - pthread_attr_setstacksize() - (e.g., Linux pthreads) -ACE_LACKS_TIMEDWAIT_PROTOTYPES MIT pthreads platform lacks - the timedwait prototypes -ACE_LACKS_TIMESPEC_T Platform does not define - timepec_t as a typedef for - struct timespec. -ACE_LACKS_TRUNCATE Platform doesn't have truncate() - (e.g., vxworks) -ACE_LACKS_U_LONGLONG_T Platform does not have - u_longlong_t typedef, and - "sun" is defined. -ACE_LACKS_UALARM_PROTOTYPE Platform/compiler lacks the - ualarm() prototype (e.g., - Solaris) -ACE_LACKS_CHAR_RIGHT_SHIFTS Compiler does not have any istream - operator>> for chars, u_chars, or - signed chars. -ACE_LACKS_CHAR_STAR_RIGHT_SHIFTS Compiler does not have - operator>> (istream &, u_char *) or - operator>> (istream &, signed char *) -ACE_LACKS_UCONTEXT_H Platform lacks the ucontext.h - file -ACE_LACKS_UNBUFFERED_STREAMBUF Platform lacks streambuf - "unbuffered ()". -ACE_LACKS_UNISTD_H Platform lacks the unistd.h - file (e.g., VxWorks and Win32) -ACE_LACKS_UNIX_DOMAIN_SOCKETS ACE platform has no UNIX - domain sockets -ACE_LACKS_UNIX_SIGNALS Platform lacks full signal - support (e.g., Win32 and - Chorus). -ACE_LACKS_UTSNAME_T Platform lacks struct utsname - (e.g., Win32 and VxWorks) -ACE_LACKS_WILDCARD_BIND The bind() call will not - select the port if it's 0. - -ACE_LACKS_WRITEV Platform doesn't define - writev, so use our own - -ACE_NEEDS_DEV_IO_CONVERSION Necessary with some compilers - to pass ACE_TTY_IO as - parameter to DEV_Connector. -ACE_NEEDS_FUNC_DEFINITIONS Compiler requires a definition - for a "hidden" function, e.g., - a private, unimplemented copy - constructor or assignment - operator. The SGI C++ - compiler needs this, in - template classes, with - ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA. -ACE_NEEDS_HUGE_THREAD_STACKSIZE Required by platforms with small default stacks. -ACE_NEEDS_LWP_PRIO_SET OS has LWPs, and when the - priority of a bound thread is - set, then the LWP priority - must be set also. -ACE_NEEDS_SCHED_H Platform needs to #include - - to get thread scheduling - defs. ----------------------------------------- - -The following is a partial list of where some of these macros are used -in the code. This list was originally compiled by Jam Hamidi -(jh1@core01.osi.com). It is now hopelessly out of date. Hopefully, -someone will come along and update it.... - -ACE_HAS_ALLOCA: ---------------- - - Used in: - libsrc/IPC_SAP/SOCK_SAP/SOCK_Connect.C - for allocation of iovp -A - libsrc/IPC_SAP/SPIPE_SAP/SPIPE_Msg.C - for alocation of iovp - - In solaris: - alloca() allocates size bytes of space in the stack frame of - the caller, and returns a pointer to the allocated block. - This temporary space is automatically freed when the caller - returns. Note: if the allocated block is beyond the current - stack limit, the resulting behavior is undefined. - - In HPUX: - no equivalent. - - Notes: - in HPUX it has to do new and delete. Affects performance. - - -ACE_HAS_AUTOMATIC_INIT_FINI: ----------------------------- - - Used in: - libsrc/Service_Configurator/Service_Repository.i - libsrc/Service_Configurator/Parse_Node.i - include/Parse_Node.i - include/Service_Repository.i - - In solaris: - _init() initializes a loadable module. It is called before - any other routine in a loadable module. - _info() returns information about a loadable module. - _fini() should return the return value from mod_remove(9F). - This flag if set, doesn't do anything. If not set, forces - _init() and _fini() to be executed as is: - dlsym ((char *) handle, "_fini"). - - In HPUX: - don't set. - Maybe have to look into shl_load( ), shl_definesym( ), - shl_findsym( ), shl_gethandle( ), shl_getsymbols( ), - shl_unload( ), shl_get( )(3X) - explicit load of shared libraries - Means Service Configurator won't be available. - TBA. - - -ACE_HAS_CPLUSPLUS_HEADERS: --------------------------- - - Used In: - ace/OS.h - - HPUX: - set it. - - Notes: - If this is not defined, libc.h and osfcn.h get included. - Only needed for older compiler/OS platforms that don't - provide standard C++ header files in /usr/include. - -ACE_HAS_HI_RES_TIMER: ---------------------- - - Used In: - libsrc/Misc/High_Res_Timer.h - libsrc/Misc/High_Res_Timer.C - include/High_Res_Timer.h - - In Solaris, - C++ wrapper around gethrtime(), which returns a long long. - gethrtime() returns the current high-resolution real time. - Time is expressed as nanoseconds since some arbitrary time - in the past; it is not correlated in any way to the time of - day, and thus is not subject to resetting, drifting, etc. - - In HPUX - look into: getclock(), reltimer(), getitimer() - maybe even vtimes structure vm_utime, vm_stime ? - - Notes: - TBA - - -ACE_LACKS_T_ERRNO: -------------------- - - Used In: - ace/OS.h - - HPUX: - set it. - - Notes: - if set, adds: - extern int t_errno; - - -ACE_HAS_POSIX_NONBLOCK: ------------------------ - - Used in: - ace/OS.h - - HPUX: - set it. - - Notes: - if defined, sets ACE_NONBLOCK and O_NONBLOCK - O_NONBLOCK is used in libsrc/Misc/misc.C to do a - fcntl (fd, F_SETFL, opt) - ACE_NONBLOCK is used in libsrc/IPC_SAP/FIFO_SAP/FIFO_Recv.C in the - disable member function and options passed to the open function - in libsrc/IPC_SAP/FIFO_SAP/FIFO.C - - -ACE_HAS_PROC_FS: ----------------- - - Used in: - ace/OS.h - libsrc/Misc/Profile_Timer.i - - Notes: - if set, includes - the PIOCUSAGE define is used in Profile_Timer. - - Solaris: - procfs.h defines things for the prpsinfo structure (basically to - do a "ps" from inside a program). - - HPUX: - don't set: obviously a different mechanism. - Look into /usr/include/sys/proc.h. The structure is proc. The - pointer to the kernel's proc table may be obtained by - extern struct proc *proc, *procNPROC; - extern int nproc; - - -ACE_HAS_PRUSAGE_T: ------------------- - - Used in: - libsrc/Misc/Profile_Timer.h - libsrc/Misc/Profile_Timer.C - - Notes: - If defined, declares the Profile_Timer class that does start(), - stop() and basically gets real_time, user_time, system_time for - an interval. - This stuff is highly non-portable. - - HPUX: - don't set - - -ACE_HAS_SEMUN: --------------- - - Used in: - libsrc/Semaphores/Semaphore_Simple.h - - Notes: - if not defined, defines semun as: - union semun { - int val; /* value for SETVAL */ - struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ - ushort *array; /* array for GETALL & SETALL */ - }; - - HPUX: - don't set. - in /usr/include/sem.h: - /* The fourth argument to semctl() varies depending on the value of - its first argument. If desired, "union semun" can be declared - by the user, but this is not necessary since the individual - member can just be passed as the argument. */ - - -ACE_HAS_SIG_ATOMIC_T: ---------------------- - - Used in: - ace/OS.h - - Notes: - if not defined, does a: - typedef int sig_atomic_t; - This is used in the Reactor and service configurator. - - HPUX: - set it. - in /usr/include/sys/signal.h: - typedef unsigned int sig_atomic_t; - - -ACE_HAS_SSIZE_T: ----------------- - - Used in: - ace/OS.h - - Notes: - if not defined, does a - typedef int ssize_t; - used mostly in IPC_SAP. (don't confuse with size_t). - - HPUX: - set it. - in /usr/include/sys/types.h - - -ACE_HAS_STRBUF_T: ------------------ - - Used in: - include/Str_Buf.h - - Notes: - if not defined, declares the strbuf structure as: - struct strbuf - { - int maxlen; /* no. of bytes in buffer */ - int len; /* no. of bytes returned */ - void *buf; /* pointer to data */ - }; - - Solaris: - defined in /usr/include/sys/stropts.h - Sys V.4 Streams. - uses strbuf as parameter to putmsg, putpmsg: - int putmsg(int fildes, const struct strbuf *ctlptr, - const struct strbuf *dataptr, int flags); - - HPUX: - don't set. - no SYS V.4 streams. - - -ACE_HAS_STREAMS: ----------------- - - Used In: - ace/OS.h - libsrc/IPC_SAP/SOCK_SAP/LSOCK.C - - Notes: - if defined, includes - - HPUX: - don't set. - no SYS V.4 streams. - - -ACE_HAS_STREAM_PIPES: ---------------------- - - Used in: - libsrc/IPC_SAP/SPIPE_SAP/SPIPE_Msg.h - libsrc/IPC_SAP/SPIPE_SAP/SPIPE_Msg.C - libsrc/IPC_SAP/SPIPE_SAP/SPIPE_Listener.h - libsrc/IPC_SAP/SPIPE_SAP/SPIPE_Listener.C - libsrc/IPC_SAP/SPIPE_SAP/SPIPE.h - libsrc/IPC_SAP/SPIPE_SAP/SPIPE.C - libsrc/IPC_SAP/FIFO_SAP/FIFO_Send_Msg.h - libsrc/IPC_SAP/FIFO_SAP/FIFO_Send_Msg.C - libsrc/IPC_SAP/FIFO_SAP/FIFO_Send_Msg.i - libsrc/IPC_SAP/FIFO_SAP/FIFO_Recv_Msg.h - libsrc/IPC_SAP/FIFO_SAP/FIFO_Recv_Msg.C - libsrc/IPC_SAP/FIFO_SAP/FIFO_Recv_Msg.i - - Notes: - if not set, won't be able to use the SPIPE class (IPC_SAP) with - rendezvous handles. - - HPUX: - don't set. - No sysV.4 streams. - - -ACE_HAS_STRERROR: ------------------ - - Used in: - ace/OS.h - - Notes: - if not defined, does a: - #define strerror(err) sys_errlist[err] - - Solaris: - /usr/include/string.h - - HPUX: - set it. - in /usr/include/sys/errno.h and string.h - extern char *strerror (int); - - -ACE_HAS_SVR4_DYNAMIC_LINKING: ------------------------------ - - Used in: - ace/OS.h - tests/Service_Configurator/CCM_App.C - - Notes: - if defined, includes - with dlopen(), dlsym(), etc.. - - HPUX: - don't set. - has its own: - shl_findsym( ), shl_gethandle( ), shl_getsymbols( ), - shl_unload( ), shl_get( )(3X) - explicit load of shared libraries - - -ACE_HAS_SVR4_GETTIMEOFDAY: --------------------------- - - Used in: - ace/OS.h - libsrc/Reactor/Timer_Queue.i - - Notes: - has to do with gettimeofday (). - - Solaris: - gettimeofday (struct timeval *tp) - - HPUX: - don't set. - it has gettimeofday (struct timeval *tp, struct timezone *tzp); - most calls do a: - #if defined (ACE_HAS_SVR4_GETTIMEOFDAY) - ::gettimeofday (&cur_time); - #else - ::gettimeofday (&cur_time, 0); - #endif /* ACE_HAS_SVR4_GETTIMEOFDAY */ - - -ACE_HAS_POLL: ------------- - Used in: - ace/OS.h - - Notes: - #if defined (ACE_HAS_POLL) - #include /**/ - #endif /* ACE_HAS_POLL */ - -ACE_USE_POLL_IMPLEMENTATION: ------------------- - - Used in: - ace/OS.h - - Notes: - Use the poll() event demultiplexor rather than select(). - - HPUX: - set it. - - -ACE_HAS_SVR4_SIGNAL_T: ----------------------- - - Used in: - ace/OS.h - - Notes: - #if defined (ACE_HAS_SVR4_SIGNAL_T) - typedef void (*SignalHandler)(int); - typedef void (*SignalHandlerV)(void); - #elif defined (ACE_HAS_SIGNALHANDLERV_INT_ARG) - typedef void (*SignalHandler)(int); - typedef void (*SignalHandlerV)(int); - #else - #define SignalHandler SIG_PF - typedef void (*SignalHandlerV)(...); - #endif /* ACE_HAS_SVR4_SIGNAL_T */ - - HPUX: - set it. - - -ACE_HAS_SVR4_TLI: ------------------ - - Used in: - libsrc/IPC_SAP/TLI_SAP/TLI.C - libsrc/IPC_SAP/TLI_SAP/TLI.h - libsrc/IPC_SAP/TLI_SAP/TLI_Stream.C - - Notes: - TLI is the transport layer calls as in: t_bind(), t_open(), t_unbind(), - t_optmgmt(), ... in SunOS and Solaris. - - HPUX: - don't set. - Not supported. - - -ACE_HAS_SYS_FILIO_H: --------------------- - - Used in: - ace/OS.h - - Notes: - if not defined, includes . - didn't find any reference to anything in this file in the ACE code. - - Solaris: - filio.h defines FIOCLEX, FIOASYNC, ... as _IO('f', 1), .. - for FIOLFS,.. solaris has this to say: - /* - * ioctl's for Online: DiskSuite. - * WARNING - the support for these ioctls may be withdrawn - * in the future OS releases. - */ - - HPUX: - defines FIOASYNC and some other ones, - defines some like FIOCLEX. - some are never defined. - use #ifdef HP-UX to modify sysincludes.h - - -ACE_HAS_SYS_SIGLIST: --------------------- - - Used in: - ace/OS.h - libsrc/Log_Msg/Log_Msg.C - - Notes: - if not defined, does a: - extern const char **_sys_siglist; - - Solaris: - This is an array holding signal descriptions. - - HPUX: - don't set. - Some additional work is required. In libsrc/Log_Msg/Log_Msg.C, - sys_siglist is used regardless of ACE_HAS_SYS_SIGLIST. - have to add #ifdefs to remove them. - - -ACE_HAS_TEMPLATE_TYPEDEFS: --------------------------- - - Used in: - libsrc/ASX/*.[Chi] - - Notes: - cfront-based C++ compilers don't implement templates that support - classes with typedefs of other types as formal arguments. This - typedef uses the C++ preprocessor to work around this problem. - -ACE_HAS_THREADS: ----------------- - - Used in: - libsrc/Service_Configurator/Svc_Conf.y.C - libsrc/Service_Configurator/Thread_Spawn.i - libsrc/Threads/Synch.C - libsrc/Threads/Synch.i - libsrc/Threads/Thr_Manager.i - libsrc/ASX/STREAM.C - libsrc/ASX/Queue.C - libsrc/ASX/Module.C - libsrc/ASX/Stream_Modules.C - libsrc/ASX/Multiplexor.C - libsrc/ASX/Message_List.C - include/Message_List.h - include/Module.h - include/Multiplexor.h - include/Queue.h - include/STREAM.h - include/Stream_Modules.h - include/Service_Types.h - include/Thread_Spawn.h - include/Synch.h - include/Thr_Manager.h - - Notes: - We use Message_List.h even in a non-threaded environment. - our XOMessageList.h does this by #ifdefs around Threaded things. - - HPUX: - not until 10.0. - - -ACE_HAS_THREAD_T: ------------------ - - Used in: - ace/OS.h - - Notes: - #if !defined (ACE_HAS_THREAD_T) - typedef int thread_t; - #endif /* !ACE_HAS_THREAD_T */ - - HPUX: - don't set. - - -ACE_HAS_TIMOD_H: ----------------- - - Used in: - ace/OS.h - - Notes: - if defined, include - - Solaris: - timod is a STREAMS module for use with the Transport Inter- - face (TI) functions of the Network Services library. The - timod module converts a set of ioctl(2) calls into STREAMS - messages that may be consumed by a transport protocol pro- - vider that supports the Transport Interface. This allows a - user to initiate certain TI functions as atomic operations. - - HPUX: - don't set. - - -ACE_HAS_TIUSER_H: ------------------ - - Used in: - ace/OS.h - - Notes: - if set, includes - - Solaris: - in conjunction with t_bind, t_accept, etc.. transport layer. - - HPUX: - don't set. - - -ACE_USE_POLL_IMPLEMENTATION: ----------------------------- - - Used in: - libsrc/Reactor/Reactor.i - include/Event_Handler.h - ace/OS.h - include/Reactor.h - - Notes: - in the reactor, use poll instead of select. In general, - good thing to have set. diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp deleted file mode 100644 index 9f897fa08dd..00000000000 --- a/ace/Reactor.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// $Id$ - -#include "ace/Reactor.h" -#include "ace/Reactor_Impl.h" -#include "ace/Handle_Set.h" -#if !defined (ACE_HAS_WINCE) -# if !defined (ACE_LACKS_ACE_SVCCONF) -# include "ace/Service_Config.h" -# endif /* !ACE_LACKS_ACE_SVCCONF */ -# include "ace/WFMO_Reactor.h" -# include "ace/Msg_WFMO_Reactor.h" -#endif /* ! ACE_HAS_WINCE */ -#include "ace/Select_Reactor.h" -#include "ace/TP_Reactor.h" -#include "ace/Object_Manager.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Reactor.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Reactor, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_Reactor) - -ACE_Reactor::ACE_Reactor (ACE_Reactor_Impl *impl, - int delete_implementation) - : implementation_ (0), - delete_implementation_ (delete_implementation) -{ - this->implementation (impl); - - if (this->implementation () == 0) - { -#if !defined (ACE_WIN32) \ - || !defined (ACE_HAS_WINSOCK2) || (ACE_HAS_WINSOCK2 == 0) \ - || defined (ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL) \ - || defined (ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL) - #if defined (ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL) - ACE_NEW (impl, - ACE_TP_Reactor); - #else - ACE_NEW (impl, - ACE_Select_Reactor); - #endif /* ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL */ -#else /* We are on Win32 and we have winsock and ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL is not defined */ - #if defined (ACE_USE_MSG_WFMO_REACTOR_FOR_REACTOR_IMPL) - ACE_NEW (impl, - ACE_Msg_WFMO_Reactor); - #else - ACE_NEW (impl, - ACE_WFMO_Reactor); - #endif /* ACE_USE_MSG_WFMO_REACTOR_FOR_REACTOR_IMPL */ -#endif /* !defined (ACE_WIN32) || !defined (ACE_HAS_WINSOCK2) || (ACE_HAS_WINSOCK2 == 0) || defined (ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL) */ - this->implementation (impl); - this->delete_implementation_ = 1; - } -} - -ACE_Reactor::~ACE_Reactor (void) -{ - if (this->delete_implementation_) - delete this->implementation (); -} - -// Process-wide ACE_Reactor. -ACE_Reactor *ACE_Reactor::reactor_ = 0; - -// Controls whether the Reactor is deleted when we shut down (we can -// only delete it safely if we created it!) -int ACE_Reactor::delete_reactor_ = 0; - -ACE_Reactor * -ACE_Reactor::instance (void) -{ - ACE_TRACE ("ACE_Reactor::instance"); - - if (ACE_Reactor::reactor_ == 0) - { - // Perform Double-Checked Locking Optimization. - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance (), 0)); - - if (ACE_Reactor::reactor_ == 0) - { - ACE_NEW_RETURN (ACE_Reactor::reactor_, - ACE_Reactor, - 0); - ACE_Reactor::delete_reactor_ = 1; - } - } - return ACE_Reactor::reactor_; -} - -ACE_Reactor * -ACE_Reactor::instance (ACE_Reactor *r, - int delete_reactor) -{ - ACE_TRACE ("ACE_Reactor::instance"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance (), 0)); - ACE_Reactor *t = ACE_Reactor::reactor_; - if (delete_reactor != 0) - ACE_Reactor::delete_reactor_ = 1; - else - // We can't safely delete it since we don't know who created it! - ACE_Reactor::delete_reactor_ = 0; - - ACE_Reactor::reactor_ = r; - return t; -} - -void -ACE_Reactor::close_singleton (void) -{ - ACE_TRACE ("ACE_Reactor::close_singleton"); - - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance ())); - - if (ACE_Reactor::delete_reactor_) - { - delete ACE_Reactor::reactor_; - ACE_Reactor::reactor_ = 0; - ACE_Reactor::delete_reactor_ = 0; - } -} - -int -ACE_Reactor::check_reconfiguration (void *) -{ -#if !defined (ACE_HAS_WINCE) && !defined (ACE_LACKS_ACE_SVCCONF) - if (ACE_Service_Config::reconfig_occurred ()) - { - ACE_Service_Config::reconfigure (); - return 1; - } -#endif /* ! ACE_HAS_WINCE || ! ACE_LACKS_ACE_SVCCONF */ - return 0; -} - -int -ACE_Reactor::run_reactor_event_loop (REACTOR_EVENT_HOOK eh) -{ - ACE_TRACE ("ACE_Reactor::run_reactor_event_loop"); - - while (1) - { - int result = this->implementation_->handle_events (); - - if (eh != 0 && (*eh)(0)) - continue; - else if (result == -1 && this->implementation_->deactivated ()) - return 0; - else if (result == -1) - return -1; - } - - ACE_NOTREACHED (return 0;) -} - -int -ACE_Reactor::run_alertable_reactor_event_loop (REACTOR_EVENT_HOOK eh) -{ - ACE_TRACE ("ACE_Reactor::run_alertable_reactor_event_loop"); - - while (1) - { - int result = this->implementation_->alertable_handle_events (); - - if (eh != 0 && (*eh)(0)) - continue; - else if (result == -1 && this->implementation_->deactivated ()) - return 0; - else if (result == -1) - return -1; - } - - ACE_NOTREACHED (return 0;) -} - -int -ACE_Reactor::run_reactor_event_loop (ACE_Time_Value &tv, - REACTOR_EVENT_HOOK eh) -{ - ACE_TRACE ("ACE_Reactor::run_reactor_event_loop"); - - while (1) - { - int result = this->implementation_->handle_events (tv); - - if (eh != 0 && (*eh)(0)) - continue; - else if (result == -1 && this->implementation_->deactivated ()) - return 0; - else if (result <= 0) - return result; - } - - ACE_NOTREACHED (return 0;) -} - -int -ACE_Reactor::run_alertable_reactor_event_loop (ACE_Time_Value &tv, - REACTOR_EVENT_HOOK eh) -{ - ACE_TRACE ("ACE_Reactor::run_alertable_reactor_event_loop"); - - while (1) - { - int result = this->implementation_->alertable_handle_events (tv); - - if (eh != 0 && (*eh)(0)) - continue; - else if (result == -1 && this->implementation_->deactivated ()) - return 0; - else if (result <= 0) - return result; - } - - ACE_NOTREACHED (return 0;) -} - -int -ACE_Reactor::end_reactor_event_loop (void) -{ - ACE_TRACE ("ACE_Reactor::end_reactor_event_loop"); - - this->implementation_->deactivate (1); - - return 0; -} - -int -ACE_Reactor::reactor_event_loop_done (void) -{ - ACE_TRACE ("ACE_Reactor::reactor_event_loop_done"); - return this->implementation_->deactivated (); -} - // Report if the 's event loop is finished. - -void -ACE_Reactor::reset_reactor_event_loop (void) -{ - ACE_TRACE ("ACE_Reactor::reset_event_loop"); - - this->implementation_->deactivate (0); -} - // Resets the static so that the - // method can be restarted. - -void -ACE_Reactor::dump (void) const -{ - ACE_TRACE ("ACE_Reactor::dump"); - - implementation_->dump (); -} diff --git a/ace/Reactor.h b/ace/Reactor.h deleted file mode 100644 index 5eeaa1655e1..00000000000 --- a/ace/Reactor.h +++ /dev/null @@ -1,563 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Reactor.h -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ - -#ifndef ACE_REACTOR_H -#define ACE_REACTOR_H -#include "ace/pre.h" - -class ACE_Reactor_Impl; - -// Need the class def for ACE_Handle_Set to compile references to it in -// programs. -#include "ace/Handle_Set.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Timer Queue is a complicated template class. A simple forward -// declaration will not work -#include "ace/Timer_Queue.h" - -// Event_Handler.h contains the definition of ACE_Reactor_Mask -#include "ace/Event_Handler.h" - -// We are using 4 or 5 signal classes, we could forward declare -// them.... But Timer_Queue_T.h includes Signal.h, so I don't think -// forward declaration will be useful here -#include "ace/Signal.h" - -class ACE_Export ACE_Reactor -{ - // = TITLE - // The resposiblility of this class is to forward all methods to - // its delegation/implementation class, e.g., - // or . -public: - enum - { - // = Operations on the "ready" mask and the "dispatch" mask. - GET_MASK = 1, - // Retrieve current value of the the "ready" mask or the - // "dispatch" mask. - SET_MASK = 2, - // Set value of bits to new mask (changes the entire mask). - ADD_MASK = 3, - // Bitwise "or" the value into the mask (only changes enabled - // bits). - CLR_MASK = 4 - // Bitwise "and" the negation of the value out of the mask (only - // changes enabled bits). - }; - - typedef int (*REACTOR_EVENT_HOOK)(void*); - // You can add a hook to various run_event methods and the hook will - // be called after handling every reactor event. If this function - // returns 0, run_reactor_event_loop will check for the return value of - // handle_event. If it is -1, the the run_reactor_event_loop will return - // (pre-maturely.) - - static ACE_Reactor *instance (void); - // Get pointer to a process-wide . - - static ACE_Reactor *instance (ACE_Reactor *, - int delete_reactor = 0); - // Set pointer to a process-wide and return existing - // pointer. If != 0 then we'll delete the Reactor - // at destruction time. - - static void close_singleton (void); - // Delete the dynamically allocated Singleton - - // = Singleton reactor event loop management methods. - - // Note that these method ONLY work on the "Singleton Reactor," - // i.e., the one returned from . - static int run_event_loop (void); - static int run_alertable_event_loop (void); - // Run the event loop until the - // - // method returns -1 or the method is invoked. - // Note that this method can only be used by the singleton - // . Thus, to run another reactor use - // . - - static int run_event_loop (ACE_Time_Value &tv); - static int run_alertable_event_loop (ACE_Time_Value &tv); - // Run the event loop until the or - // methods returns -1, the - // method is invoked, or the - // expires. Note that this method can only be used by the singleton - // . Thus, to run another reactor use - // . - - static int end_event_loop (void); - // Instruct the to terminate its event loop - // and notifies the so that it can wake up - // and close down gracefully. Note that this method can only be - // used by the singleton . Thus, to - // terminate another reactor, use - // . - - static int event_loop_done (void); - // Report if the 's event loop is finished. - // Note that this method can only be used by the singleton - // . Thus, to check another reactor use - // . - - static void reset_event_loop (void); - // Resets the static so that the - // method can be restarted. Note that this method - // can only be used by the singleton . Thus, - // to reset another reactor use - // . - - static int check_reconfiguration (void *); - // The singleton reactor is used by the . - // Therefore, we must check for the reconfiguration request and - // handle it after handling an event. - - // = Reactor event loop management methods. - - // These methods work with an instance of a reactor. - virtual int run_reactor_event_loop (REACTOR_EVENT_HOOK = 0); - virtual int run_alertable_reactor_event_loop (REACTOR_EVENT_HOOK = 0); - // Run the event loop until the - // - // method returns -1 or the method is invoked. - - virtual int run_reactor_event_loop (ACE_Time_Value &tv, - REACTOR_EVENT_HOOK = 0); - virtual int run_alertable_reactor_event_loop (ACE_Time_Value &tv, - REACTOR_EVENT_HOOK = 0); - // Run the event loop until the or - // methods returns -1, the - // method is invoked, or the - // expires. - - virtual int end_reactor_event_loop (void); - // Instruct the to terminate its event loop - // and notifies the so that it can wake up - // and close down gracefully. - - virtual int reactor_event_loop_done (void); - // Report if the 's event loop is finished. - - virtual void reset_reactor_event_loop (void); - // Resets the static so that the - // method can be restarted. - - ACE_Reactor (ACE_Reactor_Impl *implementation = 0, - int delete_implementation = 0); - // Create the Reactor using . The flag - // tells the Reactor whether or not to - // delete the on destruction. - - virtual ~ACE_Reactor (void); - // Close down and release all resources. - - virtual int open (size_t max_number_of_handles, - int restart = 0, - ACE_Sig_Handler *signal_handler = 0, - ACE_Timer_Queue *timer_queue = 0); - // Initialize the to manage . - // If is non-0 then the 's - // method will be restarted automatically when occurs. If - // or are non-0 they are used as the - // signal handler and timer queue, respectively. - - virtual int set_sig_handler (ACE_Sig_Handler *signal_handler); - // Use a user specified signal handler instead. - - virtual int set_timer_queue (ACE_Timer_Queue *timer_queue); - // Use a user specified timer queue instead. - // Notice that I don't think you should mess with timer queue - // once the Reactor is up and running. - - virtual int close (void); - // Close down and release all resources. - - // = Event loop drivers. - - virtual int work_pending (const ACE_Time_Value &max_wait_time = ACE_Time_Value::zero); - // Returns non-zero if there are I/O events "ready" for dispatching, - // but does not actually dispatch the event handlers. By default, - // don't block while checking this, i.e., "poll". - - virtual int handle_events (ACE_Time_Value *max_wait_time = 0); - virtual int alertable_handle_events (ACE_Time_Value *max_wait_time = 0); - // This event loop driver blocks for up to before - // returning. It will return earlier if events occur. Note that - // can be 0, in which case this method blocks - // indefinitely until events occur. - // - // is decremented to reflect how much time this call - // took. For instance, if a time value of 3 seconds is passed to - // handle_events and an event occurs after 2 seconds, - // will equal 1 second. This can be used if an - // application wishes to handle events for some fixed amount of - // time. - // - // Returns the total number of timers and I/O s - // that were dispatched, 0 if the elapsed without - // dispatching any handlers, or -1 if an error occurs. - // - // The only difference between and - // is that in the alertable case, the eventloop will - // return when the system queues an I/O completion routine or an - // Asynchronous Procedure Call. - - virtual int handle_events (ACE_Time_Value &max_wait_time); - virtual int alertable_handle_events (ACE_Time_Value &max_wait_time); - // This method is just like the one above, except the - // value is a reference and can therefore never be - // NULL. - // - // The only difference between and - // is that in the alertable case, the eventloop will - // return when the system queues an I/O completion routine or an - // Asynchronous Procedure Call. - - // = Register and remove Handlers. - - virtual int register_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - // Register with . The I/O handle will always - // come from on the . - - virtual int register_handler (ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - // Register with . The I/O handle is provided - // through the parameter. - -#if defined (ACE_WIN32) - virtual int register_handler (ACE_Event_Handler *event_handler, - ACE_HANDLE event_handle = ACE_INVALID_HANDLE); - // Register an that will be notified when - // is signaled. Since no event mask is passed - // through this interface, it is assumed that the - // being passed in is an event handle and not an I/O handle. - // - // Originally this interface was available for all platforms, but - // because ACE_HANDLE is an int on non-Win32 platforms, compilers - // are not able to tell the difference between - // register_handler(ACE_Event_Handler*,ACE_Reactor_Mask) and - // register_handler(ACE_Event_Handler*,ACE_HANDLE). Therefore, we - // have restricted this method to Win32 only. -#endif /* ACE_WIN32 */ - - virtual int register_handler (ACE_HANDLE event_handle, - ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - // Register an that will be notified when - // is signaled. specifies the network events - // that the is interested in. - - virtual int register_handler (const ACE_Handle_Set &handles, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - // Register with all the in the . - - virtual int register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0); - // Register to handle the signal using the - // . Returns the that was previously registered - // (if any), along with the of the signal handler. - - virtual int register_handler (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0); - // Registers to handle a set of signals using the - // . - - virtual int remove_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - // Removes . Note that the I/O handle will be - // obtained using method of . If - // == then the - // method of the is not invoked. - - virtual int remove_handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - // Removes . If == - // then the method of the associated - // is not invoked. - - virtual int remove_handler (const ACE_Handle_Set &handle_set, - ACE_Reactor_Mask mask); - // Removes all handles in . If == - // then the method of - // the associated s is not invoked. - - virtual int remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp = 0, - int sigkey = -1); - // Remove the ACE_Event_Handler currently associated with . - // Install the new disposition (if given) and return the previous - // disposition (if desired by the caller). Returns 0 on success and - // -1 if is invalid. - - virtual int remove_handler (const ACE_Sig_Set &sigset); - // Calls for every signal in . - - // = Suspend and resume Handlers. - - virtual int suspend_handler (ACE_Event_Handler *event_handler); - // Suspend temporarily. Use - // to get the handle. - - virtual int suspend_handler (ACE_HANDLE handle); - // Suspend temporarily. - - virtual int suspend_handler (const ACE_Handle_Set &handles); - // Suspend all in handle set temporarily. - - virtual int suspend_handlers (void); - // Suspend all temporarily. - - virtual int resume_handler (ACE_Event_Handler *event_handler); - // Resume . Use to - // get the handle. - - virtual int resume_handler (ACE_HANDLE handle); - // Resume . - - virtual int resume_handler (const ACE_Handle_Set &handles); - // Resume all in handle set. - - virtual int resume_handlers (void); - // Resume all . - - // = Timer management. - - virtual long schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delta, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - // Schedule an that will expire after amount - // of time, which is specified as relative time to the current - // . If it expires then is passed in as the - // value to the 's callback method. - // If is != to then it is used to - // reschedule the automatically, also specified - // using relative time. This method returns a that - // uniquely identifies the in an internal list. - // This can be used to cancel an before - // it expires. The cancellation ensures that are unique - // up to values of greater than 2 billion timers. As long as timers - // don't stay around longer than this there should be no problems - // with accidentally deleting the wrong timer. Returns -1 on - // failure (which is guaranteed never to be a valid . - - virtual int reset_timer_interval (long timer_id, - const ACE_Time_Value &interval); - // Resets the interval of the timer represented by to - // , which is specified in relative time to the current - // . If is equal to - // , the timer will become a non-rescheduling - // timer. Returns 0 if successful, -1 if not. - - virtual int cancel_timer (ACE_Event_Handler *event_handler, - int dont_call_handle_close = 1); - // Cancel all s that match the address of - // . Returns number of handlers cancelled. - - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1); - // Cancel the single that matches the - // value, which was returned from the schedule method. If arg is - // non-NULL then it will be set to point to the ``magic cookie'' - // argument passed in when the Event_Handler was registered. This - // makes it possible to free up the memory and avoid memory leaks. - // Returns 1 if cancellation succeeded and 0 if the - // wasn't found. - - // = High-level Event_Handler scheduling operations - - virtual int schedule_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_added); - // Add to the 's entry. - // must already have been registered. - - virtual int schedule_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_added); - // Add to the 's entry. - // associated with must already have been registered. - - virtual int cancel_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_cleared); - // Clear from the 's entry. - - virtual int cancel_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_cleared); - // Clear from the 's entry. - - // = Notification methods. - - virtual int notify (ACE_Event_Handler *event_handler = 0, - ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value *tv = 0); - // Notify of event. The - // indicates how long to blocking trying to notify. If == - // 0, the caller will block until action is possible, else will wait - // until the relative time specified in elapses). - - virtual void max_notify_iterations (int iterations); - // Set the maximum number of times that ACE_Reactor will - // iterate and dispatch the that are passed in - // via the notify queue before breaking out of its - // loop. By default, this is set to - // -1, which means "iterate until the queue is empty." Setting this - // to a value like "1 or 2" will increase "fairness" (and thus - // prevent starvation) at the expense of slightly higher dispatching - // overhead. - - virtual int max_notify_iterations (void); - // Get the maximum number of times that the ACE_Reactor will - // iterate and dispatch the that are passed in - // via the notify queue before breaking out of its - // loop. - - // = Assorted helper methods. - - virtual int handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **event_handler = 0); - // Check to see if is associated with a valid Event_Handler - // bound to . Return the associated with this - // if != 0. - - virtual int handler (int signum, - ACE_Event_Handler **event_handler = 0); - // Check to see if is associated with a valid Event_Handler - // bound to a signal. Return the associated with - // this if != 0. - - virtual int initialized (void); - // Returns true if Reactor has been successfully initialized, else - // false. - - virtual size_t size (void); - // Returns the current size of the Reactor's internal descriptor - // table. - - virtual ACE_Lock &lock (void); - // Returns a reference to the Reactor's internal lock. - - virtual void wakeup_all_threads (void); - // Wake up all threads in waiting in the event loop - - virtual int owner (ACE_thread_t new_owner, - ACE_thread_t *old_owner = 0); - // Transfers ownership of Reactor to the . - - virtual int owner (ACE_thread_t *owner); - // Return the ID of the "owner" thread. - - virtual void requeue_position (int position); - // Set position of the owner thread. - - virtual int requeue_position (void); - // Get position of the owner thread. - - virtual int restart (void); - // Get the existing restart value. - - virtual int restart (int r); - // Set a new value for restart and return the original value. - - // = Low-level wait_set mask manipulation methods. - - virtual int mask_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops); - // GET/SET/ADD/CLR the dispatch mask "bit" bound with the - // and . - - virtual int mask_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops); - // GET/SET/ADD/CLR the dispatch MASK "bit" bound with the - // and . - - // = Low-level ready_set mask manipulation methods. - virtual int ready_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops); - // GET/SET/ADD/CLR the ready "bit" bound with the - // and . - - virtual int ready_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops); - // GET/SET/ADD/CLR the ready "bit" bound with the and . - - virtual ACE_Reactor_Impl *implementation (void); - // Get the implementation class - - virtual int current_info (ACE_HANDLE handle, - size_t &msg_size); - // Returns 0, if the size of the current message has been put in - // returns -1, if not. ACE_HANDLE allows the reactor to - // check if the caller is valid. Used for CLASSIX Reactor - // implementation. - - virtual int uses_event_associations (void); - // Return 1 if we any event associations were made by the reactor - // for the handles that it waits on, 0 otherwise. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - void dump (void) const; - // Dump the state of the object. - -protected: - virtual void implementation (ACE_Reactor_Impl *implementation); - // Set the implementation class. - - ACE_Reactor_Impl *implementation_; - // Delegation/implementation class that all methods will be - // forwarded to. - - int delete_implementation_; - // Flag used to indicate whether we are responsible for cleaning up - // the implementation instance - - static ACE_Reactor *reactor_; - // Pointer to a process-wide singleton. - - static int delete_reactor_; - // Must delete the singleton if non-0. - - ACE_Reactor (const ACE_Reactor &); - ACE_Reactor &operator = (const ACE_Reactor &); - // Deny access since member-wise won't work... -}; - -#if defined (__ACE_INLINE__) -#include "ace/Reactor.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_REACTOR_H */ diff --git a/ace/Reactor.i b/ace/Reactor.i deleted file mode 100644 index bc7d5ab59d9..00000000000 --- a/ace/Reactor.i +++ /dev/null @@ -1,634 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/Reactor_Impl.h" -#include "ace/Handle_Set.h" - -ACE_INLINE ACE_Reactor_Impl * -ACE_Reactor::implementation (void) -{ - return this->implementation_; -} - -ACE_INLINE void -ACE_Reactor::implementation (ACE_Reactor_Impl *impl) -{ - this->implementation_ = impl; -} - -ACE_INLINE int -ACE_Reactor::current_info (ACE_HANDLE handle, - size_t &size) -{ - return this->implementation ()->current_info (handle, size); -} - -// Run the event loop until the method -// returns -1 or the method is invoked. - -ACE_INLINE int -ACE_Reactor::run_event_loop (void) -{ - ACE_TRACE ("ACE_Reactor::run_event_loop"); - - return - ACE_Reactor::instance () - ->run_reactor_event_loop (ACE_Reactor::check_reconfiguration); -} - -// Run the event loop until the -// method returns -1, the method -// is invoked, or the expires. - -ACE_INLINE int -ACE_Reactor::run_event_loop (ACE_Time_Value &tv) -{ - ACE_TRACE ("ACE_Reactor::run_event_loop"); - - return - ACE_Reactor::instance () - ->run_reactor_event_loop (tv, - ACE_Reactor::check_reconfiguration); -} - -// Run the event loop until the method -// returns -1 or the method is invoked. - -ACE_INLINE int -ACE_Reactor::run_alertable_event_loop (void) -{ - ACE_TRACE ("ACE_Reactor::run_alertable_event_loop"); - - return - ACE_Reactor::instance () - ->run_alertable_reactor_event_loop (ACE_Reactor::check_reconfiguration); -} - -// Run the event loop until the -// method returns -1, the method -// is invoked, or the expires. - -ACE_INLINE int -ACE_Reactor::run_alertable_event_loop (ACE_Time_Value &tv) -{ - ACE_TRACE ("ACE_Reactor::run_alertable_event_loop"); - - return - ACE_Reactor::instance () - ->run_alertable_reactor_event_loop (tv, - ACE_Reactor::check_reconfiguration); -} - -ACE_INLINE void -ACE_Reactor::reset_event_loop (void) -{ - ACE_TRACE ("ACE_Reactor::reset_event_loop"); - - ACE_Reactor::instance ()->reset_reactor_event_loop (); -} - -ACE_INLINE int -ACE_Reactor::end_event_loop (void) -{ - ACE_TRACE ("ACE_Reactor::end_event_loop"); - ACE_Reactor::instance ()->end_reactor_event_loop (); - - return 0; -} - -ACE_INLINE int -ACE_Reactor::event_loop_done (void) -{ - ACE_TRACE ("ACE_Reactor::event_loop_done"); - return ACE_Reactor::instance ()->reactor_event_loop_done (); -} - -ACE_INLINE int -ACE_Reactor::open (size_t size, - int restart, - ACE_Sig_Handler *signal_handler, - ACE_Timer_Queue *timer_queue) -{ - return this->implementation ()->open (size, - restart, - signal_handler, - timer_queue); -} -ACE_INLINE int -ACE_Reactor::set_sig_handler (ACE_Sig_Handler *signal_handler) -{ - return this->implementation ()->set_sig_handler (signal_handler); -} - -ACE_INLINE int -ACE_Reactor::set_timer_queue (ACE_Timer_Queue *timer_queue) -{ - return this->implementation ()->set_timer_queue (timer_queue); -} - -ACE_INLINE int -ACE_Reactor::close (void) -{ - return this->implementation ()->close (); -} - -ACE_INLINE int -ACE_Reactor::work_pending (const ACE_Time_Value &max_wait_time) -{ - return this->implementation ()->work_pending (max_wait_time); -} - -ACE_INLINE int -ACE_Reactor::handle_events (ACE_Time_Value *max_wait_time) -{ - return this->implementation ()->handle_events (max_wait_time); -} - -ACE_INLINE int -ACE_Reactor::alertable_handle_events (ACE_Time_Value *max_wait_time) -{ - return this->implementation ()->alertable_handle_events (max_wait_time); -} - -ACE_INLINE int -ACE_Reactor::handle_events (ACE_Time_Value &max_wait_time) -{ - return this->implementation ()->handle_events (max_wait_time); -} - -ACE_INLINE int -ACE_Reactor::alertable_handle_events (ACE_Time_Value &max_wait_time) -{ - return this->implementation ()->alertable_handle_events (max_wait_time); -} - - -ACE_INLINE int -ACE_Reactor::register_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - // Remember the old reactor. - ACE_Reactor *old_reactor = event_handler->reactor (); - - // Assign *this* to the . - event_handler->reactor (this); - - int result = this->implementation ()->register_handler (event_handler, - mask); - if (result == -1) - // Reset the old reactor in case of failures. - event_handler->reactor (old_reactor); - - return result; -} - -ACE_INLINE int -ACE_Reactor::register_handler (ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - // Remember the old reactor. - ACE_Reactor *old_reactor = event_handler->reactor (); - - // Assign *this* to the . - event_handler->reactor (this); - - int result = this->implementation ()->register_handler (io_handle, - event_handler, - mask); - if (result == -1) - // Reset the old reactor in case of failures. - event_handler->reactor (old_reactor); - - return result; -} - -#if defined (ACE_WIN32) - -ACE_INLINE int -ACE_Reactor::register_handler (ACE_Event_Handler *event_handler, - ACE_HANDLE event_handle) -{ - // Remember the old reactor. - ACE_Reactor *old_reactor = event_handler->reactor (); - - // Assign *this* to the . - event_handler->reactor (this); - - int result = this->implementation ()->register_handler (event_handler, - event_handle); - if (result == -1) - // Reset the old reactor in case of failures. - event_handler->reactor (old_reactor); - - return result; -} - -#endif /* ACE_WIN32 */ - -ACE_INLINE int -ACE_Reactor::register_handler (ACE_HANDLE event_handle, - ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - // Remember the old reactor. - ACE_Reactor *old_reactor = event_handler->reactor (); - - // Assign *this* to the . - event_handler->reactor (this); - - int result = this->implementation ()->register_handler (event_handle, - io_handle, - event_handler, - mask); - if (result == -1) - // Reset the old reactor in case of failures. - event_handler->reactor (old_reactor); - - return result; -} - -ACE_INLINE int -ACE_Reactor::register_handler (const ACE_Handle_Set &handles, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - // Remember the old reactor. - ACE_Reactor *old_reactor = event_handler->reactor (); - - // Assign *this* to the . - event_handler->reactor (this); - - int result = this->implementation ()->register_handler (handles, - event_handler, - mask); - if (result == -1) - // Reset the old reactor in case of failures. - event_handler->reactor (old_reactor); - - return result; -} - -ACE_INLINE int -ACE_Reactor::register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp, - ACE_Event_Handler **old_sh, - ACE_Sig_Action *old_disp) -{ - return this->implementation ()->register_handler (signum, - new_sh, - new_disp, - old_sh, - old_disp); -} - -ACE_INLINE int -ACE_Reactor::register_handler (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp) -{ - return this->implementation ()->register_handler (sigset, - new_sh, - new_disp); -} - -ACE_INLINE int -ACE_Reactor::remove_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - return this->implementation ()->remove_handler (event_handler, - mask); -} - -ACE_INLINE int -ACE_Reactor::remove_handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - return this->implementation ()->remove_handler (handle, - mask); -} - -ACE_INLINE int -ACE_Reactor::remove_handler (const ACE_Handle_Set &handle_set, - ACE_Reactor_Mask mask) -{ - return this->implementation ()->remove_handler (handle_set, - mask); -} - -ACE_INLINE int -ACE_Reactor::remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp, - int sigkey) -{ - return this->implementation ()->remove_handler (signum, - new_disp, - old_disp, - sigkey); -} - -ACE_INLINE int -ACE_Reactor::remove_handler (const ACE_Sig_Set &sigset) -{ - return this->implementation ()->remove_handler (sigset); -} - - -ACE_INLINE int -ACE_Reactor::suspend_handler (ACE_Event_Handler *event_handler) -{ - return this->implementation ()->suspend_handler (event_handler); -} - -ACE_INLINE int -ACE_Reactor::suspend_handler (ACE_HANDLE handle) -{ - return this->implementation ()->suspend_handler (handle); -} - -ACE_INLINE int -ACE_Reactor::suspend_handler (const ACE_Handle_Set &handles) -{ - return this->implementation ()->suspend_handler (handles); -} - -ACE_INLINE int -ACE_Reactor::suspend_handlers (void) -{ - return this->implementation ()->suspend_handlers (); -} - -ACE_INLINE int -ACE_Reactor::resume_handler (ACE_Event_Handler *event_handler) -{ - return this->implementation ()->resume_handler (event_handler); -} - -ACE_INLINE int -ACE_Reactor::resume_handler (ACE_HANDLE handle) -{ - return this->implementation ()->resume_handler (handle); -} - -ACE_INLINE int -ACE_Reactor::resume_handler (const ACE_Handle_Set &handles) -{ - return this->implementation ()->resume_handler (handles); -} - -ACE_INLINE int -ACE_Reactor::resume_handlers (void) -{ - return this->implementation ()->resume_handlers (); -} - - -ACE_INLINE int -ACE_Reactor::reset_timer_interval - (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Reactor::reset_timer_interval"); - - return this->implementation ()->reset_timer_interval - (timer_id, - interval); -} - -ACE_INLINE long -ACE_Reactor::schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delta, - const ACE_Time_Value &interval) -{ - // Remember the old reactor. - ACE_Reactor *old_reactor = event_handler->reactor (); - - // Assign *this* to the . - event_handler->reactor (this); - - int result = this->implementation ()->schedule_timer (event_handler, - arg, - delta, - interval); - if (result == -1) - // Reset the old reactor in case of failures. - event_handler->reactor (old_reactor); - - return result; -} - -ACE_INLINE int -ACE_Reactor::cancel_timer (ACE_Event_Handler *event_handler, - int dont_call_handle_close) -{ - return this->implementation ()->cancel_timer (event_handler, - dont_call_handle_close); -} - -ACE_INLINE int -ACE_Reactor::cancel_timer (long timer_id, - const void **arg, - int dont_call_handle_close) -{ - return this->implementation ()->cancel_timer (timer_id, - arg, - dont_call_handle_close); -} - - -ACE_INLINE int -ACE_Reactor::schedule_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_added) -{ - // Remember the old reactor. - ACE_Reactor *old_reactor = event_handler->reactor (); - - // Assign *this* to the . - event_handler->reactor (this); - - int result = this->implementation ()->schedule_wakeup (event_handler, - masks_to_be_added); - if (result == -1) - // Reset the old reactor in case of failures. - event_handler->reactor (old_reactor); - - return result; -} - -ACE_INLINE int -ACE_Reactor::schedule_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_added) -{ - return implementation ()->schedule_wakeup (handle, - masks_to_be_added); -} - -ACE_INLINE int -ACE_Reactor::cancel_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_cleared) -{ - return this->implementation ()->cancel_wakeup (event_handler, - masks_to_be_cleared); -} - -ACE_INLINE int -ACE_Reactor::cancel_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_cleared) -{ - return this->implementation ()->cancel_wakeup (handle, - masks_to_be_cleared); -} - - -ACE_INLINE int -ACE_Reactor::notify (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - ACE_Time_Value *tv) -{ - return this->implementation ()->notify (event_handler, - mask, - tv); -} - -ACE_INLINE void -ACE_Reactor::max_notify_iterations (int iterations) -{ - this->implementation ()->max_notify_iterations (iterations); -} - -ACE_INLINE int -ACE_Reactor::max_notify_iterations (void) -{ - return this->implementation ()->max_notify_iterations (); -} - -ACE_INLINE int -ACE_Reactor::handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **event_handler) -{ - return this->implementation ()->handler (handle, - mask, - event_handler); -} - -ACE_INLINE int -ACE_Reactor::handler (int signum, - ACE_Event_Handler **event_handler) -{ - return this->implementation ()->handler (signum, - event_handler); -} - -ACE_INLINE int -ACE_Reactor::initialized (void) -{ - return this->implementation ()->initialized (); -} - -ACE_INLINE ACE_Lock & -ACE_Reactor::lock (void) -{ - return this->implementation ()->lock (); -} - -ACE_INLINE void -ACE_Reactor::wakeup_all_threads (void) -{ - this->implementation ()->wakeup_all_threads (); -} - -ACE_INLINE int -ACE_Reactor::owner (ACE_thread_t new_owner, - ACE_thread_t *old_owner) -{ - return this->implementation ()->owner (new_owner, - old_owner); -} - -ACE_INLINE int -ACE_Reactor::owner (ACE_thread_t *owner) -{ - return this->implementation ()->owner (owner); -} - -ACE_INLINE int -ACE_Reactor::restart (void) -{ - return this->implementation ()->restart (); -} - -ACE_INLINE int -ACE_Reactor::restart (int r) -{ - return this->implementation ()->restart (r); -} - -ACE_INLINE void -ACE_Reactor::requeue_position (int position) -{ - this->implementation ()->requeue_position (position); -} - -ACE_INLINE int -ACE_Reactor::requeue_position (void) -{ - return this->implementation ()->requeue_position (); -} - - -ACE_INLINE int -ACE_Reactor::mask_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops) -{ - return this->implementation ()->mask_ops (event_handler, - mask, - ops); -} - -ACE_INLINE int -ACE_Reactor::mask_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops) -{ - return this->implementation ()->mask_ops (handle, - mask, - ops); -} - -ACE_INLINE int -ACE_Reactor::ready_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops) -{ - return this->implementation ()->ready_ops (event_handler, - mask, - ops); -} - -ACE_INLINE int -ACE_Reactor::ready_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops) -{ - return this->implementation ()->ready_ops (handle, - mask, - ops); -} - -ACE_INLINE size_t -ACE_Reactor::size (void) -{ - return this->implementation ()->size (); -} - -ACE_INLINE int -ACE_Reactor::uses_event_associations (void) -{ - return this->implementation ()->uses_event_associations (); -} diff --git a/ace/Reactor_Impl.h b/ace/Reactor_Impl.h deleted file mode 100644 index 2f84a748d12..00000000000 --- a/ace/Reactor_Impl.h +++ /dev/null @@ -1,465 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Reactor_Impl.h -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ - -#ifndef ACE_REACTOR_IMPL_H -#define ACE_REACTOR_IMPL_H -#include "ace/pre.h" - -// Timer Queue is a complicated template class. A simple forward -// declaration will not work -#include "ace/Timer_Queue.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Event_Handler.h contains the definition of ACE_Reactor_Mask -#include "ace/Event_Handler.h" - -// We are using 4 or 5 signal classes, we could forward declare -// them.... But Timer_Queue_T.h includes Signal.h, so I don't think -// forward declaration will be useful here -#include "ace/Signal.h" - -// Forward decls -class ACE_Handle_Set; -class ACE_Reactor_Impl; - -class ACE_Export ACE_Reactor_Notify : public ACE_Event_Handler -{ - // = TITLE - // Abstract class for unblocking an from its - // event loop. -public: - // = Initialization and termination methods. - virtual int open (ACE_Reactor_Impl *, - ACE_Timer_Queue *timer_queue = 0, - int disable_notify = 0) = 0; - virtual int close (void) = 0; - - virtual ssize_t notify (ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value * = 0) = 0; - // Called by a thread when it wants to unblock the . - // This wakeups the if currently blocked. Pass over - // both the *and* the to allow the caller to - // dictate which method the will - // invoke. The indicates how long to blocking - // trying to notify the . If == 0, the - // caller will block until action is possible, else will wait until - // the relative time specified in * elapses). - - virtual int dispatch_notifications (int &number_of_active_handles, - ACE_Handle_Set &rd_mask) = 0; - // Handles pending threads (if any) that are waiting to unblock the - // . - - virtual void max_notify_iterations (int) = 0; - // Set the maximum number of times that the method - // will iterate and dispatch the that are - // passed in via the notify queue before breaking out of the event - // loop. By default, this is set to -1, which means "iterate until - // the queue is empty." Setting this to a value like "1 or 2" will - // increase "fairness" (and thus prevent starvation) at the expense - // of slightly higher dispatching overhead. - - virtual int max_notify_iterations (void) = 0; - // Get the maximum number of times that the method - // will iterate and dispatch the that are - // passed in via the notify queue before breaking out of its event - // loop. - - virtual void dump (void) const = 0; - // Dump the state of an object. -}; - -class ACE_Export ACE_Reactor_Impl -{ - // = TITLE - // An abstract class for implementing the Reactor Pattern. -public: - virtual ~ACE_Reactor_Impl (void) {} - // Close down and release all resources. - - virtual int open (size_t size, - int restart = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify * = 0) = 0; - // Initialization. - - virtual int current_info (ACE_HANDLE, size_t & /* size */) = 0; - // Returns 0, if the size of the current message has been put in - // Returns -1, if not. ACE_HANDLE allows the reactor to - // check if the caller is valid. - - virtual int set_sig_handler (ACE_Sig_Handler *signal_handler) = 0; - // Use a user specified signal handler instead. - - virtual int set_timer_queue (ACE_Timer_Queue *timer_queue) = 0; - // Use a user specified timer queue instead. - - virtual int close (void) = 0; - // Close down and release all resources. - - // = Event loop drivers. - virtual int work_pending (const ACE_Time_Value &max_wait_time = ACE_Time_Value::zero) = 0; - // Returns non-zero if there are I/O events "ready" for dispatching, - // but does not actually dispatch the event handlers. By default, - // don't block while checking this, i.e., "poll". - - virtual int handle_events (ACE_Time_Value *max_wait_time = 0) = 0; - virtual int alertable_handle_events (ACE_Time_Value *max_wait_time = 0) = 0; - // This event loop driver blocks for up to before - // returning. It will return earlier if events occur. Note that - // can be 0, in which case this method blocks - // indefinitely until events occur. - // - // is decremented to reflect how much time this call - // took. For instance, if a time value of 3 seconds is passed to - // handle_events and an event occurs after 2 seconds, - // will equal 1 second. This can be used if an - // application wishes to handle events for some fixed amount of - // time. - // - // Returns the total number of s that were - // dispatched, 0 if the elapsed without dispatching - // any handlers, or -1 if an error occurs. - // - // The only difference between and - // is that in the alertable case, the eventloop will - // return when the system queues an I/O completion routine or an - // Asynchronous Procedure Call. - - virtual int handle_events (ACE_Time_Value &max_wait_time) = 0; - virtual int alertable_handle_events (ACE_Time_Value &max_wait_time) = 0; - // This method is just like the one above, except the - // value is a reference and can therefore never be - // NULL. - // - // The only difference between and - // is that in the alertable case, the eventloop will - // return when the system queues an I/O completion routine or an - // Asynchronous Procedure Call. - - // = Event handling control. - - virtual int deactivated (void) = 0; - // Return the status of Reactor. If this function returns 0, the reactor is - // actively handling events. If it returns non-zero, and - // return -1 immediately. - - virtual void deactivate (int do_stop) = 0; - // Control whether the Reactor will handle any more incoming events or not. - // If == 1, the Reactor will be disabled. By default, a reactor - // is in active state and can be deactivated/reactived as wish. - - // = Register and remove Handlers. - - virtual int register_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) = 0; - // Register with . The I/O handle will always - // come from on the . - - virtual int register_handler (ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) = 0; - // Register with . The I/O handle is provided - // through the parameter. - -#if defined (ACE_WIN32) - - // Originally this interface was available for all platforms, but - // because ACE_HANDLE is an int on non-Win32 platforms, compilers - // are not able to tell the difference between - // register_handler(ACE_Event_Handler*,ACE_Reactor_Mask) and - // register_handler(ACE_Event_Handler*,ACE_HANDLE). Therefore, we - // have restricted this method to Win32 only. - - virtual int register_handler (ACE_Event_Handler *event_handler, - ACE_HANDLE event_handle = ACE_INVALID_HANDLE) = 0; - // Register an that will be notified when - // is signaled. Since no event mask is passed - // through this interface, it is assumed that the - // being passed in is an event handle and not an I/O handle. - -#endif /* ACE_WIN32 */ - - virtual int register_handler (ACE_HANDLE event_handle, - ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) = 0; - // Register an that will be notified when - // is signaled. specifies the network events - // that the is interested in. - - virtual int register_handler (const ACE_Handle_Set &handles, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) = 0; - // Register with all the in the . - - virtual int register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0) = 0; - // Register to handle the signal using the - // . Returns the that was previously registered - // (if any), along with the of the signal handler. - - virtual int register_handler (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0) = 0; - // Registers to handle a set of signals using the - // . - - virtual int remove_handler (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) = 0; - // Removes . Note that the I/O handle will be - // obtained using method of . If - // == then the - // method of the is not invoked. - - virtual int remove_handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask) = 0; - // Removes . If == - // then the method of the associated - // is not invoked. - - virtual int remove_handler (const ACE_Handle_Set &handle_set, - ACE_Reactor_Mask mask) = 0; - // Removes all handles in . If == - // then the method of - // the associated s is not invoked. - - virtual int remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp = 0, - int sigkey = -1) = 0; - // Remove the ACE_Event_Handler currently associated with . - // Install the new disposition (if given) and return the previous - // disposition (if desired by the caller). Returns 0 on success and - // -1 if is invalid. - - virtual int remove_handler (const ACE_Sig_Set &sigset) = 0; - // Calls for every signal in . - - // = Suspend and resume Handlers. - - virtual int suspend_handler (ACE_Event_Handler *event_handler) = 0; - // Suspend temporarily. Use - // to get the handle. - - virtual int suspend_handler (ACE_HANDLE handle) = 0; - // Suspend temporarily. - - virtual int suspend_handler (const ACE_Handle_Set &handles) = 0; - // Suspend all in handle set temporarily. - - virtual int suspend_handlers (void) = 0; - // Suspend all temporarily. - - virtual int resume_handler (ACE_Event_Handler *event_handler) = 0; - // Resume . Use to - // get the handle. - - virtual int resume_handler (ACE_HANDLE handle) = 0; - // Resume . - - virtual int resume_handler (const ACE_Handle_Set &handles) = 0; - // Resume all in handle set. - - virtual int resume_handlers (void) = 0; - // Resume all . - - virtual int uses_event_associations (void) = 0; - // Return 1 if we any event associations were made by the reactor - // for the handles that it waits on, 0 otherwise. - - // If we need to reset handles returned from accept/connect. - - // = Timer management. - - virtual long schedule_timer (ACE_Event_Handler *event_handler, - const void *arg, - const ACE_Time_Value &delta, - const ACE_Time_Value &interval = ACE_Time_Value::zero) = 0; - // Schedule an that will expire after amount - // of time, which is specified as relative time to the current - // . If it expires then is passed in as the - // value to the 's callback method. - // If is != to then it is used to - // reschedule the automatically, also using relative - // time. This method returns a that uniquely identifies - // the in an internal list. This can be - // used to cancel an before it expires. The - // cancellation ensures that are unique up to values of - // greater than 2 billion timers. As long as timers don't stay - // around longer than this there should be no problems with - // accidentally deleting the wrong timer. Returns -1 on failure - // (which is guaranteed never to be a valid . - - virtual int reset_timer_interval (long timer_id, - const ACE_Time_Value &interval) = 0; - // Resets the interval of the timer represented by to - // , which is specified in relative time to the current - // . If is equal to - // , the timer will become a non-rescheduling - // timer. Returns 0 if successful, -1 if not. - - virtual int cancel_timer (ACE_Event_Handler *event_handler, - int dont_call_handle_close = 1) = 0; - // Cancel all Event_Handlers that match the address of - // . Returns number of handlers cancelled. - - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1) = 0; - // Cancel the single Event_Handler that matches the value - // (which was returned from the schedule method). If arg is - // non-NULL then it will be set to point to the ``magic cookie'' - // argument passed in when the Event_Handler was registered. This - // makes it possible to free up the memory and avoid memory leaks. - // Returns 1 if cancellation succeeded and 0 if the - // wasn't found. - - // = High-level Event_Handler scheduling operations - - virtual int schedule_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_added) = 0; - // Add to the 's entry. - // must already have been registered. - - virtual int schedule_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_added) = 0; - // Add to the 's entry. - // associated with must already have been registered. - - virtual int cancel_wakeup (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask masks_to_be_cleared) = 0; - // Clear from the 's entry. - - virtual int cancel_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask masks_to_be_cleared) = 0; - // Clear from the 's entry. - - // = Notification methods. - - virtual int notify (ACE_Event_Handler *event_handler = 0, - ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value * = 0) = 0; - // Notify of event. The - // indicates how long to blocking trying to notify. If == - // 0, the caller will block until action is possible, else will wait - // until the relative time specified in elapses). - - virtual void max_notify_iterations (int) = 0; - // Set the maximum number of times that ACE_Reactor_Impl will - // iterate and dispatch the that are passed in - // via the notify queue before breaking out of its - // loop. By default, this is set to - // -1, which means "iterate until the queue is empty." Setting this - // to a value like "1 or 2" will increase "fairness" (and thus - // prevent starvation) at the expense of slightly higher dispatching - // overhead. - - virtual int max_notify_iterations (void) = 0; - // Get the maximum number of times that the ACE_Reactor_Impl will - // iterate and dispatch the that are passed in - // via the notify queue before breaking out of its - // loop. - - virtual int handler (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **event_handler = 0) = 0; - // Check to see if is associated with a valid Event_Handler - // bound to . Return the associated with this - // if != 0. - - virtual int handler (int signum, - ACE_Event_Handler ** = 0) = 0; - // Check to see if is associated with a valid Event_Handler - // bound to a signal. Return the associated with - // this if != 0. - - virtual int initialized (void) = 0; - // Returns true if Reactor has been successfully initialized, else - // false. - - virtual size_t size (void) = 0; - // Returns the current size of the Reactor's internal descriptor - // table. - - virtual ACE_Lock &lock (void) = 0; - // Returns a reference to the Reactor's internal lock. - - virtual void wakeup_all_threads (void) = 0; - // Wake up all threads in waiting in the event loop - - virtual int owner (ACE_thread_t new_owner, ACE_thread_t *old_owner = 0) = 0; - // Transfers ownership of Reactor_Impl to the . - - virtual int owner (ACE_thread_t *owner) = 0; - // Return the ID of the "owner" thread. - - virtual int restart (void) = 0; - // Get the existing restart value. - - virtual int restart (int r) = 0; - // Set a new value for restart and return the original value. - - virtual void requeue_position (int) = 0; - // Set position of the owner thread. - - virtual int requeue_position (void) = 0; - // Get position of the owner thread. - - // = Low-level wait_set mask manipulation methods. - - virtual int mask_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops) = 0; - // GET/SET/ADD/CLR the dispatch mask "bit" bound with the - // and . - - virtual int mask_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops) = 0; - // GET/SET/ADD/CLR the dispatch MASK "bit" bound with the - // and . - - // = Low-level ready_set mask manipulation methods. - virtual int ready_ops (ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask, - int ops) = 0; - // GET/SET/ADD/CLR the ready "bit" bound with the - // and . - - virtual int ready_ops (ACE_HANDLE handle, - ACE_Reactor_Mask, - int ops) = 0; - // GET/SET/ADD/CLR the ready "bit" bound with the and . - - virtual void dump (void) const = 0; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#include "ace/post.h" -#endif /* ACE_REACTOR_IMPL_H */ diff --git a/ace/Read_Buffer.cpp b/ace/Read_Buffer.cpp deleted file mode 100644 index 1c599c31404..00000000000 --- a/ace/Read_Buffer.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// $Id$ - -#include "ace/Read_Buffer.h" -#include "ace/Service_Config.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Read_Buffer.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Read_Buffer, "$Id$") - -void -ACE_Read_Buffer::dump (void) const -{ - ACE_TRACE ("ACE_Read_Buffer::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("size_ = %d"), this->size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\noccurrences_ = %d"), this->occurrences_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nstream_ = %x"), this->stream_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nallocator_ = %x"), this->allocator_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_Read_Buffer::ACE_Read_Buffer (FILE *fp, - int close_on_delete, - ACE_Allocator *alloc) - : stream_ (fp), - close_on_delete_ (close_on_delete), - allocator_ (alloc) -{ - ACE_TRACE ("ACE_Read_Buffer::ACE_Read_Buffer"); - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); -} - -ACE_Read_Buffer::ACE_Read_Buffer (ACE_HANDLE handle, - int close_on_delete, - ACE_Allocator *alloc) - : stream_ (ACE_OS::fdopen (handle, ACE_TEXT ("r"))), - close_on_delete_ (close_on_delete), - allocator_ (alloc) -{ - ACE_TRACE ("ACE_Read_Buffer::ACE_Read_Buffer"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); -} - -ACE_Read_Buffer::~ACE_Read_Buffer (void) -{ - ACE_TRACE ("ACE_Read_Buffer::~ACE_Read_Buffer"); - - if (this->close_on_delete_) - ACE_OS::fclose (this->stream_); -} - -// Input: term the character to terminate on -// search the character to search for -// replace the character with which to replace search -// Output: a buffer containing the contents of stream -// Method: call the recursive helper function read_helper - -char * -ACE_Read_Buffer::read (int term, int search, int replace) -{ - ACE_TRACE ("ACE_Read_Buffer::read"); - this->occurrences_ = 0; - this->size_ = 0; - return this->rec_read (term, search, replace); -} - -// Input: term the termination character -// search the character to search for -// replace the character with which to replace search -// Purpose: read in a file to a buffer using only a single dynamic -// allocation. -// Method: read until the local buffer is full and then recurse. -// Must continue until the termination character is reached. -// Allocate the final buffer based on the number of local -// buffers read and as the recursive calls bottom out, -// copy them in reverse order into the allocated buffer. - -char * -ACE_Read_Buffer::rec_read (int term, int search, int replace) -{ - ACE_TRACE ("ACE_Read_Buffer::rec_read"); - // This is our temporary workspace. - char buf[BUFSIZ]; - - int c = EOF; - size_t slot = 0; - int done = 0; - - // Read in the file char by char - while (slot < BUFSIZ) - { - c = getc (this->stream_); - - // Don't insert EOF into the buffer... - if (c == EOF) - { - if (slot == 0) - return 0; - else - { - ungetc (c, this->stream_); - break; - } - } - else if (c == term) - done = 1; - - // Check for possible substitutions. - if (c == search) - { - this->occurrences_++; - - if (replace >= 0) - c = replace; - } - - buf[slot++] = (char) c; - - // Substitutions must be made before checking for termination. - if (done) - break; - } - - // Increment the number of bytes. - this->size_ += slot; - - char *result; - - // Recurse, when the recursion bottoms out, allocate the result - // buffer. - if (done || c == EOF) - { - // Use the allocator to acquire the memory. The + 1 allows - // space for the null terminator. - result = (char *) this->allocator_->malloc (this->size_ + 1); - - if (result == 0) - { - errno = ENOMEM; - return 0; - } - result += this->size_; - - // Null terminate the buffer. - *result = '\0'; - } - else if ((result = this->rec_read (term, search, replace)) == 0) - return 0; - - - // Copy buf into the appropriate location starting from end of - // buffer. Peter says this is confusing and that we should use - // memcpy() ;-) - for (size_t j = slot; j > 0; j--) - *--result = buf[j - 1]; - - return result; -} diff --git a/ace/Read_Buffer.h b/ace/Read_Buffer.h deleted file mode 100644 index 84688f9bc0c..00000000000 --- a/ace/Read_Buffer.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Read_Buffer.h -// -// = AUTHOR -// Doug Schmidt and Seth Widoff -// -// ============================================================================ - -#ifndef ACE_READ_BUFFER_H -#define ACE_READ_BUFFER_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Malloc.h" - -class ACE_Export ACE_Read_Buffer -{ - // = TITLE - // Efficiently reads an artibrarily large buffer from an input - // stream up to and including a termination character. Also - // performs search/replace on single occurrences a character in - // the buffer using the principles of Integrated Layer - // Processing. - // - // = DESCRIPTION - // This implementation is optimized to do a single dynamic - // allocation and make only one copy of the data. It uses - // recursion and the run-time stack to accomplish this - // efficiently. -public: - // = Initialization and termination methods. - ACE_Read_Buffer (FILE *fp, - int close_on_delete = 0, - ACE_Allocator * = 0); - // Read from a FILE *. - - ACE_Read_Buffer (ACE_HANDLE handle, - int close_on_delete = 0, - ACE_Allocator * = 0); - // Read from an open HANDLE. - - ~ACE_Read_Buffer (void); - // Closes the FILE *. - - char *read (int terminator = EOF, - int search = '\n', - int replace = '\0'); - // Returns a pointer dynamically allocated with - // to data from the input stream up to (and - // including) the . If is >= 0 then all - // occurrences of the value are substituted with the - // value. The last of the byte of data is a 0, so that - // can be used on it. The caller is responsible for - // freeing the pointer returned from this method using the - // . - - size_t replaced (void) const; - // Returns the number of characters replaced during a . - - size_t size (void) const; - // Returns the size of the allocated buffer obtained during a - // , not including the null terminator. - - ACE_Allocator *alloc (void) const; - // Returns a pointer to its allocator. - - void dump (void) const; - // Dump the state of the object. - -private: - char *rec_read (int term, int search, int replace); - // Recursive helper method that does the work... - - size_t size_; - // The total number of characters in the buffer. - - size_t occurrences_; - // The total number of characters replaced. - - FILE *stream_; - // The stream we are reading from. - - int close_on_delete_; - // Keeps track of whether we should close the FILE in the - // destructor. - - ACE_Allocator *allocator_; - // Pointer to the allocator. - - // = Disallow copying and assignment... - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Read_Buffer &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Read_Buffer (const ACE_Read_Buffer &)) -}; - -#if defined (__ACE_INLINE__) -# include "ace/Read_Buffer.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_READ_BUFFER_H */ diff --git a/ace/Read_Buffer.i b/ace/Read_Buffer.i deleted file mode 100644 index 3534c62db2e..00000000000 --- a/ace/Read_Buffer.i +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Accessor to the number of bytes in the buffer. - -ACE_INLINE size_t -ACE_Read_Buffer::size (void) const -{ - ACE_TRACE ("ACE_Read_Buffer::size"); - return this->size_; -} - -// The total number of characters replaced. - -ACE_INLINE size_t -ACE_Read_Buffer::replaced (void) const -{ - ACE_TRACE ("ACE_Read_Buffer::replaced"); - return this->occurrences_; -} - -ACE_INLINE ACE_Allocator * -ACE_Read_Buffer::alloc (void) const -{ - ACE_TRACE ("ACE_Read_Buffer::alloc"); - return this->allocator_; -} - diff --git a/ace/Registry.cpp b/ace/Registry.cpp deleted file mode 100644 index aa8e79ec7e7..00000000000 --- a/ace/Registry.cpp +++ /dev/null @@ -1,1126 +0,0 @@ -// $Id$ - -#include "ace/Registry.h" - -ACE_RCSID(ace, Registry, "$Id$") - -#if defined (ACE_WIN32) - -// Funky macro to deal with strange error passing semantics -// of Win32 Reg*() functions -#define ACE_REGISTRY_CALL_RETURN(X) \ - do { \ - if (X != ERROR_SUCCESS) \ - { \ - errno = X; \ - return -1; \ - } \ - else \ - return 0; \ - } while (0) - - -// Separator for components in a name -/* static */ -const ACE_TCHAR *ACE_Registry::STRING_SEPARATOR = ACE_TEXT ("\\"); - -int -ACE_Registry::Name_Component::operator== (const Name_Component &rhs) const -{ - return - rhs.id_ == this->id_ && - rhs.kind_ == this->kind_; -} - -int -ACE_Registry::Name_Component::operator!= (const Name_Component &rhs) const -{ - return !this->operator== (rhs); -} - -// Simple binding constructor -ACE_Registry::Binding::Binding () - : name_ (), - type_ (INVALID) -{ -} - - -// Binding constructor -// (Name version) -ACE_Registry::Binding::Binding (const Name &name, - Binding_Type type) - : name_ (ACE_Registry::make_string (name)), - type_ (type) -{ -} - - -// Binding constructor -// (String version) -ACE_Registry::Binding::Binding (const ACE_TString &name, - Binding_Type type) - : name_ (name), - type_ (type) -{ -} - - -int -ACE_Registry::Binding::operator== (const Binding &rhs) const -{ - return - rhs.name_ == this->name_ && - rhs.type_ == this->type_; -} - -int -ACE_Registry::Binding::operator!= (const Binding &rhs) const -{ - return !this->operator== (rhs); -} - -// Name accessor -// (Name version) -void -ACE_Registry::Binding::name (Name &name) -{ - name = ACE_Registry::make_name (this->name_); -} - - -// Name accessors -// (String version) -void -ACE_Registry::Binding::name (ACE_TString &name) -{ - name = this->name_; -} - - -// Name accessors -// (String version) -ACE_TString -ACE_Registry::Binding::name (void) -{ - return this->name_; -} - - -// Type accessor -ACE_Registry::Binding_Type -ACE_Registry::Binding::type (void) -{ - return this->type_; -} - - -// Simple object constructor -ACE_Registry::Object::Object (void *data, - u_long size, - u_long type) - : data_ (data), - size_ (size), - type_ (type) -{ -} - -// Object accessors and set methods -void -ACE_Registry::Object::data (void *data) -{ - this->data_ = data; -} - - -void * -ACE_Registry::Object::data (void) const -{ - return this->data_; -} - - -void -ACE_Registry::Object::size (u_long size) -{ - this->size_ = size; -} - - -u_long -ACE_Registry::Object::size (void) const -{ - return this->size_; -} - - -void -ACE_Registry::Object::type (u_long type) -{ - this->type_ = type; -} - - -u_long -ACE_Registry::Object::type (void) const -{ - return this->type_; -} - - -// Simple context constructor -ACE_Registry::Naming_Context::Naming_Context (void) - : key_ ((HKEY) 0), - parent_key_ ((HKEY) 0), - name_ () -{ -} - - -// Context constructor -ACE_Registry::Naming_Context::Naming_Context (const HKEY &key) - : key_ (key), - parent_key_ ((HKEY) 0), - name_ () -{ -} - - -ACE_Registry::Naming_Context::Naming_Context (const Naming_Context &rhs) - : key_ (rhs.key_), - parent_key_ (rhs.parent_key_), - name_ (rhs.name_) -{ - // This is incorrect. - // Rather than copying key, we should call ::DuplicateHandle() - // But since this is private (and not used), I don't care much -} - - -const ACE_Registry::Naming_Context & -ACE_Registry::Naming_Context::operator= (const Naming_Context &rhs) -{ - ACE_UNUSED_ARG(rhs); - - // Not implemented - return *this; -} - - -// Destructor -ACE_Registry::Naming_Context::~Naming_Context () -{ - this->close (); -} - - -// Insert with into context -// (Name version) -int -ACE_Registry::Naming_Context::bind_new (const Name &name, - const Object &object) -{ - return this->bind_new (ACE_Registry::make_string (name), object); -} - - -// Insert with into context -// (String version) -int -ACE_Registry::Naming_Context::bind_new (const ACE_TString &name, - const Object &object) -{ - // temporary object - Object temp; - long result = this->resolve (name, temp); - if (result == 0) - // resolve succeeded - result = -1; - else - // resolve failed - result = this->bind (name, object); - return result; -} - - -// Insert or update with into context -// (Name version) -int -ACE_Registry::Naming_Context::bind (const Name &name, - const Object &object) -{ - return this->bind (ACE_Registry::make_string (name), object); -} - - -// Insert or update with into context -// (String version) -int -ACE_Registry::Naming_Context::bind (const ACE_TString &name, - const Object &object) -{ - long result = ACE_TEXT_RegSetValueEx (this->key_, - name.c_str (), - 0, - object.type (), - (const BYTE *) object.data (), - object.size ()); - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Update with in context -// (Name version) -int -ACE_Registry::Naming_Context::rebind (const Name &name, - const Object &new_object) -{ - return this->rebind (ACE_Registry::make_string (name), new_object); -} - - -// Update with in context -// (String version) -int -ACE_Registry::Naming_Context::rebind (const ACE_TString &name, - const Object &new_object) -{ - Object old_object; - // find the old one first - long result = this->resolve (name, old_object); - if (result == 0) - // no need to delete first - result = this->bind (name, new_object); - return result; -} - - -// Find with in context -// (Name version) -int -ACE_Registry::Naming_Context::resolve (const Name &name, - Object &object) -{ - return this->resolve (ACE_Registry::make_string (name), object); -} - - -// Find with in context -// (String version) -int -ACE_Registry::Naming_Context::resolve (const ACE_TString &name, - Object &object) -{ - // Get object state - u_long type; - void *data = object.data (); - u_long size = object.size (); - - long result = ACE_TEXT_RegQueryValueEx (this->key_, - name.c_str (), - 0, - &type, - (BYTE *)data, - &size); - if (result == ERROR_SUCCESS) - { - // Reset object state - // No need to set object.data() - object.type (type); - object.size (size); - } - - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Remove object with in context -// (Name version) -int -ACE_Registry::Naming_Context::unbind (const Name &name) -{ - return this->unbind (ACE_Registry::make_string (name)); -} - - -// Remove object with in context -// (String version) -int -ACE_Registry::Naming_Context::unbind (const ACE_TString &name) -{ - long result = ACE_TEXT_RegDeleteValue (this->key_, - name.c_str ()); - - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Create new relative to context -// This method may not mean a lot in this implementation -int -ACE_Registry::Naming_Context::new_context (Naming_Context &naming_context) -{ - // Make sure that we reset the state and close keys - return naming_context.close (); -} - - -// Insert with relative to context -// (Name version) -int -ACE_Registry::Naming_Context::bind_new_context (const Name &name, - Naming_Context &naming_context, - u_long persistence, - u_long security_access, - LPSECURITY_ATTRIBUTES security_attributes) -{ - return this->bind_new_context (ACE_Registry::make_string (name), - naming_context, - persistence, - security_access, - security_attributes); -} - - -// Insert with relative to context -// (String version) -int -ACE_Registry::Naming_Context::bind_new_context (const ACE_TString &name, - Naming_Context &naming_context, - u_long persistence, - u_long security_access, - LPSECURITY_ATTRIBUTES security_attributes) -{ - u_long reason; - - long result = ACE_TEXT_RegCreateKeyEx (this->key_, - name.c_str (), - 0, - 0, - persistence, - security_access, - security_attributes, - &naming_context.key_, - &reason); - if (result == ERROR_SUCCESS) - // If create succeeds - { - if (reason == REG_CREATED_NEW_KEY) - // If new key: success - { - // Set the correct parent - naming_context.parent (this->key_); - // Set the correct name - naming_context.name (name); - } - else - // reason == REG_OPENED_EXISTING_KEY - // Failed to make new key - { - // reset result to failure - result = -1; - // Close the key first - ::RegCloseKey (naming_context.key_); - // Reset key - naming_context.key_ = (HKEY) 0; - } - } - - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Insert or update with relative to context -// (Name version) -int -ACE_Registry::Naming_Context::bind_context (const Name &name, - /* const */ Naming_Context &naming_context, - u_long persistence, - u_long security_access, - LPSECURITY_ATTRIBUTES security_attributes) -{ - return this->bind_context (ACE_Registry::make_string (name), - naming_context, - persistence, - security_access, - security_attributes); -} - - -// Insert or update with relative to context -// (String version) -int -ACE_Registry::Naming_Context::bind_context (const ACE_TString &name, - /* const */ Naming_Context &naming_context, - u_long persistence, - u_long security_access, - LPSECURITY_ATTRIBUTES security_attributes) -{ - u_long reason; - - long result = ACE_TEXT_RegCreateKeyEx (this->key_, - name.c_str (), - 0, - 0, - persistence, - security_access, - security_attributes, - &naming_context.key_, - &reason); - if (result == ERROR_SUCCESS) - { - // Set the correct parent - naming_context.parent (this->key_); - // Set the correct name - naming_context.name (name); - } - - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Rename to -// (Name version) -int -ACE_Registry::Naming_Context::rebind_context (const Name &name, - /* const */ Naming_Context &new_naming_context) -{ - return this->rebind_context (ACE_Registry::make_string (name), - new_naming_context); -} - - -// Rename to -// (String version) -int -ACE_Registry::Naming_Context::rebind_context (const ACE_TString &name, - /* const */ Naming_Context &new_naming_context) -{ - Naming_Context old_naming_context; - // find the old one first - long result = this->resolve_context (name, - old_naming_context); - if (result == 0) - { - // naming_context is found: delete entry - result = this->unbind_context (name); - if (result == 0) - { - // successful deletion; rebind - // beware of race conditions here - // (lets resolve this later) - result = this->bind_new_context (name, new_naming_context); - } - } - return result; -} - - -// Remove naming_context with from context -// (Name version) -int -ACE_Registry::Naming_Context::unbind_context (const Name &name) -{ - return this->unbind_context (ACE_Registry::make_string (name)); -} - - -// Remove naming_context with from context -// (String version) -int -ACE_Registry::Naming_Context::unbind_context (const ACE_TString &name) -{ - long result = ACE_TEXT_RegDeleteKey (this->key_, - name.c_str ()); - - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Find with in context -// (Name version) -int -ACE_Registry::Naming_Context::resolve_context (const Name &name, - Naming_Context &naming_context, - u_long security_access) -{ - return this->resolve_context (ACE_Registry::make_string (name), - naming_context, - security_access); -} - - -// Find with in context -// (String version) -int -ACE_Registry::Naming_Context::resolve_context (const ACE_TString &name, - Naming_Context &naming_context, - u_long security_access) -{ - long result = ACE_TEXT_RegOpenKeyEx (this->key_, - name.c_str (), - 0, - security_access, - &naming_context.key_); - if (result == ERROR_SUCCESS) - { - // set the correct parent - naming_context.parent (this->key_); - // set the correct name - naming_context.name (name); - } - - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Same as unbind_context() with as naming_context -int -ACE_Registry::Naming_Context::destroy (void) -{ - // hopefully the parent_key_ is still open - long result = ACE_TEXT_RegDeleteKey (this->parent_key_, - this->name_.c_str ()); - - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Sync content of context to disk -int -ACE_Registry::Naming_Context::flush (void) -{ - long result = ::RegFlushKey (this->key_); - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Close the handle of the context -int -ACE_Registry::Naming_Context::close (void) -{ - long result = this->key_ ? ::RegCloseKey (this->key_) : ERROR_SUCCESS; - ACE_REGISTRY_CALL_RETURN (result); -} - - -// Convert a to a -ACE_TString -ACE_Registry::make_string (const Name &const_name) -{ - ACE_TString string; - Name &name = ACE_const_cast (Name &, const_name); - - // Iterator through the components of name - for (Name::iterator iterator = name.begin (); - iterator != name.end (); - iterator++) - { - if (iterator != name.begin ()) - // If this is not the first component, we will add separators - string += ACE_Registry::STRING_SEPARATOR; - const Name_Component &component = *iterator; - // Add to string - string += component.id_; - } - - return string; -} - - -// Convert a to a -ACE_Registry::Name -ACE_Registry::make_name (const ACE_TString &string) -{ - int new_position = 0; - int last_position = 0; - Name name; - - // Rememeber: NPOS is -1 - while (new_position != ACE_TString::npos) - { - Name_Component component; - // Find the separator - new_position = string.find (ACE_Registry::STRING_SEPARATOR, new_position); - if (new_position != ACE_TString::npos) - // If we have not gone past the end - { - // Get the substring - component.id_ = string.substr (last_position, - new_position - last_position); - // Skip past the seperator - new_position += ACE_OS::strlen (ACE_Registry::STRING_SEPARATOR); - } - else - { - // Get the last substring - component.id_ = string.substr (last_position); - } - // Update positions - last_position = new_position; - // Insert component into name - name.insert (component); - } - - return name; -} - - -// Set key -void -ACE_Registry::Naming_Context::key (HKEY key) -{ - this->key_ = key; -} - - -// Get key -HKEY -ACE_Registry::Naming_Context::key (void) -{ - return this->key_; -} - - -// Set parent -void -ACE_Registry::Naming_Context::parent (HKEY parent) -{ - this->parent_key_ = parent; -} - - -// Get parent -HKEY -ACE_Registry::Naming_Context::parent (void) -{ - return this->parent_key_; -} - - -// Set name -// (Name version) -void -ACE_Registry::Naming_Context::name (const Name &name) -{ - this->name_ = ACE_Registry::make_string (name); -} - - -// Get name -// (Name version) -void -ACE_Registry::Naming_Context::name (Name &name) -{ - name = ACE_Registry::make_name (this->name_); -} - - -// Set name -// (String version) -void -ACE_Registry::Naming_Context::name (const ACE_TString &name) -{ - this->name_ = name; -} - - -// Get name -// (String version) -ACE_TString -ACE_Registry::Naming_Context::name (void) -{ - return this->name_; -} - - -// Get name -// (String version) -void -ACE_Registry::Naming_Context::name (ACE_TString &name) -{ - name = this->name_; -} - - -// listing function: iterator creator -// This is useful when there are many objects and contexts -// in context and you only want to look at a few entries -// at a time -int -ACE_Registry::Naming_Context::list (u_long how_many, - Binding_List &list, - Binding_Iterator &iter) -{ - // Empty list - static const ACE_Registry::Binding_List empty_list; - // Make sure that the list is empty - list = empty_list; - - // Correctly initalize the iterator - iter.reset (); - - // Make sure that the iterator uses naming context - iter.naming_context (*this); - - // Start iterations from the objects - iter.current_enumeration (iter.object_iteration_); - - // Get the next values - long result = iter.next_n (how_many, - list); - return result; -} - - -// listing function: iterator creator -// This gives back a listing of all entries in context. -int -ACE_Registry::Naming_Context::list (Binding_List &list) -{ - // Empty list - static const ACE_Registry::Binding_List empty_list; - // Make sure that the list is empty - list = empty_list; - - // Create an iterator - ACE_Registry::Binding_Iterator iterator; - - // Make sure that the iterator uses naming context - iterator.naming_context (*this); - - // Start iterations from the objects - iterator.current_enumeration (iterator.object_iteration_); - - long result = 0; - while (1) - { - ACE_Registry::Binding binding; - result = iterator.next_one (binding); - if (result == 0) - list.insert (binding); - else - break; - } - return 0; -} - - -// Default constructor -ACE_Registry::Binding_Iterator::Binding_Iterator () - : iteration_complete_ (*this), - object_iteration_ (*this), - context_iteration_ (*this) -{ - this->reset (); -} - - -void -ACE_Registry::Binding_Iterator::reset () -{ - this->current_enumeration_ = &this->iteration_complete_; - this->iteration_complete_.reset (); - this->object_iteration_.reset (); - this->context_iteration_.reset (); -} - - -void -ACE_Registry::Binding_Iterator::Iteration_State::reset () -{ - this->index_ = 0; -} - - -ACE_Registry::Binding_Iterator::Iteration_State::Iteration_State (Binding_Iterator &iter) - : parent_ (&iter), - index_ (0) -{ -} - - -ACE_Registry::Binding_Iterator::Object_Iteration::Object_Iteration (Binding_Iterator &iter) - : Iteration_State (iter) -{ -} - - -ACE_Registry::Binding_Iterator::Context_Iteration::Context_Iteration (Binding_Iterator &iter) - : Iteration_State (iter) -{ -} - - -ACE_Registry::Binding_Iterator::Iteration_Complete::Iteration_Complete (Binding_Iterator &iter) - : Iteration_State (iter) -{ -} - - -// Next entry -int -ACE_Registry::Binding_Iterator::next_one (Binding &binding) -{ - u_long how_many = 1; - Binding_List list; - - // Get next n (where n is one) - long result = this->next_n (how_many, list); - - if (result == 0) - // Success - binding = (*list.begin ()); - - return result; -} - - -// Next entries -int -ACE_Registry::Binding_Iterator::next_n (u_long how_many, - Binding_List &list) -{ - // Empty list - static const ACE_Registry::Binding_List empty_list; - // Make sure that the list is empty - list = empty_list; - - return this->current_enumeration_->next_n (how_many, list); -} - - -// Destroy iterator -int -ACE_Registry::Binding_Iterator::destroy (void) -{ - this->reset (); - return 0; -} - - -// Set/Get naming_context -void -ACE_Registry::Binding_Iterator::naming_context (Naming_Context &naming_context) -{ - this->naming_context_ = &naming_context; -} - - -ACE_Registry::Naming_Context & -ACE_Registry::Binding_Iterator::naming_context (void) -{ - return *this->naming_context_; -} - - -// Set/Get current enumeration -void -ACE_Registry::Binding_Iterator::current_enumeration (Iteration_State ¤t_enumeration) -{ - this->current_enumeration_ = ¤t_enumeration; -} - - -ACE_Registry::Binding_Iterator::Iteration_State & -ACE_Registry::Binding_Iterator::current_enumeration (void) -{ - return *this->current_enumeration_; -} - - -int -ACE_Registry::Binding_Iterator::Object_Iteration::next_n (u_long how_many, - Binding_List &list) -{ - // Make a copy - u_long requested = how_many; - - // While there are more entries to be added to the list - while (how_many > 0) - { - ACE_TCHAR string [ACE_Registry::Naming_Context::MAX_OBJECT_NAME_SIZE]; - u_long size = sizeof string / sizeof (ACE_TCHAR); - long result = ACE_TEXT_RegEnumValue (this->parent_->naming_context ().key (), - this->index_, - string, - &size, - 0, - 0, - 0, - 0); - switch (result) - { - case ERROR_SUCCESS: - // Object found - { - // Readjust counters - this->index_++; - how_many--; - - // Add to list - // Create binding - Binding binding (string, OBJECT); - // Add to binding list - list.insert (binding); - } - // Continue to add to list - break; - - case ERROR_NO_MORE_ITEMS: - // Enumeration of objects complete - // Reset index - this->index_ = 0; - - // Current enumeration will become CONTEXTS - this->parent_->current_enumeration (this->parent_->context_iteration_); - result = this->parent_->current_enumeration ().next_n (how_many, - list); - // If we were able to add objects - if (requested != how_many) - return 0; - else - return result; - - default: - // Strange error - // Reset index - this->index_ = 0; - // Current enumeration will become COMPLETE - this->parent_->current_enumeration (this->parent_->iteration_complete_); - // strange error - return -1; - } - } - // If we reach here, all of pairs were added to the list - // Since more entries may be available - // current enumeration will remain OBJECTS - return 0; -} - - -int -ACE_Registry::Binding_Iterator::Context_Iteration::next_n (u_long how_many, - Binding_List &list) -{ - // Make a copy - u_long requested = how_many; - - // While there are more entries to be added to the list - while (how_many > 0) - { - ACE_TCHAR string [ACE_Registry::Naming_Context::MAX_CONTEXT_NAME_SIZE]; - u_long size = sizeof string / sizeof (ACE_TCHAR); - long result = ACE_TEXT_RegEnumKeyEx (this->parent_->naming_context (). key (), - this->index_, - string, - &size, - 0, - 0, - 0, - 0); - switch (result) - { - case ERROR_SUCCESS: - // Object found - { - // Readjust counters - this->index_++; - how_many--; - - // Add to list - // Create binding - Binding binding (string, CONTEXT); - // Add to binding list - list.insert (binding); - } - // Continue to add to list - break; - - case ERROR_NO_MORE_ITEMS: - // Enumeration of objects complete - - /* FALL THROUGH */ - - default: - // Strange error - - // Reset index - this->index_ = 0; - // Current enumeration will become CONTEXTS - this->parent_->current_enumeration (this->parent_->iteration_complete_); - - // If we were able to add contexts - if (requested != how_many) - return 0; - else - return -1; - } - } - // If we reach here, all of pairs were added to the list - // Since more entries may be available - // current enumeration will remain CONTEXTS - return 0; -} - - -int -ACE_Registry::Binding_Iterator::Iteration_Complete::next_n (u_long how_many, - Binding_List &list) -{ - ACE_UNUSED_ARG(list); - ACE_UNUSED_ARG(how_many); - - // No more values - return -1; -} - - -// Factory method to connect to predefined registries -// This method works for both remote and local machines -// However, for remote machines CLASSES_ROOT and CURRENT_USER -// types are not allowed -/* static */ -int -ACE_Predefined_Naming_Contexts::connect (ACE_Registry::Naming_Context &naming_context, - HKEY predefined, - const ACE_TCHAR *machine_name) -{ - long result = -1; - - if (machine_name != 0 && ACE_OS::strcmp (ACE_TEXT ("localhost"), machine_name) == 0) - machine_name = 0; - - if (predefined == HKEY_LOCAL_MACHINE || predefined == HKEY_USERS) - result = ACE_TEXT_RegConnectRegistry (machine_name, - predefined, - &naming_context.key_); - if (predefined == HKEY_CURRENT_USER || predefined == HKEY_CLASSES_ROOT) - // Make sure that for these types, the machine is local - if (machine_name == 0 || - ACE_Predefined_Naming_Contexts::is_local_host (machine_name)) - { - naming_context.key_ = predefined; - result = 0; - } - else - result = -1; - - ACE_REGISTRY_CALL_RETURN (result); -} - -// Check if is the local host -/* static */ -int -ACE_Predefined_Naming_Contexts::is_local_host (const ACE_TCHAR *machine_name) -{ - ACE_TCHAR local_host[MAXHOSTNAMELEN]; - int result = ACE_OS::hostname (local_host, sizeof local_host / sizeof (ACE_TCHAR)); - if (result == 0) - result = !ACE_OS::strcmp (local_host, machine_name); - else - result = 0; - return result; -} - -#endif /* ACE_WIN32 */ diff --git a/ace/Registry.h b/ace/Registry.h deleted file mode 100644 index 8bb0aa4cab8..00000000000 --- a/ace/Registry.h +++ /dev/null @@ -1,524 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Registry.h -// -// = AUTHOR -// Irfan Pyarali (irfan@cs.wustl.edu) -// -// ============================================================================ - -#ifndef ACE_REGISTRY_H -#define ACE_REGISTRY_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_WIN32) -// This only works on Win32 platforms - -#include "ace/Containers.h" -#include "ace/SString.h" - -class ACE_Export ACE_Registry -{ - // = TITLE - // A Name Server implementation - // - // = DESCRIPTION - // The registry interface is inspired by the interface - // specified in the CORBA Naming Service Specification. - // The implementation is done through Win32 functions. - // Other than providing an OO wrapper for the Win32 - // functions, ACE_Registry provides an abstraction for iteration - // over the elements of the Registry. -public: - -// International string - struct ACE_Export Name_Component - { - ACE_TString id_; - ACE_TString kind_; - - int operator== (const Name_Component &rhs) const; - int operator!= (const Name_Component &rhs) const; - // Comparison - }; - // The field is used, - // but the field is currently ignored - - // A Name is an ordered collections of components (ids) - typedef ACE_Unbounded_Set Name; - - static const ACE_TCHAR *STRING_SEPARATOR; - // Separator for components in a name - - static ACE_TString make_string (const Name &name); - // Convert a to a - - static Name make_name (const ACE_TString &string); - // Convert a to a - - enum Binding_Type {INVALID, OBJECT, CONTEXT}; - // There are two types of bindings - - struct ACE_Export Binding - { - Binding (void); - // Empty (default) constructor - - Binding (const Name &binding_name, - Binding_Type binding_type); - // Constructor - // (Name version) - - Binding (const ACE_TString &binding_name, - Binding_Type binding_type); - // Constructor - // (String version) - - int operator== (const Binding &rhs) const; - int operator!= (const Binding &rhs) const; - // Comparison - - void name (Name &name); - // Name accessor - // (Name version) - - void name (ACE_TString &name); - ACE_TString name (void); - // Name accessors - // (String version) - - Binding_Type type (void); - // Type accessor - - private: - ACE_TString name_; - Binding_Type type_; - // A binding has a name and a type - }; - - // A list of bindings - typedef ACE_Unbounded_Set Binding_List; - - class Binding_Iterator; - // Forward declaration of iterator - - class ACE_Export Object - { - // = TITLE - // An object representation - // - // = DESCRIPTION - // In CORBA, all objects inherit from (CORBA::Object). - // For the registry, this is used as a wrapper for an - // instance of a built-in data type. - // Think about an object as being similar to a file - // in a file system. - public: - Object (void *data = 0, - u_long size = 0, - u_long type = REG_NONE); - // Default constructor - - void data (void *data); - void *data (void) const; - // Set/Get data - - void size (u_long size); - u_long size (void) const; - // Set/Get size - - void type (u_long type); - u_long type (void) const; - // Set/Get type - - private: - void *data_; - // Pointer to data - - u_long size_; - // Size of the data - - u_long type_; - // Type of data - }; - - class ACE_Export Naming_Context - { - // = TITLE - // An context representation - // - // = DESCRIPTION - // Think about a context as being similar to a directory - // in a file system. - public: - friend class ACE_Predefined_Naming_Contexts; - // Friend factory - - enum { MAX_OBJECT_NAME_SIZE = BUFSIZ, - MAX_CONTEXT_NAME_SIZE = MAXPATHLEN + 1 }; - // Max sizes of names - // (Not too sure about this value) - - Naming_Context (void); - // Empty constructor: keys will be NULL - - Naming_Context (const HKEY &key); - // Constructor: key_ will be set to - - ~Naming_Context (void); - // Destructor will call . - - // The following interfaces are for objects - - int bind_new (const Name &name, - const Object &object); - // Insert with into context - // This will fail if already exists - // (Name version) - - int bind_new (const ACE_TString &name, - const Object &object); - // Insert with into context - // This will fail if already exists - // (String version) - - int bind (const Name &name, - const Object &object); - // Insert or update with into context - // This will not fail if already exists - // (Name version) - - int bind (const ACE_TString &name, - const Object &object); - // Insert or update with into context - // This will not fail if already exists - // (String version) - - int rebind (const Name &name, - const Object &object); - // Update with in context - // (Name version) - - int rebind (const ACE_TString &name, - const Object &object); - // Update with in context - - int resolve (const Name &name, - Object &object); - // Find with in context - // (Name version) - - int resolve (const ACE_TString &name, - Object &object); - // Find with in context - - int unbind (const Name &name); - // Delete object with in context - // (Name version) - - int unbind (const ACE_TString &name); - // Delete object with in context - - - // The following interfaces are for Naming Context - - int new_context (Naming_Context &naming_context); - // Create new - - int bind_new_context (const Name &name, - Naming_Context &naming_context, - u_long persistence = REG_OPTION_NON_VOLATILE, - u_long security_access = KEY_ALL_ACCESS, - LPSECURITY_ATTRIBUTES security_attributes = 0); - // Insert with relative to context - // This will fail if already exists - // (Name version) - - int bind_new_context (const ACE_TString &name, - Naming_Context &naming_context, - u_long persistence = REG_OPTION_NON_VOLATILE, - u_long security_access = KEY_ALL_ACCESS, - LPSECURITY_ATTRIBUTES security_attributes = 0); - // Insert with relative to context - // This will fail if already exists - - int bind_context (const Name &name, - /* const */ Naming_Context &naming_context, - u_long persistence = REG_OPTION_NON_VOLATILE, - u_long security_access = KEY_ALL_ACCESS, - LPSECURITY_ATTRIBUTES security_attributes = 0); - // Insert or update with relative to context - // This will not fail if already exists - // (Name version) - - int bind_context (const ACE_TString &name, - /* const */ Naming_Context &naming_context, - u_long persistence = REG_OPTION_NON_VOLATILE, - u_long security_access = KEY_ALL_ACCESS, - LPSECURITY_ATTRIBUTES security_attributes = 0); - // Insert or update with relative to context - // This will not fail if already exists - - int rebind_context (const Name &name, - /* const */ Naming_Context &naming_context); - // Rename to - // (Name version) - - int rebind_context (const ACE_TString &name, - /* const */ Naming_Context &naming_context); - // Rename to - - int resolve_context (const Name &name, - Naming_Context &naming_context, - u_long security_access = KEY_ALL_ACCESS); - // Find with in context - // (Name version) - - int resolve_context (const ACE_TString &name, - Naming_Context &naming_context, - u_long security_access = KEY_ALL_ACCESS); - // Find with in context - - int unbind_context (const Name &name); - // Remove naming_context with from context - // (Name version) - - int unbind_context (const ACE_TString &name); - // Remove naming_context with from context - - int destroy (void); - // Same as with as naming_context - - int list (u_long how_many, - Binding_List &list, - Binding_Iterator &iterator); - // listing function: iterator creator - // This is useful when there are many objects and contexts - // in context and you only want to look at a few entries - // at a time - - int list (Binding_List &list); - // listing function: iterator creator - // This gives back a listing of all entries in context. - - - // Some other necessary functions which are - // not part of the CORBA interface - - int flush (void); - // Sync content of context to disk - - int close (void); - // Close the handle of the context - // Note: does not call - - - // Accessors - - HKEY key (void); - // Get key - - // void parent (HKEY parent); - HKEY parent (void); - // Get parent - - void name (Name &name); - // Get name - // (Name version) - - void name (ACE_TString &name); - ACE_TString name (void); - // Get name - // (String version) - - protected: - void key (HKEY key); - // Set key - - void parent (HKEY parent); - // Set parent - - void name (const Name &name); - // Set name - // (Name version) - - void name (const ACE_TString &name); - // Set name - // (String version) - - private: - Naming_Context (const Naming_Context &rhs); - // Disallow copy constructors - - const Naming_Context &operator= (const Naming_Context &rhs); - // Disallow assignment - - HKEY key_; - // Key for self - - HKEY parent_key_; - // Key for parent - - ACE_TString name_; - // Name of self - }; - - class ACE_Export Binding_Iterator - { - // = TITLE - // An iterator - // - // = DESCRIPTION - // Useful when iteratorating over a few entries at a time - public: - friend class Naming_Context; - // Friend factory - - Binding_Iterator (void); - // Default constructor - - int next_one (Binding &binding); - // Next entry - - int next_n (u_long how_many, - Binding_List &list); - // Next entries - - int destroy (void); - // Cleanup - - void reset (void); - // Reset the internal state of the iterator - - Naming_Context &naming_context (void); - // Get naming_context that the iterator is iterating over - - private: - - void naming_context (Naming_Context& naming_context); - // Set naming_context that the iterator is iterating over - - Naming_Context *naming_context_; - // Reference to context - - public: - // This should really be private - // But the compiler is broken - - class ACE_Export Iteration_State - // Base class for state - { - public: - Iteration_State (Binding_Iterator &iterator); - - virtual int next_n (u_long how_many, - Binding_List &list) = 0; - // Next entries - - void reset (void); - // Reset state - - protected: - Binding_Iterator *parent_; - // Pointer to parent iterator - - u_long index_; - }; - - private: - class ACE_Export Object_Iteration : public Iteration_State - { - public: - Object_Iteration (Binding_Iterator &iterator); - - int next_n (u_long how_many, - Binding_List &list); - // Next entries - }; - - class ACE_Export Context_Iteration : public Iteration_State - { - public: - Context_Iteration (Binding_Iterator &iterator); - - int next_n (u_long how_many, - Binding_List &list); - // Next entries - }; - - class ACE_Export Iteration_Complete : public Iteration_State - { - public: - Iteration_Complete (Binding_Iterator &iterator); - - int next_n (u_long how_many, - Binding_List &list); - // Next entries - }; - - friend class Iteration_State; - friend class Object_Iteration; - friend class Context_Iteration; - friend class Iteration_Complete; - // Friend states - - Object_Iteration object_iteration_; - Context_Iteration context_iteration_; - Iteration_Complete iteration_complete_; - // Instances of all states - - Iteration_State *current_enumeration_; - // Pointer to current state - - void current_enumeration (Iteration_State& current_enumeration); - Iteration_State ¤t_enumeration (void); - // Set/Get current_enumeration - }; -}; - -class ACE_Export ACE_Predefined_Naming_Contexts -{ - // = TITLE - // A factory for predefined registries, which exist by default - // on Win32 platforms - // - // = DESCRIPTION - // This factory can connect to both local and remote - // predefined registries. -public: - static int connect (ACE_Registry::Naming_Context &naming_context, - HKEY predefined = HKEY_LOCAL_MACHINE, - const ACE_TCHAR *machine_name = 0); - // Factory method for connecting to predefined registries. This - // method works for both remote and local machines. However, for - // remote machines, HKEY_CLASSES_ROOT and HKEY_CURRENT_USER types - // are not allowed - -private: - static int is_local_host (const ACE_TCHAR *machine_name); - // Check if is the local host -}; - -// Fix me! Shouldn't have to define this stuff - -#if defined (ACE_HAS_BROKEN_NESTED_TEMPLATES) - typedef ACE_Registry::Name_Component Name_Component; - typedef ACE_Registry::Binding Binding; -#endif /* ACE_HAS_BROKEN_NESTED_TEMPLATES */ - -#endif /* ACE_WIN32 */ -#include "ace/post.h" -#endif /* ACE_REGISTRY_H */ diff --git a/ace/Registry_Name_Space.cpp b/ace/Registry_Name_Space.cpp deleted file mode 100644 index a16c972691b..00000000000 --- a/ace/Registry_Name_Space.cpp +++ /dev/null @@ -1,254 +0,0 @@ -// $Id$ - -#include "ace/Registry_Name_Space.h" - -ACE_RCSID(ace, Registry_Name_Space, "$Id$") - -#if (defined (ACE_WIN32) && defined (UNICODE)) -// This only works on Win32 platforms when UNICODE is turned on - -ACE_Registry_Name_Space::ACE_Registry_Name_Space (void) -{ -} - -ACE_Registry_Name_Space::ACE_Registry_Name_Space (ACE_Name_Options *name_options) -{ - if (this->open (name_options) != 0) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Registry_Name_Space::open"))); -} - - -ACE_Registry_Name_Space::~ACE_Registry_Name_Space (void) -{ -} - - -int -ACE_Registry_Name_Space::open (ACE_Name_Options *name_options) -{ - const ACE_TCHAR *host = name_options->nameserver_host (); - ACE_Registry::Naming_Context predefined; - - int result = ACE_Predefined_Naming_Contexts::connect (predefined, - HKEY_LOCAL_MACHINE, - host); - if (result != 0) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Predefined_Naming_Context::connect")), - result); - else - { - // Directory - ACE_TString name = name_options->namespace_dir (); - // Separator - name += ACE_Registry::STRING_SEPARATOR; - // Filename - name += name_options->database (); - - // Create new context or bind to existing one - result = predefined.bind_context (name, - this->context_); - if (result != 0) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Registry::Naming_Context::bind_context")), result); - } - return 0; -} - - -int -ACE_Registry_Name_Space::bind (const ACE_WString &name, - const ACE_WString &value, - const char *type) -{ - // Pointer to data - const ACE_USHORT16 *data = value.fast_rep (); - - // Size - u_long size = value.length () * sizeof (ACE_USHORT16); - - // Represent value as an ACE_Registry::Object - ACE_Registry::Object object ((void *) data, - size, - REG_SZ); - // Add new / pair - return this->context_.bind (name.fast_rep(), - object); -} - - -int -ACE_Registry_Name_Space::rebind (const ACE_WString &name, - const ACE_WString &value, - const char *type) -{ - // Pointer to data - const ACE_USHORT16 *data = value.fast_rep (); - - // Size - u_long size = value.length () * sizeof (ACE_USHORT16); - - // Represent value as an ACE_Registry::Object - ACE_Registry::Object object ((void *) data, - size, - REG_SZ); - // Add new / pair - return this->context_.rebind (name.fast_rep (), - object); -} - - -int -ACE_Registry_Name_Space::unbind (const ACE_WString &name) -{ - return this->context_.unbind (name.fast_rep ()); -} - - -int -ACE_Registry_Name_Space::resolve (const ACE_WString &name, - ACE_WString &value, - char *&type) -{ - // This object will be used to query the size of the data. - // Note: The query_object.data will be null for this invocation. - ACE_Registry::Object query_object; - int result = this->context_.resolve (name.fast_rep (), query_object); - if (result != 0) - return result; - - // Resize the value passed by the user - // Note: -1 is used because the size includes the null terminator - value.resize ((query_object.size () - 1) / sizeof (ACE_USHORT16)); - - // Represent new space as an ACE_Registry::Object - ACE_Registry::Object object ((void *) value.fast_rep (), - query_object.size (), - REG_SZ); - - result = this->context_.resolve (name.fast_rep (), object); - if (object.size () != query_object.size ()) - return -1; - if (result != 0) - return result; - - return 0; -} - - -int -ACE_Registry_Name_Space:: list_names (ACE_WSTRING_SET &set, - const ACE_WString &pattern) -{ - ACE_BINDING_SET binding_set; - int result = this->list_name_entries (binding_set, - pattern); - if (result != 0) - return result; - - ACE_BINDING_ITERATOR iterator (binding_set); - - for (ACE_Name_Binding *entry = 0; - iterator.next (entry) !=0; - iterator.advance()) - { - set.insert (entry->name_); - } - return 0; -} - - -int -ACE_Registry_Name_Space::list_values (ACE_WSTRING_SET &set, - const ACE_WString &pattern) -{ - ACE_BINDING_SET binding_set; - int result = this->list_name_entries (binding_set, - pattern); - if (result != 0) - return result; - - ACE_BINDING_ITERATOR iterator (binding_set); - - for (ACE_Name_Binding *entry = 0; - iterator.next (entry) !=0; - iterator.advance()) - { - set.insert (entry->value_); - } - return 0; -} - - -int -ACE_Registry_Name_Space::list_types (ACE_WSTRING_SET &set, - const ACE_WString &pattern) -{ - return 0; -} - - -int -ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) -{ - ACE_Registry::Binding_List list; - int result = this->context_.list (list); - if (result != 0) - return result; - - // Iterator through all entries - for (ACE_Registry::Binding_List::iterator i = list.begin (); - i != list.end (); - i++) - { - // Yeeesss! STL rules! - ACE_Registry::Binding &binding = *i; - - if (binding.type () == ACE_Registry::OBJECT) - { - // Key - ACE_TString string = binding.name (); - ACE_WString key (string.c_str ()); - - // Value - ACE_WString value; - char *type = 0; - result = this->resolve (key, - value, - type); - if (result != 0) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Registry::Naming_Context::resolve")), result); - - // Complete binding - ACE_Name_Binding binding (key, value, type); - set.insert (binding); - } - } - return 0; -} - - -int -ACE_Registry_Name_Space::list_value_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) -{ - return this->list_name_entries (set, pattern); -} - - -int -ACE_Registry_Name_Space::list_type_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) -{ - return this->list_name_entries (set, pattern); -} - - -void -ACE_Registry_Name_Space::dump (void) const -{ -} - - -#endif /* ACE_WIN32 && UNICODE */ diff --git a/ace/Registry_Name_Space.h b/ace/Registry_Name_Space.h deleted file mode 100644 index 2c1458a7aa8..00000000000 --- a/ace/Registry_Name_Space.h +++ /dev/null @@ -1,127 +0,0 @@ -/*-*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// Registry_Name_Space.h -// -// = AUTHOR -// Irfan Pyarali (irfan@cs.wustl.edu) -// -// ============================================================================ - -#ifndef ACE_REGISTRY_NAME_SPACE_H -#define ACE_REGISTRY_NAME_SPACE_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if (defined (ACE_WIN32) && defined (UNICODE)) -// This only works on Win32 platforms when UNICODE is turned on - -#include "ace/Registry.h" -#include "ace/Naming_Context.h" -#include "ace/Name_Space.h" - -class ACE_Export ACE_Registry_Name_Space : public ACE_Name_Space -{ - // = TITLE - // Interface to a Name Server Database which is maintained by - // the Win32 Registry. Allows to add, change, remove and - // resolve NameBindings. - // - // = DESCRIPTION - // Manages a Naming Service for a registry name space which - // includes bindings for all contexts. All strings are stored in - // wide character format. A Name Binding consists of a name - // (that's the key), a value string. There is no type string - // support in this Name Space. -public: - - ACE_Registry_Name_Space (void); - // Constructor - - ACE_Registry_Name_Space (ACE_Name_Options *name_options); - // Contacts and opens the registry on the specified server - - ~ACE_Registry_Name_Space (void); - // Destructor - - int open (ACE_Name_Options *name_options); - // Contacts and opens the registry on the specified server - - int bind (const ACE_WString &name_in, - const ACE_WString &value_in, - const char *type_in = ""); - // Bind a new name to a naming context (Wide character strings). - - int rebind (const ACE_WString &name_in, - const ACE_WString &value_in, - const char *type_in = ""); - // Overwrite the value or type of an existing name in a - // ACE_Name_Space or bind a new name to the context, if it didn't - // exist yet. (Wide charcter strings interface). - - int unbind (const ACE_WString &name_in); - // Delete a name from a ACE_Name_Space (Wide charcter strings - // Interface). - - int resolve (const ACE_WString &name_in, - ACE_WString &value_out, - char *&type_out); - // Get value and type of a given name binding (Wide chars). The - // caller is responsible for deleting both and ! - - int list_names (ACE_WSTRING_SET &set_out, - const ACE_WString &pattern_in); - // Get a set of names matching a specified pattern (wchars). Matching - // means the names must begin with the pattern string. - - int list_values (ACE_WSTRING_SET &set_out, - const ACE_WString &pattern_in); - // Get a set of values matching a specified pattern (wchars). Matching - // means the values must begin with the pattern string. - - int list_types (ACE_WSTRING_SET &set_out, - const ACE_WString &pattern_in); - // Get a set of types matching a specified pattern (wchars). Matching - // means the types must begin with the pattern string. - - int list_name_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern); - // Get a set of names matching a specified pattern (wchars). Matching - // means the names must begin with the pattern string. Returns the - // complete binding associated each pattern match. - - int list_value_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern); - // Get a set of values matching a specified pattern (wchars). Matching - // means the values must begin with the pattern string. Returns the - // complete binding associated each pattern match. - - int list_type_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern); - // Get a set of types matching a specified pattern (wchars). Matching - // means the types must begin with the pattern string. Returns the - // complete binding associated each pattern match. - - void dump (void) const; - // Dump the state of the object - -private: - - ACE_Registry::Naming_Context context_; - // current context -}; - -#endif /* ACE_WIN32 && UNICODE */ -#include "ace/post.h" -#endif /* ACE_REGISTRY_NAME_SPACE_H */ diff --git a/ace/Remote_Name_Space.cpp b/ace/Remote_Name_Space.cpp deleted file mode 100644 index 1891f5ee010..00000000000 --- a/ace/Remote_Name_Space.cpp +++ /dev/null @@ -1,332 +0,0 @@ -// Remote_Name_Space.cpp -// $Id$ - -#include "ace/Remote_Name_Space.h" - -ACE_RCSID(ace, Remote_Name_Space, "$Id$") - -int -ACE_Remote_Name_Space::open (const ACE_TCHAR *servername, u_short port) -{ - ACE_TRACE ("ACE_Remote_Name_Space::open"); - ACE_INET_Addr servaddr; - - // Initialize Addr - if (servaddr.set (port, servername) == -1) - return -1; - - // Connect to Name Server process. - if (this->ns_proxy_.open (servaddr) == -1) - return -1; - - return 0; -} - -ACE_Remote_Name_Space::ACE_Remote_Name_Space (void) -{ - ACE_TRACE ("ACE_Remote_Name_Space::ACE_Remote_Name_Space"); -} - -ACE_Remote_Name_Space::ACE_Remote_Name_Space (const ACE_TCHAR *hostname, - u_short port) -{ - ACE_TRACE ("ACE_Remote_Name_Space::ACE_Remote_Name_Space"); - if (this->open (hostname, port) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Remote_Name_Space::ACE_Remote_Name_Space"))); -} - -int -ACE_Remote_Name_Space::bind (const ACE_WString &name, - const ACE_WString &value, - const char *type) -{ - ACE_TRACE ("ACE_Remote_Name_Space::bind"); - ACE_Name_Request request (ACE_Name_Request::BIND, - name.fast_rep (), - name.length () * sizeof (ACE_USHORT16), - value.fast_rep (), - value.length () * sizeof (ACE_USHORT16), - type, - ACE_OS::strlen (type)); - return this->ns_proxy_.request_reply (request); -} - -int -ACE_Remote_Name_Space::rebind (const ACE_WString &name, - const ACE_WString &value, - const char *type) -{ - ACE_TRACE ("ACE_Remote_Name_Space::rebind"); - ACE_Name_Request request (ACE_Name_Request::REBIND, - name.fast_rep (), - name.length () * sizeof (ACE_USHORT16), - value.fast_rep (), - value.length () * sizeof (ACE_USHORT16), - type, - ACE_OS::strlen (type)); - return this->ns_proxy_.request_reply (request); -} - -int -ACE_Remote_Name_Space::resolve (const ACE_WString &name, - ACE_WString &value, - char *&type) -{ - ACE_TRACE ("ACE_Remote_Name_Space::resolve"); - ACE_Name_Request request (ACE_Name_Request::RESOLVE, - name.fast_rep (), - name.length () * sizeof (ACE_USHORT16), - 0, 0, 0, 0); - - if (this->ns_proxy_.send_request (request) == -1) - return -1; - - ACE_Name_Request reply; - - if (this->ns_proxy_.recv_reply (reply) == -1) - return -1; - - ACE_WString temp (reply.value (), reply.value_len () / sizeof (ACE_USHORT16)); - value = temp; - ACE_NEW_RETURN (type, - char[reply.type_len () + 1], - -1); - ACE_OS::strcpy (type, reply.type ()); - return 0; -} - -int -ACE_Remote_Name_Space::unbind (const ACE_WString &name) -{ - ACE_TRACE ("ACE_Remote_Name_Space::unbind"); - ACE_Name_Request request (ACE_Name_Request::UNBIND, - name.fast_rep (), - name.length () * sizeof (ACE_USHORT16), - 0, 0, 0, 0); - return this->ns_proxy_.request_reply (request); -} - -int -ACE_Remote_Name_Space::list_names (ACE_WSTRING_SET &set, - const ACE_WString &pattern) -{ - ACE_TRACE ("ACE_Remote_Name_Space::list_names"); - ACE_Name_Request request (ACE_Name_Request::LIST_NAMES, - pattern.fast_rep (), - pattern.length () * sizeof (ACE_USHORT16), - 0, 0, 0, 0); - if (this->ns_proxy_.send_request (request) == -1) - return -1; - - ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); - - while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - if (this->ns_proxy_.recv_reply (reply) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Remote_Name_Space::list_names")), - -1); - if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - ACE_WString name (reply.name (), - reply.name_len () / sizeof (ACE_USHORT16)); - set.insert (name); - } - } - return 0; -} - -int -ACE_Remote_Name_Space::list_values (ACE_WSTRING_SET &set, - const ACE_WString &pattern) -{ - ACE_TRACE ("ACE_Remote_Name_Space::list_values"); - ACE_Name_Request request (ACE_Name_Request::LIST_VALUES, - pattern.fast_rep (), - pattern.length () * sizeof (ACE_USHORT16), - 0, 0, 0, 0); - if (this->ns_proxy_.send_request (request) == -1) - return -1; - - ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); - - while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - if (this->ns_proxy_.recv_reply (reply) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Remote_Name_Space::list_values")), - -1); - if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - ACE_WString value (reply.value (), - reply.value_len () / sizeof (ACE_USHORT16)); - set.insert (value); - } - } - - return 0; -} - -int -ACE_Remote_Name_Space::list_types (ACE_WSTRING_SET &set, - const ACE_WString &pattern) -{ - ACE_TRACE ("ACE_Remote_Name_Space::list_types"); - ACE_Name_Request request (ACE_Name_Request::LIST_TYPES, - pattern.fast_rep (), - pattern.length () * sizeof (ACE_USHORT16), - 0, 0, 0, 0); - - if (this->ns_proxy_.send_request (request) == -1) - return -1; - - ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); - - while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - if (this->ns_proxy_.recv_reply (reply) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Remote_Name_Space::list_values")), - -1); - if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - ACE_WString type (reply.type ()); - set.insert (type); - } - } - - return 0; -} - -int -ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) -{ - ACE_TRACE ("ACE_Remote_Name_Space::list_names"); - ACE_Name_Request request (ACE_Name_Request::LIST_NAME_ENTRIES, - pattern.fast_rep (), - pattern.length () * sizeof (ACE_USHORT16), - 0, 0, 0, 0); - - if (this->ns_proxy_.send_request (request) == -1) - return -1; - - ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); - - while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - if (this->ns_proxy_.recv_reply (reply) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Remote_Name_Space::list_names")), - -1); - if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - ACE_WString name (reply.name (), - reply.name_len () / sizeof (ACE_USHORT16)); - ACE_WString value (reply.value (), - reply.value_len () / sizeof (ACE_USHORT16)); - ACE_Name_Binding entry (name, - value, - reply.type ()); - if (set.insert (entry) == -1) - return -1; - } - } - return 0; -} - -int -ACE_Remote_Name_Space::list_value_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) -{ - ACE_TRACE ("ACE_Remote_Name_Space::list_values"); - ACE_Name_Request request (ACE_Name_Request::LIST_VALUE_ENTRIES, - pattern.fast_rep (), - pattern.length () * sizeof (ACE_USHORT16), - 0, 0, 0, 0); - - if (this->ns_proxy_.send_request (request) == -1) - return -1; - - ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); - - while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - if (this->ns_proxy_.recv_reply (reply) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Remote_Name_Space::list_values")), - -1); - if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - ACE_WString name (reply.name (), - reply.name_len () / sizeof (ACE_USHORT16)); - ACE_WString value (reply.value (), - reply.value_len () / sizeof (ACE_USHORT16)); - ACE_Name_Binding entry (name, - value, - reply.type()); - if (set.insert (entry) == -1) - return -1; - } - } - return 0; -} - -int -ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern) -{ - ACE_TRACE ("ACE_Remote_Name_Space::list_types"); - ACE_Name_Request request (ACE_Name_Request::LIST_TYPE_ENTRIES, - pattern.fast_rep (), - pattern.length () * sizeof (ACE_USHORT16), - 0, 0, 0, 0); - - if (this->ns_proxy_.send_request (request) == -1) - return -1; - - ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); - - while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - if (this->ns_proxy_.recv_reply (reply) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Remote_Name_Space::list_values")), - -1); - if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) - { - ACE_WString name (reply.name (), - reply.name_len () / sizeof (ACE_USHORT16)); - ACE_WString value (reply.value (), - reply.value_len () / sizeof (ACE_USHORT16)); - ACE_Name_Binding entry (name, - value, - reply.type ()); - if (set.insert (entry) == -1) - return -1; - } - } - return 0; -} - -ACE_Remote_Name_Space::~ACE_Remote_Name_Space (void) -{ - ACE_TRACE ("ACE_Remote_Name_Space::~ACE_Remote_Name_Space"); -} - -void -ACE_Remote_Name_Space::dump (void) const -{ - ACE_TRACE ("ACE_Remote_Name_Space::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->ns_proxy_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - diff --git a/ace/Remote_Name_Space.h b/ace/Remote_Name_Space.h deleted file mode 100644 index 2e44e7dd9f9..00000000000 --- a/ace/Remote_Name_Space.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// Remote_Name_Space.h -// -// = AUTHOR -// Prashant Jain -// -// ============================================================================ - -#ifndef ACE_REMOTE_NAME_SPACE_H -#define ACE_REMOTE_NAME_SPACE_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SString.h" -#include "ace/Containers.h" -#include "ace/Name_Proxy.h" -#include "ace/Name_Space.h" - -typedef ACE_Unbounded_Set ACE_WSTRING_SET; - -class ACE_Export ACE_Remote_Name_Space : public ACE_Name_Space -{ - // = TITLE - // Maintaining accesses Remote Name Server Database. Allows to - // add NameBindings, change them, remove them and resolve - // NameBindings. - // - // = DESCRIPTION - // Manages a Naming Service for a remote name space which - // includes bindings for net_local naming context. All strings - // are stored in wide character format. A Name Binding consists - // of a name (that's the key), a value string and an optional - // type string (no wide chars). -public: - // = Initialization and termination methods. - ACE_Remote_Name_Space (void); - // "Do-nothing" constructor. - - ACE_Remote_Name_Space (const ACE_TCHAR *hostname, u_short port); - // Specifies the scope of this namespace, opens and memory-maps the - // associated file (if accessible) or contacts the dedicated name - // server process for NET_LOCAL namespace. - - int open (const ACE_TCHAR *servername, u_short port); - // Specifies the scope of this namespace, opens and memory-maps the - // associated file (if accessible) or contacts the dedicated name - // server process for NET_LOCAL namespace. - - ~ACE_Remote_Name_Space (void); - // destructor, do some cleanup :TBD: last dtor should "compress" - // file - - virtual int bind (const ACE_WString &name_in, - const ACE_WString &value_in, - const char *type_in = ""); - // Bind a new name to a naming context (Wide character strings). - - virtual int rebind (const ACE_WString &name_in, - const ACE_WString &value_in, - const char *type_in = ""); - // Overwrite the value or type of an existing name in a - // ACE_Remote_Name_Space or bind a new name to the context, if it - // didn't exist yet. (Wide charcter strings interface). - - virtual int unbind (const ACE_WString &name_in); - // Delete a name from a ACE_Remote_Name_Space (Wide charcter strings - // Interface). - - virtual int resolve (const ACE_WString &name_in, - ACE_WString &value_out, - char *&type_out); - // Get value and type of a given name binding (Wide chars). The - // caller is responsible for deleting both and ! - - virtual int list_names (ACE_WSTRING_SET &set_out, - const ACE_WString &pattern_in); - // Get a set of names matching a specified pattern (wchars). Matching - // means the names must begin with the pattern string. - - virtual int list_values (ACE_WSTRING_SET &set_out, - const ACE_WString &pattern_in); - // Get a set of values matching a specified pattern (wchars). Matching - // means the values must begin with the pattern string. - - virtual int list_types (ACE_WSTRING_SET &set_out, - const ACE_WString &pattern_in); - // Get a set of types matching a specified pattern (wchars). Matching - // means the types must begin with the pattern string. - - virtual int list_name_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern); - // Get a set of names matching a specified pattern (wchars). Matching - // means the names must begin with the pattern string. Returns the - // complete binding associated each pattern match. - - virtual int list_value_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern); - // Get a set of values matching a specified pattern (wchars). Matching - // means the values must begin with the pattern string. Returns the - // complete binding associated each pattern match. - - virtual int list_type_entries (ACE_BINDING_SET &set, - const ACE_WString &pattern); - // Get a set of types matching a specified pattern (wchars). Matching - // means the types must begin with the pattern string. Returns the - // complete binding associated each pattern match. - - virtual void dump (void) const; - // Dump the state of the object. - -private: - ACE_Name_Proxy ns_proxy_; - // Interface to Name server process for NET_LOCAL namespace. -}; - -#include "ace/post.h" -#endif /* ACE_REMOTE_NAME_SPACE_H */ diff --git a/ace/Remote_Tokens.cpp b/ace/Remote_Tokens.cpp deleted file mode 100644 index e5e53cd62a5..00000000000 --- a/ace/Remote_Tokens.cpp +++ /dev/null @@ -1,435 +0,0 @@ -// Remote_Tokens.cpp -// $Id$ - -#include "ace/Remote_Tokens.h" -#include "ace/Singleton.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Remote_Tokens.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Remote_Tokens, "$Id$") - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -#define ACE_TSS_CONNECTION_MUTEX ACE_Thread_Mutex -#else -#define ACE_TSS_CONNECTION_MUTEX ACE_Null_Mutex -#endif /* ACE_MT_SAFE */ - -// Make a typedef to simplify access to the Singleton below. -typedef ACE_Singleton - ACE_Token_Connections; - -// Initialize the statics from ACE_TSS_Connection; -ACE_INET_Addr ACE_TSS_Connection::server_address_; - -// ************************************************************ - -void -ACE_TSS_Connection::set_server_address (const ACE_INET_Addr &server_address) -{ - ACE_TRACE ("ACE_TSS_Connection::set_server_address"); - server_address_ = server_address; -} - -// Necessary to make some compilers work... -ACE_TSS_Connection::ACE_TSS_Connection (void) -{ - ACE_TRACE ("ACE_TSS_Connection::ACE_TSS_Connection"); -} - -ACE_TSS_Connection::~ACE_TSS_Connection (void) -{ - ACE_TRACE ("ACE_TSS_Connection::~ACE_TSS_Connection"); -} - -ACE_SOCK_Stream * -ACE_TSS_Connection::get_connection (void) -{ - return ACE_TSS::operator-> (); -} - -ACE_SOCK_Stream * -ACE_TSS_Connection::make_TSS_TYPE (void) const -{ - ACE_TRACE ("ACE_TSS_Connection::make_TSS_TYPE"); - - ACE_SOCK_Connector connector; - ACE_SOCK_Stream *stream = 0; - - ACE_NEW_RETURN (stream, - ACE_SOCK_Stream, - 0); - - if (connector.connect (*stream, server_address_) == -1) - { - delete stream; - errno = ECONNREFUSED; - return 0; - } - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_TSS_Connection new connection\n"))); - return stream; -} - -ACE_TSS_Connection::operator ACE_SOCK_Stream *(void) -{ - return this->get_connection (); -} - -void -ACE_TSS_Connection::dump (void) const -{ - ACE_TRACE ("ACE_TSS_Connection::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_TSS_Connection::dump:\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("server_address_\n"))); - server_address_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base:\n"))); - ACE_TSS::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_Remote_Token_Proxy::ACE_Remote_Token_Proxy (void) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::ACE_Remote_Token_Proxy"); -} - -ACE_Remote_Token_Proxy::~ACE_Remote_Token_Proxy (void) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::~ACE_Remote_Token_Proxy"); -} - -int -ACE_Remote_Token_Proxy::open (const ACE_TCHAR *name, - int ignore_deadlock, - int debug) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::open"); - ignore_shadow_deadlock_ = ignore_deadlock; - return ACE_Token_Proxy::open (name, 0, debug); -} - -void -ACE_Remote_Token_Proxy::set_server_address (const ACE_INET_Addr &server_address) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::set_server_address"); - ACE_Token_Connections::instance ()->set_server_address (server_address); -} - -int -ACE_Remote_Token_Proxy::initiate_connection (void) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::initiate_connection"); - if (token_ == 0) - { - errno = ENOENT; - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("ACE_Remote_Token_Proxy not open.\n")), -1); - } - - ACE_SOCK_Stream *peer = ACE_Token_Connections::instance ()->get_connection (); - return peer == 0 ? 0 : 1; -} - -// Do the work of sending a request and getting a reply. - -int -ACE_Remote_Token_Proxy::request_reply (ACE_Token_Request &request, - ACE_Synch_Options &) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::request_reply"); - void *buffer; - ssize_t length; - - if ((length = request.encode (buffer)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("encode failed")), -1); - - ACE_SOCK_Stream *peer = ACE_Token_Connections::instance ()->get_connection (); - - if (peer == 0) - return -1; - - // Transmit request via a blocking send. - - if (peer->send_n (buffer, length) != length) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("send_n failed")), -1); - else - { - ACE_Token_Reply reply; - - // Receive reply via blocking read. - - if (peer->recv (&reply, sizeof reply) != sizeof reply) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("recv failed")), -1); - - if (reply.decode () == -1) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("decode failed")), -1); - - errno = int (reply.errnum ()); - if (errno != 0) - ACE_RETURN (-1); - else - return 0; - } -} - -int -ACE_Remote_Token_Proxy::acquire (int notify, - void (*sleep_hook)(void *), - ACE_Synch_Options &options) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::acquire"); - - // First grab the local shadow mutex. - if (ACE_Token_Proxy::acquire (notify, - sleep_hook, - ACE_Synch_Options::asynch) == -1) - { - // Acquire failed, deal with it... - switch (errno) - { - case EWOULDBLOCK : - // Whoah, we detected wouldblock via the shadow mutex! - if (debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) shadow: acquire will block, owner is %s\n"), - this->token_->owner_id ())); - // No error, but would block, - break; - - case EDEADLK : - if (debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) shadow: deadlock detected\n"))); - - if (ignore_shadow_deadlock_) - break; - else - { - errno = EDEADLK; - ACE_RETURN (-1); - } - - default : - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%t) %p shadow acquire failed\n"), - ACE_TEXT ("ACE_Remote_Token_Proxy")), - -1); - } - } - - ACE_Token_Request request (token_->type (), - this->type (), - ACE_Token_Request::ACQUIRE, - this->name (), - this->client_id (), - options); - - request.notify (notify); - - int result = this->request_reply (request, options); - - if (result == -1) - { - // Update the local shadow copy. - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("error on remote acquire, releasing shadow mutex.\n"))); - ACE_Token_Proxy::release (); - } - else - { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) acquired %s remotely.\n"), this->name ())); - // Our shadow call may have failed. However, it's still a race - // to the remote server. If we beat the client which holds the - // local token, we need to fix things locally to reflect the - // actual ownership. All that should happen is that our waiter - // is moved to the front of the waiter list. - token_->make_owner (waiter_); - } - - return result; -} - -int -ACE_Remote_Token_Proxy::tryacquire (void (*sleep_hook)(void *)) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::tryacquire"); - - // If we can detect locally that the tryacquire will fail, there is - // no need to go remote. - if (ACE_Token_Proxy::tryacquire (sleep_hook) == -1) - { - if (debug_) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("shadow try acquire failed\n"))); - } - - return -1; - } - - ACE_Token_Request request (token_->type (), - this->type (), - ACE_Token_Request::TRY_ACQUIRE, - this->name (), - this->client_id (), - ACE_Synch_Options::synch); - - return this->request_reply (request, - ACE_Synch_Options::synch); -} - -int -ACE_Remote_Token_Proxy::renew (int requeue_position, - ACE_Synch_Options &options) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::renew"); - - if (ACE_Token_Proxy::renew (requeue_position, - ACE_Synch_Options::asynch) == -1) - { - // Check for error. - if (errno != EWOULDBLOCK) - return -1; - else if (debug_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) shadow: renew would block. owner %s.\n"), - this->token_->owner_id ())); - } - - ACE_Token_Request request (token_->type (), - this->type (), - ACE_Token_Request::RENEW, - this->name (), - this->client_id (), - options); - - request.requeue_position (requeue_position); - - int result = this->request_reply (request, options); - - if (result == -1) - { - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - ACE_Token_Proxy::release (); - } - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p error on remote renew, releasing shadow mutex.\n"), - ACE_TEXT ("ACE_Remote_Token_Proxy")), -1); - } - else - { - if (debug_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) renewed %s remotely.\n"), this->name ())); - // Make sure that the local shadow reflects our new ownership. - token_->make_owner (waiter_); - return result; - } -} - -int -ACE_Remote_Token_Proxy::release (ACE_Synch_Options &options) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::release"); - - ACE_Token_Request request (token_->type (), - this->type (), - ACE_Token_Request::RELEASE, - this->name (), - this->client_id (), - options); - - int result = this->request_reply (request, options); - if (result == 0) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) released %s remotely.\n"), this->name ())); - - // whether success or failure, we're going to release the shadow. - // If race conditions exist such that we are no longer the owner, - // this release will perform a remove. - if (ACE_Token_Proxy::release () == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%t) shadow: release failed\n"))); - - return result; -} - -int -ACE_Remote_Token_Proxy::remove (ACE_Synch_Options &) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::remove"); - return 0; -} - -void -ACE_Remote_Token_Proxy::token_acquired (ACE_TPQ_Entry *) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::token_acquired"); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) shadow token %s acquired\n"), - this->client_id (), - this->name ())); - // ACE_Token_Proxy::token_acquired (vp); -} - -const ACE_TCHAR* -ACE_Remote_Token_Proxy::owner_id (void) -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::owner_id"); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("owner_id called\n"))); - // @@ special operation - return 0; -} - -void -ACE_Remote_Token_Proxy::dump (void) const -{ - ACE_TRACE ("ACE_Remote_Token_Proxy::owner_id"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Tokens::dump:\n") - ACE_TEXT (" ignore_shadow_deadlock_ = %d\n"), - ignore_shadow_deadlock_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base:\n"))); - ACE_Token_Proxy::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -void -ACE_Remote_Mutex::dump (void) const -{ - ACE_TRACE ("ACE_Remote_Mutex::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Remote_Mutex::dump:\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base:\n"))); - ACE_Remote_Token_Proxy::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -void -ACE_Remote_RLock::dump (void) const -{ - ACE_TRACE ("ACE_Remote_RLock::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Remote_RLock::dump:\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base:\n"))); - ACE_Remote_Token_Proxy::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -void -ACE_Remote_WLock::dump (void) const -{ - ACE_TRACE ("ACE_Remote_WLock::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Remote_WLock::dump:\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("base:\n"))); - ACE_Remote_Token_Proxy::dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_TSS ; -template class ACE_Singleton ; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_TSS -#pragma instantiate ACE_Singleton -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/Remote_Tokens.h b/ace/Remote_Tokens.h deleted file mode 100644 index c0e2fb041f8..00000000000 --- a/ace/Remote_Tokens.h +++ /dev/null @@ -1,293 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// Remote_Tokens.h -// -// = AUTHOR -// Douglas C. Schmidt (schmidt@cs.wustl.edu) and -// Tim Harrison (harrison@cs.wustl.edu) -// -// ============================================================================ - -#ifndef ACE_REMOTE_MUTEX_H -#define ACE_REMOTE_MUTEX_H -#include "ace/pre.h" - -#include "ace/INET_Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SOCK_Connector.h" -#include "ace/SOCK_Stream.h" -#include "ace/Synch_Options.h" -#include "ace/Local_Tokens.h" -#include "ace/Token_Request_Reply.h" - -class ACE_Export ACE_Remote_Token_Proxy : public ACE_Token_Proxy -{ - // = TITLE - // Proxy for acquiring, renewing, and releasing a distributed - // synchronization token. - // - // = DESCRIPTION - // The Remote_Token_Proxy class implements the mechanisms for - // distributed token operations. It is similar to the - // ACE_Token_Proxy. - // - // = BUGS - // Distributed sleep_hooks have not been implemented. - // is not implemented. -public: - ACE_Remote_Token_Proxy (void); - // Null construction. - - virtual ~ACE_Remote_Token_Proxy (void); - // Death. - - int open (const ACE_TCHAR *name, - int ignore_deadlock = 0, - int debug = 0); - // Same as Token_Proxy. is the string uniquely identifying - // the token. can be 1 to disable deadlock - // notifications. prints debug messages. - - - int initiate_connection (void); - // Open a connection with the token server. This only need be used - // when the user wishes to explicitly open a connection to check if - // the server exists. Connections are stored in the - // ACE_Token_Connections singleton as thread-specific data. That - // is, every thread has only one connection that is used for all - // remote tokens. - - virtual int acquire (int notify = 0, - void (*sleep_hook)(void *) = 0, - ACE_Synch_Options &options = - ACE_Synch_Options::synch); - // Acquire the distributed token. If notify is specified and the - // token is already held, the owner is notified. options contains - // the timeout value for the acquire call. The timer is kept at the - // token server. Asynchronous operations are not supported. - // Returns 0 on success, -1 on failure with == problem. - - virtual int tryacquire (void (*sleep_hook)(void *) = 0); - // Try to acquire the distributed token. If the token is already - // held, the call returns without queueing the caller as a waiter. - // Returns 0 on success (the token was acquired), and -1 with - // EWOULDBLOCK if the token was already held. - - virtual int renew (int requeue_position = 0, - ACE_Synch_Options &options = - ACE_Synch_Options::synch); - // Renew the token by offering to release it if there are any other - // waiters, otherwise get the token back immediately. This renew - // has the same semantics as ACE_Local_Mutex release. It is - // semantically equivalent to followed by , but - // it is faster. options contains the timeout value used if renew - // blocks. As with acquire, the timer is maintained at the token - // server. If there are waiters and requeue_position == -1, the - // caller is queued at the rear of the waiter list. Otherwise, - // requeue_position specifies the number of waiters to "let by" - // before reacquiring the token (effectively, the position in the - // waiter list.) - - virtual int release (ACE_Synch_Options &options = - ACE_Synch_Options::synch); - // Release the distributed token. Similar to ACE_Local_Mutex, if the - // caller is not the owner, it is removed from the waiter list (if - // applicable.) Returns 0 on success, -1 on failure with == - // problem. - - virtual int remove (ACE_Synch_Options &options = - ACE_Synch_Options::synch); - // Become interface compliant for ACE_Guard<>. This has no - // functionality. - - virtual void token_acquired (ACE_TPQ_Entry *); - // Override the default to do nothing. - - virtual const ACE_TCHAR* owner_id (void); - // the client id of the current token holder - - static void set_server_address (const ACE_INET_Addr &server_address); - // sets the server address for all instances of ACE_Remote_Token_Proxy - // If this isn't called, the environment variable TOKEN_SERVER is - // checked for the server address. If that is not specified, all - // ACE_Remote_** operations will fail. - - void dump (void) const; - // Dump the state of the class. - -protected: - - int ignore_shadow_deadlock_; - // if shadows report deadlock, go remote anyway - - int request_reply (ACE_Token_Request &request, - ACE_Synch_Options &options); - // Perform the request and wait for the reply. -}; - -class ACE_Export ACE_Remote_Mutex : public ACE_Remote_Token_Proxy -{ - // = TITLE - // Proxy for acquiring, renewing, and releasing a distributed - // mutex. - // - // = DESCRIPTION - // This is the remote equivalent to ACE_Local_Mutex. The - // Remote_Mutex class offers methods for acquiring, renewing, and - // releasing a distributed synchronization mutex. Similar to - // ACE_Local_Mutex, ACE_Remote_Token_Proxy offers recursive - // acquisition, FIFO waiter ordering, and deadlock detection. It - // depends on the Token Server for its distributed synchronization - // semantics. -public: - ACE_Remote_Mutex (void); - // Null creation. Remote_Token_Proxy::open must be called. - - ACE_Remote_Mutex (const ACE_TCHAR *token_name, - int ignore_deadlock = 0, - int debug = 0); - // Calls Remote_Token_Proxy::open for you. - - void dump (void) const; - // Dump the state of the class. - - virtual ACE_Token_Proxy *clone (void) const; - // Return deep copy. - -protected: - virtual ACE_Tokens *create_token (const ACE_TCHAR *name); - // Make the correct type of ACE_Tokens. This is called by the Token - // Manager. -}; - -class ACE_Export ACE_Remote_RLock : public ACE_Remote_Token_Proxy -{ - // = TITLE - // Proxy for acquiring, renewing, and releasing a distributed - // readers lock. - // - // = DESCRIPTION - // This is the remote equivalent to ACE_Local_RLock. Multiple - // readers can hold the lock simultaneously when no writers have - // the lock. Alternatively, when a writer holds the lock, no other - // participants (readers or writers) may hold the lock. - // ACE_Remote_RLock depends on the ACE Token Server for its - // distributed synchronization semantics. -public: - ACE_Remote_RLock (void); - - ACE_Remote_RLock (const ACE_TCHAR *token_name, - int ignore_deadlock = 0, - int debug = 0); - - ACE_Remote_RLock (const ACE_Remote_RLock &mutex); - - void dump (void) const; - // Dump the state of the class. - - virtual int type (void) const; - // Returns ACE_RW_Token::RLOCK; - - virtual ACE_Token_Proxy *clone (void) const; - // Return deep copy. - -protected: - virtual ACE_Tokens *create_token (const ACE_TCHAR *name); - // Make the correct type of ACE_Tokens. This is called by the Token - // Manager. -}; - -class ACE_Export ACE_Remote_WLock : public ACE_Remote_Token_Proxy -{ - // = TITLE - // Proxy for acquiring, renewing, and releasing a distributed - // writers lock. - // - // = DESCRIPTION - // Shields applications from details of interacting with the - // ACE_Token_Server. The token_name_ is just the string that the - // Token Server uses to identify the token. The client_id_ (also - // used by the Token Server,) identifies the owner of the token and - // is used for deadlock detection. -public: - ACE_Remote_WLock (void); - - ACE_Remote_WLock (const ACE_TCHAR *token_name, - int ignore_deadlock = 0, - int debug = 0); - - ACE_Remote_WLock (const ACE_Remote_WLock &mutex); - - void dump (void) const; - // Dump the state of the class. - - virtual int type (void) const; - // Returns ACE_RW_Token::WLOCK; - - virtual ACE_Token_Proxy *clone (void) const; - // Return deep copy. - -protected: - virtual ACE_Tokens *create_token (const ACE_TCHAR *name); - // Make the correct type of ACE_Tokens. This is called by the Token - // Manager. -}; - -class ACE_Export ACE_TSS_Connection : public ACE_TSS -{ - // = TITLE - // Class for providing a connection per thread. - // - // = DESCRIPTION - // ACE_TSS_Connection provides a single access point for all - // threads to access thread-specific connections. This prevents - // resource-sharing problems such as thread serialization. -public: - // Necessary to make some compilers work... - ACE_TSS_Connection (void); - ~ACE_TSS_Connection (void); - - ACE_SOCK_Stream *get_connection (void); - // retrieve the thread's connection - - virtual ACE_SOCK_Stream *make_TSS_TYPE (void) const; - // Factory Method that creates a new SOCK Stream. - - operator ACE_SOCK_Stream *(void); - // inheritence and operator overloading don't mix. Redefine this - // from ACE_TSS so that we can use it. - - static void set_server_address (const ACE_INET_Addr &server_address); - // Set the server address. - - void dump (void) const; - // Dump the state of the class. - -protected: - static ACE_INET_Addr server_address_; - // The address of the Token Server used by all instances of - // Token_Proxy. - -private: - ACE_TSS_Connection (const ACE_TSS_Connection &); - void operator= (const ACE_TSS_Connection &); - // Private: should not be used -}; - -#if defined (__ACE_INLINE__) -#include "ace/Remote_Tokens.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_REMOTE_TOKEN_H */ diff --git a/ace/Remote_Tokens.i b/ace/Remote_Tokens.i deleted file mode 100644 index bbd2b2613e7..00000000000 --- a/ace/Remote_Tokens.i +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Remote_Tokens.i - -ACE_INLINE -ACE_Remote_Mutex::ACE_Remote_Mutex (void) -{ - ACE_TRACE ("ACE_Remote_Mutex::ACE_Remote_Mutex"); -} - -ACE_INLINE -ACE_Remote_Mutex::ACE_Remote_Mutex (const ACE_TCHAR *token_name, - int ignore_deadlock, - int debug) -{ - ACE_TRACE ("ACE_Remote_Mutex::ACE_Remote_Mutex"); - this->open (token_name, ignore_deadlock, debug); -} - -ACE_INLINE ACE_Token_Proxy * -ACE_Remote_Mutex::clone (void) const -{ - return new ACE_Remote_Mutex (this->name (), - ignore_deadlock_, - debug_); -} - -ACE_INLINE ACE_Tokens * -ACE_Remote_Mutex::create_token (const ACE_TCHAR *name) -{ - return new ACE_Mutex_Token (name); -} - -// ************************************************************ - -ACE_INLINE -ACE_Remote_RLock::ACE_Remote_RLock (const ACE_TCHAR *token_name, - int ignore_deadlock, - int debug) -{ - ACE_TRACE ("ACE_Remote_RLock::ACE_Remote_RLock"); - this->open (token_name, ignore_deadlock, debug); -} - -ACE_INLINE ACE_Tokens * -ACE_Remote_RLock::create_token (const ACE_TCHAR *name) -{ - return new ACE_RW_Token (name); -} - -ACE_INLINE int -ACE_Remote_RLock::type (void) const -{ - return ACE_RW_Token::READER; -} - -ACE_INLINE ACE_Token_Proxy * -ACE_Remote_RLock::clone (void) const -{ - return new ACE_Remote_RLock (this->name (), - ignore_deadlock_, - debug_); -} - -// ************************************************************ - -ACE_INLINE -ACE_Remote_WLock::ACE_Remote_WLock (const ACE_TCHAR *token_name, - int ignore_deadlock, - int debug) -{ - ACE_TRACE ("ACE_Remote_WLock::ACE_Remote_WLock"); - this->open (token_name, ignore_deadlock, debug); -} - - -ACE_INLINE ACE_Tokens * -ACE_Remote_WLock::create_token (const ACE_TCHAR *name) -{ - return new ACE_RW_Token (name); -} - -ACE_INLINE int -ACE_Remote_WLock::type (void) const -{ - return ACE_RW_Token::WRITER; -} - -ACE_INLINE ACE_Token_Proxy * -ACE_Remote_WLock::clone (void) const -{ - return new ACE_Remote_WLock (this->name (), - ignore_deadlock_, - debug_); -} diff --git a/ace/SOCK.cpp b/ace/SOCK.cpp deleted file mode 100644 index 00f5be3f259..00000000000 --- a/ace/SOCK.cpp +++ /dev/null @@ -1,179 +0,0 @@ -// SOCK.cpp -// $Id$ - -#include "ace/SOCK.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK.i" -#endif - -ACE_RCSID(ace, SOCK, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK) - -void -ACE_SOCK::dump (void) const -{ - ACE_TRACE ("ACE_SOCK::dump"); -} - -ACE_SOCK::ACE_SOCK (void) -{ - // ACE_TRACE ("ACE_SOCK::ACE_SOCK"); -} - -// Returns information about the remote peer endpoint (if there is -// one). - -int -ACE_SOCK::get_remote_addr (ACE_Addr &sa) const -{ - ACE_TRACE ("ACE_SOCK::get_remote_addr"); - - int len = sa.get_size (); - sockaddr *addr = ACE_reinterpret_cast (sockaddr *, - sa.get_addr ()); - - if (ACE_OS::getpeername (this->get_handle (), - addr, - &len) == -1) - return -1; - - sa.set_size (len); - return 0; -} - -int -ACE_SOCK::get_local_addr (ACE_Addr &sa) const -{ - ACE_TRACE ("ACE_SOCK::get_local_addr"); - - int len = sa.get_size (); - sockaddr *addr = ACE_reinterpret_cast (sockaddr *, - sa.get_addr ()); - - if (ACE_OS::getsockname (this->get_handle (), - addr, - &len) == -1) - return -1; - - sa.set_size (len); - return 0; -} - -// Close down a ACE_SOCK. - -int -ACE_SOCK::close (void) -{ - ACE_TRACE ("ACE_SOCK::close"); - int result = 0; - - if (this->get_handle () != ACE_INVALID_HANDLE) - { - result = ACE_OS::closesocket (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - } - return result; -} - -int -ACE_SOCK::open (int type, - int protocol_family, - int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK::open"); - int one = 1; - - this->set_handle (ACE_OS::socket (protocol_family, - type, - protocol)); - - if (this->get_handle () == ACE_INVALID_HANDLE) - return -1; - else if (protocol_family != PF_UNIX - && reuse_addr - && this->set_option (SOL_SOCKET, - SO_REUSEADDR, - &one, - sizeof one) == -1) - { - this->close (); - return -1; - } - return 0; -} - -// General purpose constructor for performing server ACE_SOCK -// creation. - -ACE_SOCK::ACE_SOCK (int type, - int protocol_family, - int protocol, - int reuse_addr) -{ - // ACE_TRACE ("ACE_SOCK::ACE_SOCK"); - if (this->open (type, - protocol_family, - protocol, - reuse_addr) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK::ACE_SOCK"))); -} - -int -ACE_SOCK::open (int type, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK::open"); - - this->set_handle (ACE_OS::socket (protocol_family, - type, - protocol, - protocolinfo, - g, - flags)); - int one = 1; - - if (this->get_handle () == ACE_INVALID_HANDLE) - return -1; - else if (reuse_addr - && this->set_option (SOL_SOCKET, - SO_REUSEADDR, - &one, - sizeof one) == -1) - { - this->close (); - return -1; - } - else - return 0; -} - -ACE_SOCK::ACE_SOCK (int type, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr) -{ - // ACE_TRACE ("ACE_SOCK::ACE_SOCK"); - if (this->open (type, - protocol_family, - protocol, - protocolinfo, - g, - flags, - reuse_addr) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK::ACE_SOCK"))); -} diff --git a/ace/SOCK.h b/ace/SOCK.h deleted file mode 100644 index 4c02306a523..00000000000 --- a/ace/SOCK.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -//============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK.h -// -// = AUTHOR -// Doug Schmidt -// -//============================================================================ - -#ifndef ACE_SOCK_H -#define ACE_SOCK_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Addr.h" -#include "ace/IPC_SAP.h" -#include "ace/QoS_Session.h" - -class ACE_Export ACE_SOCK : public ACE_IPC_SAP -{ - // = TITLE - // An abstract class that forms the basis for more specific - // classes, such as and . - // Do not instantiate this class. - // - // = DESCRIPTION - // This class provides functions that are common to all of the - // classes. provides the ability to get - // and set socket options, get the local and remote addresses, - // and close the socket. -public: - ~ACE_SOCK (void); - // Default ctor/dtor. - - int set_option (int level, - int option, - void *optval, - int optlen) const; - // Wrapper around the system call. - - int get_option (int level, - int option, - void *optval, - int *optlen) const; - // Wrapper around the system call. - - int close (void); - // Close down the socket. - - int get_local_addr (ACE_Addr &) const; - // Return the local endpoint address in the referenced . - // Returns 0 if successful, else -1. - - int get_remote_addr (ACE_Addr &) const; - // Return the address of the remotely connected peer (if there is - // one), in the referenced . Returns 0 if successful, else - // -1. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - int open (int type, - int protocol_family, - int protocol, - int reuse_addr); - // Wrapper around the BSD-style system call (no QoS). - - int open (int type, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr); - // Wrapper around the QoS-enabled function. - -protected: - ACE_SOCK (int type, - int protocol_family, - int protocol = 0, - int reuse_addr = 0); - // Constructor with arguments to call the BSD-style system - // call (no QoS). - - ACE_SOCK (int type, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr); - // Constructor with arguments to call the QoS-enabled - // function. - - ACE_SOCK (void); - // Default constructor is private to prevent instances of this class - // from being defined. - -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/post.h" -#endif /* ACE_SOCK_H */ - - - - diff --git a/ace/SOCK.i b/ace/SOCK.i deleted file mode 100644 index 78b17d3e36e..00000000000 --- a/ace/SOCK.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SOCK.i - -ASYS_INLINE -ACE_SOCK::~ACE_SOCK (void) -{ - // ACE_TRACE ("ACE_SOCK::~ACE_SOCK"); -} - -ASYS_INLINE int -ACE_SOCK::set_option (int level, - int option, - void *optval, - int optlen) const -{ - ACE_TRACE ("ACE_SOCK::set_option"); - return ACE_OS::setsockopt (this->get_handle (), level, - option, (char *) optval, optlen); -} - -// Provides access to the ACE_OS::getsockopt system call. - -ASYS_INLINE int -ACE_SOCK::get_option (int level, - int option, - void *optval, - int *optlen) const -{ - ACE_TRACE ("ACE_SOCK::get_option"); - return ACE_OS::getsockopt (this->get_handle (), level, - option, (char *) optval, optlen); -} diff --git a/ace/SOCK_Acceptor.cpp b/ace/SOCK_Acceptor.cpp deleted file mode 100644 index 4587e17a687..00000000000 --- a/ace/SOCK_Acceptor.cpp +++ /dev/null @@ -1,343 +0,0 @@ -// SOCK_Acceptor.cpp -// $Id$ - -#include "ace/SOCK_Acceptor.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Acceptor.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/Synch.h" - -ACE_RCSID(ace, SOCK_Acceptor, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Acceptor) - -// Do nothing routine for constructor. - -ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (void) -{ - ACE_TRACE ("ACE_SOCK_Acceptor::ACE_SOCK_Acceptor"); -} - -// Performs the timed accept operation. - -int -ACE_SOCK_Acceptor::shared_accept_start (ACE_Time_Value *timeout, - int restart, - int &in_blocking_mode) const -{ - ACE_TRACE ("ACE_SOCK_Acceptor::shared_accept_start"); - - ACE_HANDLE handle = this->get_handle (); - - // Handle the case where we're doing a timed . - if (timeout != 0) - { - if (ACE::handle_timed_accept (handle, - timeout, - restart) == -1) - return -1; - else - { - in_blocking_mode = ACE_BIT_DISABLED (ACE::get_flags (handle), - ACE_NONBLOCK); - // Set the handle into non-blocking mode if it's not already - // in it. - if (in_blocking_mode - && ACE::set_flags (handle, - ACE_NONBLOCK) == -1) - return -1; - } - } - - return 0; -} - -int -ACE_SOCK_Acceptor::shared_accept_finish (ACE_SOCK_Stream new_stream, - int in_blocking_mode, - int reset_new_handle) const -{ - ACE_TRACE ("ACE_SOCK_Acceptor::shared_accept_finish ()"); - - ACE_HANDLE new_handle = new_stream.get_handle (); - - // Check to see if we were originally in blocking mode, and if so, - // set the 's handle and handle to be in blocking - // mode. - if (in_blocking_mode) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - - // Only disable ACE_NONBLOCK if we weren't in non-blocking mode - // originally. - ACE::clr_flags (this->get_handle (), - ACE_NONBLOCK); - ACE::clr_flags (new_handle, - ACE_NONBLOCK); - } - -#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) - if (reset_new_handle) - // Reset the event association inherited by the new handle. - ::WSAEventSelect ((SOCKET) new_handle, 0, 0); -#else - ACE_UNUSED_ARG (reset_new_handle); -#endif /* ACE_WIN32 */ - - return new_handle == ACE_INVALID_HANDLE ? -1 : 0; -} - -// General purpose routine for accepting new connections. - -int -ACE_SOCK_Acceptor::accept (ACE_SOCK_Stream &new_stream, - ACE_Addr *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const -{ - ACE_TRACE ("ACE_SOCK_Acceptor::accept"); - - int in_blocking_mode = 0; - if (this->shared_accept_start (timeout, - restart, - in_blocking_mode) == -1) - return -1; - else - { - // On Win32 the third parameter to must be a NULL - // pointer if we want to ignore the client's address. - int *len_ptr = 0; - sockaddr *addr = 0; - int len = 0; - - if (remote_addr != 0) - { - len = remote_addr->get_size (); - len_ptr = &len; - addr = (sockaddr *) remote_addr->get_addr (); - } - - do - new_stream.set_handle (ACE_OS::accept (this->get_handle (), - addr, - len_ptr)); - while (new_stream.get_handle () == ACE_INVALID_HANDLE - && restart != 0 - && errno == EINTR - && timeout == 0); - - // Reset the size of the addr, which is only necessary for UNIX - // domain sockets. - if (new_stream.get_handle () != ACE_INVALID_HANDLE - && remote_addr != 0) - remote_addr->set_size (len); - } - - return this->shared_accept_finish (new_stream, - in_blocking_mode, - reset_new_handle); -} - -int -ACE_SOCK_Acceptor::accept (ACE_SOCK_Stream &new_stream, - ACE_Accept_QoS_Params qos_params, - ACE_Addr *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const -{ - ACE_TRACE ("ACE_SOCK_Acceptor::accept"); - - int in_blocking_mode = 0; - if (this->shared_accept_start (timeout, - restart, - in_blocking_mode) == -1) - return -1; - else - { - // On Win32 the third parameter to must be a NULL - // pointer if we want to ignore the client's address. - int *len_ptr = 0; - int len = 0; - sockaddr *addr = 0; - - if (remote_addr != 0) - { - len = remote_addr->get_size (); - len_ptr = &len; - addr = (sockaddr *) remote_addr->get_addr (); - } - - do - new_stream.set_handle (ACE_OS::accept (this->get_handle (), - addr, - len_ptr, - qos_params)); - while (new_stream.get_handle () == ACE_INVALID_HANDLE - && restart != 0 - && errno == EINTR - && timeout == 0); - - // Reset the size of the addr, which is only necessary for UNIX - // domain sockets. - if (new_stream.get_handle () != ACE_INVALID_HANDLE - && remote_addr != 0) - remote_addr->set_size (len); - } - - return this->shared_accept_finish (new_stream, - in_blocking_mode, - reset_new_handle); -} - -void -ACE_SOCK_Acceptor::dump (void) const -{ - ACE_TRACE ("ACE_SOCK_Acceptor::dump"); -} - -int -ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, - int protocol_family, - int backlog) -{ - ACE_TRACE ("ACE_SOCK_Acceptor::shared_open"); - int error = 0; - - if (protocol_family == PF_INET) - { - sockaddr_in local_inet_addr; - ACE_OS::memset (ACE_reinterpret_cast (void *, - &local_inet_addr), - 0, - sizeof local_inet_addr); - - if (local_sap == ACE_Addr::sap_any) - { - local_inet_addr.sin_port = 0; - local_inet_addr.sin_addr.s_addr = htonl (INADDR_ANY); - } - else - local_inet_addr = *ACE_reinterpret_cast (sockaddr_in *, - local_sap.get_addr ()); - if (local_inet_addr.sin_port == 0) - { - if (ACE::bind_port (this->get_handle (), - local_inet_addr.sin_addr.s_addr) == -1) - error = 1; - } - else if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - &local_inet_addr), - sizeof local_inet_addr) == -1) - error = 1; - } - else if (ACE_OS::bind (this->get_handle (), - (sockaddr *) local_sap.get_addr (), - local_sap.get_size ()) == -1) - error = 1; - - if (error != 0 - || ACE_OS::listen (this->get_handle (), - backlog) == -1) - { - error = 1; - this->close (); - } - - return error ? -1 : 0; -} - -int -ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Acceptor::open"); - - if (ACE_SOCK::open (SOCK_STREAM, - protocol_family, - protocol, - protocolinfo, - g, - flags, - reuse_addr) == -1) - return -1; - else - return this->shared_open (local_sap, - protocol_family, - backlog); -} - -ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Acceptor::ACE_SOCK_Acceptor"); - if (this->open (local_sap, - protocolinfo, - g, - flags, - reuse_addr, - protocol_family, - backlog, - protocol) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK_Acceptor"))); -} - -// General purpose routine for performing server ACE_SOCK creation. - -int -ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Acceptor::open"); - - if (ACE_SOCK::open (SOCK_STREAM, - protocol_family, - protocol, - reuse_addr) == -1) - return -1; - else - return this->shared_open (local_sap, - protocol_family, - backlog); -} - -// General purpose routine for performing server ACE_SOCK creation. - -ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (const ACE_Addr &local_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Acceptor::ACE_SOCK_Acceptor"); - if (this->open (local_sap, - reuse_addr, - protocol_family, - backlog, - protocol) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK_Acceptor"))); -} diff --git a/ace/SOCK_Acceptor.h b/ace/SOCK_Acceptor.h deleted file mode 100644 index b4871f328c8..00000000000 --- a/ace/SOCK_Acceptor.h +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_Acceptor.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SOCK_ACCEPTOR_H -#define ACE_SOCK_ACCEPTOR_H -#include "ace/pre.h" - -#include "ace/SOCK_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Time_Value.h" - -class ACE_Export ACE_SOCK_Acceptor : public ACE_SOCK -{ - // = TITLE - // Defines a factory that creates new s passively. - // - // = DESCRIPTION - // The has its own "passive-mode" socket. - // This serves as a factory to create so-called "data-mode" - // sockets, which are what the encapsulates. - // Therefore, by inheriting from , - // gets its very own socket. -public: - // = Initialization and termination methods. - ACE_SOCK_Acceptor (void); - // Default constructor. - - ACE_SOCK_Acceptor (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = PF_INET, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - // Initialize a passive-mode BSD-style acceptor socket (no QoS). - // is the address that we're going to listen for - // connections on. If is 1 then we'll use the - // to reuse this address. - - ACE_SOCK_Acceptor (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - // Initialize a passive-mode QoS-enabled acceptor socket. Returns 0 - // on success and -1 on failure. - - int open (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = PF_INET, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - // Initialize a passive-mode BSD-style acceptor socket (no QoS). - // is the address that we're going to listen for - // connections on. If is 1 then we'll use the - // to reuse this address. Returns 0 on success and - // -1 on failure. - - int open (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - // Initialize a passive-mode QoS-enabled acceptor socket. Returns 0 - // on success and -1 on failure. - - ~ACE_SOCK_Acceptor (void); - // Default dtor. - - // = Passive connection methods. - int accept (ACE_SOCK_Stream &new_stream, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; - // Accept a new connection. A of 0 - // means block forever, a of {0, 0} means poll. - // == 1 means "restart if interrupted," i.e., if errno == EINTR. - // Note that inherits the "blocking mode" of - // , i.e., if acceptor factory is in - // non-blocking mode, the will be in non-blocking mode - // and vice versa. - - int accept (ACE_SOCK_Stream &new_stream, - ACE_Accept_QoS_Params qos_params, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; - // Accept a new connection using the QoS - // information in . A of 0 means block - // forever, a of {0, 0} means poll. == 1 means - // "restart if interrupted," i.e., if errno == EINTR. Note that - // inherits the "blocking mode" of - // , i.e., if acceptor factory is in - // non-blocking mode, the will be in non-blocking mode - // and vice versa. - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - typedef ACE_SOCK_Stream PEER_STREAM; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - int shared_accept_start (ACE_Time_Value *timeout, - int restart, - int &in_blocking_mode) const; - // Perform operations that must occur before is - // called. - - int shared_accept_finish (ACE_SOCK_Stream new_stream, - int in_blocking_mode, - int reset_new_handle) const; - // Perform operations that must occur after is - // called. - - int shared_open (const ACE_Addr &local_sap, - int protocol_family, - int backlog); - // This method factors out the common code and is called by - // both the QoS-enabled method and the BSD-style - // method. - -private: - int get_remote_addr (ACE_Addr &) const; - // Do not allow this function to percolate up to this interface... -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Acceptor.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/post.h" -#endif /* ACE_SOCK_ACCEPTOR_H */ diff --git a/ace/SOCK_Acceptor.i b/ace/SOCK_Acceptor.i deleted file mode 100644 index 0ba44700809..00000000000 --- a/ace/SOCK_Acceptor.i +++ /dev/null @@ -1,12 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SOCK_Acceptor.i - -ASYS_INLINE -ACE_SOCK_Acceptor::~ACE_SOCK_Acceptor (void) -{ - ACE_TRACE ("ACE_SOCK_Acceptor::~ACE_SOCK_Acceptor"); -} - - diff --git a/ace/SOCK_CODgram.cpp b/ace/SOCK_CODgram.cpp deleted file mode 100644 index a0b21dc0694..00000000000 --- a/ace/SOCK_CODgram.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// SOCK_CODgram.cpp -// $Id$ - -#include "ace/SOCK_CODgram.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_CODgram.i" -#endif - -ACE_RCSID(ace, SOCK_CODgram, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_CODgram) - -void -ACE_SOCK_CODgram::dump (void) const -{ - ACE_TRACE ("ACE_SOCK_CODgram::dump"); -} - -// Here's the general-purpose constructor. - -ACE_SOCK_CODgram::ACE_SOCK_CODgram (const ACE_Addr &remote, const ACE_Addr &local, - int protocol_family, int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_CODgram::ACE_SOCK_CODgram"); - if (this->open (remote, local, - protocol_family, protocol, reuse_addr) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SOCK_CODgram"))); -} - -/* This is the general-purpose open routine. Note that it performs - a different set of functions depending on the LOCAL and REMOTE - addresses passed to it. Here's the basic logic: - - 1. remote == ACE_Addr::sap_any && local == ACE_Addr::sap_any - if protocol_family == PF_INET then - bind the local address to a randomly generated port number... - - 2. remote == ACE_Addr::sap_any && local != ACE_Addr::sap_any - we are just binding the local address - (used primarily by servers) - - 3. remote != ACE_Addr::sap_any && local == ACE_Addr::sap_any - we are connecting to the remote address - (used primarily by clients) - - 4. remote != ACE_Addr::sap_any && local != ACE_Addr::sap_any - we are binding to the local address - and connecting to the remote address -*/ - -int -ACE_SOCK_CODgram::open (const ACE_Addr &remote, const ACE_Addr &local, - int protocol_family, int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_CODgram::open"); - if (ACE_SOCK::open (SOCK_DGRAM, protocol_family, - protocol, reuse_addr) == -1) - return -1; - else - { - int error = 0; - - if (local == ACE_Addr::sap_any && remote == ACE_Addr::sap_any) - { - // Assign an arbitrary port number from the transient range!! - - if (protocol_family == PF_INET - && ACE::bind_port (this->get_handle ()) == -1) - error = 1; - } - // We are binding just the local address. - else if (local != ACE_Addr::sap_any && remote == ACE_Addr::sap_any) - { - if (ACE_OS::bind (this->get_handle (), (sockaddr *) local.get_addr (), - local.get_size ()) == -1) - error = 1; - } - // We are connecting to the remote address. - else if (local == ACE_Addr::sap_any && remote != ACE_Addr::sap_any) - { - if (ACE_OS::connect (this->get_handle (), (sockaddr *) remote.get_addr (), - remote.get_size ()) == -1) - error = 1; - } - // We are binding to the local address and connecting to the - // remote addresses. - else - { - if (ACE_OS::bind (this->get_handle (), (sockaddr *) local.get_addr (), - local.get_size ()) == -1 - || ACE_OS::connect (this->get_handle (), (sockaddr *) remote.get_addr (), - remote.get_size ()) == -1) - error = 1; - } - if (error) - { - this->close (); - this->set_handle (ACE_INVALID_HANDLE); - } - return error ? -1 : 0; - } -} diff --git a/ace/SOCK_CODgram.h b/ace/SOCK_CODgram.h deleted file mode 100644 index a865b8075ce..00000000000 --- a/ace/SOCK_CODgram.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_CODgram.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SOCK_CODGRAM_H -#define ACE_SOCK_CODGRAM_H -#include "ace/pre.h" - -#include "ace/SOCK_IO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Addr.h" - -class ACE_Export ACE_SOCK_CODgram : public ACE_SOCK_IO -{ - // = TITLE - // Defines the member functions for the ACE_SOCK connected - // datagram abstraction. -public: - // = Initialization methods. - ACE_SOCK_CODgram (void); - // Default constructor. - - ACE_SOCK_CODgram (const ACE_Addr &remote_sap, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int protocol_family = PF_INET, - int protocol = 0, - int reuse_addr = 0); - - ~ACE_SOCK_CODgram (void); - // Default dtor. - - // Initiate a connected dgram. - - int open (const ACE_Addr &remote_sap, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int protocol_family = PF_INET, - int protocol = 0, - int reuse_addr = 0); - // Initiate a connected dgram. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_CODgram.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SOCK_CODGRAM_H */ diff --git a/ace/SOCK_CODgram.i b/ace/SOCK_CODgram.i deleted file mode 100644 index 7dd5b40a1d6..00000000000 --- a/ace/SOCK_CODgram.i +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SOCK_CODgram.i - -ASYS_INLINE -ACE_SOCK_CODgram::ACE_SOCK_CODgram (void) -{ - ACE_TRACE ("ACE_SOCK_CODgram::ACE_SOCK_CODgram"); -} - -ASYS_INLINE -ACE_SOCK_CODgram::~ACE_SOCK_CODgram (void) -{ - ACE_TRACE ("ACE_SOCK_CODgram::~ACE_SOCK_CODgram"); -} - - diff --git a/ace/SOCK_Connector.cpp b/ace/SOCK_Connector.cpp deleted file mode 100644 index 68e03648bd0..00000000000 --- a/ace/SOCK_Connector.cpp +++ /dev/null @@ -1,315 +0,0 @@ -// SOCK_Connector.cpp -// $Id$ - -#include "ace/SOCK_Connector.h" -#include "ace/INET_Addr.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Connector.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -ACE_RCSID(ace, SOCK_Connector, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Connector) - -void -ACE_SOCK_Connector::dump (void) const -{ - ACE_TRACE ("ACE_SOCK_Connector::dump"); -} - -int -ACE_SOCK_Connector::shared_open (ACE_SOCK_Stream &new_stream, - int protocol_family, - int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_Connector::shared_open"); - - // Only open a new socket if we don't already have a valid handle. - if (new_stream.get_handle () == ACE_INVALID_HANDLE - && new_stream.open (SOCK_STREAM, - protocol_family, - protocol, - reuse_addr) == -1) - return -1; - else - return 0; -} - -int -ACE_SOCK_Connector::shared_open (ACE_SOCK_Stream &new_stream, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_Connector::shared_open"); - - // Only open a new socket if we don't already have a valid handle. - if (new_stream.get_handle () == ACE_INVALID_HANDLE - && new_stream.open (SOCK_STREAM, - protocol_family, - protocol, - protocolinfo, - g, - flags, - reuse_addr) == -1) - return -1; - else - return 0; -} - -int -ACE_SOCK_Connector::shared_connect_start (ACE_SOCK_Stream &new_stream, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap) -{ - ACE_TRACE ("ACE_SOCK_Connector::shared_connect_start"); - - if (local_sap != ACE_Addr::sap_any) - { - sockaddr *laddr = ACE_reinterpret_cast (sockaddr *, - local_sap.get_addr ()); - size_t size = local_sap.get_size (); - - if (ACE_OS::bind (new_stream.get_handle (), - laddr, - size) == -1) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - new_stream.close (); - return -1; - } - } - - // Enable non-blocking, if required. - if (timeout != 0 - && new_stream.enable (ACE_NONBLOCK) == -1) - return -1; - else - return 0; -} - -int -ACE_SOCK_Connector::shared_connect_finish (ACE_SOCK_Stream &new_stream, - ACE_Time_Value *timeout, - int result) -{ - ACE_TRACE ("ACE_SOCK_Connector::shared_connect_finish"); - // Save/restore errno. - ACE_Errno_Guard error (errno); - - if (result == -1 && timeout != 0) - { - // Check whether the connection is in progress. - if (error == EINPROGRESS || error == EWOULDBLOCK) - { - // This expression checks if we were polling. - if (timeout->sec () == 0 - && timeout->usec () == 0) - error = EWOULDBLOCK; - // Wait synchronously using timeout. - else if (this->complete (new_stream, - 0, - timeout) == -1) - error = errno; - else - return 0; - } - } - - // EISCONN is treated specially since this routine may be used to - // check if we are already connected. - if (result != -1 || error == EISCONN) - // Start out with non-blocking disabled on the . - new_stream.disable (ACE_NONBLOCK); - else if (!(error == EWOULDBLOCK || error == ETIMEDOUT)) - new_stream.close (); - - return result; -} - -// Actively connect and produce a new ACE_SOCK_Stream if things go well... - -int -ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int /* flags */, - int /* perms */, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Connector::connect"); - if (this->shared_open (new_stream, - protocol_family, - protocol, - reuse_addr) == -1) - return -1; - else if (this->shared_connect_start (new_stream, - timeout, - local_sap) == -1) - return -1; - - int result = ACE_OS::connect (new_stream.get_handle (), - ACE_reinterpret_cast (sockaddr *, - remote_sap.get_addr ()), - remote_sap.get_size ()); - - return this->shared_connect_finish (new_stream, - timeout, - result); -} - -int -ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - ACE_Protocol_Info * protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int /* perms */, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Connector::connect"); - if (this->shared_open (new_stream, - protocol_family, - protocol, - protocolinfo, - g, - flags, - reuse_addr) == -1) - return -1; - else if (this->shared_connect_start (new_stream, - timeout, - local_sap) == -1) - return -1; - - int result = ACE_OS::connect (new_stream.get_handle (), - ACE_reinterpret_cast (sockaddr *, - remote_sap.get_addr ()), - remote_sap.get_size (), - qos_params); - - return this->shared_connect_finish (new_stream, - timeout, - result); -} - -// Try to complete a non-blocking connection. - -int -ACE_SOCK_Connector::complete (ACE_SOCK_Stream &new_stream, - ACE_Addr *remote_sap, - ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_SOCK_Connector::complete"); -#if defined (ACE_HAS_BROKEN_NON_BLOCKING_CONNECTS) - // Win32 has a timing problem - if you check to see if the - // connection has completed too fast, it will fail - so wait - // microseconds to let it catch up. - ACE_Time_Value time (0, ACE_NON_BLOCKING_BUG_DELAY); - ACE_OS::sleep (time); -#endif /* ACE_HAS_BROKEN_NON_BLOCKING_CONNECTS */ - ACE_HANDLE h = ACE::handle_timed_complete (new_stream.get_handle (), - tv); - // We failed to get connected. - if (h == ACE_INVALID_HANDLE) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - new_stream.close (); - return -1; - } - else if (remote_sap != 0) - { - int len = remote_sap->get_size (); - sockaddr *addr = ACE_reinterpret_cast (sockaddr *, - remote_sap->get_addr ()); - if (ACE_OS::getpeername (h, - addr, - &len) == -1) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - new_stream.close (); - return -1; - } - } - - // Start out with non-blocking disabled on the . - new_stream.disable (ACE_NONBLOCK); - return 0; -} - -ACE_SOCK_Connector::ACE_SOCK_Connector (ACE_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Connector::ACE_SOCK_Connector"); - - if (this->connect (new_stream, - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms, - protocol_family, - protocol) == -1 - && timeout != 0 - && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK_Connector::ACE_SOCK_Connector"))); -} - -ACE_SOCK_Connector::ACE_SOCK_Connector (ACE_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int perms, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Connector::ACE_SOCK_Connector"); - - if (this->connect (new_stream, - remote_sap, - qos_params, - timeout, - local_sap, - protocolinfo, - g, - flags, - reuse_addr, - perms, - protocol_family, - protocol) == -1 - && timeout != 0 - && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK_Connector::ACE_SOCK_Connector"))); -} diff --git a/ace/SOCK_Connector.h b/ace/SOCK_Connector.h deleted file mode 100644 index ddf7381b84e..00000000000 --- a/ace/SOCK_Connector.h +++ /dev/null @@ -1,210 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_Connector.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SOCK_CONNECTOR_H -#define ACE_SOCK_CONNECTOR_H -#include "ace/pre.h" - -#include "ace/SOCK_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Time_Value.h" - -class ACE_Export ACE_SOCK_Connector -{ - // = TITLE - // Defines a factory that creates new s actively. - // - // = DESCRIPTION - // The doesn't have a socket of its own, - // i.e., it simply "borrows" the one from the ACE_SOCK_Stream - // that's being connected. The reason for this is that the - // underlying socket API doesn't use a "factory" socket to connect - // "data-mode" sockets. Therefore, there's no need to inherit - // from . A nice side-effect of - // this is that 's do not store state so they - // can be used reentrantly in multi-threaded programs. -public: - // = Initialization and termination methods. - ACE_SOCK_Connector (void); - // Default constructor. - - ACE_SOCK_Connector (ACE_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - - ACE_SOCK_Connector (ACE_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The contains QoS parameters that are passed - // to the IntServ (RSVP) and DiffServ protocols. The is - // the amount of time to wait to connect. If it's 0 then we block - // indefinitely. If *timeout == {0, 0} then the connection is done - // using non-blocking mode. In this case, if the connection can't - // be made immediately the value of -1 is returned with . If *timeout > {0, 0} then this is the amount of - // time to wait before timing out. If the time expires before the - // connection is made . The is the - // value of local address to bind to. If it's the default value of - // then the user is letting the OS do the - // binding. If == 1 then the is reused, - // even if it hasn't been cleanedup yet. - - int connect (ACE_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - // Note that the always starts out in blocking mode. - - int connect (ACE_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The contains QoS parameters that are passed - // to the IntServ (RSVP) and DiffServ protocols. The is - // the amount of time to wait to connect. If it's 0 then we block - // indefinitely. If *timeout == {0, 0} then the connection is done - // using non-blocking mode. In this case, if the connection can't - // be made immediately the value of -1 is returned with . If *timeout > {0, 0} then this is the amount of - // time to wait before timing out. If the time expires before the - // connection is made . The is the - // value of local address to bind to. If it's the default value of - // then the user is letting the OS do the - // binding. If == 1 then the is reused, - // even if it hasn't been cleanedup yet. - - ~ACE_SOCK_Connector (void); - // Default dtor. - - // = Completion routine. - int complete (ACE_SOCK_Stream &new_stream, - ACE_Addr *remote_sap = 0, - ACE_Time_Value *timeout = 0); - // Try to complete a non-blocking connection. - // If connection completion is successful then contains - // the connected ACE_SOCK_Stream. If is non-NULL then it - // will contain the address of the connected peer. - - int reset_new_handle (ACE_HANDLE handle); - // Resets any event associations on this handle - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - typedef ACE_SOCK_Stream PEER_STREAM; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - int shared_open (ACE_SOCK_Stream &new_stream, - int protocol_family, - int protocol, - int reuse_addr); - // Perform operations that ensure the socket is opened using - // BSD-style semantics (no QoS). - - int shared_open (ACE_SOCK_Stream &new_stream, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr); - // Perform operations that ensure the socket is opened using - // QoS-enabled semantics. - - int shared_connect_start (ACE_SOCK_Stream &new_stream, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap); - // Perform operations that must be called before . - - int shared_connect_finish (ACE_SOCK_Stream &new_stream, - ACE_Time_Value *timeout, - int result); - // Perform operations that must be called after . -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Connector.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SOCK_CONNECTOR_H */ diff --git a/ace/SOCK_Connector.i b/ace/SOCK_Connector.i deleted file mode 100644 index c4801c01cf0..00000000000 --- a/ace/SOCK_Connector.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SOCK_Connector.i - -// This constructor is used by a client when it wants to connect to -// the specified REMOTE_SAP address using a blocking open. - -ASYS_INLINE -ACE_SOCK_Connector::~ACE_SOCK_Connector (void) -{ - ACE_TRACE ("ACE_SOCK_Connector::~ACE_SOCK_Connector"); -} - -// Do-nothing constructor... - -ASYS_INLINE -ACE_SOCK_Connector::ACE_SOCK_Connector (void) -{ - ACE_TRACE ("ACE_SOCK_Connector::ACE_SOCK_Connector"); -} - -ASYS_INLINE int -ACE_SOCK_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_UNUSED_ARG (handle); -#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) - // Reset the event association - return ::WSAEventSelect ((SOCKET) handle, - NULL, - 0); -#else /* !defined ACE_HAS_WINSOCK2 */ - return 0; -#endif /* ACE_WIN32 */ -} - diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp deleted file mode 100644 index 7a53f45ae97..00000000000 --- a/ace/SOCK_Dgram.cpp +++ /dev/null @@ -1,450 +0,0 @@ -// SOCK_Dgram.cpp -// $Id$ - -#include "ace/SOCK_Dgram.h" -#include "ace/Handle_Set.h" -#include "ace/Synch.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Dgram.i" -#endif - -ACE_RCSID(ace, SOCK_Dgram, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Dgram) - -void -ACE_SOCK_Dgram::dump (void) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::dump"); -} - -// Allows a client to read from a socket without having to provide a -// buffer to read. This method determines how much data is in the -// socket, allocates a buffer of this size, reads in the data, and -// returns the number of bytes read. - -ssize_t -ACE_SOCK_Dgram::recv (iovec io_vec[], - ACE_Addr &addr, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::recv"); -#if defined (FIONREAD) - ACE_Handle_Set handle_set; - handle_set.reset (); - handle_set.set_bit (this->get_handle ()); - - // Check the status of the current socket to make sure there's data - // to recv (or time out). - switch (ACE_OS::select (int (this->get_handle ()) + 1, - handle_set, - 0, 0, - timeout)) - { - case -1: - return -1; - /* NOTREACHED */ - case 0: - errno = ETIME; - return -1; - /* NOTREACHED */ - default: - // Goes fine, fallthrough to get data - break; - } - - sockaddr *saddr = (sockaddr *) addr.get_addr (); - int addr_len = addr.get_size (); - u_long inlen; - - if (ACE_OS::ioctl (this->get_handle (), - FIONREAD, (u_long *) &inlen) == -1) - return -1; - else if (inlen > 0) - { - ACE_NEW_RETURN (io_vec->iov_base, - char[inlen], - -1); - io_vec->iov_len = ACE_OS::recvfrom (this->get_handle (), - (char *) io_vec->iov_base, - inlen, - flags, - (sockaddr *) saddr, - &addr_len); - addr.set_size (addr_len); - return io_vec->iov_len; - } - else - return 0; -#else - ACE_UNUSED_ARG (flags); - ACE_UNUSED_ARG (addr); - ACE_UNUSED_ARG (io_vec); - ACE_UNUSED_ARG (timeout); - ACE_NOTSUP_RETURN (-1); -#endif /* FIONREAD */ -} - -// Here's the shared open function. Note that if we are using the -// PF_INET protocol family and the address of LOCAL == the address of -// the special variable SAP_ANY then we are going to arbitrarily bind -// to a portnumber. - -int -ACE_SOCK_Dgram::shared_open (const ACE_Addr &local, - int protocol_family) -{ - ACE_TRACE ("ACE_SOCK_Dgram::shared_open"); - int error = 0; - - if (local == ACE_Addr::sap_any - && protocol_family == PF_INET) - { - if (ACE::bind_port (this->get_handle ()) == -1) - error = 1; - } - else if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - local.get_addr ()), - local.get_size ()) == -1) - error = 1; - - if (error != 0) - this->close (); - - return error ? -1 : 0; -} - -int -ACE_SOCK_Dgram::open (const ACE_Addr &local, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr) -{ - if (ACE_SOCK::open (SOCK_DGRAM, - protocol_family, - protocol, - protocolinfo, - g, - flags, - reuse_addr) == -1) - return -1; - else if (this->shared_open (local, - protocol_family) == -1) - return -1; - else - return 0; -} - -// Here's the general-purpose open routine. - -int -ACE_SOCK_Dgram::open (const ACE_Addr &local, - int protocol_family, - int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_Dgram::open"); - if (ACE_SOCK::open (SOCK_DGRAM, - protocol_family, - protocol, - reuse_addr) == -1) - return -1; - else - return this->shared_open (local, - protocol_family); -} - -// Here's the general-purpose constructor used by a connectionless -// datagram ``server''... - -ACE_SOCK_Dgram::ACE_SOCK_Dgram (const ACE_Addr &local, - int protocol_family, - int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_Dgram::ACE_SOCK_Dgram"); - - if (this->open (local, - protocol_family, - protocol, - reuse_addr) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK_Dgram"))); -} - -ACE_SOCK_Dgram::ACE_SOCK_Dgram (const ACE_Addr &local, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_Dgram::ACE_SOCK_Dgram"); - if (this->open (local, - protocol_family, - protocol, - protocolinfo, - g, - flags, - reuse_addr) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK_Dgram"))); -} - -#if defined (ACE_HAS_MSG) -// Send an iovec of size N to ADDR as a datagram (connectionless -// version). - -ssize_t -ACE_SOCK_Dgram::send (const iovec iov[], - size_t n, - const ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::send"); - msghdr send_msg; - - send_msg.msg_iov = (iovec *) iov; - send_msg.msg_iovlen = n; -#if defined (ACE_HAS_SOCKADDR_MSG_NAME) - send_msg.msg_name = (struct sockaddr *) addr.get_addr (); -#else - send_msg.msg_name = (char *) addr.get_addr (); -#endif /* ACE_HAS_SOCKADDR_MSG_NAME */ - send_msg.msg_namelen = addr.get_size (); - -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - send_msg.msg_control = 0; - send_msg.msg_controllen = 0; - send_msg.msg_flags = 0; -#else - send_msg.msg_accrights = 0; - send_msg.msg_accrightslen = 0; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - return ACE_OS::sendmsg (this->get_handle (), - &send_msg, - flags); -} - -// Recv an iovec of size N to ADDR as a datagram (connectionless -// version). - -ssize_t -ACE_SOCK_Dgram::recv (iovec iov[], - size_t n, - ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::recv"); - msghdr recv_msg; - - recv_msg.msg_iov = (iovec *) iov; - recv_msg.msg_iovlen = n; -#if defined (ACE_HAS_SOCKADDR_MSG_NAME) - recv_msg.msg_name = (struct sockaddr *) addr.get_addr (); -#else - recv_msg.msg_name = (char *) addr.get_addr (); -#endif /* ACE_HAS_SOCKADDR_MSG_NAME */ - recv_msg.msg_namelen = addr.get_size (); - -#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) - recv_msg.msg_control = 0 ; - recv_msg.msg_controllen = 0 ; -#else - recv_msg.msg_accrights = 0; - recv_msg.msg_accrightslen = 0; -#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - - ssize_t status = ACE_OS::recvmsg (this->get_handle (), - &recv_msg, - flags); - addr.set_size (recv_msg.msg_namelen); - return status; -} - -#else /* ACE_HAS_MSG */ - -// Send an iovec of size N to ADDR as a datagram (connectionless -// version). - -ssize_t -ACE_SOCK_Dgram::send (const iovec iov[], - size_t n, - const ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::send"); - - size_t length = 0; - size_t i; - - // Determine the total length of all the buffers in . - for (i = 0; i < n; i++) -#if ! (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0530)) - // The iov_len is unsigned in Borland. If we go ahead and try the - // if, it will emit a warning. - if (iov[i].iov_len < 0) - return -1; - else -#endif - length += iov[i].iov_len; - - char *buf; - -#if defined (ACE_HAS_ALLOCA) - buf = alloca (length); -#else - ACE_NEW_RETURN (buf, - char[length], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - char *ptr = buf; - - for (i = 0; i < n; i++) - { - ACE_OS::memcpy (ptr, iov[i].iov_base, iov[i].iov_len); - ptr += iov[i].iov_len; - } - - ssize_t result = ACE_SOCK_Dgram::send (buf, length, addr, flags); -#if !defined (ACE_HAS_ALLOCA) - delete [] buf; -#endif /* !defined (ACE_HAS_ALLOCA) */ - return result; -} - -// Recv an iovec of size N to ADDR as a datagram (connectionless -// version). - -ssize_t -ACE_SOCK_Dgram::recv (iovec iov[], - size_t n, - ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::recv"); - - ssize_t length = 0; - size_t i; - - for (i = 0; i < n; i++) -#if ! (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0530)) - // The iov_len is unsigned in Borland. If we go ahead and try the - // if, it will emit a warning. - if (iov[i].iov_len < 0) - return -1; - else -#endif - length += iov[i].iov_len; - - char *buf; - -#if defined (ACE_HAS_ALLOCA) - buf = alloca (length); -#else - ACE_NEW_RETURN (buf, - char[length], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - length = ACE_SOCK_Dgram::recv (buf, length, addr, flags); - - if (length != -1) - { - char *ptr = buf; - int copyn = length; - - for (i = 0; - i < n && copyn > 0; - i++) - { - ACE_OS::memcpy (iov[i].iov_base, ptr, - // iov_len is int on some platforms, size_t on others - copyn > (int) iov[i].iov_len - ? (size_t) iov[i].iov_len - : (size_t) copyn); - ptr += iov[i].iov_len; - copyn -= iov[i].iov_len; - } - } - -#if !defined (ACE_HAS_ALLOCA) - delete [] buf; -#endif /* !defined (ACE_HAS_ALLOCA) */ - return length; -} - -#endif /* ACE_HAS_MSG */ - -ssize_t -ACE_SOCK_Dgram::recv (void *buf, - size_t n, - ACE_Addr &addr, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_Handle_Set handle_set; - handle_set.reset (); - handle_set.set_bit (this->get_handle ()); - - // Check the status of the current socket. - switch (ACE_OS::select (int (this->get_handle ()) + 1, - handle_set, - 0, - 0, - timeout)) - { - case -1: - return -1; - /* NOTREACHED */ - case 0: - errno = ETIME; - return -1; - /* NOTREACHED */ - default: - // Goes fine, call to get data - return this->recv (buf, n, addr, flags); - } -} - -ssize_t -ACE_SOCK_Dgram::send (const void *buf, - size_t n, - ACE_Addr &addr, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_Handle_Set handle_set; - handle_set.reset (); - handle_set.set_bit (this->get_handle ()); - - // Check the status of the current socket. - switch (ACE_OS::select (int (this->get_handle ()) + 1, - 0, - handle_set, - 0, - timeout)) - { - case -1: - return -1; - /* NOTREACHED */ - case 0: - errno = ETIME; - return -1; - /* NOTREACHED */ - default: - // Goes fine, call to get data - return this->send (buf, n, addr, flags); - } -} diff --git a/ace/SOCK_Dgram.h b/ace/SOCK_Dgram.h deleted file mode 100644 index 567d5d34142..00000000000 --- a/ace/SOCK_Dgram.h +++ /dev/null @@ -1,201 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// =========================================================================== -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_Dgram.h -// -// = AUTHOR -// Doug Schmidt -// -// =========================================================================== - -#ifndef ACE_SOCK_DGRAM_H -#define ACE_SOCK_DGRAM_H -#include "ace/pre.h" - -#include "ace/SOCK.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Addr.h" - -class ACE_Export ACE_SOCK_Dgram : public ACE_SOCK -{ - // = TITLE - // Defines the member functions for the ACE_SOCK datagram - // abstraction. -public: - // = Initialization and termination methods. - ACE_SOCK_Dgram (void); - // Default constructor. - - ACE_SOCK_Dgram (const ACE_Addr &local, - int protocol_family = PF_INET, - int protocol = 0, - int reuse_addr = 0); - // This is a BSD-style method (i.e., no QoS) for initiating a socket - // dgram that will accept datagrams at the address. - - ACE_SOCK_Dgram (const ACE_Addr &local, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0); - // This is a QoS-enabed method for initiating a socket dgram that - // will accept datagrams at the address. The - // are passed to . - - int open (const ACE_Addr &local, - int protocol_family = PF_INET, - int protocol = 0, - int reuse_addr = 0); - // This is a BSD-style method (i.e., no QoS) for initiating a socket - // dgram that will accept datagrams at the address. - - int open (const ACE_Addr &local, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0); - // This is a QoS-enabed method for initiating a socket dgram that - // will accept datagrams at the address. The - // are passed to . - - ~ACE_SOCK_Dgram (void); - // Default dtor. - - // = Data transfer routines. - ssize_t send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags = 0) const; - // Send an byte to the datagram socket (uses ). - - ssize_t recv (void *buf, - size_t n, - ACE_Addr &addr, - int flags = 0) const; - // Receive an byte from the datagram socket (uses - // ). - - ssize_t recv (iovec *io_vec, - ACE_Addr &addr, - int flags = 0, - const ACE_Time_Value *timeout = 0) const; - // Allows a client to read from a socket without having to provide a - // buffer to read. This method determines how much data is in the - // socket, allocates a buffer of this size, reads in the data, and - // returns the number of bytes read. The caller is responsible for - // deleting the member in the field of using the - // ``delete []'' syntax. - - ssize_t send (const iovec iov[], - size_t n, - const ACE_Addr &addr, - int flags = 0) const; - // Send an of size to the datagram socket (uses - // ). - - ssize_t recv (iovec iov[], - size_t n, - ACE_Addr &addr, - int flags = 0) const; - // Recv an of size to the datagram socket (uses - // ). - - ssize_t recv (void *buf, - size_t n, - ACE_Addr &addr, - int flags, - const ACE_Time_Value *timeout) const; - // Wait up to amount of time to receive a datagram into - // . The indicates how long to blocking - // trying to receive. If == 0, the caller will block - // until action is possible, else will wait until the relative time - // specified in * elapses). If times out a -1 is - // returned with . If it succeeds the number of - // bytes received is returned. - - ssize_t send (const void *buf, - size_t n, - ACE_Addr &addr, - int flags, - const ACE_Time_Value *timeout) const; - // Wait up to amount of time to receive a datagram into - // . The indicates how long to blocking - // trying to receive. If == 0, the caller will block - // until action is possible, else will wait until the relative time - // specified in * elapses). If times out a -1 is - // returned with . If it succeeds the number of - // bytes received is returned. - - ssize_t send (const iovec buffers[], - int buffer_count, - size_t &number_of_bytes_sent, - int flags, - const ACE_Addr &addr, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const; - // Send worth of to using overlapped - // I/O (uses ). Returns 0 on success. - - ssize_t recv (iovec buffers[], - int buffer_count, - size_t &number_of_bytes_recvd, - int &flags, - ACE_Addr &addr, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const; - // Recv worth of from using - // overlapped I/O (uses ). Returns 0 on success. - - ssize_t send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const; - // Send an byte to the datagram socket (uses ). - - ssize_t recv (void *buf, - size_t n, - ACE_Addr &addr, - int flags, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const; - // Receive an byte from the datagram socket (uses - // ). - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - int shared_open (const ACE_Addr &local, - int protocol_family); - // Open is shared by this and by . - -private: - int get_remote_addr (ACE_Addr &) const; - // Do not allow this function to percolate up to this interface... -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Dgram.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SOCK_DGRAM_H */ diff --git a/ace/SOCK_Dgram.i b/ace/SOCK_Dgram.i deleted file mode 100644 index 723a3d3b9d8..00000000000 --- a/ace/SOCK_Dgram.i +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SOCK_Dgram.i - -// Here's the simple-minded constructor. - -ASYS_INLINE -ACE_SOCK_Dgram::ACE_SOCK_Dgram (void) -{ - ACE_TRACE ("ACE_SOCK_Dgram::ACE_SOCK_Dgram"); -} - -ASYS_INLINE -ACE_SOCK_Dgram::~ACE_SOCK_Dgram (void) -{ - ACE_TRACE ("ACE_SOCK_Dgram::~ACE_SOCK_Dgram"); -} - -// an N byte datagram to (connectionless version). - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram::send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::send"); - sockaddr *saddr = (sockaddr *) addr.get_addr (); - size_t len = addr.get_size (); - return ACE_OS::sendto (this->get_handle (), - (const char *) buf, - n, - flags, - (struct sockaddr *) saddr, - len); -} - -// an n byte datagram (connectionless version). - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram::recv (void *buf, - size_t n, - ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::recv"); - sockaddr *saddr = (sockaddr *) addr.get_addr (); - int addr_len = addr.get_size (); - - ssize_t status = ACE_OS::recvfrom (this->get_handle (), - (char *) buf, - n, - flags, - (sockaddr *) saddr, - &addr_len); - addr.set_size (addr_len); - return status; -} - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram::send (const iovec buffers[], - int buffer_count, - size_t &number_of_bytes_sent, - int flags, - const ACE_Addr &addr, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::send"); - sockaddr *saddr = (sockaddr *) addr.get_addr (); - size_t len = addr.get_size (); - return ACE_OS::sendto (this->get_handle (), - buffers, - buffer_count, - number_of_bytes_sent, - flags, - (const sockaddr *) saddr, - len, - overlapped, - func); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram::recv (iovec buffers[], - int buffer_count, - size_t &number_of_bytes_recvd, - int &flags, - ACE_Addr &addr, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - sockaddr *saddr = (sockaddr *) addr.get_addr (); - int addr_len = addr.get_size (); - - ssize_t status = ACE_OS::recvfrom (this->get_handle (), - buffers, - buffer_count, - number_of_bytes_recvd, - flags, - (sockaddr *) saddr, - &addr_len, - overlapped, - func); - addr.set_size (addr_len); - return status; -} - -// an N byte datagram to (connectionless version). - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram::send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::send"); - - iovec buffer[1]; - buffer[0].iov_len = n; - buffer[0].iov_base = (char *) buf; - size_t number_of_bytes_sent = 0; - return this->send (buffer, - 1, - number_of_bytes_sent, - flags, - addr, - overlapped, - func); -} - -// an n byte datagram (connectionless version). - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram::recv (void *buf, - size_t n, - ACE_Addr &addr, - int flags, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const -{ - ACE_TRACE ("ACE_SOCK_Dgram::recv"); - - iovec buffer[1]; - buffer[0].iov_len = n; - buffer[0].iov_base = (char *) buf; - size_t number_of_bytes_recvd = 0; - return this->recv (buffer, - 1, - number_of_bytes_recvd, - flags, - addr, - overlapped, - func); -} diff --git a/ace/SOCK_Dgram_Bcast.cpp b/ace/SOCK_Dgram_Bcast.cpp deleted file mode 100644 index eb1f3fb49f8..00000000000 --- a/ace/SOCK_Dgram_Bcast.cpp +++ /dev/null @@ -1,323 +0,0 @@ -// $Id$ - -#include "ace/SOCK_Dgram_Bcast.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Dgram_Bcast.i" -#endif - -ACE_RCSID(ace, SOCK_Dgram_Bcast, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Dgram_Bcast) - -ACE_Bcast_Node::ACE_Bcast_Node (ACE_INET_Addr &addr, - ACE_Bcast_Node *next) - : bcast_addr_ (addr), - next_ (next) -{ - ACE_TRACE ("ACE_Bcast_Node::ACE_Bcast_Node"); -} - -void -ACE_SOCK_Dgram_Bcast::dump (void) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::dump"); -} - -// Close up and release resources. - -int -ACE_SOCK_Dgram_Bcast::close (void) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::close"); - - ACE_Bcast_Node *temp = this->if_list_; - - // Release the dynamically allocated memory. - - while (temp != 0) - { - ACE_Bcast_Node *hold = temp->next_; - delete temp; - temp = hold; - } - - // Shut down the descriptor. - return ACE_SOCK::close (); -} - -// Here's the simple-minded constructor. - -ACE_SOCK_Dgram_Bcast::ACE_SOCK_Dgram_Bcast (void) - : if_list_ (0) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::ACE_SOCK_Dgram_Bcast"); -} - -// Here's the general-purpose constructor used by a connectionless -// datagram ``server''... - -ACE_SOCK_Dgram_Bcast::ACE_SOCK_Dgram_Bcast (const ACE_Addr &local, - int protocol_family, - int protocol, - int reuse_addr, - const ACE_TCHAR *host_name) - : ACE_SOCK_Dgram (local, protocol_family, protocol, reuse_addr), - if_list_ (0) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::ACE_SOCK_Dgram_Bcast"); - - if (this->mk_broadcast (host_name) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SOCK_Dgram_Bcast"))); -} - -// Here's the general-purpose open routine. - -int -ACE_SOCK_Dgram_Bcast::open (const ACE_Addr &local, - int protocol_family, - int protocol, - int reuse_addr, - const ACE_TCHAR *host_name) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::open"); - - if (this->ACE_SOCK_Dgram::open (local, protocol_family, - protocol, reuse_addr) == -1) - return -1; - - return this->mk_broadcast (host_name); -} - -// Make broadcast available for Datagram socket. - -int -ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::mk_broadcast"); - - int one = 1; - - if (ACE_OS::setsockopt (this->get_handle (), - SOL_SOCKET, - SO_BROADCAST, - (char *) &one, - sizeof one) == -1) - return -1; - -#if !defined (ACE_WIN32) - ACE_HANDLE s = this->get_handle (); - - char buf[BUFSIZ]; - struct ifconf ifc; - - ifc.ifc_len = sizeof buf; - ifc.ifc_buf = buf; - - // Get interface structure and initialize the addresses using UNIX - // techniques. - if (ACE_OS::ioctl (s, - SIOCGIFCONF, - (char *) &ifc) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get interface configuration)"), - ACE_INVALID_HANDLE); - - struct ifreq *ifr = ifc.ifc_req; - - struct sockaddr_in host_addr; - - //Get host ip address - if (host_name) - { - hostent *hp = ACE_OS::gethostbyname (host_name); - - if (hp == 0) - return -1; - else -#if defined(_UNICOS) - { - ACE_UINT64 haddr; // a place to put the address - char * haddrp = (char *) &haddr; // convert to char pointer - ACE_OS::memcpy(haddrp,(char *) hp->h_addr,hp->h_length); - host_addr.sin_addr.s_addr = haddr; - } -#else /* ! _UNICOS */ - ACE_OS::memcpy ((char *) &host_addr.sin_addr.s_addr, - (char *) hp->h_addr, - hp->h_length); -#endif /* ! _UNICOS */ - } - - for (int n = ifc.ifc_len / sizeof (struct ifreq) ; n > 0; n--, ifr++) - { - // Compare host ip address with interface ip address. - if (host_name) - { - struct sockaddr_in if_addr; - - ACE_OS::memcpy (&if_addr, - &ifr->ifr_addr, - sizeof if_addr); - - if (host_addr.sin_addr.s_addr != if_addr.sin_addr.s_addr) - continue; - } - - if (ifr->ifr_addr.sa_family != AF_INET) - { - // Note that some systems seem to generate 0 (AF_UNDEF) for - // the sa_family, even when there are no errors! Thus, we - // only print an error if this is not the case, or if we're - // in "debugging" mode. - if (ifr->ifr_addr.sa_family != 0 - || ACE::debug () > 0) - ACE_DEBUG ((LM_DEBUG, - "warning %p: sa_family: %d\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: Not AF_INET", - ifr->ifr_addr.sa_family)); - continue; - } - - struct ifreq flags = *ifr; - struct ifreq if_req = *ifr; - - if (ACE_OS::ioctl (s, - SIOCGIFFLAGS, - (char *) &flags) == -1) - { - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get interface flags)")); - continue; - } - - if (ACE_BIT_ENABLED (flags.ifr_flags, - IFF_UP) == 0) - { - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: Network interface is not up")); - continue; - } - - if (ACE_BIT_ENABLED (flags.ifr_flags, - IFF_LOOPBACK)) - continue; - - if (ACE_BIT_ENABLED (flags.ifr_flags, - IFF_BROADCAST)) - { - if (ACE_OS::ioctl (s, - SIOCGIFBRDADDR, - (char *) &if_req) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get broadaddr)")); - else - { - ACE_INET_Addr addr (ACE_reinterpret_cast (sockaddr_in *, - &if_req.ifr_broadaddr), - sizeof if_req.ifr_broadaddr); - ACE_NEW_RETURN (this->if_list_, - ACE_Bcast_Node (addr, - this->if_list_), - -1); - } - } - else - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: Broadcast is not enable for this interface.")); - } -#else - ACE_UNUSED_ARG (host_name); - - ACE_INET_Addr addr (u_short (0), - ACE_UINT32 (INADDR_BROADCAST)); - ACE_NEW_RETURN (this->if_list_, - ACE_Bcast_Node (addr, - this->if_list_), - -1); -#endif /* !ACE_WIN32 */ - return this->if_list_ == 0 ? -1 : 0; -} - -// Broadcast the datagram to every interface. Returns the average -// number of bytes sent. - -ssize_t -ACE_SOCK_Dgram_Bcast::send (const void *buf, - size_t n, - u_short port_number, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::send"); - size_t iterations = 0; - ssize_t total_bytes = 0; - - if (this->if_list_ == 0) - return -1; - - for (ACE_Bcast_Node *temp = this->if_list_; - temp != 0; - temp = temp->next_) - { - temp->bcast_addr_.set_port_number (port_number); - - ssize_t bytes_sent = ACE_SOCK_Dgram::send (buf, - n, - temp->bcast_addr_, - flags); - - if (bytes_sent == -1) - return -1; - else - total_bytes += bytes_sent; - - iterations++; - } - - return iterations == 0 ? 0 : total_bytes / iterations; -} - -#if defined (ACE_HAS_MSG) -// Broadcast datagram to every interfaces. - -ssize_t -ACE_SOCK_Dgram_Bcast::send (const iovec iov[], - size_t n, - u_short /* port_number */, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::send"); - - if (this->if_list_ == 0) - return -1; - - // Send the message to every interface. - - for (ACE_Bcast_Node *temp = this->if_list_; - temp != 0; - temp++) - if (ACE_SOCK_Dgram::send (iov, - n, - temp->bcast_addr_, - flags) == -1) - return -1; - - return 0; -} - -// Broadcast an iovec of size N to ADDR as a datagram (note that addr -// must be preassigned to the broadcast address of the subnet...). - -ssize_t -ACE_SOCK_Dgram_Bcast::send (const iovec iov[], - size_t n, - const ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::send"); - - return ACE_SOCK_Dgram::send (iov, n, addr, flags); -} -#endif /* ACE_HAS_MSG */ diff --git a/ace/SOCK_Dgram_Bcast.h b/ace/SOCK_Dgram_Bcast.h deleted file mode 100644 index e509a7bf712..00000000000 --- a/ace/SOCK_Dgram_Bcast.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_Dgram_Bcast.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SOCK_DGRAM_BCAST_H -#define ACE_SOCK_DGRAM_BCAST_H -#include "ace/pre.h" - -#include "ace/INET_Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SOCK_Dgram.h" - -class ACE_Export ACE_Bcast_Node -{ - // = TITLE - // Linked list of broadcast interfaces. -public: - ACE_Bcast_Node (ACE_INET_Addr &, - ACE_Bcast_Node *); - ~ACE_Bcast_Node (void); - // Default dtor. - - ACE_INET_Addr bcast_addr_; - // Broadcast address for the interface. - - ACE_Bcast_Node *next_; - // Pointer to the next interface in the chain. -}; - -class ACE_Export ACE_SOCK_Dgram_Bcast : public ACE_SOCK_Dgram -{ - // = TITLE - // Defines the member functions for the ACE_SOCK datagram - // abstraction. -public: - // = Initialization and termination methods. - ACE_SOCK_Dgram_Bcast (void); - // Default constructor. - - ACE_SOCK_Dgram_Bcast (const ACE_Addr &local, - int protocol_family = PF_INET, - int protocol = 0, - int reuse_addr = 0, - const ACE_TCHAR *host_name = 0); - - ~ACE_SOCK_Dgram_Bcast (void); - // Default dtor. - - // Initiate a connectionless datagram broadcast endpoint. - - int open (const ACE_Addr &local, - int protocol_family = PF_INET, - int protocol = 0, - int reuse_addr = 0, - const ACE_TCHAR *host_name = 0); - // Initiate a connectionless datagram broadcast endpoint. - - int close (void); - // Close up and release dynamically allocated resources. - - ssize_t send (const void *buf, - size_t n, - u_short portnum, - int flags = 0) const; - // Broadcast the datagram to every interface. Returns the average - // number of bytes sent. - - ssize_t send (const iovec iov[], - size_t n, - u_short portnum, - int flags = 0) const; - // Broadcast the datagrams to every interface. Returns the - // average number of bytes sent. - - ssize_t send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags = 0) const; - // Broadcast an N byte datagram to ADDR (note that addr must be - // preassigned to the broadcast address of the subnet...). - - ssize_t send (const iovec iov[], - size_t n, - const ACE_Addr &addr, - int flags = 0) const; - // Broadcast an of size to as a datagram (note - // that addr must be preassigned to the broadcast address of the - // subnet...) */ - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - int mk_broadcast (const ACE_TCHAR *host_name); - // Make broadcast available for Datagram socket. - - ACE_Bcast_Node *if_list_; - // Points to the head of the list of broadcast interfaces. - - int get_remote_addr (ACE_Addr &) const; - // Do not allow this function to percolate up to this interface... -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Dgram_Bcast.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SOCK_DGRAM_BCAST_H */ diff --git a/ace/SOCK_Dgram_Bcast.i b/ace/SOCK_Dgram_Bcast.i deleted file mode 100644 index 9304ba1d933..00000000000 --- a/ace/SOCK_Dgram_Bcast.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SOCK_Dgram_Bcast.i - -ASYS_INLINE -ACE_Bcast_Node::~ACE_Bcast_Node (void) -{ -} - -ASYS_INLINE -ACE_SOCK_Dgram_Bcast::~ACE_SOCK_Dgram_Bcast (void) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::~ACE_SOCK_Dgram_Bcast"); -} - -// Broadcast an N byte datagram to ADDR (note that addr must be -// preassigned to the broadcast address of the subnet...) - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram_Bcast::send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Bcast::send"); - - sockaddr *saddr = (sockaddr *) addr.get_addr (); - size_t len = addr.get_size (); - return ACE_OS::sendto (this->get_handle (), (const char *) buf, n, flags, - (struct sockaddr *) saddr, len); -} - - diff --git a/ace/SOCK_Dgram_Mcast.cpp b/ace/SOCK_Dgram_Mcast.cpp deleted file mode 100644 index b0ab087cc30..00000000000 --- a/ace/SOCK_Dgram_Mcast.cpp +++ /dev/null @@ -1,400 +0,0 @@ -// $Id$ - -#include "ace/SOCK_Dgram_Mcast.h" -#include "ace/INET_Addr.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Dgram_Mcast.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -// This is a workaround for platforms with non-standard -// definitions of the ip_mreq structure -#if ! defined (IMR_MULTIADDR) -#define IMR_MULTIADDR imr_multiaddr -#endif /* ! defined (IMR_MULTIADDR) */ - -ACE_RCSID(ace, SOCK_Dgram_Mcast, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Dgram_Mcast) - -void -ACE_SOCK_Dgram_Mcast::dump (void) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::dump"); -} - -// Dummy default constructor... - -ACE_SOCK_Dgram_Mcast::ACE_SOCK_Dgram_Mcast (void) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::ACE_SOCK_Dgram_Mcast"); -} - -int -ACE_SOCK_Dgram_Mcast::open (const ACE_Addr &mcast_addr, - int protocol_family, - int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::open"); - - // Make a copy of address to use in the methods. - // Note: Sun C++ 4.2 needs the useless const_cast. - this->mcast_addr_.set (ACE_reinterpret_cast (const ACE_INET_Addr &, - ACE_const_cast (ACE_Addr &, - mcast_addr))); - - // Only perform the initialization if we haven't been opened - // earlier. - if (this->get_handle () == ACE_INVALID_HANDLE) - { - if (ACE_SOCK::open (SOCK_DGRAM, - protocol_family, - protocol, - reuse_addr) == -1) - return -1; - - int one = 1; - if (reuse_addr - && this->ACE_SOCK::set_option (SOL_SOCKET, - SO_REUSEADDR, - &one, - sizeof one) == -1) - return -1; -#if defined (SO_REUSEPORT) - else if (this->ACE_SOCK::set_option (SOL_SOCKET, - SO_REUSEPORT, - &one, - sizeof one) == -1) - return -1; -#endif /* SO_REUSEPORT */ - - // Create an address to bind the socket to. - ACE_INET_Addr local; - - if (local.set (this->mcast_addr_.get_port_number ()) == -1) - return -1; - else if (ACE_SOCK_Dgram::shared_open (local, - protocol_family) == -1) - return -1; - } - - return 0; -} - -int -ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::subscribe_ifs"); -#if defined (ACE_WIN32) - // Windows NT's winsock has trouble with multicast subscribes in the - // presence of multiple network interfaces when the IP address is - // given as INADDR_ANY. It will pick the first interface and only - // accept mcast there. So, to work around this, cycle through all - // of the interfaces known and subscribe to all the non-loopback - // ones. - // - // Note that this only needs to be done on NT, but there's no way to - // tell at this point if the code will be running on NT - only if it - // is compiled for NT-only or for NT/95, and that doesn't really - // help us. It doesn't hurt to do this on Win95, it's just a little - // slower than it normally would be. - // - // NOTE - doesn't always get all of the - // interfaces. In particular, it may not get a PPP interface. This - // is a limitation of the way works with - // MSVC. The reliable way of getting the interface list is - // available only with MSVC 5. - - if (net_if == 0) - { - ACE_INET_Addr *if_addrs = 0; - size_t if_cnt; - - if (ACE::get_ip_interfaces (if_cnt, - if_addrs) != 0) - return -1; - - size_t nr_subscribed = 0; - - if (if_cnt < 2) - { - if (this->subscribe (mcast_addr, - reuse_addr, - ACE_TEXT ("0.0.0.0"), - protocol_family, - protocol) == 0) - ++nr_subscribed; - } - else - // Iterate through all the interfaces, figure out which ones - // offer multicast service, and subscribe to them. - while (if_cnt > 0) - { - --if_cnt; - - // Convert to 0-based for indexing, next loop check. - if (if_addrs[if_cnt].get_ip_address() == INADDR_LOOPBACK) - continue; - if (this->subscribe (mcast_addr, - reuse_addr, - if_addrs[if_cnt].get_host_addr(), - protocol_family, - protocol) == 0) - ++nr_subscribed; - } - - delete [] if_addrs; - - if (nr_subscribed == 0) - { - errno = ENODEV; - return -1; - } - else - // 1 indicates a "short-circuit" return. This handles the - // rather bizarre semantics of checking all the interfaces on - // NT. - return 1; - } -#else - ACE_UNUSED_ARG (mcast_addr); - ACE_UNUSED_ARG (protocol_family); - ACE_UNUSED_ARG (protocol); - ACE_UNUSED_ARG (reuse_addr); -#endif /* ACE_WIN32 */ - // Otherwise, do it like everyone else... - - // Create multicast request. - if (this->make_multicast_address (this->mcast_addr_, - net_if) == -1) - return -1; - else - return 0; -} - -int -ACE_SOCK_Dgram_Mcast::subscribe (const ACE_INET_Addr &mcast_addr, - int reuse_addr, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::subscribe"); - - if (this->open (mcast_addr, - protocol_family, - protocol, - reuse_addr) == -1) - return -1; - - int result = this->subscribe_ifs (mcast_addr, - net_if, - protocol_family, - protocol, - reuse_addr); - // Check for the "short-circuit" return value of 1 (for NT). This - // handles the rather bizarre semantics of checking all the - // interfaces on NT. - if (result != 0) - return result; - - // Create multicast request. - else if (this->make_multicast_address (this->mcast_addr_, - net_if) == -1) - return -1; - - // Tell network device driver to read datagrams with a - // multicast_address IP interface. - else if (this->ACE_SOCK::set_option (IPPROTO_IP, - IP_ADD_MEMBERSHIP, - &this->mcast_request_if_, - sizeof this->mcast_request_if_) == -1) - return -1; - else - return 0; -} - -int -ACE_SOCK_Dgram_Mcast::unsubscribe_ifs (const ACE_INET_Addr &mcast_addr, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::unsubscribe_ifs"); -#if defined (ACE_WIN32) - // Windows NT's winsock has trouble with multicast subscribes in the - // presence of multiple network interfaces when the IP address is - // given as INADDR_ANY. It will pick the first interface and only - // accept mcast there. So, to work around this, cycle through all - // of the interfaces known and subscribe to all the non-loopback - // ones. - // - // Note that this only needs to be done on NT, but there's no way to - // tell at this point if the code will be running on NT - only if it - // is compiled for NT-only or for NT/95, and that doesn't really - // help us. It doesn't hurt to do this on Win95, it's just a little - // slower than it normally would be. - // - // NOTE - doesn't always get all of the - // interfaces. In particular, it may not get a PPP interface. This - // is a limitation of the way works with - // MSVC. The reliable way of getting the interface list is - // available only with MSVC 5. - - if (net_if == 0) - { - ACE_INET_Addr *if_addrs = 0; - size_t if_cnt; - - if (ACE::get_ip_interfaces (if_cnt, - if_addrs) != 0) - return -1; - - size_t nr_unsubscribed = 0; - - if (if_cnt < 2) - { - if (this->unsubscribe (mcast_addr, - ACE_TEXT ("0.0.0.0"), - protocol_family, - protocol) == 0) - ++nr_unsubscribed; - } - else - while (if_cnt > 0) - { - --if_cnt; - // Convert to 0-based for indexing, next loop check - if (if_addrs[if_cnt].get_ip_address() == INADDR_LOOPBACK) - continue; - if (this->unsubscribe (mcast_addr, - if_addrs[if_cnt].get_host_addr(), - protocol_family, - protocol) == 0) - ++nr_unsubscribed; - } - - delete [] if_addrs; - - if (nr_unsubscribed == 0) - { - errno = ENODEV; - return -1; - } - - return 1; - } -#else - ACE_UNUSED_ARG (protocol_family); - ACE_UNUSED_ARG (protocol); -#endif /* ACE_WIN32 */ - // Otherwise, do it like everyone else. - - ip_mreq multicast_address; - - // Create multicast request. - if (this->make_multicast_address_i (mcast_addr, - multicast_address, - net_if) == -1) - return -1; - else - return 0; -} - -int -ACE_SOCK_Dgram_Mcast::unsubscribe (const ACE_INET_Addr &mcast_addr, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::unsubscribe"); - int result = this->unsubscribe_ifs (mcast_addr, - net_if, - protocol_family, - protocol); - - // Check for the "short-circuit" return value of 1 (for NT). - if (result != 0) - return result; - - // Tell network device driver to stop reading datagrams with the - // . - else if (ACE_SOCK::set_option (IPPROTO_IP, - IP_DROP_MEMBERSHIP, - &this->mcast_request_if_, - sizeof this->mcast_request_if_) == -1) - return -1; - else - return 0; -} - -int -ACE_SOCK_Dgram_Mcast::unsubscribe (void) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::unsubscribe"); - return this->ACE_SOCK::set_option (IPPROTO_IP, - IP_DROP_MEMBERSHIP, - &this->mcast_request_if_, - sizeof this->mcast_request_if_); -} - -int -ACE_SOCK_Dgram_Mcast::make_multicast_address_i (const ACE_INET_Addr &mcast_addr, - ip_mreq &multicast_address , - const ACE_TCHAR *net_if) -{ - if (net_if != 0) - { -#if defined (ACE_WIN32) - // This port number is not necessary, just convenient - ACE_INET_Addr interface_addr; - if (interface_addr.set (mcast_addr.get_port_number (), - net_if) == -1) - return -1; - multicast_address.imr_interface.s_addr = - htonl (interface_addr.get_ip_address ()); -#else - ifreq if_address; - -#if defined (ACE_PSOS) - // Look up the interface by number, not name. - if_address.ifr_ifno = ACE_OS::atoi (net_if); -#else - ACE_OS::strcpy (if_address.ifr_name, net_if); -#endif /* defined (ACE_PSOS) */ - - if (ACE_OS::ioctl (this->get_handle (), - SIOCGIFADDR, - &if_address) == -1) - return -1; - - sockaddr_in *socket_address; - socket_address = ACE_reinterpret_cast(sockaddr_in *, - &if_address.ifr_addr); - multicast_address.imr_interface.s_addr = socket_address->sin_addr.s_addr; -#endif /* ACE_WIN32 */ - } - else - multicast_address.imr_interface.s_addr = INADDR_ANY; - - multicast_address.IMR_MULTIADDR.s_addr = htonl (mcast_addr.get_ip_address ()); - return 0; -} - -int -ACE_SOCK_Dgram_Mcast::make_multicast_address (const ACE_INET_Addr &mcast_addr, - const ACE_TCHAR *net_if) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::make_multicast_address"); - - return this->make_multicast_address_i (mcast_addr, - this->mcast_request_if_, - net_if ); -} - - diff --git a/ace/SOCK_Dgram_Mcast.h b/ace/SOCK_Dgram_Mcast.h deleted file mode 100644 index a9a824e84ea..00000000000 --- a/ace/SOCK_Dgram_Mcast.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_Dgram_Mcast.h -// -// = AUTHORS -// Irfan Pyrali , -// Tim Harrison , and -// Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_SOCK_DGRAM_MCAST_H -#define ACE_SOCK_DGRAM_MCAST_H -#include "ace/pre.h" - -#include "ace/SOCK_Dgram.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/INET_Addr.h" - -class ACE_Export ACE_SOCK_Dgram_Mcast : public ACE_SOCK_Dgram -{ - // = TITLE - // Defines the member functions for the ACE socket wrapper - // for UDP/IP multicast. -public: - // = Initialization routine. - ACE_SOCK_Dgram_Mcast (void); - // Note that there is no public method. Therefore, this - // class cannot be used unless you to a multicast group. - // If you just want to send (and not listen) to a multicast group, - // use or instead. - - ~ACE_SOCK_Dgram_Mcast (void); - // Default dtor. - - // = Multicast group management routines. - - int subscribe (const ACE_INET_Addr &mcast_addr, - int reuse_addr = 1, - const ACE_TCHAR *net_if = 0, - int protocol_family = PF_INET, - int protocol = 0); - // This is a BSD-style method (i.e., no QoS) for joining a multicast - // group. The network interface device driver is instructed to - // accept datagrams with multicast addresses. If the - // socket has already been opened, closes the socket and - // opens a new socket bound to the . - // - // The interface is hardware specific, e.g., use "netstat - // -i" to find whether your interface is, such as "le0" or something - // else. If net_if == 0, uses the default mcast - // interface. Returns: -1 if the call fails. - // - // Note that some platforms, such as pSoS, support only number, not - // names, for network interfaces. For these platforms, just give - // these numbers in alphanumeric form and will convert - // them into numbers via . - - int unsubscribe (const ACE_INET_Addr &mcast_addr, - const ACE_TCHAR *net_if = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Leave a multicast group identified by . The - // interface is hardware specific. Use something like "netstat -i" - // to find whether your interface is, such as "le0" or something - // else. If == 0, uses the default mcast - // interface. Returns: -1 if the call fails. - // - // Note that some platforms, such as pSoS, support only number, not - // names, for network interfaces. For these platforms, just give - // these numbers in alphanumeric form and will convert - // them into numbers via . - - int unsubscribe (void); - // Unsubscribe from a multicast group. Returns -1 if the call - // fails. - - // = Data transfer routines. - ssize_t send (const void *buf, - size_t n, - int flags = 0) const; - // Send bytes in . - - ssize_t send (const iovec iov[], - size_t n, - int flags = 0) const; - // Send . - - // = Options. - int set_option (int option, - char optval); - // Set an ip option that takes a char as input, such as - // or . This is just a more - // concise nice interface to a subset of possible - // calls. Returns 0 on success, -1 on - // failure. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - // = Disable public method to ensure class used properly. - - int open (const ACE_Addr &mcast_addr, - int protocol_family = PF_INET, - int protocol = 0, - int reuse_addr = 0); - // Not publically visible. - - int open (const ACE_Addr &mcast_addr, - const ACE_QoS_Params &qos_params, - int protocol_family = PF_INET, - int protocol = 0, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0); - // Not publically visible. - - int subscribe_ifs (const ACE_INET_Addr &mcast_addr, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol, - int reuse_addr); - // Subscribe to the multicast interface using BSD-style semantics - // (no QoS). - - int unsubscribe_ifs (const ACE_INET_Addr &mcast_addr, - const ACE_TCHAR *net_if = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Unsubscribe to multicast interfaces subscribed to previously by - // . - - // = Disable public use of s - - // This forces s inline. - ssize_t send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags = 0) const; - ssize_t send (const iovec iov[], - size_t n, - const ACE_Addr &addr, - int flags = 0) const; - -protected: - int make_multicast_address (const ACE_INET_Addr &mcast_addr, - const ACE_TCHAR *net_if = ACE_TEXT ("le0")); - // Initialize the IP address. - - int make_multicast_address_i (const ACE_INET_Addr &mcast_addr, - ip_mreq& multicast_address, - const ACE_TCHAR *net_if = ACE_TEXT ("le0")); - // Initialize a multicast address. This method factors out common - // code called by and . - - ACE_INET_Addr mcast_addr_; - // A copy of the address that we use to multicasts. - - ip_mreq mcast_request_if_; - // IP address of the interface upon which we're receiving - // multicasts. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Dgram_Mcast.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/post.h" -#endif /* ACE_SOCK_DGRAM_MCAST_H */ - diff --git a/ace/SOCK_Dgram_Mcast.i b/ace/SOCK_Dgram_Mcast.i deleted file mode 100644 index b7a9ca06abe..00000000000 --- a/ace/SOCK_Dgram_Mcast.i +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ASYS_INLINE -ACE_SOCK_Dgram_Mcast::~ACE_SOCK_Dgram_Mcast (void) -{ -} - -ASYS_INLINE int -ACE_SOCK_Dgram_Mcast::set_option (int option, - char optval) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::set_option"); -#if defined (ACE_WIN32) - int sock_opt = optval; - return this->ACE_SOCK::set_option (IPPROTO_IP, - option, - &sock_opt, - sizeof (sock_opt)); -#else - return this->ACE_SOCK::set_option (IPPROTO_IP, - option, - &optval, - sizeof (optval)); -#endif /* !ACE_WIN32 */ -} - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram_Mcast::send (const void *buf, - size_t n, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::send"); - return this->ACE_SOCK_Dgram::send (buf, - n, - this->mcast_addr_, - flags); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram_Mcast::send (const iovec iov[], - size_t n, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::send"); - return this->ACE_SOCK_Dgram::send (iov, - n, - this->mcast_addr_, - flags); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram_Mcast::send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::send"); - return this->ACE_SOCK_Dgram::send (buf, - n, - addr, - flags); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram_Mcast::send (const iovec iov[], - size_t n, - const ACE_Addr &addr, - int flags) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::send"); - return this->ACE_SOCK_Dgram::send (iov, - n, - addr, - flags); -} - - diff --git a/ace/SOCK_Dgram_Mcast_QoS.cpp b/ace/SOCK_Dgram_Mcast_QoS.cpp deleted file mode 100644 index 628664c864a..00000000000 --- a/ace/SOCK_Dgram_Mcast_QoS.cpp +++ /dev/null @@ -1,280 +0,0 @@ -// $Id$ - -#include "ace/SOCK_Dgram_Mcast_QoS.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Dgram_Mcast_QoS.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -// This is a workaround for platforms with non-standard -// definitions of the ip_mreq structure -#if ! defined (IMR_MULTIADDR) -#define IMR_MULTIADDR imr_multiaddr -#endif /* ! defined (IMR_MULTIADDR) */ - -ACE_RCSID(ace, SOCK_Dgram_Mcast_QoS, "$Id $") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Dgram_Mcast_QoS) - -// Dummy default constructor... - -ACE_SOCK_Dgram_Mcast_QoS::ACE_SOCK_Dgram_Mcast_QoS (void) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::ACE_SOCK_Dgram_Mcast_QoS"); -} - -int -ACE_SOCK_Dgram_Mcast_QoS::open (const ACE_Addr &mcast_addr, - const ACE_QoS_Params &qos_params, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::open"); - - ACE_UNUSED_ARG (qos_params); - - // Make a copy of address to use in the methods. - // Note: Sun C++ 4.2 needs the useless const_cast. - this->mcast_addr_.set (ACE_reinterpret_cast (const ACE_INET_Addr &, - ACE_const_cast (ACE_Addr &, - mcast_addr))); - - // Only perform the initialization if we haven't been opened - // earlier. - if (this->get_handle () == ACE_INVALID_HANDLE) - { - if (ACE_SOCK::open (SOCK_DGRAM, - protocol_family, - protocol, - protocolinfo, - g, - flags, - reuse_addr) == -1) - return -1; - - int one = 1; - if (reuse_addr - && this->ACE_SOCK::set_option (SOL_SOCKET, - SO_REUSEADDR, - &one, - sizeof one) == -1) - return -1; -#if defined (SO_REUSEPORT) - else if (this->ACE_SOCK::set_option (SOL_SOCKET, - SO_REUSEPORT, - &one, - sizeof one) == -1) - return -1; -#endif /* SO_REUSEPORT */ - - // Create an address to bind the socket to. - ACE_INET_Addr local; - - if (local.set (this->mcast_addr_.get_port_number ()) == -1) - return -1; - else if (ACE_SOCK_Dgram::shared_open (local, - protocol_family) == -1) - return -1; - } - - return 0; -} - - -int -ACE_SOCK_Dgram_Mcast_QoS::subscribe_ifs (const ACE_INET_Addr &mcast_addr, - const ACE_QoS_Params &qos_params, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol, - int reuse_addr, - ACE_Protocol_Info *protocolinfo) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::subscribe_ifs"); -#if defined (ACE_WIN32) - // Windows NT's winsock has trouble with multicast subscribes in the - // presence of multiple network interfaces when the IP address is - // given as INADDR_ANY. It will pick the first interface and only - // accept mcast there. So, to work around this, cycle through all - // of the interfaces known and subscribe to all the non-loopback - // ones. - // - // Note that this only needs to be done on NT, but there's no way to - // tell at this point if the code will be running on NT - only if it - // is compiled for NT-only or for NT/95, and that doesn't really - // help us. It doesn't hurt to do this on Win95, it's just a little - // slower than it normally would be. - // - // NOTE - doesn't always get all of the - // interfaces. In particular, it may not get a PPP interface. This - // is a limitation of the way works with - // MSVC. The reliable way of getting the interface list is - // available only with MSVC 5. - - if (net_if == 0) - { - ACE_INET_Addr *if_addrs = 0; - size_t if_cnt; - - if (ACE::get_ip_interfaces (if_cnt, - if_addrs) != 0) - return -1; - - size_t nr_subscribed = 0; - - if (if_cnt < 2) - { - if (this->subscribe (mcast_addr, - qos_params, - reuse_addr, - ACE_TEXT ("0.0.0.0"), - protocol_family, - protocol, - protocolinfo) == 0) - ++nr_subscribed; - } - else - // Iterate through all the interfaces, figure out which ones - // offer multicast service, and subscribe to them. - while (if_cnt > 0) - { - --if_cnt; - - // Convert to 0-based for indexing, next loop check. - if (if_addrs[if_cnt].get_ip_address() == INADDR_LOOPBACK) - continue; - if (this->subscribe (mcast_addr, - qos_params, - reuse_addr, - if_addrs[if_cnt].get_host_addr(), - protocol_family, - protocol, - protocolinfo) == 0) - ++nr_subscribed; - } - - delete [] if_addrs; - - if (nr_subscribed == 0) - { - errno = ENODEV; - return -1; - } - else - // 1 indicates a "short-circuit" return. This handles the - // rather bizarre semantics of checking all the interfaces on - // NT. - return 1; - } -#else - ACE_UNUSED_ARG (mcast_addr); - ACE_UNUSED_ARG (qos_params); - ACE_UNUSED_ARG (protocol_family); - ACE_UNUSED_ARG (protocol); - ACE_UNUSED_ARG (reuse_addr); - ACE_UNUSED_ARG (protocolinfo); -#endif /* ACE_WIN32 */ - // Otherwise, do it like everyone else... - - // Create multicast request. - if (this->make_multicast_address (this->mcast_addr_, - net_if) == -1) - return -1; - else - return 0; -} - -int -ACE_SOCK_Dgram_Mcast_QoS::subscribe (const ACE_INET_Addr &mcast_addr, - const ACE_QoS_Params &qos_params, - int reuse_addr, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - ACE_QoS_Manager *qos_manager, - ACE_QoS_Session *qos_session) -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast::subscribe"); - - if (this->open (mcast_addr, - qos_params, - protocol_family, - protocol, - protocolinfo, - g, - flags, - reuse_addr) == -1) - return -1; - - // The following method call only applies to Win32 currently. - int result = this->subscribe_ifs (mcast_addr, - qos_params, - net_if, - protocol_family, - protocol, - reuse_addr, - protocolinfo); - // Check for the "short-circuit" return value of 1 (for NT). - if (result != 0) - return result; - - // Tell network device driver to read datagrams with a - // IP interface. - else - { - // Check if the mcast_addr passed into this method is the - // same as the QoS session address. - if (mcast_addr == qos_session->dest_addr ()) - { - - // Subscribe to the QoS session. - ACE_UNUSED_ARG (qos_manager); -#if 0 - if (qos_manager->join_qos_session (qos_session) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to join QoS Session\n"), - -1); -#endif - - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Dest Addr in the QoS Session does") - ACE_TEXT (" not match the address passed into") - ACE_TEXT (" subscribe\n")), - -1); - } - - sockaddr_in mult_addr; - - if (protocol_family == ACE_FROM_PROTOCOL_INFO) - mult_addr.sin_family = protocolinfo->iAddressFamily; - else - mult_addr.sin_family = protocol_family; - - mult_addr.sin_port = ACE_HTONS (mcast_addr.get_port_number ()); - - mult_addr.sin_addr = this->mcast_request_if_.IMR_MULTIADDR; - - // XX This is windows stuff only. fredk - if (ACE_OS::join_leaf (this->get_handle (), - ACE_reinterpret_cast (const sockaddr *, - &mult_addr), - sizeof mult_addr, - qos_params) == ACE_INVALID_HANDLE - && errno != ENOTSUP) - return -1; - else - qos_session->qos (*(qos_params.socket_qos ())); - - return 0; - } -} diff --git a/ace/SOCK_Dgram_Mcast_QoS.h b/ace/SOCK_Dgram_Mcast_QoS.h deleted file mode 100644 index 9ed2d63ea87..00000000000 --- a/ace/SOCK_Dgram_Mcast_QoS.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_Dgram_Mcast_QoS.h -// -// = AUTHORS -// Vishal Kachroo -// -// ============================================================================ - -#ifndef ACE_SOCK_DGRAM_MCAST_QOS_H -#define ACE_SOCK_DGRAM_MCAST_QOS_H -#include "ace/pre.h" - -#include "ace/SOCK_Dgram_Mcast.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_SOCK_Dgram_Mcast_QoS : public ACE_SOCK_Dgram_Mcast -{ - // = TITLE - // Defines the member functions for the ACE QoS enabled socket - // wrapper for UDP/IP multicast. - -public: - // = Initialization routine. - ACE_SOCK_Dgram_Mcast_QoS (void); - - // Note that there is no public method. Therefore, this - // class cannot be used unless you to a multicast group. - // If you just want to send (and not listen) to a multicast group, - // use or instead. - - ~ACE_SOCK_Dgram_Mcast_QoS (void); - // Default dtor. - - // = Multicast group management routines. - int subscribe (const ACE_INET_Addr &mcast_addr, - const ACE_QoS_Params &qos_params, - int reuse_addr = 1, - const ACE_TCHAR *net_if = 0, - int protocol_family = PF_INET, - int protocol = 0, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - ACE_QoS_Manager *qos_manager = 0, - ACE_QoS_Session *qos_session = 0); - // This is a QoS-enabled method for joining a multicast group, which - // passes via . The network - // interface device driver is instructed to accept datagrams with - // multicast addresses. If the socket has already been - // opened, closes the socket and opens a new socket - // bound to the . The session object specifies the QoS - // session that the socket wants to subscribe to. A socket may - // subscribe to multiple QoS sessions by calling this method multiple - // times with different session objects. - // - // The interface is hardware specific, e.g., use "netstat - // -i" to find whether your interface is, such as "le0" or something - // else. If net_if == 0, uses the default mcast - // interface. Returns: -1 if the call fails. - // - // Note that some platforms, such as pSoS, support only number, not - // names, for network interfaces. For these platforms, just give - // these numbers in alphanumeric form and will convert - // them into numbers via . - - // = Data transfer routines. - - ssize_t send (const iovec buffers[], - int buffer_count, - size_t &number_of_bytes_sent, - int flags, - const ACE_Addr &addr, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const; - // Send worth of to using overlapped - // I/O (uses ). Returns 0 on success. - - ssize_t send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const; - // Send an byte to the datagram socket (uses ). - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - // = Disable public method to ensure class used properly. - - int open (const ACE_Addr &mcast_addr, - const ACE_QoS_Params &qos_params, - int protocol_family = PF_INET, - int protocol = 0, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0); - // Not publically visible. - - int subscribe_ifs (const ACE_INET_Addr &mcast_addr, - const ACE_QoS_Params &qos_params, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol, - int reuse_addr, - ACE_Protocol_Info *protocolinfo); - // Subscribe to the multicast interface using QoS-enabled semantics. - -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Dgram_Mcast_QoS.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/post.h" -#endif /* ACE_SOCK_DGRAM_MCAST_QOS_H */ - - diff --git a/ace/SOCK_Dgram_Mcast_QoS.i b/ace/SOCK_Dgram_Mcast_QoS.i deleted file mode 100644 index 879f50d51fd..00000000000 --- a/ace/SOCK_Dgram_Mcast_QoS.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ASYS_INLINE -ACE_SOCK_Dgram_Mcast_QoS::~ACE_SOCK_Dgram_Mcast_QoS (void) -{ -} - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram_Mcast_QoS::send (const iovec buffers[], - int buffer_count, - size_t &number_of_bytes_sent, - int flags, - const ACE_Addr &addr, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::send"); - - return ACE_SOCK_Dgram::send (buffers, - buffer_count, - number_of_bytes_sent, - flags, - addr, - overlapped, - func); - -} - -ASYS_INLINE ssize_t -ACE_SOCK_Dgram_Mcast_QoS::send (const void *buf, - size_t n, - const ACE_Addr &addr, - int flags, - ACE_OVERLAPPED *overlapped, - ACE_OVERLAPPED_COMPLETION_FUNC func) const -{ - ACE_TRACE ("ACE_SOCK_Dgram_Mcast_QoS::send"); - - return ACE_SOCK_Dgram::send (buf, - n, - addr, - flags, - overlapped, - func); -} - diff --git a/ace/SOCK_IO.cpp b/ace/SOCK_IO.cpp deleted file mode 100644 index 1f233aa88db..00000000000 --- a/ace/SOCK_IO.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// SOCK_IO.cpp -// $Id$ - -#include "ace/SOCK_IO.h" -#include "ace/Handle_Set.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_IO.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -ACE_RCSID(ace, SOCK_IO, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_IO) - -void -ACE_SOCK_IO::dump (void) const -{ - ACE_TRACE ("ACE_SOCK_IO::dump"); -} - -// Allows a client to read from a socket without having to provide -// a buffer to read. This method determines how much data is in the -// socket, allocates a buffer of this size, reads in the data, and -// returns the number of bytes read. - -ssize_t -ACE_SOCK_IO::recvv (iovec *io_vec, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::recvv"); -#if defined (FIONREAD) - ACE_Handle_Set handle_set; - handle_set.reset (); - handle_set.set_bit (this->get_handle ()); - - io_vec->iov_base = 0; - - // Check the status of the current socket. - switch (ACE_OS::select (int (this->get_handle ()) + 1, - handle_set, - 0, 0, - timeout)) - { - case -1: - return -1; - /* NOTREACHED */ - case 0: - errno = ETIME; - return -1; - /* NOTREACHED */ - default: - // Goes fine, fallthrough to get data - break; - } - - u_long inlen; - - if (ACE_OS::ioctl (this->get_handle (), - FIONREAD, - (u_long *) &inlen) == -1) - return -1; - else if (inlen > 0) - { - ACE_NEW_RETURN (io_vec->iov_base, - char[inlen], - -1); - io_vec->iov_len = this->recv (io_vec->iov_base, - inlen); - return io_vec->iov_len; - } - else - return 0; -#else - ACE_UNUSED_ARG (io_vec); - ACE_UNUSED_ARG (timeout); - ACE_NOTSUP_RETURN (-1); -#endif /* FIONREAD */ -} - -// Send N char *ptrs and int lengths. Note that the char *'s precede -// the ints (basically, an varargs version of writev). The count N is -// the *total* number of trailing arguments, *not* a couple of the -// number of tuple pairs! - -ssize_t -ACE_SOCK_IO::send (size_t n, ...) const -{ - ACE_TRACE ("ACE_SOCK_IO::send"); - - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, ssize_t); - } - - ssize_t result = ACE_OS::sendv (this->get_handle (), - iovp, - total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// This is basically an interface to ACE_OS::readv, that doesn't use -// the struct iovec_Base explicitly. The ... can be passed as an arbitrary -// number of (char *ptr, int len) tuples. However, the count N is the -// *total* number of trailing arguments, *not* a couple of the number -// of tuple pairs! - -ssize_t -ACE_SOCK_IO::recv (size_t n, ...) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, ssize_t); - } - - ssize_t result = ACE_OS::recvv (this->get_handle (), - iovp, - total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} diff --git a/ace/SOCK_IO.h b/ace/SOCK_IO.h deleted file mode 100644 index 0ad3ef62682..00000000000 --- a/ace/SOCK_IO.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_IO.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SOCK_IO_H -#define ACE_SOCK_IO_H -#include "ace/pre.h" - -#include "ace/SOCK.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_SOCK_IO : public ACE_SOCK -{ - // = TITLE - // Defines the methods for the ACE socket wrapper I/O routines - // (e.g., send/recv). - // - // = NOTES - // - // If == 0, then the call behaves as a normal - // send/recv call, i.e., for blocking sockets, the call will - // block until action is possible; for non-blocking sockets, - // EWOULDBLOCK will be returned if no action is immediately - // possible. - // - // If != 0, the call will wait until the relative time - // specified in * elapses. - // - // Errors are reported by -1 and 0 return values. If the - // operation times out, -1 is returned with . - // If it succeeds the number of bytes transferred is returned. - // - // Methods with the extra argument will always result in - // getting called. Methods without the extra - // argument will result in getting called on Win32 - // platforms, and getting called on non-Win32 platforms. - // -public: - // = Initialization and termination methods. - - ACE_SOCK_IO (void); - // Constructor. - - ~ACE_SOCK_IO (void); - // Destructor. - - ssize_t recv (void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout = 0) const; - // Recv an byte buffer from the connected socket. - - ssize_t recv (void *buf, - size_t n, - const ACE_Time_Value *timeout = 0) const; - // Recv an byte buffer from the connected socket. - - ssize_t recvv (iovec iov[], - size_t n, - const ACE_Time_Value *timeout = 0) const; - // Recv an of size from the connected socket. - - ssize_t recv (iovec iov[], - size_t n, - const ACE_Time_Value *timeout = 0) const; - // Same as above. Deprecated. - - ssize_t recvv (iovec *io_vec, - const ACE_Time_Value *timeout = 0) const; - // Allows a client to read from a socket without having to provide a - // buffer to read. This method determines how much data is in the - // socket, allocates a buffer of this size, reads in the data, and - // returns the number of bytes read. The caller is responsible for - // deleting the member in the field of using - // delete [] io_vec->iov_base. - - ssize_t recv (iovec *io_vec, - const ACE_Time_Value *timeout = 0) const; - // Same as above. Deprecated. - - ssize_t recv (size_t n, - ...) const; - // Recv varargs messages to the connected socket. - - ssize_t recv (void *buf, - size_t n, - ACE_OVERLAPPED *overlapped) const; - // Recv bytes via Win32 using overlapped I/O. - - ssize_t send (const void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout = 0) const; - // Send an byte buffer to the connected socket. - - ssize_t send (const void *buf, - size_t n, - const ACE_Time_Value *timeout = 0) const; - // Send an byte buffer to the connected socket. - - ssize_t sendv (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout = 0) const; - // Send an of size to the connected socket. - - ssize_t send (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout = 0) const; - // Same as above. Deprecated. - - ssize_t send (size_t n, - ...) const; - // Send varargs messages to the connected socket. - - ssize_t send (const void *buf, - size_t n, - ACE_OVERLAPPED *overlapped) const; - // Send bytes via Win32 using overlapped I/O. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_IO.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SOCK_IO_H */ diff --git a/ace/SOCK_IO.i b/ace/SOCK_IO.i deleted file mode 100644 index d46ca3c188f..00000000000 --- a/ace/SOCK_IO.i +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SOCK_IO.i - -// Send an n byte message to the connected socket. - -ASYS_INLINE -ACE_SOCK_IO::ACE_SOCK_IO (void) -{ - // ACE_TRACE ("ACE_SOCK_IO::ACE_SOCK_IO"); -} - -ASYS_INLINE -ACE_SOCK_IO::~ACE_SOCK_IO (void) -{ - // ACE_TRACE ("ACE_SOCK_IO::~ACE_SOCK_IO"); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::recv (void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - return ACE::recv (this->get_handle (), - buf, - len, - flags, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::recv (void *buf, - size_t len, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - return ACE::recv (this->get_handle (), - buf, - len, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::recvv (iovec iov[], - size_t n, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::recvv"); - return ACE::recvv (this->get_handle (), - iov, - n, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::recv (iovec iov[], - size_t n, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - return this->recvv (iov, - n, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::recv (iovec *io_vec, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - return this->recvv (io_vec, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::recv (void *buf, - size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - return ACE_OS::read (this->get_handle (), - (char *) buf, - n, - overlapped); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::send (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::send"); - return ACE::send (this->get_handle (), - buf, - len, - flags, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::send (const void *buf, - size_t len, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::send"); - return ACE::send (this->get_handle (), - buf, - len, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::sendv (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::sendv"); - return ACE::sendv (this->get_handle (), - iov, - n, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::send (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::send"); - return this->sendv (iov, - n, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_IO::send (const void *buf, - size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_SOCK_IO::send"); - return ACE_OS::write (this->get_handle (), - (const char *) buf, - n, - overlapped); -} diff --git a/ace/SOCK_Stream.cpp b/ace/SOCK_Stream.cpp deleted file mode 100644 index cd9be127aaa..00000000000 --- a/ace/SOCK_Stream.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SOCK_Stream.cpp -// $Id$ - -#include "ace/SOCK_Stream.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Stream.i" -#endif - -ACE_RCSID(ace, SOCK_Stream, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Stream) - -void -ACE_SOCK_Stream::dump (void) const -{ - ACE_TRACE ("ACE_SOCK_Stream::dump"); -} - -int -ACE_SOCK_Stream::close (void) -{ -#if defined (ACE_WIN32) - // We need the following call to make things work correctly on - // Win32, which requires use to do a before doing the - // close in order to avoid losing data. Note that we don't need to - // do this on UNIX since it doesn't have this "feature". Moreover, - // this will cause subtle problems on UNIX due to the way that - // fork() works. - this->close_writer (); -#endif /* ACE_WIN32 */ - // Close down the socket. - return ACE_SOCK::close (); -} - diff --git a/ace/SOCK_Stream.h b/ace/SOCK_Stream.h deleted file mode 100644 index 2d67713a878..00000000000 --- a/ace/SOCK_Stream.h +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SOCK_Stream.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SOCK_STREAM_H -#define ACE_SOCK_STREAM_H -#include "ace/pre.h" - -#include "ace/SOCK_IO.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/INET_Addr.h" - -class ACE_Export ACE_SOCK_Stream : public ACE_SOCK_IO -{ - // = TITLE - // Defines the methods in the abstraction. - // - // = DESCRIPTION - // This adds additional wrapper methods atop the - // class. - // - // = NOTES - // - // The "_n" I/O methods keep looping until all the data has been - // transferred. These methods also work for sockets in - // non-blocking mode i.e., they keep looping on EWOULDBLOCK. - // is used to make sure we keep making progress, i.e., - // the same timeout value is used for every I/O operation in the - // loop and the timeout is not counted down. If the transfer - // times out, the number of bytes transferred so far are - // returned. - // - // Errors are reported by -1 and 0 return values. - // - // Methods with the extra argument will always result in - // getting called. Methods without the extra - // argument will result in getting called on Win32 - // platforms, and getting called on non-Win32 platforms. - // -public: - // Initialization and termination methods. - ACE_SOCK_Stream (void); - // Constructor. - - ACE_SOCK_Stream (ACE_HANDLE h); - // Constructor (sets the underlying with ). - - ~ACE_SOCK_Stream (void); - // Destructor. - - // = I/O functions. - - ssize_t recv_n (void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0, - int error_on_eof = 1) const; - // Try to recv exactly bytes into from . - - ssize_t recv_n (void *buf, - size_t len, - const ACE_Time_Value *timeout = 0, - int error_on_eof = 1) const; - // Try to recv exactly bytes into from . - - ssize_t recvv_n (iovec iov[], - size_t iovcnt, - const ACE_Time_Value *timeout = 0, - int error_on_eof = 1) const; - // Receive an of size to the connected socket. - - ssize_t send_n (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0, - int error_on_eof = 1) const; - // Try to send exactly bytes into from . - - ssize_t send_n (const void *buf, - size_t len, - const ACE_Time_Value *timeout = 0, - int error_on_eof = 1) const; - // Try to send exactly bytes into from . - - ssize_t sendv_n (const iovec iov[], - size_t iovcnt, - const ACE_Time_Value *timeout = 0, - int error_on_eof = 1) const; - // Send an of size to the connected socket. - - // = Send/receive ``urgent'' data (see TCP specs...). - ssize_t send_urg (const void *ptr, - size_t len = sizeof (char), - const ACE_Time_Value *timeout = 0) const; - - ssize_t recv_urg (void *ptr, - size_t len = sizeof (char), - const ACE_Time_Value *timeout = 0) const; - - // = Selectively close endpoints. - int close_reader (void); - // Close down the reader. - int close_writer (void); - // Close down the writer. - - int close (void); - // Close down the socket (we need this to make things work correctly - // on Win32, which requires use to do a before doing - // the close to avoid losing data). - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SOCK_Stream.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SOCK_STREAM_H */ diff --git a/ace/SOCK_Stream.i b/ace/SOCK_Stream.i deleted file mode 100644 index 1e9fb491842..00000000000 --- a/ace/SOCK_Stream.i +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/SOCK_Stream.h" - -ASYS_INLINE -ACE_SOCK_Stream::ACE_SOCK_Stream (void) -{ - // ACE_TRACE ("ACE_SOCK_Stream::ACE_SOCK_Stream"); -} - -ASYS_INLINE -ACE_SOCK_Stream::ACE_SOCK_Stream (ACE_HANDLE h) -{ - // ACE_TRACE ("ACE_SOCK_Stream::ACE_SOCK_Stream"); - this->set_handle (h); -} - -ASYS_INLINE -ACE_SOCK_Stream::~ACE_SOCK_Stream (void) -{ - // ACE_TRACE ("ACE_SOCK_Stream::~ACE_SOCK_Stream"); -} - -ASYS_INLINE int -ACE_SOCK_Stream::close_reader (void) -{ - ACE_TRACE ("ACE_SOCK_Stream::close_reader"); - if (this->get_handle () != ACE_INVALID_HANDLE) - return ACE_OS::shutdown (this->get_handle (), 0); - else - return 0; -} - -// Shut down just the writing end of a ACE_SOCK. - -ASYS_INLINE int -ACE_SOCK_Stream::close_writer (void) -{ - ACE_TRACE ("ACE_SOCK_Stream::close_writer"); - if (this->get_handle () != ACE_INVALID_HANDLE) - return ACE_OS::shutdown (this->get_handle (), 1); - else - return 0; -} - -ASYS_INLINE ssize_t -ACE_SOCK_Stream::recv_n (void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - int error_on_eof) const -{ - ACE_TRACE ("ACE_SOCK_Stream::recv_n"); - return ACE::recv_n (this->get_handle (), - buf, - len, - flags, - timeout, - error_on_eof); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Stream::recv_n (void *buf, - size_t len, - const ACE_Time_Value *timeout, - int error_on_eof) const -{ - ACE_TRACE ("ACE_SOCK_Stream::recv_n"); - return ACE::recv_n (this->get_handle (), - buf, - len, - timeout, - error_on_eof); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Stream::recvv_n (iovec iov[], - size_t n, - const ACE_Time_Value *timeout, - int error_on_eof) const -{ - ACE_TRACE ("ACE_SOCK_Stream::recvv_n"); - return ACE::recvv_n (this->get_handle (), - iov, - n, - timeout, - error_on_eof); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Stream::send_n (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - int error_on_eof) const -{ - ACE_TRACE ("ACE_SOCK_Stream::send_n"); - return ACE::send_n (this->get_handle (), - buf, - len, - flags, - timeout, - error_on_eof); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Stream::send_n (const void *buf, - size_t len, - const ACE_Time_Value *timeout, - int error_on_eof) const -{ - ACE_TRACE ("ACE_SOCK_Stream::send_n"); - return ACE::send_n (this->get_handle (), - buf, - len, - timeout, - error_on_eof); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Stream::sendv_n (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout, - int error_on_eof) const -{ - ACE_TRACE ("ACE_SOCK_Stream::sendv_n"); - return ACE::sendv_n (this->get_handle (), - iov, - n, - timeout, - error_on_eof); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Stream::send_urg (const void *ptr, - size_t len, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_Stream::send_urg"); - return ACE::send (this->get_handle (), - ptr, - len, - MSG_OOB, - timeout); -} - -ASYS_INLINE ssize_t -ACE_SOCK_Stream::recv_urg (void *ptr, - size_t len, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_Stream::recv_urg"); - return ACE::recv (this->get_handle (), - ptr, - len, - MSG_OOB, - timeout); -} diff --git a/ace/SPIPE.cpp b/ace/SPIPE.cpp deleted file mode 100644 index 0f2be4cc65d..00000000000 --- a/ace/SPIPE.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPIPE.cpp -// $Id$ - -#include "ace/SPIPE.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SPIPE.i" -#endif - -ACE_RCSID(ace, SPIPE, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SPIPE) - -// This is the do-nothing constructor. - -ACE_SPIPE::ACE_SPIPE (void) -{ - // ACE_TRACE ("ACE_SPIPE::ACE_SPIPE"); -} - -void -ACE_SPIPE::dump (void) const -{ - ACE_TRACE ("ACE_SPIPE::dump"); -} - -// Close down a ACE_SPIPE. - -int -ACE_SPIPE::get_local_addr (ACE_SPIPE_Addr &local_sap) const -{ - ACE_TRACE ("ACE_SPIPE::get_local_addr"); - local_sap = this->local_addr_; - return 0; -} - -// Close down the STREAM pipe without removing the rendezvous point. - -int -ACE_SPIPE::close (void) -{ - ACE_TRACE ("ACE_SPIPE::close"); - int result = 0; - - if (this->get_handle () != ACE_INVALID_HANDLE) - { - result = ACE_OS::close (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - } - return result; -} - -// Close down the STREAM pipe and remove the rendezvous point from the -// file system. - -int -ACE_SPIPE::remove (void) -{ - ACE_TRACE ("ACE_SPIPE::remove"); - int result = this->close (); - return ACE_OS::unlink (this->local_addr_.get_path_name ()) == -1 || result == -1 ? -1 : 0; -} - diff --git a/ace/SPIPE.h b/ace/SPIPE.h deleted file mode 100644 index a9fcfe334e5..00000000000 --- a/ace/SPIPE.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SPIPE.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SPIPE_H -#define ACE_SPIPE_H -#include "ace/pre.h" - -#include "ace/IPC_SAP.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SPIPE_Addr.h" - -class ACE_Export ACE_SPIPE : public ACE_IPC_SAP -{ - // = TITLE - // Defines the member functions for the base class of the - // ACE_SPIPE abstraction. -public: - int close (void); - // Close down the STREAM pipe without removing the rendezvous point. - - int remove (void); - // Close down the STREAM pipe and remove the rendezvous point from - // the file system. - - int get_local_addr (ACE_SPIPE_Addr &) const; - // Return the local address of this endpoint. - - int disable (int signum) const ; - // Disable signal - // This is here to prevent Win32 from - // disabling SPIPE using socket calls - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - ACE_SPIPE (void); - // Ensure that this class is an abstract base class - - ACE_SPIPE_Addr local_addr_; - // Our local address. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SPIPE.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SPIPE_H */ diff --git a/ace/SPIPE.i b/ace/SPIPE.i deleted file mode 100644 index fd205ab76df..00000000000 --- a/ace/SPIPE.i +++ /dev/null @@ -1,16 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SPIPE.i - -ASYS_INLINE int -ACE_SPIPE::disable (int signum) const -{ -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (signum) ; - return 0 ; -#else /* ACE_WIN32 */ - return ACE_IPC_SAP::disable (signum) ; -#endif /* ACE_WIN32 */ -} - diff --git a/ace/SPIPE_Acceptor.cpp b/ace/SPIPE_Acceptor.cpp deleted file mode 100644 index a87510de58b..00000000000 --- a/ace/SPIPE_Acceptor.cpp +++ /dev/null @@ -1,261 +0,0 @@ -// SPIPE_Acceptor.cpp -// $Id$ - -#include "ace/SPIPE_Acceptor.h" - -ACE_RCSID(ace, SPIPE_Acceptor, "$Id$") - -ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor (void) -{ - ACE_TRACE ("ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor"); -} - -int -ACE_SPIPE_Acceptor::remove (void) -{ - ACE_TRACE ("ACE_SPIPE_Acceptor::remove"); -#if defined (ACE_HAS_STREAM_PIPES) - int result = this->close (); - - // Remove the underlying file. - return ACE_OS::unlink (this->local_addr_.get_path_name ()) == -1 - || result == -1 ? -1 : 0; -#else - this->close (); - return 0; -#endif -} - -ACE_ALLOC_HOOK_DEFINE (ACE_SPIPE_Acceptor) - -void -ACE_SPIPE_Acceptor::dump (void) const -{ - ACE_TRACE ("ACE_SPIPE_Acceptor::dump"); -} - -// General purpose routine for performing server ACE_SPIPE creation. - -int -ACE_SPIPE_Acceptor::open (const ACE_SPIPE_Addr &local_sap, - int /* reuse_addr */, - int perms) -{ - ACE_TRACE ("ACE_SPIPE_Acceptor::open"); - - this->local_addr_ = local_sap; - this->set_handle (ACE_INVALID_HANDLE); - - return this->create_new_instance (perms); -} - -int -ACE_SPIPE_Acceptor::create_new_instance (int perms) -{ -#if defined (ACE_HAS_STREAM_PIPES) - ACE_HANDLE spipe[2]; - char module[] = "connld"; - - ACE_HANDLE handle = ACE_OS::creat (this->local_addr_.get_path_name (), - perms); - if (handle == ACE_INVALID_HANDLE) - return -1; - else if (ACE_OS::close (handle) == -1) - return -1; - else if (ACE_OS::pipe (spipe) == -1) - return -1; - else if (ACE_OS::ioctl (spipe[0], - I_PUSH, - module) == -1) - return -1; - else if (ACE_OS::fattach (spipe[0], - this->local_addr_.get_path_name ()) == -1) - return -1; - - this->set_handle (spipe[1]); - return 0; - -#elif (defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) - - // Create a new instance of the Named Pipe (WIN32). A new instance - // of the named pipe must be created for every client process. If - // an instance of the named pipe that is already connected to a - // client process is reused with a new client process, - // ::ConnectNamedPipe () would fail. - - ACE_UNUSED_ARG (perms); - ACE_TRACE ("ACE_SPIPE_Acceptor::create_new_instance"); - int status; - - // Create a new instance of the named pipe - ACE_HANDLE handle = -#if defined (ACE_USES_WCHAR) - ::CreateNamedPipeW ( -#else /* ACE_USES_WCHAR */ - ::CreateNamedPipeA ( -#endif /* ACE_USES_WCHAR */ - this->local_addr_.get_path_name (), - PIPE_ACCESS_DUPLEX - | FILE_FLAG_OVERLAPPED, - PIPE_TYPE_MESSAGE - | PIPE_READMODE_MESSAGE, - PIPE_UNLIMITED_INSTANCES, - 1024 * 10, - 1024 * 10, - ACE_DEFAULT_TIMEOUT, - NULL); - - - if (handle == ACE_INVALID_HANDLE) - { - return -1; - } - else - { - // Start the Connect (analogous to listen () for a socket). Completion - // is noted by the event being signalled. If a client connects - // before this call, the error status will be ERROR_PIPE_CONNECTED, in - // which case that fact is remembered via already_connected_ and noted - // when the user calls accept (). - // Else the error status should be ERROR_IO_PENDING and the OS will - // signal the event when it's done. - this->already_connected_ = FALSE; - this->set_handle (handle); - this->overlapped_.hEvent = this->event_.handle (); - this->event_.reset (); - - BOOL result = ::ConnectNamedPipe (handle, &this->overlapped_); - ACE_ASSERT (result == FALSE); - ACE_UNUSED_ARG (result); - - status = ::GetLastError (); - if (status == ERROR_PIPE_CONNECTED) - this->already_connected_ = TRUE; - else if (status != ERROR_IO_PENDING) - this->close (); // Sets handle to ACE_INVALID_HANDLE - } - return (this->get_handle () == ACE_INVALID_HANDLE ? -1 : 0); -#else - ACE_UNUSED_ARG (perms); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_STREAM_PIPES */ -} - -int -ACE_SPIPE_Acceptor::close (void) -{ - ACE_TRACE ("ACE_SPIPE_Acceptor::close"); - - // This behavior is shared by UNIX and Win32... - int result = this->ACE_SPIPE::close (); - this->set_handle (ACE_INVALID_HANDLE); - -#if defined (ACE_HAS_STREAM_PIPES) - ACE_OS::fdetach (this->local_addr_.get_path_name ()); -#endif /* ACE_HAS_STREAM_PIPES */ - return result; -} - -ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor (const ACE_SPIPE_Addr &local_sap, - int reuse_addr, - int perms) -{ - ACE_TRACE ("ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor"); - - if (this->open (local_sap, reuse_addr, perms) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SPIPE_Acceptor"))); -} - -// General purpose routine for accepting new connections. - -int -ACE_SPIPE_Acceptor::accept (ACE_SPIPE_Stream &new_io, - ACE_SPIPE_Addr *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) -{ - ACE_TRACE ("ACE_SPIPE_Acceptor::accept"); - ACE_UNUSED_ARG (reset_new_handle); - -#if defined (ACE_HAS_STREAM_PIPES) - strrecvfd r_handle; - - // Note that if THIS->MILLI_SECOND_DELAY == -1 we block on - // ACE_OS::ioctl (). Otherwise, we will wait for the desired number - // of milli seconds using ACE_OS::poll. - - if (timeout != 0 && - ACE::handle_timed_accept (this->get_handle (), - timeout, - restart) == -1) - return -1; - else if (ACE_OS::ioctl (this->get_handle (), - I_RECVFD, - &r_handle) == -1) - return -1; - - new_io.set_handle (r_handle.fd); - new_io.local_addr_ = this->local_addr_; - new_io.remote_addr_.set_size (sizeof r_handle.gid + sizeof r_handle.uid); - new_io.remote_addr_.group_id (r_handle.gid); - new_io.remote_addr_.user_id (r_handle.uid); - - // This is for compatibility with ACE_SOCK_Acceptor and - // ACE_TLI_Acceptor. - if (remote_addr != 0) - *remote_addr = new_io.remote_addr_; - - return 0; -#elif (defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) - ACE_UNUSED_ARG (restart); - ACE_UNUSED_ARG (remote_addr); - - // Check to see if we have a valid pipe - if (this->get_handle () == ACE_INVALID_HANDLE) - return -1; - - // open () started the Connect in asynchronous mode. Wait for the event - // in the OVERLAPPED structure to be signalled, then grab the status. - if (this->already_connected_ == FALSE) - { - if (timeout != 0) - { - ACE_Time_Value abstime (ACE_OS::gettimeofday () + *timeout); - if (this->event_.wait (&abstime) == -1) - return -1; - } - else - if (this->event_.wait () == -1) - return -1; - - // Should be here with the ConnectNamedPipe operation complete. - // Steal the already_connected_ flag to record the results. - DWORD unused; - this->already_connected_ = ::GetOverlappedResult (this->get_handle (), - &this->overlapped_, - &unused, - FALSE); - } - - if (this->already_connected_) - { - new_io.set_handle (this->get_handle ()); - this->set_handle (ACE_INVALID_HANDLE); - new_io.local_addr_ = this->local_addr_; - - // Create a new instance of the pipe for the next connection. - this->create_new_instance (); - return 0; - } - return -1; -#else - ACE_UNUSED_ARG (restart); - ACE_UNUSED_ARG (timeout); - ACE_UNUSED_ARG (remote_addr); - ACE_UNUSED_ARG (new_io); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_STREAM_PIPES */ -} diff --git a/ace/SPIPE_Acceptor.h b/ace/SPIPE_Acceptor.h deleted file mode 100644 index 2e4d08fa338..00000000000 --- a/ace/SPIPE_Acceptor.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SPIPE_Acceptor.h -// -// = AUTHOR -// Doug Schmidt and Prashant Jain -// -// ============================================================================ - -#ifndef ACE_SPIPE_ACCEPTOR_H -#define ACE_SPIPE_ACCEPTOR_H -#include "ace/pre.h" - -#include "ace/SPIPE_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_WIN32) -#include "ace/Synch.h" -#endif /* ACE_WIN32 */ - -class ACE_Export ACE_SPIPE_Acceptor : public ACE_SPIPE -{ - // = TITLE - // Defines the format and interface for the listener side of the - // ACE_SPIPE_Stream. -public: - // = Initialization and termination methods. - ACE_SPIPE_Acceptor (void); - // Default constructor. - - ACE_SPIPE_Acceptor (const ACE_SPIPE_Addr &local_sap, - int reuse_addr = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - // Initiate a passive-mode STREAM pipe listener. - - int open (const ACE_SPIPE_Addr &local_sap, - int reuse_addr = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - // Initiate a passive-mode STREAM pipe listener. - - int close (void); - // Close down the passive-mode STREAM pipe listener. - - int remove (void); - // Remove the underlying mounted pipe from the file system. - - // = Passive connection acceptance method. - int accept (ACE_SPIPE_Stream &ipc_sap_spipe, - ACE_SPIPE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0); - // Accept a new data transfer connection. A of 0 means - // block forever, a of {0, 0} means poll. == 1 - // means "restart if interrupted." - - // = Meta-type info - typedef ACE_SPIPE_Addr PEER_ADDR; - typedef ACE_SPIPE_Stream PEER_STREAM; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - int create_new_instance (int perms = 0); - // Create a new instance of an SPIPE. - -#if (defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) - ACE_OVERLAPPED overlapped_; - ACE_Manual_Event event_; - char already_connected_; -#endif /* ACE_WIN32 */ - -}; - -#include "ace/post.h" -#endif /* ACE_SPIPE_ACCEPTOR_H */ diff --git a/ace/SPIPE_Acceptor.i b/ace/SPIPE_Acceptor.i deleted file mode 100644 index 441ff5a6232..00000000000 --- a/ace/SPIPE_Acceptor.i +++ /dev/null @@ -1,4 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SPIPE_Acceptor.i diff --git a/ace/SPIPE_Addr.cpp b/ace/SPIPE_Addr.cpp deleted file mode 100644 index 566597a7d9e..00000000000 --- a/ace/SPIPE_Addr.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// SPIPE_Addr.cpp -// $Id$ - -#include "ace/SPIPE_Addr.h" - -#if !defined (__ACE_INLINE__) -#include "ace/SPIPE_Addr.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, SPIPE_Addr, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SPIPE_Addr) - -void -ACE_SPIPE_Addr::dump (void) const -{ -} - -// Set a pointer to the address. -void -ACE_SPIPE_Addr::set_addr (void *addr, int len) -{ - ACE_TRACE ("ACE_SPIPE_Addr::set_addr"); - - this->ACE_Addr::base_set (AF_SPIPE, len); - ACE_OS::memcpy ((void *) &this->SPIPE_addr_, - (void *) addr, - len); -} - -// Do nothing constructor. - -ACE_SPIPE_Addr::ACE_SPIPE_Addr (void) - : ACE_Addr (AF_SPIPE, sizeof this->SPIPE_addr_) -{ - (void) ACE_OS::memset ((void *) &this->SPIPE_addr_, - 0, - sizeof this->SPIPE_addr_); -} - -// Transform the string into the current addressing format. - -int -ACE_SPIPE_Addr::string_to_addr (const ACE_TCHAR *addr) -{ - return this->set (addr); -} - -int -ACE_SPIPE_Addr::set (const ACE_SPIPE_Addr &sa) -{ - this->base_set (sa.get_type (), sa.get_size ()); - - if (sa.get_type () == AF_ANY) - (void) ACE_OS::memset ((void *) &this->SPIPE_addr_, - 0, - sizeof this->SPIPE_addr_); - else - (void) ACE_OS::memcpy ((void *) &this->SPIPE_addr_, (void *) - &sa.SPIPE_addr_, - sa.get_size ()); - return 0; -} - -// Copy constructor. - -ACE_SPIPE_Addr::ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa) - : ACE_Addr (AF_SPIPE, sizeof this->SPIPE_addr_) -{ - this->set (sa); -} - -int -ACE_SPIPE_Addr::set (const ACE_TCHAR *addr, - gid_t gid, - uid_t uid) -{ - int len = sizeof (this->SPIPE_addr_.uid_); - len += sizeof (this->SPIPE_addr_.gid_); - -#if defined (ACE_WIN32) - const ACE_TCHAR *colonp = ACE_OS::strchr (addr, ':'); - ACE_TCHAR temp[BUFSIZ]; - - if (colonp == 0) // Assume it's a local name. - { - ACE_OS::strcpy (temp, ACE_TEXT ( "\\\\.\\pipe\\")); - ACE_OS::strcat (temp, addr); - } - else - { - - if (ACE_OS::strncmp (addr, - ACE_TEXT ("localhost"), - ACE_OS::strlen ("localhost")) == 0) - // change "localhost" to "." - ACE_OS::strcpy (temp, ACE_TEXT ("\\\\.")); - else - { - ACE_OS::strcpy (temp, ACE_TEXT ("\\\\")); - - ACE_TCHAR *t; - - // We need to allocate a duplicate so that we can write a - // NUL character into it. - ACE_ALLOCATOR_RETURN (t, ACE_OS::strdup (addr), -1); - - t[colonp - addr] = ACE_TEXT ('\0'); - ACE_OS::strcpy (temp, t); - - ACE_OS::free (t); - } - - ACE_OS::strcat (temp, ACE_TEXT ("\\pipe\\")); - ACE_OS::strcat (temp, colonp + 1); - } - this->ACE_Addr::base_set (AF_SPIPE, - ACE_OS::strlen (temp) + len); - - ACE_OS::strcpy (this->SPIPE_addr_.rendezvous_, temp); -#else - this->ACE_Addr::base_set (AF_SPIPE, - ACE_OS::strlen (addr) + len); - ACE_OS::strncpy (this->SPIPE_addr_.rendezvous_, - addr, - sizeof this->SPIPE_addr_.rendezvous_); -#endif /* ACE_WIN32 */ - this->SPIPE_addr_.gid_ = gid == 0 ? ACE_OS::getgid () : gid; - this->SPIPE_addr_.uid_ = uid == 0 ? ACE_OS::getuid () : uid; - return 0; -} - -// Create a ACE_Addr from a ACE_SPIPE pathname. - -ACE_SPIPE_Addr::ACE_SPIPE_Addr (const ACE_TCHAR *addr, - gid_t gid, - uid_t uid) - : ACE_Addr (AF_SPIPE, sizeof this->SPIPE_addr_) -{ - this->set (addr, gid, uid); -} - diff --git a/ace/SPIPE_Addr.h b/ace/SPIPE_Addr.h deleted file mode 100644 index 063c2382315..00000000000 --- a/ace/SPIPE_Addr.h +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SPIPE_Addr.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SPIPE_ADDR_H -#define ACE_SPIPE_ADDR_H -#include "ace/pre.h" - -#include "ace/Addr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/ACE.h" - -class ACE_Export ACE_SPIPE_Addr : public ACE_Addr -{ - // = TITLE - // Defines the SVR4 STREAM pipe address family address format. -public: - // = Initialization methods. - ACE_SPIPE_Addr (void); - // Default constructor. - - ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa); - // Copy constructor. - - ACE_SPIPE_Addr (const ACE_TCHAR *rendezvous_point, gid_t = 0, uid_t = 0); - // Create a ACE_SPIPE_Addr from a rendezvous point in the file - // system. - - int set (const ACE_SPIPE_Addr &sa); - // Acts like a copy constructor... - - int set (const ACE_TCHAR *rendezvous_point, gid_t = 0, uid_t = 0); - // Create a ACE_SPIPE_Addr from a rendezvous point in the file - // system. - - virtual void *get_addr (void) const; - // Return a pointer to the address. - - virtual void set_addr (void *addr, int len); - // Set a pointer to the underlying network address. - - virtual int addr_to_string (ACE_TCHAR *addr, size_t) const; - // Transform the current address into string format. - - virtual int string_to_addr (const ACE_TCHAR *addr); - // Transform the string into the current addressing format. - - // = Equality/inequality tests - int operator == (const ACE_SPIPE_Addr &SAP) const; - // Check for equality. - - int operator != (const ACE_SPIPE_Addr &SAP) const; - // Check for inequality - - // = SPIPE-specific address operations - const ACE_TCHAR *get_path_name (void) const; - // Pathname of rendezvous point in file system. - - uid_t user_id (void) const; - // Get user id. - void user_id (uid_t uid); - // Set user id. - - void group_id (gid_t gid); - // Set group ids. - gid_t group_id (void) const; - // Get group ids. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - struct SPIPE_Addr - { - // = TITLE - // Contains security attributes. - - gid_t gid_; - // Group id. - - uid_t uid_; - // User id. - - ACE_TCHAR rendezvous_[MAXNAMLEN + 1]; - // Pathname in the file system. - - } SPIPE_addr_; - // Contents of an SPIPE address. -}; - -#if defined (__ACE_INLINE__) -#include "ace/SPIPE_Addr.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_SPIPE_ADDR_H */ diff --git a/ace/SPIPE_Addr.i b/ace/SPIPE_Addr.i deleted file mode 100644 index d7947515c24..00000000000 --- a/ace/SPIPE_Addr.i +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SPIPE_Addr.i - -#include "ace/SString.h" - -// Transform the current address into string format. - -ACE_INLINE int -ACE_SPIPE_Addr::addr_to_string (ACE_TCHAR *s, size_t len) const -{ - ACE_OS::strncpy (s, - this->SPIPE_addr_.rendezvous_, - len); - return 0; -} - -// Return the address. - -ACE_INLINE void * -ACE_SPIPE_Addr::get_addr (void) const -{ - return (void *) &this->SPIPE_addr_; -} - -// Compare two addresses for equality. - -ACE_INLINE int -ACE_SPIPE_Addr::operator == (const ACE_SPIPE_Addr &sap) const -{ - return ACE_OS::strcmp (this->SPIPE_addr_.rendezvous_, - sap.SPIPE_addr_.rendezvous_ ) == 0; -} - -// Compare two addresses for inequality. - -ACE_INLINE int -ACE_SPIPE_Addr::operator != (const ACE_SPIPE_Addr &sap) const -{ - return !((*this) == sap); // This is lazy, of course... ;-) -} - -// Return the path name used for the rendezvous point. - -ACE_INLINE const ACE_TCHAR * -ACE_SPIPE_Addr::get_path_name (void) const -{ - return this->SPIPE_addr_.rendezvous_; -} - -ACE_INLINE uid_t -ACE_SPIPE_Addr::user_id (void) const -{ - return this->SPIPE_addr_.uid_; -} - -ACE_INLINE void -ACE_SPIPE_Addr::user_id (uid_t uid) -{ - this->SPIPE_addr_.uid_ = uid; -} - -ACE_INLINE gid_t -ACE_SPIPE_Addr::group_id (void) const -{ - return this->SPIPE_addr_.gid_; -} - -ACE_INLINE void -ACE_SPIPE_Addr::group_id (gid_t gid) -{ - this->SPIPE_addr_.gid_ = gid; -} diff --git a/ace/SPIPE_Connector.cpp b/ace/SPIPE_Connector.cpp deleted file mode 100644 index 3ea8f5aa617..00000000000 --- a/ace/SPIPE_Connector.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// SPIPE_Connector.cpp -// $Id$ - -#include "ace/SPIPE_Connector.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SPIPE_Connector.i" -#endif - -ACE_RCSID(ace, SPIPE_Connector, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SPIPE_Connector) - -// Creates a Local ACE_SPIPE. - -ACE_SPIPE_Connector::ACE_SPIPE_Connector (ACE_SPIPE_Stream &new_io, - const ACE_SPIPE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr & local_sap, - int reuse_addr, - int flags, - int perms) -{ - ACE_TRACE ("ACE_SPIPE_Connector::ACE_SPIPE_Connector"); - if (this->connect (new_io, remote_sap, timeout, local_sap, - reuse_addr, flags, perms) == -1 - && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("address %s, %p\n"), - remote_sap.get_path_name (), ACE_TEXT ("ACE_SPIPE_Connector"))); -} - -void -ACE_SPIPE_Connector::dump (void) const -{ - ACE_TRACE ("ACE_SPIPE_Connector::dump"); -} - -ACE_SPIPE_Connector::ACE_SPIPE_Connector (void) -{ - ACE_TRACE ("ACE_SPIPE_Connector::ACE_SPIPE_Connector"); -} - -int -ACE_SPIPE_Connector::connect (ACE_SPIPE_Stream &new_io, - const ACE_SPIPE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr & /* local_sap */, - int /* reuse_addr */, - int flags, - int perms) -{ - ACE_TRACE ("ACE_SPIPE_Connector::connect"); - - // Make darn sure that the O_CREAT flag is not set! -#if ! defined (ACE_PSOS_DIAB_MIPS) - ACE_CLR_BITS (flags, O_CREAT); -# endif /* !ACE_PSOS_DIAB_MIPS */ - ACE_HANDLE handle = ACE::handle_timed_open (timeout, - remote_sap.get_path_name (), - flags, perms); - new_io.set_handle (handle); - new_io.remote_addr_ = remote_sap; // class copy. - -#if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP) - DWORD pipe_mode = PIPE_READMODE_MESSAGE | PIPE_WAIT; - - // Set named pipe mode and buffering characteristics. - if (handle != ACE_INVALID_HANDLE) - return ::SetNamedPipeHandleState (handle, - &pipe_mode, - NULL, - NULL); -#endif - return handle == ACE_INVALID_HANDLE ? -1 : 0; -} diff --git a/ace/SPIPE_Connector.h b/ace/SPIPE_Connector.h deleted file mode 100644 index 9bc38a1f7c7..00000000000 --- a/ace/SPIPE_Connector.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SPIPE_Connector.h -// -// = AUTHOR -// Doug Schmidt and Prashant Jain -// -// ============================================================================ - -#ifndef ACE_SPIPE_CONNECTOR_H -#define ACE_SPIPE_CONNECTOR_H -#include "ace/pre.h" - -#include "ace/SPIPE_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_SPIPE_Connector -{ - // = TITLE - // Defines an active connection factory for the STREAM pipe - // wrappers. -public: - // = Initialization method. - ACE_SPIPE_Connector (void); - // Default constructor. - - ACE_SPIPE_Connector (ACE_SPIPE_Stream &new_io, - const ACE_SPIPE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - // The and arguments are passed down to the - // method. - - int connect (ACE_SPIPE_Stream &new_io, - const ACE_SPIPE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = O_RDWR, - int perms = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - // The and arguments are passed down to the - // method. - - int reset_new_handle (ACE_HANDLE handle); - // Resets any event associations on this handle - - // = Meta-type info - typedef ACE_SPIPE_Addr PEER_ADDR; - typedef ACE_SPIPE_Stream PEER_STREAM; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SPIPE_Connector.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SPIPE_CONNECTOR_H */ diff --git a/ace/SPIPE_Connector.i b/ace/SPIPE_Connector.i deleted file mode 100644 index 9ce4c1a7855..00000000000 --- a/ace/SPIPE_Connector.i +++ /dev/null @@ -1,13 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SPIPE_Connector.i - -ASYS_INLINE int -ACE_SPIPE_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_UNUSED_ARG (handle); - // Nothing to do here since the handle is not a socket - return 0; -} - diff --git a/ace/SPIPE_Stream.cpp b/ace/SPIPE_Stream.cpp deleted file mode 100644 index 9488d8dcdc0..00000000000 --- a/ace/SPIPE_Stream.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// SPIPE_Stream.cpp -// $Id$ - -#include "ace/SPIPE_Stream.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SPIPE_Stream.i" -#endif - -ACE_RCSID(ace, SPIPE_Stream, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SPIPE_Stream) - -void -ACE_SPIPE_Stream::dump (void) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::dump"); -} - -// Simple-minded do nothing constructor. - -ACE_SPIPE_Stream::ACE_SPIPE_Stream (void) -{ - // ACE_TRACE ("ACE_SPIPE_Stream::ACE_SPIPE_Stream"); -} - -// Send N char *ptrs and int lengths. Note that the char *'s precede -// the ints (basically, an varargs version of writev). The count N is -// the *total* number of trailing arguments, *not* a couple of the -// number of tuple pairs! - -ssize_t -ACE_SPIPE_Stream::send (size_t n, ...) const -{ - // ACE_TRACE ("ACE_SPIPE_Stream::send"); - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// This is basically an interface to ACE_OS::readv, that doesn't use -// the struct iovec explicitly. The ... can be passed as an arbitrary -// number of (char *ptr, int len) tuples. However, the count N is the -// *total* number of trailing arguments, *not* a couple of the number -// of tuple pairs! - -ssize_t -ACE_SPIPE_Stream::recv (size_t n, ...) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv"); - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} diff --git a/ace/SPIPE_Stream.h b/ace/SPIPE_Stream.h deleted file mode 100644 index 60fd3ac2bb3..00000000000 --- a/ace/SPIPE_Stream.h +++ /dev/null @@ -1,143 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SPIPE_Stream.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SPIPE_STREAM_H -#define ACE_SPIPE_STREAM_H -#include "ace/pre.h" - -#include "ace/SPIPE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SPIPE_Addr.h" - -class ACE_Export ACE_SPIPE_Stream : public ACE_SPIPE -{ - // = TITLE - // Define an ACE_SPIPE_Stream. -public: - friend class ACE_SPIPE_Acceptor; - friend class ACE_SPIPE_Connector; - - // = Initialization method. - ACE_SPIPE_Stream (void); - // Default constructor. - - int get_remote_addr (ACE_SPIPE_Addr &remote_sap) const; - // Obtain the address of whom we are connected with. - - int send_handle (ACE_HANDLE handle) const; - // Send an open FD to another process. - - int recv_handle (ACE_HANDLE &handle) const; - // Recv an open FD from another process. - - int recv_handle (strrecvfd &recvfd) const; - // Recv an open FD from another process. - - ssize_t send_n (const void *buf, size_t n) const; - // Send n bytes, keep trying until n are sent. - - ssize_t recv_n (void *buf, size_t n) const; - // Recv n bytes, keep trying until n are received. - - ssize_t send (const void *buf, size_t n) const; - // Send bytes via STREAM pipes using "band" mode. - - ssize_t recv (void *buf, size_t n) const; - // Recv bytes via STREAM pipes using "band" mode. - - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int flags = 0) const; - // Send and via STREAM pipes. - - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *flags) const; - // Recv and via STREAM pipes. - - ssize_t send (const ACE_Str_Buf *cntl, - const ACE_Str_Buf *data, - int band, - int flags) const; - // Send bytes via STREAM pipes using "band" mode. - - ssize_t recv (ACE_Str_Buf *cntl, - ACE_Str_Buf *data, - int *band, - int *flags) const; - // Recv bytes via STREAM pipes using "band" mode. - - ssize_t send (const iovec iov[], size_t n) const; - // Send iovecs via <::writev>. - - ssize_t recv (iovec iov[], size_t n) const; - // Recv iovecs via <::readv>. - - ssize_t send (size_t n, ...) const; - // Send N char *ptrs and int lengths. Note that the char *'s - // precede the ints (basically, an varargs version of writev). The - // count N is the *total* number of trailing arguments, *not* a - // couple of the number of tuple pairs! - - ssize_t recv (size_t n, ...) const; - // This is an interface to ::readv, that doesn't use the struct - // iovec explicitly. The ... can be passed as an arbitrary number - // of (char *ptr, int len) tuples. However, the count N is the - // *total* number of trailing arguments, *not* a couple of the - // number of tuple pairs! - - ssize_t send (const void *buf, size_t n, ACE_OVERLAPPED *overlapped) const; - // Send bytes via Win32 WriteFile using overlapped I/O. - - ssize_t recv (void *buf, size_t n, ACE_OVERLAPPED *overlapped) const; - // Recv bytes via Win32 ReadFile using overlapped I/O. - - ssize_t sendv (const iovec iov[], - size_t n) const; - // Send an of size to the stream. - - ssize_t sendv_n (const iovec iov[], - size_t n) const; - // Send an of size to the stream. Will block until all - // bytes are sent or an error occurs. - - ssize_t recvv_n (iovec iov[], - size_t n) const; - // Receive an of size to the stream. - - // = Meta-type info - typedef ACE_SPIPE_Addr PEER_ADDR; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_SPIPE_Addr remote_addr_; -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SPIPE_Stream.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SPIPE_STREAM_H */ diff --git a/ace/SPIPE_Stream.i b/ace/SPIPE_Stream.i deleted file mode 100644 index 4733a628815..00000000000 --- a/ace/SPIPE_Stream.i +++ /dev/null @@ -1,198 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SPIPE_Stream.i - -// Create an ACE_SPIPE_Stream. - -ASYS_INLINE int -ACE_SPIPE_Stream::get_remote_addr (ACE_SPIPE_Addr &remote_sap) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::get_remote_addr"); - remote_sap = this->remote_addr_; - return 0; -} - -// Send exactly N bytes from BUF to this socket. Keeping trying until -// this many bytes are sent. - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::send_n (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::send_n"); - return ACE::write_n (this->get_handle (), buf, n); -} - -// Receive exactly N bytes from this socket into BUF. Keep trying -// until this many bytes are received. - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::recv_n (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv_n"); - return ACE::read_n (this->get_handle (), buf, n); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::send (const void *buf, size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::send"); - return ACE_OS::write (this->get_handle (), (const char *) buf, n); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::recv (void *buf, size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv"); - return ACE_OS::read (this->get_handle (), (char *) buf, n); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::send"); - return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv"); - return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::send"); - return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv"); - return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::send (const iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::send"); - return ACE_OS::writev (this->get_handle (), iov, n); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::recv (iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv"); - return ACE_OS::readv (this->get_handle (), iov, n); -} - -// This routine sends an open file descriptor to this socket. - -ASYS_INLINE int -ACE_SPIPE_Stream::send_handle (ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::send_handle"); -#if defined (ACE_HAS_STREAM_PIPES) - return ACE_OS::ioctl (this->get_handle (), I_SENDFD, (void *) handle); -#else - handle = handle; - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_STREAM_PIPES */ -} - -// This file receives an open file descriptor from this socket. - -ASYS_INLINE int -ACE_SPIPE_Stream::recv_handle (ACE_HANDLE &handle) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv_handle"); -#if defined (ACE_HAS_STREAM_PIPES) - strrecvfd recvfd; - - if (ACE_OS::ioctl (this->get_handle (), I_RECVFD, (void *) &recvfd) == -1) - return -1; - else - { - handle = recvfd.fd; - return 0; - } -#else - handle = handle; - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_STREAM_PIPES */ -} - -// This file receives an open file descriptor from this socket and -// also passes back the information about the address... - -ASYS_INLINE int -ACE_SPIPE_Stream::recv_handle (strrecvfd &recvfd) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv_handle"); -#if defined (ACE_HAS_STREAM_PIPES) - return ACE_OS::ioctl (this->get_handle (), I_RECVFD, (void *) &recvfd); -#else - ACE_UNUSED_ARG (recvfd); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_STREAM_PIPES */ -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::send (const void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::send"); - return ACE_OS::write (this->get_handle (), - (const char *) buf, n, - overlapped); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::recv (void *buf, size_t n, - ACE_OVERLAPPED *overlapped) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recv"); - return ACE_OS::read (this->get_handle (), - (char *) buf, n, - overlapped); -} - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::sendv_n (const iovec iov[], - size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::sendv_n"); - return ACE::writev_n (this->get_handle (), - iov, - n); -} - -// Recv an n byte message from the Stream. - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::recvv_n (iovec iov[], - size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::recvv_n"); - // @@ Carlos, can you please update this to call the - // new ACE::recvv_n() method that you write? - return ACE_OS::readv (this->get_handle (), - iov, - n); -} - -// Send an of size to the Stream. - -ASYS_INLINE ssize_t -ACE_SPIPE_Stream::sendv (const iovec iov[], - size_t n) const -{ - ACE_TRACE ("ACE_SPIPE_Stream::sendv"); - return ACE_OS::writev (this->get_handle (), - iov, - n); -} - diff --git a/ace/SSL/ACE_SSL.dsp b/ace/SSL/ACE_SSL.dsp deleted file mode 100644 index e98752263cc..00000000000 --- a/ace/SSL/ACE_SSL.dsp +++ /dev/null @@ -1,166 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ACE_SSL" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ACE_SSL - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ACE_SSL.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ACE_SSL.mak" CFG="ACE_SSL - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ACE_SSL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ACE_SSL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ACE_SSL - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACE_SSL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\OpenSSL\openssl-0.9.5\inc32" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "ACE_HAS_SSL" /D "ACE_SSL_HAS_DLL" /YX /FD /c -# SUBTRACT CPP /X -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 ACE_SSL.lib ace.lib libeay32.lib ssleay32.lib /nologo /dll /pdb:none /machine:I386 /libpath:"..\..\ACE_wrappers\ace" /libpath:"..\..\ACE_wrappers\TAO\tao" /libpath:"..\..\OpenSSL\openssl-0.9.5\out32dll" - -!ELSEIF "$(CFG)" == "ACE_SSL - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ACE_SSL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "..\..\ACE_wrappers" /I "..\..\OpenSSL\openssl-0.9.5\inc32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ACE_HAS_SSL" /D "ACE_SSL_BUILD_DLL" /YX /FD /GZ /c -# SUBTRACT CPP /Fr -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 aced.lib libeay32.lib ssleay32.lib /nologo /dll /debug /machine:I386 /out:"ACE_SSLd.dll" /libpath:"..\..\ACE_wrappers\ace" /libpath:"..\..\ACE_wrappers\TAO\tao" /libpath:"..\..\OpenSSL\openssl-0.9.5\out32dll" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "ACE_SSL - Win32 Release" -# Name "ACE_SSL - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\SSL_Context.cpp -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK.cpp -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Acceptor.cpp -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Connector.cpp -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Stream.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\SSL_Context.h -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK.h -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Acceptor.h -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Connector.h -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Stream.h -# End Source File -# Begin Source File - -SOURCE=.\sslconf.h -# End Source File -# End Group -# Begin Group "Inline Files" - -# PROP Default_Filter "i" -# Begin Source File - -SOURCE=.\SSL_Context.i -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Acceptor.i -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Connector.i -# End Source File -# Begin Source File - -SOURCE=.\SSL_SOCK_Stream.i -# End Source File -# End Group -# End Target -# End Project diff --git a/ace/SSL/SSL_Context.cpp b/ace/SSL/SSL_Context.cpp deleted file mode 100644 index 5c2cf8fa38f..00000000000 --- a/ace/SSL/SSL_Context.cpp +++ /dev/null @@ -1,342 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ========================================================================== -// -// = LIBRARY -// ACE_SSL -// -// = FILENAME -// SSL_Context.cpp -// -// = AUTHOR -// Chris Zimman -// Carlos O'Ryan -// Ossama Othman -// -// ========================================================================== - -#if defined (ACE_HAS_SSL) - -#include "SSL_Context.h" -#include "sslconf.h" - -#if !defined(__ACE_INLINE__) -#include "SSL_Context.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/Synch.h" -#include "ace/Object_Manager.h" - -#include -#include -#include - - -#ifdef ACE_HAS_THREADS -ACE_mutex_t * ACE_SSL_Context::lock_ = 0; -#endif /* ACE_HAS_THREADS */ - -// @@ We really need a better seed value. A seed value based on the -// date and time, in combination with some other strings, may -// suffice. -// -Ossama -static const char rnd_seed[] = "string to make the random number generator think it has entropy"; - -int ACE_SSL_Context::library_init_count_ = 0; - -ACE_SSL_Context::ACE_SSL_Context (void) - : context_ (0), - mode_ (-1), - default_verify_mode_ (SSL_VERIFY_NONE) -{ - ACE_SSL_Context::ssl_library_init (); -} - -ACE_SSL_Context::~ACE_SSL_Context (void) -{ - if (this->context_) - { - ::SSL_CTX_free (this->context_); - this->context_ = 0; - } - - ACE_SSL_Context::ssl_library_fini (); -} - -void -ACE_SSL_Context::ssl_library_init (void) -{ - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, - ace_ssl_mon, - *ACE_Static_Object_Lock::instance ())); - - if (ACE_SSL_Context::library_init_count_ == 0) - { - ::SSL_library_init (); - ::SSL_load_error_strings (); - ::SSLeay_add_ssl_algorithms (); - - // Seed the random number generator - // @@ TODO: Need to pick a better seed value. - ::RAND_seed (rnd_seed, - sizeof rnd_seed); - -#ifdef ACE_HAS_THREADS - int num_locks = ::CRYPTO_num_locks (); - - ACE_NEW (ACE_SSL_Context::lock_, - ACE_mutex_t[num_locks]); - - for (int i = 0; i < num_locks; ++i) - { - // rwlock_init(&(ACE_SSL_Context::lock_[i]), USYNC_THREAD, - // 0); - if (ACE_OS::mutex_init(&(ACE_SSL_Context::lock_[i]), - USYNC_THREAD, - 0) != 0) - ACE_ERROR ((LM_ERROR, - "(%P|%t) ACE_SSL_Context::ssl_library_init - %p\n", - "mutex_init")); - } - -# if !defined (WIN32) - // This call isn't necessary on some platforms. See the CRYPTO - // library's threads(3) man page for details. - ::CRYPTO_set_id_callback (ACE_SSL_thread_id); -# endif /* WIN32 */ - ::CRYPTO_set_locking_callback (ACE_SSL_locking_callback); -#endif /* ACE_HAS_THREADS */ - } - ACE_SSL_Context::library_init_count_++; -} - -void -ACE_SSL_Context::ssl_library_fini (void) -{ - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, - ace_ssl_mon, - *ACE_Static_Object_Lock::instance ())); - - ACE_SSL_Context::library_init_count_--; - if (ACE_SSL_Context::library_init_count_ == 0) - { -#ifdef ACE_HAS_THREADS - int num_locks = ::CRYPTO_num_locks (); - - ::CRYPTO_set_locking_callback (0); - for (int i = 0; i < num_locks; ++i) - ACE_OS::mutex_destroy (&(ACE_SSL_Context::lock_[i])); - - delete [] ACE_SSL_Context::lock_; -#endif /* ACE_HAS_THREADS */ - - ::EVP_cleanup (); - } -} - -int -ACE_SSL_Context::set_mode (int mode) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, - ace_ssl_mon, - *ACE_Static_Object_Lock::instance (), - -1)); - - if (this->context_ != 0) - return -1; - - SSL_METHOD *method = 0; - - switch (mode) - { - case ACE_SSL_Context::SSLv2_client: - method = ::SSLv2_client_method (); - break; - case ACE_SSL_Context::SSLv2_server: - method = ::SSLv2_server_method (); - break; - case ACE_SSL_Context::SSLv2: - method = ::SSLv2_method (); - break; - case ACE_SSL_Context::SSLv3_client: - method = ::SSLv3_client_method (); - break; - case ACE_SSL_Context::SSLv3_server: - method = ::SSLv3_server_method (); - break; - case ACE_SSL_Context::SSLv3: - method = ::SSLv3_method (); - break; - case ACE_SSL_Context::SSLv23_client: - method = ::SSLv23_client_method (); - break; - case ACE_SSL_Context::SSLv23_server: - method = ::SSLv23_server_method (); - break; - case ACE_SSL_Context::SSLv23: - method = ::SSLv23_method (); - break; - case ACE_SSL_Context::TLSv1_client: - method = ::TLSv1_client_method (); - break; - case ACE_SSL_Context::TLSv1_server: - method = ::TLSv1_server_method (); - break; - case ACE_SSL_Context::TLSv1: - method = ::TLSv1_method (); - break; - default: - method = ::SSLv3_method (); - break; - } - - this->context_ = ::SSL_CTX_new (method); - if (this->context_ == 0) - { - ::ERR_print_errors_fp (stderr); - return -1; - } - - this->mode_ = mode; - - const char *cert_file = ACE_OS::getenv (ACE_SSL_CERT_FILE_ENV); - if (cert_file == 0) - cert_file = ACE_DEFAULT_SSL_CERT_FILE; - const char *cert_dir = ACE_OS::getenv (ACE_SSL_CERT_DIR_ENV); - if (cert_dir == 0) - cert_dir = ACE_DEFAULT_SSL_CERT_DIR; - - ::SSL_CTX_load_verify_locations (this->context_, - cert_file, - cert_dir); - ::ERR_print_errors_fp (stderr); - - if (this->certificate_.type () != -1 - && ::SSL_CTX_use_certificate_file (this->context_, - this->certificate_.file_name (), - this->certificate_.type ()) <= 0) - { - // ERR_print_errors_fp (stderr); - return -1; - } - if (this->private_key_.type () != -1 - && SSL_CTX_use_PrivateKey_file (this->context_, - this->private_key_.file_name (), - this->private_key_.type ()) <= 0) - { - // ERR_print_errors_fp (stderr); - return -1; - } - - if (!::SSL_CTX_check_private_key (this->context_)) - { - // ACE_ERROR ((LM_ERROR, "Mismatch in key/certificate\n")); - return -1; - } - - return 0; -} - -int -ACE_SSL_Context::get_mode (void) const -{ - return this->mode_; -} - -int -ACE_SSL_Context::private_key (const char *file_name, - int type) -{ - if (this->private_key_.type () != -1) - return 0; - - this->private_key_ = ACE_SSL_Data_File (file_name, type); - - if (this->context_ == 0) - return 0; - - int status = - ::SSL_CTX_use_PrivateKey_file (this->context_, - this->private_key_.file_name (), - this->private_key_.type ()); - return status; -} - -int -ACE_SSL_Context::verify_private_key (void) -{ - this->check_context (); - - return ::SSL_CTX_check_private_key (this->context_); -} - -int -ACE_SSL_Context::certificate (const char *file_name, - int type) -{ - if (this->certificate_.type () != -1) - return 0; - - this->certificate_ = ACE_SSL_Data_File (file_name, type); - - if (this->context_ == 0) - return 0; - - int status = - ::SSL_CTX_use_certificate_file (this->context_, - this->certificate_.file_name (), - this->certificate_.type ()); - return status; -} - -// **************************************************************** - -#ifdef ACE_HAS_THREADS - -void -ACE_SSL_locking_callback (int mode, - int type, - const char * /* file */, - int /* line */) -{ - // #ifdef undef - // fprintf(stderr,"thread=%4d mode=%s lock=%s %s:%d\n", - // CRYPTO_thread_id(), - // (mode&CRYPTO_LOCK)?"l":"u", - // (type&CRYPTO_READ)?"r":"w",file,line); - // #endif - // /* - // if (CRYPTO_LOCK_SSL_CERT == type) - // fprintf(stderr,"(t,m,f,l) %ld %d %s %d\n", - // CRYPTO_thread_id(), - // mode,file,line); - // */ - if (mode & CRYPTO_LOCK) - ACE_OS::mutex_lock (&(ACE_SSL_Context::lock_[type])); - else - ACE_OS::mutex_unlock (&(ACE_SSL_Context::lock_[type])); -} - -unsigned long -ACE_SSL_thread_id (void) -{ - return (unsigned long) ACE_OS::thr_self (); -} -#endif /* ACE_HAS_THREADS */ - -// **************************************************************** - - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Singleton; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_Singleton - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_Context.h b/ace/SSL/SSL_Context.h deleted file mode 100644 index 48fed50f5fd..00000000000 --- a/ace/SSL/SSL_Context.h +++ /dev/null @@ -1,221 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SSL_Context.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_SSL_CONTEXT_H -#define ACE_SSL_CONTEXT_H - -#include "ace/SString.h" - -#if defined (ACE_HAS_SSL) - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Singleton.h" -#include "ace/Synch.h" - -#include - -#include "SSL_Export.h" - -#ifdef ACE_HAS_THREADS -extern "C" -{ - void ACE_SSL_locking_callback (int mode, - int type, - const char * file, - int line); - // Mutex locking/unlocking callback for OpenSSL multithread support. - - unsigned long ACE_SSL_thread_id (void); - // Return the current thread ID. OpenSSL uses this on platforms - // that need it. -} -#endif /* ACE_HAS_THREADS */ - - -class ACE_SSL_Export ACE_SSL_Data_File -{ -public: - ACE_SSL_Data_File (void); - // Default constructor - - ACE_SSL_Data_File (const char *file_name, - int type = SSL_FILETYPE_PEM); - // Contructor from a file name and the file type. - - // Default dtor, cpy ctor and operator= - - const char *file_name (void) const; - // The file name - - int type (void) const; - // The type - -private: - ACE_CString file_name_; - // The file name - - int type_; - // The type, used by the SSL library to parse the file contents. -}; - -// **************************************************************** - -class ACE_SSL_Export ACE_SSL_Context -{ - friend void ACE_SSL_locking_callback (int, int, const char *, int); - - // = TITLE - // A wrapper for the ACE_SSL_Context class. - // - // = DESCRIPTION - // This class provides a wrapper for the SSL_CTX data structure. - // Since most applications have a single SSL_CTX structure, this - // class can be used as a singleton. - -public: - - enum { - INVALID_METHOD = -1, - SSLv2_client = 1, - SSLv2_server, - SSLv2, - SSLv3_client, - SSLv3_server, - SSLv3, - SSLv23_client, - SSLv23_server, - SSLv23, - TLSv1_client, - TLSv1_server, - TLSv1 - }; - - ACE_SSL_Context (); - // Constructor - - ~ACE_SSL_Context (void); - // Destructor - - static ACE_SSL_Context *instance (void); - // The Singleton context, the SSL components use the singleton if - // nothing else is available. - - int set_mode (int mode = ACE_SSL_Context::SSLv3); - // Set the CTX mode. The mode can be set only once, afterwards the - // function has no effect and returns -1. - // Once the mode is set the underlying SSL_CTX is initialized and - // the class can be used. - // If the mode is not set, then the class automatically initializes - // itself to the default mode. - - int get_mode (void) const; - // @@ John, you need to document each function or at least each - // group of functions. Also remember to follow the ACE guidelines, - // this includes: - // - a space between the function name and the '(' starting its - // argument list. - // - a single space after the return value - // - Using const where appropriate - // - // You may not like the style (i don't) but it is more important - // that we all use the same than keeping each one of us happy. - - SSL_CTX *context (void); - // Get the SSL context - - int private_key_type (void) const; - const char *private_key_file_name (void) const; - // Get the file name and file format used for the private key - - int private_key (const char *file_name, - int type = SSL_FILETYPE_PEM); - // Set the private key file. - - int verify_private_key (void); - // Verify if the private key is valid - - int certificate_type (void) const; - const char *certificate_file_name (void) const; - // Get the file name and file format used for the certificate file - - int certificate (const char *file_name, - int type = SSL_FILETYPE_PEM); - // Set the certificate file. - - void default_verify_mode (int mode); - int default_verify_mode (void) const; - // Set and query the default verify mode for this context, it is - // inherited by all the ACE_SSL objects created using the context. - // It can be overriden on a per-ACE_SSL object. - -private: - void check_context (void); - // Verify if the context has been initialized or not. - - void ssl_library_init (); - void ssl_library_fini (); - // @@ More to document - - // = Prevent assignment and initialization. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_SSL_Context &)) - ACE_UNIMPLEMENTED_FUNC (ACE_SSL_Context (const ACE_SSL_Context &)) - -private: - // @@ Carlos, I protected this variable with an ACE_GUARD, just like - // what we do for the orb_init_count_ variable in - // tao/ORB.cpp. The code isn't pretty but it should suffice - // until the SSL context is stored in a Singleton. - // -Ossama - - SSL_CTX *context_; - // The SSL_CTX structure - - int mode_; - // Cache the mode so we can answer fast - - ACE_SSL_Data_File private_key_; - ACE_SSL_Data_File certificate_; - // The private key and certificate file - - int default_verify_mode_; - // The default verify mode. - - static int library_init_count_; - // Reference count of the number of times the ACE_SSL_Context was - // initialized. - - // @@ This should also be done with a singleton, otherwise it is not - // thread safe and/or portable to some weird platforms... - -#ifdef ACE_HAS_THREADS - static ACE_mutex_t * lock_; - // Array of mutexes used internally by OpenSSL when the SSL - // application is multithreaded. - - // @@ This should also be managed by a singleton. -#endif -}; - -#if defined(__ACE_INLINE__) -#include "SSL_Context.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_HAS_SSL */ - -#endif /* ACE_SSL_CONTEXT_H */ diff --git a/ace/SSL/SSL_Context.i b/ace/SSL/SSL_Context.i deleted file mode 100644 index b7068ff110e..00000000000 --- a/ace/SSL/SSL_Context.i +++ /dev/null @@ -1,87 +0,0 @@ -// -*- C++ -*- -// $Id$ -// - -ACE_INLINE -ACE_SSL_Data_File::ACE_SSL_Data_File (void) - : type_ (-1) -{ -} - -ACE_INLINE -ACE_SSL_Data_File::ACE_SSL_Data_File (const char *file_name, - int type) - : file_name_ (file_name), - type_ (type) -{ -} - -ACE_INLINE const char* -ACE_SSL_Data_File::file_name (void) const -{ - return this->file_name_.c_str (); -} - -ACE_INLINE int -ACE_SSL_Data_File::type (void) const -{ - return this->type_; -} - -// **************************************************************** - -ACE_INLINE ACE_SSL_Context* -ACE_SSL_Context::instance (void) -{ - return ACE_Singleton::instance (); -} - -ACE_INLINE void -ACE_SSL_Context::check_context (void) -{ - if (this->context_ == 0) - this->set_mode (); -} - -ACE_INLINE SSL_CTX * -ACE_SSL_Context::context (void) -{ - this->check_context (); - return this->context_; -} - -ACE_INLINE int -ACE_SSL_Context::private_key_type (void) const -{ - return this->private_key_.type (); -} - -ACE_INLINE const char* -ACE_SSL_Context::private_key_file_name (void) const -{ - return this->private_key_.file_name (); -} - -ACE_INLINE int -ACE_SSL_Context::certificate_type (void) const -{ - return this->certificate_.type (); -} - -ACE_INLINE const char* -ACE_SSL_Context::certificate_file_name (void) const -{ - return this->certificate_.file_name (); -} - -ACE_INLINE void -ACE_SSL_Context::default_verify_mode (int mode) -{ - this->default_verify_mode_ = mode; -} - -ACE_INLINE int -ACE_SSL_Context::default_verify_mode (void) const -{ - return this->default_verify_mode_; -} diff --git a/ace/SSL/SSL_Context.inl b/ace/SSL/SSL_Context.inl deleted file mode 100644 index b7068ff110e..00000000000 --- a/ace/SSL/SSL_Context.inl +++ /dev/null @@ -1,87 +0,0 @@ -// -*- C++ -*- -// $Id$ -// - -ACE_INLINE -ACE_SSL_Data_File::ACE_SSL_Data_File (void) - : type_ (-1) -{ -} - -ACE_INLINE -ACE_SSL_Data_File::ACE_SSL_Data_File (const char *file_name, - int type) - : file_name_ (file_name), - type_ (type) -{ -} - -ACE_INLINE const char* -ACE_SSL_Data_File::file_name (void) const -{ - return this->file_name_.c_str (); -} - -ACE_INLINE int -ACE_SSL_Data_File::type (void) const -{ - return this->type_; -} - -// **************************************************************** - -ACE_INLINE ACE_SSL_Context* -ACE_SSL_Context::instance (void) -{ - return ACE_Singleton::instance (); -} - -ACE_INLINE void -ACE_SSL_Context::check_context (void) -{ - if (this->context_ == 0) - this->set_mode (); -} - -ACE_INLINE SSL_CTX * -ACE_SSL_Context::context (void) -{ - this->check_context (); - return this->context_; -} - -ACE_INLINE int -ACE_SSL_Context::private_key_type (void) const -{ - return this->private_key_.type (); -} - -ACE_INLINE const char* -ACE_SSL_Context::private_key_file_name (void) const -{ - return this->private_key_.file_name (); -} - -ACE_INLINE int -ACE_SSL_Context::certificate_type (void) const -{ - return this->certificate_.type (); -} - -ACE_INLINE const char* -ACE_SSL_Context::certificate_file_name (void) const -{ - return this->certificate_.file_name (); -} - -ACE_INLINE void -ACE_SSL_Context::default_verify_mode (int mode) -{ - this->default_verify_mode_ = mode; -} - -ACE_INLINE int -ACE_SSL_Context::default_verify_mode (void) const -{ - return this->default_verify_mode_; -} diff --git a/ace/SSL/SSL_Export.h b/ace/SSL/SSL_Export.h deleted file mode 100644 index 4c42722d80b..00000000000 --- a/ace/SSL/SSL_Export.h +++ /dev/null @@ -1,36 +0,0 @@ -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by -// ${ACE_ROOT}/GenExportH.BAT -// ------------------------------ -#ifndef ACE_SSL_EXPORT_H -#define ACE_SSL_EXPORT_H - -#include "ace/OS.h" - -#if !defined (ACE_SSL_HAS_DLL) -#define ACE_SSL_HAS_DLL 1 -#endif /* ! ACE_SSL_HAS_DLL */ - -#if defined (ACE_SSL_HAS_DLL) -# if (ACE_SSL_HAS_DLL == 1) -# if defined (ACE_SSL_BUILD_DLL) -# define ACE_SSL_Export ACE_Proper_Export_Flag -# define ACE_SSL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# else -# define ACE_SSL_Export ACE_Proper_Import_Flag -# define ACE_SSL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# endif /* ACE_SSL_BUILD_DLL */ -# else -# define ACE_SSL_Export -# define ACE_SSL_SINGLETON_DECLARATION(T) -# endif /* ! ACE_SSL_HAS_DLL == 1 */ -#else -# define ACE_SSL_Export -# define ACE_SSL_SINGLETON_DECLARATION(T) -#endif /* ACE_SSL_HAS_DLL */ - -#endif /* ACE_SSL_EXPORT_H */ - -// End of auto generated file. diff --git a/ace/SSL/SSL_SOCK.cpp b/ace/SSL/SSL_SOCK.cpp deleted file mode 100644 index f6b1f9a48b8..00000000000 --- a/ace/SSL/SSL_SOCK.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- -// $Id$ - - -#include "SSL_SOCK.h" - -#if defined (ACE_HAS_SSL) - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "SSL_SOCK.i" -#endif - -ACE_RCSID(ACE_SSL, SSL_SOCK, "$Id$") - - -ACE_SSL_SOCK::ACE_SSL_SOCK (void) -{ - ACE_TRACE ("ACE_SSL_SOCK::ACE_SSL_SOCK"); -} - -ACE_SSL_SOCK::~ACE_SSL_SOCK (void) -{ - ACE_TRACE ("ACE_SSL_SOCK::~ACE_SSL_SOCK"); -} - -int -ACE_SSL_SOCK::enable (int value) const -{ - ACE_TRACE ("ACE_SSL_SOCK::enable"); - - switch (value) - { -#ifdef SIGURG - case SIGURG: - case ACE_SIGURG: -#endif /* SIGURG */ - case SIGIO: - case ACE_SIGIO: - case ACE_CLOEXEC: - ACE_NOTSUP_RETURN (-1); - case ACE_NONBLOCK: - return ACE_IPC_SAP::enable (value); - default: - return -1; - } - return 0; -} - -int -ACE_SSL_SOCK::disable (int value) const -{ - ACE_TRACE("ACE_SSL_SOCK::disable"); - switch (value) - { -#ifdef SIGURG - case SIGURG: - case ACE_SIGURG: -#endif /* SIGURG */ - case SIGIO: - case ACE_SIGIO: - case ACE_CLOEXEC: - ACE_NOTSUP_RETURN (-1); - case ACE_NONBLOCK: - return ACE_IPC_SAP::disable (value); - default: - return -1; - } - return 0; -} - - -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_SOCK.h b/ace/SSL/SSL_SOCK.h deleted file mode 100644 index 98a7a785f2f..00000000000 --- a/ace/SSL/SSL_SOCK.h +++ /dev/null @@ -1,92 +0,0 @@ -// -*- C++ -*- -// $Id$ - -//============================================================================ -// -// = LIBRARY -// ACE_SSL -// -// = FILENAME -// SSL_SOCK.h -// -// = AUTHOR -// Ossama Othman -// -//============================================================================ - -#ifndef ACE_SSL_SOCK_H -#define ACE_SSL_SOCK_H - -#include "ace/pre.h" - -#include "ace/SOCK.h" - -#include "SSL_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -#if defined (ACE_HAS_TEMPLATE_TYPEDEFS) -# define ACE_SSL_SOCK_ACCEPTOR ACE_SSL_SOCK_Acceptor -# define ACE_SSL_SOCK_CONNECTOR ACE_SSL_SOCK_Connector -# define ACE_SSL_SOCK_STREAM ACE_SSL_SOCK_Stream -#else -# define ACE_SSL_SOCK_ACCEPTOR ACE_SSL_SOCK_Acceptor, ACE_INET_Addr -# define ACE_SSL_SOCK_CONNECTOR ACE_SSL_SOCK_Connector, ACE_INET_Addr -# define ACE_SSL_SOCK_STREAM ACE_SSL_SOCK_Stream, ACE_INET_Addr -#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ - -class ACE_SSL_Export ACE_SSL_SOCK : public ACE_SOCK -{ - // = TITLE - // An abstract class that forms the basis for more specific - // classes, such as and - // . - // Do not instantiate this class. - // - // = DESCRIPTION - // This class provides functions that are common to all of the - // classes. provides the ability - // to get and set socket options, get the local and remote - // addresses, and close the socket. -public: - - ~ACE_SSL_SOCK (void); - // Default destructor. - - // Override ACE_SOCK base class implementations with these SSL - // specific ones. - - int set_option (int level, - int option, - void *optval, - int optlen) const; - int get_option (int level, - int option, - void *optval, - int *optlen) const; - int enable (int value) const; - int disable (int value) const; - void set_handle (ACE_HANDLE); - ACE_HANDLE get_handle (void) const; - int control (int cmd, void *arg) const; - -protected: - - ACE_SSL_SOCK (void); - // Default constructor is private to prevent instances of this class - // from being defined. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "SSL_SOCK.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#include "ace/post.h" -#endif /* ACE_SSL_SOCK_H */ - - - - diff --git a/ace/SSL/SSL_SOCK.i b/ace/SSL/SSL_SOCK.i deleted file mode 100644 index dc21bfbdba1..00000000000 --- a/ace/SSL/SSL_SOCK.i +++ /dev/null @@ -1,64 +0,0 @@ -// -*- C++ -*- -// $Id$ - -ASYS_INLINE void -ACE_SSL_SOCK::set_handle (ACE_HANDLE fd) -{ - this->ACE_SOCK::set_handle (fd); -} - -ASYS_INLINE ACE_HANDLE -ACE_SSL_SOCK::get_handle (void) const -{ - // return this->ssl_ ? (ACE_HANDLE) ::SSL_get_fd (this->ssl_) : ACE_INVALID_HANDLE; - return this->ACE_SOCK::get_handle (); -} - - -ASYS_INLINE int -ACE_SSL_SOCK::control (int cmd, void *arg) const -{ - return ACE_OS::ioctl (this->get_handle (), cmd, arg); -} - -ASYS_INLINE int -ACE_SSL_SOCK::set_option (int level, - int option, - void *optval, - int optlen) const -{ -// switch (option) -// { -// case SO_SNDBUF: -// return ::BIO_set_write_buffer_size (this->io_bio_, *((int *) optval)); -// case SO_RCVCBUF: -// return ::BIO_set_read_buffer_size (this->io_bio_, *((int *) optval)); -// default: - return ACE_OS::setsockopt (this->get_handle (), - level, - option, (char *) optval, - optlen); -// } -} - -// Provides access to the ACE_OS::getsockopt system call. - -ASYS_INLINE int -ACE_SSL_SOCK::get_option (int level, - int option, - void *optval, - int *optlen) const -{ -// switch (option) -// { -// case SO_SNDBUF: -// return ::BIO_get_write_buffer_size (this->io_bio_, *((int *) optval)); -// case SO_RCVCBUF: -// return ::BIO_get_read_buffer_size (this->io_bio_, *((int *) optval)); -// default: - return ACE_OS::getsockopt (this->get_handle (), - level, - option, (char *) optval, - optlen); -// } -} diff --git a/ace/SSL/SSL_SOCK_Acceptor.cpp b/ace/SSL/SSL_SOCK_Acceptor.cpp deleted file mode 100644 index 3d87e859930..00000000000 --- a/ace/SSL/SSL_SOCK_Acceptor.cpp +++ /dev/null @@ -1,226 +0,0 @@ -// -*- C++ -*- -// $Id$ -// - -#include "SSL_SOCK_Acceptor.h" - -#if defined (ACE_HAS_SSL) - -#include - -ACE_ALLOC_HOOK_DEFINE(ACE_SSL_SOCK_Acceptor) - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "SSL_SOCK_Acceptor.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -int -ACE_SSL_SOCK_Acceptor::shared_accept_start (ACE_Time_Value *timeout, - int restart, - int &in_blocking_mode) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::shared_accept_start"); - - ACE_HANDLE handle = this->get_handle (); - - // Handle the case where we're doing a timed . - if (timeout != 0) - { - if (ACE::handle_timed_accept (handle, - timeout, - restart) == -1) - return -1; - else - { - in_blocking_mode = ACE_BIT_DISABLED (ACE::get_flags (handle), - ACE_NONBLOCK); - // Set the handle into non-blocking mode if it's not already - // in it. - if (in_blocking_mode - && ACE::set_flags (handle, - ACE_NONBLOCK) == -1) - return -1; - } - } - - return 0; -} - -int -ACE_SSL_SOCK_Acceptor::shared_accept_finish (ACE_SSL_SOCK_Stream& new_stream, - int in_blocking_mode, - int reset_new_handle) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::shared_accept_finish ()"); - - ACE_HANDLE new_handle = new_stream.get_handle (); - - // Check to see if we were originally in blocking mode, and if so, - // set the 's handle and handle to be in blocking - // mode. - if (in_blocking_mode) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - - // Only disable ACE_NONBLOCK if we weren't in non-blocking mode - // originally. - ACE::clr_flags (this->get_handle (), - ACE_NONBLOCK); - ACE::clr_flags (new_handle, - ACE_NONBLOCK); - } - -#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) - if (reset_new_handle) - // Reset the event association inherited by the new handle. - ::WSAEventSelect ((SOCKET) new_handle, 0, 0); -#else - ACE_UNUSED_ARG (reset_new_handle); -#endif /* ACE_WIN32 */ - - if (new_handle == ACE_INVALID_HANDLE) - return -1; - - return this->ssl_accept (new_stream); -} - -int -ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream) const -{ - if (SSL_is_init_finished (new_stream.ssl ())) - return 0; - - ::SSL_set_accept_state (new_stream.ssl ()); - - int status = ::SSL_accept (new_stream.ssl ()); - if (status <= 0) - { - if (::BIO_sock_should_retry (status)) - { - switch (::SSL_get_error (new_stream.ssl (), status)) - { - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_X509_LOOKUP: - // If blocked, try again. - errno = EWOULDBLOCK; - break; - default: - ERR_print_errors_fp (stderr); - break; - } - } - else - ERR_print_errors_fp (stderr); - - return -1; - } - - return 0; -} - -// General purpose routine for accepting new connections. -int -ACE_SSL_SOCK_Acceptor::accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Addr *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::accept"); - - int in_blocking_mode = 0; - if (this->shared_accept_start (timeout, - restart, - in_blocking_mode) == -1) - return -1; - else - { - // On Win32 the third parameter to must be a NULL - // pointer if we want to ignore the client's address. - int *len_ptr = 0; - sockaddr *addr = 0; - int len = 0; - - if (remote_addr != 0) - { - len = remote_addr->get_size (); - len_ptr = &len; - addr = (sockaddr *) remote_addr->get_addr (); - } - - do - new_stream.set_handle (ACE_OS::accept (this->get_handle (), - addr, - len_ptr)); - while (new_stream.get_handle () == ACE_INVALID_HANDLE - && restart != 0 - && errno == EINTR - && timeout == 0); - - // Reset the size of the addr, which is only necessary for UNIX - // domain sockets. - if (new_stream.get_handle () != ACE_INVALID_HANDLE - && remote_addr != 0) - remote_addr->set_size (len); - } - - return this->shared_accept_finish (new_stream, - in_blocking_mode, - reset_new_handle); -} - -int -ACE_SSL_SOCK_Acceptor::accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Accept_QoS_Params qos_params, - ACE_Addr *remote_addr, - ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::accept"); - - int in_blocking_mode = 0; - if (this->shared_accept_start (timeout, - restart, - in_blocking_mode) == -1) - return -1; - else - { - // On Win32 the third parameter to must be a NULL - // pointer if we want to ignore the client's address. - int *len_ptr = 0; - sockaddr *addr = 0; - int len = 0; - - if (remote_addr != 0) - { - len = remote_addr->get_size (); - len_ptr = &len; - addr = (sockaddr *) remote_addr->get_addr (); - } - - do - new_stream.set_handle (ACE_OS::accept (this->get_handle (), - addr, - len_ptr, - qos_params)); - while (new_stream.get_handle () == ACE_INVALID_HANDLE - && restart != 0 - && errno == EINTR - && timeout == 0); - - // Reset the size of the addr, which is only necessary for UNIX - // domain sockets. - if (new_stream.get_handle () != ACE_INVALID_HANDLE - && remote_addr != 0) - remote_addr->set_size (len); - } - - return this->shared_accept_finish (new_stream, - in_blocking_mode, - reset_new_handle); -} - -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_SOCK_Acceptor.h b/ace/SSL/SSL_SOCK_Acceptor.h deleted file mode 100644 index 96ffa60038a..00000000000 --- a/ace/SSL/SSL_SOCK_Acceptor.h +++ /dev/null @@ -1,136 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_SSL -// -// = FILENAME -// SSL_SOCK_Acceptor.h -// -// = AUTHOR -// John Heitmann and Chris Zimman -// Ossama Othman -// -// ============================================================================ - -#ifndef ACE_SSL_SOCK_ACCEPTOR_H -#define ACE_SSL_SOCK_ACCEPTOR_H - -#include "ace/SOCK_Acceptor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_SSL) - -#include "SSL_SOCK_Stream.h" - -class ACE_SSL_Export ACE_SSL_SOCK_Acceptor : public ACE_SSL_SOCK -{ - // = TITLE - // Defines a factory that creates new s - // passively. - // - // = DESCRIPTION - // The has its own - // which handles virtually all of the socket acceptance. This - // class is a wrapper which only adds the SSL acceptance. -public: - // = Initialization and termination methods. - ACE_SSL_SOCK_Acceptor (void); - // Default constructor. - - ACE_SSL_SOCK_Acceptor (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = PF_INET, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - // Initiate a passive mode ssl/BSD-style acceptor socket. - // is the address that we-re going to listen for - // connections on. - - ACE_SSL_SOCK_Acceptor (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - // Initialize a passive-mode QoS-enabled acceptor socket. Returns 0 - // on success and -1 on failure. - - int open (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = PF_INET, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 0); - // Initiate a passive mode SSL/BSD-style acceptor socket. - // is the address that we-re going to listen for - // connections on. - - int close (void); - - ~ACE_SSL_SOCK_Acceptor (void); - // Default dtor. - - // = Passive connection methods. - int accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; - // Accept a new connection. A of 0 - // means block forever, a of {0, 0} means poll. - // == 1 means "restart if interrupted," i.e., if errno == EINTR. - - int accept (ACE_SSL_SOCK_Stream &new_stream, - ACE_Accept_QoS_Params qos_params, - ACE_Addr *remote_addr = 0, - ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; - // Accept a new connection using the RVSP QoS - // information in . A of 0 means block - // forever, a of {0, 0} means poll. == 1 means - // "restart if interrupted," i.e., if errno == EINTR. - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - typedef ACE_SSL_SOCK_Stream PEER_STREAM; - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - - int shared_accept_start (ACE_Time_Value *timeout, - int restart, - int &in_blocking_mode) const; - // Perform operations that must occur before is - // called. - - int shared_accept_finish (ACE_SSL_SOCK_Stream &new_stream, - int in_blocking_mode, - int reset_new_handle) const; - // Perform operations that must occur after is - // called. - - int ssl_accept (ACE_SSL_SOCK_Stream &new_stream) const; - // Complete SSL passive connection establishment. - -private: - ACE_SOCK_Acceptor acceptor_; - // The BSD-socket workhorse -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "SSL_SOCK_Acceptor.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#endif /* ACE_HAS_SSL */ -#endif /* ACE_SSL_SOCK_ACCEPTOR_H */ - diff --git a/ace/SSL/SSL_SOCK_Acceptor.i b/ace/SSL/SSL_SOCK_Acceptor.i deleted file mode 100644 index c0939202685..00000000000 --- a/ace/SSL/SSL_SOCK_Acceptor.i +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// SSL_SOCK_Acceptor.i - - -// Do nothing routine for constructor. - -ASYS_INLINE -ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor"); -} - -ASYS_INLINE -ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor (const ACE_Addr &local_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) - : acceptor_ (local_sap, - reuse_addr, - protocol_family, - backlog, - protocol) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor"); -} - -ASYS_INLINE -ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) - : acceptor_ (local_sap, - protocolinfo, - g, - flags, - reuse_addr, - protocol_family, - backlog, - protocol) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::ACE_SSL_SOCK_Acceptor"); -} - -ASYS_INLINE int -ACE_SSL_SOCK_Acceptor::open (const ACE_Addr &local_sap, - int reuse_addr, - int protocol_family, - int backlog, - int protocol) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::open"); - if (this->acceptor_.open (local_sap, - reuse_addr, - protocol_family, - backlog, - protocol) != 0) - return -1; - else - this->set_handle (this->acceptor_.get_handle ()); - - return 0; -} - -ASYS_INLINE int -ACE_SSL_SOCK_Acceptor::close (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::close ()"); - return this->acceptor_.close (); -} - -ASYS_INLINE -ACE_SSL_SOCK_Acceptor::~ACE_SSL_SOCK_Acceptor (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Acceptor::~ACE_SSL_SOCK_Acceptor"); -} diff --git a/ace/SSL/SSL_SOCK_Connector.cpp b/ace/SSL/SSL_SOCK_Connector.cpp deleted file mode 100644 index 6fd7fe05509..00000000000 --- a/ace/SSL/SSL_SOCK_Connector.cpp +++ /dev/null @@ -1,300 +0,0 @@ -// -*- C++ -*- -// $Id$ - - -#include "SSL_SOCK_Connector.h" - -#if defined (ACE_HAS_SSL) - -#include "ace/INET_Addr.h" - -#include - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "SSL_SOCK_Connector.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - - -ACE_ALLOC_HOOK_DEFINE(ACE_SSL_SOCK_Connector) - -int -ACE_SSL_SOCK_Connector::shared_connect_start (ACE_SSL_SOCK_Stream &new_stream, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::shared_connect_start"); - - if (local_sap != ACE_Addr::sap_any) - { - sockaddr *laddr = ACE_reinterpret_cast (sockaddr *, - local_sap.get_addr ()); - size_t size = local_sap.get_size (); - - if (ACE_OS::bind (new_stream.get_handle (), - laddr, - size) == -1) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - new_stream.close (); - return -1; - } - } - - // Enable non-blocking, if required. - if (timeout != 0 && new_stream.disable (ACE_NONBLOCK) == -1) - return -1; - else - return 0; -} - -int -ACE_SSL_SOCK_Connector::shared_connect_finish (ACE_SSL_SOCK_Stream &new_stream, - ACE_Time_Value *timeout, - int result) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::shared_connect_finish"); - // Save/restore errno. - ACE_Errno_Guard error (errno); - - if (result == -1 && timeout != 0) - { - // Check whether the connection is in progress. - if (error == EINPROGRESS || error == EWOULDBLOCK) - { - // This expression checks if we were polling. - if (timeout->sec () == 0 - && timeout->usec () == 0) - error = EWOULDBLOCK; - // Wait synchronously using timeout. - else if (this->complete (new_stream, - 0, - timeout) == -1) - error = errno; - else - return 0; - } - } - - // EISCONN is treated specially since this routine may be used to - // check if we are already connected. - if (result != -1 || error == EISCONN) - // Start out with non-blocking disabled on the . - new_stream.disable (ACE_NONBLOCK); - else if (!(error == EWOULDBLOCK || error == ETIMEDOUT)) - new_stream.close (); - - return result; - -} - -int -ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream) -{ - if (SSL_is_init_finished (new_stream.ssl ())) - return 0; - - ::SSL_set_connect_state (new_stream.ssl ()); - - int status = ::SSL_connect (new_stream.ssl ()); - if (status <= 0) - { - if (::BIO_sock_should_retry (status)) - { - switch (::SSL_get_error (new_stream.ssl (), status)) - { - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_X509_LOOKUP: - // If blocked, try again. - errno = EWOULDBLOCK; - break; - default: - ERR_print_errors_fp (stderr); - break; - } - } - else - ERR_print_errors_fp (stderr); - - return -1; - } - - // Start out with non-blocking disabled on the . - new_stream.disable (ACE_NONBLOCK); - - return 0; -} - -int -ACE_SSL_SOCK_Connector::connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::connect"); - - if (this->non_ssl_connect_done_ == 0) - { - if (this->connector_.connect (new_stream.peer (), - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms, - protocol_family, - protocol) == -1) - return -1; - else - { - new_stream.set_handle (new_stream.peer ().get_handle ()); - this->non_ssl_connect_done_ = 1; - } - } - - return this->ssl_connect (new_stream); -} - -int -ACE_SSL_SOCK_Connector::connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int perms, - int protocol_family, - int protocol) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::connect"); - - if (this->non_ssl_connect_done_ == 0) - { - if (this->connector_.connect (new_stream.peer (), - remote_sap, - qos_params, - timeout, - local_sap, - protocolinfo, - g, - flags, - reuse_addr, - perms, - protocol_family, - protocol) == -1) - return -1; - else - { - new_stream.set_handle (new_stream.peer ().get_handle ()); - this->non_ssl_connect_done_ = 1; - } - } - - return this->ssl_connect (new_stream); -} - -// Try to complete a non-blocking connection. - -int -ACE_SSL_SOCK_Connector::complete (ACE_SSL_SOCK_Stream &new_stream, - ACE_Addr *remote_sap, - ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::complete"); - - if (this->non_ssl_connect_done_ == 0) - { - if (this->connector_.complete (new_stream.peer (), - remote_sap, - tv) == -1) - return -1; - else - { - new_stream.set_handle (new_stream.peer ().get_handle ()); - this->non_ssl_connect_done_ = 1; - } - } - - return this->ssl_connect (new_stream); -} - - -ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector ( - ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - int reuse_addr, - int flags, - int perms, - int protocol_family, - int protocol) - : non_ssl_connect_done_ (0) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector"); - if (this->connect (new_stream, - remote_sap, - timeout, - local_sap, - reuse_addr, - flags, - perms, - protocol_family, - protocol) == -1 - && timeout != 0 - && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("%p\n"), - ASYS_TEXT ( - "ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector" - ))); -} - -ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector ( - ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout, - const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int perms, - int protocol_family, - int protocol) - : non_ssl_connect_done_ (0) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector"); - - if (this->connect (new_stream, - remote_sap, - qos_params, - timeout, - local_sap, - protocolinfo, - g, - flags, - reuse_addr, - perms, - protocol_family, - protocol) == -1 - && timeout != 0 - && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("%p\n"), - ASYS_TEXT ( - "ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector" - ))); -} - -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_SOCK_Connector.h b/ace/SSL/SSL_SOCK_Connector.h deleted file mode 100644 index e498ac989c8..00000000000 --- a/ace/SSL/SSL_SOCK_Connector.h +++ /dev/null @@ -1,203 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SSL_SOCK_Connector.h -// -// = AUTHOR -// John Heitmann -// Chris Zimman -// Carlos O'Ryan -// Ossama Othman -// -// ============================================================================ - -#ifndef ACE_SSL_SOCK_CONNECTOR_H -#define ACE_SSL_SOCK_CONNECTOR_H - -#include "SSL_SOCK_Stream.h" -#include "ace/SOCK_Connector.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_SSL) - -class ACE_SSL_Export ACE_SSL_SOCK_Connector -{ - // = TITLE - // Defines a factory that creates new s actively. - // - // = DESCRIPTION - // The doesn't have a socket of its own, - // i.e., it simply "borrows" the one from the ACE_SOCK_Stream - // that's being connected. The reason for this is that the - // underlying socket API doesn't use a "factory" socket to connect - // "data-mode" sockets. Therefore, there's no need to inherit - // from . A nice side-effect of - // this is that 's do not store state so they - // can be used reentrantly in multi-threaded programs. -public: - // = Initialization and termination methods. - ACE_SSL_SOCK_Connector (void); - // Default constructor. - - ACE_SSL_SOCK_Connector (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - - ACE_SSL_SOCK_Connector (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The contains QoS parameters that are passed - // to RSVP. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - - int connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - int reuse_addr = 0, - int flags = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - - int connect (ACE_SSL_SOCK_Stream &new_stream, - const ACE_Addr &remote_sap, - ACE_QoS_Params qos_params, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = ACE_Addr::sap_any, - ACE_Protocol_Info *protocolinfo = 0, - ACE_SOCK_GROUP g = 0, - u_long flags = 0, - int reuse_addr = 0, - int perms = 0, - int protocol_family = PF_INET, - int protocol = 0); - // Actively connect and produce a if things go well. - // The is the address that we are trying to connect - // with. The contains QoS parameters that are passed - // to RSVP. The is the amount of time to wait to connect. - // If it's 0 then we block indefinitely. If *timeout == {0, 0} then - // the connection is done using non-blocking mode. In this case, if - // the connection can't be made immediately the value of -1 is - // returned with . If *timeout > {0, 0} then - // this is the amount of time to wait before timing out. If the - // time expires before the connection is made . The - // is the value of local address to bind to. If it's - // the default value of then the user is letting - // the OS do the binding. If == 1 then the - // is reused, even if it hasn't been cleanedup yet. - - ~ACE_SSL_SOCK_Connector (void); - // Default dtor. - - // = Completion routine. - int complete (ACE_SSL_SOCK_Stream &new_stream, - ACE_Addr *remote_sap = 0, - ACE_Time_Value *timeout = 0); - // Try to complete a non-blocking connection. - // If connection completion is successful then contains - // the connected ACE_SOCK_Stream. If is non-NULL then it - // will contain the address of the connected peer. - - int reset_new_handle (ACE_HANDLE handle); - // Resets any event associations on this handle - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - typedef ACE_SSL_SOCK_Stream PEER_STREAM; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - int shared_connect_start(ACE_SSL_SOCK_Stream &new_stream, - ACE_Time_Value *timeout = 0, - const ACE_Addr &local_sap = 0); - - int shared_connect_finish(ACE_SSL_SOCK_Stream &new_stream, - ACE_Time_Value *timeout = 0, - int result = 0); - - int ssl_connect (ACE_SSL_SOCK_Stream &new_stream); - // Complete SSL active connection establishment. - -private: - ACE_SOCK_Connector connector_; - // The class that does all of the non-secure socket connection. - // It is default contructed, and subsequently used by connect(). - - int non_ssl_connect_done_; - // Set to 1 once basic connection (i.e. prior to SSL handshake) is - // done. This is used primarily during non-blocking connects. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "SSL_SOCK_Connector.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#endif /* ACE_SSL_SOCK_CONNECTOR_H */ -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_SOCK_Connector.i b/ace/SSL/SSL_SOCK_Connector.i deleted file mode 100644 index a7bd94ee422..00000000000 --- a/ace/SSL/SSL_SOCK_Connector.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SSL_SOCK_Connector.i - -#if defined (ACE_HAS_SSL) - -ASYS_INLINE -ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector (void) - : non_ssl_connect_done_ (0) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::ACE_SSL_SOCK_Connector"); -} - -ASYS_INLINE -ACE_SSL_SOCK_Connector::~ACE_SSL_SOCK_Connector (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::~ACE_SSL_SOCK_Connector"); -} - -ASYS_INLINE int -ACE_SSL_SOCK_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::reset_new_handle"); - return this->connector_.reset_new_handle (handle); -} - -ASYS_INLINE void -ACE_SSL_SOCK_Connector::dump (void) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Connector::dump"); -} - -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_SOCK_Stream.cpp b/ace/SSL/SSL_SOCK_Stream.cpp deleted file mode 100644 index 75b1410c870..00000000000 --- a/ace/SSL/SSL_SOCK_Stream.cpp +++ /dev/null @@ -1,482 +0,0 @@ -// -*- C++ -*- -// $Id$ - -#include "ace/Handle_Set.h" - -#if defined (ACE_HAS_SSL) - -#include - -#include "SSL_SOCK_Stream.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "SSL_SOCK_Stream.i" -#endif - -ACE_ALLOC_HOOK_DEFINE(ACE_SSL_SOCK_Stream) - -ssize_t -ACE_SSL_SOCK_Stream::sendv (const iovec iov[], - size_t n) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::sendv"); - - // Mimics ACE_OS::sendv. - int result = 0; - ssize_t bytes_sent = 0; - for (size_t i = 0; i < n && result != -1; i++) - { - result = this->send (iov[i].iov_base, - iov[i].iov_len); - bytes_sent += iov[i].iov_len; // Gets ignored on error anyway - } - - if (result == -1) - bytes_sent = -1; - - return bytes_sent; -} - -ssize_t -ACE_SSL_SOCK_Stream::recvv (iovec *io_vec, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recvv"); - - // From . -#if defined (FIONREAD) - ACE_Handle_Set handle_set; - handle_set.reset (); - handle_set.set_bit (this->get_handle ()); - - io_vec->iov_base = 0; - - // Check the status of the current socket. - switch (ACE_OS::select (int (this->get_handle ()) + 1, - handle_set, - 0, 0, - timeout)) - { - case -1: - return -1; - /* NOTREACHED */ - case 0: - errno = ETIME; - return -1; - /* NOTREACHED */ - default: - // Goes fine, fallthrough to get data - break; - } - - u_long inlen; - - - if (ACE_OS::ioctl (this->get_handle (), - FIONREAD, - (u_long *) &inlen) == -1) - return -1; - else if (inlen > 0) - { - ACE_NEW_RETURN (io_vec->iov_base, - char[inlen], - -1); - io_vec->iov_len = this->recv (io_vec->iov_base, - inlen); - return io_vec->iov_len; - } - else - return 0; -#else - ACE_UNUSED_ARG (io_vec); - ACE_UNUSED_ARG (timeout); - ACE_NOTSUP_RETURN (-1); -#endif /* FIONREAD */ -} - -ssize_t -ACE_SSL_SOCK_Stream::send (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - - if (flags) - ACE_NOTSUP_RETURN (-1); - - // Mimics . - if (timeout == 0) - return this->send (buf, len); - - int val = 0; - if (ACE::enter_send_timedwait (this->get_handle (), - timeout, - val) == -1) - return -1; - else - { - ssize_t bytes_transferred = this->send (buf, len); - ACE::restore_non_blocking_mode (this->get_handle (), val); - return bytes_transferred; - } -} - -ssize_t -ACE_SSL_SOCK_Stream::recv (void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - - // Mimics code in . - int peek = 0; - - if (flags) - { - if ((flags | MSG_PEEK) == MSG_PEEK) - peek = 1; - else - ACE_NOTSUP_RETURN (-1); - } - - if (timeout == 0) - return this->recv (buf, n, flags); - { - int val = 0; - if (ACE::enter_recv_timedwait (this->get_handle (), - timeout, - val) == -1) - return -1; - else - { - ssize_t bytes_transferred = this->recv (buf, n, flags); - ACE::restore_non_blocking_mode (this->get_handle (), val); - return bytes_transferred; - } - } -} - - -ssize_t -ACE_SSL_SOCK_Stream::send (size_t n, - ...) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - - // Mimics . - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, - iovec[total_tuples], - -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, ssize_t); - } - - ssize_t result = this->sendv (iovp, - total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -ssize_t -ACE_SSL_SOCK_Stream::recv (size_t n, - ...) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - size_t total_tuples = n / 2; - va_list argp; - va_start (argp, n); - - ssize_t result = 0; - ssize_t bytes_recv = 0; - for (size_t i = 0; i < total_tuples; i++) - { - result = this->recv_n (va_arg (argp, char *), va_arg (argp, ssize_t)); - if (result == -1) - return -1; - bytes_recv += result; - } - - va_end (argp); - return bytes_recv; -} - -ssize_t -ACE_SSL_SOCK_Stream::send_n (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n"); - - //no support for send flags in SSL - if (flags != 0) - ACE_NOTSUP_RETURN (-1); - - /* This code mimics ACE::send_n */ - // Total number of bytes written. - size_t bytes_transferred = 0; - - // Actual number of bytes written in each attempt - ssize_t n = 0; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - n = this->send ((const char*) buf + bytes_transferred, - len - bytes_transferred, - flags, - timeout); - - if (n < 0) - { - if (errno == EWOULDBLOCK) - { - // If blocked, try again. - n = 0; - continue; - } - else - return -1; - } - else if (n == 0) - break; - } - - return bytes_transferred; -} - -ssize_t -ACE_SSL_SOCK_Stream::recv_n (void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n"); - - if (flags != 0) - { - if ((flags | MSG_PEEK) != MSG_PEEK) - ACE_NOTSUP_RETURN (-1); - } - - size_t bytes_transferred = 0; - ssize_t n = 0; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - n = this->recv ((char*) buf + bytes_transferred, - len - bytes_transferred, - flags, - timeout); - - if (n < 0) - { - if (errno == EWOULDBLOCK) - { - // If blocked, try again. - n = 0; - continue; - } - else - return -1; - } - else if (n == 0) - break; - } - - return bytes_transferred; -} - -ssize_t -ACE_SSL_SOCK_Stream::recv_n (void *buf, int len, int flags) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n"); - - if (flags != 0) - { - if ((flags | MSG_PEEK) != MSG_PEEK) - ACE_NOTSUP_RETURN (-1); - } - - ssize_t bytes_transferred = 0; - ssize_t n = 0; - - for (bytes_transferred = 0; - bytes_transferred < len; - bytes_transferred += n) - { - n = this->recv ((char*) buf + bytes_transferred, - len - bytes_transferred, - flags); - - if (n < 0) - { - if (errno == EWOULDBLOCK) - { - // If blocked, try again. - n = 0; - continue; - } - else - return -1; - } - else if (n == 0) - break; - } - - return bytes_transferred; -} - -ssize_t -ACE_SSL_SOCK_Stream::send_n (const void *buf, int len, int flags) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n"); - - // Send flags are unsupported in SSL - if (flags != 0) - ACE_NOTSUP_RETURN (-1); - - /* The following code mimics */ - size_t bytes_transferred = 0; - ssize_t n = 0; - - for (bytes_transferred = 0; - bytes_transferred < (size_t) len; - bytes_transferred += n) - { - n = this->send ((const char*) buf + bytes_transferred, - len - bytes_transferred, - flags); - - if (n < 0) - { - if (errno == EWOULDBLOCK) - { - // If blocked, try again. - n = 0; - continue; - } - else - return -1; - } - else if (n == 0) - break; - } - - return bytes_transferred; -} - - -//Taken from OS.cpp, writev () -ssize_t -ACE_SSL_SOCK_Stream::sendv_n (const iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::sendv_n"); - size_t length = 0; - size_t i; - - // Determine the total length of all the buffers in . - for (i = 0; i < n; i++) - if (ACE_static_cast (const int, iov[i].iov_len) < 0) - return -1; - else - length += iov[i].iov_len; - - char *buf; - -# if defined (ACE_HAS_ALLOCA) - buf = (char *) alloca (length); -# else - ACE_NEW_RETURN (buf, - char[length], - -1); -# endif /* !defined (ACE_HAS_ALLOCA) */ - - char *ptr = buf; - - for (i = 0; i < n; i++) - { - ACE_OS::memcpy (ptr, iov[i].iov_base, iov[i].iov_len); - ptr += iov[i].iov_len; - } - - ssize_t result = this->send_n (buf, length); -# if !defined (ACE_HAS_ALLOCA) - delete [] buf; -# endif /* !defined (ACE_HAS_ALLOCA) */ - return result; -} - -// Taken straight from OS.cpp, readv () -ssize_t -ACE_SSL_SOCK_Stream::recvv_n (iovec iov[], size_t n) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recvv_n"); - ssize_t length = 0; - size_t i; - - for (i = 0; i < n; i++) - if (ACE_static_cast (int, iov[i].iov_len) < 0) - return -1; - else - length += iov[i].iov_len; - - char *buf; -# if defined (ACE_HAS_ALLOCA) - buf = (char *) alloca (length); -# else - ACE_NEW_RETURN (buf, - char[length], - -1); -# endif /* !defined (ACE_HAS_ALLOCA) */ - - length = this->recv_n (buf, length); - - if (length != -1) - { - char *ptr = buf; - int copyn = length; - - for (i = 0; - i < n && copyn > 0; - i++) - { - ACE_OS::memcpy (iov[i].iov_base, ptr, - // iov_len is int on some platforms, size_t - // on others - copyn > (int) iov[i].iov_len - ? (size_t) iov[i].iov_len - : (size_t) copyn); - ptr += iov[i].iov_len; - copyn -= iov[i].iov_len; - } - } - -# if !defined (ACE_HAS_ALLOCA) - delete [] buf; -# endif /* !defined (ACE_HAS_ALLOCA) */ - return length; -} - - -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_SOCK_Stream.h b/ace/SSL/SSL_SOCK_Stream.h deleted file mode 100644 index 983d235be83..00000000000 --- a/ace/SSL/SSL_SOCK_Stream.h +++ /dev/null @@ -1,252 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_SSL -// -// = FILENAME -// SSL_SOCK_Stream.h -// -// = AUTHOR -// John Heitmann -// Carlos O'Ryan -// Ossama Othman -// -// ============================================================================ - -#ifndef ACE_SSL_SOCK_STREAM_H -#define ACE_SSL_SOCK_STREAM_H - -#include "ace/SOCK_Stream.h" - -#if defined (ACE_HAS_SSL) - -#include - -#include "ace/Synch_T.h" - -#include "SSL_SOCK.h" -#include "SSL_Context.h" - - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_SSL_Export ACE_SSL_SOCK_Stream : public ACE_SSL_SOCK -{ - // = TITLE - // Defines methods in the abstraction. - // - // = DESCRIPTION - // This adds SSL functionality to an interface by - // wrapping around an implementation. - // - - friend class ACE_SSL_SOCK_Connector; - friend class ACE_SSL_SOCK_Acceptor; - -public: - // = Initialization and termination functions. - - ACE_SSL_SOCK_Stream (ACE_SSL_Context *context = - ACE_SSL_Context::instance ()); - // Constructor - - ~ACE_SSL_SOCK_Stream (void); - // Destructor - - ssize_t send (const void *buf, - size_t n, - int flags) const; - // Send an byte buffer to the ssl socket using - // the semantics of . ACE+SSL supports no - // flags for sending at this time. - - ssize_t recv (void *buf, - size_t n, - int flags) const; - // Recv an byte buffer from the ssl socket using - // the semantics of . ACE+SSL supports MSG_PEEK, - // but no other flags at this time. - - - ssize_t send (const void *buf, - size_t n) const; - // Send an byte buffer to the ssl socket using - // the semantics of . - - ssize_t recv (void *buf, - size_t n) const; - // Recv an byte buffer from the ssl socket using - // the semantics of . - - ssize_t sendv (const iovec iov[], - size_t n) const; - // Send an of size to the ssl socket. - - - ssize_t recvv (iovec *io_vec, - const ACE_Time_Value *timeout = 0) const; - // Allows a client to read from a socket without having to provide a - // buffer to read. This method determines how much data is in the - // socket, allocates a buffer of this size, reads in the data, and - // returns the number of bytes read. The caller is responsible for - // deleting the member in the field of using - // delete [] io_vec->iov_base. - - - ssize_t send (const void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) const; - // Wait to to amount of time to send up to bytes into - // (uses the call). If times out - // a -1 is returned with . If it succeeds the - // number of bytes sent is returned. No flags are supported. - - ssize_t recv (void *buf, - size_t n, - int flags, - const ACE_Time_Value *timeout) const; - // Wait up to amount of time to receive up to bytes - // into (uses the call). If times - // out a -1 is returned with . If it succeeds the - // number of bytes received is returned. MSG_PEEK is the only - // supported flag. - - ssize_t send (const void *buf, - size_t n, - const ACE_Time_Value *timeout) const; - // Wait to to amount of time to send up to bytes into - // (uses the call). If times out - // a -1 is returned with . If it succeeds the - // number of bytes sent is returned. - - ssize_t recv (void *buf, - size_t n, - const ACE_Time_Value *timeout) const; - // Wait up to amount of time to receive up to bytes - // into (uses the call). If times - // out a -1 is returned with . If it succeeds the - // number of bytes received is returned. - - ssize_t send (size_t n, - ...) const; - // Send varargs messages to the connected ssl socket. - - ssize_t recv (size_t n, - ...) const; - // Recv varargs messages to the connected ssl socket. - - ssize_t send_n (const void *buf, int n) const; - // Send bytes, keep trying until are sent. - - ssize_t recv_n (void *buf, int n) const; - // Recv bytes, keep trying until are received. - - // = In the following four methods, only MSG_PEEK is supported - // for recv_n, and no flags are supported for send_n. - ssize_t send_n (const void *buf, int n, int flags) const; - // Send bytes, keep trying until are sent. - - ssize_t recv_n (void *buf, int n, int flags) const; - // Recv bytes, keep trying until are sent. - - ssize_t send_n (const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) const; - // Try to send exactly bytes into (uses - // the call). If blocks for longer than the - // number of bytes actually sent is returned with . - // If a timeout does not occur, return (i.e., the - // number of bytes requested to be sent). - - ssize_t recv_n (void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout) const; - // Try to recv exactly bytes into (uses - // the call). The indicates how long - // to blocking trying to receive. If == 0, the caller - // will block until action is possible, else will wait until the - // relative time specified in * elapses). If blocks - // for longer than the number of bytes actually read is - // returned with . If a timeout does not occur, - // return (i.e., the number of bytes requested to be - // read). - - ssize_t sendv_n (const iovec iov[], - size_t n) const; - // Send an of size to the connected socket. - // Will block until all bytes are sent or an error - // occurs. - - ssize_t recvv_n (iovec iov[], - size_t n) const; - // Receive an of size to the connected socket. - - - // = Selectively close endpoints. - int close_reader (void); - // Close down the reader. - - int close_writer (void); - // Close down the writer. - - int close (void); - //Close down the socket. - - // = Meta-type info - typedef ACE_INET_Addr PEER_ADDR; - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - ACE_SSL_Context *context (void) const; - // Return a pointer to the underlying SSL context. - - void set_handle (ACE_HANDLE fd); - // Overridden set_handle() method. - // - // Only an ACE_SSL_SOCK_Acceptor or ACE_SSL_SOCK_Connector should - // access this method since some state in the underlying data - // structure is set during SSL connection establishment. - -protected: - - SSL *ssl (void) const; - // Return a pointer to the underlying SSL structure. - - - - ACE_SOCK_Stream & peer (void); - // Return the underlying which SSL runs atop of. - -private: - - // = Prevent assignment and initialization. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_SSL_SOCK_Stream &)) - ACE_UNIMPLEMENTED_FUNC (ACE_SSL_SOCK_Stream (const ACE_SSL_SOCK_Stream &)) - -protected: - - ACE_SSL_Context *context_; - // The SSL context. - - SSL *ssl_; - // The SSL session. - - ACE_SOCK_Stream stream_; - // The stream which works under the ssl connection. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "SSL_SOCK_Stream.i" -#endif /* ACE_LACKS_INLINE_FUNCTIONS */ - -#endif /* ACE_SSL_SOCK_STREAM_H */ -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/SSL_SOCK_Stream.i b/ace/SSL/SSL_SOCK_Stream.i deleted file mode 100644 index 0683b438111..00000000000 --- a/ace/SSL/SSL_SOCK_Stream.i +++ /dev/null @@ -1,272 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// SOCK_Stream.i - -#if defined (ACE_HAS_SSL) - -ASYS_INLINE void -ACE_SSL_SOCK_Stream::set_handle (ACE_HANDLE fd) -{ - if (this->ssl_ == 0) - { - this->ACE_SSL_SOCK::set_handle (ACE_INVALID_HANDLE); - return; - } - else - { - (void) ::SSL_set_fd (this->ssl_, (int) fd); - this->ACE_SSL_SOCK::set_handle (fd); - this->stream_.set_handle (fd); - } -} - -ASYS_INLINE -ACE_SSL_SOCK_Stream::ACE_SSL_SOCK_Stream (ACE_SSL_Context *context) - : context_ (context == 0 ? ACE_SSL_Context::instance () : context), - ssl_ (::SSL_new (this->context_->context ())) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::ACE_SSL_SOCK_Stream"); - - if (this->ssl_ == 0) - ACE_ERROR ((LM_ERROR, - "(%P|%t) ACE_SSL_SOCK_Stream - cannot allocate new " - "SSL structure%p\n", - "")); - - ::SSL_set_verify (this->ssl_, - this->context_->default_verify_mode (), - 0); -} - -ASYS_INLINE -ACE_SSL_SOCK_Stream::~ACE_SSL_SOCK_Stream (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::~ACE_SSL_SOCK_Stream"); - - ::SSL_free (this->ssl_); - this->ssl_ = 0; - - // @@ Question: should we reference count the Context object or - // leave that to the application developer? We do not reference - // count reactors (for example) and following some simple rules - // seems to work fine! -} - -ASYS_INLINE ssize_t -ACE_SSL_SOCK_Stream::send (const void *buf, - size_t n, - int flags) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - - // No send flags are supported in SSL. - if (flags != 0) - ACE_NOTSUP_RETURN (-1); - - int status = ::SSL_write (this->ssl_, - ACE_static_cast (const char*, buf), - n); - - if (status <= 0) - { - switch (::SSL_get_error (this->ssl_, n)) - { - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_X509_LOOKUP: - errno = EWOULDBLOCK; - break; - default: - ERR_print_errors_fp (stderr); - break; - } - } - - return status; -} - -ASYS_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv (void *buf, - size_t n, - int flags) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - - if (flags) - { - if (ACE_BIT_ENABLED (flags, MSG_PEEK)) - return ::SSL_peek (this->ssl_, - ACE_static_cast (char*, buf), - n); - else - ACE_NOTSUP_RETURN (-1); - } - - int status = ::SSL_read (this->ssl_, - ACE_static_cast (char *, buf), - n); - if (status <= 0) - { - switch (::SSL_get_error (this->ssl_, n)) - { - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_X509_LOOKUP: - errno = EWOULDBLOCK; - break; - default: - ERR_print_errors_fp (stderr); - break; - } - } - - return status; -} - -ASYS_INLINE ssize_t -ACE_SSL_SOCK_Stream::send (const void *buf, - size_t n) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - - int status = ::SSL_write (this->ssl_, - ACE_static_cast (const char *, buf), - n); - - if (status <= 0) - { - switch (::SSL_get_error (this->ssl_, n)) - { - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_X509_LOOKUP: - errno = EWOULDBLOCK; - break; - default: - ERR_print_errors_fp (stderr); - break; - } - } - - return status; -} - -ASYS_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv (void *buf, - size_t n) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - - int status = ::SSL_read (this->ssl_, - ACE_static_cast (char*, buf), - n); - - if (status <= 0) - { - switch (::SSL_get_error (this->ssl_, n)) - { - case SSL_ERROR_WANT_WRITE: - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_X509_LOOKUP: - errno = EWOULDBLOCK; - break; - default: - ERR_print_errors_fp (stderr); - break; - } - } - - return status; -} - -ASYS_INLINE ssize_t -ACE_SSL_SOCK_Stream::send (const void *buf, - size_t len, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send"); - return this->send (buf, len, 0, timeout); -} - -ASYS_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv (void *buf, - size_t n, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv"); - return this->recv (buf, n, 0, timeout); -} - -ASYS_INLINE ssize_t -ACE_SSL_SOCK_Stream::recv_n (void *buf, int buf_size) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::recv_n"); - return this->recv_n (buf, buf_size, 0); -} - -ASYS_INLINE ssize_t -ACE_SSL_SOCK_Stream::send_n (const void *buf, int len) const -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::send_n"); - return this->send_n (buf, len, 0); -} - -ASYS_INLINE int -ACE_SSL_SOCK_Stream::close_reader (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::close_reader"); - return this->stream_.close_reader (); -} - -ASYS_INLINE int -ACE_SSL_SOCK_Stream::close_writer (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::close_writer"); - return this->stream_.close_writer (); -} - -ASYS_INLINE int -ACE_SSL_SOCK_Stream::close (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::close"); - - if (this->ssl_ == 0) - return -1; - - // SSL_shutdown() returns 1 on successful shutdown of the SSL - // connection, not 0. - if (::SSL_shutdown (this->ssl_) != 1) - { - // Save/restore errno - ACE_Errno_Guard error (errno); - (void) this->stream_.close (); - - return -1; - } - - return this->stream_.close (); -} - -ASYS_INLINE ACE_SOCK_Stream & -ACE_SSL_SOCK_Stream::peer (void) -{ - ACE_TRACE ("ACE_SSL_SOCK_Stream::peer"); - return this->stream_; -} - -ASYS_INLINE ACE_SSL_Context * -ACE_SSL_SOCK_Stream::context (void) const -{ - return this->context_; -} - -ASYS_INLINE SSL * -ACE_SSL_SOCK_Stream::ssl (void) const -{ - return this->ssl_; -} - - - -#endif /* ACE_HAS_SSL */ diff --git a/ace/SSL/sslconf.h b/ace/SSL/sslconf.h deleted file mode 100644 index b81721b889a..00000000000 --- a/ace/SSL/sslconf.h +++ /dev/null @@ -1,37 +0,0 @@ -// -*- C++ -*- -// $Id$ -// ============================================================================ -// -// = LIBRARY -// ACE_SSL -// -// = FILENAME -// sslconf.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - - -#ifndef ACE_SSLCONF_H -#define ACE_SSLCONF_H - -#if !defined (ACE_DEFAULT_SSL_CERT_FILE) -#define ACE_DEFAULT_SSL_CERT_FILE "/etc/ssl/cert.pem" -#endif /* ACE_DEFAULT_SSL_CERT_FILE */ - -#if !defined (ACE_DEFAULT_SSL_CERT_DIR) -#define ACE_DEFAULT_SSL_CERT_DIR "/etc/ssl/certs" -#endif /* ACE_DEFAULT_SSL_CERT_DIR */ - -#if !defined (ACE_SSL_CERT_FILE_ENV) -#define ACE_SSL_CERT_FILE_ENV "SSL_CERT_FILE" -#endif /* ACE_SSL_CERT_FILE_ENV */ - -#if !defined (ACE_SSL_CERT_DIR_ENV) -#define ACE_SSL_CERT_DIR_ENV "SSL_CERT_DIR" -#endif /* ACE_SSL_CERT_DIR_ENV */ - -#endif /* ACE_SSLCONF_H */ - diff --git a/ace/SString.cpp b/ace/SString.cpp deleted file mode 100644 index c53e826fb4d..00000000000 --- a/ace/SString.cpp +++ /dev/null @@ -1,984 +0,0 @@ -// $Id$ - -#include "ace/Malloc.h" -#if !defined (ACE_HAS_WINCE) -# include "ace/Service_Config.h" -#endif /* !ACE_HAS_WINCE */ -#include "ace/SString.h" -#include "ace/Auto_Ptr.h" - -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -# include "ace/streams.h" -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -#if !defined (__ACE_INLINE__) -#include "ace/SString.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, SString, "$Id$") - -ACE_Tokenizer::ACE_Tokenizer (ACE_TCHAR *buffer) - : buffer_ (buffer), - index_ (0), - preserves_index_ (0), - delimiter_index_ (0) -{ -} - -int -ACE_Tokenizer::delimiter (ACE_TCHAR d) -{ - if (delimiter_index_ == MAX_DELIMITERS) - return -1; - - delimiters_[delimiter_index_].delimiter_ = d; - delimiters_[delimiter_index_].replace_ = 0; - delimiter_index_++; - return 0; -} - -int -ACE_Tokenizer::delimiter_replace (ACE_TCHAR d, - ACE_TCHAR replacement) -{ - // Make it possible to replace delimiters on-the-fly, e.g., parse - // string until certain token count and then copy rest of the - // original string. - for (int i = 0; i < delimiter_index_; i++) - if (delimiters_[i].delimiter_ == d) - { - delimiters_[i].replacement_ = replacement; - delimiters_[i].replace_ = 1; - return 0; - } - - if (delimiter_index_ >= MAX_DELIMITERS) - return -1; - - delimiters_[delimiter_index_].delimiter_ = d; - delimiters_[delimiter_index_].replacement_ = replacement; - delimiters_[delimiter_index_].replace_ = 1; - delimiter_index_++; - return 0; -} - -int -ACE_Tokenizer::preserve_designators (ACE_TCHAR start, - ACE_TCHAR stop, - int strip) -{ - if (preserves_index_ == MAX_PRESERVES) - return -1; - - preserves_[preserves_index_].start_ = start; - preserves_[preserves_index_].stop_ = stop; - preserves_[preserves_index_].strip_ = strip; - preserves_index_++; - return 0; -} - -int -ACE_Tokenizer::is_delimiter (ACE_TCHAR d, - int &replace, - ACE_TCHAR &r) -{ - replace = 0; - - for (int x = 0; x < delimiter_index_; x++) - if (delimiters_[x].delimiter_ == d) - { - if (delimiters_[x].replace_) - { - r = delimiters_[x].replacement_; - replace = 1; - } - return 1; - } - - return 0; -} - -int -ACE_Tokenizer::is_preserve_designator (ACE_TCHAR start, - ACE_TCHAR &stop, - int &strip) -{ - for (int x = 0; x < preserves_index_; x++) - if (preserves_[x].start_ == start) - { - stop = preserves_[x].stop_; - strip = preserves_[x].strip_; - return 1; - } - - return 0; -} - -ACE_TCHAR * -ACE_Tokenizer::next (void) -{ - // Check if the previous pass was the last one in the buffer. - if (index_ == -1) - { - index_ = 0; - return 0; - } - - ACE_TCHAR replacement; - int replace; - ACE_TCHAR *next_token; - - // Skip all leading delimiters. - for (;;) - { - // Check for end of string. - if (buffer_[index_] == '\0') - { - // If we hit EOS at the start, return 0. - index_ = 0; - return 0; - } - - if (this->is_delimiter (buffer_[index_], - replace, - replacement)) - index_++; - else - break; - } - - // When we reach this point, buffer_[index_] is a non-delimiter and - // not EOS - the start of our next_token. - next_token = buffer_ + index_; - - // A preserved region is it's own token. - ACE_TCHAR stop; - int strip; - if (this->is_preserve_designator (buffer_[index_], - stop, - strip)) - { - while (++index_) - { - if (buffer_[index_] == '\0') - { - index_ = -1; - goto EXIT_LABEL; - } - - if (buffer_[index_] == stop) - break; - } - - if (strip) - { - // Skip start preserve designator. - next_token += 1; - // Zap the stop preserve designator. - buffer_[index_] = '\0'; - // Increment to the next token. - index_++; - } - - goto EXIT_LABEL; - } - - // Step through finding the next delimiter or EOS. - for (;;) - { - // Advance pointer. - index_++; - - // Check for delimiter. - if (this->is_delimiter (buffer_[index_], - replace, - replacement)) - { - // Replace the delimiter. - if (replace != 0) - buffer_[index_] = replacement; - - // Move the pointer up and return. - index_++; - goto EXIT_LABEL; - } - - // A preserve designator signifies the end of this token. - if (this->is_preserve_designator (buffer_[index_], - stop, - strip)) - goto EXIT_LABEL; - - // Check for end of string. - if (buffer_[index_] == '\0') - { - index_ = -1; - goto EXIT_LABEL; - } - } - -EXIT_LABEL: - return next_token; -} - -// ************************************************************ - -ACE_ALLOC_HOOK_DEFINE(ACE_CString) - -char ACE_CString::NULL_CString_ = '\0'; -const int ACE_CString::npos = -1; -const int ACE_SString::npos = -1; -const int ACE_WString::npos = -1; - -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -ostream & -operator<< (ostream &os, const ACE_CString &cs) -{ - if (cs.fast_rep () != 0) - os << cs.fast_rep (); - return os; -} - -ostream & -operator<< (ostream &os, const ACE_WString &ws) -{ - if (ws.fast_rep () != 0) - { - ACE_Auto_Basic_Array_Ptr char_string(ws.char_rep ()); - os << char_string.get (); - } - return os; -} - -ostream & -operator<< (ostream &os, const ACE_SString &ss) -{ - if (ss.fast_rep () != 0) - os << ss.fast_rep (); - return os; -} -#endif /* !ACE_LACKS_IOSTREAM_TOTALLY */ - -// Constructor that copies into dynamically allocated memory. -// Probable loss of data. Please use with care. - -ACE_CString::ACE_CString (const ACE_WSTRING_TYPE *s, - ACE_Allocator *alloc) - : allocator_ (alloc ? alloc : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (0) -{ - ACE_TRACE ("ACE_CString::ACE_CString"); - - if (s == 0 || s[0] == (ACE_WSTRING_TYPE) '\0') - { - this->release_ = 0; - this->len_ = 0; - this->rep_ = &ACE_CString::NULL_CString_; - } - else - { - this->release_ = 1; - - size_t len = ACE_WString::strlen (s); - ACE_ALLOCATOR (this->rep_, - (char *) this->allocator_->malloc (len + 1)); - this->len_ = len; - this->buf_len_ = len + 1; - - // Copy the ACE_WSTRING_TYPE * string byte-by-byte into the char * - // string. - for (size_t i = 0; i < this->len_; i++) - this->rep_[i] = char (s[i]); - - this->rep_[this->len_] = '\0'; - } -} - -// this method might benefit from a little restructuring. -void -ACE_CString::set (const char *s, - size_t len, - int release) -{ - // Case 1. Going from memory to more memory - size_t new_buf_len = len + 1; - if (s != 0 && len != 0 && s[0] != '\0' && release - && this->buf_len_ < new_buf_len) - { - char *temp; - ACE_ALLOCATOR (temp, - (char *) this->allocator_->malloc (new_buf_len)); - - if (this->release_) - this->allocator_->free (this->rep_); - - this->rep_ = temp; - this->buf_len_ = new_buf_len; - this->release_ = 1; - this->len_ = len; - ACE_OS::memcpy (this->rep_, s, len); - // NUL terminate. - this->rep_[len] = '\0'; - } - - // Case 2. No memory allocation is necessary. - else - { - // Free memory if necessary and figure out future ownership - if (!release || s == 0 || s[0] == '\0' || len == 0) - if (this->release_) - { - this->allocator_->free (this->rep_); - this->release_ = 0; - } - // else - stay with whatever value for release_ we have. - - // Populate data. - if (s == 0 || s[0] == '\0' || len == 0) - { - this->buf_len_ = 0; - this->len_ = 0; - this->rep_ = &ACE_CString::NULL_CString_; - } - else if (!release) - { - this->buf_len_ = len; - this->len_ = len; - this->rep_ = (char *) s; - } - else - { - ACE_OS::memcpy (this->rep_, s, len); - // NUL terminate. - this->rep_[len] = 0; - this->len_ = len; - } - } -} - -// Return substring. -ACE_CString -ACE_CString::substring (size_t offset, - ssize_t length) const -{ - ACE_CString nil; - size_t count = length; - - // case 1. empty string - if (this->len_ == 0) - return nil; - - // case 2. start pos past our end - if (offset >= this->len_) - return nil; - // No length == empty string. - else if (length == 0) - return nil; - // Get all remaining bytes. - else if (length == -1) - count = this->len_ - offset; - - return ACE_CString (&this->rep_[offset], - count, - this->allocator_); -} - -// Concat operator (does copy memory). - -ACE_CString & -ACE_CString::operator+= (const ACE_CString &s) -{ - ACE_TRACE ("ACE_CString::operator+="); - - if (s.len_ > 0) - { - size_t new_buf_len = this->len_ + s.len_ + 1; - - // case 1. No memory allocation needed. - if (this->buf_len_ >= new_buf_len) - // Copy in data from new string. - ACE_OS::memcpy (this->rep_ + this->len_, - s.rep_, - s.len_); - - // case 2. Memory reallocation is needed - else - { - char *t = 0; - - ACE_ALLOCATOR_RETURN (t, - (char *) this->allocator_->malloc (new_buf_len), - *this); - - // Copy memory from old string into new string. - ACE_OS::memcpy (t, - this->rep_, - this->len_); - - ACE_OS::memcpy (t + this->len_, - s.rep_, - s.len_); - - if (this->release_) - this->allocator_->free (this->rep_); - - this->release_ = 1; - this->rep_ = t; - this->buf_len_ = new_buf_len; - } - - this->len_ += s.len_; - this->rep_[this->len_] = '\0'; - } - - return *this; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_SString) - -void -ACE_SString::dump (void) const -{ - ACE_TRACE ("ACE_SString::dump"); -} - -// Copy constructor. - -ACE_SString::ACE_SString (const ACE_SString &s) - : allocator_ (s.allocator_), - len_ (s.len_) -{ - ACE_TRACE ("ACE_SString::ACE_SString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->rep_ = (char *) this->allocator_->malloc (s.len_ + 1); - ACE_OS::memcpy ((void *) this->rep_, - (const void *) s.rep_, - this->len_); - this->rep_[this->len_] = '\0'; -} - -// Default constructor. - -ACE_SString::ACE_SString (ACE_Allocator *alloc) - : allocator_ (alloc), - len_ (0), - rep_ (0) - -{ - ACE_TRACE ("ACE_SString::ACE_SString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->len_ = 0; - this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1); - this->rep_[this->len_] = '\0'; -} - -// Set the underlying pointer (does not copy memory). - -void -ACE_SString::rep (char *s) -{ - ACE_TRACE ("ACE_SString::rep"); - - this->rep_ = s; - - if (s == 0) - this->len_ = 0; - else - this->len_ = ACE_OS::strlen (s); -} - -// Constructor that actually copies memory. - -ACE_SString::ACE_SString (const char *s, - ACE_Allocator *alloc) - : allocator_ (alloc) -{ - ACE_TRACE ("ACE_SString::ACE_SString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (s == 0) - { - this->len_ = 0; - this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1); - this->rep_[this->len_] = '\0'; - } - else - { - this->len_ = ACE_OS::strlen (s); - this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1); - ACE_OS::strcpy (this->rep_, s); - } -} - -ACE_SString::ACE_SString (char c, - ACE_Allocator *alloc) - : allocator_ (alloc) -{ - ACE_TRACE ("ACE_SString::ACE_SString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->len_ = 1; - this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1); - this->rep_[0] = c; - this->rep_[this->len_] = '\0'; -} - -// Constructor that actually copies memory. - -ACE_SString::ACE_SString (const char *s, - size_t len, - ACE_Allocator *alloc) - : allocator_ (alloc) -{ - ACE_TRACE ("ACE_SString::ACE_SString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (s == 0) - { - this->len_ = 0; - this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1); - this->rep_[this->len_] = '\0'; - } - else - { - this->len_ = len; - this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1); - ACE_OS::memcpy (this->rep_, s, len); - this->rep_[len] = '\0'; // Make sure to NUL terminate this! - } -} - -// Assignment operator (does copy memory). - -ACE_SString & -ACE_SString::operator= (const ACE_SString &s) -{ - ACE_TRACE ("ACE_SString::operator="); - // Check for identify. - - if (this != &s) - { - // Only reallocate if we don't have enough space... - if (this->len_ < s.len_) - { - this->allocator_->free (this->rep_); - this->rep_ = (char *) this->allocator_->malloc (s.len_ + 1); - } - this->len_ = s.len_; - ACE_OS::strcpy (this->rep_, s.rep_); - } - - return *this; -} - -// Return substring. -ACE_SString -ACE_SString::substring (size_t offset, - ssize_t length) const -{ - ACE_SString nil; - size_t count = length; - - // case 1. empty string - if (len_ == 0) - return nil; - - // case 2. start pos l - if (offset >= len_) - return nil; - - // get all remaining bytes - if (length == -1) - count = len_ - offset; - - return ACE_SString (&rep_[offset], count, this->allocator_); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_WString) - -void -ACE_WString::dump (void) const -{ - ACE_TRACE ("ACE_WString::dump"); -} - -// Default constructor. - -ACE_WString::ACE_WString (ACE_Allocator *alloc) - : allocator_ (alloc), - len_ (0), - rep_ (0) -{ - ACE_TRACE ("ACE_WString::ACE_WString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->len_ = 0; - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - this->rep_[this->len_] = 0; -} - -/* static */ -size_t -ACE_WString::strlen (const ACE_WSTRING_TYPE *s) -{ - ACE_TRACE ("ACE_WString::strlen"); - -#if defined (ACE_HAS_WCHAR) - return ACE_OS::strlen (s); -#else /* ACE_HAS_WCHAR */ - size_t len = 0; - - while (*s++ != 0) - ++len; - - return len; -#endif /* ACE_HAS_WCHAR */ -} - -// Get the underlying pointer as an ASCII char. - -char * -ACE_WString::char_rep (void) const -{ - ACE_TRACE ("ACE_WString::char_rep"); - if (this->len_ <= 0) - return 0; - else - { - char *t; - - ACE_NEW_RETURN (t, - char[this->len_ + 1], - 0); - - for (size_t i = 0; i < this->len_; i++) - // Note that this cast may lose data if wide chars are - // actually used! - t[i] = char (this->rep_[i]); - - t[this->len_] = '\0'; - return t; - } -} - -// Constructor that actually copies memory. - -ACE_WString::ACE_WString (const char *s, - ACE_Allocator *alloc) - : allocator_ (alloc) -{ - ACE_TRACE ("ACE_WString::ACE_WString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (s == 0) - { - this->len_ = 0; - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - this->rep_[this->len_] = 0; - } - else - { - this->len_ = ACE_OS::strlen (s); - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - - // Copy the char * string byte-by-byte into the ACE_WSTRING_TYPE * - // string. - for (size_t i = 0; i < this->len_; i++) - this->rep_[i] = s[i]; - - // null terminate - this->rep_[this->len_] = 0; - } -} - -// Constructor that actually copies memory. - -ACE_WString::ACE_WString (const ACE_WSTRING_TYPE *s, - ACE_Allocator *alloc) - : allocator_ (alloc) -{ - ACE_TRACE ("ACE_WString::ACE_WString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (s == 0) - { - this->len_ = 0; - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - this->rep_[this->len_] = 0; - } - else - { - this->len_ = ACE_WString::strlen (s); - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - - ACE_OS::memcpy (this->rep_, - s, - this->len_ * sizeof (ACE_WSTRING_TYPE)); - - // null terminate - this->rep_[this->len_] = 0; - } -} - -ACE_WString::ACE_WString (ACE_WSTRING_TYPE c, - ACE_Allocator *alloc) - : allocator_ (alloc) -{ - ACE_TRACE ("ACE_WString::ACE_WString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->len_ = 1; - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - this->rep_[0] = c; - this->rep_[this->len_] = 0; -} - -// Constructor that actually copies memory. - -ACE_WString::ACE_WString (const ACE_WSTRING_TYPE *s, - size_t len, - ACE_Allocator *alloc) - : allocator_ (alloc) -{ - ACE_TRACE ("ACE_WString::ACE_WString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - if (s == 0) - { - this->len_ = 0; - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - this->rep_[this->len_] = 0; - } - else - { - this->len_ = len; - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - - ACE_OS::memcpy (this->rep_, - s, - len * sizeof (ACE_WSTRING_TYPE)); - - // null terminate - this->rep_[this->len_] = 0; - } -} - -// Constructor that allocates empty memory - -ACE_WString::ACE_WString (size_t len, - ACE_Allocator *alloc) - : allocator_ (alloc) -{ - ACE_TRACE ("ACE_WString::ACE_WString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->len_ = len; - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - - ACE_OS::memset (this->rep_, - 0, - len * sizeof (ACE_WSTRING_TYPE)); - // NUL terminate. - this->rep_[this->len_] = 0; -} - -// Copy constructor. - -ACE_WString::ACE_WString (const ACE_WString &s) - : allocator_ (s.allocator_), - len_ (s.len_) -{ - ACE_TRACE ("ACE_WString::ACE_WString"); - - if (this->allocator_ == 0) - this->allocator_ = ACE_Allocator::instance (); - - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((s.len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - ACE_OS::memcpy ((void *) this->rep_, - (const void *) s.rep_, - this->len_ * sizeof (ACE_WSTRING_TYPE)); - this->rep_[this->len_] = 0; -} - -// Assignment operator (does copy memory). - -ACE_WString & -ACE_WString::operator= (const ACE_WString &s) -{ - ACE_TRACE ("ACE_WString::operator="); - // Check for identify. - - if (this != &s) - this->set (s.rep_, s.len_); - - return *this; -} - -void -ACE_WString::set (const ACE_WSTRING_TYPE *s) -{ - this->set (s, ACE_WString::strlen (s)); -} - -void -ACE_WString::set (const ACE_WSTRING_TYPE *s, size_t len) -{ - // Only reallocate if we don't have enough space... - if (this->len_ < len) - { - this->allocator_->free (this->rep_); - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((len + 1) * sizeof (ACE_WSTRING_TYPE)); - } - - this->len_ = len; - ACE_OS::memcpy (this->rep_, - s, - len * sizeof (ACE_WSTRING_TYPE)); - // NUL terminate. - this->rep_[len] = 0; -} - -// return substring -ACE_WString -ACE_WString::substring (size_t offset, - ssize_t length) const -{ - ACE_WString nil; - size_t count = length; - - // case 1. empty string - if (len_ == 0) - return nil; - - // case 2. start pos l - if (offset >= len_) - return nil; - - // get all remaining bytes - if (length == -1) - count = len_ - offset; - - return ACE_WString (&rep_[offset], - count, - this->allocator_); -} - -void -ACE_WString::resize (size_t len) -{ - ACE_TRACE ("ACE_WString::resize"); - - // Only reallocate if we don't have enough space... - if (this->len_ < len) - { - this->allocator_->free (this->rep_); - this->rep_ = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((len + 1) * sizeof (ACE_WSTRING_TYPE)); - } - - this->len_ = len; - ACE_OS::memset (this->rep_, - 0, - this->len_ * sizeof (ACE_WSTRING_TYPE)); - this->rep_[this->len_] = 0; -} - -// Concat operator (does copy memory). - -ACE_WString & -ACE_WString::operator+= (const ACE_WString &s) -{ - ACE_TRACE ("ACE_WString::operator+="); - ACE_WSTRING_TYPE *t = (ACE_WSTRING_TYPE *) this->allocator_->malloc - ((this->len_ + s.len_ + 1) * sizeof (ACE_WSTRING_TYPE)); - - ACE_OS::memcpy ((void *) t, - (const void *) this->rep_, - this->len_ * sizeof (ACE_WSTRING_TYPE)); - ACE_OS::memcpy ((void *) (t + this->len_), - (const void *) s.rep_, - s.len_ * sizeof (ACE_WSTRING_TYPE)); - this->len_ += s.len_; - - // NUL terminate. - t[this->len_] = 0; - - this->allocator_->free (this->rep_); - this->rep_ = t; - - return *this; -} - -ACE_WString::~ACE_WString (void) -{ - ACE_TRACE ("ACE_WString::~ACE_WString"); - this->allocator_->free (this->rep_); -} - -/* static */ -const ACE_WSTRING_TYPE * -ACE_WString::strstr (const ACE_WSTRING_TYPE *s1, - const ACE_WSTRING_TYPE *s2) -{ - ACE_TRACE ("ACE_WString::strstr"); - - // Original string length - size_t len1 = ACE_WString::strlen (s1); - // Substring length - size_t len2 = ACE_WString::strlen (s2); - - // Check if the substring is longer than the string being searched. - if (len2 > len1) - return 0; - - // Go upto - size_t len = len1 - len2; - - for (size_t i = 0; i <= len; i++) - { - if (ACE_OS::memcmp (s1 + i, s2, len2 * sizeof (ACE_WSTRING_TYPE)) == 0) - // Found a match! Return the index. - return s1 + i; - } - - return 0; -} - diff --git a/ace/SString.h b/ace/SString.h deleted file mode 100644 index bbdd013fe22..00000000000 --- a/ace/SString.h +++ /dev/null @@ -1,659 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SString.h -// -// = AUTHOR -// Douglas C. Schmidt (schmidt@cs.wustl.edu) -// -// ============================================================================ - -#ifndef ACE_SSTRING_H -#define ACE_SSTRING_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_WCHAR) -typedef wchar_t ACE_WSTRING_TYPE; -#else /* ACE_HAS_WCHAR */ -typedef ACE_USHORT16 ACE_WSTRING_TYPE; -#endif /* ACE_HAS_WCHAR */ - -// Forward decl. -class ACE_Allocator; - -class ACE_Export ACE_CString -{ - // = TITLE - // This class provides a wrapper facade for C strings. - // - // = DESCRIPTION - // This class uses an to allocate memory. The - // user can make this a persistant class by providing an - // ACE_Allocator with a persistable memory pool. This class is - // optimized for efficiency, so it doesn't provide any internal - // locking. - // - // NOTE: if an instance of this class is constructed from or - // assigned an empty string (with first element of '\0'), then it - // is _not_ allocated new space. Instead, its internal - // representation is set equal to a global empty string. - // - // CAUTION: in cases when ACE_CString is constructed from a - // provided buffer with the release parameter set to 0, - // ACE_CString is not guaranteed to be '\0' terminated. - -public: - static const int npos; - // No position constant - - ACE_CString (ACE_Allocator *alloc = 0); - // Default constructor. - - ACE_CString (const char *s, - ACE_Allocator *alloc = 0, - int release = 1); - // Constructor that copies into dynamically allocated memory. - // If is non-0 then the is responsible for - // freeing this memory. Memory is _not_ allocated/freed if - // is 0. - - ACE_CString (const char *s, - size_t len, - ACE_Allocator *alloc = 0, - int release = 1); - // Constructor that copies chars of into dynamically - // allocated memory (will NUL terminate the result). If - // is non-0 then the is responsible for freeing this - // memory. Memory is _not_ allocated/freed if is 0. - - ACE_CString (const ACE_CString &); - // Copy constructor. - - ACE_CString (const ACE_WSTRING_TYPE *s, - ACE_Allocator *alloc = 0); - // Constructor that copies into dynamically allocated memory. - // Probable loss of data. Please use with care. - - ACE_CString (char c, ACE_Allocator *alloc = 0); - // Constructor that copies into dynamically allocated memory. - - ~ACE_CString (void); - // Deletes the memory... - - const char &operator [] (size_t slot) const; - // Return the character in the string (doesn't perform - // bounds checking). - - char &operator [] (size_t slot); - // Return the character by reference in the string - // (doesn't perform bounds checking). - - ACE_CString &operator = (const ACE_CString &); - // Assignment operator (does copy memory). - - void set (const char *s, int release = 1); - // Copy into this . Memory is _not_ - // allocated/freed if is 0. - - void set (const char *s, - size_t len, - int release); - // Copy bytes of (will NUL terminate the result). - // Memory is _not_ allocated/freed if is 0. - - ACE_CString substring (size_t offset, ssize_t length = -1) const; - // Return a substring given an offset and length, if length == -1 - // use rest of str. Return empty substring if offset or - // offset/length are invalid. - - ACE_CString substr (size_t offset, ssize_t length = -1) const; - // Same as . - - ACE_CString &operator += (const ACE_CString &); - // Concat operator (copies memory). - - u_long hash (void) const; - // Returns a hash value for this string. - - size_t length (void) const; - // Return the length of the string. - - char *rep (void) const; - // Get a copy of the underlying pointer. - - const char *fast_rep (void) const; - // Get at the underlying representation directly! - // _Don't_ even think about casting the result to (char *) and modifying it, - // if it has length 0! - - const char *c_str (void) const; - // Same as STL String's and . - - int strstr (const ACE_CString &s) const; - // Comparison operator that will match substrings. Returns the - // slot of the first location that matches, else -1. - - int find (const ACE_CString &str, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int find (const char *s, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int find (char c, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int rfind (char c, int pos = npos) const; - // Find starting at pos (counting from the end). Returns the - // slot of the first location that matches, else npos. - - int operator == (const ACE_CString &s) const; - // Equality comparison operator (must match entire string). - - int operator < (const ACE_CString &s) const; - // Less than comparison operator. - - int operator > (const ACE_CString &s) const; - // Greater than comparison operator. - - int operator != (const ACE_CString &s) const; - // Inequality comparison operator. - - int compare (const ACE_CString &s) const; - // Performs a -style comparison. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_Allocator *allocator_; - // Pointer to a memory allocator. - - size_t len_; - // Length of the ACE_CString data (not counting the trailing '\0'). - - size_t buf_len_; - // Length of the ACE_CString data buffer. Keeping track of the - // length allows to avoid unnecessary dynamic allocations. - - char *rep_; - // Pointer to data. - - int release_; - // Flag that indicates if we own the memory - - static char NULL_CString_; - // Represents the "NULL" string to simplify the internal logic. -}; - -ACE_Export ACE_INLINE ACE_CString operator + (const ACE_CString &, - const ACE_CString &); -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -ACE_Export ostream &operator << (ostream &, const ACE_CString &); -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -class ACE_Export ACE_WString -{ - // = TITLE - // This class provides a wrapper facade for C wide strings. - // - // = DESCRIPTION - // This class uses an to allocate memory. The - // user can make this a persistant class by providing an - // with a persistable memory pool. This class is - // optimized for efficiency, so it doesn't provide any internal - // locking. -public: - static const int npos; - // No position constant - - ACE_WString (ACE_Allocator *alloc = 0); - // Default constructor. - - ACE_WString (const char *s, - ACE_Allocator *alloc = 0); - // Constructor that copies into dynamically allocated memory. - - ACE_WString (const ACE_WSTRING_TYPE *s, - ACE_Allocator *alloc = 0); - // Constructor that copies into dynamically allocated memory. - - ACE_WString (const ACE_WSTRING_TYPE *s, - size_t len, - ACE_Allocator *alloc = 0); - // Constructor that copies ACE_WSTRING_TYPE's of into dynamically - // allocated memory (will NUL terminate the result). - - ACE_WString (size_t len, ACE_Allocator *alloc = 0); - // Constructor that dynamically allocates memory for + 1 - // ACE_WSTRING_TYPE characters. The newly created memory is set memset to 0. - - ACE_WString (const ACE_WString &s); - // Copy constructor. - - ACE_WString (ACE_WSTRING_TYPE c, ACE_Allocator *alloc = 0); - // Constructor that copies into dynamically allocated memory. - - ~ACE_WString (void); - // Deletes the memory... - - ACE_WSTRING_TYPE operator [] (size_t slot) const; - // Return the character in the string (doesn't perform - // bounds checking). - - ACE_WSTRING_TYPE &operator [] (size_t slot); - // Return the character by reference in the string - // (doesn't perform bounds checking). - - ACE_WString &operator = (const ACE_WString &); - // Assignment operator (does copy memory). - - void set (const ACE_WSTRING_TYPE *s); - // Copy - - void set (const ACE_WSTRING_TYPE *s, - size_t len); - // Copy bytes of (will NUL terminate the result) - - ACE_WString substring (size_t offset, ssize_t length = -1) const; - // Return a substring given an offset and length, if length == -1 - // use rest of str return empty substring if offset or offset/length - // are invalid. - - ACE_WString substr (size_t offset, ssize_t length = -1) const; - // Same as substring - - ACE_WString &operator += (const ACE_WString &); - // Concat operator (does copy memory). - - u_long hash (void) const; - // Returns a hash value for this string. - - size_t length (void) const; - // Return the length of the string. - - ACE_WSTRING_TYPE *rep (void) const; - // Gets a copy of the underlying pointer. - - char *char_rep (void) const; - // Transform into a copy of the ASCII character representation. - - const ACE_WSTRING_TYPE *fast_rep (void) const; - // Get at the underlying representation directly! - - const ACE_WSTRING_TYPE *c_str (void) const; - // Same as STL String's and . - - int strstr (const ACE_WString &s) const; - // Comparison operator that will match substrings. Returns the - // slot of the first location that matches, else -1. - - int find (const ACE_WString &str, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int find (const ACE_WSTRING_TYPE *s, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int find (ACE_WSTRING_TYPE c, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int rfind (ACE_WSTRING_TYPE c, int pos = npos) const; - // Find starting at pos (counting from the end). Returns the - // slot of the first location that matches, else npos. - - int operator == (const ACE_WString &s) const; - // Equality comparison operator (must match entire string). - - int operator < (const ACE_WString &s) const; - // Less than comparison operator. - - int operator > (const ACE_WString &s) const; - // Greater than comparison operator. - - int operator != (const ACE_WString &s) const; - // Inequality comparison operator. - - int compare (const ACE_WString &s) const; - // Performs a -style comparison. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - - static size_t strlen (const ACE_WSTRING_TYPE *); - // Computes the length of a "0" terminated ACE_WSTRING_TYPE *. - - static const ACE_WSTRING_TYPE *strstr (const ACE_WSTRING_TYPE *s1, - const ACE_WSTRING_TYPE *s2); - // Traditional style strstr - - void resize (size_t len); - // This method is designed for high-performance. Please use with - // care ;-) If the current size of the string is less than , - // the string is resized to the new length. The data is is zero'd - // out after this operation. - -private: - ACE_Allocator *allocator_; - // Pointer to a memory allocator. - - size_t len_; - // Length of the ACE_WString. - - ACE_WSTRING_TYPE *rep_; - // Pointer to data. -}; - -ACE_Export ACE_INLINE ACE_WString operator+ (const ACE_WString &, - const ACE_WString &); -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -ACE_Export ostream &operator << (ostream &, const ACE_WString &); -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -class ACE_Export ACE_SString -{ - // = TITLE - // A very Simple String class. This is not a - // general-purpose string class, and you should probably consider - // using is you don't understand why this class - // exists... - // - // = DESCRIPTION - // This class is optimized for efficiency, so it doesn't provide - // any internal locking. - // - // CAUTION: This class is only intended for use with applications - // that understand how it works. In particular, its destructor - // does not deallocate its memory when it is destroyed... We need - // this class since the requires an object that - // supports the operator == and operator !=. This class uses an - // to allocate memory. The user can make this a - // persistant class by providing an with a - // persistable memory pool. -public: - static const int npos; - // No position constant - - ACE_SString (ACE_Allocator *alloc = 0); - // Default constructor. - - ACE_SString (const char *s, ACE_Allocator *alloc = 0); - // Constructor that copies into dynamically allocated memory. - - ACE_SString (const char *s, size_t len, ACE_Allocator *alloc = 0); - // Constructor that copies chars of into dynamically - // allocated memory (will NUL terminate the result). - - ACE_SString (const ACE_SString &); - // Copy constructor. - - ACE_SString (char c, ACE_Allocator *alloc = 0); - // Constructor that copies into dynamically allocated memory. - - ~ACE_SString (void); - // Default dtor. - - char operator [] (size_t slot) const; - // Return the character in the string (doesn't perform - // bounds checking). - - char &operator [] (size_t slot); - // Return the character by reference in the string - // (doesn't perform bounds checking). - - ACE_SString &operator = (const ACE_SString &); - // Assignment operator (does copy memory). - - ACE_SString substring (size_t offset, ssize_t length = -1) const; - // Return a substring given an offset and length, if length == -1 - // use rest of str return empty substring if offset or offset/length - // are invalid - - ACE_SString substr (size_t offset, ssize_t length = -1) const; - // Same as substring - - u_long hash (void) const; - // Returns a hash value for this string. - - size_t length (void) const; - // Return the length of the string. - - void rep (char *s); - // Set the underlying pointer. Since this does not copy memory or - // delete existing memory use with extreme caution!!! - - const char *rep (void) const; - // Get the underlying pointer. - - const char *fast_rep (void) const; - // Get the underlying pointer. - - const char *c_str (void) const; - // Same as STL String's and . - - int strstr (const ACE_SString &s) const; - // Comparison operator that will match substrings. Returns the - // slot of the first location that matches, else -1. - - int find (const ACE_SString &str, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int find (const char *s, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int find (char c, int pos = 0) const; - // Find starting at pos. Returns the slot of the first - // location that matches, else npos. - - int rfind (char c, int pos = npos) const; - // Find starting at pos (counting from the end). Returns the - // slot of the first location that matches, else npos. - - int operator == (const ACE_SString &s) const; - // Equality comparison operator (must match entire string). - - int operator < (const ACE_SString &s) const; - // Less than comparison operator. - - int operator > (const ACE_SString &s) const; - // Greater than comparison operator. - - int operator != (const ACE_SString &s) const; - // Inequality comparison operator. - - int compare (const ACE_SString &s) const; - // Performs a -style comparison. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_Allocator *allocator_; - // Pointer to a memory allocator. - - size_t len_; - // Length of the ACE_SString (not counting the trailing '\0'). - - char *rep_; - // Pointer to data. -}; - -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -ACE_Export ostream &operator << (ostream &, const ACE_SString &); -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -// This allows one to use W or C String based on the Unicode -// setting -#if defined (ACE_USES_WCHAR) -typedef ACE_WString ACE_TString; -#else /* ACE_USES_WCHAR */ -typedef ACE_CString ACE_TString; -#endif /* ACE_USES_WCHAR */ - - -// ************************************************************ - -class ACE_Export ACE_Tokenizer -{ - // = TITLE - // Tokenizer - // - // = DESCRIPTION - // Tokenizes a buffer. Allows application to set delimiters and - // preserve designators. Does not allow special characters, yet - // (e.g., printf ("\"like a quoted string\"")). -public: - ACE_Tokenizer (ACE_TCHAR *buffer); - // will be parsed. - - int delimiter (ACE_TCHAR d); - // is a delimiter. Returns 0 on success, -1 if there is no - // memory left. - - int delimiter_replace (ACE_TCHAR d, ACE_TCHAR replacement); - // is a delimiter and, when found, will be replaced by - // . Returns 0 on success, -1 if there is no memory - // left. - - int preserve_designators (ACE_TCHAR start, ACE_TCHAR stop, int strip=1); - // For instance, quotes, or '(' and ')'. Returns 0 on success, -1 - // if there is no memory left. If == 1, then the preserve - // designators will be stripped from the tokens returned by next. - - ACE_TCHAR *next (void); - // Returns the next token. - - enum { - MAX_DELIMITERS=16, - MAX_PRESERVES=16 - }; - -protected: - int is_delimiter (ACE_TCHAR d, int &replace, ACE_TCHAR &r); - // Returns 1 if is a delimiter, 0 otherwise. If should be - // replaced with , is set to 1, otherwise 0. - - int is_preserve_designator (ACE_TCHAR start, ACE_TCHAR &stop, int &strip); - // If is a start preserve designator, returns 1 and sets - // to the stop designator. Returns 0 if is not a - // preserve designator. - -private: - ACE_TCHAR *buffer_; - int index_; - - class Preserve_Entry - { - // = TITLE - // Preserve Entry - // - // = DESCRIPTION - // Defines a set of characters that designate an area that - // should not be parsed, but should be treated as a complete - // token. For instance, in: (this is a preserve region), start - // would be a left paren -(- and stop would be a right paren - // -)-. The strip determines whether the designators should be - // removed from the token. - public: - ACE_TCHAR start_; - // E.g., "(". - ACE_TCHAR stop_; - // E.g., ")". - int strip_; - // Whether the designators should be removed from the token. - }; - - Preserve_Entry preserves_[MAX_PRESERVES]; - // The application can specify MAX_PRESERVES preserve designators. - - int preserves_index_; - // Pointer to the next free spot in preserves_. - - class Delimiter_Entry - { - // = TITLE - // Delimiter Entry - // - // = DESCRIPTION - // Describes a delimiter for the tokenizer. - public: - ACE_TCHAR delimiter_; - // Most commonly a space ' '. - ACE_TCHAR replacement_; - // What occurrences of delimiter_ should be replaced with. - int replace_; - // Whether replacement_ should be used. This should be replaced - // with a technique that sets replacement_ = delimiter by - // default. I'll do that next iteration. - }; - - Delimiter_Entry delimiters_[MAX_DELIMITERS]; - // The tokenizer allows MAX_DELIMITERS number of delimiters. - - int delimiter_index_; - // Pointer to the next free space in delimiters_. -}; - -// **************************************************************** - -class ACE_Export ACE_Auto_String_Free -{ - // = TITLE - // Simple class to automatically de-allocate strings - // - // = DESCRIPTION - // Keeps a pointer to a string and deallocates it (using - // ) on its destructor. - // If you need to delete using "delete[]" the - // ACE_Auto_Array_Ptr is your choice. - // The class plays the same role as auto_ptr<> - // -public: - ACE_EXPLICIT ACE_Auto_String_Free (char* p = 0); - ACE_Auto_String_Free (ACE_Auto_String_Free &rhs); - ACE_Auto_String_Free& operator= (ACE_Auto_String_Free &rhs); - ~ACE_Auto_String_Free (void); - - char* operator* () const; - char operator[] (int i) const; - char* get (void) const; - char* release (void); - void reset (char* p = 0); - -private: - char* p_; -}; - -#if defined (__ACE_INLINE__) -#include "ace/SString.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_SSTRING_H */ diff --git a/ace/SString.i b/ace/SString.i deleted file mode 100644 index f93f6ac1660..00000000000 --- a/ace/SString.i +++ /dev/null @@ -1,757 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/Malloc_Base.h" - -// Default constructor. - -ACE_INLINE -ACE_CString::ACE_CString (ACE_Allocator *alloc) - : allocator_ (alloc ? alloc : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (&ACE_CString::NULL_CString_), - release_ (0) -{ - ACE_TRACE ("ACE_CString::ACE_CString"); -} - -// Constructor that actually copies memory. - -ACE_INLINE -ACE_CString::ACE_CString (const char *s, - ACE_Allocator *alloc, - int release) - : allocator_ (alloc ? alloc : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (0) -{ - ACE_TRACE ("ACE_CString::ACE_CString"); - - size_t length; - if (s != 0) - length = ACE_OS::strlen (s); - else - length = 0; - - this->set (s, length, release); -} - -ACE_INLINE -ACE_CString::ACE_CString (char c, - ACE_Allocator *alloc) - : allocator_ (alloc ? alloc : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (0) -{ - ACE_TRACE ("ACE_CString::ACE_CString"); - - this->set (&c, 1, 1); -} - -// Constructor that actually copies memory. - -ACE_INLINE -ACE_CString::ACE_CString (const char *s, - size_t len, - ACE_Allocator *alloc, - int release) - : allocator_ (alloc ? alloc : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (0) -{ - ACE_TRACE ("ACE_CString::ACE_CString"); - - this->set (s, len, release); -} - -// Copy constructor. - -ACE_INLINE -ACE_CString::ACE_CString (const ACE_CString &s) - : allocator_ (s.allocator_ ? s.allocator_ : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (0) -{ - ACE_TRACE ("ACE_CString::ACE_CString"); - - this->set (s.rep_, s.len_, 1); -} - -ACE_INLINE -ACE_CString::~ACE_CString (void) -{ - ACE_TRACE ("ACE_CString::~ACE_CString"); - - this->set (0, 0, 0); -} - -ACE_INLINE void -ACE_CString::dump (void) const -{ - ACE_TRACE ("ACE_CString::dump"); -} - -// Assignment operator (does copy memory). - -ACE_INLINE ACE_CString & -ACE_CString::operator= (const ACE_CString &s) -{ - ACE_TRACE ("ACE_CString::operator="); - - // Check for identify. - if (this != &s) - this->set (s.rep_, s.len_, 1); - - return *this; -} - -ACE_INLINE void -ACE_CString::set (const char *s, int release) -{ - size_t length; - if (s != 0) - length = ACE_OS::strlen (s); - else - length = 0; - - this->set (s, length, release); -} - -ACE_INLINE size_t -ACE_CString::length (void) const -{ - ACE_TRACE ("ACE_CString::length"); - return this->len_; -} - -ACE_INLINE ACE_CString -ACE_CString::substr (size_t offset, - ssize_t length) const -{ - return this->substring (offset, length); -} - -// Return the character in the string. - -ACE_INLINE const char & -ACE_CString::operator[] (size_t slot) const -{ - ACE_TRACE ("ACE_CString::operator[]"); - return this->rep_[slot]; -} - -// Return the character in the string by reference. - -ACE_INLINE char & -ACE_CString::operator[] (size_t slot) -{ - ACE_TRACE ("ACE_CString::operator[]"); - return this->rep_[slot]; -} - -// Get a copy of the underlying representation. - -ACE_INLINE char * -ACE_CString::rep (void) const -{ - ACE_TRACE ("ACE_CString::rep"); - - char *new_string; - ACE_NEW_RETURN (new_string, char[this->len_ + 1], 0); - ACE_OS::strncpy (new_string, this->rep_, this->len_); - new_string[this->len_] = '\0'; - - return new_string; -} - -ACE_INLINE const char * -ACE_CString::fast_rep (void) const -{ - return this->rep_; -} - -ACE_INLINE const char * -ACE_CString::c_str (void) const -{ - return this->rep_; -} - -// Comparison operator. - -ACE_INLINE int -ACE_CString::operator== (const ACE_CString &s) const -{ - ACE_TRACE ("ACE_CString::operator=="); - - return this->len_ == s.len_ - && ACE_OS::strncmp (this->rep_, s.rep_, this->len_) == 0; -} - -// Less than comparison operator. - -ACE_INLINE int -ACE_CString::operator < (const ACE_CString &s) const -{ - ACE_TRACE ("ACE_CString::operator <"); - - return (this->rep_ && s.rep_) - ? ACE_OS::strcmp (this->rep_, s.rep_) < 0 - : ((s.rep_) ? 1 : 0 ); -} - -// Greater than comparison operator. - -ACE_INLINE int -ACE_CString::operator > (const ACE_CString &s) const -{ - ACE_TRACE ("ACE_CString::operator >"); - - return (this->rep_ && s.rep_) - ? ACE_OS::strcmp (this->rep_, s.rep_) > 0 - : ((this->rep_) ? 1 : 0 ); -} - - -// Comparison operator. - -ACE_INLINE int -ACE_CString::operator!= (const ACE_CString &s) const -{ - ACE_TRACE ("ACE_CString::operator!="); - return !(*this == s); -} - -ACE_INLINE int -ACE_CString::compare (const ACE_CString &s) const -{ - ACE_TRACE ("ACE_CString::compare"); - - // We can't just pass both strings to strcmp, since they are not - // guaranteed to be null-terminated. - - // Pick smaller of the two lengths and perform the comparison. - int smaller_length = (this->len_ < s.len_) ? this->len_ : s.len_; - int result = ACE_OS::strncmp (this->rep_, - s.rep_, - smaller_length); - - if (result != 0 || s.len_ == this->len_) - return result; - - else - // we need to differentiate based on length - if (this->len_ > s.len_) - return (this->rep_[smaller_length] - '\0'); - - else - return ('\0' - s.rep_[smaller_length]); -} - -ACE_INLINE int -ACE_CString::find (const char *s, int pos) const -{ - char *substr = this->rep_ + pos; - size_t len = ACE_OS::strlen (s); - char *pointer = ACE_OS::strnstr (substr, s, len); - if (pointer == 0) - return ACE_CString::npos; - else - return pointer - substr; -} - -ACE_INLINE int -ACE_CString::find (char c, int pos) const -{ - char *substr = this->rep_ + pos; - char *pointer = ACE_OS::strnchr (substr, c, this->len_ - pos); - if (pointer == 0) - return ACE_CString::npos; - else - return pointer - substr; -} - -ACE_INLINE int -ACE_CString::find (const ACE_CString &str, int pos) const -{ - return this->find (str.rep_, pos); -} - -ACE_INLINE int -ACE_CString::strstr (const ACE_CString &s) const -{ - ACE_TRACE ("ACE_CString::strstr"); - - return this->find (s.rep_); -} - -ACE_INLINE int -ACE_CString::rfind (char c, int pos) const -{ - if (pos == ACE_CString::npos) - pos = this->len_; - - for (int i = pos - 1; i >= 0; i--) - if (this->rep_[i] == c) - return i; - - return ACE_CString::npos; -} - -ACE_INLINE u_long -ACE_CString::hash (void) const -{ - return ACE::hash_pjw (this->rep_, this->len_); -} - -ACE_INLINE ACE_WString -operator+ (const ACE_WString &s, - const ACE_WString &t) -{ - ACE_WString temp (s); - temp += t; - return temp; -} - -ACE_INLINE ACE_CString -operator+ (const ACE_CString &s, const ACE_CString &t) -{ - ACE_CString temp (s); - temp += t; - return temp; -} - -ACE_INLINE -ACE_SString::~ACE_SString (void) -{ -} - -ACE_INLINE ACE_SString -ACE_SString::substr (size_t offset, - ssize_t length) const -{ - return this->substring (offset, length); -} - -// Return the character in the string. - -ACE_INLINE char -ACE_SString::operator[] (size_t slot) const -{ - ACE_TRACE ("ACE_SString::operator[]"); - return this->rep_[slot]; -} - -// Return the character in the string by reference. - -ACE_INLINE char & -ACE_SString::operator[] (size_t slot) -{ - ACE_TRACE ("ACE_SString::operator[]"); - return this->rep_[slot]; -} - -// Get the underlying pointer (does not make a copy, so beware!). - -ACE_INLINE const char * -ACE_SString::rep (void) const -{ - ACE_TRACE ("ACE_SString::rep"); - return this->rep_; -} - -// Get the underlying pointer (does not make a copy, so beware!). - -ACE_INLINE const char * -ACE_SString::fast_rep (void) const -{ - ACE_TRACE ("ACE_SString::fast_rep"); - return this->rep_; -} - -// Get the underlying pointer (does not make a copy, so beware!). - -ACE_INLINE const char * -ACE_SString::c_str (void) const -{ - ACE_TRACE ("ACE_SString::c_str"); - return this->rep_; -} - -// Comparison operator. - -ACE_INLINE int -ACE_SString::operator== (const ACE_SString &s) const -{ - ACE_TRACE ("ACE_SString::operator=="); - return this->len_ == s.len_ - && ACE_OS::strcmp (this->rep_, s.rep_) == 0; -} - -// Less than comparison operator. - -ACE_INLINE int -ACE_SString::operator < (const ACE_SString &s) const -{ - ACE_TRACE ("ACE_SString::operator <"); - - return (this->rep_ && s.rep_) - ? ACE_OS::strcmp (this->rep_, s.rep_) < 0 - : ((s.rep_) ? 1 : 0 ); -} - -// Greater than comparison operator. - -ACE_INLINE int -ACE_SString::operator > (const ACE_SString &s) const -{ - ACE_TRACE ("ACE_SString::operator >"); - - return (this->rep_ && s.rep_) - ? ACE_OS::strcmp (this->rep_, s.rep_) > 0 - : ((this->rep_) ? 1 : 0 ); -} - -// Comparison operator. - -ACE_INLINE int -ACE_SString::operator!= (const ACE_SString &s) const -{ - ACE_TRACE ("ACE_SString::operator!="); - return !(*this == s); -} - -ACE_INLINE int -ACE_SString::compare (const ACE_SString &s) const -{ - ACE_TRACE ("ACE_SString::compare"); - return ACE_OS::strcmp (this->rep_, s.rep_); -} - -ACE_INLINE int -ACE_SString::find (const char *s, int pos) const -{ - char *substr = this->rep_ + pos; - char *pointer = ACE_OS::strstr (substr, s); - if (pointer == 0) - return ACE_SString::npos; - else - return pointer - substr; -} - -ACE_INLINE int -ACE_SString::find (char c, int pos) const -{ - char *substr = this->rep_ + pos; - char *pointer = ACE_OS::strchr (substr, c); - if (pointer == 0) - return ACE_SString::npos; - else - return pointer - substr; -} - -ACE_INLINE int -ACE_SString::strstr (const ACE_SString &s) const -{ - ACE_TRACE ("ACE_SString::strstr"); - - return this->find (s.rep_); -} - -ACE_INLINE int -ACE_SString::find (const ACE_SString &str, int pos) const -{ - return this->find (str.rep_, pos); -} - -ACE_INLINE int -ACE_SString::rfind (char c, int pos) const -{ - if (pos == ACE_SString::npos) - pos = this->len_; - - for (int i = pos - 1; i >= 0; i--) - { - if (this->rep_[i] == c) - return i; - } - - return ACE_SString::npos; -} - -ACE_INLINE u_long -ACE_SString::hash (void) const -{ - return ACE::hash_pjw (this->rep_); -} - -ACE_INLINE size_t -ACE_SString::length (void) const -{ - ACE_TRACE ("ACE_SString::length"); - return this->len_; -} - - - -ACE_INLINE ACE_WString -ACE_WString::substr (size_t offset, - ssize_t length) const -{ - return this->substring (offset, length); -} - -// Get a copy of the underlying representation. - -ACE_INLINE ACE_WSTRING_TYPE * -ACE_WString::rep (void) const -{ - ACE_TRACE ("ACE_WString::rep"); - if (this->len_ <= 0) - return 0; - else - { - ACE_WSTRING_TYPE *t; - ACE_NEW_RETURN (t, ACE_WSTRING_TYPE[this->len_ + 1], 0); - ACE_OS::memcpy (t, this->rep_, this->len_ * sizeof (ACE_WSTRING_TYPE)); - - // 0 terminate - t[this->len_] = 0; - - return t; - } -} - -// Get at the underlying representation directly! - -ACE_INLINE const ACE_WSTRING_TYPE * -ACE_WString::fast_rep (void) const -{ - return this->rep_; -} - -ACE_INLINE const ACE_WSTRING_TYPE * -ACE_WString::c_str (void) const -{ - return this->rep_; -} - -// Comparison operator. - -ACE_INLINE int -ACE_WString::operator== (const ACE_WString &s) const -{ - ACE_TRACE ("ACE_WString::operator=="); - return this->len_ == s.len_ - && ACE_OS::memcmp ((const void *) this->rep_, - (const void *) s.rep_, - this->len_ * sizeof (ACE_WSTRING_TYPE)) == 0; -} - -// Less than comparison operator. - -ACE_INLINE int -ACE_WString::operator < (const ACE_WString &s) const -{ - ACE_TRACE ("ACE_WString::operator <"); - return (this->len_ < s.len_) - ? (ACE_OS::memcmp ((const void *) this->rep_, - (const void *) s.rep_, - this->len_ * sizeof (ACE_WSTRING_TYPE)) <= 0) - : (ACE_OS::memcmp ((const void *) this->rep_, - (const void *) s.rep_, - s.len_ * sizeof (ACE_WSTRING_TYPE)) < 0); -} - -// Greater than comparison operator. - -ACE_INLINE int -ACE_WString::operator > (const ACE_WString &s) const -{ - ACE_TRACE ("ACE_WString::operator >"); - return (this->len_ <= s.len_) - ? (ACE_OS::memcmp ((const void *) this->rep_, - (const void *) s.rep_, - this->len_ * sizeof (ACE_WSTRING_TYPE)) > 0) - : (ACE_OS::memcmp ((const void *) this->rep_, - (const void *) s.rep_, - s.len_ * sizeof (ACE_WSTRING_TYPE)) >= 0); -} - - -// Comparison operator. - -ACE_INLINE int -ACE_WString::operator!= (const ACE_WString &s) const -{ - ACE_TRACE ("ACE_WString::operator!="); - return !(*this == s); -} - -ACE_INLINE int -ACE_WString::compare (const ACE_WString &s) const -{ - ACE_TRACE ("ACE_WString::compare"); - - return ACE_OS::memcmp ((const void *) this->rep_, - (const void *) s.rep_, - this->len_ * sizeof (ACE_WSTRING_TYPE)); -} - -// Return the character in the string. - -ACE_INLINE ACE_WSTRING_TYPE -ACE_WString::operator[] (size_t slot) const -{ - ACE_TRACE ("ACE_WString::operator[]"); - return this->rep_[slot]; -} - -// Return the character in the string. - -ACE_INLINE ACE_WSTRING_TYPE & -ACE_WString::operator[] (size_t slot) -{ - ACE_TRACE ("ACE_WString::operator[]"); - return this->rep_[slot]; -} - -ACE_INLINE int -ACE_WString::find (const ACE_WSTRING_TYPE *s, int pos) const -{ - ACE_WSTRING_TYPE *substr = this->rep_ + pos; - const ACE_WSTRING_TYPE *pointer = ACE_WString::strstr (substr, s); - if (pointer == 0) - return ACE_WString::npos; - else - return pointer - substr; -} - -ACE_INLINE int -ACE_WString::find (ACE_WSTRING_TYPE c, int pos) const -{ - if (pos == ACE_WString::npos) - pos = this->len_; - - for (size_t i = pos; i < this->len_; i++) - if (this->rep_[i] == c) - return ACE_static_cast (int, i); - - return ACE_WString::npos; -} - -ACE_INLINE int -ACE_WString::strstr (const ACE_WString &s) const -{ - ACE_TRACE ("ACE_WString::strstr"); - - return this->find (s.rep_); -} - -ACE_INLINE int -ACE_WString::find (const ACE_WString &str, int pos) const -{ - return this->find (str.rep_, pos); -} - -ACE_INLINE int -ACE_WString::rfind (ACE_WSTRING_TYPE c, int pos) const -{ - if (pos == ACE_WString::npos) - pos = this->len_; - - for (int i = pos - 1; i >= 0; i--) - if (this->rep_[i] == c) - return i; - - return ACE_WString::npos; -} - -ACE_INLINE size_t -ACE_WString::length (void) const -{ - ACE_TRACE ("ACE_WString::length"); - return this->len_; -} - -ACE_INLINE u_long -ACE_WString::hash (void) const -{ - return ACE::hash_pjw - (ACE_reinterpret_cast (char *, ACE_const_cast (ACE_WSTRING_TYPE *, - this->rep_)), - this->len_ * sizeof (ACE_WSTRING_TYPE)); -} - - -ACE_INLINE -ACE_Auto_String_Free::ACE_Auto_String_Free (char* p) - : p_ (p) -{ -} - -ACE_INLINE -ACE_Auto_String_Free::ACE_Auto_String_Free (ACE_Auto_String_Free& rhs) - : p_ (rhs.p_) -{ - rhs.p_ = 0; -} - -ACE_INLINE void -ACE_Auto_String_Free::reset (char* p) -{ - if (this->p_ != 0) - ACE_OS::free (this->p_); - this->p_ = p; -} - -ACE_INLINE ACE_Auto_String_Free& -ACE_Auto_String_Free::operator= (ACE_Auto_String_Free& rhs) -{ - if (this != &rhs) - { - this->reset (rhs.p_); - rhs.p_ = 0; - } - return *this; -} - -ACE_INLINE -ACE_Auto_String_Free::~ACE_Auto_String_Free (void) -{ - this->reset (0); -} - -ACE_INLINE char* -ACE_Auto_String_Free::operator* (void) const -{ - return this->p_; -} - -ACE_INLINE char -ACE_Auto_String_Free::operator[] (int i) const -{ - return this->p_[i]; -} - -ACE_INLINE char* -ACE_Auto_String_Free::get (void) const -{ - return this->p_; -} - -ACE_INLINE char* -ACE_Auto_String_Free::release (void) -{ - char* p = this->p_; - this->p_ = 0; - return p; -} diff --git a/ace/SV_Message.cpp b/ace/SV_Message.cpp deleted file mode 100644 index fef83458651..00000000000 --- a/ace/SV_Message.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// SV_Message.cpp -// $Id$ - -#include "ace/SV_Message.h" - -#if !defined (__ACE_INLINE__) -#include "ace/SV_Message.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, SV_Message, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SV_Message) - -void -ACE_SV_Message::dump (void) const -{ - ACE_TRACE ("ACE_SV_Message::dump"); -} - diff --git a/ace/SV_Message.h b/ace/SV_Message.h deleted file mode 100644 index 64d36b235a6..00000000000 --- a/ace/SV_Message.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SV_Message.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SV_MESSAGE_H -#define ACE_SV_MESSAGE_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_SV_Message -{ - // = TITLE - // Defines the header file for the C++ wrapper for message queues. */ -public: - // = Initialization and termination methods. - ACE_SV_Message (long type = 0); - ~ACE_SV_Message (void); - - // = Get/set the message type. - long type (void) const; - void type (long); - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - long type_; - // Type of the message. -}; - -#if defined (__ACE_INLINE__) -#include "ace/SV_Message.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_SV_MESSAGE_H */ diff --git a/ace/SV_Message.i b/ace/SV_Message.i deleted file mode 100644 index 8c08e41d151..00000000000 --- a/ace/SV_Message.i +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SV_Message.i - -ACE_INLINE -ACE_SV_Message::ACE_SV_Message (long t) - : type_ (t) -{ - ACE_TRACE ("ACE_SV_Message::ACE_SV_Message"); -} - -ACE_INLINE -ACE_SV_Message::~ACE_SV_Message (void) -{ - ACE_TRACE ("ACE_SV_Message::~ACE_SV_Message"); -} - -ACE_INLINE long -ACE_SV_Message::type (void) const -{ - ACE_TRACE ("ACE_SV_Message::type"); - return this->type_; -} - -ACE_INLINE void -ACE_SV_Message::type (long t) -{ - ACE_TRACE ("ACE_SV_Message::type"); - this->type_ = t; -} diff --git a/ace/SV_Message_Queue.cpp b/ace/SV_Message_Queue.cpp deleted file mode 100644 index b1090c1c3f8..00000000000 --- a/ace/SV_Message_Queue.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SV_Message_Queue.cpp -// $Id$ - -#include "ace/SV_Message_Queue.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SV_Message_Queue.i" -#endif - -ACE_RCSID(ace, SV_Message_Queue, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SV_Message_Queue) - -void -ACE_SV_Message_Queue::dump (void) const -{ - ACE_TRACE ("ACE_SV_Message_Queue::dump"); -} - -ACE_SV_Message_Queue::ACE_SV_Message_Queue (void) -{ - ACE_TRACE ("ACE_SV_Message_Queue::ACE_SV_Message_Queue"); -} - -ACE_SV_Message_Queue::~ACE_SV_Message_Queue (void) -{ - ACE_TRACE ("ACE_SV_Message_Queue::~ACE_SV_Message_Queue"); -} - -ACE_SV_Message_Queue::ACE_SV_Message_Queue (key_t external_id, - int create, - int perms) -{ - ACE_TRACE ("ACE_SV_Message_Queue::ACE_SV_Message_Queue"); - if (this->open (external_id, create, perms) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SV_Message_Queue::ACE_SV_Message_Queue"))); -} diff --git a/ace/SV_Message_Queue.h b/ace/SV_Message_Queue.h deleted file mode 100644 index a06139e6aa1..00000000000 --- a/ace/SV_Message_Queue.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SV_Message_Queue.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SV_MESSAGE_QUEUE_H -#define ACE_SV_MESSAGE_QUEUE_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SV_Message.h" - -class ACE_Export ACE_SV_Message_Queue -{ - // = TITLE - // Defines the header file for the C++ wrapper for System V IPC - // message queues. -public: - // = Useful symbolic constants. - enum - { - ACE_CREATE = IPC_CREAT, - ACE_OPEN = 0, - ACE_NOWAIT = IPC_NOWAIT - }; - - // = Initialization and termination methods. - ACE_SV_Message_Queue (void); - ACE_SV_Message_Queue (key_t external_id, - int create = ACE_SV_Message_Queue::ACE_OPEN, - int perms = ACE_DEFAULT_FILE_PERMS); - int open (key_t external_id, - int create = ACE_SV_Message_Queue::ACE_OPEN, - int perms = ACE_DEFAULT_FILE_PERMS); - // Open a message queue using the . - - ~ACE_SV_Message_Queue (void); - - int close (void); - // Close down this instance of the message queue without removing it - // from the system. - - int remove (void); - // Close down and remove the message queue from the system. - - - // = Message transfer methods. - int recv (ACE_SV_Message &mb, - int length, - long mtype = 0, - int mflags = 0); - - int send (const ACE_SV_Message &mb, - int length, - int mflags = 0); - - int control (int option, void *arg = 0); - // Access the underlying control operations. - - // = Get/set the underly internal id. - int get_id (void); - void set_id (int); - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - int internal_id_; - // Returned from the underlying system call. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SV_Message_Queue.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SV_MESSAGE_QUEUE_H */ diff --git a/ace/SV_Message_Queue.i b/ace/SV_Message_Queue.i deleted file mode 100644 index 45fd1f4efcc..00000000000 --- a/ace/SV_Message_Queue.i +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SV_Message_Queue.i - -#include "ace/SV_Message_Queue.h" - -// Open a message queue using the . - -ASYS_INLINE int -ACE_SV_Message_Queue::open (key_t external_id, int create, int perms) -{ - ACE_TRACE ("ACE_SV_Message_Queue::open"); - return this->internal_id_ = ACE_OS::msgget (external_id, create | perms); -} - -// What does it mean to close a message queue?! - -ASYS_INLINE int -ACE_SV_Message_Queue::close (void) -{ - ACE_TRACE ("ACE_SV_Message_Queue::close"); - this->internal_id_ = -1; - return 1; -} - -ASYS_INLINE int -ACE_SV_Message_Queue::control (int option, void *arg) -{ - ACE_TRACE ("ACE_SV_Message_Queue::control"); - return ACE_OS::msgctl (this->internal_id_, option, - (msqid_ds *) arg); -} - -ASYS_INLINE int -ACE_SV_Message_Queue::remove (void) -{ - ACE_TRACE ("ACE_SV_Message_Queue::remove"); - int result = this->control (IPC_RMID); - this->internal_id_ = -1; - return result; -} - -ASYS_INLINE int -ACE_SV_Message_Queue::get_id (void) -{ - ACE_TRACE ("ACE_SV_Message_Queue::get_id"); - return this->internal_id_; -} - -ASYS_INLINE void -ACE_SV_Message_Queue::set_id (int id) -{ - ACE_TRACE ("ACE_SV_Message_Queue::set_id"); - this->internal_id_ = id; -} - -ASYS_INLINE int -ACE_SV_Message_Queue::recv (ACE_SV_Message &mb, - int length, - long type, - int mflags) -{ - ACE_TRACE ("ACE_SV_Message_Queue::recv"); - return ACE_OS::msgrcv (this->internal_id_, (void *) &mb, - length, type, mflags); -} - -ASYS_INLINE int -ACE_SV_Message_Queue::send (const ACE_SV_Message &mb, - int length, - int mflags) -{ - ACE_TRACE ("ACE_SV_Message_Queue::send"); - return ACE_OS::msgsnd (this->internal_id_, (void *) &mb, - length, mflags); -} - diff --git a/ace/SV_Semaphore_Complex.cpp b/ace/SV_Semaphore_Complex.cpp deleted file mode 100644 index 401157b20f0..00000000000 --- a/ace/SV_Semaphore_Complex.cpp +++ /dev/null @@ -1,253 +0,0 @@ -// SV_Semaphore_Complex.cpp -// $Id$ - -/* -*- C++ -*- */ - -#include "ace/SV_Semaphore_Complex.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SV_Semaphore_Complex.i" -#endif - -ACE_RCSID(ace, SV_Semaphore_Complex, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SV_Semaphore_Complex) - -void -ACE_SV_Semaphore_Complex::dump (void) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::dump"); -} - -// initial value of process -const int ACE_SV_Semaphore_Complex::BIGCOUNT_ = 10000; - -// Define the ACE_SV_Semaphore operation arrays for the semop() calls. -sembuf ACE_SV_Semaphore_Complex::op_lock_[2] = -{ - {0, 0, 0}, // Wait for [0] (lock) to equal 0 - {0, 1, SEM_UNDO}, // then increment [0] to 1 - this locks it. - // UNDO to release the lock if processes exit - // before explicitly unlocking. -}; - -sembuf ACE_SV_Semaphore_Complex::op_endcreate_[2] = -{ - {1, -1, SEM_UNDO}, // Decrement [1] (proc counter) with undo on - // exit, UNDO to adjust proc counter if - // process exits before explicitly calling close() - {0, -1, SEM_UNDO}, // the decrement [0] (lock) back to 0 -}; - -sembuf ACE_SV_Semaphore_Complex::op_open_[1] = -{ - {1, -1, SEM_UNDO}, // Decrement [1] (proc counter) with undo on - // exit. -}; - -sembuf ACE_SV_Semaphore_Complex::op_close_[3] = -{ - {0, 0, 0}, // Wait for [0] (lock) to equal 0 - {0, 1, SEM_UNDO}, // then increment [0] to 1 - this lock it - {1, 1, SEM_UNDO}, // then increment [1] (proc counter) -}; - -sembuf ACE_SV_Semaphore_Complex::op_unlock_[1] = -{ - {0, -1, SEM_UNDO}, // Decrement [0] (lock) back to 0 -}; - -// Open or create an array of SV_Semaphores. We return 0 if all is OK, else -1. - -int -ACE_SV_Semaphore_Complex::open (key_t k, - int create, - int initial_value, - u_short nsems, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::open"); - if (k == IPC_PRIVATE) - return -1; - - this->key_ = k; - - // Must include a count for the 2 additional semaphores we use - // internally. - this->sem_number_ = nsems + 2; - - if (create == ACE_SV_Semaphore_Complex::ACE_CREATE) - { - int result; - - do - { - this->internal_id_ = ACE_OS::semget - (this->key_, - (u_short) 2 + nsems, - perms | ACE_SV_Semaphore_Complex::ACE_CREATE); - - if (this->internal_id_ == -1) - return -1; // permission problem or tables full - - // When the is created, we know - // that the value of all 3 members is 0. Get a lock on the - // by waiting for [0] to equal 0, - // then increment it. - - // There is a race condition here. There is the possibility - // that between the above and the below, - // another process can call out function which can - // remove the if that process is the last - // one using it. Therefor we handle the error condition of - // an invalid ID specifically below, and - // if it does happen, we just go back and create it again. - result = ACE_OS::semop (this->internal_id_, - &ACE_SV_Semaphore_Complex::op_lock_[0], - 2); - } - while (result == -1 && (errno == EINVAL || errno == EIDRM)); - - if (result == -1) - return -1; - - // Get the value of the process counter. If it equals 0, then no - // one has initialized the ACE_SV_Semaphore yet. - - int semval = ACE_SV_Semaphore_Simple::control (GETVAL, 0, 1); - - if (semval == -1) - return this->init (); - else if (semval == 0) - { - // We should initialize by doing a SETALL, but that would - // clear the adjust value that we set when we locked the - // ACE_SV_Semaphore above. Instead we do system calls to - // initialize [1], as well as all the nsems SV_Semaphores. - - if (ACE_SV_Semaphore_Simple::control (SETVAL, - ACE_SV_Semaphore_Complex::BIGCOUNT_, - 1) == -1) - return -1; - else - for (int i = 0; i < nsems; i++) - if (this->control (SETVAL, initial_value, i) == -1) - return -1; - } - - // Decrement the process counter and then release the lock. - return ACE_OS::semop (this->internal_id_, - &ACE_SV_Semaphore_Complex::op_endcreate_[0], - 2); - } - else - { - this->internal_id_ = ACE_OS::semget (this->key_, 2 + nsems, 0); - if (this->internal_id_ == -1) - return -1; // doesn't exist or tables full - - // Decrement the process counter. We don't need a lock to do this. - if (ACE_OS::semop (this->internal_id_, - &ACE_SV_Semaphore_Complex::op_open_[0], 1) < 0) - return this->init (); - return 0; - } -} - -int -ACE_SV_Semaphore_Complex::open (const char *name, - int flags, - int initial_value, - u_short nsems, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::open"); - return this->open (ACE_SV_Semaphore_Simple::name_2_key (name), - flags, initial_value, nsems, perms); -} - -// Close a ACE_SV_Semaphore. Unlike the remove above, this function -// is for a process to call before it exits, when it is done with the -// ACE_SV_Semaphore. We "decrement" the counter of processes using -// the ACE_SV_Semaphore, and if this was the last one, we can remove -// the ACE_SV_Semaphore. - -int -ACE_SV_Semaphore_Complex::close (void) -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::close"); - int semval; - - if (this->key_ == (key_t) - 1 || this->internal_id_ == -1) - return -1; - - // The following semop() first gets a lock on the ACE_SV_Semaphore, - // then increments [1] - the process number. - - if (ACE_OS::semop (this->internal_id_, - &ACE_SV_Semaphore_Complex::op_close_[0], - 3) == -1) - return -1; - - // Now that we have a lock, read the value of the process counter to - // see if this is the last reference to the ACE_SV_Semaphore. There - // is a race condition here - see the comments in create (). - - if ((semval = ACE_SV_Semaphore_Simple::control (GETVAL, 0, 1)) == -1) - return -1; - - if (semval > ACE_SV_Semaphore_Complex::BIGCOUNT_) - return -1; - else if (semval == ACE_SV_Semaphore_Complex::BIGCOUNT_) - return this->remove (); - else - { - int result = ACE_OS::semop (this->internal_id_, - &ACE_SV_Semaphore_Complex::op_unlock_[0], 1); - this->init (); - return result; - } -} - -ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex (key_t k, - int flags, - int initial_value, - u_short nsems, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex"); - if (this->open (k, flags, initial_value, nsems, perms) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SV_Semaphore_Complex"))); -} - -ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex (const char *name, - int flags, - int initial_value, - u_short nsems, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex"); - - key_t key; - - if (name == 0) - key = ACE_DEFAULT_SEM_KEY; - else - key = this->name_2_key (name); - - if (this->open (key, flags, initial_value, nsems, perms) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SV_Semaphore_Complex"))); -} - -ACE_SV_Semaphore_Complex::~ACE_SV_Semaphore_Complex (void) -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::~ACE_SV_Semaphore_Complex"); - if (this->internal_id_ >= 0) - this->close (); -} - -ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex (void) -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex"); - this->init (); -} diff --git a/ace/SV_Semaphore_Complex.h b/ace/SV_Semaphore_Complex.h deleted file mode 100644 index 6d3cbd81dc6..00000000000 --- a/ace/SV_Semaphore_Complex.h +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// ACE_SV_Semaphore_Complex.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SV_SEMAPHORE_COMPLEX_H -#define ACE_SV_SEMAPHORE_COMPLEX_H -#include "ace/pre.h" - -#include "ace/SV_Semaphore_Simple.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_SV_Semaphore_Complex : private ACE_SV_Semaphore_Simple -{ - // = TITLE - // This is a more complex semaphore wrapper that handles race - // conditions for initialization correctly... - // - // = DESCRIPTION - // This code is a port to C++, inspired by: W. Richard Stevens - // from his book: UNIX Network Programming (Prentice Hall, ISBN - // 0-13-949876-1 - 1990). We provide a simpler and easier to - // understand interface to the System V Semaphore system calls. - // We create and use a 2 + n-member set for the requested - // . The first member, [0], is a - // counter used to know when all processes have finished with - // the . The counter is initialized - // to a large number, decremented on every create or open and - // incremented on every close. This way we can use the "adjust" - // feature provided by System V so that any process that exit's - // without calling is accounted for. It doesn't help us - // if the last process does this (as we have no way of getting - // control to remove the ) but it - // will work if any process other than the last does an exit - // (intentional or unintentional). - // - // The second member, [1], of the semaphore is used as a lock - // variable to avoid any race conditions in the and - // functions. - // - // The members beyond [1] are actual semaphore values in the - // array of semaphores, which may be sized by the user in the - // constructor. -public: - enum - { - ACE_CREATE = IPC_CREAT, - ACE_OPEN = 0 - }; - - // = Initialization and termination methods. - ACE_SV_Semaphore_Complex (void); - ACE_SV_Semaphore_Complex (key_t key, - int create = ACE_SV_Semaphore_Complex::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - ACE_SV_Semaphore_Complex (const char *name, - int create = ACE_SV_Semaphore_Complex::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - ~ACE_SV_Semaphore_Complex (void); - - int open (const char *name, - int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - // Open or create an array of SV_Semaphores. We return 0 if all is - // OK, else -1. - - int open (key_t key, - int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - // Open or create an array of SV_Semaphores. We return 0 if all is - // OK, else -1. - - int close (void); - // Close an ACE_SV_Semaphore. Unlike the method, this - // method is for a process to call before it exits, when it is done - // with the ACE_SV_Semaphore. We "decrement" the counter of - // processes using the ACE_SV_Semaphore, and if this was the last - // one, we can remove the ACE_SV_Semaphore. - - // = Semaphore acquire and release methods. - - int acquire (u_short n = 0, int flags = 0) const; - // Acquire the semaphore. - - int acquire_read (u_short n = 0, int flags = 0) const; - // Acquire a semaphore for reading. - - int acquire_write (u_short n = 0, int flags = 0) const; - // Acquire a semaphore for writing - - int tryacquire (u_short n = 0, int flags = 0) const; - // Try to acquire the semaphore. - - int tryacquire_read (u_short n = 0, int flags = 0) const; - // Try to acquire the semaphore for reading. - - int tryacquire_write (u_short n = 0, int flags = 0) const; - // Try to acquire the semaphore for writing. - - int release (u_short n = 0, int flags = 0) const; - // Release the semaphore. - - // = Semaphore operation methods. - int op (int val, u_short n = 0, int flags = 0) const; - int op (sembuf op_vec[], u_short n) const; - - // = Semaphore control methods. - int control (int cmd, semun arg, u_short n = 0) const; - int control (int cmd, int value = 0, u_short n = 0) const; - - // = Upgrade access control... - ACE_USING ACE_SV_Semaphore_Simple::get_id; - ACE_USING ACE_SV_Semaphore_Simple::remove; - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - static const int BIGCOUNT_; - static sembuf op_lock_[2]; - static sembuf op_endcreate_[2]; - static sembuf op_open_[1]; - static sembuf op_close_[3]; - static sembuf op_unlock_[1]; -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SV_Semaphore_Complex.i" -#endif - -#include "ace/post.h" -#endif /* ACE_SV_SEMAPHORE_COMPLEX_H */ diff --git a/ace/SV_Semaphore_Complex.i b/ace/SV_Semaphore_Complex.i deleted file mode 100644 index 82ce23bbbef..00000000000 --- a/ace/SV_Semaphore_Complex.i +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SV_Semaphore_Complex.i - -#include "ace/Trace.h" - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::acquire (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::acquire"); - return ACE_SV_Semaphore_Simple::acquire ((u_short) n + 2, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::acquire_read (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::acquire_read"); - return this->acquire (n, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::acquire_write (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::acquire_write"); - return this->acquire (n, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::tryacquire (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::tryacquire"); - return ACE_SV_Semaphore_Simple::tryacquire ((u_short) n + 2, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::tryacquire_read (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::tryacquire_read"); - return this->tryacquire (n, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::tryacquire_write (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::tryacquire_write"); - return this->tryacquire (n, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::release (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::release"); - return ACE_SV_Semaphore_Simple::release ((u_short) n + 2, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::op (int val, u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::op"); - return ACE_SV_Semaphore_Simple::op (val, (u_short) n + 2, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::op (sembuf op_vec[], u_short n) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::op"); - return ACE_SV_Semaphore_Simple::op (op_vec, (u_short) n + 2); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::control (int cmd, semun arg, u_short n) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::control"); - return ACE_SV_Semaphore_Simple::control (cmd, arg, (u_short) n + 2); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Complex::control (int cmd, int value, u_short n) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Complex::control"); - return ACE_SV_Semaphore_Simple::control (cmd, value, (u_short) n + 2); -} diff --git a/ace/SV_Semaphore_Simple.cpp b/ace/SV_Semaphore_Simple.cpp deleted file mode 100644 index 176c06d2bb8..00000000000 --- a/ace/SV_Semaphore_Simple.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// $Id$ - -/* -*- C++ -*- */ - -#include "ace/SV_Semaphore_Simple.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SV_Semaphore_Simple.i" -#endif - -ACE_RCSID(ace, SV_Semaphore_Simple, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SV_Semaphore_Simple) - -void -ACE_SV_Semaphore_Simple::dump (void) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::dump"); -} - -int -ACE_SV_Semaphore_Simple::control (int cmd, - int value, - u_short semnum) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::control"); - if (this->internal_id_ == -1) - return -1; - else - { - semun semctl_arg; - - semctl_arg.val = value; - return ACE_OS::semctl (this->internal_id_, - semnum, - cmd, - semctl_arg); - } -} - -int -ACE_SV_Semaphore_Simple::init (key_t k, int i) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::init"); - this->key_ = k; - this->internal_id_ = i; - return 0; -} - -// General ACE_SV_Semaphore operation. Increment or decrement by a -// specific amount (positive or negative; amount can`t be zero). - -int -ACE_SV_Semaphore_Simple::op (int val, u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::op"); - sembuf op_op; - - op_op.sem_num = n; - op_op.sem_flg = flags; - - if (this->internal_id_ == -1) - return -1; - else if ((op_op.sem_op = val) == 0) - return -1; - else - return ACE_OS::semop (this->internal_id_, &op_op, 1); -} - -// Open or create one or more SV_Semaphores. We return 0 if all is -// OK, else -1. - -int -ACE_SV_Semaphore_Simple::open (key_t k, - int flags, - int initial_value, - u_short n, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::open"); - union semun ivalue; - - if (k == IPC_PRIVATE || k == ACE_static_cast (key_t, ACE_INVALID_SEM_KEY)) - return -1; - - ivalue.val = initial_value; - this->key_ = k; - this->sem_number_ = n; - - this->internal_id_ = ACE_OS::semget (this->key_, n, perms | flags); - - if (this->internal_id_ == -1) - return -1; - - if (ACE_BIT_ENABLED (flags, IPC_CREAT)) - for (int i = 0; i < n; i++) - if (ACE_OS::semctl (this->internal_id_, i, SETVAL, ivalue) == -1) - return -1; - - return 0; -} - -ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (key_t k, - int flags, - int initial_value, - u_short n, - int perms) - : key_ (k) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"); - if (this->open (k, flags, initial_value, n, perms) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_SV_Semaphore::ACE_SV_Semaphore"))); -} - -// Convert name to key. This function is used internally to create keys -// for the semaphores. -// -// The method for generating names is a 32 bit CRC, but still we -// measured close to collition ratio of nearly 0.1% for -// ACE::unique_name()-like strings. - -key_t -ACE_SV_Semaphore_Simple::name_2_key (const char *name) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::name_2_key"); - - if (name == 0) - { - errno = EINVAL; - return ACE_static_cast (key_t, ACE_INVALID_SEM_KEY); - } - - // Basically "hash" the values in the . This won't - // necessarily guarantee uniqueness of all keys. - // But (IMHO) CRC32 is good enough for most purposes (Carlos) - return (key_t) ACE::crc32 (name); -} - -// Open or create a ACE_SV_Semaphore. We return 1 if all is OK, else -// 0. - -int -ACE_SV_Semaphore_Simple::open (const char *name, - int flags, - int initial_value, - u_short n, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::open"); - - key_t key; - - if (name == 0) - key = ACE_DEFAULT_SEM_KEY; - else - key = this->name_2_key (name); - - return this->open (key, flags, initial_value, n, perms); -} - -ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (const char *name, - int flags, - int initial_value, - u_short n, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"); - if (this->open (name, - flags, - initial_value, - n, - perms) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"))); -} - -ACE_SV_Semaphore_Simple::~ACE_SV_Semaphore_Simple (void) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::~ACE_SV_Semaphore_Simple"); - this->close (); -} - -ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (void) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"); - this->init (); -} - -// Remove all SV_Semaphores associated with a particular key. This -// call is intended to be called from a server, for example, when it -// is being shut down, as we do an IPC_RMID on the ACE_SV_Semaphore, -// regardless of whether other processes may be using it or not. Most -// other processes should use close() below. - -int -ACE_SV_Semaphore_Simple::remove (void) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::remove"); - int result = this->control (IPC_RMID); - ((ACE_SV_Semaphore_Simple *) this)->init (); - return result; -} diff --git a/ace/SV_Semaphore_Simple.h b/ace/SV_Semaphore_Simple.h deleted file mode 100644 index 9350fb8cd7b..00000000000 --- a/ace/SV_Semaphore_Simple.h +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SV_Semaphore_Simple.h -// -// = AUTHOR -// Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_SV_SEMAPHORE_SIMPLE_H -#define ACE_SV_SEMAPHORE_SIMPLE_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_SV_Semaphore_Simple -{ - // = TITLE - // This is a simple semaphore package that assumes there are - // no race conditions for initialization (i.e., the order of - // process startup must be well defined). -public: - enum - { - ACE_CREATE = IPC_CREAT, - ACE_EXCL = IPC_EXCL, - ACE_OPEN = 0 - }; - - // = Initialization and termination methods. - ACE_SV_Semaphore_Simple (void); - ACE_SV_Semaphore_Simple (key_t key, - int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - ACE_SV_Semaphore_Simple (const char *name, - int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - ~ACE_SV_Semaphore_Simple (void); - - int open (const char *name, - int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - - int open (key_t key, - int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); - // Open or create one or more SV_Semaphores. We return 0 if all is - // OK, else -1. - - int close (void); - // Close a ACE_SV_Semaphore, marking it as invalid for subsequent - // operations... - - int remove (void) const; - // Remove all SV_Semaphores associated with a particular key. This - // call is intended to be called from a server, for example, when it - // is being shut down, as we do an IPC_RMID on the ACE_SV_Semaphore, - // regardless of whether other processes may be using it or not. - // Most other processes should use below. - - // = Semaphore acquire and release methods. - int acquire (u_short n = 0, int flags = 0) const; - // Wait until a ACE_SV_Semaphore's value is greater than 0, the - // decrement it by 1 and return. Dijkstra's P operation, Tannenbaums - // DOWN operation. - - int acquire_read (u_short n = 0, int flags = 0) const; - // Acquire a semaphore for reading. - - int acquire_write (u_short n = 0, int flags = 0) const; - // Acquire a semaphore for writing - - int tryacquire (u_short n = 0, int flags = 0) const; - // Non-blocking version of . - - int tryacquire_read (u_short n = 0, int flags = 0) const; - // Try to acquire the semaphore for reading. - - int tryacquire_write (u_short n = 0, int flags = 0) const; - // Try to acquire the semaphore for writing. - - int release (u_short n = 0, int flags = 0) const; - // Increment ACE_SV_Semaphore by one. Dijkstra's V operation, - // Tannenbaums UP operation. - - // = Semaphore operation methods. - int op (int val, u_short semnum = 0, int flags = SEM_UNDO) const; - // General ACE_SV_Semaphore operation. Increment or decrement by a - // specific amount (positive or negative; amount can`t be zero). - - int op (sembuf op_vec[], u_short nsems) const; - // General ACE_SV_Semaphore operation on an array of SV_Semaphores. - - // = Semaphore control methods. - int control (int cmd, semun arg, u_short n = 0) const; - int control (int cmd, int value = 0, u_short n = 0) const; - - int get_id (void) const; - // Get underlying internal id. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - key_t key_; - // Semaphore key. - - int internal_id_; - // Internal ID to identify the semaphore group within this process. - - int sem_number_; - // Number of semaphores we're creating. - - int init (key_t k = ACE_static_cast (key_t, ACE_INVALID_SEM_KEY), - int i = -1); - key_t name_2_key (const char *name); - // Convert name to key This function is used internally to create - // keys for the semaphores. A valid name contains letters and - // digits only and MUST start with a letter. - // - // The method for generating names is not very sophisticated, so - // caller should not pass strings which match each other for the first - // LUSED characters when he wants to get a different key. -}; - -#if !defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/SV_Semaphore_Simple.i" -#endif - -#include "ace/post.h" -#endif /* _SV_SEMAPHORE_SIMPLE_H */ diff --git a/ace/SV_Semaphore_Simple.i b/ace/SV_Semaphore_Simple.i deleted file mode 100644 index e18acd95a84..00000000000 --- a/ace/SV_Semaphore_Simple.i +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SV_Semaphore_Simple.i - -#include "ace/Trace.h" - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::control (int cmd, - semun arg, - u_short n) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::control"); - return this->internal_id_ == -1 ? - -1 : ACE_OS::semctl (this->internal_id_, n, cmd, arg); -} - -// Close a ACE_SV_Semaphore, marking it as invalid for subsequent -// operations... - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::close (void) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::close"); - return this->init (); -} - -// General ACE_SV_Semaphore operation on an array of SV_Semaphores. - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::op (sembuf op_vec[], u_short n) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::op"); - return this->internal_id_ == -1 - ? -1 : ACE_OS::semop (this->internal_id_, op_vec, n); -} - -// Wait until a ACE_SV_Semaphore's value is greater than 0, the -// decrement it by 1 and return. Dijkstra's P operation, Tannenbaums -// DOWN operation. - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::acquire (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::acquire"); - return this->op (-1, n, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::acquire_read (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::acquire_read"); - return this->acquire (n, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::acquire_write (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::acquire_write"); - return this->acquire (n, flags); -} - -// Non-blocking version of acquire(). - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::tryacquire (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::tryacquire"); - return this->op (-1, n, flags | IPC_NOWAIT); -} - -// Non-blocking version of acquire(). - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::tryacquire_read (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::tryacquire_read"); - return this->tryacquire (n, flags); -} - -// Non-blocking version of acquire(). - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::tryacquire_write (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::tryacquire_write"); - return this->tryacquire (n, flags); -} - -// Increment ACE_SV_Semaphore by one. Dijkstra's V operation, -// Tannenbaums UP operation. - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::release (u_short n, int flags) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::release"); - return this->op (1, n, flags); -} - -ASYS_INLINE int -ACE_SV_Semaphore_Simple::get_id (void) const -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::get_id"); - return this->internal_id_; -} - diff --git a/ace/SV_Shared_Memory.cpp b/ace/SV_Shared_Memory.cpp deleted file mode 100644 index a0b0ebedca5..00000000000 --- a/ace/SV_Shared_Memory.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// SV_Shared_Memory.cpp -// $Id$ - -#include "ace/SV_Shared_Memory.h" - -#if !defined (__ACE_INLINE__) -#include "ace/SV_Shared_Memory.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, SV_Shared_Memory, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_SV_Shared_Memory) - -void -ACE_SV_Shared_Memory::dump (void) const -{ - ACE_TRACE ("ACE_SV_Shared_Memory::dump"); -} - -// Creates a shared memory segment of SIZE bytes and *does* attach to -// this segment. - -int -ACE_SV_Shared_Memory::open_and_attach (key_t external_id, - size_t sz, - int create, - int perms, - void *virtual_addr, - int flags) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::open_and_attach"); - if (this->open (external_id, sz, create, perms) == -1) - return -1; - else if (this->attach (virtual_addr, flags) == -1) - return -1; - else - return 0; -} - -// Constructor interface to this->open_and_attach () member function. - -ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (key_t external_id, - size_t sz, - int create, - int perms, - void *virtual_addr, - int flags) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"); - if (this->open_and_attach (external_id, sz, create, - perms, virtual_addr, flags) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"))); -} - -// The "do nothing" constructor. - -ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (void) - : internal_id_ (0), - size_ (0), - segment_ptr_ (0) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"); -} - -// Added this constructor to accept an internal id, the one generated -// when a server constructs with the key IPC_PRIVATE. The client can -// be passed ACE_SV_Shared_Memory::internal_id via a socket and call -// this construtor to attach the existing segment. This prevents -// having to hard-code a key in advance. Courtesy of Marvin Wolfthal -// (maw@fsg.com). - -ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (ACE_HANDLE int_id, - int flags) - : internal_id_ (int_id), - size_ (0) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"); - if (this->attach (0, flags) == -1) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"))); -} diff --git a/ace/SV_Shared_Memory.h b/ace/SV_Shared_Memory.h deleted file mode 100644 index 73b33d75c0b..00000000000 --- a/ace/SV_Shared_Memory.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// SV_Shared_Memory.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SV_SHARED_MEMORY_H -#define ACE_SV_SHARED_MEMORY_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_SV_Shared_Memory -{ - // = TITLE - // This is a wrapper for System V shared memory. -public: - enum - { - ACE_CREATE = IPC_CREAT, - ACE_OPEN = 0 - }; - - // = Initialization and termination methods. - ACE_SV_Shared_Memory (void); - ACE_SV_Shared_Memory (key_t external_id, - size_t size, - int create, - int perms = ACE_DEFAULT_FILE_PERMS, - void *virtual_addr = 0, - int flags = 0); - - ACE_SV_Shared_Memory (ACE_HANDLE internal_id, - int flags = 0); - - int open (key_t external_id, - size_t size, - int create = ACE_SV_Shared_Memory::ACE_OPEN, - int perms = ACE_DEFAULT_FILE_PERMS); - - int open_and_attach (key_t external_id, - size_t size, - int create = ACE_SV_Shared_Memory::ACE_OPEN, - int perms = ACE_DEFAULT_FILE_PERMS, - void *virtual_addr = 0, - int flags = 0); - - int attach (void *virtual_addr = 0, - int flags =0); - // Attach this shared memory segment. - - int detach (void); - // Detach this shared memory segment. - - int remove (void); - // Remove this shared memory segment. - - int control (int cmd, void *buf); - // Forward to underlying System V . - - // = Segment-related info. - void *get_segment_ptr (void) const; - int get_segment_size (void) const; - - ACE_HANDLE get_id (void) const; - // Return the ID of the shared memory segment (i.e., an ACE_HANDLE). - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - enum - { - ALIGN_WORDB = 8 // Most restrictive alignment. - }; - - ACE_HANDLE internal_id_; - // Internal identifier. - - int size_; - // Size of the mapped segment. - - void *segment_ptr_; - // Pointer to the beginning of the segment. - - int round_up (size_t len); - // Round up to an appropriate page size. -}; - -#if defined (__ACE_INLINE__) -#include "ace/SV_Shared_Memory.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_SV_SHARED_MEMORY_H */ diff --git a/ace/SV_Shared_Memory.i b/ace/SV_Shared_Memory.i deleted file mode 100644 index 9fd4083ff95..00000000000 --- a/ace/SV_Shared_Memory.i +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// SV_Shared_Memory.i - -#include "ace/SV_Shared_Memory.h" - -ACE_INLINE int -ACE_SV_Shared_Memory::round_up (size_t len) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::round_up"); - return (len + ACE_SV_Shared_Memory::ALIGN_WORDB - 1) & ~(ACE_SV_Shared_Memory::ALIGN_WORDB - 1); -} - -// Creates a shared memory segment of SIZE bytes. Does *not* attach -// this memory segment... - -ACE_INLINE int -ACE_SV_Shared_Memory::open (key_t external_id, size_t sz, int create, int perms) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::open"); -#if defined (ACE_WIN32) - ACE_UNUSED_ARG(perms); - ACE_UNUSED_ARG(create); - ACE_UNUSED_ARG(sz); - ACE_UNUSED_ARG(external_id); - ACE_NOTSUP_RETURN (-1); -#else - this->segment_ptr_ = 0; - this->size_ = sz; - - this->internal_id_ = ACE_OS::shmget (external_id, sz, create | perms); - - return this->internal_id_ == -1 ? -1 : 0; -#endif /* ACE_WIN32 */ -} - -// Attachs to the shared memory segment. - -ACE_INLINE int -ACE_SV_Shared_Memory::attach (void *virtual_addr, int flags) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::attach"); -#if defined (ACE_WIN32) - ACE_UNUSED_ARG(flags); - ACE_UNUSED_ARG(virtual_addr); - ACE_NOTSUP_RETURN (-1); -#else - this->segment_ptr_ = ACE_OS::shmat (this->internal_id_, virtual_addr, flags); - return this->segment_ptr_ == (void *) -1 ? -1 : 0; -#endif /* ACE_WIN32 */ -} - -// Interface to the underlying shared memory control function. - -ACE_INLINE int -ACE_SV_Shared_Memory::control (int cmd, void *buf) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::control"); -#if defined (ACE_WIN32) - ACE_UNUSED_ARG(cmd); - ACE_UNUSED_ARG(buf); - - ACE_NOTSUP_RETURN (-1); -#else - return ACE_OS::shmctl (this->internal_id_, cmd, (struct shmid_ds *) buf); -#endif /* ACE_WIN32 */ -} - -// The overall size of the segment. - -ACE_INLINE int -ACE_SV_Shared_Memory::get_segment_size (void) const -{ - ACE_TRACE ("ACE_SV_Shared_Memory::get_segment_size"); - return this->size_; -} - -// Removes the shared memory segment. - -ACE_INLINE int -ACE_SV_Shared_Memory::remove (void) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::remove"); -#if defined (ACE_WIN32) - ACE_NOTSUP_RETURN (-1); -#else - return ACE_OS::shmctl (this->internal_id_, IPC_RMID, 0); -#endif /* ACE_WIN32 */ -} - -// Detach the current binding between this->segment_ptr and the shared -// memory segment. - -ACE_INLINE int -ACE_SV_Shared_Memory::detach (void) -{ - ACE_TRACE ("ACE_SV_Shared_Memory::detach"); - return ACE_OS::shmdt (this->segment_ptr_); -} - -ACE_INLINE void * -ACE_SV_Shared_Memory::get_segment_ptr (void) const -{ - ACE_TRACE ("ACE_SV_Shared_Memory::get_segment_ptr"); - return this->segment_ptr_; -} - -ACE_INLINE ACE_HANDLE -ACE_SV_Shared_Memory::get_id (void) const -{ - ACE_TRACE ("ACE_SV_Shared_Memory::get_id"); - return this->internal_id_; -} diff --git a/ace/Sched_Params.cpp b/ace/Sched_Params.cpp deleted file mode 100644 index e590119681c..00000000000 --- a/ace/Sched_Params.cpp +++ /dev/null @@ -1,277 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// Sched_Params.cpp -// -// = CREATION DATE -// 28 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -#include "ace/Sched_Params.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Sched_Params.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Sched_Params, "$Id$") - -int -ACE_Sched_Params::priority_min (const Policy policy, - const int scope) -{ -#if defined (ACE_HAS_PRIOCNTL) && defined (ACE_HAS_STHREADS) - ACE_UNUSED_ARG (scope); - - // Assume that ACE_SCHED_OTHER indicates TS class, and that other - // policies indicate RT class. - - if (policy == ACE_SCHED_OTHER) - { - // Get the priority class ID and attributes. - pcinfo_t pcinfo; - // The following is just to avoid Purify warnings about unitialized - // memory reads. - ACE_OS::memset (&pcinfo, 0, sizeof pcinfo); - ACE_OS::strcpy (pcinfo.pc_clname, "TS"); - - if (ACE_OS::priority_control (P_ALL /* ignored */, - P_MYID /* ignored */, - PC_GETCID, - (char *) &pcinfo) == -1) - // Just hope that priority range wasn't configured from -1 - // .. 1 - return -1; - - // OK, now we've got the class ID in pcinfo.pc_cid. In - // addition, the maximum configured time-share priority is in - // ((tsinfo_t *) pcinfo.pc_clinfo)->ts_maxupri. The minimum - // priority is just the negative of that. - - return -((tsinfo_t *) pcinfo.pc_clinfo)->ts_maxupri; - } - else - return 0; -#elif defined (ACE_HAS_PTHREADS) && !defined(ACE_LACKS_SETSCHED) - - switch (scope) - { - case ACE_SCOPE_THREAD: - switch (policy) - { - case ACE_SCHED_FIFO: - return ACE_THR_PRI_FIFO_MIN; - case ACE_SCHED_RR: - return ACE_THR_PRI_RR_MIN; -#if !defined (CHORUS) // SCHED_OTHRE and SCHED_RR have same value - case ACE_SCHED_OTHER: -#endif /* CHORUS */ - default: - return ACE_THR_PRI_OTHER_MIN; - } - - case ACE_SCOPE_PROCESS: - default: - switch (policy) - { - case ACE_SCHED_FIFO: - return ACE_PROC_PRI_FIFO_MIN; - case ACE_SCHED_RR: - return ACE_PROC_PRI_RR_MIN; -#if !defined (CHORUS) // SCHED_OTHRE and SCHED_RR have same value - case ACE_SCHED_OTHER: -#endif /* CHORUS */ - default: - return ACE_PROC_PRI_OTHER_MIN; - } - } - -#elif defined (ACE_HAS_WTHREADS) - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - return THREAD_PRIORITY_IDLE; -#elif defined (VXWORKS) - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - return 255; -#else - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_PRIOCNTL && defined (ACE_HAS_STHREADS) */ -} - -int -ACE_Sched_Params::priority_max (const Policy policy, - const int scope) -{ -#if defined (ACE_HAS_PRIOCNTL) && defined (ACE_HAS_STHREADS) - ACE_UNUSED_ARG (scope); - - // Assume that ACE_SCHED_OTHER indicates TS class, and that other - // policies indicate RT class. - - // Get the priority class ID and attributes. - pcinfo_t pcinfo; - // The following is just to avoid Purify warnings about unitialized - // memory reads. - ACE_OS::memset (&pcinfo, 0, sizeof pcinfo); - ACE_OS::strcpy (pcinfo.pc_clname, - policy == ACE_SCHED_OTHER ? "TS" : "RT"); - - if (ACE_OS::priority_control (P_ALL /* ignored */, - P_MYID /* ignored */, - PC_GETCID, - (char *) &pcinfo) == -1) - return -1; - - // OK, now we've got the class ID in pcinfo.pc_cid. In addition, - // the maximum configured real-time priority is in ((rtinfo_t *) - // pcinfo.pc_clinfo)->rt_maxpri, or similarly for the TS class. - - return policy == ACE_SCHED_OTHER - ? ((tsinfo_t *) pcinfo.pc_clinfo)->ts_maxupri - : ((rtinfo_t *) pcinfo.pc_clinfo)->rt_maxpri; -#elif defined(ACE_HAS_PTHREADS) && !defined(ACE_LACKS_SETSCHED) - - switch (scope) - { - case ACE_SCOPE_THREAD: - switch (policy) - { - case ACE_SCHED_FIFO: - return ACE_THR_PRI_FIFO_MAX; - case ACE_SCHED_RR: - return ACE_THR_PRI_RR_MAX; -#if !defined (CHORUS) // SCHED_OTHRE and SCHED_RR have same value - case ACE_SCHED_OTHER: -#endif /* CHORUS */ - default: - return ACE_THR_PRI_OTHER_MAX; - } - - case ACE_SCOPE_PROCESS: - default: - switch (policy) - { - case ACE_SCHED_FIFO: - return ACE_PROC_PRI_FIFO_MAX; - case ACE_SCHED_RR: - return ACE_PROC_PRI_RR_MAX; -#if !defined (CHORUS) // SCHED_OTHRE and SCHED_RR have same value - case ACE_SCHED_OTHER: -#endif /* CHORUS */ - default: - return ACE_PROC_PRI_OTHER_MAX; - } - } - -#elif defined (ACE_HAS_WTHREADS) - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - return THREAD_PRIORITY_TIME_CRITICAL; -#elif defined (VXWORKS) - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - return 0; -#else - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_PRIOCNTL && defined (ACE_HAS_STHREADS) */ -} - -int -ACE_Sched_Params::next_priority (const Policy policy, - const int priority, - const int scope) -{ -#if defined (VXWORKS) - return priority > priority_max (policy, scope) - ? priority - 1 - : priority_max (policy, scope); -#elif defined (ACE_HAS_WTHREADS) - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - switch (priority) - { - case THREAD_PRIORITY_IDLE: - return THREAD_PRIORITY_LOWEST; - case THREAD_PRIORITY_LOWEST: - return THREAD_PRIORITY_BELOW_NORMAL; - case THREAD_PRIORITY_BELOW_NORMAL: - return THREAD_PRIORITY_NORMAL; - case THREAD_PRIORITY_NORMAL: - return THREAD_PRIORITY_ABOVE_NORMAL; - case THREAD_PRIORITY_ABOVE_NORMAL: - return THREAD_PRIORITY_HIGHEST; - case THREAD_PRIORITY_HIGHEST: - return THREAD_PRIORITY_TIME_CRITICAL; - case THREAD_PRIORITY_TIME_CRITICAL: - return THREAD_PRIORITY_TIME_CRITICAL; - default: - return priority; // unknown priority: should never get here - } -#elif defined(ACE_HAS_THREADS) && !defined(ACE_LACKS_SETSCHED) - // including STHREADS, and PTHREADS - const int max = priority_max (policy, scope); - return priority < max ? priority + 1 : max; -#else - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - ACE_UNUSED_ARG (priority); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_THREADS */ -} - -int -ACE_Sched_Params::previous_priority (const Policy policy, - const int priority, - const int scope) -{ -#if defined (VXWORKS) - return priority < priority_min (policy, scope) - ? priority + 1 - : priority_min (policy, scope); -#elif defined (ACE_HAS_WTHREADS) - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - switch (priority) - { - case THREAD_PRIORITY_IDLE: - return THREAD_PRIORITY_IDLE; - case THREAD_PRIORITY_LOWEST: - return THREAD_PRIORITY_IDLE; - case THREAD_PRIORITY_BELOW_NORMAL: - return THREAD_PRIORITY_LOWEST; - case THREAD_PRIORITY_NORMAL: - return THREAD_PRIORITY_BELOW_NORMAL; - case THREAD_PRIORITY_ABOVE_NORMAL: - return THREAD_PRIORITY_NORMAL; - case THREAD_PRIORITY_HIGHEST: - return THREAD_PRIORITY_ABOVE_NORMAL; - case THREAD_PRIORITY_TIME_CRITICAL: - return THREAD_PRIORITY_HIGHEST; - default: - return priority; // unknown priority: should never get here - } -#elif defined (ACE_HAS_THREADS) && !defined(ACE_LACKS_SETSCHED) - // including STHREADS and PTHREADS - const int min = priority_min (policy, scope); - - return priority > min ? priority - 1 : min; -#else - ACE_UNUSED_ARG (policy); - ACE_UNUSED_ARG (scope); - ACE_UNUSED_ARG (priority); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_THREADS */ -} diff --git a/ace/Sched_Params.h b/ace/Sched_Params.h deleted file mode 100644 index c8f2a3a5f84..00000000000 --- a/ace/Sched_Params.h +++ /dev/null @@ -1,220 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// Sched_Params.h -// -// = CREATION DATE -// 28 January 1997 -// -// = AUTHOR -// David Levine and Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_SCHED_PARAMS_H -#define ACE_SCHED_PARAMS_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_Sched_Params -{ - // = TITLE - // Container for scheduling-related parameters. - // - // = DESCRIPTION - // ACE_Sched_Params are passed via to the - // OS to specify scheduling parameters. These parameters include - // scheduling policy, such as FIFO (ACE_SCHED_FIFO), round-robin - // (ACE_SCHED_RR), or an implementation-defined "OTHER" - // (ACE_SCHED_OTHER), to which many systems default; priority; - // and a time-slice quantum for round-robin scheduling. A - // "scope" parameter specifies whether the ACE_Sched_Params - // applies to the current process, current lightweight process - // (LWP) (on Solaris), or current thread. Please see the "NOTE" - // below about not all combinations of parameters being legal on - // a particular platform. - // - // For the case of thread priorities, it is intended that - // usually be called from
    before - // any threads have been spawned. If spawned threads inherit - // their parent's priority (I think that's the default behavior - // for all of our platforms), then this sets the default base - // priority. Individual thread priorities can be adjusted as - // usual using or via the ACE_Thread - // interface. See the parameter descriptions in the private: - // section below. - // - // NOTE: this class does not do any checking of parameters. It - // is just a container class. If it is constructed with values - // that are not supported on a platform, the call to - // will fail by returning -1 with EINVAL - // (available through ). - - // NOTE: Solaris 2.5.x threads in the RT class must set the - // priority of their LWP. The only way to do that through ACE is - // for the RT thread itself to call with - // it's own priority. - - // OS Scheduling parameters are complicated and often confusing. - // Many thanks to Thilo Kielmann - // for his careful review of - // this class design, thoughtful comments, and assistance with - // implementation, especially for PTHREADS platforms. Please - // send any comments or corrections to the ACE developers. -public: - typedef int Policy; - - // = Initialization and termination methods. - ACE_Sched_Params (const Policy policy, - const ACE_Sched_Priority priority, - const int scope = ACE_SCOPE_THREAD, - const ACE_Time_Value &quantum = ACE_Time_Value::zero); - // Constructor. - - ~ACE_Sched_Params (void); - // Termination. - - // = Get/Set methods: - - // = Get/Set policy - Policy policy (void) const; - void policy (const Policy); - - // = Get/Set priority. - ACE_Sched_Priority priority (void) const; - void priority (const ACE_Sched_Priority); - - // = Get/Set scope. - int scope (void) const; - void scope(const int); - - // = Get/Set quantum. - const ACE_Time_Value &quantum (void) const; - void quantum (const ACE_Time_Value &); - - // = Accessors for OS-specific priorities. - // These return priority values for ACE_SCHED_OTHER if the Policy value - // is invalid. - static int priority_min (const Policy, - const int scope = ACE_SCOPE_THREAD); - static int priority_max (const Policy, - const int scope = ACE_SCOPE_THREAD); - - static int next_priority (const Policy, - const int priority, - const int scope = ACE_SCOPE_THREAD); - // The next higher priority. "Higher" refers to scheduling priority, - // not to the priority value itself. (On some platforms, higher scheduling - // priority is indicated by a lower priority value.) If "priority" is - // already the highest priority (for the specified policy), then it is - // returned. - - static int previous_priority (const Policy, - const int priority, - const int scope = ACE_SCOPE_THREAD); - // The previous, lower priority. "Lower" refers to scheduling priority, - // not to the priority value itself. (On some platforms, lower scheduling - // priority is indicated by a higher priority value.) If "priority" is - // already the lowest priority (for the specified policy), then it is - // returned. - -private: - Policy policy_; - // Scheduling policy. - - ACE_Sched_Priority priority_; - // Default : for setting the priority for the process, LWP, - // or thread, as indicated by the scope_ parameter. - - int scope_; - // must be one of the following: - // ACE_SCOPE_PROCESS: sets the scheduling policy for the - // process, and the process priority. On some platforms, - // such as Win32, the scheduling policy can _only_ be - // set at process scope. - // ACE_SCOPE_LWP: lightweight process scope, only used with - // Solaris threads. - // ACE_SCOPE_THREAD: sets the scheduling policy for the thread, - // if the OS supports it, such as with Posix threads, and the - // thread priority. - // NOTE: I don't think that these are the same as POSIX - // contention scope. POSIX users who are interested in, - // and understand, contention scope will have to set it - // by using system calls outside of ACE. - - ACE_Time_Value quantum_; - // The is for time slicing. An ACE_Time_Value of 0 has - // special significance: it means time-slicing is disabled; with - // that, a thread that is running on a CPU will continue to run - // until it blocks or is preempted. Currently ignored if the OS - // doesn't directly support time slicing, such as on VxWorks, or - // setting the quantum (can that be done on Win32?). -}; - -class ACE_Export ACE_Sched_Priority_Iterator - // = TITLE - // An iterator over the OS-defined scheduling priorities. - // - // = DESCRIPTION - // The order of priorities (numeric value vs. importance) is OS - // dependant, it can be the case that the priorities are not even - // contigous. This class permits iteration over priorities using - // the iterator pattern. -{ -public: - ACE_Sched_Priority_Iterator (const ACE_Sched_Params::Policy &policy, - int scope = ACE_SCOPE_THREAD); - // Initialize the iterator, the arguments define the scheduling - // policy and scope for the priorities (see ACE_Sched_Param). - - ~ACE_Sched_Priority_Iterator (void); - // Default dtor. - - int more (void) const; - // Check if there are more priorities. - - int priority (void) const; - // Return the current priority. - - void next (void); - // Move to the next priority. - // The iteration is from lowest to highest importance. - - const ACE_Sched_Params::Policy &policy (void) const; - // Accessor for the scheduling policy over which we are iterating. - - int scope (void) const; - // Accessor for the scheduling - -private: - ACE_Sched_Params::Policy policy_; - int scope_; - // The Scheduling policy (FIFO, RR, etc.) and scheduling scope - // (PROCESS, SYSTEM) we are iterating on. - - int priority_; - // The current priority. - - int done_; - // This is set to 1 when there are no more priorities. Cannot easily - // compare against the highest priority on platforms were priorities - // are non-contigous or descending. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Sched_Params.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_SCHED_PARAMS_H */ diff --git a/ace/Sched_Params.i b/ace/Sched_Params.i deleted file mode 100644 index 041f9cb1648..00000000000 --- a/ace/Sched_Params.i +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// Sched_Params.i -// -// = CREATION DATE -// 28 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -ACE_INLINE -ACE_Sched_Params::ACE_Sched_Params ( - const Policy policy, - const ACE_Sched_Priority priority, - const int scope, - const ACE_Time_Value &quantum) - : policy_ (policy), - priority_ (priority), - scope_ (scope), - quantum_ (quantum) -{ -} - -ACE_INLINE ACE_Sched_Params::~ACE_Sched_Params (void) -{ -} - -ACE_INLINE ACE_Sched_Params::Policy -ACE_Sched_Params::policy (void) const -{ - return this->policy_; -} - -ACE_INLINE void -ACE_Sched_Params::policy (const ACE_Sched_Params::Policy policy) -{ - this->policy_ = policy; -} - -ACE_INLINE ACE_Sched_Priority -ACE_Sched_Params::priority (void) const -{ - return this->priority_; -} - -ACE_INLINE void -ACE_Sched_Params::priority (const ACE_Sched_Priority priority) -{ - this->priority_ = priority; -} - -ACE_INLINE int -ACE_Sched_Params::scope (void) const -{ - return this->scope_; -} - -ACE_INLINE void -ACE_Sched_Params::scope (const int scope) -{ - this->scope_ = scope; -} - -ACE_INLINE const ACE_Time_Value & -ACE_Sched_Params::quantum (void) const -{ - return this->quantum_; -} - -ACE_INLINE void -ACE_Sched_Params::quantum (const ACE_Time_Value &quant) -{ - this->quantum_ = quant; -} - -ACE_INLINE const ACE_Sched_Params::Policy & -ACE_Sched_Priority_Iterator::policy (void) const -{ - return this->policy_; -} - -ACE_INLINE int -ACE_Sched_Priority_Iterator::scope (void) const -{ - return this->scope_; -} - -ACE_INLINE -ACE_Sched_Priority_Iterator::ACE_Sched_Priority_Iterator (const ACE_Sched_Params::Policy &policy, - int scope) - : policy_ (policy), - scope_ (scope), - priority_ (0), - done_ (0) -{ - priority_ = ACE_Sched_Params::priority_min (this->policy (), this->scope ()); -} - -ACE_INLINE -ACE_Sched_Priority_Iterator::~ACE_Sched_Priority_Iterator (void) -{ -} - -ACE_INLINE int -ACE_Sched_Priority_Iterator::more (void) const -{ - return !this->done_; -} - -ACE_INLINE int -ACE_Sched_Priority_Iterator::priority (void) const -{ - return this->priority_; -} - -ACE_INLINE void -ACE_Sched_Priority_Iterator::next (void) -{ - if (this->done_) - return; - - int old_priority = this->priority_; - priority_ = ACE_Sched_Params::next_priority (this->policy (), - this->priority (), - this->scope ()); - this->done_ = old_priority == priority_; -} diff --git a/ace/Select_Reactor.cpp b/ace/Select_Reactor.cpp deleted file mode 100644 index fe5be69789f..00000000000 --- a/ace/Select_Reactor.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// $Id$ - -#include "ace/Select_Reactor.h" - -ACE_RCSID(ace, Select_Reactor, "$Id$") - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -# if defined (ACE_SELECT_REACTOR_HAS_DEADLOCK_DETECTION) -template class ACE_Select_Reactor_Token_T; -template class ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T >; -template class ACE_Lock_Adapter< ACE_Select_Reactor_Token_T >; -template class ACE_Guard< ACE_Select_Reactor_Token_T >; -# else -template class ACE_Select_Reactor_Token_T; -template class ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T >; -template class ACE_Lock_Adapter< ACE_Select_Reactor_Token_T >; -template class ACE_Guard< ACE_Select_Reactor_Token_T >; -# endif /* ACE_SELECT_REACTOR_HAS_DEADLOCK_DETECTION */ -# else -template class ACE_Select_Reactor_Token_T; -template class ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T >; -template class ACE_Lock_Adapter< ACE_Select_Reactor_Token_T >; -# endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -# if defined (ACE_SELECT_REACTOR_HAS_DEADLOCK_DETECTION) -# pragma instantiate ACE_Select_Reactor_Token_T -# pragma instantiate ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T > -# pragma instantiate ACE_Lock_Adapter< ACE_Select_Reactor_Token_T > -# pragma instantiate ACE_Guard< ACE_Select_Reactor_Token_T > -# else -# pragma instantiate ACE_Select_Reactor_Token_T -# pragma instantiate ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T > -# pragma instantiate ACE_Lock_Adapter< ACE_Select_Reactor_Token_T > -# pragma instantiate ACE_Guard< ACE_Select_Reactor_Token_T > -# endif /* ACE_SELECT_REACTOR_HAS_DEADLOCK_DETECTION */ -# else -# pragma instantiate ACE_Select_Reactor_Token_T -# pragma instantiate ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T > -# pragma instantiate ACE_Lock_Adapter< ACE_Select_Reactor_Token_T > -# endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/Select_Reactor.h b/ace/Select_Reactor.h deleted file mode 100644 index 65c59c765bd..00000000000 --- a/ace/Select_Reactor.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Select_Reactor.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SELECT_REACTOR_H -#define ACE_SELECT_REACTOR_H -#include "ace/pre.h" - -#include "ace/Select_Reactor_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -#if defined (ACE_SELECT_REACTOR_HAS_DEADLOCK_DETECTION) -#include "ace/Local_Tokens.h" -typedef ACE_Select_Reactor_Token_T ACE_Select_Reactor_Token; -#else -typedef ACE_Select_Reactor_Token_T ACE_Select_Reactor_Token; -#endif /* ACE_SELECT_REACTOR_HAS_DEADLOCK_DETECTION */ -#else -typedef ACE_Select_Reactor_Token_T ACE_Select_Reactor_Token; -#endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ - -typedef ACE_Select_Reactor_T ACE_Select_Reactor; -ACE_TEMPLATE_SPECIALIZATION -class ACE_Export ACE_Guard< ACE_Select_Reactor_Token_T > -{ - // = TITLE - // Template specialization of for the - // . - // - // = DESCRIPTION - // This specialization is useful since it helps to speedup - // performance of the "Null_Mutex" considerably. -public: - // = Initialization and termination methods. - ACE_Guard (ACE_Select_Reactor_Token_T &) {} - ACE_Guard (ACE_Select_Reactor_Token_T &, int) {} - ~ACE_Guard (void) {} - - int acquire (void) { return 0; } - int tryacquire (void) { return 0; } - int release (void) { return 0; } - int locked (void) { return 1; } - int remove (void) { return 0; } - void dump (void) const {} - -private: - // = Prevent assignment and initialization. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Guard< ACE_Select_Reactor_Token_T > &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Guard (const ACE_Guard< ACE_Select_Reactor_Token_T > &)) -}; - -#if defined (__ACE_INLINE__) -#include "ace/Select_Reactor.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_SELECT_REACTOR_H */ diff --git a/ace/Select_Reactor.i b/ace/Select_Reactor.i deleted file mode 100644 index 6318deb79a0..00000000000 --- a/ace/Select_Reactor.i +++ /dev/null @@ -1,2 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp deleted file mode 100644 index baca4ca60f3..00000000000 --- a/ace/Select_Reactor_Base.cpp +++ /dev/null @@ -1,944 +0,0 @@ -// $Id$ - -#include "ace/Select_Reactor_Base.h" -#include "ace/Reactor.h" -#include "ace/Thread.h" -#include "ace/Synch_T.h" -#include "ace/SOCK_Acceptor.h" -#include "ace/SOCK_Connector.h" -#include "ace/Timer_Heap.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Select_Reactor_Base.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Select_Reactor_Base, "$Id$") - -#if defined (ACE_WIN32) -#define ACE_SELECT_REACTOR_HANDLE(H) (this->event_handlers_[(H)].handle_) -#define ACE_SELECT_REACTOR_EVENT_HANDLER(THIS,H) ((THIS)->event_handlers_[(H)].event_handler_) -#else -#define ACE_SELECT_REACTOR_HANDLE(H) (H) -#define ACE_SELECT_REACTOR_EVENT_HANDLER(THIS,H) ((THIS)->event_handlers_[(H)]) -#endif /* ACE_WIN32 */ - -// Performs sanity checking on the ACE_HANDLE. - -int -ACE_Select_Reactor_Handler_Repository::invalid_handle (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::invalid_handle"); -#if defined (ACE_WIN32) - // It's too expensive to perform more exhaustive validity checks on - // Win32 due to the way that they implement SOCKET HANDLEs. - if (handle == ACE_INVALID_HANDLE) -#else /* !ACE_WIN32 */ - if (handle < 0 || handle >= this->max_size_) -#endif /* ACE_WIN32 */ - { - errno = EINVAL; - return 1; - } - else - return 0; -} - -// Performs sanity checking on the ACE_HANDLE. - -int -ACE_Select_Reactor_Handler_Repository::handle_in_range (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::handle_in_range"); -#if defined (ACE_WIN32) - // It's too expensive to perform more exhaustive validity checks on - // Win32 due to the way that they implement SOCKET HANDLEs. - if (handle != ACE_INVALID_HANDLE) -#else /* !ACE_WIN32 */ - if (handle >= 0 && handle < this->max_handlep1_) -#endif /* ACE_WIN32 */ - return 1; - else - { - errno = EINVAL; - return 0; - } -} - -size_t -ACE_Select_Reactor_Handler_Repository::max_handlep1 (void) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::max_handlep1"); - - return this->max_handlep1_; -} - -int -ACE_Select_Reactor_Handler_Repository::open (size_t size) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::open"); - this->max_size_ = size; - this->max_handlep1_ = 0; - -#if defined (ACE_WIN32) - // Try to allocate the memory. - ACE_NEW_RETURN (this->event_handlers_, - ACE_Event_Tuple[size], - -1); - - // Initialize the ACE_Event_Handler * to { ACE_INVALID_HANDLE, 0 }. - for (size_t h = 0; h < size; h++) - { - ACE_SELECT_REACTOR_HANDLE (h) = ACE_INVALID_HANDLE; - ACE_SELECT_REACTOR_EVENT_HANDLER (this, h) = 0; - } -#else - // Try to allocate the memory. - ACE_NEW_RETURN (this->event_handlers_, - ACE_Event_Handler *[size], - -1); - - // Initialize the ACE_Event_Handler * to NULL. - for (size_t h = 0; h < size; h++) - ACE_SELECT_REACTOR_EVENT_HANDLER (this, h) = 0; -#endif /* ACE_WIN32 */ - - // Check to see if the user is asking for too much and fail in this - // case. - if (size > FD_SETSIZE) - { - errno = ERANGE; - return -1; - } - else - { - // Try to increase the number of handles if is greater than - // the current limit. We ignore the return value here because this - // is more of a "warning" not an error. - (void) ACE::set_handle_limit (size); - return 0; - } -} - -// Initialize a repository of the appropriate . - -ACE_Select_Reactor_Handler_Repository::ACE_Select_Reactor_Handler_Repository (ACE_Select_Reactor_Impl &select_reactor) - : select_reactor_ (select_reactor), - max_size_ (0), - max_handlep1_ (0), - event_handlers_ (0) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::ACE_Select_Reactor_Handler_Repository"); -} - -int -ACE_Select_Reactor_Handler_Repository::unbind_all (void) -{ - // Unbind all of the s. - for (int handle = 0; - handle < this->max_handlep1_; - handle++) - this->unbind (ACE_SELECT_REACTOR_HANDLE (handle), - ACE_Event_Handler::ALL_EVENTS_MASK); - - return 0; -} - -int -ACE_Select_Reactor_Handler_Repository::close (void) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::close"); - - if (this->event_handlers_ != 0) - { - this->unbind_all (); - - delete [] this->event_handlers_; - this->event_handlers_ = 0; - } - return 0; -} - -// Return the associated with the . - -ACE_Event_Handler * -ACE_Select_Reactor_Handler_Repository::find (ACE_HANDLE handle, - size_t *index_p) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::find"); - - ACE_Event_Handler *eh = 0; - ssize_t i; - - // Only bother to search for the if it's in range. - if (this->handle_in_range (handle)) - { -#if defined (ACE_WIN32) - i = 0; - - for (; i < this->max_handlep1_; i++) - if (ACE_SELECT_REACTOR_HANDLE (i) == handle) - { - eh = ACE_SELECT_REACTOR_EVENT_HANDLER (this, i); - break; - } -#else - i = handle; - - eh = ACE_SELECT_REACTOR_EVENT_HANDLER (this, handle); -#endif /* ACE_WIN32 */ - } - else - // g++ can't figure out that won't be used below if the handle - // is out of range, so keep it happy by defining here . . . - i = 0; - - if (eh != 0) - { - if (index_p != 0) - *index_p = i; - } - else - errno = ENOENT; - - return eh; -} - -// Bind the to the . - -int -ACE_Select_Reactor_Handler_Repository::bind (ACE_HANDLE handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::bind"); - - if (handle == ACE_INVALID_HANDLE) - handle = event_handler->get_handle (); - - if (this->invalid_handle (handle)) - return -1; - -#if defined (ACE_WIN32) - int assigned_slot = -1; - - for (ssize_t i = 0; i < this->max_handlep1_; i++) - { - // Found it, so let's just reuse this location. - if (ACE_SELECT_REACTOR_HANDLE (i) == handle) - { - assigned_slot = i; - break; - } - // Here's the first free slot, so let's take it. - else if (ACE_SELECT_REACTOR_HANDLE (i) == ACE_INVALID_HANDLE - && assigned_slot == -1) - assigned_slot = i; - } - - if (assigned_slot > -1) - // We found a free spot, let's reuse it. - { - ACE_SELECT_REACTOR_HANDLE (assigned_slot) = handle; - ACE_SELECT_REACTOR_EVENT_HANDLER (this, assigned_slot) = event_handler; - } - else if (this->max_handlep1_ < this->max_size_) - { - // Insert at the end of the active portion. - ACE_SELECT_REACTOR_HANDLE (this->max_handlep1_) = handle; - ACE_SELECT_REACTOR_EVENT_HANDLER (this, this->max_handlep1_) = event_handler; - this->max_handlep1_++; - } - else - { - // No more room at the inn! - errno = ENOMEM; - return -1; - } -#else - ACE_SELECT_REACTOR_EVENT_HANDLER (this, handle) = event_handler; - - if (this->max_handlep1_ < handle + 1) - this->max_handlep1_ = handle + 1; -#endif /* ACE_WIN32 */ - - // Add the for this in the Select_Reactor's wait_set. - this->select_reactor_.bit_ops (handle, - mask, - this->select_reactor_.wait_set_, - ACE_Reactor::ADD_MASK); - - // Note the fact that we've changed the state of the , - // which is used by the dispatching loop to determine whether it can - // keep going or if it needs to reconsult select(). - this->select_reactor_.state_changed_ = 1; - - return 0; -} - -// Remove the binding of . - -int -ACE_Select_Reactor_Handler_Repository::unbind (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::unbind"); - - size_t slot; - ACE_Event_Handler *eh = this->find (handle, &slot); - - if (eh == 0) - return -1; - - // Clear out the bits in the Select_Reactor's wait_set. - this->select_reactor_.bit_ops (handle, - mask, - this->select_reactor_.wait_set_, - ACE_Reactor::CLR_MASK); - - // And suspend_set. - this->select_reactor_.bit_ops (handle, - mask, - this->select_reactor_.suspend_set_, - ACE_Reactor::CLR_MASK); - - // Note the fact that we've changed the state of the , - // which is used by the dispatching loop to determine whether it can - // keep going or if it needs to reconsult select(). - this->select_reactor_.state_changed_ = 1; - - // Close down the unless we've been instructed not - // to. - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::DONT_CALL) == 0) - eh->handle_close (handle, mask); - - // If there are no longer any outstanding events on this - // then we can totally shut down the Event_Handler. - if (this->select_reactor_.wait_set_.rd_mask_.is_set (handle) == 0 - && this->select_reactor_.wait_set_.wr_mask_.is_set (handle) == 0 - && this->select_reactor_.wait_set_.ex_mask_.is_set (handle) == 0) -#if defined (ACE_WIN32) - { - ACE_SELECT_REACTOR_HANDLE (slot) = ACE_INVALID_HANDLE; - ACE_SELECT_REACTOR_EVENT_HANDLER (this, slot) = 0; - - if (this->max_handlep1_ == (int) slot + 1) - { - // We've deleted the last entry (i.e., i + 1 == the current - // size of the array), so we need to figure out the last - // valid place in the array that we should consider in - // subsequent searches. - - int i; - - for (i = this->max_handlep1_ - 1; - i >= 0 && ACE_SELECT_REACTOR_HANDLE (i) == ACE_INVALID_HANDLE; - i--) - continue; - - this->max_handlep1_ = i + 1; - } - } -#else - { - ACE_SELECT_REACTOR_EVENT_HANDLER (this, handle) = 0; - - if (this->max_handlep1_ == handle + 1) - { - // We've deleted the last entry, so we need to figure out - // the last valid place in the array that is worth looking - // at. - ACE_HANDLE wait_rd_max = this->select_reactor_.wait_set_.rd_mask_.max_set (); - ACE_HANDLE wait_wr_max = this->select_reactor_.wait_set_.wr_mask_.max_set (); - ACE_HANDLE wait_ex_max = this->select_reactor_.wait_set_.ex_mask_.max_set (); - - ACE_HANDLE suspend_rd_max = this->select_reactor_.suspend_set_.rd_mask_.max_set (); - ACE_HANDLE suspend_wr_max = this->select_reactor_.suspend_set_.wr_mask_.max_set (); - ACE_HANDLE suspend_ex_max = this->select_reactor_.suspend_set_.ex_mask_.max_set (); - - // Compute the maximum of six values. - this->max_handlep1_ = wait_rd_max; - if (this->max_handlep1_ < wait_wr_max) - this->max_handlep1_ = wait_wr_max; - if (this->max_handlep1_ < wait_ex_max) - this->max_handlep1_ = wait_ex_max; - - if (this->max_handlep1_ < suspend_rd_max) - this->max_handlep1_ = suspend_rd_max; - if (this->max_handlep1_ < suspend_wr_max) - this->max_handlep1_ = suspend_wr_max; - if (this->max_handlep1_ < suspend_ex_max) - this->max_handlep1_ = suspend_ex_max; - - this->max_handlep1_++; - } - } -#endif /* ACE_WIN32 */ - - return 0; -} - -ACE_Select_Reactor_Handler_Repository_Iterator::ACE_Select_Reactor_Handler_Repository_Iterator - (const ACE_Select_Reactor_Handler_Repository *s) - : rep_ (s), - current_ (-1) -{ - this->advance (); -} - -// Pass back the that hasn't been seen in the Set. -// Returns 0 when all items have been seen, else 1. - -int -ACE_Select_Reactor_Handler_Repository_Iterator::next (ACE_Event_Handler *&next_item) -{ - int result = 1; - - if (this->current_ >= this->rep_->max_handlep1_) - result = 0; - else - next_item = ACE_SELECT_REACTOR_EVENT_HANDLER (this->rep_, - this->current_); - return result; -} - -int -ACE_Select_Reactor_Handler_Repository_Iterator::done (void) const -{ - return this->current_ >= this->rep_->max_handlep1_; -} - -// Move forward by one element in the set. - -int -ACE_Select_Reactor_Handler_Repository_Iterator::advance (void) -{ - if (this->current_ < this->rep_->max_handlep1_) - this->current_++; - - while (this->current_ < this->rep_->max_handlep1_) - if (ACE_SELECT_REACTOR_EVENT_HANDLER (this->rep_, this->current_) != 0) - return 1; - else - this->current_++; - - return this->current_ < this->rep_->max_handlep1_; -} - -// Dump the state of an object. - -void -ACE_Select_Reactor_Handler_Repository_Iterator::dump (void) const -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository_Iterator::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("rep_ = %u"), this->rep_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("current_ = %d"), this->current_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -void -ACE_Select_Reactor_Handler_Repository::dump (void) const -{ - ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) max_handlep1_ = %d, max_size_ = %d\n"), - this->max_handlep1_, this->max_size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("["))); - - ACE_Event_Handler *eh = 0; - - for (ACE_Select_Reactor_Handler_Repository_Iterator iter (this); - iter.next (eh) != 0; - iter.advance ()) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (eh = %x, eh->handle_ = %d)"), - eh, eh->get_handle ())); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" ]"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Select_Reactor_Handler_Repository_Iterator) - -ACE_Select_Reactor_Notify::ACE_Select_Reactor_Notify (void) - : max_notify_iterations_ (-1) -{ -} - -void -ACE_Select_Reactor_Notify::max_notify_iterations (int iterations) -{ - // Must always be > 0 or < 0 to optimize the loop exit condition. - if (iterations == 0) - iterations = 1; - - this->max_notify_iterations_ = iterations; -} - -int -ACE_Select_Reactor_Notify::max_notify_iterations (void) -{ - return this->max_notify_iterations_; -} - -void -ACE_Select_Reactor_Notify::dump (void) const -{ - ACE_TRACE ("ACE_Select_Reactor_Notify::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("select_reactor_ = %x"), this->select_reactor_)); - this->notification_pipe_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -int -ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r, - ACE_Timer_Queue *, - int disable_notify_pipe) -{ - ACE_TRACE ("ACE_Select_Reactor_Notify::open"); - - if (disable_notify_pipe == 0) - { - this->select_reactor_ = - ACE_dynamic_cast (ACE_Select_Reactor_Impl *, r); - - if (select_reactor_ == 0) - { - errno = EINVAL; - return -1; - } - - if (this->notification_pipe_.open () == -1) - return -1; -#if defined (F_SETFD) - ACE_OS::fcntl (this->notification_pipe_.read_handle (), F_SETFD, 1); - ACE_OS::fcntl (this->notification_pipe_.write_handle (), F_SETFD, 1); -#endif /* F_SETFD */ - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - ACE_Notification_Buffer *temp; - - ACE_NEW_RETURN (temp, - ACE_Notification_Buffer[ACE_REACTOR_NOTIFICATION_ARRAY_SIZE], - -1); - - if (this->alloc_queue_.enqueue_head (temp) == -1) - return -1; - - for (size_t i = 0; i < ACE_REACTOR_NOTIFICATION_ARRAY_SIZE; i++) - if (free_queue_.enqueue_head (temp + i) == -1) - return -1; - -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ - - // There seems to be a Win32 bug with this... Set this into - // non-blocking mode. - if (ACE::set_flags (this->notification_pipe_.read_handle (), - ACE_NONBLOCK) == -1) - return -1; - else - return this->select_reactor_->register_handler - (this->notification_pipe_.read_handle (), - this, - ACE_Event_Handler::READ_MASK); - } - else - { - this->select_reactor_ = 0; - return 0; - } -} - -int -ACE_Select_Reactor_Notify::close (void) -{ - ACE_TRACE ("ACE_Select_Reactor_Notify::close"); - -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - // Free up the dynamically allocated resources. - ACE_Notification_Buffer **b; - - for (ACE_Unbounded_Queue_Iterator alloc_iter (this->alloc_queue_); - alloc_iter.next (b) != 0; - alloc_iter.advance ()) - { - delete [] *b; - *b = 0; - } - - this->alloc_queue_.reset (); - this->notify_queue_.reset (); - this->free_queue_.reset (); -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ - - return this->notification_pipe_.close (); -} - -ssize_t -ACE_Select_Reactor_Notify::notify (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - ACE_Time_Value *timeout) -{ - ACE_TRACE ("ACE_Select_Reactor_Notify::notify"); - - // Just consider this method a "no-op" if there's no - // configured. - if (this->select_reactor_ == 0) - return 0; - else - { -#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - ACE_Notification_Buffer buffer (eh, mask); - int notification_required = 0; - - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->notify_queue_lock_, -1); - - // No pending notifications. - if (this->notify_queue_.is_empty ()) - notification_required = 1; - - ACE_Notification_Buffer *temp = 0; - - if (free_queue_.dequeue_head (temp) == -1) - { - // Grow the queue of available buffers. - ACE_Notification_Buffer *temp1; - - ACE_NEW_RETURN (temp1, - ACE_Notification_Buffer[ACE_REACTOR_NOTIFICATION_ARRAY_SIZE], - -1); - - if (this->alloc_queue_.enqueue_head (temp1) == -1) - return -1; - - // Start at 1 and enqueue only - // (ACE_REACTOR_NOTIFICATION_ARRAY_SIZE - 1) elements since - // the first one will be used right now. - for (size_t i = 1; - i < ACE_REACTOR_NOTIFICATION_ARRAY_SIZE; - i++) - this->free_queue_.enqueue_head (temp1 + i); - - temp = temp1; - } - - ACE_ASSERT (temp != 0); - *temp = buffer; - - if (notify_queue_.enqueue_tail (temp) == -1) - return -1; - - if (notification_required) - { - ssize_t n = ACE::send (this->notification_pipe_.write_handle (), - (char *) &buffer, - sizeof buffer, - timeout); - if (n == -1) - return -1; - } - return 0; -#else - ACE_Notification_Buffer buffer (eh, mask); - - ssize_t n = ACE::send (this->notification_pipe_.write_handle (), - (char *) &buffer, - sizeof buffer, - timeout); - if (n == -1) - return -1; - else - return 0; -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ - } -} - -// Handles pending threads (if any) that are waiting to unblock the -// Select_Reactor. - -int -ACE_Select_Reactor_Notify::dispatch_notifications (int &number_of_active_handles, - ACE_Handle_Set &rd_mask) -{ - ACE_TRACE ("ACE_Select_Reactor_Notify::handle_notification"); - - ACE_HANDLE read_handle = - this->notification_pipe_.read_handle (); - - if (read_handle != ACE_INVALID_HANDLE - && rd_mask.is_set (read_handle)) - { - number_of_active_handles--; - rd_mask.clr_bit (read_handle); - return this->handle_input (read_handle); - } - else - return 0; -} - -// Special trick to unblock or - // when updates occur other than in the main - // thread. To do this, we signal an - // auto-reset event the is listening on. - // If an and is - // passed to , the appropriate method is - // dispatched in the context of the thread. -public: - ACE_Select_Reactor_Notify (void); - ~ACE_Select_Reactor_Notify (void); - // Default dtor. - - // = Initialization and termination methods. - virtual int open (ACE_Reactor_Impl *, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0); - // Initialize. - - virtual int close (void); - // Destroy. - - virtual ssize_t notify (ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value * = 0); - // Called by a thread when it wants to unblock the - // . This wakeups the if - // currently blocked in . - - ACE_Select_Reactor_Handle_Set suspend_set_; - // Tracks handles that are currently suspended. - - ACE_Select_Reactor_Handle_Set ready_set_; - // Track HANDLES we are interested in for various events that must - // be dispatched *without* going through is interrupted via . - - int requeue_position_; - // Position that the main ACE_Select_Reactor thread is requeued in - // the list of waiters during a callback. If this value == - // -1 we are requeued at the end of the list. Else if it's 0 then - // we are requeued at the front of the list. Else if it's > 1 then - // that indicates the number of waiters to skip over. - - int initialized_; - // True if we've been initialized yet... - - ACE_thread_t owner_; - // The original thread that created this Select_Reactor. - - int state_changed_; - // True if state has changed during dispatching of - // , else false. This is used to determine - // whether we need to make another trip through the - // 's loop. - - int supress_notify_renew (void); - void supress_notify_renew (int sr); - // Controls/access whether the notify handler should renew the - // Select_Reactor's token or not. - -private: - int supress_renew_; - // Determine whether we should renew Select_Reactor's token after handling - // the notification message. - - ACE_Select_Reactor_Impl (const ACE_Select_Reactor_Impl &); - ACE_Select_Reactor_Impl &operator = (const ACE_Select_Reactor_Impl &); - // Deny access since member-wise won't work... -}; - -#if defined (__ACE_INLINE__) -#include "ace/Select_Reactor_Base.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_SELECT_REACTOR_BASE_H */ diff --git a/ace/Select_Reactor_Base.i b/ace/Select_Reactor_Base.i deleted file mode 100644 index 001a19fb753..00000000000 --- a/ace/Select_Reactor_Base.i +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/Reactor.h" - -ACE_INLINE -ACE_Event_Tuple::~ACE_Event_Tuple (void) -{ -} - -ACE_INLINE -ACE_Select_Reactor_Notify::~ACE_Select_Reactor_Notify (void) -{ -} - -ACE_INLINE -ACE_Select_Reactor_Handler_Repository::~ACE_Select_Reactor_Handler_Repository (void) -{ -} - -ACE_INLINE -ACE_Select_Reactor_Handler_Repository_Iterator::~ACE_Select_Reactor_Handler_Repository_Iterator (void) -{ -} - -ACE_INLINE size_t -ACE_Select_Reactor_Handler_Repository::size (void) -{ - return this->max_size_; -} - -ACE_INLINE -ACE_Event_Tuple::ACE_Event_Tuple (void) -: handle_ (ACE_INVALID_HANDLE), - event_handler_ (0) -{ -} - -ACE_INLINE -ACE_Event_Tuple::ACE_Event_Tuple (ACE_Event_Handler* eh, - ACE_HANDLE h) -: handle_ (h), - event_handler_ (eh) -{ -} - -ACE_INLINE int -ACE_Event_Tuple::operator== (const ACE_Event_Tuple &rhs) const -{ - return this->handle_ == rhs.handle_; -} - -ACE_INLINE int -ACE_Event_Tuple::operator!= (const ACE_Event_Tuple &rhs) const -{ - return !(*this == rhs); -} - -ACE_INLINE -ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl () - : handler_rep_ (*this), - timer_queue_ (0), - delete_timer_queue_ (0), - delete_signal_handler_ (0), - delete_notify_handler_ (0), - requeue_position_ (-1), // Requeue at end of waiters by default. - initialized_ (0), - state_changed_ (0), - supress_renew_ (0) -{ -} - -ACE_INLINE int -ACE_Select_Reactor_Impl::supress_notify_renew (void) -{ - return this->supress_renew_; -} - -ACE_INLINE void -ACE_Select_Reactor_Impl::supress_notify_renew (int sr) -{ - this->supress_renew_ = sr; -} diff --git a/ace/Select_Reactor_T.cpp b/ace/Select_Reactor_T.cpp deleted file mode 100644 index a643a325cbc..00000000000 --- a/ace/Select_Reactor_T.cpp +++ /dev/null @@ -1,1365 +0,0 @@ -// $Id$ - -#ifndef ACE_SELECT_REACTOR_T_C -#define ACE_SELECT_REACTOR_T_C - -#include "ace/Select_Reactor_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Thread.h" -#include "ace/Timer_Heap.h" - -// @@ The latest version of SunCC can't grok the code if we put inline -// function here. Therefore, we temporarily disable the code here. -// We shall turn this back on once we know the problem gets fixed. -#if 1 // !defined (__ACE_INLINE__) -#include "ace/Select_Reactor_T.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Select_Reactor_T, "$Id$") - - ACE_ALLOC_HOOK_DEFINE(ACE_Select_Reactor_T) - -#if defined (ACE_WIN32) -#define ACE_SELECT_REACTOR_HANDLE(H) (this->event_handlers_[(H)].handle_) -#define ACE_SELECT_REACTOR_EVENT_HANDLER(THIS,H) ((THIS)->event_handlers_[(H)].event_handler_) -#else -#define ACE_SELECT_REACTOR_HANDLE(H) (H) -#define ACE_SELECT_REACTOR_EVENT_HANDLER(THIS,H) ((THIS)->event_handlers_[(H)]) -#endif /* ACE_WIN32 */ - - template int -ACE_Select_Reactor_T::any_ready - (ACE_Select_Reactor_Handle_Set &wait_set) -{ - ACE_TRACE ("ACE_Select_Reactor_T::any_ready"); - - if (this->mask_signals_) - { -#if !defined (ACE_WIN32) - // Make this call signal safe. - ACE_Sig_Guard sb; -#endif /* ACE_WIN32 */ - - return this->any_ready_i (wait_set); - } - return this->any_ready_i (wait_set); -} - - template int -ACE_Select_Reactor_T::any_ready_i - (ACE_Select_Reactor_Handle_Set &wait_set) -{ - int number_ready = this->ready_set_.rd_mask_.num_set () - + this->ready_set_.wr_mask_.num_set () - + this->ready_set_.ex_mask_.num_set (); - - if (number_ready > 0) - { - wait_set.rd_mask_ = this->ready_set_.rd_mask_; - wait_set.wr_mask_ = this->ready_set_.wr_mask_; - wait_set.ex_mask_ = this->ready_set_.ex_mask_; - - this->ready_set_.rd_mask_.reset (); - this->ready_set_.wr_mask_.reset (); - this->ready_set_.ex_mask_.reset (); - } - - return number_ready; -} - -template int -ACE_Select_Reactor_T::handler_i (int signum, - ACE_Event_Handler **eh) -{ - ACE_TRACE ("ACE_Select_Reactor_T::handler_i"); - ACE_Event_Handler *handler = this->signal_handler_->handler (signum); - - if (handler == 0) - return -1; - else if (eh != 0 && *eh != 0) - *eh = handler; - return 0; -} - -template int -ACE_Select_Reactor_T::initialized (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::initialized"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, 0)); - return this->initialized_; -} - -template int -ACE_Select_Reactor_T::owner (ACE_thread_t tid, - ACE_thread_t *o_id) -{ - ACE_TRACE ("ACE_Select_Reactor_T::owner"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - if (o_id) - *o_id = this->owner_; - - this->owner_ = tid; - - return 0; -} - -template int -ACE_Select_Reactor_T::owner (ACE_thread_t *t_id) -{ - ACE_TRACE ("ACE_Select_Reactor_T::owner"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - *t_id = this->owner_; - return 0; -} - -template int -ACE_Select_Reactor_T::restart (void) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->restart_; -} - -template int -ACE_Select_Reactor_T::restart (int r) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - int current_value = this->restart_; - this->restart_ = r; - return current_value; -} - -template void -ACE_Select_Reactor_T::requeue_position (int rp) -{ - ACE_TRACE ("ACE_Select_Reactor_T::requeue_position"); - ACE_MT (ACE_GUARD (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_)); -#if defined (ACE_WIN32) - ACE_UNUSED_ARG (rp); - // Must always requeue ourselves "next" on Win32. - this->requeue_position_ = 0; -#else - this->requeue_position_ = rp; -#endif /* ACE_WIN32 */ -} - -template int -ACE_Select_Reactor_T::requeue_position (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::requeue_position"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->requeue_position_; -} - -template void -ACE_Select_Reactor_T::max_notify_iterations (int iterations) -{ - ACE_TRACE ("ACE_Select_Reactor_T::max_notify_iterations"); - ACE_MT (ACE_GUARD (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_)); - - this->notify_handler_->max_notify_iterations (iterations); -} - -template int -ACE_Select_Reactor_T::max_notify_iterations (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::max_notify_iterations"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->notify_handler_->max_notify_iterations (); -} - -// Enqueue ourselves into the list of waiting threads. -template void -ACE_Select_Reactor_T::renew (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::renew"); -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - if (this->supress_notify_renew () == 0) - this->token_.renew (this->requeue_position_); -#endif /* defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) */ -} - -template void -ACE_Select_Reactor_Token_T::dump (void) const -{ - ACE_TRACE ("ACE_Select_Reactor_Token::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template -ACE_Select_Reactor_Token_T::ACE_Select_Reactor_Token_T - (ACE_Select_Reactor_Impl &r) - : select_reactor_ (&r) -{ - ACE_TRACE ("ACE_Select_Reactor_Token::ACE_Select_Reactor_Token"); -} - -template -ACE_Select_Reactor_Token_T::ACE_Select_Reactor_Token_T (void) - : select_reactor_ (0) -{ - ACE_TRACE ("ACE_Select_Reactor_Token::ACE_Select_Reactor_Token"); -} - -template -ACE_Select_Reactor_Token_T::~ACE_Select_Reactor_Token_T (void) -{ - ACE_TRACE ("ACE_Select_Reactor_Token::~ACE_Select_Reactor_Token"); -} - -template ACE_Select_Reactor_Impl & -ACE_Select_Reactor_Token_T::select_reactor (void) -{ - return *this->select_reactor_; -} - -template void -ACE_Select_Reactor_Token_T::select_reactor - (ACE_Select_Reactor_Impl &select_reactor) -{ - this->select_reactor_ = &select_reactor; -} - -// Used to wakeup the Select_Reactor. - -template void -ACE_Select_Reactor_Token_T::sleep_hook (void) -{ - ACE_TRACE ("ACE_Select_Reactor_Token::sleep_hook"); - if (this->select_reactor_->notify () == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("sleep_hook failed"))); -} - -template int -ACE_Select_Reactor_T::notify (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - ACE_Time_Value *timeout) -{ - ACE_TRACE ("ACE_Select_Reactor_T::notify"); - - ssize_t n = 0; - - // Pass over both the Event_Handler *and* the mask to allow the - // caller to dictate which Event_Handler method the receiver - // invokes. Note that this call can timeout. - - n = this->notify_handler_->notify (eh, mask, timeout); - return n == -1 ? -1 : 0; -} - -template int -ACE_Select_Reactor_T::resume_handler (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Select_Reactor_T::resume_handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->resume_i (handle); -} - -template int -ACE_Select_Reactor_T::suspend_handler (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Select_Reactor_T::suspend_handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->suspend_i (handle); -} - -template int -ACE_Select_Reactor_T::suspend_handlers (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::suspend_handlers"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - ACE_Event_Handler *eh = 0; - - for (ACE_Select_Reactor_Handler_Repository_Iterator iter (&this->handler_rep_); - iter.next (eh) != 0; - iter.advance ()) - this->suspend_i (eh->get_handle ()); - - return 0; -} - -template int -ACE_Select_Reactor_T::resume_handlers (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::resume_handlers"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - ACE_Event_Handler *eh = 0; - - for (ACE_Select_Reactor_Handler_Repository_Iterator iter (&this->handler_rep_); - iter.next (eh) != 0; - iter.advance ()) - this->resume_i (eh->get_handle ()); - - return 0; -} - -template int -ACE_Select_Reactor_T::register_handler - (ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::register_handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->register_handler_i (handler->get_handle (), handler, mask); -} - -template int -ACE_Select_Reactor_T::register_handler - (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::register_handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->register_handler_i (handle, handler, mask); -} - -template int -ACE_Select_Reactor_T::register_handler - (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::register_handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->register_handler_i (handles, handler, mask); -} - -template int -ACE_Select_Reactor_T::handler - (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **handler) -{ - ACE_TRACE ("ACE_Select_Reactor_T::handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->handler_i (handle, mask, handler); -} - -template int -ACE_Select_Reactor_T::remove_handler - (const ACE_Handle_Set &handles, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::remove_handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->remove_handler_i (handles, mask); -} - -template int -ACE_Select_Reactor_T::remove_handler - (ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::remove_handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->remove_handler_i (handler->get_handle (), mask); -} - -template int -ACE_Select_Reactor_T::remove_handler - (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::remove_handler"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->remove_handler_i (handle, mask); -} - -// Performs operations on the "ready" bits. - -template int -ACE_Select_Reactor_T::ready_ops - (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops) -{ - ACE_TRACE ("ACE_Select_Reactor_T::ready_ops"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->bit_ops (handle, - mask, - this->ready_set_, - ops); -} - -template int -ACE_Select_Reactor_T::open - (size_t size, - int restart, - ACE_Sig_Handler *sh, - ACE_Timer_Queue *tq, - int disable_notify_pipe, - ACE_Reactor_Notify *notify) -{ - ACE_TRACE ("ACE_Select_Reactor_T::open"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - // Can't initialize ourselves more than once. - if (this->initialized_ > 0) - return -1; - - this->owner_ = ACE_Thread::self (); - this->restart_ = restart; - this->signal_handler_ = sh; - this->timer_queue_ = tq; - this->notify_handler_ = notify; - - int result = 0; - - // Allows the signal handler to be overridden. - if (this->signal_handler_ == 0) - { - ACE_NEW_RETURN (this->signal_handler_, - ACE_Sig_Handler, - -1); - - if (this->signal_handler_ == 0) - result = -1; - else - this->delete_signal_handler_ = 1; - } - - // Allows the timer queue to be overridden. - if (result != -1 && this->timer_queue_ == 0) - { - ACE_NEW_RETURN (this->timer_queue_, - ACE_Timer_Heap, - -1); - - if (this->timer_queue_ == 0) - result = -1; - else - this->delete_timer_queue_ = 1; - } - - // Allows the Notify_Handler to be overridden. - if (result != -1 && this->notify_handler_ == 0) - { - ACE_NEW_RETURN (this->notify_handler_, - ACE_Select_Reactor_Notify, - -1); - - if (this->notify_handler_ == 0) - result = -1; - else - this->delete_notify_handler_ = 1; - } - - if (result != -1 && this->handler_rep_.open (size) == -1) - result = -1; - else if (this->notify_handler_->open (this, - 0, - disable_notify_pipe) == -1) - result = -1; - - if (result != -1) - // We're all set to go. - this->initialized_ = 1; - else - // This will close down all the allocated resources properly. - this->close (); - - return result; -} - -template int -ACE_Select_Reactor_T::set_sig_handler - (ACE_Sig_Handler *signal_handler) -{ - if (this->signal_handler_ != 0 && this->delete_signal_handler_ != 0) - delete this->signal_handler_; - this->signal_handler_ = signal_handler; - this->delete_signal_handler_ = 0; - return 0; -} - -template int -ACE_Select_Reactor_T::set_timer_queue - (ACE_Timer_Queue *timer_queue) -{ - if (this->timer_queue_ != 0 && this->delete_timer_queue_ != 0) - delete this->timer_queue_; - this->timer_queue_ = timer_queue; - this->delete_timer_queue_ = 0; - return 0; -} - -template -ACE_Select_Reactor_T::ACE_Select_Reactor_T - (ACE_Sig_Handler *sh, - ACE_Timer_Queue *tq, - int disable_notify_pipe, - ACE_Reactor_Notify *notify, - int mask_signals) - : token_ (*this), - lock_adapter_ (token_), - deactivated_ (0), - mask_signals_ (mask_signals) -{ - ACE_TRACE ("ACE_Select_Reactor_T::ACE_Select_Reactor_T"); - - if (this->open (ACE_Select_Reactor_T::DEFAULT_SIZE, - 0, - sh, - tq, - disable_notify_pipe, - notify) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Select_Reactor_T::open ") - ACE_TEXT ("failed inside ACE_Select_Reactor_T::CTOR"))); -} - -// Initialize ACE_Select_Reactor_T. - -template -ACE_Select_Reactor_T::ACE_Select_Reactor_T - (size_t size, - int rs, - ACE_Sig_Handler *sh, - ACE_Timer_Queue *tq, - int disable_notify_pipe, - ACE_Reactor_Notify *notify, - int mask_signals) - : token_ (*this), - lock_adapter_ (token_), - deactivated_ (0), - mask_signals_ (mask_signals) -{ - ACE_TRACE ("ACE_Select_Reactor_T::ACE_Select_Reactor_T"); - - if (this->open (size, - rs, - sh, - tq, - disable_notify_pipe, - notify) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Select_Reactor_T::open ") - ACE_TEXT ("failed inside ACE_Select_Reactor_T::CTOR"))); -} - -// Close down the ACE_Select_Reactor_T instance, detaching any -// remaining Event_Handers. This had better be called from the main -// event loop thread... - -template int -ACE_Select_Reactor_T::close (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::close"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - if (this->delete_signal_handler_) - { - delete this->signal_handler_; - this->signal_handler_ = 0; - this->delete_signal_handler_ = 0; - } - - this->handler_rep_.close (); - - if (this->delete_timer_queue_) - { - delete this->timer_queue_; - this->timer_queue_ = 0; - this->delete_timer_queue_ = 0; - } - - if (this->notify_handler_ != 0) - this->notify_handler_->close (); - - if (this->delete_notify_handler_) - { - delete this->notify_handler_; - this->notify_handler_ = 0; - this->delete_notify_handler_ = 0; - } - - this->initialized_ = 0; - - return 0; -} - -template int -ACE_Select_Reactor_T::current_info - (ACE_HANDLE, size_t &) -{ - return -1; -} - -template -ACE_Select_Reactor_T::~ACE_Select_Reactor_T (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::~ACE_Select_Reactor_T"); - this->close (); -} - -template int -ACE_Select_Reactor_T::remove_handler_i - (const ACE_Handle_Set &handles, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::remove_handler_i"); - ACE_HANDLE h; - - ACE_Handle_Set_Iterator handle_iter (handles); - - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->remove_handler_i (h, mask) == -1) - return -1; - - return 0; -} - -template int -ACE_Select_Reactor_T::register_handler_i - (const ACE_Handle_Set &handles, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::register_handler_i"); - ACE_HANDLE h; - - ACE_Handle_Set_Iterator handle_iter (handles); - while ((h = handle_iter ()) != ACE_INVALID_HANDLE) - if (this->register_handler_i (h, handler, mask) == -1) - return -1; - - return 0; -} - -template int -ACE_Select_Reactor_T::register_handler - (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp) -{ - ACE_TRACE ("ACE_Select_Reactor_T::register_handler"); - - int result = 0; - -#if (ACE_NSIG > 0) && !defined (CHORUS) - for (int s = 1; s < ACE_NSIG; s++) - if (sigset.is_member (s) - && this->signal_handler_->register_handler (s, - new_sh, - new_disp) == -1) - result = -1; -#else /* ACE_NSIG <= 0 || CHORUS */ - ACE_UNUSED_ARG (sigset); - ACE_UNUSED_ARG (new_sh); - ACE_UNUSED_ARG (new_disp); -#endif /* ACE_NSIG <= 0 || CHORUS */ - return result; -} - -template int -ACE_Select_Reactor_T::remove_handler - (const ACE_Sig_Set &sigset) -{ - ACE_TRACE ("ACE_Select_Reactor_T::remove_handler"); - int result = 0; - -#if (ACE_NSIG > 0) && !defined (CHORUS) - for (int s = 1; s < ACE_NSIG; s++) - if (sigset.is_member (s) - && this->signal_handler_->remove_handler (s) == -1) - result = -1; -#else /* ACE_NSIG <= 0 || CHORUS */ - ACE_UNUSED_ARG (sigset); -#endif /* ACE_NSIG <= 0 || CHORUS */ - - return result; -} - -template long -ACE_Select_Reactor_T::schedule_timer - (ACE_Event_Handler *handler, - const void *arg, - const ACE_Time_Value &delta_time, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Select_Reactor_T::schedule_timer"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - return this->timer_queue_->schedule - (handler, - arg, - timer_queue_->gettimeofday () + delta_time, - interval); -} - -template int -ACE_Select_Reactor_T::reset_timer_interval - (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Select_Reactor_T::reset_timer_interval"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - return this->timer_queue_->reset_interval - (timer_id, - interval); -} - -// Main event loop driver that blocks for before -// returning (will return earlier if I/O or signal events occur). - -template int -ACE_Select_Reactor_T::handle_events - (ACE_Time_Value &max_wait_time) -{ - ACE_TRACE ("ACE_Select_Reactor_T::handle_events"); - - return this->handle_events (&max_wait_time); -} - -template int -ACE_Select_Reactor_T::handle_error (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::handle_error"); - if (errno == EINTR) - return this->restart_; -#if defined (__MVS__) || defined (ACE_WIN32) - // On MVS Open Edition and Win32, there can be a number of failure - // codes on a bad socket, so check_handles on anything other than - // EINTR. - else - return this->check_handles (); -#else - else if (errno == EBADF) - return this->check_handles (); - else - return -1; -#endif /* __MVS__ */ -} - -template void -ACE_Select_Reactor_T::notify_handle - (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Handle_Set &ready_mask, - ACE_Event_Handler *event_handler, - ACE_EH_PTMF ptmf) -{ - ACE_TRACE ("ACE_Select_Reactor_T::notify_handle"); - // Check for removed handlers. - if (event_handler == 0) - return; - - int status = (event_handler->*ptmf) (handle); - - if (status < 0) - this->remove_handler_i (handle, mask); - else if (status > 0) - ready_mask.set_bit (handle); -} - -// Perform GET, CLR, SET, and ADD operations on the select() -// Handle_Sets. -// -// GET = 1, Retrieve current value -// SET = 2, Set value of bits to new mask (changes the entire mask) -// ADD = 3, Bitwise "or" the value into the mask (only changes -// enabled bits) -// CLR = 4 Bitwise "and" the negation of the value out of the mask -// (only changes enabled bits) -// -// Returns the original mask. - -template int -ACE_Select_Reactor_T::mask_ops - (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops) -{ - ACE_TRACE ("ACE_Select_Reactor_T::mask_ops"); - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - return this->bit_ops (handle, mask, - this->wait_set_, - ops); -} - -// Must be called with locks held. - -template int -ACE_Select_Reactor_T::handler_i - (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Event_Handler **handler) -{ - ACE_TRACE ("ACE_Select_Reactor_T::handler_i"); - ACE_Event_Handler *h = this->handler_rep_.find (handle); - - if (h == 0) - return -1; - else - { - if ((ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK) - || ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) - && this->wait_set_.rd_mask_.is_set (handle) == 0) - return -1; - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK) - && this->wait_set_.wr_mask_.is_set (handle) == 0) - return -1; - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK) - && this->wait_set_.ex_mask_.is_set (handle) == 0) - return -1; - } - - if (handler != 0) - *handler = h; - return 0; -} - -// Must be called with locks held - -template int -ACE_Select_Reactor_T::resume_i (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Select_Reactor_T::resume"); - if (this->handler_rep_.find (handle) == 0) - return -1; - - if (this->suspend_set_.rd_mask_.is_set (handle)) - { - this->wait_set_.rd_mask_.set_bit (handle); - this->suspend_set_.rd_mask_.clr_bit (handle); - } - if (this->suspend_set_.wr_mask_.is_set (handle)) - { - this->wait_set_.wr_mask_.set_bit (handle); - this->suspend_set_.wr_mask_.clr_bit (handle); - } - if (this->suspend_set_.ex_mask_.is_set (handle)) - { - this->wait_set_.ex_mask_.set_bit (handle); - this->suspend_set_.ex_mask_.clr_bit (handle); - } - return 0; -} - -// Must be called with locks held - -template int -ACE_Select_Reactor_T::suspend_i (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Select_Reactor_T::suspend"); - if (this->handler_rep_.find (handle) == 0) - return -1; - - if (this->wait_set_.rd_mask_.is_set (handle)) - { - this->suspend_set_.rd_mask_.set_bit (handle); - this->wait_set_.rd_mask_.clr_bit (handle); - } - if (this->wait_set_.wr_mask_.is_set (handle)) - { - this->suspend_set_.wr_mask_.set_bit (handle); - this->wait_set_.wr_mask_.clr_bit (handle); - } - if (this->wait_set_.ex_mask_.is_set (handle)) - { - this->suspend_set_.ex_mask_.set_bit (handle); - this->wait_set_.ex_mask_.clr_bit (handle); - } - return 0; -} - -// Must be called with locks held - -template int -ACE_Select_Reactor_T::register_handler_i - (ACE_HANDLE handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::register_handler_i"); - - // Insert the tuple into the Handler - // Repository. - return this->handler_rep_.bind (handle, event_handler, mask); -} - -template int -ACE_Select_Reactor_T::remove_handler_i - (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_T::remove_handler_i"); - - // Unbind this handle. - return this->handler_rep_.unbind (handle, mask); -} - -template int -ACE_Select_Reactor_T::work_pending (const ACE_Time_Value &timeout) -{ - ACE_MT (ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1)); - - u_long width = (u_long) this->handler_rep_.max_handlep1 (); - - ACE_Select_Reactor_Handle_Set fd_set; - fd_set.rd_mask_ = this->wait_set_.rd_mask_; - fd_set.wr_mask_ = this->wait_set_.wr_mask_; - fd_set.ex_mask_ = this->wait_set_.ex_mask_; - - return ACE_OS::select (int (width), - fd_set.rd_mask_, - fd_set.wr_mask_, - fd_set.ex_mask_, - timeout); -} - -// Must be called with lock held. - -template int -ACE_Select_Reactor_T::wait_for_multiple_events - (ACE_Select_Reactor_Handle_Set &dispatch_set, - ACE_Time_Value *max_wait_time) -{ - ACE_TRACE ("ACE_Select_Reactor_T::wait_for_multiple_events"); - u_long width = 0; - ACE_Time_Value timer_buf (0); - ACE_Time_Value *this_timeout = &timer_buf; - - int number_of_active_handles = this->any_ready (dispatch_set); - - // If there are any bits enabled in the then we'll - // handle those first, otherwise we'll block in was interrupted. - if (ACE_Sig_Handler::sig_pending () != 0) - { - ACE_Sig_Handler::sig_pending (0); - - // If any HANDLES in the are activated as a - // result of signals they should be dispatched since - // they may be time critical... - active_handle_count = this->any_ready (dispatch_set); - - // Record the fact that the Reactor has dispatched a - // handle_signal() method. We need this to return the - // appropriate count below. - signal_occurred = 1; - } - else - return -1; - } - - // Handle timers early since they may have higher latency - // constraints than I/O handlers. Ideally, the order of - // dispatching should be a strategy... - else if (this->dispatch_timer_handlers (other_handlers_dispatched) == -1) - // State has changed or timer queue has failed, exit loop. - break; - - // Check to see if there are no more I/O handles left to - // dispatch AFTER we've handled the timers... - else if (active_handle_count == 0) - return io_handlers_dispatched - + other_handlers_dispatched - + signal_occurred; - - // Next dispatch the notification handlers (if there are any to - // dispatch). These are required to handle multi-threads that - // are trying to update the . - - else if (this->dispatch_notification_handlers - (dispatch_set, - active_handle_count, - other_handlers_dispatched) == -1) - break; // State has changed, exit loop. - - // Finally, dispatch the I/O handlers. - else if (this->dispatch_io_handlers - (dispatch_set, - active_handle_count, - io_handlers_dispatched) == -1) - // State has changed, so exit loop. - break; - } - while (active_handle_count > 0); - - return io_handlers_dispatched + other_handlers_dispatched+signal_occurred; -} - -template int -ACE_Select_Reactor_T::release_token (void) -{ -#if defined (ACE_WIN32) - this->token_.release (); - return (int) EXCEPTION_CONTINUE_SEARCH; -#else - return 0; -#endif /* ACE_WIN32 */ -} - -template int -ACE_Select_Reactor_T::handle_events - (ACE_Time_Value *max_wait_time) -{ - ACE_TRACE ("ACE_Select_Reactor_T::handle_events"); - - // Stash the current time -- the destructor of this object will - // automatically compute how much time elpased since this method was - // called. - ACE_Countdown_Time countdown (max_wait_time); - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - ACE_GUARD_RETURN (ACE_SELECT_REACTOR_TOKEN, ace_mon, this->token_, -1); - - if (ACE_OS::thr_equal (ACE_Thread::self (), - this->owner_) == 0 || this->deactivated_) - return -1; - - // Update the countdown to reflect time waiting for the mutex. - countdown.update (); -#else - if (this->deactivated_) - return -1; -#endif /* ACE_MT_SAFE */ - - return this->handle_events_i (max_wait_time); -} - -template int -ACE_Select_Reactor_T::handle_events_i - (ACE_Time_Value *max_wait_time) -{ - int result = -1; - - ACE_SEH_TRY - { - ACE_Select_Reactor_Handle_Set dispatch_set; - - int number_of_active_handles = - this->wait_for_multiple_events (dispatch_set, - max_wait_time); - - result = this->dispatch (number_of_active_handles, - dispatch_set); - } - ACE_SEH_EXCEPT (this->release_token ()) - { - // As it stands now, we catch and then rethrow all Win32 - // structured exceptions so that we can make sure to release the - // lock correctly. - } - - this->state_changed_ = 1; - - return result; -} - -template int -ACE_Select_Reactor_T::check_handles (void) -{ - ACE_TRACE ("ACE_Select_Reactor_T::check_handles"); - -#if defined (ACE_WIN32) || defined (__MVS__) - ACE_Time_Value time_poll = ACE_Time_Value::zero; - ACE_Handle_Set rd_mask; -#endif /* ACE_WIN32 || MVS */ - - ACE_Event_Handler *eh = 0; - int result = 0; - - for (ACE_Select_Reactor_Handler_Repository_Iterator iter (&this->handler_rep_); - iter.next (eh) != 0; - iter.advance ()) - { - ACE_HANDLE handle = eh->get_handle (); - - // Skip back to the beginning of the loop if the HANDLE is - // invalid. - if (handle == ACE_INVALID_HANDLE) - continue; - -#if defined (ACE_WIN32) || defined (__MVS__) - // Win32 needs to do the check this way because fstat won't work on - // a socket handle. MVS Open Edition needs to do it this way because, - // even though the docs say to check a handle with either select or - // fstat, the fstat method always says the handle is ok. - rd_mask.set_bit (handle); - - if (ACE_OS::select (int (handle) + 1, - rd_mask, 0, 0, - &time_poll) < 0) - { - result = 1; - this->remove_handler_i (handle, - ACE_Event_Handler::ALL_EVENTS_MASK); - } - rd_mask.clr_bit (handle); -#else /* !ACE_WIN32 && !MVS */ - struct stat temp; - - if (ACE_OS::fstat (handle, &temp) == -1) - { - result = 1; - this->remove_handler_i (handle, - ACE_Event_Handler::ALL_EVENTS_MASK); - } -#endif /* ACE_WIN32 || MVS */ - } - - return result; -} - -template void -ACE_Select_Reactor_T::dump (void) const -{ - ACE_TRACE ("ACE_Select_Reactor_T::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - this->timer_queue_->dump (); - this->handler_rep_.dump (); - this->signal_handler_->dump (); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("delete_signal_handler_ = %d\n"), - this->delete_signal_handler_)); - - ACE_HANDLE h; - - for (ACE_Handle_Set_Iterator handle_iter_wr (this->wait_set_.wr_mask_); - (h = handle_iter_wr ()) != ACE_INVALID_HANDLE; - ++handle_iter_wr) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("write_handle = %d\n"), h)); - - for (ACE_Handle_Set_Iterator handle_iter_rd (this->wait_set_.rd_mask_); - (h = handle_iter_rd ()) != ACE_INVALID_HANDLE; - ++handle_iter_rd) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("read_handle = %d\n"), h)); - - for (ACE_Handle_Set_Iterator handle_iter_ex (this->wait_set_.ex_mask_); - (h = handle_iter_ex ()) != ACE_INVALID_HANDLE; - ++handle_iter_ex) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("except_handle = %d\n"), h)); - - for (ACE_Handle_Set_Iterator handle_iter_wr_ready (this->ready_set_.wr_mask_); - (h = handle_iter_wr_ready ()) != ACE_INVALID_HANDLE; - ++handle_iter_wr_ready) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("write_handle_ready = %d\n"), h)); - - for (ACE_Handle_Set_Iterator handle_iter_rd_ready (this->ready_set_.rd_mask_); - (h = handle_iter_rd_ready ()) != ACE_INVALID_HANDLE; - ++handle_iter_rd_ready) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("read_handle_ready = %d\n"), h)); - - for (ACE_Handle_Set_Iterator handle_iter_ex_ready (this->ready_set_.ex_mask_); - (h = handle_iter_ex_ready ()) != ACE_INVALID_HANDLE; - ++handle_iter_ex_ready) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("except_handle_ready = %d\n"), h)); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("restart_ = %d\n"), this->restart_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nrequeue_position_ = %d\n"), this->requeue_position_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ninitialized_ = %d\n"), this->initialized_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nowner_ = %d\n"), this->owner_)); - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - this->notify_handler_->dump (); - this->token_.dump (); -#endif /* ACE_MT_SAFE */ - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} -#endif /* ACE_SELECT_REACTOR_T_C */ diff --git a/ace/Select_Reactor_T.h b/ace/Select_Reactor_T.h deleted file mode 100644 index 120516c0aa0..00000000000 --- a/ace/Select_Reactor_T.h +++ /dev/null @@ -1,671 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Select_Reactor_T.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_SELECT_REACTOR_T_H -#define ACE_SELECT_REACTOR_T_H -#include "ace/pre.h" - -#include "ace/Select_Reactor_Base.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -template -class ACE_Select_Reactor_Token_T : public ACE_SELECT_REACTOR_MUTEX -{ - // = TITLE - // Used as a synchronization mechanism to coordinate concurrent - // access to a Select_Reactor object. - // - // = DESCRIPTION - // This class is used to make the - // thread-safe. By default, the thread that runs the - // loop holds the token, even when it is blocked - // in the call and gets - // ``re-acquired'' as soon as the - // there would be a good chance that the could have - // been modified while the . Thus, it is not critical to change the - // . The implementation of the mechanism - // provided by the enables the - // default owner to be the thread that executes the dispatch - // loop. -public: - ACE_Select_Reactor_Token_T (ACE_Select_Reactor_Impl &r); - ACE_Select_Reactor_Token_T (void); - virtual ~ACE_Select_Reactor_Token_T (void); - - virtual void sleep_hook (void); - // Called just before the ACE_Event_Handler goes to sleep. - - ACE_Select_Reactor_Impl &select_reactor (void); - void select_reactor (ACE_Select_Reactor_Impl &); - // Set/Get methods - - virtual void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - ACE_Select_Reactor_Impl *select_reactor_; -}; - -template -class ACE_Select_Reactor_T : public ACE_Select_Reactor_Impl -{ - // = TITLE - // An object oriented event demultiplexor and event handler - // dispatcher. - // - // = DESCRIPTION - // The is an object-oriented event - // demultiplexor and event handler dispatcher. The sources of - // events that the waits for and dispatches - // includes I/O events, signals, and timer events. All public - // methods acquire the main lock and - // call down to private or protected methods, which assume that - // the lock is held and so therefore don't (re)acquire the lock. -public: - // = Initialization and termination methods. - - ACE_Select_Reactor_T (ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify *notify = 0, - int mask_signals = 1); - // Initialize with the default size. - - ACE_Select_Reactor_T (size_t size, - int restart = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify *notify = 0, - int mask_signals = 1); - // Initialize with size . - - virtual int open (size_t max_number_of_handles = DEFAULT_SIZE, - int restart = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int disable_notify_pipe = 0, - ACE_Reactor_Notify * = 0); - // Initialize the to manage - // . If is non-0 then the - // 's method will be restarted - // automatically when occurs. If or - // are non-0 they are used as the signal handler and - // timer queue, respectively. If is non-0 the - // notification pipe is not created, thereby saving two I/O handles. - - virtual int current_info (ACE_HANDLE, size_t & /* size */); - // Returns -1 (not used in this implementation); - - virtual int set_sig_handler (ACE_Sig_Handler *signal_handler); - // Use a user specified signal handler instead. - - virtual int set_timer_queue (ACE_Timer_Queue *timer_queue); - // Use a user specified timer queue instead. - - virtual int close (void); - // Close down the select_reactor and release all of its resources. - - virtual ~ACE_Select_Reactor_T (void); - // Close down the select_reactor and release all of its resources. - - // = Event loop drivers. - - virtual int work_pending (const ACE_Time_Value &max_wait_time = ACE_Time_Value::zero); - // Returns non-zero if there are I/O events "ready" for dispatching, - // but does not actually dispatch the event handlers. By default, - // don't block while checking this, i.e., "poll". - - virtual int handle_events (ACE_Time_Value *max_wait_time = 0); - virtual int alertable_handle_events (ACE_Time_Value *max_wait_time = 0); - // This event loop driver that blocks for before - // returning. It will return earlier if timer events, I/O events, - // or signal events occur. Note that can be 0, in - // which case this method blocks indefinitely until events occur. - // - // is decremented to reflect how much time this call - // took. For instance, if a time value of 3 seconds is passed to - // handle_events and an event occurs after 2 seconds, - // will equal 1 second. This can be used if an - // application wishes to handle events for some fixed amount of - // time. - // - // Returns the total number of I/O and Timer s - // that were dispatched, 0 if the elapsed without - // dispatching any handlers, or -1 if something goes wrong. - // - // Current is identical to - // . - - virtual int handle_events (ACE_Time_Value &max_wait_time); - virtual int alertable_handle_events (ACE_Time_Value &max_wait_time); - // This method is just like the one above, except the - // value is a reference and can therefore never be - // NULL. - // - // Current is identical to - // . - - // = Event handling control. - - virtual int deactivated (void); - // Return the status of Reactor. If this function returns 0, the reactor is - // actively handling events. If it returns non-zero, and - // return -1 immediately. - - virtual void deactivate (int do_stop); - // Control whether the Reactor will handle any more incoming events or not. - // If == 1, the Reactor will be disabled. By default, a reactor - // is in active state and can be deactivated/reactived as wish. - - // = Register and remove s. - virtual int register_handler (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - // Register a with a particular . Note that the - // will call to - // extract the underlying I/O handle. - - virtual int register_handler (ACE_HANDLE handle, - ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - // Register a with a particular . Note that since the - // is given the Select_Reactor will *not* call - // to extract the underlying I/O - // handle. - -#if defined (ACE_WIN32) - - // Originally this interface was available for all platforms, but - // because ACE_HANDLE is an int on non-Win32 platforms, compilers - // are not able to tell the difference between - // register_handler(ACE_Event_Handler*,ACE_Reactor_Mask) and - // register_handler(ACE_Event_Handler*,ACE_HANDLE). Therefore, we - // have restricted this method to Win32 only. - - virtual int register_handler (ACE_Event_Handler *event_handler, - ACE_HANDLE event_handle = ACE_INVALID_HANDLE); - // Not implemented. - -#endif /* ACE_WIN32 */ - - virtual int register_handler (ACE_HANDLE event_handle, - ACE_HANDLE io_handle, - ACE_Event_Handler *event_handler, - ACE_Reactor_Mask mask); - // Not implemented. - - virtual int register_handler (const ACE_Handle_Set &handles, - ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - // Register with all the in the . - - virtual int register_handler (int signum, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0, - ACE_Event_Handler **old_sh = 0, - ACE_Sig_Action *old_disp = 0); - // Register to handle the signal using the - // . Returns the that was previously registered - // (if any), along with the of the signal handler. - - virtual int register_handler (const ACE_Sig_Set &sigset, - ACE_Event_Handler *new_sh, - ACE_Sig_Action *new_disp = 0); - // Registers to handle a set of signals using the - // . - - virtual int remove_handler (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - // Removes the binding of from the Select_Reactor. If - // there are no more bindings for this then it is removed from - // the Select_Reactor. Note that the Select_Reactor will call - // to extract the underlying I/O - // handle. - - virtual int remove_handler (ACE_HANDLE handle, - ACE_Reactor_Mask); - // Removes the bind of whose handle is - // from the Select_Reactor. If there are no more bindings - // for this then it is removed from the Select_Reactor. - - virtual int remove_handler (const ACE_Handle_Set &handle_set, - ACE_Reactor_Mask); - // Removes all the bindings for handles in the - // bind of . If there are no more bindings for any - // of these handlers then they are removed from the Select_Reactor. - - virtual int remove_handler (int signum, - ACE_Sig_Action *new_disp, - ACE_Sig_Action *old_disp = 0, - int sigkey = -1); - // Remove the ACE_Event_Handler currently associated with . - // is ignored in this implementation since there is only - // one instance of a signal handler. Install the new disposition - // (if given) and return the previous disposition (if desired by the - // caller). Returns 0 on success and -1 if is invalid. - - virtual int remove_handler (const ACE_Sig_Set &sigset); - // Calls for every signal in . - - // = Suspend and resume Handlers. - - virtual int suspend_handler (ACE_Event_Handler *eh); - // Temporarily suspend the associated with . - - virtual int suspend_handler (ACE_HANDLE handle); - // Temporarily suspend the associated with . - - virtual int suspend_handler (const ACE_Handle_Set &handles); - // Suspend all in handle set temporarily. - - virtual int suspend_handlers (void); - // Suspend all the in the Select_Reactor. - - virtual int resume_handler (ACE_Event_Handler *eh); - // Resume a temporarily suspend associated with - // . - - virtual int resume_handler (ACE_HANDLE handle); - // Resume a temporarily suspended associated with - // . - - virtual int resume_handler (const ACE_Handle_Set &handles); - // Resume all in handle set. - - virtual int resume_handlers (void); - // Resume all the in the Select_Reactor. - - virtual int uses_event_associations (void); - // Return 1 if we any event associations were made by the reactor - // for the handles that it waits on, 0 otherwise. Since the - // Select_Reactor does not do any event associations, this function - // always return 0. - - // = Timer management. - virtual long schedule_timer (ACE_Event_Handler *, - const void *arg, - const ACE_Time_Value &delta, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - // Schedule an that will expire after amount - // of time, which is specified as relative time to the current - // . If it expires then is passed in as the - // value to the 's callback method. - // If is != to then it is used to - // reschedule the automatically, which is also - // specified using relative time. This method returns a - // that uniquely identifies the in an internal list. - // This can be used to cancel an before - // it expires. The cancellation ensures that are unique - // up to values of greater than 2 billion timers. As long as timers - // don't stay around longer than this there should be no problems - // with accidentally deleting the wrong timer. Returns -1 on - // failure (which is guaranteed never to be a valid . - - virtual int reset_timer_interval (long timer_id, - const ACE_Time_Value &interval); - // Resets the interval of the timer represented by to - // , which is specified in relative time to the current - // . If is equal to - // , the timer will become a non-rescheduling - // timer. Returns 0 if successful, -1 if not. - - virtual int cancel_timer (ACE_Event_Handler *event_handler, - int dont_call_handle_close = 1); - // Cancel all that match the address of - // . If is 0 then the - // method of will be invoked. - // Returns number of handler's cancelled. - - virtual int cancel_timer (long timer_id, - const void **arg = 0, - int dont_call_handle_close = 1); - // Cancel the single that matches the - // value (which was returned from the method). If arg is - // non-NULL then it will be set to point to the ``magic cookie'' - // argument passed in when the was registered. This - // makes it possible to free up the memory and avoid memory leaks. - // If is 0 then the method - // of will be invoked. Returns 1 if cancellation - // succeeded and 0 if the wasn't found. - - // = High-level Event_Handler scheduling operations - - virtual int schedule_wakeup (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - // ADD the dispatch MASK "bit" bound with the and the . - - virtual int schedule_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - // ADD the dispatch MASK "bit" bound with the and the . - - virtual int cancel_wakeup (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask); - // CLR the dispatch MASK "bit" bound with the and the . - - virtual int cancel_wakeup (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - // CLR the dispatch MASK "bit" bound with the and the . - - // = Notification methods. - virtual int notify (ACE_Event_Handler * = 0, - ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK, - ACE_Time_Value * = 0); - // Called by a thread when it wants to unblock the Select_Reactor. - // This wakeups the if currently blocked in - // are persistent if not acted upon immediately. It - // works by remembering the event handler that just got - // activated, releasing the internal lock (so that some other - // thread can start waiting in the event loop) and then - // dispatching the event handler outside the context of the - // Reactor lock. - // - // This Reactor is best suited for situations when the callbacks - // to event handlers can take arbitrarily long and/or a number - // of threads are available to run the event loops. - // - // Note that callback code in Event Handlers - // (e.g. Event_Handler::handle_input) does not have to be - // modified or made thread-safe for this Reactor. This is - // because an activated Event Handler is suspended in the - // Reactor before the upcall is made and resumed after the - // upcall completes. Therefore, one Event Handler cannot be - // called by multiple threads simultaneously. -public: - - // = Initialization and termination methods. - - ACE_TP_Reactor (ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int mask_signals = 1); - // Initialize with the default size. - - ACE_TP_Reactor (size_t max_number_of_handles, - int restart = 0, - ACE_Sig_Handler * = 0, - ACE_Timer_Queue * = 0, - int mask_signals = 1); - // Initialize the to manage - // . If is non-0 then the - // 's method will be restarted - // automatically when occurs. If or - // are non-0 they are used as the signal handler and - // timer queue, respectively. - - // = Event loop drivers. - - virtual int handle_events (ACE_Time_Value *max_wait_time = 0); - // This event loop driver that blocks for before - // returning. It will return earlier if timer events, I/O events, - // or signal events occur. Note that can be 0, in - // which case this method blocks indefinitely until events occur. - // - // is decremented to reflect how much time this call - // took. For instance, if a time value of 3 seconds is passed to - // handle_events and an event occurs after 2 seconds, - // will equal 1 second. This can be used if an - // application wishes to handle events for some fixed amount of - // time. - // - // Returns the total number of s that were - // dispatched, 0 if the elapsed without dispatching - // any handlers, or -1 if something goes wrong. - - virtual int handle_events (ACE_Time_Value &max_wait_time); - - virtual int mask_ops (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - int ops); - // GET/SET/ADD/CLR the dispatch mask "bit" bound with the and - // . - - virtual int mask_ops (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - int ops); - // GET/SET/ADD/CLR the dispatch mask "bit" bound with the - // and . - - static void no_op_sleep_hook (void *); - // Called from handle events - - virtual void wakeup_all_threads (void); - // Wake up all threads in waiting in the event loop - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - // = Internal methods that do the actual work. - - virtual int dispatch_io_set (int number_of_active_handles, - int& number_dispatched, - int mask, - ACE_Handle_Set& dispatch_mask, - ACE_Handle_Set& ready_mask, - ACE_EH_PTMF callback); - // Overwrites to *not* - // dispatch any event handlers. The information of one activated - // event handler is stored away, so that the event handler can be - // dispatch later. - - virtual void notify_handle (ACE_HANDLE handle, - ACE_Reactor_Mask mask, - ACE_Handle_Set &, - ACE_Event_Handler *eh, - ACE_EH_PTMF callback); - // This method shouldn't get called. - - virtual int notify_handle (ACE_EH_Dispatch_Info &dispatch_info); - // Notify the appropriate in the context of the - // associated with that a particular event has occurred. - - ACE_EH_Dispatch_Info dispatch_info_; - // Dispatch information of the activated event handler - -private: - ACE_TP_Reactor (const ACE_TP_Reactor &); - ACE_TP_Reactor &operator = (const ACE_TP_Reactor &); - // Deny access since member-wise won't work... -}; - -#if defined (__ACE_INLINE__) -#include "ace/TP_Reactor.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_TP_REACTOR_H */ diff --git a/ace/TP_Reactor.i b/ace/TP_Reactor.i deleted file mode 100644 index 969a7fdaf02..00000000000 --- a/ace/TP_Reactor.i +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE int -ACE_TP_Reactor::handle_events (ACE_Time_Value &max_wait_time) -{ - return ACE_Select_Reactor::handle_events (max_wait_time); -} - -ACE_INLINE int -ACE_TP_Reactor::mask_ops (ACE_Event_Handler *eh, - ACE_Reactor_Mask mask, - int ops) -{ - return this->mask_ops (eh->get_handle (), mask, ops); -} - -ACE_INLINE void -ACE_TP_Reactor::wakeup_all_threads (void) -{ - ACE_MT (this->token_.signal_all_threads ();); - - // Send a notification, but don't block if there's no one to receive - // it. - this->notify (0, - ACE_Event_Handler::NULL_MASK, - (ACE_Time_Value *) &ACE_Time_Value::zero); -} - -ACE_INLINE void -ACE_TP_Reactor::notify_handle (ACE_HANDLE, - ACE_Reactor_Mask, - ACE_Handle_Set &, - ACE_Event_Handler *, - ACE_EH_PTMF) -{ - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_TP_Reactor::notify_handle: Wrong version of notify_handle() gets called"))); -} diff --git a/ace/TTY_IO.cpp b/ace/TTY_IO.cpp deleted file mode 100644 index 0e7c2e98419..00000000000 --- a/ace/TTY_IO.cpp +++ /dev/null @@ -1,286 +0,0 @@ -// $Id$ - -#include "ace/TTY_IO.h" - -ACE_RCSID(ace, TTY_IO, "$Id$") - -// Interface for reading/writing serial device parameters - -int -ACE_TTY_IO::control (Control_Mode cmd, - Serial_Params *arg) const -{ -#if defined (ACE_HAS_TERM_IOCTLS) -#if defined(TCGETS) - struct termios devpar; -#elif defined(TCGETA) - struct termio devpar; -#else - errno = ENOSYS; - return -1; -#endif - u_long c_iflag; - u_long c_oflag; - u_long c_cflag; - u_long c_lflag; - // u_long c_line; - u_char ivmin_cc4; - u_char ivtime_cc5; - - c_iflag=0; - c_oflag=0; - c_cflag=0; - c_lflag=0; - // c_line=0; - - // Get default device parameters. - -#if defined (TCGETS) - if (this->ACE_IO_SAP::control (ACE_static_cast (int, TCGETS), - (void *) &devpar) == -1) -#elif defined (TCGETA) - if (this->ACE_IO_SAP::control (TCGETA, (void *) &devpar) == -1) -#else - errno = ENOSYS; -#endif /* TCGETS */ - return -1; - - u_int newbaudrate = 0; - - switch (cmd) - { - case SETPARAMS: - switch (arg->baudrate) - { - case 300: - newbaudrate = B300; - break; - case 600: - newbaudrate = B600; - break; - case 1200: - newbaudrate = B1200; - break; - case 2400: - newbaudrate = B2400; - break; - case 4800: - newbaudrate = B4800; - break; - case 9600: - newbaudrate = B9600; - break; - case 19200: - newbaudrate = B19200; - break; - case 38400: - newbaudrate = B38400; - break; -#if defined (ACE_USES_HIGH_BAUD_RATES) -// case 56000: -// newbaudrate = B56000; -// break; - case 57600: - newbaudrate = B57600; - break; - case 115200: - newbaudrate = B115200; - break; -// case 128000: -// newbaudrate = B128000; -// break; -// case 256000: -// newbaudrate = B256000; -// break; -#endif /* ACE_USES_HIGH_BAUD_RATES */ - default: - return -1; - } - -#if defined(ACE_USES_OLD_TERMIOS_STRUCT) - // @@ Can you really have different input and output baud - // rates?! - devpar.c_ispeed = newbaudrate; - devpar.c_ospeed = newbaudrate; -#else - c_cflag |= newbaudrate; -#endif /* ACE_USES_OLD_TERMIOS_STRUCT */ - - switch (arg->databits) - { - case 5: - c_cflag |= CS5; - break; - case 6: - c_cflag |= CS6; - break; - case 7: - c_cflag |= CS7; - break; - case 8: - c_cflag |= CS8; - break; - default: - return -1; - } - switch (arg->stopbits) - { - case 1: - break; - case 2: - c_cflag |= CSTOPB; - break; - default: - return -1; - } - if (arg->parityenb) - { - c_cflag |= PARENB; - if (ACE_OS::strcmp ((char *) arg->paritymode, "ODD") == 0 - || ACE_OS::strcmp ((char *) arg->paritymode, "odd") == 0) - c_cflag |= PARODD; - } -#if defined (CRTSCTS) - if (arg->ctsenb) /* enable CTS/RTS protocoll */ - c_cflag |= CRTSCTS; -#endif /* CRTSCTS */ -#if defined (CREAD) - if (arg->rcvenb) /* enable receiver */ - c_cflag |= CREAD; -#endif /* CREAD */ - - c_oflag = 0; - c_iflag = IGNPAR | INPCK; - if (arg->databits < 8) - c_iflag |= ISTRIP; - c_lflag = 0; - - ivmin_cc4 = (u_char) 0; - ivtime_cc5= (u_char) (arg->readtimeoutmsec / 100); - devpar.c_iflag = c_iflag; - devpar.c_oflag = c_oflag; - devpar.c_cflag = c_cflag; - devpar.c_lflag = c_lflag; - devpar.c_cc[4] = ivmin_cc4; - devpar.c_cc[5] = ivtime_cc5; - -#if defined(TCSETS) - return this->ACE_IO_SAP::control (ACE_static_cast (int, TCSETS), - (void *) &devpar); -#elif defined(TCSETA) - return this->ACE_IO_SAP::control (TCSETA, - (void *) &devpar); -#else - errno = ENOSYS; - return -1; -#endif - case GETPARAMS: - return -1; // Not yet implemented. - default: - return -1; // Wrong cmd. - } -#elif defined (ACE_WIN32) - switch (cmd) - { - case SETPARAMS: - DCB dcb ; - dcb.DCBlength = sizeof dcb ; - ::GetCommState (this->get_handle (), &dcb); - - switch (arg->baudrate) - { - case 300: dcb.BaudRate = CBR_300; break; - case 600: dcb.BaudRate = CBR_600; break; - case 1200: dcb.BaudRate = CBR_1200; break; - case 2400: dcb.BaudRate = CBR_2400; break; - case 4800: dcb.BaudRate = CBR_4800; break; - case 9600: dcb.BaudRate = CBR_9600; break; - case 19200: dcb.BaudRate = CBR_19200; break; - case 38400: dcb.BaudRate = CBR_38400; break; -// case 56000: dcb.BaudRate = CBR_56000; break; - case 57600: dcb.BaudRate = CBR_57600; break; - case 115200: dcb.BaudRate = CBR_115200; break; -// case 128000: dcb.BaudRate = CBR_128000; break; -// case 256000: dcb.BaudRate = CBR_256000; break; - default: return -1; - } - - switch (arg->databits) - { - case 4: - case 5: - case 6: - case 7: - case 8: - dcb.ByteSize = u_char (arg->databits); - break; - default: - return -1; - } - - switch (arg->stopbits) - { - case 1: - dcb.StopBits = ONESTOPBIT; - break ; - case 2: - dcb.StopBits = TWOSTOPBITS; - break ; - default: - return -1; - } - - if (arg->parityenb) - { - dcb.fParity = TRUE ; - if (ACE_OS::strcmp ((char *) arg->paritymode, "ODD") == 0 - || ACE_OS::strcmp ((char *) arg->paritymode, "odd") == 0) - dcb.Parity = ODDPARITY ; - else if (ACE_OS::strcmp ((char *) arg->paritymode, "EVEN") == 0 - || ACE_OS::strcmp ((char *) arg->paritymode, "even") == 0) - dcb.Parity = EVENPARITY ; - } - else - { - dcb.fParity = FALSE ; - dcb.Parity = NOPARITY ; - } - - if (arg->ctsenb) // enable CTS/RTS protocol. - { - dcb.fOutxCtsFlow = TRUE ; - dcb.fRtsControl = RTS_CONTROL_HANDSHAKE ; - } - else - { - dcb.fOutxCtsFlow = FALSE ; - dcb.fRtsControl = RTS_CONTROL_DISABLE ; - } - dcb.fBinary = TRUE ; - ::SetCommState (this->get_handle (), &dcb); - - // 2/13/97 BWF added drop out timer - COMMTIMEOUTS timeouts; - ::GetCommTimeouts (this->get_handle(), &timeouts) ; - timeouts.ReadIntervalTimeout = arg->readtimeoutmsec ; - return ::SetCommTimeouts (this->get_handle (), &timeouts) ; - - case GETPARAMS: - ACE_NOTSUP_RETURN (-1); // Not yet implemented. - default: - return -1; // Wrong cmd. - - } // arg switch -#else - ACE_UNUSED_ARG (cmd); - ACE_UNUSED_ARG (arg); - ACE_NOTSUP_RETURN (-1); -#endif /* ACE_HAS_TERM_IOCTLS */ -} - -#if defined (ACE_NEEDS_DEV_IO_CONVERSION) -ACE_TTY_IO::operator ACE_DEV_IO &() -{ - return (ACE_DEV_IO &) *this; -} -#endif /* ACE_NEEDS_DEV_IO_CONVERSION */ diff --git a/ace/TTY_IO.h b/ace/TTY_IO.h deleted file mode 100644 index 4c0e768a78d..00000000000 --- a/ace/TTY_IO.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// TTY_IO.h -// -// = DESCRIPTION -// -// = AUTHOR -// Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_TTY_IO_H -#define ACE_TTY_IO_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/DEV_Addr.h" -#include "ace/DEV_Connector.h" -#include "ace/DEV_IO.h" - -class ACE_Export ACE_TTY_IO : public ACE_DEV_IO -{ - // = TITLE - // Class definitions for platform specific TTY features. - // - // = DESCRIPTION - // This class represents an example interface for a specific - // device (a serial line) It extends the capability of the - // underlying DEV_IO class by adding a control method that takes - // a special structure (Serial_Params) as argument to allow a - // comfortable user interface (away from that annoying termios - // structure, which is very specific to UNIX). -public: - enum Control_Mode - { - SETPARAMS, // Set control parameters. - GETPARAMS // Get control parameters. - }; - - struct Serial_Params - { - int baudrate; - int parityenb; - const char *paritymode; - int databits; - int stopbits; - int readtimeoutmsec; - int ctsenb; - int rcvenb; - }; - - int control (Control_Mode cmd, - Serial_Params *arg) const; - // Interface for reading/writing serial device parameters. - -#if defined (ACE_NEEDS_DEV_IO_CONVERSION) - operator ACE_DEV_IO &(); - // This is necessary to pass ACE_TTY_IO as parameter to DEV_Connector. -#endif /* ACE_NEEDS_DEV_IO_CONVERSION */ -}; - -#include "ace/post.h" -#endif /* ACE_TTY_IO_H */ diff --git a/ace/Task.cpp b/ace/Task.cpp deleted file mode 100644 index 6342b37441e..00000000000 --- a/ace/Task.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// $Id$ - -#include "ace/Task.h" -#include "ace/Module.h" -#if !defined (ACE_HAS_WINCE) -#include "ace/Service_Config.h" -#endif /* !ACE_HAS_WINCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Task.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Task, "$Id$") - -ACE_Task_Base::~ACE_Task_Base (void) -{ -} - -ACE_Task_Base::ACE_Task_Base (ACE_Thread_Manager *thr_man) - : thr_count_ (0), - thr_mgr_ (thr_man), - flags_ (0), - grp_id_ (-1) -{ -} - -// Wait for all threads running in a task to exit. - -int -ACE_Task_Base::wait (void) -{ - ACE_TRACE ("ACE_Task_Base::wait"); - - // If we don't have a thread manager, we probably were never - // activated. - if (this->thr_mgr () != 0) - return this->thr_mgr ()->wait_task (this); - else - return 0; -} - -// Suspend a task. -int -ACE_Task_Base::suspend (void) -{ - ACE_TRACE ("ACE_Task_Base::suspend"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - if (this->thr_count_ > 0) - return this->thr_mgr_->suspend_task (this); - else - return 0; -} - -// Resume a suspended task. -int -ACE_Task_Base::resume (void) -{ - ACE_TRACE ("ACE_Task_Base::resume"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - if (this->thr_count_ > 0) - return this->thr_mgr_->resume_task (this); - else - return 0; -} - -int -ACE_Task_Base::activate (long flags, - int n_threads, - int force_active, - long priority, - int grp_id, - ACE_Task_Base *task, - ACE_hthread_t thread_handles[], - void *stack[], - size_t stack_size[], - ACE_thread_t thread_ids[]) -{ - ACE_TRACE ("ACE_Task_Base::activate"); - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1); - - // If the task passed in is zero, we will use - if (task == 0) - task = this; - - if (this->thr_count_ > 0 && force_active == 0) - return 1; // Already active. - else - { - if (this->thr_count_ > 0 && grp_id != -1) - // If we're joining an existing group of threads then make - // sure to use its group id. - grp_id = this->grp_id_; - this->thr_count_ += n_threads; - } - - // Use the ACE_Thread_Manager singleton if we're running as an - // active object and the caller didn't supply us with a - // Thread_Manager. - if (this->thr_mgr_ == 0) -# if defined (ACE_THREAD_MANAGER_LACKS_STATICS) - this->thr_mgr_ = ACE_THREAD_MANAGER_SINGLETON::instance (); -# else /* ! ACE_THREAD_MANAGER_LACKS_STATICS */ - this->thr_mgr_ = ACE_Thread_Manager::instance (); -# endif /* ACE_THREAD_MANAGER_LACKS_STATICS */ - - int grp_spawned = -1; - if (thread_ids == 0) - // Thread Ids were not specified - grp_spawned = - this->thr_mgr_->spawn_n (n_threads, - ACE_THR_FUNC (&ACE_Task_Base::svc_run), - (void *) this, - flags, - priority, - grp_id, - task, - thread_handles, - stack, - stack_size); - else - // thread names were specified - grp_spawned = - this->thr_mgr_->spawn_n (thread_ids, - n_threads, - ACE_THR_FUNC (&ACE_Task_Base::svc_run), - (void *) this, - flags, - priority, - grp_id, - stack, - stack_size, - thread_handles); - if (grp_spawned == -1) - { - // If spawn_n fails, restore original thread count. - this->thr_count_ -= n_threads; - return -1; - } - else - { - if (this->grp_id_ == -1) - this->grp_id_ = grp_spawned; - return 0; - } -#else - { - // Keep the compiler from complaining. - ACE_UNUSED_ARG (flags); - ACE_UNUSED_ARG (n_threads); - ACE_UNUSED_ARG (force_active); - ACE_UNUSED_ARG (priority); - ACE_UNUSED_ARG (grp_id); - ACE_UNUSED_ARG (task); - ACE_UNUSED_ARG (thread_handles); - ACE_UNUSED_ARG (stack); - ACE_UNUSED_ARG (stack_size); - ACE_UNUSED_ARG (thread_ids); - ACE_NOTSUP_RETURN (-1); - } -#endif /* ACE_MT_SAFE */ -} - -void -ACE_Task_Base::cleanup (void *object, void *) -{ - ACE_Task_Base *t = (ACE_Task_Base *) object; - - // The thread count must be decremented first in case the - // hook does something crazy like "delete this". - t->thr_count_dec (); - // @@ Is it possible to pass in the exit status somehow? - t->close (); -} - -#if defined (ACE_HAS_SIG_C_FUNC) -extern "C" void -ACE_Task_Base_cleanup (void *object, void *) -{ - ACE_Task_Base::cleanup (object, 0); -} -#endif /* ACE_HAS_SIG_C_FUNC */ - -void * -ACE_Task_Base::svc_run (void *args) -{ - ACE_TRACE ("ACE_Task_Base::svc_run"); - - ACE_Task_Base *t = (ACE_Task_Base *) args; - - // Register ourself with our 's thread exit hook - // mechanism so that our close() hook will be sure to get invoked - // when this thread exits. - -#if defined ACE_HAS_SIG_C_FUNC - t->thr_mgr ()->at_exit (t, ACE_Task_Base_cleanup, 0); -#else - t->thr_mgr ()->at_exit (t, ACE_Task_Base::cleanup, 0); -#endif /* ACE_HAS_SIG_C_FUNC */ - - // Call the Task's svc() hook method. - void * status = (void *) t->svc (); - -// If we changed this zero change the other if in OS.cpp Thread_Adapter::invoke -#if 1 - // Call the close> hook. - ACE_Thread_Manager *thr_mgr_ptr = t->thr_mgr (); - - // This calls the Task->close () hook. - t->cleanup (t, 0); - - // This prevents a second invocation of the cleanup code - // (called later by . - thr_mgr_ptr->at_exit (t, 0, 0); -#endif - return status; -} - -// Forward the call to close() so that existing applications don't -// break. - -int -ACE_Task_Base::module_closed (void) -{ - return this->close (1); -} diff --git a/ace/Task.h b/ace/Task.h deleted file mode 100644 index f5e6cbbf162..00000000000 --- a/ace/Task.h +++ /dev/null @@ -1,245 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Task.h -// -// = AUTHOR -// Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_TASK_H -#define ACE_TASK_H -#include "ace/pre.h" - -#include "ace/Service_Object.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Thread_Manager.h" - -class ACE_Export ACE_Task_Flags -{ -public: - // = TITLE - // These flags are used within the ACE_Task. - // - // = DESCRIPTION - // These flags should be hidden within ACE_Task. Unfortunately, the - // HP/UX C++ compiler can't grok this... Fortunately, there's no - // code defined here, so we don't have to worry about multiple - // definitions. - enum - { - ACE_READER = 01, // Identifies a Task as being the "reader" in a Module. - ACE_FLUSHDATA = 02, // Just flush data messages in the queue. - ACE_FLUSHALL = 04, // Flush all messages in the Queue. - ACE_FLUSHR = 010, // flush read queue - ACE_FLUSHW = 020, // flush write queue - ACE_FLUSHRW = 030 // flush both queues - }; -}; - -class ACE_Export ACE_Task_Base : public ACE_Service_Object -{ - // = TITLE - // Direct base class for the ACE_Task template. - // - // = DESCRIPTION - // This class factors out the non-template code in order to - // reduce template bloat, as well as to make it possible for the - // to store *'s - // polymorphically. -public: - // = Initialization and termination methods. - ACE_Task_Base (ACE_Thread_Manager * = 0); - // Constructor. - - virtual ~ACE_Task_Base (void); - // Destructor. - - // = Initialization and termination hooks. - - // These methods should be overridden by subclasses if you'd like to - // provide -specific initialization and termination behavior. - - virtual int open (void *args = 0); - // Hook called to open a Task. can be used to pass arbitrary - // information into . - - virtual int close (u_long flags = 0); - // Hook called from when during thread exit and from - // the default implemenation of . In general, this - // method shouldn't be called directly by an application, - // particularly if the is running as an Active Object. - // Instead, a special message should be passed into the via - // the method defined below, and the method should - // interpret this as a flag to shut down the . - - virtual int module_closed (void); - // Hook called during . The default - // implementation calls forwards the call to close(1). Please - // notice the changed value of the default argument of . - // This allows tasks to differ between the call has been originated - // from or from . Be aware that - // close(0) will be also called when a thread associated with the - // ACE_Task instance exits. - - // = Immediate and deferred processing methods, respectively. - - // These methods should be overridden by subclasses if you'd like to - // provide -specific message processing behavior. - - virtual int put (ACE_Message_Block *, ACE_Time_Value * = 0); - // Transfer msg into the queue to handle immediate processing. - - virtual int svc (void); - // Run by a daemon thread to handle deferred processing. - - // = Active object activation method. - virtual int activate (long flags = THR_NEW_LWP | THR_JOINABLE, - int n_threads = 1, - int force_active = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - ACE_Task_Base *task = 0, - ACE_hthread_t thread_handles[] = 0, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_thread_t thread_ids[] = 0); - // Turn the task into an active object, i.e., having of - // control, all running at the level (see below) with the - // same , all of which invoke . Returns -1 if - // failure occurs, returns 1 if Task is already an active object and - // is false (i.e., do *not* create a new thread in - // this case), and returns 0 if Task was not already an active - // object and a thread is created successfully or thread is an - // active object and is true. Note that if - // is true and there are already threads spawned in - // this , the parameter is ignored and the - // of any newly activated thread(s) will inherit the existing - // of the existing thread(s) in the . - // - // The <{flags}> are a bitwise-OR of the following: - // = BEGIN - // THR_CANCEL_DISABLE, THR_CANCEL_ENABLE, THR_CANCEL_DEFERRED, - // THR_CANCEL_ASYNCHRONOUS, THR_BOUND, THR_NEW_LWP, THR_DETACHED, - // THR_SUSPENDED, THR_DAEMON, THR_JOINABLE, THR_SCHED_FIFO, - // THR_SCHED_RR, THR_SCHED_DEFAULT - // = END - // - // By default, or if <{priority}> is set to - // ACE_DEFAULT_THREAD_PRIORITY, an "appropriate" priority value for - // the given scheduling policy (specified in <{flags}>, e.g., - // ) is used. This value is calculated - // dynamically, and is the median value between the minimum and - // maximum priority values for the given policy. If an explicit - // value is given, it is used. Note that actual priority values are - // EXTREMEMLY implementation-dependent, and are probably best - // avoided. - // - // If != 0 it is assumed to be an array of - // thread_handles that will be assigned the values of the thread - // handles being spawned. Returns -1 on failure ( will - // explain...), otherwise returns the group id of the threads. - // - // If != 0 it is assumed to be an array of pointers to - // the base of the stacks to use for the threads being spawned. - // Likewise, if != 0 it is assumed to be an array of - // values indicating how big each of the corresponding s - // are. - - virtual int wait (void); - // Wait for all threads running in this task to exit. - - // = Suspend/resume a Task. - - // Note that these methods are not portable and should be avoided - // since they are inherently error-prone to use. They are only here - // for (the rare) applications that know how to use them correctly. - virtual int suspend (void); - // Suspend a task. - virtual int resume (void); - // Resume a suspended task. - - int grp_id (void) const; - // Get the current group id. - - void grp_id (int); - // Set the current group id. - - ACE_Thread_Manager *thr_mgr (void) const; - // Gets the thread manager associated with this Task. - - void thr_mgr (ACE_Thread_Manager *); - // Set the thread manager associated with this Task. - - int is_reader (void) const; - // True if queue is a reader, else false. - - int is_writer (void) const; - // True if queue is a writer, else false. - - size_t thr_count (void) const; - // Returns the number of threads currently running within a task. - // If we're a passive object this value is 0, else it's > 0. - - void thr_count_dec (void); - // Atomically decrement the thread count by 1. This should only be - // called by the class destructor. - - static void *svc_run (void *); - // Routine that runs the service routine as a daemon thread. - - static void cleanup (void *object, void *params); - // Cleanup hook that is called when a thread exits to gracefully - // shutdown an . - - // = Internal data (should be private...). -// private: - - size_t thr_count_; - // Count of the number of threads running within the task. If this - // value is > 0 then we're an active object and the value of - // is the number of active threads at this instant. If - // the value == 0, then we're a passive object. - - ACE_Thread_Manager *thr_mgr_; - // Multi-threading manager. - - u_long flags_; - // ACE_Task flags. - - int grp_id_; - // This maintains the group id of the Task. - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - ACE_Thread_Mutex lock_; - // Protect the state of a Task during concurrent operations, but - // only if we're configured as MT safe... -#endif /* ACE_MT_SAFE */ - -private: - - // = Disallow these operations. - ACE_Task_Base &operator= (const ACE_Task_Base &); - ACE_Task_Base (const ACE_Task_Base &); -}; - -#if defined (__ACE_INLINE__) -#include "ace/Task.i" -#endif /* __ACE_INLINE__ */ - -// Include the ACE_Task templates classes at this point. -#include "ace/Task_T.h" - -#include "ace/post.h" -#endif /* ACE_TASK_H */ diff --git a/ace/Task.i b/ace/Task.i deleted file mode 100644 index fd9f992579b..00000000000 --- a/ace/Task.i +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Task.i - -ACE_INLINE ACE_Thread_Manager * -ACE_Task_Base::thr_mgr (void) const -{ - ACE_TRACE ("ACE_Task_Base::thr_mgr"); - return this->thr_mgr_; -} - -ACE_INLINE void -ACE_Task_Base::thr_mgr (ACE_Thread_Manager *thr_mgr) -{ - ACE_TRACE ("ACE_Task_Base::thr_mgr"); - this->thr_mgr_ = thr_mgr; -} - -// Return the count of the current number of threads. -ACE_INLINE size_t -ACE_Task_Base::thr_count (void) const -{ - ACE_TRACE ("ACE_Task_Base::thr_count"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->lock_, 0)); - - return this->thr_count_; -} - -// Decrement the count of the active threads by 1. - -ACE_INLINE void -ACE_Task_Base::thr_count_dec (void) -{ - ACE_TRACE ("ACE_Task_Base::thr_count_dec"); - ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_)); - - this->thr_count_--; -} - -ACE_INLINE int -ACE_Task_Base::is_reader (void) const -{ - ACE_TRACE ("ACE_Task_Base::is_reader"); - return (ACE_BIT_ENABLED (this->flags_, ACE_Task_Flags::ACE_READER)); -} - -ACE_INLINE int -ACE_Task_Base::is_writer (void) const -{ - ACE_TRACE ("ACE_Task_Base::is_writer"); - return (ACE_BIT_DISABLED (this->flags_, ACE_Task_Flags::ACE_READER)); -} - -// Default ACE_Task service routine - -ACE_INLINE int -ACE_Task_Base::svc (void) -{ - ACE_TRACE ("ACE_Task_Base::svc"); - return 0; -} - -// Default ACE_Task open routine - -ACE_INLINE int -ACE_Task_Base::open (void *) -{ - ACE_TRACE ("ACE_Task_Base::open"); - return 0; -} - -// Default ACE_Task close routine - -ACE_INLINE int -ACE_Task_Base::close (u_long) -{ - ACE_TRACE ("ACE_Task_Base::close"); - return 0; -} - -// Default ACE_Task put routine. - -ACE_INLINE int -ACE_Task_Base::put (ACE_Message_Block *, ACE_Time_Value *) -{ - ACE_TRACE ("ACE_Task_Base::put"); - return 0; -} - -// Get the current group id. -ACE_INLINE int -ACE_Task_Base::grp_id (void) const -{ - ACE_TRACE ("ACE_Task_Base::grp_id"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->lock_, -1)); - return this->grp_id_; -} - -// Set the current group id. - -ACE_INLINE void -ACE_Task_Base::grp_id (int id) -{ - ACE_TRACE ("ACE_Task_Base::grp_id"); - ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, this->lock_)); - - // Cache the group id in the task and then set it in the - // Thread_Manager, if there is one. - this->grp_id_ = id; - if (this->thr_mgr ()) - this->thr_mgr ()->set_grp (this, id); -} - diff --git a/ace/Task_T.cpp b/ace/Task_T.cpp deleted file mode 100644 index 0d2be69edbd..00000000000 --- a/ace/Task_T.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// Task.cpp -// $Id$ - -#ifndef ACE_TASK_T_C -#define ACE_TASK_T_C - -#include "ace/Task_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Module.h" -#include "ace/Service_Config.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Task_T.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Task_T, "$Id$") - -template void -ACE_Task::dump (void) const -{ - ACE_TRACE ("ACE_Task::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_mgr_ = %x"), this->thr_mgr_)); - this->msg_queue_->dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_msg_queue_ = %d\n"), this->delete_msg_queue_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nflags = %x"), this->flags_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmod_ = %x"), this->mod_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nnext_ = %x"), this->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ngrp_id_ = %d"), this->grp_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_count_ = %d"), this->thr_count_)); -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - this->lock_.dump (); -#endif /* ACE_MT_SAFE */ - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// If the user doesn't supply a ACE_Message_Queue pointer then we'll -// allocate one dynamically. Otherwise, we'll use the one they give. - -template -ACE_Task::ACE_Task (ACE_Thread_Manager *thr_man, - ACE_Message_Queue *mq) - : ACE_Task_Base (thr_man), - msg_queue_ (0), - delete_msg_queue_ (0), - mod_ (0), - next_ (0) -{ - ACE_TRACE ("ACE_Task::ACE_Task"); - - if (mq == 0) - { - ACE_NEW (mq, - ACE_Message_Queue); - this->delete_msg_queue_ = 1; - } - - this->msg_queue_ = mq; -} - -template -ACE_Task::~ACE_Task (void) -{ - ACE_TRACE ("ACE_Task::~ACE_Task"); - if (this->delete_msg_queue_) - delete this->msg_queue_; - - // These assignments aren't strickly necessary but they help guard - // against odd race conditions... - this->delete_msg_queue_ = 0; -} - -template ACE_Task * -ACE_Task::sibling (void) -{ - ACE_TRACE ("ACE_Task::sibling"); - if (this->mod_ == 0) - return 0; - else - return this->mod_->sibling (this); -} - -template const ACE_TCHAR * -ACE_Task::name (void) const -{ - ACE_TRACE ("ACE_Task::name"); - if (this->mod_ == 0) - return 0; - else - return this->mod_->name (); -} - -template ACE_Module * -ACE_Task::module (void) const -{ - ACE_TRACE ("ACE_Task::module"); - return this->mod_; -} - -#endif /* ACE_TASK_T_C */ diff --git a/ace/Task_T.h b/ace/Task_T.h deleted file mode 100644 index 3374fb6d42a..00000000000 --- a/ace/Task_T.h +++ /dev/null @@ -1,167 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Task_T.h -// -// = AUTHOR -// Douglas C. Schmidt -// -// ============================================================================ - -#ifndef ACE_TASK_T_H -#define ACE_TASK_T_H -#include "ace/pre.h" - -#include "ace/Message_Queue.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Synch_T.h" -#include "ace/Task.h" - -// Forward decls... -template class ACE_Module; - -template -class ACE_Task : public ACE_Task_Base -{ - // = TITLE - // Primary interface for application message processing, as well - // as input and output message queueing. - // - // = DESCRIPTION - // This class serves as the basis for passive and active objects - // in ACE. -public: - friend class ACE_Module; - friend class ACE_Module_Type; - - // = Initialization/termination methods. - ACE_Task (ACE_Thread_Manager *thr_mgr = 0, - ACE_Message_Queue *mq = 0); - // Initialize a Task, supplying a thread manager and a message - // queue. If the user doesn't supply a ACE_Message_Queue pointer - // then we'll allocate one dynamically. Otherwise, we'll use the - // one passed as a parameter. - - virtual ~ACE_Task (void); - // Destructor. - - ACE_Message_Queue *msg_queue (void); - // Gets the message queue associated with this task. - - void msg_queue (ACE_Message_Queue *); - // Sets the message queue associated with this task. - -public: // Should be protected: - // = Message queue manipulation methods. - - // = Enqueue and dequeue methods. - - // For the following five method if == 0, the caller will - // block until action is possible, else will wait until the - // <{absolute}> time specified in * elapses). These calls - // will return, however, when queue is closed, deactivated, when a - // signal occurs, or if the time specified in timeout elapses, (in - // which case errno = EWOULDBLOCK). - - int putq (ACE_Message_Block *, ACE_Time_Value *timeout = 0); - // Insert message into the message queue. Note that uses - // <{absolute}> time rather than <{relative}> time. - - int getq (ACE_Message_Block *&mb, ACE_Time_Value *timeout = 0); - // Extract the first message from the queue (blocking). Note that - // uses <{absolute}> time rather than <{relative}> time. - - int ungetq (ACE_Message_Block *, ACE_Time_Value *timeout = 0); - // Return a message to the queue. Note that uses - // <{absolute}> time rather than <{relative}> time. - - int reply (ACE_Message_Block *, ACE_Time_Value *timeout = 0); - // Turn the message around and send it back down the Stream. Note - // that uses <{absolute}> time rather than <{relative}> - // time. - - int put_next (ACE_Message_Block *msg, ACE_Time_Value *timeout = 0); - // Transfer message to the adjacent ACE_Task in a ACE_Stream. Note - // that uses <{absolute}> time rather than <{relative}> - // time. - - int can_put (ACE_Message_Block *); - // Tests whether we can enqueue a message without blocking. - - // = ACE_Task utility routines to identify names et al. - const ACE_TCHAR *name (void) const; - // Return the name of the enclosing Module if there's one associated - // with the Task, else returns 0. - - // = Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream). - ACE_Task *next (void); - // Get next Task pointer. - void next (ACE_Task *); - // Set next Task pointer. - - ACE_Task *sibling (void); - // Return the Task's sibling if there's one associated with the - // Task's Module, else returns 0. - - ACE_Module *module (void) const; - // Return the Task's Module if there is one, else returns 0. - - int flush (u_long flag = ACE_Task_Flags::ACE_FLUSHALL); - // Flush the queue. Note that if this conflicts with the C++ - // iostream function, just rewrite the iostream function as - // ::. - - // = Special routines corresponding to certain message types. - - void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t); - // Manipulate watermarks. - - ACE_Message_Queue *msg_queue_; - // Queue of messages on the ACE_Task.. - - int delete_msg_queue_; - // 1 if should delete Message_Queue, 0 otherwise. - - ACE_Module *mod_; - // Back-pointer to the enclosing module. - - ACE_Task *next_; - // Pointer to adjacent ACE_Task. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - - // = Disallow these operations. - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Task &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Task (const ACE_Task &)) -}; - -#if defined (__ACE_INLINE__) -#include "ace/Task_T.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Task_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Task_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_TASK_T_H */ diff --git a/ace/Task_T.i b/ace/Task_T.i deleted file mode 100644 index 1a78650279f..00000000000 --- a/ace/Task_T.i +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Task_T.i - -template ACE_INLINE void -ACE_Task::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, - size_t wm_size) -{ - ACE_TRACE ("ACE_Task::water_marks"); - if (cmd == ACE_IO_Cntl_Msg::SET_LWM) - this->msg_queue_->low_water_mark (wm_size); - else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */ - this->msg_queue_->high_water_mark (wm_size); -} - -template ACE_INLINE int -ACE_Task::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::getq"); - return this->msg_queue_->dequeue_head (mb, tv); -} - -template ACE_INLINE int -ACE_Task::can_put (ACE_Message_Block *) -{ - ACE_TRACE ("ACE_Task::can_put"); - assert (!"not implemented"); - return -1; -} - -template ACE_INLINE int -ACE_Task::putq (ACE_Message_Block *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::putq"); - return this->msg_queue_->enqueue_tail (mb, tv); -} - -template ACE_INLINE int -ACE_Task::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::ungetq"); - return this->msg_queue_->enqueue_head (mb, tv); -} - -template ACE_INLINE int -ACE_Task::flush (u_long flag) -{ - ACE_TRACE ("ACE_Task::flush"); - if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL)) - return this->msg_queue_ != 0 && this->msg_queue_->close (); - else - return -1; // Note, need to be more careful about what we free... -} - -template ACE_INLINE void -ACE_Task::msg_queue (ACE_Message_Queue *mq) -{ - ACE_TRACE ("ACE_Task::msg_queue"); - if (this->delete_msg_queue_) - { - delete this->msg_queue_; - this->delete_msg_queue_ = 0; - } - this->msg_queue_ = mq; -} - -template ACE_Message_Queue * -ACE_Task::msg_queue (void) -{ - ACE_TRACE ("ACE_Task::msg_queue"); - return this->msg_queue_; -} - -template ACE_INLINE int -ACE_Task::reply (ACE_Message_Block *mb, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::reply"); - return this->sibling ()->put_next (mb, tv); -} - -template ACE_INLINE ACE_Task * -ACE_Task::next (void) -{ - ACE_TRACE ("ACE_Task::next"); - return this->next_; -} - -template ACE_INLINE void -ACE_Task::next (ACE_Task *q) -{ - ACE_TRACE ("ACE_Task::next"); - this->next_ = q; -} - -// Transfer msg to the next ACE_Task. - -template ACE_INLINE int -ACE_Task::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv) -{ - ACE_TRACE ("ACE_Task::put_next"); - return this->next_ == 0 ? -1 : this->next_->put (msg, tv); -} diff --git a/ace/Template_Instantiations.cpp b/ace/Template_Instantiations.cpp deleted file mode 100644 index 0aa01515cc5..00000000000 --- a/ace/Template_Instantiations.cpp +++ /dev/null @@ -1,365 +0,0 @@ -// $Id$ - -// Note: this file has been created through concatenation of ALL -// explicit template instantiations in ACE, and only those that -// interfered with the multithreaded port of ACE to pSOS using the -// Diab D-C++ 4.1a compiler have been wrapped with the appropriate -// preprocesor directives for conditional compilation. If you are -// trying to use this file, you will need to ensure that any -// additional preprocessor directives needed are added. Also, if you -// wish to extend this technique to instantiation pragmas, you will -// need to modify the preprocesor directives below - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_FILE) - -// header files that are not already included -#include "ace/Local_Tokens.h" -#include "ace/Token.h" -#include "ace/Containers.h" -#include "ace/Obstack.h" -#include "ace/Select_Reactor.h" -#include "ace/Message_Queue.h" -#include "ace/Module.h" -#include "ace/Name_Space.h" -#include "ace/Stream.h" -#include "ace/Stream_Modules.h" -#include "ace/Dynamic.h" -#include "ace/Local_Name_Space_T.h" -#include "ace/Filecache.h" -#include "ace/Token_Invariants.h" -#include "ace/Remote_Tokens.h" -#include "ace/Singleton.h" -#include "ace/Timer_Hash.h" -#include "ace/Timer_Wheel_T.h" -#include "ace/Auto_Ptr.h" - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#error ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_FILE may not be used with ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION or ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA -#endif /* defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) */ - -// D E P T H = 0 -// Templates with nesting depth 0 (no dependencies on -// other templates), ordered by number of template arguments - -ACE_MT (template class ACE_Guard); - -// ACE_MT (template class ACE_Guard); -ACE_MT (template class ACE_Guard); -ACE_MT (template class ACE_Guard); - -ACE_MT (template class ACE_Guard); - -template class ACE_Guard; -template class ACE_Guard; -template class ACE_Guard; -template class ACE_Guard; -template class ACE_Guard; - -ACE_MT (template class ACE_TSS_Guard); - -template class ACE_Array; -template class ACE_Array_Base; -template class ACE_Array; -template class ACE_Array_Base; -template class ACE_Array; -template class ACE_Array_Base; -template class ACE_Array; -template class ACE_Array_Base; -template class ACE_Array_Iterator; - -// ACE_PROCESS_MUTEX is defined in Malloc.h, -// depending on whether ACE_HAS_THREADS is defined -#if defined (ACE_HAS_MALLOC_STATS) -template class ACE_Atomic_Op; -#endif /* ACE_HAS_MALLOC_STATS */ - -template class ACE_Auto_Array_Ptr; -template class ACE_Auto_Basic_Array_Ptr; -template class ACE_Auto_Basic_Ptr; - -template class ACE_Cleanup_Adapter; -template class ACE_Cleanup_Adapter; -template class ACE_Cleanup_Adapter; -template class ACE_Cleanup_Adapter; - -// ACE_SYNCH_RW_MUTEX is defined in Synch_T.h -template class ACE_Cleanup_Adapter; - -template class ACE_Cleanup_Adapter; -template class ACE_Double_Linked_List; -template class ACE_Double_Linked_List_Iterator_Base; -template class ACE_Double_Linked_List_Iterator; -template class ACE_Double_Linked_List_Reverse_Iterator; -// ACE_SYNCH_RECURSIVE_MUTEX is defined in Synch_T.h -template class ACE_Event_Handler_Handle_Timeout_Upcall; - -template class ACE_Lock_Adapter; - -template class ACE_Managed_Object; -template class ACE_Managed_Object; -template class ACE_Managed_Object; - -// ACE_SYNCH_RW_MUTEX is defined in Synch_T.h -template class ACE_Managed_Object; -template class ACE_Managed_Object; - -template class ACE_Managed_Object; - -// ACE_NULL_SYNCH is defined in Synch_T.h -template class ACE_Message_Queue; - -// ACE_SYNCH is defined in Synch_T.h -template class ACE_Message_Queue; - -// ACE_NULL_SYNCH is defined in Synch_T.h -template class ACE_Module; - -// ACE_SYNCH is defined in Synch_T.h -template class ACE_Module; - -template class ACE_Node ; -template class ACE_Node; -template class ACE_Node; -template class ACE_Node; -template class ACE_Node; -template class ACE_Node; -template class ACE_Node; -template class ACE_Node; - -template class ACE_Node; - -// ACE_TCHAR is defined in OS.h -template class ACE_Node; - -template class ACE_Read_Guard; -template class ACE_Read_Guard; -template class ACE_Read_Guard; - -// ACE_SYNCH is defined in Synch_T.h -template class ACE_Stream; -template class ACE_Stream_Head; -template class ACE_Stream_Tail; - -template class ACE_TSS ; -template class ACE_TSS ; -template class ACE_TSS; -template class ACE_TSS; -template class ACE_TSS; - -// ACE_NULL_SYNCH is defined in Synch_T.h -template class ACE_Task; - -// ACE_SYNCH is defined in Synch_T.h -template class ACE_Task; - -// ACE_NULL_SYNCH is defined in Synch_T.h -template class ACE_Thru_Task; - -// ACE_SYNCH is defined in Synch_T.h -template class ACE_Thru_Task; - -template class ACE_Timer_Node_T; -template class ACE_Unbounded_Queue; -template class ACE_Unbounded_Queue; -template class ACE_Unbounded_Queue; -template class ACE_Unbounded_Queue; - -// ACE_TCHAR is defined in OS.h -template class ACE_Unbounded_Queue; - -template class ACE_Unbounded_Queue_Iterator; -template class ACE_Unbounded_Queue_Iterator; -template class ACE_Unbounded_Queue_Iterator; -template class ACE_Unbounded_Queue_Iterator; - -// ACE_TCHAR is defined in OS.h -template class ACE_Unbounded_Queue_Iterator; - -template class ACE_Unbounded_Set; -template class ACE_Unbounded_Set; -template class ACE_Unbounded_Set; -template class ACE_Unbounded_Set_Iterator; -template class ACE_Unbounded_Set_Iterator; -template class ACE_Unbounded_Set_Iterator; -template class ACE_Unbounded_Stack ; -template class ACE_Write_Guard; -template class ACE_Write_Guard; -template class ACE_Write_Guard; - -// ACE_SYNCH_RW_MUTEX is defined in Synch_T.h -template class ACE_Write_Guard; - -template class auto_ptr; - -// from Signal.cpp -#if !defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) -#define ACE_MAX_SIGNAL_HANDLERS ((size_t) 20) -template class ACE_Fixed_Set; -template class ACE_Fixed_Set_Iterator; -#endif /* !defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) */ - -// ACE_LOCAL_MEMORY_POOL, ACE_MMAP_MEMORY_POOL, and -// ACE_LITE_MMAP_MEMORY_POOL are all defined in OS.h - -template class ACE_Local_Name_Space ; -template class ACE_Local_Name_Space ; -template class ACE_Malloc; -template class ACE_Malloc; -template class ACE_Malloc; -template class ACE_Malloc_T; -template class ACE_Malloc_T; -template class ACE_Malloc_T; -template class ACE_Allocator_Adapter >; - -template class ACE_Map_Entry ; -template class ACE_Map_Entry; -template class ACE_Map_Entry; -template class ACE_Map_Entry; -template class ACE_Module; - -// from Remote_Tokens.cpp -template class ACE_Singleton ; - -template class ACE_TSS_Singleton; - -// from Local_Name_Space.cpp -#if (1) -template class ACE_Hash_Map_Entry; -template class ACE_Hash; -template class ACE_Equal_To; -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Iterator; -template class ACE_Hash_Map_Reverse_Iterator; -template class ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex>; -#else -template class ACE_Map_Entry; -template class ACE_Map_Manager; -template class ACE_Map_Iterator; -template class ACE_Map_Reverse_Iterator; -template class ACE_Map_Iterator_Base; -#endif - -// from Filecache.cpp -#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) -template class ACE_Hash_Map_Entry; -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Iterator; -template class ACE_Hash_Map_Reverse_Iterator; -template class ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -#else -template class ACE_Hash_Map_Entry; -template class ACE_Hash; -template class ACE_Equal_To; -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Iterator; -template class ACE_Hash_Map_Reverse_Iterator; -template class ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex, ACE_Equal_To, ACE_Null_Mutex>; -#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ - -template class ACE_Map_Iterator; -template class ACE_Map_Iterator; -template class ACE_Map_Iterator; -template class ACE_Map_Iterator; -template class ACE_Map_Iterator_Base; -template class ACE_Map_Iterator_Base; -template class ACE_Map_Iterator_Base; -template class ACE_Map_Iterator_Base; -template class ACE_Map_Manager ; -template class ACE_Map_Manager; -template class ACE_Map_Manager; -template class ACE_Map_Manager; -template class ACE_Map_Reverse_Iterator; -template class ACE_Map_Reverse_Iterator; -template class ACE_Map_Reverse_Iterator; -template class ACE_Map_Reverse_Iterator; - -// D E P T H = 1 -// Templates with nesting depth 1 (dependencies on other templates 1 -// level deep), ordered by number of template arguments at top level - - -// ACE_MMAP_MEMORY_POOL is defined in OS.h - -template class ACE_Allocator_Adapter >; -template class ACE_Allocator_Adapter >; - -template class ACE_Node *>; - -// ACE_SYNCH_NULL_MUTEX is defined in Synch_T.h -template class ACE_Cached_Allocator, ACE_SYNCH_NULL_MUTEX>; - -template class ACE_Cached_Mem_Pool_Node >; -template class ACE_Free_List >; - -// ACE_SYNCH_RECURSIVE_MUTEX is defined in Synch_T.h -template class ACE_Timer_Heap_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_Heap_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_List_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_List_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_Queue_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_Queue_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_Wheel_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_Wheel_T, ACE_SYNCH_RECURSIVE_MUTEX>; - -template class ACE_Unbounded_Set *>; -template class ACE_Unbounded_Set_Iterator *>; -template class ACE_Locked_Free_List, ACE_Null_Mutex>; - -template class ACE_Timer_Hash_Upcall, ACE_Null_Mutex>; - -// ACE_SYNCH_RECURSIVE_MUTEX is defined in Synch_T.h -template class ACE_Timer_Hash_Upcall , ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_Hash_T, ACE_SYNCH_RECURSIVE_MUTEX, ACE_Hash_Timer_List>; -template class ACE_Timer_Hash_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX, ACE_Hash_Timer_List>; -template class ACE_Timer_Hash_T, ACE_SYNCH_RECURSIVE_MUTEX, ACE_Hash_Timer_Heap>; -template class ACE_Timer_Hash_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX, ACE_Hash_Timer_Heap>; - -// D E P T H = 2 -// Templates with nesting depth 2 (dependencies on other templates 2 -// levels deep), ordered by number of template arguments at top level - -template class ACE_Timer_Queue_T ; - -template class ACE_Timer_Queue_Iterator_T ; - -template class ACE_Timer_List_T ; - -template class ACE_Timer_List_Iterator_T ; - -template class ACE_Timer_Heap_T ; - -template class ACE_Timer_Heap_Iterator_T ; - -// ACE_MMAP_MEMORY_POOL and ACE_LITE_MMAP_MEMORY_POOL are defined in OS.h - -template class ACE_Name_Space_Map > >; -template class ACE_Name_Space_Map > >; - -template class ACE_Free_List > >; - -// ACE_SYNCH_NULL_MUTEX is defined in Synch_T.h -template class ACE_Locked_Free_List >, ACE_SYNCH_NULL_MUTEX>; - -template class ACE_Timer_Heap_T, ACE_Null_Mutex>, ACE_Null_Mutex>; - -template class ACE_Timer_Heap_Iterator_T, ACE_Null_Mutex>, ACE_Null_Mutex>; - -template class ACE_Timer_List_T, ACE_Null_Mutex>, ACE_Null_Mutex>; - -template class ACE_Timer_List_Iterator_T, ACE_Null_Mutex>, ACE_Null_Mutex>; - -template class ACE_Timer_Queue_T, ACE_Null_Mutex>, ACE_Null_Mutex>; - -template class ACE_Timer_Queue_Iterator_T, ACE_Null_Mutex>, ACE_Null_Mutex>; - - -#endif /* defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_FILE) */ diff --git a/ace/Thread.cpp b/ace/Thread.cpp deleted file mode 100644 index 7fa156c2488..00000000000 --- a/ace/Thread.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// Thread.cpp -// $Id$ - -#include "ace/Thread.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Thread.i" -#endif /* !defined (__ACE_INLINE__) */ - -ACE_RCSID(ace, Thread, "$Id$") - -#if defined (ACE_HAS_THREADS) - -int -ACE_Thread::spawn_n (size_t n, - ACE_THR_FUNC func, - void *arg, - long flags, - long priority, - void *stack[], - size_t stack_size[], - ACE_Thread_Adapter *thread_adapter) -{ - ACE_TRACE ("ACE_Thread::spawn_n"); - ACE_thread_t t_id; - size_t i; - - for (i = 0; i < n; i++) - // Bail out if error occurs. - if (ACE_OS::thr_create (func, - arg, - flags, - &t_id, - 0, - priority, - stack == 0 ? 0 : stack[i], - stack_size == 0 ? 0 : stack_size[i], - thread_adapter) != 0) - break; - - return i; -} - -int -ACE_Thread::spawn_n (ACE_thread_t thread_ids[], - size_t n, - ACE_THR_FUNC func, - void *arg, - long flags, - long priority, - void *stack[], - size_t stack_size[], - ACE_hthread_t thread_handles[], - ACE_Thread_Adapter *thread_adapter) -{ - ACE_TRACE ("ACE_Thread::spawn_n"); - size_t i; - - for (i = 0; i < n; i++) - { - ACE_thread_t t_id; - ACE_hthread_t t_handle; - - int result = - ACE_OS::thr_create (func, - arg, - flags, - &t_id, - &t_handle, - priority, - stack == 0 ? 0 : stack[i], - stack_size == 0 ? 0 : stack_size[i], - thread_adapter); - - if (result == 0) - { - if (thread_ids != 0) - thread_ids[i] = t_id; - if (thread_handles != 0) - thread_handles[i] = t_handle; - } - else - // Bail out if error occurs. - break; - } - - return i; -} - -#endif /* ACE_HAS_THREADS */ diff --git a/ace/Thread.h b/ace/Thread.h deleted file mode 100644 index 8948ebda2c1..00000000000 --- a/ace/Thread.h +++ /dev/null @@ -1,228 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Thread.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_THREAD_H -#define ACE_THREAD_H -#include "ace/pre.h" - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Export ACE_Thread -{ - // = TITLE - // Provides a wrapper for threads. - // - // = DESCRIPTION - // This class provides a common interface that is mapped onto - // POSIX Pthreads, Solaris threads, Win32 threads, VxWorks - // threads, or pSoS threads. Note, however, that it is - // generally a better idea to use the - // programming API rather than the API since the - // thread manager is more powerful. -public: - static int spawn (ACE_THR_FUNC func, - void *arg = 0, - long flags = THR_NEW_LWP | THR_JOINABLE, - ACE_thread_t *t_id = 0, - ACE_hthread_t *t_handle = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - void *stack = 0, - size_t stack_size = 0, - ACE_Thread_Adapter *thread_adapter = 0); - // Creates a new thread having attributes and running - // with (if is non-0 then and - // are ignored and are obtained from ). - // and are set to the thread's ID and handle (?), - // respectively. The thread runs at priority (see - // below). - // - // The are a bitwise-OR of the following: - // = BEGIN - // THR_CANCEL_DISABLE, THR_CANCEL_ENABLE, THR_CANCEL_DEFERRED, - // THR_CANCEL_ASYNCHRONOUS, THR_BOUND, THR_NEW_LWP, THR_DETACHED, - // THR_SUSPENDED, THR_DAEMON, THR_JOINABLE, THR_SCHED_FIFO, - // THR_SCHED_RR, THR_SCHED_DEFAULT - // = END - // - // By default, or if is set to - // ACE_DEFAULT_THREAD_PRIORITY, an "appropriate" priority value for - // the given scheduling policy (specified in , e.g., - // ) is used. This value is calculated - // dynamically, and is the median value between the minimum and - // maximum priority values for the given policy. If an explicit - // value is given, it is used. Note that actual priority values are - // EXTREMEMLY implementation-dependent, and are probably best - // avoided. - // - // Note that is always deleted by , - // therefore it must be allocated with global operator new. - - static int spawn_n (size_t n, - ACE_THR_FUNC func, - void *arg = 0, - long flags = THR_NEW_LWP | THR_JOINABLE, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_Thread_Adapter *thread_adapter = 0); - // Spawn N new threads, which execute with argument (if - // is non-0 then and are ignored and - // are obtained from ). If != 0 it is - // assumed to be an array of pointers to the base of the stacks - // to use for the threads being spawned. Likewise, if - // != 0 it is assumed to be an array of values indicating how - // big each of the corresponding s are. Returns the number - // of threads actually spawned (if this doesn't equal the number - // requested then something has gone wrong and will - // explain...). - // - // See also . - - static int spawn_n (ACE_thread_t thread_ids[], - size_t n, - ACE_THR_FUNC func, - void *arg, - long flags, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_hthread_t thread_handles[] = 0, - ACE_Thread_Adapter *thread_adapter = 0); - // Spawn new threads, which execute with argument - // (if is non-0 then and are ignored - // and are obtained from ). The thread_ids of - // successfully spawned threads will be placed into the - // buffer (which must be the same size as ). If != 0 it - // is assumed to be an array of pointers to the base of the - // stacks to use for the threads being spawned. If != - // 0 it is assumed to be an array of values indicating how big - // each of the corresponding s are. If != 0 - // it is assumed to be an array of thread_handles that will be - // assigned the values of the thread handles being spawned. Returns - // the number of threads actually spawned (if this doesn't equal the - // number requested then something has gone wrong and will - // explain...). - // - // See also . - - static int join (ACE_thread_t, - ACE_thread_t *, - void **status = 0); - // Wait for one or more threads to exit. - - static int join (ACE_hthread_t, - void ** = 0); - // Wait for one thread to exit. - - static int resume (ACE_hthread_t); - // Continue the execution of a previously suspended thread. - - static int suspend (ACE_hthread_t); - // Suspend the execution of a particular thread. - - static int getprio (ACE_hthread_t, int &prio); - // Get the priority of a particular thread. - - static int setprio (ACE_hthread_t, int prio); - // Set the priority of a particular thread. - - static int kill (ACE_thread_t, int signum); - // Send a signal to the thread. - - static void yield (void); - // Yield the thread to another. - - static void self (ACE_hthread_t &t_handle); - // Return the unique kernel handle of the thread. Note that on - // Win32 this is actually a pseudohandle, which cannot be shared - // with other processes or waited on by threads. To locate the real - // handle, please use the method. - - static ACE_thread_t self (void); - // Return the unique ID of the thread. - - static void exit (void *status = 0); - // Exit the current thread and return "status". - // Should _not_ be called by main thread. - - static int getconcurrency (void); - // Get the LWP concurrency level of the process. - - static int setconcurrency (int new_level); - // Set the LWP concurrency level of the process. - - static int sigsetmask (int how, - const sigset_t *sigset, - sigset_t *osigset = 0); - // Change and/or examine calling thread's signal mask. - - static int keycreate (ACE_thread_key_t *keyp, -#if defined (ACE_HAS_THR_C_DEST) - ACE_THR_C_DEST destructor, -#else - ACE_THR_DEST destructor, -#endif /* ACE_HAS_THR_C_DEST */ - void * = 0); - // Allocates a that is used to identify data that is specific - // to each thread in the process. The key is global to all threads - // in the process. - - static int keyfree (ACE_thread_key_t key); - // Free up the key so that other threads can reuse it. - - static int setspecific (ACE_thread_key_t key, - void *value); - // Bind value to the thread-specific data key, , for the calling - // thread. - - static int getspecific (ACE_thread_key_t key, - void **valuep); - // Stores the current value bound to for the calling thread - // into the location pointed to by . - - static int disablecancel (struct cancel_state *old_state); - // Disable thread cancellation. - - static int enablecancel (struct cancel_state *old_state, - int flag); - // Enable thread cancellation. - - static int setcancelstate (struct cancel_state &new_state, - struct cancel_state *old_state); - // Set the cancellation state. - - static int cancel (ACE_thread_t t_id); - // Cancel a thread. Note that this method is only portable on - // platforms, such as POSIX pthreads, that support thread - // cancellation. - - static void testcancel (void); - // Test the cancel. - -private: - ACE_Thread (void); - // Ensure that we don't get instantiated. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Thread.i" -#endif /* __ACE_INLINE__ */ -#include "ace/post.h" -#endif /* ACE_THREAD_H */ diff --git a/ace/Thread.i b/ace/Thread.i deleted file mode 100644 index 610b84f1ad0..00000000000 --- a/ace/Thread.i +++ /dev/null @@ -1,272 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Thread.i - -// Allocates a that is used to identify data that is specific -// to each thread in the process. The key is global to all threads in -// the process. - -ACE_INLINE int -ACE_Thread::keycreate (ACE_thread_key_t *keyp, -#if defined (ACE_HAS_THR_C_DEST) - ACE_THR_C_DEST destructor, -#else - ACE_THR_DEST destructor, -#endif /* ACE_HAS_THR_C_DEST */ - void *inst) -{ - // ACE_TRACE ("ACE_Thread::keycreate"); - return ACE_OS::thr_keycreate (keyp, destructor, inst); -} - -// Free up the key so that other threads can reuse it. - -ACE_INLINE int -ACE_Thread::keyfree (ACE_thread_key_t key) -{ - ACE_TRACE ("ACE_Thread::keyfree"); - return ACE_OS::thr_keyfree (key); -} - -// Bind value to the thread-specific data key, , for the calling -// thread. - -ACE_INLINE int -ACE_Thread::setspecific (ACE_thread_key_t key, void *value) -{ - // ACE_TRACE ("ACE_Thread::setspecific"); - return ACE_OS::thr_setspecific (key, value); -} - -// Stores the current value bound to for the calling thread -// into the location pointed to by . - -ACE_INLINE int -ACE_Thread::getspecific (ACE_thread_key_t key, void **valuep) -{ - // ACE_TRACE ("ACE_Thread::getspecific"); - return ACE_OS::thr_getspecific (key, valuep); -} - -ACE_INLINE ACE_thread_t -ACE_Thread::self (void) -{ -// ACE_TRACE ("ACE_Thread::self"); - return ACE_OS::thr_self (); -} - -ACE_INLINE void -ACE_Thread::exit (void *status) -{ - ACE_TRACE ("ACE_Thread::exit"); - ACE_OS::thr_exit (status); -} - -ACE_INLINE void -ACE_Thread::yield (void) -{ - ACE_TRACE ("ACE_Thread::yield"); - ACE_OS::thr_yield (); -} - -ACE_INLINE int -ACE_Thread::spawn (ACE_THR_FUNC func, - void *arg, - long flags, - ACE_thread_t *t_id, - ACE_hthread_t *t_handle, - long priority, - void *thr_stack, - size_t thr_stack_size, - ACE_Thread_Adapter *thread_adapter) -{ - ACE_TRACE ("ACE_Thread::spawn"); - - return ACE_OS::thr_create (func, - arg, - flags, - t_id, - t_handle, - priority, - thr_stack, - thr_stack_size, - thread_adapter); -} - -ACE_INLINE int -ACE_Thread::resume (ACE_hthread_t t_id) -{ - ACE_TRACE ("ACE_Thread::resume"); - return ACE_OS::thr_continue (t_id); -} - -ACE_INLINE int -ACE_Thread::suspend (ACE_hthread_t t_id) -{ - ACE_TRACE ("ACE_Thread::suspend"); - return ACE_OS::thr_suspend (t_id); -} - -ACE_INLINE int -ACE_Thread::kill (ACE_thread_t t_id, int signum) -{ - ACE_TRACE ("ACE_Thread::kill"); - return ACE_OS::thr_kill (t_id, signum); -} - -ACE_INLINE int -ACE_Thread::join (ACE_thread_t wait_for, - ACE_thread_t *departed, - void **status) -{ - ACE_TRACE ("ACE_Thread::join"); - return ACE_OS::thr_join (wait_for, departed, status); -} - -ACE_INLINE int -ACE_Thread::join (ACE_hthread_t wait_for, - void **status) -{ - ACE_TRACE ("ACE_Thread::join"); - return ACE_OS::thr_join (wait_for, status); -} - -ACE_INLINE int -ACE_Thread::getconcurrency (void) -{ - ACE_TRACE ("ACE_Thread::getconcurrency"); - return ACE_OS::thr_getconcurrency (); -} - -ACE_INLINE int -ACE_Thread::setconcurrency (int new_level) -{ - ACE_TRACE ("ACE_Thread::setconcurrency"); - return ACE_OS::thr_setconcurrency (new_level); -} - -ACE_INLINE int -ACE_Thread::sigsetmask (int how, - const sigset_t *sigset, - sigset_t *osigset) -{ - ACE_TRACE ("ACE_Thread::sigsetmask"); - return ACE_OS::thr_sigsetmask (how, sigset, osigset); -} - -ACE_INLINE int -ACE_Thread::disablecancel (struct cancel_state *old_state) -{ - ACE_TRACE ("ACE_Thread::disablecancel"); - int old_cstate = 0; - int result = ACE_OS::thr_setcancelstate (THR_CANCEL_DISABLE, - &old_cstate); - if (result == 0 && old_state != 0) - { - ACE_OS::memset (old_state, - 0, - sizeof (old_state)); - old_state->cancelstate = old_cstate; - } - - return result; -} - -ACE_INLINE int -ACE_Thread::enablecancel (struct cancel_state *old_state, - int flag) -{ - ACE_TRACE ("ACE_Thread::enablecancel"); - int old_cstate = 0; - int old_ctype = 0; - int result; - - result = ACE_OS::thr_setcancelstate (THR_CANCEL_ENABLE, - &old_cstate); - if (result != 0) - return result; - - result = ACE_OS::thr_setcanceltype (flag, - &old_ctype); - if (result != 0) - return result; - - if (old_state != 0) - { - old_state->cancelstate = old_cstate; - old_state->canceltype = old_ctype; - } - - return 0; -} - -ACE_INLINE int -ACE_Thread::setcancelstate (struct cancel_state &new_state, - struct cancel_state *old_state) -{ - ACE_TRACE ("ACE_Thread::setcancelstate"); - int old_cstate = 0; - int old_ctype = 0; - - if (new_state.cancelstate != 0 - && ACE_OS::thr_setcancelstate (new_state.cancelstate, - &old_cstate) != 0) - return -1; - - if (new_state.canceltype != 0 - && ACE_OS::thr_setcanceltype (new_state.canceltype, - &old_ctype) != 0) - { - int o_cstate; - - ACE_OS::thr_setcancelstate (old_cstate, - &o_cstate); - return -1; - } - - if (old_state != 0) - { - old_state->cancelstate = old_cstate; - old_state->canceltype = old_ctype; - } - - return 0; -} - -ACE_INLINE int -ACE_Thread::cancel (ACE_thread_t t_id) -{ - ACE_TRACE ("ACE_Thread::cancel"); - - return ACE_OS::thr_cancel (t_id); -} - -ACE_INLINE void -ACE_Thread::testcancel (void) -{ - ACE_TRACE ("ACE_Thread::testcancel"); - - ACE_OS::thr_testcancel (); -} - -ACE_INLINE void -ACE_Thread::self (ACE_hthread_t &t_id) -{ -// ACE_TRACE ("ACE_Thread::self"); - ACE_OS::thr_self (t_id); -} - -ACE_INLINE int -ACE_Thread::getprio (ACE_hthread_t t_id, int &prio) -{ - ACE_TRACE ("ACE_Thread::getprio"); - return ACE_OS::thr_getprio (t_id, prio); -} - -ACE_INLINE int -ACE_Thread::setprio (ACE_hthread_t t_id, int prio) -{ - ACE_TRACE ("ACE_Thread::setprio"); - return ACE_OS::thr_setprio (t_id, prio); -} diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp deleted file mode 100644 index a243c754f01..00000000000 --- a/ace/Thread_Manager.cpp +++ /dev/null @@ -1,2415 +0,0 @@ -// $Id$ - -#include "ace/Synch_T.h" -#include "ace/Thread_Manager.h" -#include "ace/Dynamic.h" -#include "ace/Object_Manager.h" -#include "ace/Singleton.h" -#include "ace/Auto_Ptr.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Thread_Manager.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Thread_Manager, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Control) -ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Manager) - -#if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) -// Process-wide Thread Manager. -ACE_Thread_Manager *ACE_Thread_Manager::thr_mgr_ = 0; - -// Controls whether the Thread_Manager is deleted when we shut down -// (we can only delete it safely if we created it!) -int ACE_Thread_Manager::delete_thr_mgr_ = 0; -#endif /* ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ - -void -ACE_Thread_Manager::dump (void) -{ - ACE_TRACE ("ACE_Thread_Manager::dump"); - // Cast away const-ness of this in order to use its non-const lock_. - ACE_MT (ACE_GUARD (ACE_Thread_Mutex, ace_mon, - ((ACE_Thread_Manager *) this)->lock_)); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ngrp_id_ = %d"), this->grp_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncurrent_count_ = %d"), this->thr_list_.size ())); - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - iter.next ()->dump (); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_Thread_Descriptor::~ACE_Thread_Descriptor (void) -{ - delete this->sync_; -} - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) -void ACE_Thread_Descriptor::at_pop (int apply) - -{ - ACE_TRACE ("ACE_Thread_Descriptor::at_pop"); - // Get first at from at_exit_list - ACE_At_Thread_Exit* at = this->at_exit_list_; - // Remove at from at_exit list - this->at_exit_list_ = at->next_; - // Apply if required - if (apply) - { - at->apply (); - // Do the apply method - at->was_applied (1); - // Mark at has been applied to avoid double apply from - // at destructor - } - // If at is not owner delete at. - if (!at->is_owner ()) - delete at; -} - -void -ACE_Thread_Descriptor::at_push (ACE_At_Thread_Exit* cleanup, int is_owner) - -{ - ACE_TRACE ("ACE_Thread_Descriptor::at_push"); - cleanup->is_owner (is_owner); - cleanup->td_ = this; - cleanup->next_ = at_exit_list_; - at_exit_list_ = cleanup; -} - -int -ACE_Thread_Descriptor::at_exit (ACE_At_Thread_Exit& cleanup) - -{ - ACE_TRACE ("ACE_Thread_Descriptor::at_exit"); - at_push (&cleanup, 1); - return 0; -} - -int -ACE_Thread_Descriptor::at_exit (ACE_At_Thread_Exit* cleanup) - -{ - ACE_TRACE ("ACE_Thread_Descriptor::at_exit"); - if (cleanup==0) - return -1; - else - { - this->at_push (cleanup); - return 0; - } -} - -void -ACE_Thread_Descriptor::do_at_exit () - -{ - ACE_TRACE ("ACE_Thread_Descriptor::at_exit"); - while (at_exit_list_!=0) - this->at_pop (); -} - -void -ACE_Thread_Descriptor::terminate () - -{ - ACE_TRACE ("ACE_Thread_Descriptor::terminate"); - - if (!terminated_) - { - terminated_ = 1; - // Run at_exit hooks - this->do_at_exit (); - // We must remove Thread_Descriptor from Thread_Manager list - if (this->tm_ != 0) - { - int close_handle = 0; - -#if !defined (VXWORKS) - // Threads created with THR_DAEMON shouldn't exist here, but - // just to be safe, let's put it here. - - if (ACE_BIT_DISABLED (this->thr_state_, ACE_Thread_Manager::ACE_THR_JOINING)) - { - if (ACE_BIT_DISABLED (this->flags_, THR_DETACHED | THR_DAEMON) - || ACE_BIT_ENABLED (this->flags_, THR_JOINABLE)) - { - // Mark thread as terminated. - ACE_SET_BITS (this->thr_state_, ACE_Thread_Manager::ACE_THR_TERMINATED); - tm_->register_as_terminated (this); - // Must copy the information here because td will be - // "freed" below. - } -#if defined (ACE_WIN32) - else - { - close_handle = 1; - } -#endif /* ACE_WIN32 */ - } -#endif /* ! VXWORKS */ - - // Remove thread descriptor from the table. - if (this->tm_ != 0) - tm_->remove_thr (this, close_handle); - } - - // Check if we need delete ACE_Log_Msg instance - ACE_Log_Msg* log_msg = this->log_msg_; - // If ACE_TSS_cleanup was not executed first log_msg == 0 - if (log_msg == 0) - { - // Only inform to ACE_TSS_cleanup that it must delete the log instance - // setting ACE_LOG_MSG thr_desc to 0. - ACE_LOG_MSG->thr_desc (0); - } - else - { - // Thread_Descriptor is the owner of the Log_Msg instance!! - // deleted. - this->log_msg_ = 0; - delete log_msg; - } - } -} - -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - -int -ACE_Thread_Descriptor::at_exit (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param) -{ - ACE_TRACE ("ACE_Thread_Descriptor::at_exit"); -#if defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - this->cleanup_info_.cleanup_hook_ = cleanup_hook; - this->cleanup_info_.object_ = object; - this->cleanup_info_.param_ = param; -#else - // To keep compatibility, when cleanup_hook is null really is a at_pop - // without apply. - if (cleanup_hook == 0) - { - if (this->at_exit_list_!= 0) - this->at_pop(0); - } - else - { - ACE_At_Thread_Exit* cleanup; - ACE_NEW_RETURN (cleanup, - ACE_At_Thread_Exit_Func (object, - cleanup_hook, - param), - -1); - this->at_push (cleanup); - } -#endif /* ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - return 0; -} - -void -ACE_Thread_Descriptor::dump (void) const -{ - ACE_TRACE ("ACE_Thread_Descriptor::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_id_ = %d"), this->thr_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_handle_ = %d"), this->thr_handle_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ngrp_id_ = %d"), this->grp_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nthr_state_ = %d"), this->thr_state_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncleanup_info_.cleanup_hook_ = %x"), this->cleanup_info_.cleanup_hook_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nflags_ = %x\n"), this->flags_)); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -ACE_Thread_Descriptor::ACE_Thread_Descriptor (void) - : -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - log_msg_ (0), - at_exit_list_ (0), - terminated_ (0) -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ -{ - ACE_TRACE ("ACE_Thread_Descriptor::ACE_Thread_Descriptor"); - ACE_NEW (this->sync_, - ACE_DEFAULT_THREAD_MANAGER_LOCK); -} - -void -ACE_Thread_Descriptor::acquire_release (void) -{ - // Just try to acquire the lock then release it. -#if defined (ACE_THREAD_MANAGER_USES_SAFE_SPAWN) - if (ACE_BIT_DISABLED (this->thr_state_, ACE_Thread_Manager::ACE_THR_SPAWNED)) -#endif /* ACE_THREAD_MANAGER_USES_SAFE_SPAWN */ - { - this->sync_->acquire (); - // Acquire the lock before removing from the thread table. If - // this thread is in the table already, it should simply acquire the - // lock easily. - - // Once we get the lock, we must have registered. - ACE_ASSERT (ACE_BIT_ENABLED (this->thr_state_, ACE_Thread_Manager::ACE_THR_SPAWNED)); - - this->sync_->release (); - // Release the lock before putting it back to freelist. - } -} - -// The following macro simplifies subsequence code. -#define ACE_FIND(OP,INDEX) \ - ACE_Thread_Descriptor *INDEX = OP; \ - -ACE_Thread_Descriptor * -ACE_Thread_Manager::thread_descriptor (ACE_thread_t thr_id) -{ - ACE_TRACE ("ACE_Thread_Manager::thread_descriptor"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - - ACE_FIND (this->find_thread (thr_id), ptr); - return ptr; -} - -ACE_Thread_Descriptor * -ACE_Thread_Manager::hthread_descriptor (ACE_hthread_t thr_handle) -{ - ACE_TRACE ("ACE_Thread_Manager::hthread_descriptor"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - - ACE_FIND (this->find_hthread (thr_handle), ptr); - return ptr; -} - -// Return the thread descriptor (indexed by ACE_hthread_t). - -int -ACE_Thread_Manager::thr_self (ACE_hthread_t &self) -{ - ACE_TRACE ("ACE_Thread_Manager::thr_self"); - - ACE_Thread_Descriptor *desc = - this->thread_desc_self (); - - if (desc == 0) - return -1; - else - desc->self (self); - - return 0; -} - -// Initialize the synchronization variables. - -ACE_Thread_Manager::ACE_Thread_Manager (size_t prealloc, - size_t lwm, - size_t inc, - size_t hwm) - : grp_id_ (1), - automatic_wait_ (1) -#if defined (ACE_HAS_THREADS) - , zero_cond_ (lock_) -#endif /* ACE_HAS_THREADS */ - , thread_desc_freelist_ (ACE_FREE_LIST_WITH_POOL, - prealloc, lwm, hwm, inc) -{ - ACE_TRACE ("ACE_Thread_Manager::ACE_Thread_Manager"); -} - -#if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) -ACE_Thread_Manager * -ACE_Thread_Manager::instance (void) -{ - ACE_TRACE ("ACE_Thread_Manager::instance"); - - if (ACE_Thread_Manager::thr_mgr_ == 0) - { - // Perform Double-Checked Locking Optimization. - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance (), 0)); - - if (ACE_Thread_Manager::thr_mgr_ == 0) - { - ACE_NEW_RETURN (ACE_Thread_Manager::thr_mgr_, - ACE_Thread_Manager, - 0); - ACE_Thread_Manager::delete_thr_mgr_ = 1; - } - } - - return ACE_Thread_Manager::thr_mgr_; -} - -ACE_Thread_Manager * -ACE_Thread_Manager::instance (ACE_Thread_Manager *tm) -{ - ACE_TRACE ("ACE_Thread_Manager::instance"); - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance (), 0)); - - ACE_Thread_Manager *t = ACE_Thread_Manager::thr_mgr_; - // We can't safely delete it since we don't know who created it! - ACE_Thread_Manager::delete_thr_mgr_ = 0; - - ACE_Thread_Manager::thr_mgr_ = tm; - return t; -} - -void -ACE_Thread_Manager::close_singleton (void) -{ - ACE_TRACE ("ACE_Thread_Manager::close_singleton"); - - ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, - *ACE_Static_Object_Lock::instance ())); - - if (ACE_Thread_Manager::delete_thr_mgr_) - { - // First, we clean up the thread descriptor list. - ACE_Thread_Manager::thr_mgr_->close (); - delete ACE_Thread_Manager::thr_mgr_; - ACE_Thread_Manager::thr_mgr_ = 0; - ACE_Thread_Manager::delete_thr_mgr_ = 0; - } -} -#endif /* ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ - -// Close up and release all resources. - -int -ACE_Thread_Manager::close () -{ - ACE_TRACE ("ACE_Thread_Manager::close"); - - // Clean up the thread descriptor list. - if (this->automatic_wait_) - this->wait (0, 1); - else - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - this->remove_thr_all (); - } - - return 0; -} - -ACE_Thread_Manager::~ACE_Thread_Manager (void) -{ - ACE_TRACE ("ACE_Thread_Manager::~ACE_Thread_Manager"); - this->close (); -} - -#if defined (ACE_HAS_SIG_C_FUNC) -extern "C" void -ACE_Thread_Exit_cleanup (void *instance, void *) -{ - ACE_TRACE ("ACE_Thread_Exit_cleanup"); - - delete (ACE_TSS_TYPE (ACE_Thread_Exit) *) instance; -} -#else -void -ACE_Thread_Exit::cleanup (void *instance, void *) -{ - ACE_TRACE ("ACE_Thread_Exit::cleanup"); - - delete (ACE_TSS_TYPE (ACE_Thread_Exit) *) instance; -} -#endif /* ACE_HAS_SIG_C_FUNC */ - -// NOTE: this preprocessor directive should match the one in -// ACE_Task_Base::svc_run () below. This prevents the two statics -// from being defined. - -ACE_Thread_Exit * -ACE_Thread_Exit::instance (void) -{ -#if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION) - ACE_TRACE ("ACE_Thread_Exit::instance"); - - // Determines if we were dynamically allocated. - static ACE_TSS_TYPE (ACE_Thread_Exit) *instance_; - - // Implement the Double Check pattern. - - if (ACE_Thread_Exit::is_constructed_ == 0) - { - ACE_MT (ACE_Thread_Mutex *lock = - ACE_Managed_Object::get_preallocated_object - (ACE_Object_Manager::ACE_THREAD_EXIT_LOCK); - ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, *lock, 0)); - - if (ACE_Thread_Exit::is_constructed_ == 0) - { - ACE_NEW_RETURN (instance_, - ACE_TSS_TYPE (ACE_Thread_Exit), - 0); - - ACE_Thread_Exit::is_constructed_ = 1; - - // Register for destruction with ACE_Object_Manager. -#if defined ACE_HAS_SIG_C_FUNC - ACE_Object_Manager::at_exit (instance_, - ACE_Thread_Exit_cleanup, - 0); -#else - ACE_Object_Manager::at_exit (instance_, - ACE_Thread_Exit::cleanup, - 0); -#endif /* ACE_HAS_SIG_C_FUNC */ - } - } - - return ACE_TSS_GET (instance_, ACE_Thread_Exit); -#else - return 0; -#endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ -} - -// Grab hold of the Task * so that we can close() it in the -// destructor. - -ACE_Thread_Exit::ACE_Thread_Exit (void) -{ - ACE_TRACE ("ACE_Thread_Exit::ACE_Thread_Exit"); -} - -// Set the this pointer... - -void -ACE_Thread_Exit::thr_mgr (ACE_Thread_Manager *tm) -{ - ACE_TRACE ("ACE_Thread_Exit::thr_mgr"); - - if (tm != 0) - this->thread_control_.insert (tm, 0); -} - -// When this object is destroyed the Task is automatically closed -// down! - -ACE_Thread_Exit::~ACE_Thread_Exit (void) -{ - ACE_TRACE ("ACE_Thread_Exit::~ACE_Thread_Exit"); - - ACE_Thread_Exit::is_constructed_ = 0; -} - -// Run the entry point for thread spawned under the control of the -// . This must be an extern "C" to make certain -// compilers happy... -// -// The interaction with and -// works like this, with -// ACE_HAS_THREAD_SPECIFIC_STORAGE or ACE_HAS_TSS_EMULATION: -// -// o Every thread in the is run with -// . -// -// o retrieves the singleton -// instance from . -// The singleton gets created in thread-specific storage -// in the first call to that function. The key point is that the -// instance is in thread-specific storage. -// -// o A thread can exit by various means, such as , C++ -// or Win32 exception, "falling off the end" of the thread entry -// point function, etc. -// -// o If you follow this so far, now it gets really fun . . . -// When the thread-specific storage (for the thread that -// is being destroyed) is cleaned up, the OS threads package (or -// the ACE emulation of thread-specific storage) will destroy any -// objects that are in thread-specific storage. It has a list of -// them, and just walks down the list and destroys each one. -// -// o That's where the ACE_Thread_Exit destructor gets called. - -#if defined(ACE_USE_THREAD_MANAGER_ADAPTER) -extern "C" void * -ace_thread_manager_adapter (void *args) -{ -#if defined (ACE_HAS_TSS_EMULATION) - // As early as we can in the execution of the new thread, allocate - // its local TS storage. Allocate it on the stack, to save dynamic - // allocation/dealloction. - void *ts_storage[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX]; - ACE_TSS_Emulation::tss_open (ts_storage); -#endif /* ACE_HAS_TSS_EMULATION */ - - ACE_Thread_Adapter *thread_args = (ACE_Thread_Adapter *) args; - - // NOTE: this preprocessor directive should match the one in above - // ACE_Thread_Exit::instance (). With the Xavier Pthreads package, - // the exit_hook in TSS causes a seg fault. So, this works around - // that by creating exit_hook on the stack. -#if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION) - // Obtain our thread-specific exit hook and make sure that it knows - // how to clean us up! Note that we never use this pointer directly - // (it's stored in thread-specific storage), so it's ok to - // dereference it here and only store it as a reference. - ACE_Thread_Exit &exit_hook = *ACE_Thread_Exit::instance (); -#else - // Without TSS, create an instance. When this - // function returns, its destructor will be called because the - // object goes out of scope. The drawback with this appraoch is - // that the destructor _won't_ get called if is called. - // So, threads shouldn't exit that way. Instead, they should return - // from . - ACE_Thread_Exit exit_hook; -#endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ - - // Keep track of the that's associated with this - // . - exit_hook.thr_mgr (thread_args->thr_mgr ()); - - // Invoke the user-supplied function with the args. - void *status = thread_args->invoke (); - - return status; -} -#endif - -// Call the appropriate OS routine to spawn a thread. Should *not* be -// called with the lock_ held... - -int -ACE_Thread_Manager::spawn_i (ACE_THR_FUNC func, - void *args, - long flags, - ACE_thread_t *t_id, - ACE_hthread_t *t_handle, - long priority, - int grp_id, - void *stack, - size_t stack_size, - ACE_Task_Base *task) -{ - // First, threads created by Thread Manager should not be daemon threads. - // Using assertion is probably a bit too strong. However, it helps - // finding this kind of error as early as possible. Perhaps we can replace - // assertion by returning error. - ACE_ASSERT (ACE_BIT_DISABLED (flags, THR_DAEMON)); - - // Create a new thread running . *Must* be called with the - // held... - // Get a "new" Thread Descriptor from the freelist. - auto_ptr new_thr_desc (this->thread_desc_freelist_.remove ()); - - // Reset thread descriptor status - new_thr_desc->reset (this); - - ACE_Thread_Adapter *thread_args = 0; -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - ACE_NEW_RETURN (thread_args, - ACE_Thread_Adapter (func, - args, - (ACE_THR_C_FUNC) ace_thread_adapter, - this, - new_thr_desc.get (), - ACE_LOG_MSG->seh_except_selector(), - ACE_LOG_MSG->seh_except_handler()), - -1); -#else - ACE_NEW_RETURN (thread_args, - ACE_Thread_Adapter (func, - args, - (ACE_THR_C_FUNC) ace_thread_adapter, - this, - new_thr_desc.get ()), - -1); -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - - ACE_TRACE ("ACE_Thread_Manager::spawn_i"); - ACE_hthread_t thr_handle; - -#if defined (VXWORKS) - // On VxWorks, ACE_thread_t is char *. If t_id is 0, allocate space - // for ACE_OS::thr_create () to store the task name. If t_id is not - // 0, and it doesn't point to a 0 char *, then the non-zero char * - // will be used for the task name in ACE_OS::thr_create (). If t_id - // is not 0, but does point to a 0 char *, the t_id will be set to - // point to the task name in the TCB in ACE_OS::thr_create (). - if (t_id == 0) - { - char *thr_id; - ACE_NEW_RETURN (thr_id, - char[16], - -1); - // Mark the thread ID to show that the ACE_Thread_Manager - // allocated it. - thr_id[0] = ACE_THR_ID_ALLOCATED; - thr_id[1] = '\0'; - t_id = &thr_id; - } -#else /* ! VXWORKS */ - ACE_thread_t thr_id; - if (t_id == 0) - t_id = &thr_id; -#endif /* ! VXWORKS */ - - new_thr_desc->sync_->acquire (); - // Acquire the lock to block the spawned thread from - // removing this Thread Descriptor before it gets put into our - // thread table. - - int result = ACE_Thread::spawn (func, - args, - flags, - t_id, - &thr_handle, - priority, - stack, - stack_size, - thread_args); - - if (result != 0) - { - // _Don't_ clobber errno here! result is either 0 or -1, and - // ACE_OS::thr_create () already set errno! D. Levine 28 Mar 1997 - // errno = result; - ACE_Errno_Guard guard (errno); // Lock release may smash errno - new_thr_desc->sync_->release (); - return -1; - } - else - { -#if defined (ACE_HAS_WTHREADS) - // Have to duplicate handle if client asks for it. - // @@ How are thread handles implemented on AIX? Do they - // also need to be duplicated? - if (t_handle != 0) -# if defined (ACE_HAS_WINCE) - *t_handle = thr_handle; -# else /* ! ACE_HAS_WINCE */ - (void) ::DuplicateHandle (::GetCurrentProcess (), - thr_handle, - ::GetCurrentProcess (), - t_handle, - 0, - TRUE, - DUPLICATE_SAME_ACCESS); -# endif /* ! ACE_HAS_WINCE */ -#elif defined (VXWORKS) - if (t_handle != 0) - *t_handle = thr_handle; -#else /* ! ACE_HAS_WTHREADS && ! VXWORKS */ - ACE_UNUSED_ARG (t_handle); -#endif /* ! ACE_HAS_WTHREADS && ! VXWORKS */ - - // append_thr also put the into Thread_Manager's - // double-linked list. Only after this point, can we manipulate - // double-linked list from a spawned thread's context. - return this->append_thr (*t_id, - thr_handle, - ACE_THR_SPAWNED, - grp_id, - task, - flags, - new_thr_desc.release ()); - } -} - -int -ACE_Thread_Manager::spawn (ACE_THR_FUNC func, - void *args, - long flags, - ACE_thread_t *t_id, - ACE_hthread_t *t_handle, - long priority, - int grp_id, - void *stack, - size_t stack_size) -{ - ACE_TRACE ("ACE_Thread_Manager::spawn"); - - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - if (grp_id == -1) - grp_id = this->grp_id_++; // Increment the group id. - - if (this->spawn_i (func, args, flags, t_id, t_handle, - priority, grp_id, stack, stack_size) == -1) - return -1; - else - return grp_id; -} - -// Create N new threads running FUNC. - -int -ACE_Thread_Manager::spawn_n (size_t n, - ACE_THR_FUNC func, - void *args, - long flags, - long priority, - int grp_id, - ACE_Task_Base *task, - ACE_hthread_t thread_handles[], - void *stack[], - size_t stack_size[]) -{ - ACE_TRACE ("ACE_Thread_Manager::spawn_n"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - if (grp_id == -1) - grp_id = this->grp_id_++; // Increment the group id. - - for (size_t i = 0; i < n; i++) - { - // @@ What should happen if this fails?! e.g., should we try to - // cancel the other threads that we've already spawned or what? - if (this->spawn_i (func, - args, - flags, - 0, - thread_handles == 0 ? 0 : &thread_handles[i], - priority, - grp_id, - stack == 0 ? 0 : stack[i], - stack_size == 0 ? 0 : stack_size[i], - task) == -1) - return -1; - } - - return grp_id; -} - -// Create N new threads running FUNC. - -int -ACE_Thread_Manager::spawn_n (ACE_thread_t thread_ids[], - size_t n, - ACE_THR_FUNC func, - void *args, - long flags, - long priority, - int grp_id, - void *stack[], - size_t stack_size[], - ACE_hthread_t thread_handles[]) -{ - ACE_TRACE ("ACE_Thread_Manager::spawn_n"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - if (grp_id == -1) - grp_id = this->grp_id_++; // Increment the group id. - - for (size_t i = 0; i < n; i++) - { - // @@ What should happen if this fails?! e.g., should we try to - // cancel the other threads that we've already spawned or what? - if (this->spawn_i (func, - args, - flags, - thread_ids == 0 ? 0 : &thread_ids[i], - thread_handles == 0 ? 0 : &thread_handles[i], - priority, - grp_id, - stack == 0 ? 0 : stack[i], - stack_size == 0 ? 0 : stack_size[i]) == -1) - return -1; - } - - return grp_id; -} - -// Append a thread into the pool (does not check for duplicates). -// Must be called with locks held. - -int -ACE_Thread_Manager::append_thr (ACE_thread_t t_id, - ACE_hthread_t t_handle, - ACE_UINT32 thr_state, - int grp_id, - ACE_Task_Base *task, - long flags, - ACE_Thread_Descriptor *td) -{ - ACE_TRACE ("ACE_Thread_Manager::append_thr"); - ACE_Thread_Descriptor *thr_desc; - - if (td == 0) - { - ACE_NEW_RETURN (thr_desc, - ACE_Thread_Descriptor, - -1); -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - thr_desc->tm_ = this; - // Setup the Thread_Manager. -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - } - else - thr_desc = td; - - thr_desc->thr_id_ = t_id; - thr_desc->thr_handle_ = t_handle; - thr_desc->grp_id_ = grp_id; - thr_desc->task_ = task; - thr_desc->flags_ = flags; - - this->thr_list_.insert_head (thr_desc); - ACE_SET_BITS (thr_desc->thr_state_, thr_state); - thr_desc->sync_->release (); - - return 0; -} - -// Return the thread descriptor (indexed by ACE_hthread_t). - -ACE_Thread_Descriptor * -ACE_Thread_Manager::find_hthread (ACE_hthread_t h_id) -{ - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (ACE_OS::thr_cmp (iter.next ()->thr_handle_, h_id)) - return iter.next (); - - return 0; -} - -// Locate the index in the table associated with . Must be -// called with the lock held. - -ACE_Thread_Descriptor * -ACE_Thread_Manager::find_thread (ACE_thread_t t_id) -{ - ACE_TRACE ("ACE_Thread_Manager::find_thread"); - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (ACE_OS::thr_equal (iter.next ()->thr_id_, t_id)) - return iter.next (); - return 0; -} - -// Insert a thread into the pool (checks for duplicates and doesn't -// allow them to be inserted twice). - -int -ACE_Thread_Manager::insert_thr (ACE_thread_t t_id, - ACE_hthread_t t_handle, - int grp_id, - long flags) -{ - ACE_TRACE ("ACE_Thread_Manager::insert_thr"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - // Check for duplicates and bail out if we're already registered... -#if defined (VXWORKS) - if (this->find_hthread (t_handle) != 0 ) - return -1; -#else /* ! VXWORKS */ - if (this->find_thread (t_id) != 0 ) - return -1; -#endif /* ! VXWORKS */ - - if (grp_id == -1) - grp_id = this->grp_id_++; - - if (this->append_thr (t_id, - t_handle, - ACE_THR_SPAWNED, - grp_id, - 0, - flags) == -1) - return -1; - else - return grp_id; -} - -// Run the registered hooks when the thread exits. - -void -ACE_Thread_Manager::run_thread_exit_hooks (int i) -{ -#if 0 // currently unused! - ACE_TRACE ("ACE_Thread_Manager::run_thread_exit_hooks"); - - // @@ Currently, we have just one hook. This should clearly be - // generalized to support an arbitrary number of hooks. - - ACE_Thread_Descriptor *td = this->thread_desc_self (); - if (td != 0 && td->cleanup_info.cleanup_hook_ != 0) - { - (*td->cleanup_info_.cleanup_hook_) - (td->cleanup_info_.object_, - td->cleanup_info_.param_); - - td->cleanup_info_.cleanup_hook_ = 0; - } - ACE_UNUSED_ARG (i); -#else - ACE_UNUSED_ARG (i); -#endif /* 0 */ -} - -// Remove a thread from the pool. Must be called with locks held. - -void -ACE_Thread_Manager::remove_thr (ACE_Thread_Descriptor *td, - int close_handler) -{ - ACE_TRACE ("ACE_Thread_Manager::remove_thr"); - -#if defined (VXWORKS) - ACE_thread_t tid = td->self (); -#endif /* VXWORKS */ - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - td->tm_ = 0; -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - this->thr_list_.remove (td); - -#if defined (VXWORKS) - // Delete the thread ID, if the ACE_Thread_Manager allocated it. - if (tid && tid[0] == ACE_THR_ID_ALLOCATED) - { - delete [] tid; - } -#endif /* VXWORKS */ - -#if defined (ACE_WIN32) - if (close_handler != 0) - ::CloseHandle (td->thr_handle_); -#else - ACE_UNUSED_ARG (close_handler); -#endif /* ACE_WIN32 */ - -#if 1 - - this->thread_desc_freelist_.add (td); -#else - delete td; -#endif /* 1 */ - -#if defined (ACE_HAS_THREADS) - // Tell all waiters when there are no more threads left in the pool. - if (this->thr_list_.size () == 0) - this->zero_cond_.broadcast (); -#endif /* ACE_HAS_THREADS */ -} - -// Repeatedly call remove_thr on all table entries until there -// is no thread left. Must be called with lock held. - -void -ACE_Thread_Manager::remove_thr_all (void) -{ - ACE_Thread_Descriptor *td; - - while ((td = this->thr_list_.delete_head ()) != 0) - { -#if defined (ACE_WIN32) - // We need to let go handles if we want to let the threads - // run wild. - // @@ Do we need to close down AIX thread handles too? - ::CloseHandle (td->thr_handle_); -#endif /* ACE_WIN32 */ - delete td; - } - -} - -// ------------------------------------------------------------------ -// Factor out some common behavior to simplify the following methods. -#define ACE_THR_OP(OP,STATE) \ - int result = OP (td->thr_handle_); \ - if (result == -1) { \ - if (errno != ENOTSUP) \ - this->thr_to_be_removed_.enqueue_tail (td); \ - return -1; \ - } \ - else { \ - ACE_SET_BITS (td->thr_state_, STATE); \ - return 0; \ - } - -int -ACE_Thread_Manager::join_thr (ACE_Thread_Descriptor *td, int) -{ - ACE_TRACE ("ACE_Thread_Manager::join_thr"); - - int result = ACE_Thread::join (td->thr_handle_); - -# if defined (ACE_HAS_PTHREADS_DRAFT4) && defined (ACE_LACKS_SETDETACH) -# if defined (HPUX_10) - // HP-UX DCE threads' pthread_detach will smash thr_id if it's just given - // as an argument. Since the id is still needed, give pthread_detach - // a junker to scribble on. - ACE_thread_t junker; - cma_handle_assign(&td->thr_handle_, &junker); - ::pthread_detach (&junker); -# else - ::pthread_detach (&td->thr_handle_); -# endif /* HPUX_10 */ -# endif /* ACE_HAS_PTHREADS_DRAFT4 && ACE_LACKS_SETDETACH */ - - if (result != 0) - { - // Since the thread are being joined, we should - // let it remove itself from the list. - - // this->remove_thr (td); - errno = result; - return -1; - } - - return 0; -} - -int -ACE_Thread_Manager::suspend_thr (ACE_Thread_Descriptor *td, int) -{ - ACE_TRACE ("ACE_Thread_Manager::suspend_thr"); - - int result = ACE_Thread::suspend (td->thr_handle_); - if (result == -1) { - if (errno != ENOTSUP) - this->thr_to_be_removed_.enqueue_tail (td); - return -1; - } - else { - ACE_SET_BITS (td->thr_state_, ACE_THR_SUSPENDED); - return 0; - } -} - -int -ACE_Thread_Manager::resume_thr (ACE_Thread_Descriptor *td, int) -{ - ACE_TRACE ("ACE_Thread_Manager::resume_thr"); - - int result = ACE_Thread::resume (td->thr_handle_); - if (result == -1) { - if (errno != ENOTSUP) - this->thr_to_be_removed_.enqueue_tail (td); - return -1; - } - else { - ACE_CLR_BITS (td->thr_state_, ACE_THR_SUSPENDED); - return 0; - } -} - -int -ACE_Thread_Manager::cancel_thr (ACE_Thread_Descriptor *td, int async_cancel) -{ - ACE_TRACE ("ACE_Thread_Manager::cancel_thr"); - // Must set the state first and then try to cancel the thread. - ACE_SET_BITS (td->thr_state_, ACE_THR_CANCELLED); - - if (async_cancel != 0) - // Note that this call only does something relevant if the OS - // platform supports asynchronous thread cancellation. Otherwise, - // it's a no-op. - return ACE_Thread::cancel (td->thr_id_); - - return 0; -} - -int -ACE_Thread_Manager::kill_thr (ACE_Thread_Descriptor *td, int signum) -{ - ACE_TRACE ("ACE_Thread_Manager::kill_thr"); - - ACE_thread_t tid = td->thr_id_; -#if defined (VXWORKS) - // Skip over the ID-allocated marker, if present. - tid += tid[0] == ACE_THR_ID_ALLOCATED ? 1 : 0; -#endif /* VXWORKS */ - - int result = ACE_Thread::kill (tid, signum); - - if (result != 0) - { - // Only remove a thread from us when there is a "real" error. - if (errno != ENOTSUP) - this->thr_to_be_removed_.enqueue_tail (td); - - return -1; - } -#if defined (CHORUS) - else if (signum == SIGTHREADKILL) - this->thr_to_be_removed_.enqueue_tail (td); -#endif /* CHORUS */ - - return 0; -} - -// ------------------------------------------------------------------ -// Factor out some common behavior to simplify the following methods. -#define ACE_EXECUTE_OP(OP, ARG) \ - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); \ - ACE_ASSERT (this->thr_to_be_removed_.is_empty ()); \ - ACE_FIND (this->find_thread (t_id), ptr); \ - if (ptr == 0) \ - { \ - errno = ENOENT; \ - return -1; \ - } \ - int result = OP (ptr, ARG); \ - ACE_Errno_Guard error (errno); \ - while (! this->thr_to_be_removed_.is_empty ()) { \ - ACE_Thread_Descriptor *td; \ - this->thr_to_be_removed_.dequeue_head (td); \ - this->remove_thr (td, 1); \ - } \ - return result - -// Suspend a single thread. - -int -ACE_Thread_Manager::suspend (ACE_thread_t t_id) -{ - ACE_TRACE ("ACE_Thread_Manager::suspend"); - ACE_EXECUTE_OP (this->suspend_thr, 0); -} - -// Resume a single thread. - -int -ACE_Thread_Manager::resume (ACE_thread_t t_id) -{ - ACE_TRACE ("ACE_Thread_Manager::resume"); - ACE_EXECUTE_OP (this->resume_thr, 0); -} - -// Cancel a single thread. - -int -ACE_Thread_Manager::cancel (ACE_thread_t t_id, int async_cancel) -{ - ACE_TRACE ("ACE_Thread_Manager::cancel"); - ACE_EXECUTE_OP (this->cancel_thr, async_cancel); -} - -// Send a signal to a single thread. - -int -ACE_Thread_Manager::kill (ACE_thread_t t_id, int signum) -{ - ACE_TRACE ("ACE_Thread_Manager::kill"); - ACE_EXECUTE_OP (this->kill_thr, signum); -} - -int -ACE_Thread_Manager::check_state (ACE_UINT32 state, - ACE_thread_t id, - int enable) -{ - ACE_TRACE ("ACE_Thread_Manager::check_state"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - ACE_UINT32 thr_state; - - int self_check = ACE_OS::thr_equal (id, ACE_OS::thr_self ()); - - // If we're checking the state of our thread, try to get the cached - // value out of TSS to avoid lookup. - if (self_check) - thr_state = this->thread_desc_self ()->thr_state_; - else - { - // Not calling from self, have to look it up from the list. - ACE_FIND (this->find_thread (id), ptr); - if (ptr == 0) - return 0; - thr_state = ptr->thr_state_; - } - if (enable) - return ACE_BIT_ENABLED (thr_state, state); - else - return ACE_BIT_DISABLED (thr_state, state); -} - -// Test if a single thread is suspended. - -int -ACE_Thread_Manager::testsuspend (ACE_thread_t t_id) -{ - ACE_TRACE ("ACE_Thread_Manager::testsuspend"); - return this->check_state (ACE_THR_SUSPENDED, t_id); -} - -// Test if a single thread is active (i.e., resumed). - -int -ACE_Thread_Manager::testresume (ACE_thread_t t_id) -{ - ACE_TRACE ("ACE_Thread_Manager::testresume"); - return this->check_state (ACE_THR_SUSPENDED, t_id, 0); -} - -// Test if a single thread is cancelled. - -int -ACE_Thread_Manager::testcancel (ACE_thread_t t_id) -{ - ACE_TRACE ("ACE_Thread_Manager::testcancel"); - return this->check_state (ACE_THR_CANCELLED, t_id); -} - -// Thread information query functions. - -int -ACE_Thread_Manager::hthread_within (ACE_hthread_t handle) -{ - ACE_TRACE ("ACE_Thread_Manager::hthread_within"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_monx, this->lock_, -1)); - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (ACE_OS::thr_cmp(iter.next ()->thr_handle_, handle)) - return 1; - - return 0; -} - -int -ACE_Thread_Manager::thread_within (ACE_thread_t tid) -{ - ACE_TRACE ("ACE_Thread_Manager::thread_within"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_monx, this->lock_, -1)); - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (ACE_OS::thr_equal (iter.next ()->thr_id_, tid)) - return 1; - - return 0; -} - -// Get group ids for a particular thread id. - -int -ACE_Thread_Manager::get_grp (ACE_thread_t t_id, int &grp_id) -{ - ACE_TRACE ("ACE_Thread_Manager::get_grp"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - ACE_FIND (this->find_thread (t_id), ptr); - - if (ptr) - grp_id = ptr->grp_id_; - else - return -1; - return 0; -} - -// Set group ids for a particular thread id. - -int -ACE_Thread_Manager::set_grp (ACE_thread_t t_id, int grp_id) -{ - ACE_TRACE ("ACE_Thread_Manager::set_grp"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - ACE_FIND (this->find_thread (t_id), ptr); - if (ptr) - ptr->grp_id_ = grp_id; - else - return -1; - return 0; -} - -// Suspend a group of threads. - -int -ACE_Thread_Manager::apply_grp (int grp_id, - ACE_THR_MEMBER_FUNC func, - int arg) -{ - ACE_TRACE ("ACE_Thread_Manager::apply_grp"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_monx, this->lock_, -1)); - ACE_ASSERT (this->thr_to_be_removed_.is_empty ()); - - int result = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (iter.next ()->grp_id_ == grp_id) - if ((this->*func) (iter.next (), arg) == -1) - result = -1; - - // Must remove threads after we have traversed the thr_list_ to - // prevent clobber thr_list_'s integrity. - - if (! this->thr_to_be_removed_.is_empty ()) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - - for (ACE_Thread_Descriptor *td; - this->thr_to_be_removed_.dequeue_head (td) != -1; - ) - this->remove_thr (td, 1); - } - - return result; -} - -int -ACE_Thread_Manager::suspend_grp (int grp_id) -{ - ACE_TRACE ("ACE_Thread_Manager::suspend_grp"); - return this->apply_grp (grp_id, - ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::suspend_thr)); -} - -// Resume a group of threads. - -int -ACE_Thread_Manager::resume_grp (int grp_id) -{ - ACE_TRACE ("ACE_Thread_Manager::resume_grp"); - return this->apply_grp (grp_id, - ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::resume_thr)); -} - -// Kill a group of threads. - -int -ACE_Thread_Manager::kill_grp (int grp_id, int signum) -{ - ACE_TRACE ("ACE_Thread_Manager::kill_grp"); - return this->apply_grp (grp_id, - ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::kill_thr), signum); -} - -// Cancel a group of threads. - -int -ACE_Thread_Manager::cancel_grp (int grp_id, int async_cancel) -{ - ACE_TRACE ("ACE_Thread_Manager::resume_grp"); - return this->apply_grp (grp_id, - ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::cancel_thr), - async_cancel); -} - -int -ACE_Thread_Manager::apply_all (ACE_THR_MEMBER_FUNC func, int arg) -{ - ACE_TRACE ("ACE_Thread_Manager::apply_all"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - ACE_ASSERT (this->thr_to_be_removed_.is_empty ()); - - int result = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if ((this->*func)(iter.next (), arg) == -1) - result = -1; - - // Must remove threads after we have traversed the thr_list_ to - // prevent clobber thr_list_'s integrity. - - if (! this->thr_to_be_removed_.is_empty ()) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - - for (ACE_Thread_Descriptor *td; - this->thr_to_be_removed_.dequeue_head (td) != -1; - ) - this->remove_thr (td, 1); - } - - return result; -} - -// Resume all threads that are suspended. - -int -ACE_Thread_Manager::resume_all (void) -{ - ACE_TRACE ("ACE_Thread_Manager::resume_all"); - return this->apply_all (ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::resume_thr)); -} - -int -ACE_Thread_Manager::suspend_all (void) -{ - ACE_TRACE ("ACE_Thread_Manager::suspend_all"); - return this->apply_all (ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::suspend_thr)); -} - -int -ACE_Thread_Manager::kill_all (int sig) -{ - ACE_TRACE ("ACE_Thread_Manager::kill_all"); - return this->apply_all (&ACE_Thread_Manager::kill_thr, sig); -} - -int -ACE_Thread_Manager::cancel_all (int async_cancel) -{ - ACE_TRACE ("ACE_Thread_Manager::cancel_all"); - return this->apply_all (ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::cancel_thr), - async_cancel); -} - -int -ACE_Thread_Manager::join (ACE_thread_t tid, void **status) -{ - ACE_TRACE ("ACE_Thread_Manager::join"); - - ACE_Thread_Descriptor_Base tdb; - int found = 0; - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - -#if !defined (VXWORKS) - for (ACE_Double_Linked_List_Iterator biter (this->terminated_thr_list_); - !biter.done (); - biter.advance ()) - if (ACE_OS::thr_equal (biter.next ()->thr_id_, tid)) - { - ACE_Thread_Descriptor_Base *tdb = biter.advance_and_remove (0); - if (ACE_Thread::join (tdb->thr_handle_) == -1) - return -1; - -# if defined (ACE_HAS_PTHREADS_DRAFT4) && defined (ACE_LACKS_SETDETACH) - // Must explicitly detach threads. Threads without THR_DETACHED - // were detached in ACE_OS::thr_create (). - ::pthread_detach (&tdb->thr_handle_); -# endif /* ACE_HAS_PTHREADS_DRAFT4 && ACE_LACKS_SETDETACH */ - - delete tdb; - return 0; - // return immediately if we've found the thread we want to join. - } -#endif /* !VXWORKS */ - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - // If threads are created as THR_DETACHED or THR_DAEMON, we - // can't help much. - if (ACE_OS::thr_equal (iter.next ()->thr_id_,tid) && - (ACE_BIT_DISABLED (iter.next ()->flags_, THR_DETACHED | THR_DAEMON) - || ACE_BIT_ENABLED (iter.next ()->flags_, THR_JOINABLE))) - { - tdb = *iter.next (); - ACE_SET_BITS (tdb.thr_state_, ACE_THR_JOINING); - found = 1; - break; - } - - if (!found) - return -1; - // Didn't find the thread we want or the thread is not joinable. - } - -# if defined (_AIX) - // The AIX xlC compiler does not match the proper function here - it - // confuses ACE_Thread::join(ACE_thread_t, ACE_thread_t *, void **=0) and - // ACE_Thread::join(ACE_hthread_t, void **=0). At least at 3.1.4.7 and .8. - // The 2nd arg is ignored for pthreads anyway. - - // And, g++ on AIX needs the three-arg thr_join, also, to pick up the - // proper version from the AIX libraries. - if (ACE_Thread::join (tdb.thr_handle_, &tdb.thr_handle_, status) == -1) -# else /* ! _AIX */ - if (ACE_Thread::join (tdb.thr_handle_, status) == -1) -# endif /* ! _AIX */ - return -1; - -# if defined (ACE_HAS_PTHREADS_DRAFT4) && defined (ACE_LACKS_SETDETACH) - // Must explicitly detach threads. Threads without THR_DETACHED - // were detached in ACE_OS::thr_create (). - -# if defined (HPUX_10) - // HP-UX DCE threads' pthread_detach will smash thr_id if it's just given - // as an argument. Since the thread handle is still needed, give - // pthread_detach a junker to scribble on. - ACE_thread_t junker; - cma_handle_assign(&tdb.thr_handle_, &junker); - ::pthread_detach (&junker); -# else - ::pthread_detach (&tdb.thr_handle_); - #endif /* HPUX_10 */ -# endif /* ACE_HAS_PTHREADS_DRAFT4 && ACE_LACKS_SETDETACH */ - return 0; -} - -// Wait for group of threads - -int -ACE_Thread_Manager::wait_grp (int grp_id) -{ - ACE_TRACE ("ACE_Thread_Manager::wait_grp"); - - int copy_count = 0; - ACE_Thread_Descriptor_Base *copy_table = 0; - - // We have to make sure that while we wait for these threads to - // exit, we do not have the lock. Therefore we make a copy of all - // interesting entries and let go of the lock. - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - -#if !defined (VXWORKS) - ACE_NEW_RETURN (copy_table, - ACE_Thread_Descriptor_Base [this->thr_list_.size () - + this->terminated_thr_list_.size ()], - -1); -#else - ACE_NEW_RETURN (copy_table, - ACE_Thread_Descriptor_Base [this->thr_list_.size ()], - -1); -#endif /* VXWORKS */ - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - // If threads are created as THR_DETACHED or THR_DAEMON, we - // can't help much. - if (iter.next ()->grp_id_ == grp_id && - (ACE_BIT_DISABLED (iter.next ()->flags_, THR_DETACHED | THR_DAEMON) - || ACE_BIT_ENABLED (iter.next ()->flags_, THR_JOINABLE))) - { - ACE_SET_BITS (iter.next ()->thr_state_, ACE_THR_JOINING); - copy_table[copy_count++] = *iter.next (); - } - -#if !defined (VXWORKS) - for (ACE_Double_Linked_List_Iterator biter (this->terminated_thr_list_); - !biter.done (); - biter.advance ()) - // If threads are created as THR_DETACHED or THR_DAEMON, we - // can't help much. - if (biter.next ()->grp_id_ == grp_id) - { - ACE_Thread_Descriptor_Base *tdb = biter.advance_and_remove (0); - copy_table[copy_count++] = *tdb; - delete tdb; - } -#endif /* !VXWORKS */ - } - - // Now actually join() with all the threads in this group. - int result = 0; - - for (int i = 0; - i < copy_count && result != -1; - i++) - { - if (ACE_Thread::join (copy_table[i].thr_handle_) == -1) - result = -1; - -# if defined (ACE_HAS_PTHREADS_DRAFT4) && defined (ACE_LACKS_SETDETACH) - // Must explicitly detach threads. Threads without THR_DETACHED - // were detached in ACE_OS::thr_create (). - ::pthread_detach (©_table[i].thr_handle_); -# endif /* ACE_HAS_PTHREADS_DRAFT4 && ACE_LACKS_SETDETACH */ - } - - delete [] copy_table; - - return result; -} - -// Must be called when thread goes out of scope to clean up its table -// slot. - -void * -ACE_Thread_Manager::exit (void *status, int do_thr_exit) -{ - ACE_TRACE ("ACE_Thread_Manager::exit"); -#if defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - int close_handle = 0; -#endif /* ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - -#if defined (ACE_WIN32) - // Remove detached thread handle. - - if (do_thr_exit) - { -#if 0 - // @@ This callback is now taken care of by TSS_Cleanup. Do we - // need it anymore? - - // On Win32, if we really wants to exit from a thread, we must - // first clean up the thread specific storage. By doing so, - // ACE_Thread_Manager::exit will be called again with - // do_thr_exit = 0 and cleaning up the ACE_Cleanup_Info (but not - // exiting the thread.) After the following call returns, we - // are safe to exit this thread. - delete ACE_Thread_Exit::instance (); -#endif /* 0 */ - ACE_Thread::exit (status); - } -#endif /* ACE_WIN32 */ - -#if defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - ACE_Cleanup_Info cleanup_info; - - // Just hold onto the guard while finding this thread's id and - // copying the exit hook. - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - - // Find the thread id, but don't use the cache. It might have been - // deleted already. -#if defined (VXWORKS) - ACE_hthread_t id; - ACE_OS::thr_self (id); - ACE_Thread_Descriptor *td = this->find_hthread (id); -#else /* ! VXWORKS */ - ACE_thread_t id = ACE_OS::thr_self (); - ACE_Thread_Descriptor *td = this->find_thread (id); -#endif /* ! VXWORKS */ - - // Locate thread id. - if (td != 0) - { - // @@ Currently, we have just one hook. This should clearly - // be generalized to support an arbitrary number of hooks. - - if (td->cleanup_info_.cleanup_hook_ != 0) - { - // Copy the hook so that we can call it after releasing - // the guard. - cleanup_info = td->cleanup_info_; - td->cleanup_info_.cleanup_hook_ = 0; - } - -#if !defined (VXWORKS) - // Threads created with THR_DAEMON shouldn't exist here, but - // just to be safe, let's put it here. - - if (ACE_BIT_DISABLED (td->thr_state_, ACE_THR_JOINING)) - if (ACE_BIT_DISABLED (td->flags_, THR_DETACHED | THR_DAEMON) - || ACE_BIT_ENABLED (td->flags_, THR_JOINABLE)) - { - // Mark thread as terminated. - ACE_SET_BITS (td->thr_state_, ACE_THR_TERMINATED); - this->register_as_terminated (td); - // Must copy the information here because td will be "freed" below. - } -#if defined (ACE_WIN32) - else - { - close_handle = 1; - } -#endif /* ACE_WIN32 */ -#endif /* ! VXWORKS */ - - // Remove thread descriptor from the table. - this->remove_thr (td, close_handle); - } - // Release the guard. - } - - // Call the cleanup hook. - if (cleanup_info.cleanup_hook_ != 0) - (*cleanup_info.cleanup_hook_) (cleanup_info.object_, - cleanup_info.param_); -#else /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - // Just hold onto the guard while finding this thread's id and - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - - // Find the thread id, but don't use the cache. It might have been - // deleted already. -#if defined (VXWORKS) - ACE_hthread_t id; - ACE_OS::thr_self (id); - ACE_Thread_Descriptor* td = this->find_hthread (id); -#else /* ! VXWORKS */ - ACE_thread_t id = ACE_OS::thr_self (); - ACE_Thread_Descriptor* td = this->find_thread (id); -#endif /* ! VXWORKS */ - if (td != 0) - { - // @@ We call Thread_Descriptor terminate this realize the cleanup - // process itself. - td->terminate(); - } - } - - -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - - if (do_thr_exit) - { - ACE_Thread::exit (status); - // On reasonable systems should not return. - // However, due to horrible semantics with Win32 thread-specific - // storage this call can return (don't ask...). - } - - return 0; -} - -// Wait for all the threads to exit. - -int -ACE_Thread_Manager::wait (const ACE_Time_Value *timeout, - int abandon_detached_threads) -{ - ACE_TRACE ("ACE_Thread_Manager::wait"); - -#if defined (ACE_HAS_THREADS) - { - // Just hold onto the guard while waiting. - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - if (ACE_Object_Manager::shutting_down () != 1) - { - // Program is not shutting down. Perform a normal wait on threads. - if (abandon_detached_threads != 0) - { - ACE_ASSERT (this->thr_to_be_removed_.is_empty ()); - for (ACE_Double_Linked_List_Iterator - iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (ACE_BIT_ENABLED (iter.next ()->flags_, - THR_DETACHED | THR_DAEMON) - && ACE_BIT_DISABLED (iter.next ()->flags_, THR_JOINABLE)) - { - this->thr_to_be_removed_.enqueue_tail (iter.next ()); - ACE_SET_BITS (iter.next ()->thr_state_, ACE_THR_JOINING); - } - - if (! this->thr_to_be_removed_.is_empty ()) - { - ACE_Thread_Descriptor *td; - while (this->thr_to_be_removed_.dequeue_head (td) != -1) - this->remove_thr (td, 1); - } - } - - while (this->thr_list_.size () > 0) - if (this->zero_cond_.wait (timeout) == -1) - return -1; - } - else - // Program is shutting down, no chance to wait on threads. - // Therefore, we'll just remove threads from the list. - this->remove_thr_all (); - // Release the guard, giving other threads a chance to run. - } - -#if !defined (VXWORKS) - // @@ VxWorks doesn't support thr_join (yet.) We are working - //on our implementation. Chorus'es thr_join seems broken. - ACE_Thread_Descriptor_Base *item; - -#if defined (CHORUS) - if (ACE_Object_Manager::shutting_down () != 1) - { -#endif /* CHORUS */ - while ((item = this->terminated_thr_list_.delete_head ()) != 0) - { - if (ACE_BIT_DISABLED (item->flags_, THR_DETACHED | THR_DAEMON) - || ACE_BIT_ENABLED (item->flags_, THR_JOINABLE)) - // Detached handles shouldn't reached here. - ACE_Thread::join (item->thr_handle_); - -# if defined (ACE_HAS_PTHREADS_DRAFT4) && defined (ACE_LACKS_SETDETACH) - // Must explicitly detach threads. Threads without - // THR_DETACHED were detached in ACE_OS::thr_create (). - ::pthread_detach (&item->thr_handle_); -# endif /* ACE_HAS_PTHREADS_DRAFT4 && ACE_LACKS_SETDETACH */ - delete item; - } -#if defined (CHORUS) - } -#endif /* CHORUS */ - -#endif /* ! VXWORKS */ -#else - ACE_UNUSED_ARG (timeout); - ACE_UNUSED_ARG (abandon_detached_threads); -#endif /* ACE_HAS_THREADS */ - - return 0; -} - -int -ACE_Thread_Manager::apply_task (ACE_Task_Base *task, - ACE_THR_MEMBER_FUNC func, - int arg) -{ - ACE_TRACE ("ACE_Thread_Manager::apply_task"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - ACE_ASSERT (this->thr_to_be_removed_.is_empty ()); - - int result = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (iter.next ()->task_ == task - && (this->*func) (iter.next (), arg) == -1) - result = -1; - - // Must remove threads after we have traversed the thr_list_ to - // prevent clobber thr_list_'s integrity. - - if (! this->thr_to_be_removed_.is_empty ()) - { - // Save/restore errno. - ACE_Errno_Guard error (errno); - - for (ACE_Thread_Descriptor *td; - this->thr_to_be_removed_.dequeue_head (td) != -1; - ) - this->remove_thr (td, 1); - } - - return result; -} - -// Wait for all threads to exit a task. - -int -ACE_Thread_Manager::wait_task (ACE_Task_Base *task) -{ - int copy_count = 0; - ACE_Thread_Descriptor_Base *copy_table = 0; - - // We have to make sure that while we wait for these threads to - // exit, we do not have the lock. Therefore we make a copy of all - // interesting entries and let go of the lock. - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - -#if !defined (VXWORKS) - ACE_NEW_RETURN (copy_table, - ACE_Thread_Descriptor_Base [this->thr_list_.size () - + this->terminated_thr_list_.size ()], - -1); -#else - ACE_NEW_RETURN (copy_table, - ACE_Thread_Descriptor_Base [this->thr_list_.size ()], - -1); -#endif /* VXWORKS */ - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - // If threads are created as THR_DETACHED or THR_DAEMON, we - // can't wait on them here. - if (iter.next ()->task_ == task && - (ACE_BIT_DISABLED (iter.next ()->flags_, - THR_DETACHED | THR_DAEMON) - || ACE_BIT_ENABLED (iter.next ()->flags_, - THR_JOINABLE))) - { - ACE_SET_BITS (iter.next ()->thr_state_, - ACE_THR_JOINING); - copy_table[copy_count++] = *iter.next (); - } - -#if !defined (VXWORKS) - for (ACE_Double_Linked_List_Iterator titer (this->terminated_thr_list_); - !titer.done (); - titer.advance ()) - // If threads are created as THR_DETACHED or THR_DAEMON, we can't help much here. - if (titer.next ()->task_ == task) - { - ACE_Thread_Descriptor_Base *tdb = - titer.advance_and_remove (0); - copy_table[copy_count++] = *tdb; - delete tdb; - } -#endif /* VXWORKS */ - } - - // Now to do the actual work - int result = 0; - - for (int i = 0; - i < copy_count && result != -1; - i++) - { - if (ACE_Thread::join (copy_table[i].thr_handle_) == -1) - result = -1; - -# if defined (ACE_HAS_PTHREADS_DRAFT4) && defined (ACE_LACKS_SETDETACH) - // Must explicitly detach threads. Threads without THR_DETACHED - // were detached in ACE_OS::thr_create (). - ::pthread_detach (©_table[i].thr_handle_); -# endif /* ACE_HAS_PTHREADS_DRAFT4 && ACE_LACKS_SETDETACH */ - } - - delete [] copy_table; - - return result; -} - -// Suspend a task - -int -ACE_Thread_Manager::suspend_task (ACE_Task_Base *task) -{ - ACE_TRACE ("ACE_Thread_Manager::suspend_task"); - return this->apply_task (task, - ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::suspend_thr)); -} - -// Resume a task. -int -ACE_Thread_Manager::resume_task (ACE_Task_Base *task) -{ - ACE_TRACE ("ACE_Thread_Manager::resume_task"); - return this->apply_task (task, - ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::resume_thr)); -} - -// Kill a task. - -int -ACE_Thread_Manager::kill_task (ACE_Task_Base *task, int /* signum */) -{ - ACE_TRACE ("ACE_Thread_Manager::kill_task"); - return this->apply_task (task, - ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::kill_thr)); -} - -// Cancel a task. -int -ACE_Thread_Manager::cancel_task (ACE_Task_Base *task, - int async_cancel) -{ - ACE_TRACE ("ACE_Thread_Manager::cancel_task"); - return this->apply_task (task, - ACE_THR_MEMBER_FUNC (&ACE_Thread_Manager::cancel_thr), - async_cancel); -} - -// Locate the index in the table associated with from the -// beginning of the table up to an index. Must be called with the -// lock held. - -ACE_Thread_Descriptor * -ACE_Thread_Manager::find_task (ACE_Task_Base *task, int slot) -{ - ACE_TRACE ("ACE_Thread_Manager::find_task"); - - int i = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (i >= slot) - break; - - if (task == iter.next ()->task_) - return iter.next (); - - i++; - } - - return 0; -} - -// Returns the number of ACE_Task in a group. - -int -ACE_Thread_Manager::num_tasks_in_group (int grp_id) -{ - ACE_TRACE ("ACE_Thread_Manager::num_tasks_in_group"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - int tasks_count = 0; - size_t i = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (iter.next ()->grp_id_ == grp_id - && this->find_task (iter.next ()->task_, i) == 0 - && iter.next ()->task_ != 0) - tasks_count++; - - i++; - } - return tasks_count; -} - -// Returns the number of threads in an ACE_Task. - -int -ACE_Thread_Manager::num_threads_in_task (ACE_Task_Base *task) -{ - ACE_TRACE ("ACE_Thread_Manager::num_threads_in_task"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - int threads_count = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (iter.next ()->task_ == task) - threads_count++; - - return threads_count; -} - -// Returns in task_list a list of ACE_Tasks registered with ACE_Thread_Manager. - -int -ACE_Thread_Manager::task_all_list (ACE_Task_Base *task_list[], - size_t n) -{ - ACE_TRACE ("ACE_Thread_Manager::task_all_list"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - ACE_Task_Base **task_list_iterator = task_list; - size_t task_list_count = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (task_list_count >= n) - break; - - if ( iter.next ()->task_ ) - { - task_list_iterator[task_list_count] = iter.next ()->task_; - task_list_count++; - } - } - - return task_list_count; -} - -// Returns in thread_list a list of all thread ids - -int -ACE_Thread_Manager::thread_all_list ( ACE_thread_t thread_list[], - size_t n) -{ - ACE_TRACE ("ACE_Thread_Manager::thread_all_list"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - size_t thread_count = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (thread_count >= n) - break; - - thread_list[thread_count] = iter.next ()->thr_id_; - thread_count ++; - } - - return thread_count; -} - -// Returns in task_list a list of ACE_Tasks in a group. - -int -ACE_Thread_Manager::task_list (int grp_id, - ACE_Task_Base *task_list[], - size_t n) -{ - ACE_TRACE ("ACE_Thread_Manager::task_list"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - ACE_Task_Base **task_list_iterator = task_list; - size_t task_list_count = 0; - size_t i = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (task_list_count >= n) - break; - - if (iter.next ()->grp_id_ == grp_id - && this->find_task (iter.next ()->task_, i) == 0) - { - task_list_iterator[task_list_count] = iter.next ()->task_; - task_list_count++; - } - - i++; - } - - return task_list_count; -} - -// Returns in thread_list a list of thread ids in an ACE_Task. - -int -ACE_Thread_Manager::thread_list (ACE_Task_Base *task, - ACE_thread_t thread_list[], - size_t n) -{ - ACE_TRACE ("ACE_Thread_Manager::thread_list"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - size_t thread_count = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (thread_count >= n) - break; - - if (iter.next ()->task_ == task) - { - thread_list[thread_count] = iter.next ()->thr_id_; - thread_count++; - } - } - - return thread_count; -} - -// Returns in thread_list a list of thread handles in an ACE_Task. - -int -ACE_Thread_Manager::hthread_list (ACE_Task_Base *task, - ACE_hthread_t hthread_list[], - size_t n) -{ - ACE_TRACE ("ACE_Thread_Manager::hthread_list"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - size_t hthread_count = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (hthread_count >= n) - break; - - if (iter.next ()->task_ == task) - { - hthread_list[hthread_count] = iter.next ()->thr_handle_; - hthread_count++; - } - } - - return hthread_count; -} - -int -ACE_Thread_Manager::thread_grp_list (int grp_id, - ACE_thread_t thread_list[], - size_t n) -{ - ACE_TRACE ("ACE_Thread_Manager::thread_grp_list"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - size_t thread_count = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (thread_count >= n) - break; - - if (iter.next ()->grp_id_ == grp_id) - { - thread_list[thread_count] = iter.next ()->thr_id_; - thread_count++; - } - } - - return thread_count; -} - -// Returns in thread_list a list of thread handles in an ACE_Task. - -int -ACE_Thread_Manager::hthread_grp_list (int grp_id, - ACE_hthread_t hthread_list[], - size_t n) -{ - ACE_TRACE ("ACE_Thread_Manager::hthread_list"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - size_t hthread_count = 0; - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - { - if (hthread_count >= n) - break; - - if (iter.next ()->grp_id_ == grp_id) - { - hthread_list[hthread_count] = iter.next ()->thr_handle_; - hthread_count++; - } - } - - return hthread_count; -} - -int -ACE_Thread_Manager::set_grp (ACE_Task_Base *task, int grp_id) -{ - ACE_TRACE ("ACE_Thread_Manager::set_grp"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - for (ACE_Double_Linked_List_Iterator iter (this->thr_list_); - !iter.done (); - iter.advance ()) - if (iter.next ()->task_ == task) - iter.next ()->grp_id_ = grp_id; - - return 0; -} - -int -ACE_Thread_Manager::get_grp (ACE_Task_Base *task, int &grp_id) -{ - ACE_TRACE ("ACE_Thread_Manager::get_grp"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - ACE_FIND (this->find_task (task), ptr); - grp_id = ptr->grp_id_; - return 0; -} - -void -ACE_Thread_Control::dump (void) const -{ - ACE_TRACE ("ACE_Thread_Control::dump"); -} - -int -ACE_Thread_Control::insert (ACE_Thread_Manager *tm, int insert) -{ - ACE_TRACE ("ACE_Thread_Control::insert"); - - ACE_hthread_t t_id; - ACE_Thread::self (t_id); - this->tm_ = tm; - - if (insert) - return this->tm_->insert_thr (ACE_Thread::self (), t_id); - else - return 0; -} - -// Initialize the thread controller. - -ACE_Thread_Control::ACE_Thread_Control (ACE_Thread_Manager *t, - int insert) - : tm_ (t), - status_ (0) -{ - ACE_TRACE ("ACE_Thread_Control::ACE_Thread_Control"); - - if (this->tm_ != 0 && insert) - { - ACE_hthread_t t_id; - ACE_Thread::self (t_id); - this->tm_->insert_thr (ACE_Thread::self (), t_id); - } -} - -// Automatically kill thread on exit. - -ACE_Thread_Control::~ACE_Thread_Control (void) -{ - ACE_TRACE ("ACE_Thread_Control::~ACE_Thread_Control"); - -#if defined (ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS) || defined (ACE_HAS_TSS_EMULATION) || defined (ACE_WIN32) - this->exit (this->status_, 0); -#else - this->exit (this->status_, 1); -#endif /* ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS */ -} - -// Exit from thread (but clean up first). - -void * -ACE_Thread_Control::exit (void *exit_status, int do_thr_exit) -{ - ACE_TRACE ("ACE_Thread_Control::exit"); - - if (this->tm_ != 0) - return this->tm_->exit (exit_status, do_thr_exit); - else - { -#if !defined (ACE_HAS_TSS_EMULATION) - // With ACE_HAS_TSS_EMULATION, we let ACE_Thread_Adapter::invoke () - // exit the thread after cleaning up TSS. - ACE_Thread::exit (exit_status); -#endif /* ! ACE_HAS_TSS_EMULATION */ - return 0; - } -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -# if defined (ACE_THREAD_MANAGER_LACKS_STATICS) - template class ACE_Singleton; -# endif /* defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ - template class ACE_Auto_Basic_Ptr; - template class auto_ptr; - template class ACE_Double_Linked_List; - template class ACE_Double_Linked_List_Iterator_Base; - template class ACE_Double_Linked_List_Iterator; - template class ACE_Double_Linked_List; - template class ACE_Double_Linked_List_Iterator_Base; - template class ACE_Double_Linked_List_Iterator; - template class ACE_Node; - template class ACE_Unbounded_Queue; - template class ACE_Unbounded_Queue_Iterator; - template class ACE_Free_List; - template class ACE_Locked_Free_List; -# if (defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) - // These don't necessarily belong here, but it's a convenient place for them. - template class ACE_TSS; - template class ACE_TSS; -# endif /* ACE_HAS_THREADS && (ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION) */ -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -# if defined (ACE_THREAD_MANAGER_LACKS_STATICS) - #pragma instantiate ACE_Singleton -# endif /* defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ - #pragma instantiate ACE_Auto_Basic_Ptr - #pragma instantiate auto_ptr - #pragma instantiate ACE_Double_Linked_List - #pragma instantiate ACE_Double_Linked_List_Iterator_Base - #pragma instantiate ACE_Double_Linked_List_Iterator - #pragma instantiate ACE_Double_Linked_List - #pragma instantiate ACE_Double_Linked_List_Iterator_Base - #pragma instantiate ACE_Double_Linked_List_Iterator - #pragma instantiate ACE_Node - #pragma instantiate ACE_Unbounded_Queue - #pragma instantiate ACE_Unbounded_Queue_Iterator - #pragma instantiate ACE_Free_List - #pragma instantiate ACE_Locked_Free_List -# if (defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) - // These don't necessarily belong here, but it's a convenient place for them. - #pragma instantiate ACE_TSS - #pragma instantiate ACE_TSS -# endif /* ACE_HAS_THREADS && (ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION) */ -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h deleted file mode 100644 index ba4c443f742..00000000000 --- a/ace/Thread_Manager.h +++ /dev/null @@ -1,911 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Thread_Manager.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_THREAD_MANAGER_H -#define ACE_THREAD_MANAGER_H -#include "ace/pre.h" - -#include "ace/Thread.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Synch.h" -#include "ace/Containers.h" -#include "ace/Free_List.h" -#include "ace/Singleton.h" - -// The following macros control how a Thread Manager manages a pool of -// Thread_Descriptor. Currently, the default behavior is not to -// preallocate any thread descriptor and never (well, almost never) -// free up any thread descriptor until the Thread Manager gets -// destructed. Which means, once your system is stable, you rarely -// need to pay the price of memory allocation. On a deterministic -// system, which means, the number of threads spawned can be -// determined before hand, you can either redefine the memory pool -// size macros to suit your need or constructed the Thread_Manager -// accordingly. That way, you don't pay the price of memory -// allocation when the system is really doing its job. OTOH, on -// system with resources constraint, you may want to lower the size of -// ACE_DEFAULT_THREAD_MANAGER_HWM to avoid unused memory hanging -// around. - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_PREALLOC) -# define ACE_DEFAULT_THREAD_MANAGER_PREALLOC 0 -#endif /* ACE_DEFAULT_THREAD_MANAGER_PREALLOC */ - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_LWM) -# define ACE_DEFAULT_THREAD_MANAGER_LWM 1 -#endif /* ACE_DEFAULT_THREAD_MANAGER_LWM */ - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_INC) -# define ACE_DEFAULT_THREAD_MANAGER_INC 1 -#endif /* ACE_DEFAULT_THREAD_MANAGER_INC */ - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_HWM) -# define ACE_DEFAULT_THREAD_MANAGER_HWM ACE_DEFAULT_FREE_LIST_HWM -// this is a big number -#endif /* ACE_DEFAULT_THREAD_MANAGER_HWM */ - -// This is the synchronization mechanism used to prevent a thread -// descriptor gets removed from the Thread_Manager before it gets -// stash into it. If you want to disable this feature (and risk of -// corrupting the freelist,) you define the lock as ACE_Null_Mutex. -// Usually, if you can be sure that your threads will run for an -// extended period of time, you can safely disable the lock. - -#if !defined (ACE_DEFAULT_THREAD_MANAGER_LOCK) -# define ACE_DEFAULT_THREAD_MANAGER_LOCK ACE_SYNCH_MUTEX -#endif /* ACE_DEFAULT_THREAD_MANAGER_LOCK */ - -// Forward declarations. -class ACE_Task_Base; -class ACE_Thread_Manager; -class ACE_Thread_Descriptor; - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) -class ACE_Export ACE_At_Thread_Exit -{ - // = TITLE - // Contains a method to be applied when a thread is terminated. - friend class ACE_Thread_Descriptor; - friend class ACE_Thread_Manager; -public: - // Default constructor - ACE_At_Thread_Exit (void); - - // The destructor - virtual ~ACE_At_Thread_Exit (void); - - // has the ownership? - int is_owner (void) const; - - // Set the ownership of the . - int is_owner (int owner); - - // This was applied? - int was_applied (void) const; - - // Set applied state of . - int was_applied (int applied); - -protected: - ACE_At_Thread_Exit *next_; - // The next hook in the list. - - // Do the apply if necessary - void do_apply (void); - - virtual void apply (void) = 0; - // The apply method. - - ACE_Thread_Descriptor* td_; - // The Thread_Descriptor where this at is registered. - - int was_applied_; - // The at was applied? - - int is_owner_; - // The at has the ownership of this? -}; - -class ACE_Export ACE_At_Thread_Exit_Func : public ACE_At_Thread_Exit -{ -public: - // Constructor - ACE_At_Thread_Exit_Func (void *object, - ACE_CLEANUP_FUNC func, - void *param = 0); - - virtual ~ACE_At_Thread_Exit_Func (void); - -protected: - void *object_; - // The object to be cleanup - - ACE_CLEANUP_FUNC func_; - // The cleanup func - - void *param_; - // A param if required - - // The apply method - void apply (void); -}; - -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - -class ACE_Export ACE_Thread_Descriptor_Base : public ACE_OS_Thread_Descriptor -{ - // = TITLE - // Basic information for thread descriptors. These information - // gets extracted out because we need it after a thread is - // terminated. - - friend class ACE_Thread_Manager; - friend class ACE_Double_Linked_List; - friend class ACE_Double_Linked_List_Iterator_Base; - friend class ACE_Double_Linked_List_Iterator; - friend class ACE_Double_Linked_List; - friend class ACE_Double_Linked_List_Iterator_Base; - friend class ACE_Double_Linked_List_Iterator; -public: - ACE_Thread_Descriptor_Base (void); - ~ACE_Thread_Descriptor_Base (void); - - // = We need the following operators to make Borland happy. - - int operator== (const ACE_Thread_Descriptor_Base &rhs) const; - // Equality operator. - - int operator!= (const ACE_Thread_Descriptor_Base &rhs) const; - // Inequality operator. - - int grp_id (void); - // Group ID. - - ACE_UINT32 state (void); - // Current state of the thread. - - ACE_Task_Base *task (void); - // Return the pointer to an or NULL if there's no - // associated with this thread.; - -protected: - void reset (void); - // Reset this base thread descriptor. - - ACE_thread_t thr_id_; - // Unique thread ID. - - ACE_hthread_t thr_handle_; - // Unique handle to thread (used by Win32 and AIX). - - int grp_id_; - // Group ID. - - ACE_UINT32 thr_state_; - // Current state of the thread. - - ACE_Task_Base *task_; - // Pointer to an or NULL if there's no - // . - - ACE_Thread_Descriptor_Base *next_; - ACE_Thread_Descriptor_Base *prev_; - // We need these pointers to maintain the double-linked list in a - // thread managers. -}; - -class ACE_Export ACE_Thread_Descriptor : public ACE_Thread_Descriptor_Base -{ - // = TITLE - // Information for controlling threads that run under the control - // of the . -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - friend class ACE_At_Thread_Exit; -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - friend class ACE_Thread_Manager; - friend class ACE_Double_Linked_List; - friend class ACE_Double_Linked_List_Iterator; -public: - // = Initialization method. - ACE_Thread_Descriptor (void); - - // = Accessor methods. - ACE_thread_t self (void); - // Unique thread id. - - void self (ACE_hthread_t &); - // Unique handle to thread (used by Win32 and AIX). - - void dump (void) const; - // Dump the state of an object. - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - void log_msg_cleanup(ACE_Log_Msg* log_msg); - // This cleanup function must be called only for ACE_TSS_cleanup. - // The ACE_TSS_cleanup delegate Log_Msg instance destruction when - // Log_Msg cleanup is called before terminate. - - int at_exit (ACE_At_Thread_Exit* cleanup); - // Register an At_Thread_Exit hook and the ownership is acquire by - // Thread_Descriptor, this is the usual case when the AT is dynamically - // allocated. - - int at_exit (ACE_At_Thread_Exit& cleanup); - // Register an At_Thread_Exit hook and the ownership is retained for the - // caller. Normally used when the at_exit hook is created in stack. -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - - int at_exit (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param); - // Register an object (or array) for cleanup at thread termination. - // "cleanup_hook" points to a (global, or static member) function - // that is called for the object or array when it to be destroyed. - // It may perform any necessary cleanup specific for that object or - // its class. "param" is passed as the second parameter to the - // "cleanup_hook" function; the first parameter is the object (or - // array) to be destroyed. Returns 0 on success, non-zero on - // failure: -1 if virtual memory is exhausted or 1 if the object (or - // arrayt) had already been registered. - - ~ACE_Thread_Descriptor (void); - // Do nothing destructor to keep some compilers happy - - void acquire_release (void); - // Do nothing but to acquire the thread descriptor's lock and - // release. This will first check if the thread is registered or - // not. If it is already registered, there's no need to reacquire - // the lock again. This is used mainly to get newly spawned thread - // in synch with thread manager and prevent it from accessing its - // thread descriptor before it gets fully built. This function is - // only called from ACE_Log_Msg::thr_desc. - - ACE_INLINE_FOR_GNUC void set_next (ACE_Thread_Descriptor *td); - ACE_INLINE_FOR_GNUC ACE_Thread_Descriptor *get_next (void); - // Set/get the pointer. These are required by the - // ACE_Free_List. ACE_INLINE is specified here because one version - // of g++ couldn't grok this code without it. - -private: - void reset (ACE_Thread_Manager *tm); - // Reset this thread descriptor. - -#if !defined (ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - void at_pop (int apply = 1); - // Pop an At_Thread_Exit from at thread termination list, apply the at - // if apply is true. - - void at_push (ACE_At_Thread_Exit* cleanup, - int is_owner = 0); - // Push an At_Thread_Exit to at thread termination list and set the - // ownership of at. - - void do_at_exit (void); - // Run the AT_Thread_Exit hooks. - - void terminate (void); - // terminate realize the cleanup process to thread termination - - ACE_Log_Msg *log_msg_; - // Thread_Descriptor is the ownership of ACE_Log_Msg if log_msg_!=0 - // This can occur because ACE_TSS_cleanup was executed before terminate. - - ACE_At_Thread_Exit *at_exit_list_; - // The AT_Thread_Exit list -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - - ACE_Cleanup_Info cleanup_info_; - // Stores the cleanup info for a thread. - // @@ Note, this should be generalized to be a stack of - // s. - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - ACE_Thread_Manager* tm_; - // Pointer to an or NULL if there's no - // . -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - - ACE_DEFAULT_THREAD_MANAGER_LOCK *sync_; - // Registration lock to prevent premature removal of thread descriptor. - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - int terminated_; - // Keep track of termination status. -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ -}; - -// Forward declaration. -class ACE_Thread_Control; - -// This typedef should be (and used to be) inside the -// ACE_Thread_Manager declaration. But, it caused compilation -// problems on g++/VxWorks/i960 with -g. Note that -// ACE_Thread_Manager::THR_FUNC is only used internally in -// ACE_Thread_Manager, so it's not useful for anyone else. -// It also caused problems on IRIX5 with g++. -#if defined (__GNUG__) -typedef int (ACE_Thread_Manager::*ACE_THR_MEMBER_FUNC)(ACE_Thread_Descriptor *, int); -#endif /* __GNUG__ */ - -class ACE_Export ACE_Thread_Manager -{ - // = TITLE - // Manages a pool of threads. - // - // = DESCRIPTION - // This class allows operations on groups of threads atomically. - // The default behavior of thread manager is to wait on - // all threads under it's management when it gets destructed. - // Therefore, remember to remove a thread from thread manager if - // you don't want it to wait for the thread. There are also - // function to disable this default wait-on-exit behavior. - // However, if your program depends on turning this off to run - // correctly, you are probably doing something wrong. Rule of - // thumb, use ACE_Thread to manage your daemon threads. - // - // Notice that if there're threads live beyond the scope of - //
    , you are sure to have resource leaks in your program. - // Remember to wait on threads before exiting
    if that - // could happen in your programs. -public: - friend class ACE_Thread_Control; -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - friend class ACE_Thread_Descriptor; -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - -#if !defined (__GNUG__) - typedef int (ACE_Thread_Manager::*ACE_THR_MEMBER_FUNC)(ACE_Thread_Descriptor *, int); -#endif /* !__GNUG__ */ - - // These are the various states a thread managed by the - // can be in. - enum - { - ACE_THR_IDLE = 0x00000000, - // Uninitialized. - - ACE_THR_SPAWNED = 0x00000001, - // Created but not yet running. - - ACE_THR_RUNNING = 0x00000002, - // Thread is active (naturally, we don't know if it's actually - // *running* because we aren't the scheduler...). - - ACE_THR_SUSPENDED = 0x00000004, - // Thread is suspended. - - ACE_THR_CANCELLED = 0x00000008, - // Thread has been cancelled (which is an indiction that it needs to - // terminate...). - - ACE_THR_TERMINATED = 0x00000010, - // Thread has shutdown, but the slot in the thread manager hasn't - // been reclaimed yet. - - ACE_THR_JOINING = 0x10000000 - // Join operation has been invoked on the thread by thread manager. - }; - - // = Initialization and termination methods. - ACE_Thread_Manager (size_t preaolloc = 0, - size_t lwm = ACE_DEFAULT_THREAD_MANAGER_LWM, - size_t inc = ACE_DEFAULT_THREAD_MANAGER_INC, - size_t hwm = ACE_DEFAULT_THREAD_MANAGER_HWM); - virtual ~ACE_Thread_Manager (void); - -#if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) - static ACE_Thread_Manager *instance (void); - // Get pointer to a process-wide . - - static ACE_Thread_Manager *instance (ACE_Thread_Manager *); - // Set pointer to a process-wide and return - // existing pointer. - - static void close_singleton (void); - // Delete the dynamically allocated Singleton -#endif /* ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ - - int open (size_t size = 0); - // No-op. Currently unused. - - int close (void); - // Release all resources. - // By default, this method will wait till all threads - // exit. However, when called from , most global resources - // are destroyed and thus, we don't try to wait but just clean up the thread - // descriptor list. - - // The * argument to each of the family member - // functions is interpreted and used as shown in the following - // table. NOTE: the final option, to provide task names, is _only_ - // supported on VxWorks! - // - // Value of ACE_thread_t * argument Use Platforms - // ================================ ========================== ========= - // 0 Not used. All - // non-0 (and points to 0 char * The task name is passed All - // on VxWorks) back in the char *. - // non-0, points to non-0 char * The char * is used as VxWorks only - // the task name. The - // argument is not modified. - - int spawn (ACE_THR_FUNC func, - void *args = 0, - long flags = THR_NEW_LWP | THR_JOINABLE, - ACE_thread_t * = 0, - ACE_hthread_t *t_handle = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - void *stack = 0, - size_t stack_size = 0); - // Create a new thread, which executes . - // Returns: on success a unique group id that can be used to control - // other threads added to the same group. On failure, returns -1. - - int spawn_n (size_t n, - ACE_THR_FUNC func, - void *args = 0, - long flags = THR_NEW_LWP | THR_JOINABLE, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - ACE_Task_Base *task = 0, - ACE_hthread_t thread_handles[] = 0, - void *stack[] = 0, - size_t stack_size[] = 0); - // Create N new threads, all of which execute . - // Returns: on success a unique group id that can be used to control - // all of the threads in the same group. On failure, returns -1. - - int spawn_n (ACE_thread_t thread_ids[], - size_t n, - ACE_THR_FUNC func, - void *args, - long flags, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_hthread_t thread_handles[] = 0); - // Spawn N new threads, which execute with argument . - // If != 0 the thread_ids of successfully spawned - // threads will be placed into the buffer (which must - // be the same size as ). If != 0 it is assumed to be an - // array of pointers to the base of the stacks to use for the - // threads being spawned. If != 0 it is assumed to be - // an array of values indicating how big each of the - // corresponding s are. If != 0 it is - // assumed to be an array of thread_handles that will be - // assigned the values of the thread handles being spawned. Returns - // -1 on failure ( will explain...), otherwise returns the - // group id of the threads. - - void *exit (void *status = 0, - int do_thread_exit = 1); - // Called to clean up when a thread exits. If is - // non-0 then is called to exit the thread, in - // which case is passed as the exit value of the thread. - // Should _not_ be called by main thread. - - int wait (const ACE_Time_Value *timeout = 0, - int abandon_detached_threads = 0); - // Block until there are no more threads running in the - // or expires. Note that is - // treated as "absolute" time. Returns 0 on success and -1 on - // failure. If is set, wait will first - // check thru its thread list for threads with THR_DETACHED or - // THR_DAEMON flags set and remove these threads. Notice that - // unlike other wait_* function, by default, does wait on - // all thread spawned by this thread_manager no matter the detached - // flags are set or not unless it is called with - // flag set. - // NOTE that if this function is called while the ACE_Object_Manager - // is shutting down (as a result of program rundown via ACE::fini), - // it will not wait for any threads to complete. If you must wait for - // threads spawned by this thread manager to complete and you are in a - // ACE rundown situation (such as your object is being destroyed by the - // ACE_Object_Manager) you can use wait_grp instead. - - int join (ACE_thread_t tid, void **status = 0); - // Join a thread specified by . Do not wait on a detached thread. - - int wait_grp (int grp_id); - // Block until there are no more threads running in a group. - // Returns 0 on success and -1 on failure. Notice that wait_grp - // will not wait on detached threads. - - // = Accessors for ACE_Thread_Descriptors. - ACE_Thread_Descriptor *thread_desc_self (void); - // Get a pointer to the calling thread's own thread_descriptor. - // This must be called from a spawn thread. This function will - // fetch the info from TSS. - - ACE_Thread_Descriptor *thread_descriptor (ACE_thread_t); - // Return a pointer to the thread's Thread_Descriptor, - // 0 if fail. - - ACE_Thread_Descriptor *hthread_descriptor (ACE_hthread_t); - // Return a pointer to the thread's Thread_Descriptor, - // 0 if fail. - - int thr_self (ACE_hthread_t &); - // Return the "real" handle to the calling thread, caching it if - // necessary in TSS to speed up subsequent lookups. This is - // necessary since on some platforms (e.g., Win32) we can't get this - // handle via direct method calls. Notice that you should *not* - // close the handle passed back from this method. It is used - // internally by Thread Manager. On the other hand, you *have to* - // use this internal thread handle when working on Thread_Manager. - // Return -1 if fail. - - ACE_thread_t thr_self (void); - // Return the unique ID of the thread. This is not strictly - // necessary (because a thread can always just call - // ). However, we put it here to be complete. - - ACE_Task_Base *task (void); - // Returns a pointer to the current we're executing - // in if this thread is indeed running in an , else - // return 0. - - // = Suspend methods, which isn't supported on POSIX pthreads (will not block). - int suspend_all (void); - // Suspend all threads - int suspend (ACE_thread_t); - // Suspend a single thread. - int suspend_grp (int grp_id); - // Suspend a group of threads. - int testsuspend (ACE_thread_t t_id); - // True if is inactive (i.e., suspended), else false. - - // = Resume methods, which isn't supported on POSIX pthreads (will not block). - int resume_all (void); - // Resume all stopped threads - int resume (ACE_thread_t); - // Resume a single thread. - int resume_grp (int grp_id); - // Resume a group of threads. - int testresume (ACE_thread_t t_id); - // True if is active (i.e., resumed), else false. - - // = Kill methods, send signals -- which isn't supported on Win32 (will not block). - int kill_all (int signum); - // Send signum to all stopped threads - int kill (ACE_thread_t, - int signum); - // Kill a single thread. - int kill_grp (int grp_id, - int signum); - // Kill a group of threads. - - // = Cancel methods, which provides a cooperative thread-termination mechanism (will not block). - int cancel_all (int async_cancel = 0); - // Cancel's all the threads. - int cancel (ACE_thread_t, int async_cancel = 0); - // Cancel a single thread. - int cancel_grp (int grp_id, int async_cancel = 0); - // Cancel a group of threads. - int testcancel (ACE_thread_t t_id); - // True if is cancelled, else false. - - // = Set/get group ids for a particular thread id. - int set_grp (ACE_thread_t, - int grp_id); - int get_grp (ACE_thread_t, - int &grp_id); - - // = The following methods are new methods which resemble current - // methods in . For example, the - // method resembles the method, and - // resembles . - - // = Operations on ACE_Tasks. - - int wait_task (ACE_Task_Base *task); - // Block until there are no more threads running in . Returns - // 0 on success and -1 on failure. Note that will not - // wait on detached threads. - int suspend_task (ACE_Task_Base *task); - // Suspend all threads in an ACE_Task. - int resume_task (ACE_Task_Base *task); - // Resume all threads in an ACE_Task. - int kill_task (ACE_Task_Base *task, - int signum); - // Send a signal to all threads in an . - - int cancel_task (ACE_Task_Base *task, int async_cancel = 0); - // Cancel all threads in an . If is non-0, - // then asynchronously cancel these threads if the OS platform - // supports cancellation. Otherwise, perform a "cooperative" - // cancellation. - - // = Collect thread handles in the thread manager. Notice that - // the collected information is just a snapshot. - int hthread_within (ACE_hthread_t handle); - int thread_within (ACE_thread_t tid); - // Check if the thread is managed by the thread manager. Return true if - // the thread is found, false otherwise. - - int num_tasks_in_group (int grp_id); - // Returns the number of in a group. - - int num_threads_in_task (ACE_Task_Base *task); - // Returns the number of threads in an . - - int task_list (int grp_id, - ACE_Task_Base *task_list[], - size_t n); - // Returns in a list of up to in a - // group. The caller must allocate the memory for . In - // case of an error, -1 is returned. If no requested values are - // found, 0 is returned, otherwise correct number of retrieved - // values are returned. - - int thread_list (ACE_Task_Base *task, - ACE_thread_t thread_list[], - size_t n); - // Returns in a list of up to thread ids in an - // . The caller must allocate the memory for - // . In case of an error, -1 is returned. If no - // requested values are found, 0 is returned, otherwise correct - // number of retrieved values are returned. - - int hthread_list (ACE_Task_Base *task, - ACE_hthread_t hthread_list[], - size_t n); - // Returns in a list of up to thread handles in - // an . The caller must allocate memory for - // . In case of an error, -1 is returned. If no - // requested values are found, 0 is returned, otherwise correct - // number of retrieved values are returned. - - int thread_grp_list (int grp_id, - ACE_thread_t thread_list[], - size_t n); - // Returns in a list of up to thread ids in a - // group . The caller must allocate the memory for - // . In case of an error, -1 is returned. If no - // requested values are found, 0 is returned, otherwise correct - // number of retrieved values are returned. - - int hthread_grp_list (int grp_id, - ACE_hthread_t hthread_list[], - size_t n); - // Returns in a list of up to thread handles in - // a group . The caller must allocate memory for - // . - - int task_all_list (ACE_Task_Base *task_list[], - size_t n); - // Returns in a list of up to . The - // caller must allocate the memory for . In case of an - // error, -1 is returned. If no requested values are found, 0 is - // returned, otherwise correct number of retrieved values are - // returned. - - int thread_all_list (ACE_thread_t thread_list[], - size_t n); - // Returns in a list of up to thread ids. The - // caller must allocate the memory for . In case of an - // error, -1 is returned. If no requested values are found, 0 is - // returned, otherwise correct number of retrieved values are - // returned. - - // = Set/get group ids for a particular task. - int set_grp (ACE_Task_Base *task, int grp_id); - int get_grp (ACE_Task_Base *task, int &grp_id); - - int count_threads (void) const; - // Return a count of the current number of threads active in the - // . - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - int at_exit (ACE_At_Thread_Exit* cleanup); - // Register an At_Thread_Exit hook and the ownership is acquire by - // Thread_Descriptor, this is the usual case when the AT is dynamically - // allocated. - - int at_exit (ACE_At_Thread_Exit& cleanup); - // Register an At_Thread_Exit hook and the ownership is retained for the - // caller. Normally used when the at_exit hook is created in stack. -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - - int at_exit (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param); - // *** This function is deprecated. Please use the previous two - // *** at_exit method. Notice that you should avoid mixing this method - // *** with the previous two at_exit methods. - // - // Register an object (or array) for cleanup at - // thread termination. "cleanup_hook" points to a (global, or - // static member) function that is called for the object or array - // when it to be destroyed. It may perform any necessary cleanup - // specific for that object or its class. "param" is passed as the - // second parameter to the "cleanup_hook" function; the first - // parameter is the object (or array) to be destroyed. - // "cleanup_hook", for example, may delete the object (or array). - // If == 0, the will _NOT_ get cleanup at - // thread exit. You can use this to cancel the previously added - // at_exit. - - void wait_on_exit (int dowait); - int wait_on_exit (void); - // Access function to determine whether the Thread_Manager will - // wait for its thread to exit or not when being closing down. - - void dump (void); - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -protected: - virtual int spawn_i (ACE_THR_FUNC func, - void *args, - long flags, - ACE_thread_t * = 0, - ACE_hthread_t *t_handle = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - void *stack = 0, - size_t stack_size = 0, - ACE_Task_Base *task = 0); - // Create a new thread (must be called with locks held). - - void run_thread_exit_hooks (int i); - // Run the registered hooks when the thread exits. - - ACE_Thread_Descriptor *find_thread (ACE_thread_t t_id); - // Locate the index of the table slot occupied by . Returns - // -1 if is not in the table doesn't contain . - - ACE_Thread_Descriptor *find_hthread (ACE_hthread_t h_id); - // Locate the index of the table slot occupied by . Returns - // -1 if is not in the table doesn't contain . - - ACE_Thread_Descriptor *find_task (ACE_Task_Base *task, - int slot = -1); - // Locate the thread descriptor address of the list occupied by - // . Returns 0 if is not in the table doesn't contain - // . - - int insert_thr (ACE_thread_t t_id, - ACE_hthread_t, - int grp_id = -1, - long flags = 0); - // Insert a thread in the table (checks for duplicates). - - int append_thr (ACE_thread_t t_id, ACE_hthread_t, - ACE_UINT32, - int grp_id, - ACE_Task_Base *task = 0, - long flags = 0, - ACE_Thread_Descriptor *td = 0); - // Append a thread in the table (adds at the end, growing the table - // if necessary). - - void remove_thr (ACE_Thread_Descriptor *td, - int close_handler); - // Remove thread from the table. - - void remove_thr_all (void); - // Remove all threads from the table. - - // = The following four methods implement a simple scheme for - // operating on a collection of threads atomically. - - int check_state (ACE_UINT32 state, - ACE_thread_t thread, - int enable = 1); - // Efficiently check whether is in a particular . - // This call updates the TSS cache if possible to speed up - // subsequent searches. - - int apply_task (ACE_Task_Base *task, - ACE_THR_MEMBER_FUNC, - int = 0); - // Apply to all members of the table that match the - - int apply_grp (int grp_id, - ACE_THR_MEMBER_FUNC func, - int arg = 0); - // Apply to all members of the table that match the . - - int apply_all (ACE_THR_MEMBER_FUNC, - int = 0); - // Apply to all members of the table. - - int join_thr (ACE_Thread_Descriptor *td, - int = 0); - // Join the thread described in . - - int resume_thr (ACE_Thread_Descriptor *td, - int = 0); - // Resume the thread described in . - - int suspend_thr (ACE_Thread_Descriptor *td, - int = 0); - // Suspend the thread described in . - - int kill_thr (ACE_Thread_Descriptor *td, - int signum); - // Send signal to the thread described in . - - int cancel_thr (ACE_Thread_Descriptor *td, - int async_cancel = 0); - // Set the cancellation flag for the thread described in . - - int register_as_terminated (ACE_Thread_Descriptor *td); - // Register a thread as terminated and put it into the . - - ACE_Double_Linked_List thr_list_; - // Keeping a list of thread descriptors within the thread manager. - // Double-linked list enables us to cache the entries in TSS - // and adding/removing thread descriptor entries without - // affecting other thread's descriptor entries. - -#if !defined (VXWORKS) - ACE_Double_Linked_List terminated_thr_list_; - // Collect terminated but not yet joined thread entries. -#endif /* VXWORKS */ - - ACE_Unbounded_Queue thr_to_be_removed_; - // Collect pointers to thread descriptors of threads to be removed later. - - int grp_id_; - // Keeps track of the next group id to assign. - - int automatic_wait_; - // Set if we want the Thread_Manager to wait on all threads before - // being closed, reset otherwise. - - // = ACE_Thread_Mutex and condition variable for synchronizing termination. -#if defined (ACE_HAS_THREADS) - ACE_Thread_Mutex lock_; - // Serialize access to the . - - ACE_Condition_Thread_Mutex zero_cond_; - // Keep track of when there are no more threads. -#endif /* ACE_HAS_THREADS */ - -private: - ACE_Locked_Free_List thread_desc_freelist_; - -#if ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) - static ACE_Thread_Manager *thr_mgr_; - // Pointer to a process-wide . - - static int delete_thr_mgr_; - // Must delete the if non-0. -#endif /* ! defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ -}; - -#if defined (ACE_THREAD_MANAGER_LACKS_STATICS) -#define ACE_THREAD_MANAGER_SINGLETON_DEFINE \ - ACE_Singleton; -typedef ACE_Singleton ACE_THREAD_MANAGER_SINGLETON; -#endif /* defined (ACE_THREAD_MANAGER_LACKS_STATICS) */ - -#if defined (__ACE_INLINE__) -#include "ace/Thread_Manager.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* ACE_THREAD_MANAGER_H */ diff --git a/ace/Thread_Manager.i b/ace/Thread_Manager.i deleted file mode 100644 index b6a29735c34..00000000000 --- a/ace/Thread_Manager.i +++ /dev/null @@ -1,370 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Thread_Manager.i - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) -ACE_INLINE -ACE_At_Thread_Exit::ACE_At_Thread_Exit() - : td_(0), - was_applied_(0), - is_owner_(1) - -{ -} - -ACE_INLINE int -ACE_At_Thread_Exit::was_applied() const - -{ - return was_applied_; -} - -ACE_INLINE int -ACE_At_Thread_Exit::was_applied(int applied) - -{ - was_applied_ = applied; - if (was_applied_) - td_ = 0; - return was_applied_; -} - -ACE_INLINE int -ACE_At_Thread_Exit::is_owner() const - -{ - return is_owner_; -} - -ACE_INLINE int -ACE_At_Thread_Exit::is_owner(int owner) - -{ - is_owner_ = owner; - return is_owner_; -} - -ACE_INLINE void -ACE_At_Thread_Exit::do_apply() - -{ - if (!this->was_applied_ && this->is_owner_) - { - td_->at_pop(); - } -} - -ACE_INLINE -ACE_At_Thread_Exit::~ACE_At_Thread_Exit() - -{ - this->do_apply(); -} - -ACE_INLINE -ACE_At_Thread_Exit_Func::ACE_At_Thread_Exit_Func ( - void* object, - ACE_CLEANUP_FUNC func, - void* param -) - : object_(object), - func_(func), - param_(param) - -{ -} - -ACE_INLINE -ACE_At_Thread_Exit_Func::~ACE_At_Thread_Exit_Func() - -{ - this->do_apply(); -} - -ACE_INLINE void -ACE_At_Thread_Exit_Func::apply() - -{ - func_(object_, param_); -} -#endif /* ! ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - -ACE_INLINE -ACE_Thread_Descriptor_Base::ACE_Thread_Descriptor_Base (void) - : ACE_OS_Thread_Descriptor (), - thr_id_ (ACE_OS::NULL_thread), - thr_handle_ (ACE_OS::NULL_hthread), - grp_id_ (0), - thr_state_ (ACE_Thread_Manager::ACE_THR_IDLE), - task_ (0) -{ -} - -ACE_INLINE -ACE_Thread_Descriptor_Base::~ACE_Thread_Descriptor_Base (void) -{ -} - -ACE_INLINE int -ACE_Thread_Descriptor_Base::operator==(const ACE_Thread_Descriptor_Base &rhs) const -{ - return ACE_OS::thr_cmp (this->thr_handle_, rhs.thr_handle_) == 0 - && ACE_OS::thr_equal (this->thr_id_, rhs.thr_id_) == 0; -} - -ACE_INLINE int -ACE_Thread_Descriptor_Base::operator!=(const ACE_Thread_Descriptor_Base &rhs) const -{ - return !(*this == rhs); -} - -ACE_INLINE ACE_Task_Base * -ACE_Thread_Descriptor_Base::task (void) -{ - ACE_TRACE ("ACE_Thread_Descriptor_Base::task"); - return this->task_; -} - -// Group ID. - -ACE_INLINE int -ACE_Thread_Descriptor_Base::grp_id (void) -{ - ACE_TRACE ("ACE_Thread_Descriptor_Base::grp_id"); - return grp_id_; -} - -// Current state of the thread. -ACE_INLINE ACE_UINT32 -ACE_Thread_Descriptor_Base::state (void) -{ - ACE_TRACE ("ACE_Thread_Descriptor_Base::state"); - return thr_state_; -} - -// Reset this base descriptor. -ACE_INLINE void -ACE_Thread_Descriptor_Base::reset (void) -{ - ACE_TRACE ("ACE_Thread_Descriptor_Base::reset"); - this->thr_id_ = ACE_OS::NULL_thread; - this->thr_handle_ = ACE_OS::NULL_hthread; - this->grp_id_ = 0; - this->thr_state_ = ACE_Thread_Manager::ACE_THR_IDLE; - this->task_ = 0; - this->flags_ = 0; -} - -// Unique thread id. -ACE_INLINE ACE_thread_t -ACE_Thread_Descriptor::self (void) -{ - ACE_TRACE ("ACE_Thread_Descriptor::self"); - return this->thr_id_; -} - -// Unique kernel-level thread handle. - -ACE_INLINE void -ACE_Thread_Descriptor::self (ACE_hthread_t &handle) -{ - ACE_TRACE ("ACE_Thread_Descriptor::self"); - handle = this->thr_handle_; -} - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) -ACE_INLINE void -ACE_Thread_Descriptor::log_msg_cleanup(ACE_Log_Msg* log_msg) - -{ - log_msg_ = log_msg; -} -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - -// Set the pointer -ACE_INLINE void -ACE_Thread_Descriptor::set_next (ACE_Thread_Descriptor *td) -{ - ACE_TRACE ("ACE_Thread_Descriptor::set_next"); - this->next_ = td; -} - -// Get the pointer -ACE_INLINE ACE_Thread_Descriptor * -ACE_Thread_Descriptor::get_next (void) -{ - ACE_TRACE ("ACE_Thread_Descriptor::get_next"); - return ACE_static_cast (ACE_Thread_Descriptor *, this->next_); -} - -// Reset this thread descriptor -ACE_INLINE void -ACE_Thread_Descriptor::reset (ACE_Thread_Manager *tm) -{ - ACE_TRACE ("ACE_Thread_Descriptor::reset"); - this->ACE_Thread_Descriptor_Base::reset (); -#if defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) - this->cleanup_info_.cleanup_hook_ = 0; - this->cleanup_info_.object_ = 0; - this->cleanup_info_.param_ = 0; -#else /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - this->at_exit_list_ = 0; - // Start the at_exit hook list. - this->tm_ = tm; - // Setup the Thread_Manager. - this->log_msg_ = 0; - this->terminated_ = 0; -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ -} - -// Set the exit status. - -ACE_INLINE void * -ACE_Thread_Control::status (void *s) -{ - ACE_TRACE ("ACE_Thread_Control::status"); - return this->status_ = s; -} - -// Get the exit status. - -ACE_INLINE void * -ACE_Thread_Control::status (void) -{ - ACE_TRACE ("ACE_Thread_Control::status"); - return this->status_; -} - -// Returns the current . - -ACE_INLINE ACE_Thread_Manager * -ACE_Thread_Control::thr_mgr (void) -{ - ACE_TRACE ("ACE_Thread_Control::thr_mgr"); - return this->tm_; -} - -// Atomically set a new and return the old -// . - -ACE_INLINE ACE_Thread_Manager * -ACE_Thread_Control::thr_mgr (ACE_Thread_Manager *tm) -{ - ACE_TRACE ("ACE_Thread_Control::thr_mgr"); - ACE_Thread_Manager *o_tm = this->tm_; - this->tm_ = tm; - return o_tm; -} - -ACE_INLINE ACE_Thread_Descriptor * -ACE_Thread_Manager::thread_desc_self (void) -{ - // This method must be called with lock held. - - // Try to get it from cache. - ACE_Thread_Descriptor *desc = ACE_LOG_MSG->thr_desc (); - -#if 1 - ACE_ASSERT (desc != 0); - // Thread descriptor should always get cached. -#else - if (desc == 0) - { - ACE_thread_t id = ACE_OS::thr_self (); - - desc = this->find_thread (id); - - // Thread descriptor adapter might not have been put into the - // list yet. - if (desc != 0) - // Update the TSS cache. - ACE_LOG_MSG->thr_desc (desc); - } -#endif - return desc; -} - -// Return the unique ID of the thread. - -ACE_INLINE ACE_thread_t -ACE_Thread_Manager::thr_self (void) -{ - ACE_TRACE ("ACE_Thread_Manager::thr_self"); - return ACE_Thread::self (); -} - -ACE_INLINE ACE_Task_Base * -ACE_Thread_Manager::task (void) -{ - ACE_TRACE ("ACE_Thread_Manager::task"); - - ACE_Thread_Descriptor *td = this->thread_desc_self () ; - - if (td == 0) - return 0; - else - return td->task (); -} - -ACE_INLINE int -ACE_Thread_Manager::open (size_t) -{ - // Currently no-op. - return 0; -} - -#if !defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) -ACE_INLINE int -ACE_Thread_Manager::at_exit (ACE_At_Thread_Exit* at) -{ - return this->thread_desc_self ()->at_exit (at); -} - -ACE_INLINE int -ACE_Thread_Manager::at_exit (ACE_At_Thread_Exit& at) -{ - return this->thread_desc_self ()->at_exit (at); -} -#endif /* !ACE_USE_ONE_SHOT_AT_THREAD_EXIT */ - -ACE_INLINE int -ACE_Thread_Manager::at_exit (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param) -{ - return this->thread_desc_self ()->at_exit (object, - cleanup_hook, - param); -} - -ACE_INLINE void -ACE_Thread_Manager::wait_on_exit (int do_wait) -{ - this->automatic_wait_ = do_wait; -} - -ACE_INLINE int -ACE_Thread_Manager::wait_on_exit (void) -{ - return this->automatic_wait_; -} - -ACE_INLINE int -ACE_Thread_Manager::register_as_terminated (ACE_Thread_Descriptor *td) -{ -#if defined (VXWORKS) - ACE_UNUSED_ARG (td); -#else /* ! VXWORKS */ - ACE_Thread_Descriptor_Base *tdb; - ACE_NEW_RETURN (tdb, ACE_Thread_Descriptor_Base (*td), -1); - this->terminated_thr_list_.insert_tail (tdb); -#endif /* ! VXWORKS */ - return 0; -} - -ACE_INLINE int -ACE_Thread_Manager::count_threads (void) const -{ - return this->thr_list_.size (); -} diff --git a/ace/Time_Request_Reply.cpp b/ace/Time_Request_Reply.cpp deleted file mode 100644 index e9d63a58ad3..00000000000 --- a/ace/Time_Request_Reply.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// $Id$ - -#include "ace/Time_Request_Reply.h" - -ACE_RCSID(ace, Time_Request_Reply, "$Id$") - -// Default "do nothing" constructor. - -ACE_Time_Request::ACE_Time_Request (void) -{ - ACE_TRACE ("ACE_Time_Request::ACE_Time_Request"); -} - -// Create a ACE_Time_Request message. - -ACE_Time_Request::ACE_Time_Request (ACE_INT32 t, // Type of request. - const ACE_UINT32 time, - ACE_Time_Value *timeout) // Max time waiting for request. -{ - ACE_TRACE ("ACE_Time_Request::ACE_Time_Request"); - this->msg_type (t); - - // If timeout is a NULL pointer, then block forever... - if (timeout == 0) - { - this->transfer_.block_forever_ = 1; - this->transfer_.sec_timeout_ = 0; - this->transfer_.usec_timeout_ = 0; - } - else // Do a "timed wait." - { - this->block_forever (0); - // Keep track of how long client is willing to wait. - this->transfer_.sec_timeout_ = timeout->sec (); - this->transfer_.usec_timeout_ = timeout->usec (); - } - - // Copy time into request - this->time_ = this->transfer_.time_ = time; -} - -// Initialize length_ in order to avoid problems with byte-ordering -void -ACE_Time_Request::init (void) -{ - ACE_TRACE ("ACE_Time_Request::init"); -// this->length (sizeof this->transfer_); -} - -// Get the fixed size of message -ssize_t -ACE_Time_Request::size (void) const -{ - ACE_TRACE ("ACE_Time_Request::size"); - return sizeof (this->transfer_); -} - -// = Set/get the type of the message. -ACE_INT32 -ACE_Time_Request::msg_type (void) const -{ - ACE_TRACE ("ACE_Time_Request::msg_type"); - return this->transfer_.msg_type_; -} - -void -ACE_Time_Request::msg_type (ACE_INT32 t) -{ - ACE_TRACE ("ACE_Time_Request::msg_type"); - this->transfer_.msg_type_ = t; -} - -// = Set/get the blocking semantics. -ACE_UINT32 -ACE_Time_Request::block_forever (void) const -{ - ACE_TRACE ("ACE_Time_Request::block_forever"); - return this->transfer_.block_forever_; -} - -void -ACE_Time_Request::block_forever (ACE_UINT32 bs) -{ - ACE_TRACE ("ACE_Time_Request::block_forever"); - this->transfer_.block_forever_ = bs; -} - -// = Set/get the timeout. -ACE_Time_Value -ACE_Time_Request::timeout (void) const -{ - ACE_TRACE ("ACE_Time_Request::timeout"); - return ACE_Time_Value (this->transfer_.sec_timeout_, this->transfer_.usec_timeout_); -} - -void -ACE_Time_Request::timeout (const ACE_Time_Value timeout) -{ - ACE_TRACE ("ACE_Time_Request::timeout"); - this->transfer_.sec_timeout_ = timeout.sec (); - this->transfer_.usec_timeout_ = timeout.usec (); -} - -// = Set/get the time -ACE_UINT32 -ACE_Time_Request::time (void) const -{ - ACE_TRACE ("ACE_Time_Request::time"); - return this->time_; -} - -void -ACE_Time_Request::time (ACE_UINT32 t) -{ - ACE_TRACE ("ACE_Time_Request::time"); - this->time_ = t; -} - -// Encode the transfer buffer into network byte order -// so that it can be sent to the server. -int -ACE_Time_Request::encode (void *&buf) -{ - ACE_TRACE ("ACE_Time_Request::encode"); - // Compute the length *before* doing the marshaling. - - buf = (void *) &this->transfer_; - this->transfer_.block_forever_ = htonl (this->transfer_.block_forever_); - this->transfer_.usec_timeout_ = htonl (this->transfer_.usec_timeout_); - this->transfer_.sec_timeout_ = htonl (this->transfer_.sec_timeout_); - this->transfer_.msg_type_ = htonl (this->transfer_.msg_type_); - this->transfer_.time_ = htonl (this->transfer_.time_); - - return this->size (); // Always fixed -} - -// Decode the transfer buffer into host byte byte order -// so that it can be used by the server. -int -ACE_Time_Request::decode (void) -{ - ACE_TRACE ("ACE_Time_Request::decode"); - // Decode - this->transfer_.block_forever_ = ntohl (this->transfer_.block_forever_); - this->transfer_.usec_timeout_ = ntohl (this->transfer_.usec_timeout_); - this->transfer_.sec_timeout_ = ntohl (this->transfer_.sec_timeout_); - this->transfer_.msg_type_ = ntohl (this->transfer_.msg_type_); - this->transfer_.time_ = ntohl (this->transfer_.time_); - - this->time_ = this->transfer_.time_; - return 0; -} - -// Print out the current values of the ACE_Time_Request. - -void -ACE_Time_Request::dump (void) const -{ - ACE_TRACE ("ACE_Time_Request::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("*******\nlength = %d\n"), - this->size ())); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("message-type = "))); - - switch (this->msg_type ()) - { - case ACE_Time_Request::TIME_UPDATE: - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TIME_UPDATE\n"))); - break; - default: - ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" = %d\n"), this->msg_type ())); - break; - } - - if (this->block_forever ()) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("blocking forever\n"))); - else - { -#if !defined (ACE_NLOGGING) - ACE_Time_Value tv = this->timeout (); -#endif /* ! ACE_NLOGGING */ - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("waiting for %d secs and %d usecs\n"), - tv.sec (), tv.usec ())); - } - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("*******\ntime = %d\n"), - this->time ())); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("+++++++\n"))); -} diff --git a/ace/Time_Request_Reply.h b/ace/Time_Request_Reply.h deleted file mode 100644 index ed7022e0dc8..00000000000 --- a/ace/Time_Request_Reply.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - - -// ============================================================================ -// -// = LIBRARY -// ACE -// -// = FILENAME -// ACE_Time_Request_Reply.h -// -// = DESCRIPTION -// Define the format used to exchange messages between the -// ACE_Time_Server and clerks. -// -// = AUTHOR -// Prashant Jain -// -// ============================================================================ - -#ifndef ACE_TIME_REQUEST_REPLY_H -#define ACE_TIME_REQUEST_REPLY_H -#include "ace/pre.h" - -#include "ace/Time_Value.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SString.h" - -class ACE_Export ACE_Time_Request -{ - // = TITLE - // Message format for delivering requests to the ACE_Time Server. - // - // = DESCRIPTION - // This class is implemented to minimize data copying. - // In particular, all marshaling is done in situ... -public: - enum Constants - { - // Request message types. - TIME_UPDATE = 01, - - // Class-specific constant values. - MAX_TIME_LEN = MAXPATHLEN + 1 - }; - - ACE_Time_Request (void); - // Default constructor. - - ACE_Time_Request (ACE_INT32 msg_type, // Type of request. - const ACE_UINT32 time, - ACE_Time_Value *timeout = 0); // Max time waiting for request. - // Create a message. - - void init (void); - // Initialize length_ in order to ensure correct byte ordering - // before a request is sent. - - // Get the fixed size of message - ssize_t size (void) const; - - // = Set/get the type of the message. - ACE_INT32 msg_type (void) const; - void msg_type (ACE_INT32); - - // = Set/get the time - ACE_UINT32 time (void) const; - void time (ACE_UINT32 t); - - // = Set/get the blocking semantics. - ACE_UINT32 block_forever (void) const; - void block_forever (ACE_UINT32); - - // = Set/get the timeout. - ACE_Time_Value timeout (void) const; - void timeout (const ACE_Time_Value timeout); - - int encode (void *&); - // Encode the message before transmission. - - int decode (void); - // Decode message after reception. - - void dump (void) const; - // Print out the values of the message for debugging purposes. - -private: - // = The 5 fields in the struct are transmitted to the server. - // The remaining 2 fields are not tranferred -- they are used only on - // the server-side to simplify lookups. - - struct Transfer - { - ACE_INT32 msg_type_; - // Type of the request (i.e., ) - - ACE_UINT32 block_forever_; - // Indicates if we should block forever. If 0, then - // and indicates how long we should wait. - - ACE_UINT32 sec_timeout_; - // Max seconds willing to wait for name if not blocking forever. - - ACE_UINT32 usec_timeout_; - // Max micro seconds to wait for name if not blocking forever. - - ACE_UINT32 time_; - // The data portion contains - }; - - Transfer transfer_; - // Transfer buffer. - - ACE_UINT32 time_; - // Time -}; - - -#include "ace/post.h" -#endif /* ACE_TIME_REQUEST_REPLY_H */ diff --git a/ace/Time_Value.h b/ace/Time_Value.h deleted file mode 100644 index 4ac2bed868d..00000000000 --- a/ace/Time_Value.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Time_Value.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_TIME_VALUE_H -#define ACE_TIME_VALUE_H -#include "ace/pre.h" - -// This file is no longer used and is only here due to backwards -// compatibility. All the functionality has been merged into OS.h. - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/post.h" -#endif /* ACE_TIME_VALUE */ diff --git a/ace/Timeprobe.cpp b/ace/Timeprobe.cpp deleted file mode 100644 index cdfdb116913..00000000000 --- a/ace/Timeprobe.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// $Id$ - -#include "ace/OS.h" - -ACE_RCSID(ace, Timeprobe, "$Id$") - -#if defined (ACE_COMPILE_TIMEPROBES) - -#include "ace/Timeprobe.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Timeprobe.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Timeprobe; -template class ACE_Function_Timeprobe >; -template class ACE_Unbounded_Set_Iterator; -template class ACE_Unbounded_Set; -template class ACE_Node; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Timeprobe -#pragma instantiate ACE_Function_Timeprobe > -#pragma instantiate ACE_Unbounded_Set_Iterator -#pragma instantiate ACE_Unbounded_Set -#pragma instantiate ACE_Node -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - -# if defined (ACE_TSS_TIMEPROBES) -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_TSS_Singleton; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_TSS_Singleton -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -# else /* ACE_TSS_TIMEPROBES */ -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Singleton; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Singleton -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -# endif /* ACE_TSS_TIMEPROBES */ - -#endif /* ACE_COMPILE_TIMEPROBES */ - diff --git a/ace/Timeprobe.h b/ace/Timeprobe.h deleted file mode 100644 index 5070a863a14..00000000000 --- a/ace/Timeprobe.h +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timeprobe.h -// -// = AUTHOR -// Irfan Pyarali -// -// = ADDITIONAL COMMENTS -// -// If users want to use time probes, the ACE_COMPILE_TIMEPROBES -// flag must be defined when compiling ACE. This can be achieved -// by doing one of the following: -// -// . Use make probe = 1, if you are using the make utility. -// -// . Define ACE_COMPILE_TIMEPROBES in config.h -// -// . Define ACE_COMPILE_TIMEPROBES in the VC project file. -// -// . Other regular methods will also work. -// -// It is not necessary to define ACE_COMPILE_TIMEPROBES when using -// time probes, you simply need ACE_ENABLE_TIMEPROBES. You can use -// the ACE_TIMEPROBE_* macros to program the time probes, and use -// the ACE_ENABLE_TIMEPROBE to enable the time probes. If you -// define ACE_ENABLE_TIMEPROBE in your code, but forget to compile -// ACE with ACE_COMPILE_TIMEPROBES, you will end up with linker -// errors. -// -// Remember that ACE_COMPILE_TIMEPROBES means that the ACE library -// will contain code for time probes. This is only useful when -// compiling ACE. ACE_ENABLE_TIMEPROBES means that the -// ACE_TIMEPROBE_* macros should spring to life. -// -// ============================================================================ - -#ifndef ACE_TIMEPROBE_H -#define ACE_TIMEPROBE_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_ENABLE_TIMEPROBES) - #if !defined (ACE_COMPILE_TIMEPROBES) - #define ACE_COMPILE_TIMEPROBES - #endif /* ACE_COMPILE_TIMEPROBES */ -#endif /* ACE_ENABLE_TIMEPROBES */ - -#if defined (ACE_COMPILE_TIMEPROBES) - -class ACE_Export ACE_Event_Descriptions -{ - // = TITLE - // Event Descriptions. -public: - const char **descriptions_; - // Event descriptions - - u_long minimum_id_; - // Minimum id of this description set - - int operator== (const ACE_Event_Descriptions &rhs) const; - // Comparison -}; - -class ACE_Export ACE_timeprobe_t -{ - // = TITLE - // Time probe record. -public: - // = Events are record as strings or numbers. - union event - { - u_long event_number_; - const char *event_description_; - }; - - // = Type of event. - enum event_type - { - NUMBER, - STRING - }; - - event event_; - // Event. - - event_type event_type_; - // Type of event. - - ACE_hrtime_t time_; - // Timestamp. - - ACE_thread_t thread_; - // Id of thread posting the time probe. -}; - -#if defined (__ACE_INLINE__) -#include "ace/Timeprobe.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/Timeprobe_T.h" -#include "ace/Synch.h" -#include "ace/Singleton.h" - -// If ACE_MT_TIMEPROBES is defined, use a Thread_Mutex to lock the -// internal state of ACE_Timerprobe. This allows multiple threads to -// use the same ACE_Timerprobe. -# if defined (ACE_MT_TIMEPROBES) -typedef ACE_SYNCH_MUTEX ACE_TIMEPROBE_MUTEX; -# else /* ACE_MT_TIMEPROBES */ -typedef ACE_SYNCH_NULL_MUTEX ACE_TIMEPROBE_MUTEX; -# endif /* ACE_MT_TIMEPROBES */ - -typedef ACE_Timeprobe - ACE_TIMEPROBE_WITH_LOCKING; - -// If ACE_TSS_TIMEPROBES is defined, store the ACE_Timeprobe singleton -// in thread specific storage. This allows multiple threads to use -// their own instance of ACE_Timerprobe, without interfering with each -// other. -# if defined (ACE_TSS_TIMEPROBES) -#define ACE_TIMEPROBE_SINGLETON_DEFINE \ - ACE_TSS_Singleton; -typedef ACE_TSS_Singleton - ACE_TIMEPROBE_SINGLETON; -# else /* ACE_TSS_TIMEPROBES */ -#define ACE_TIMEPROBE_SINGLETON_DEFINE \ - ACE_Singleton; -typedef ACE_Singleton - ACE_TIMEPROBE_SINGLETON; -# endif /* ACE_TSS_TIMEPROBES */ - -#if defined (_MSC_VER) -// Disable warning of using Microsoft Extension. -#pragma warning(disable:4231) -#endif /* _MSC_VER */ - -ACE_SINGLETON_DECLARATION (ACE_TIMEPROBE_SINGLETON_DEFINE); - -#if defined (_MSC_VER) -// Default back the warning of using Microsoft Extension. -#pragma warning(default:4231) -#endif /* _MSC_VER */ - -#endif /* ACE_COMPILE_TIMEPROBES */ - -// If ACE_ENABLE_TIMEPROBES is defined, the macros below will -// work. Otherwise, they just vanish. Using this macro, you can -// control which files/libraries are probed. -#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES) - -# define ACE_TIMEPROBE_RESET ACE_TIMEPROBE_SINGLETON::instance ()->reset () -# define ACE_TIMEPROBE(id) ACE_TIMEPROBE_SINGLETON::instance ()->timeprobe (id) -# define ACE_TIMEPROBE_PRINT ACE_TIMEPROBE_SINGLETON::instance ()->print_times () -# define ACE_TIMEPROBE_PRINT_ABSOLUTE ACE_TIMEPROBE_SINGLETON::instance ()->print_absolute_times () -# define ACE_TIMEPROBE_EVENT_DESCRIPTIONS(descriptions, minimum_id) static int ace_timeprobe_##descriptions##_return = ACE_TIMEPROBE_SINGLETON::instance ()->event_descriptions (descriptions, minimum_id) -# define ACE_FUNCTION_TIMEPROBE(X) ACE_Function_Timeprobe function_timeprobe (*ACE_TIMEPROBE_SINGLETON::instance (), X) - -#else /* ACE_ENABLE_TIMEPROBES && ACE_COMPILE_TIMEPROBES */ - -# define ACE_TIMEPROBE_RESET -# define ACE_TIMEPROBE(id) -# define ACE_TIMEPROBE_PRINT -# define ACE_TIMEPROBE_PRINT_ABSOLUTE -# define ACE_TIMEPROBE_EVENT_DESCRIPTIONS(descriptions, minimum_id) -# define ACE_FUNCTION_TIMEPROBE(X) - -#endif /* ACE_ENABLE_TIMEPROBES && ACE_COMPILE_TIMEPROBES */ -#include "ace/post.h" -#endif /* ACE_TIMEPROBE_H */ diff --git a/ace/Timeprobe.i b/ace/Timeprobe.i deleted file mode 100644 index 31f022f77b4..00000000000 --- a/ace/Timeprobe.i +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -ACE_INLINE int -ACE_Event_Descriptions::operator== (const ACE_Event_Descriptions &rhs) const -{ - return this->minimum_id_ == rhs.minimum_id_ && - this->descriptions_ == rhs.descriptions_; -} diff --git a/ace/Timeprobe_T.cpp b/ace/Timeprobe_T.cpp deleted file mode 100644 index 395ebbceb3f..00000000000 --- a/ace/Timeprobe_T.cpp +++ /dev/null @@ -1,300 +0,0 @@ -// $Id$ - -#ifndef ACE_TIMEPROBE_T_C -#define ACE_TIMEPROBE_T_C - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(ace, Timeprobe_T, "$Id$") - -#if defined (ACE_COMPILE_TIMEPROBES) - -#include "ace/Timeprobe.h" -#include "ace/High_Res_Timer.h" - -template -ACE_Timeprobe::ACE_Timeprobe (u_long size) - : timeprobes_ (0), - lock_ (), - max_size_ (size), - current_size_ (0) -{ - ACE_NEW (this->timeprobes_, - ACE_timeprobe_t[this->max_size_]); - -#if defined (VXWORKS) - if (sysProcNumGet () == 0) - this->current_slot_vme_address_ = (u_int *) 0xDa010000; - else - this->current_slot_vme_address_ = (u_int *) 0xD8010000; -#endif /* VXWORKS */ -} - -template -ACE_Timeprobe::ACE_Timeprobe (const ACE_Timeprobe &) -{ - // - // Stupid MSVC is forcing me to define this; please don't use it. - // - - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_NOTSUP: %s, line %d\n"), __FILE__, __LINE__)); - errno = ENOTSUP; -} - -template -ACE_Timeprobe::~ACE_Timeprobe (void) -{ - delete [] this->timeprobes_; -} - -template void -ACE_Timeprobe::timeprobe (u_long event) -{ - ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); - - ACE_ASSERT (this->current_size_ < this->max_size_); - - this->timeprobes_[this->current_size_].event_.event_number_ = event; - this->timeprobes_[this->current_size_].event_type_ = ACE_timeprobe_t::NUMBER; - this->timeprobes_[this->current_size_].time_ = ACE_OS::gethrtime (); - this->timeprobes_[this->current_size_].thread_ = ACE_OS::thr_self (); - - this->current_size_++; - -#if defined (VMETRO_TIME_TEST) && (VXWORKS) - // If we are using the VMETRO board to get time samples, then write - // to the other boards VME address. - *this->current_slot_vme_address_ = event; -#endif /* VMETRO_TIME_TEST && VXWORKS */ -} - -template void -ACE_Timeprobe::timeprobe (const char *event) -{ - ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); - - ACE_ASSERT (this->current_size_ < this->max_size_); - - this->timeprobes_[this->current_size_].event_.event_description_ = event; - this->timeprobes_[this->current_size_].event_type_ = ACE_timeprobe_t::STRING; - this->timeprobes_[this->current_size_].time_ = ACE_OS::gethrtime (); - this->timeprobes_[this->current_size_].thread_ = ACE_OS::thr_self (); - - this->current_size_++; -} - -template void -ACE_Timeprobe::reset (void) -{ - ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); - - this->current_size_ = 0; -} - -template ACE_Unbounded_Set & -ACE_Timeprobe::event_descriptions (void) -{ - return this->event_descriptions_; -} - -template ACE_Unbounded_Set & -ACE_Timeprobe::sorted_event_descriptions (void) -{ - return this->sorted_event_descriptions_; -} - -template u_int * -ACE_Timeprobe::current_slot_vme_address (void) -{ - return this->current_slot_vme_address_; -} - -template ACE_timeprobe_t * -ACE_Timeprobe::timeprobes (void) -{ - return this->timeprobes_; -} - -template ACE_LOCK & -ACE_Timeprobe::lock (void) -{ - return this->lock_; -} - -template u_long -ACE_Timeprobe::max_size (void) -{ - return this->max_size_; -} - -template u_long -ACE_Timeprobe::current_size (void) -{ - return this->current_size_; -} - -template int -ACE_Timeprobe::event_descriptions (const char **descriptions, - u_long minimum_id) -{ - ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - - ACE_Event_Descriptions events; - events.descriptions_ = descriptions; - events.minimum_id_ = minimum_id; - - this->event_descriptions_.insert (events); - - return 0; -} - -template void -ACE_Timeprobe::print_times (void) -{ - ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); - - // Sort the event descriptions - this->sort_event_descriptions_i (); - - ACE_DEBUG ((LM_DEBUG, - "\nACE_Timeprobe; %d timestamps were recorded:\n", - this->current_size_)); - - if (this->current_size_ == 0) - return; - - ACE_DEBUG ((LM_DEBUG, - "\n%-50.50s %8.8s %13.13s\n\n", - "Event", - "thread", - "usec")); - - ACE_DEBUG ((LM_DEBUG, - "%-50.50s %8.8x %13.13s\n", - this->find_description_i (0), - this->timeprobes_[0].thread_, - "START")); - - ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); - for (u_long i = 1; i < this->current_size_; i++) - { - ACE_hrtime_t time_difference = - this->timeprobes_[i].time_ - this->timeprobes_[i-1].time_; - - ACE_UINT32 elapsed_time_in_micro_seconds = - (ACE_UINT32) (time_difference / gsf); - ACE_UINT32 remainder = - (ACE_UINT32) (time_difference % gsf); - // Convert to the fractional part in microseconds, with 3 digits - // of precision (hence the 1000). - ACE_UINT32 fractional = remainder * 1000 / gsf; - - ACE_DEBUG ((LM_DEBUG, - "%-50.50s %8.8x %10u.%03.3u\n", - this->find_description_i (i), - this->timeprobes_[i].thread_, - (unsigned int) elapsed_time_in_micro_seconds, - (unsigned int) fractional)); - } -} - -template void -ACE_Timeprobe::print_absolute_times (void) -{ - ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); - - // Sort the event descriptions - this->sort_event_descriptions_i (); - - ACE_DEBUG ((LM_DEBUG, - "\nACE_Timeprobe; %d timestamps were recorded:\n", - this->current_size_)); - - if (this->current_size_ == 0) - return; - - ACE_DEBUG ((LM_DEBUG, - "\n%-50.50s %8.8s %13.13s\n\n", - "Event", - "thread", - "stamp")); - - for (u_long i = 0; i < this->current_size_; i++) - { - char buf[64]; - ACE_OS::sprintf (buf, "%llu", this->timeprobes_[i].time_); - ACE_DEBUG ((LM_DEBUG, - "%-50.50s %8.8x %13.13s\n", - this->find_description_i (i), - this->timeprobes_[i].thread_, - buf)); - } -} - -template const char * -ACE_Timeprobe::find_description_i (u_long i) -{ - if (this->timeprobes_[i].event_type_ == ACE_timeprobe_t::STRING) - return this->timeprobes_[i].event_.event_description_; - else - { - EVENT_DESCRIPTIONS::iterator iterator = this->sorted_event_descriptions_.begin (); - for (u_long j = 0; - j < this->sorted_event_descriptions_.size () - 1; - iterator++, j++) - { - EVENT_DESCRIPTIONS::iterator next_event_descriptions = iterator; - next_event_descriptions++; - - if (this->timeprobes_[i].event_.event_number_ < (*next_event_descriptions).minimum_id_) - break; - } - return (*iterator).descriptions_[this->timeprobes_[i].event_.event_number_ - (*iterator).minimum_id_]; - } -} - -template void -ACE_Timeprobe::sort_event_descriptions_i (void) -{ - size_t total_elements = this->event_descriptions_.size (); - - for (size_t i = 0; - i < total_elements; - i++) - { - EVENT_DESCRIPTIONS::iterator iterator = this->event_descriptions_.begin (); - ACE_Event_Descriptions min_entry = *iterator; - - for (; - iterator != this->event_descriptions_.end (); - iterator++) - if ((*iterator).minimum_id_ < min_entry.minimum_id_) - min_entry = *iterator; - - this->sorted_event_descriptions_.insert (min_entry); - this->event_descriptions_.remove (min_entry); - } -} - -template -ACE_Function_Timeprobe::ACE_Function_Timeprobe (Timeprobe &timeprobe, - u_long event) - : timeprobe_ (timeprobe), - event_ (event) -{ - this->timeprobe_.timeprobe (this->event_); -} - -template -ACE_Function_Timeprobe::~ACE_Function_Timeprobe (void) -{ - this->timeprobe_.timeprobe (this->event_ + 1); -} - -#endif /* ACE_COMPILE_TIMEPROBES */ -#endif /* ACE_TIMEPROBE_T_C */ diff --git a/ace/Timeprobe_T.h b/ace/Timeprobe_T.h deleted file mode 100644 index 3850020415a..00000000000 --- a/ace/Timeprobe_T.h +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#ifndef ACE_TIMEPROBE_T_H -#define ACE_TIMEPROBE_T_H -#include "ace/pre.h" - -#include "ace/OS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_COMPILE_TIMEPROBES) - -#include "ace/Containers.h" - -template -class ACE_Timeprobe -{ - // = TITLE - // This class is used to instrument code. This is accomplished - // by inserting time probes at different location in the code. - // ACE_Timeprobe then measures the time difference between two - // time probes. - // - // = DESCRIPTION - // This class provides a lightweight implementation for - // measuring the time required to execute code between two time - // probes. When a time probe executes, it records the time, the - // id of the calling thread, and an event description. The - // event description can either be an unsigned long or a string - // (char *). If string are used, care must be taken cause only - // pointer copies are done and the string data is *not* copied. - // - // The recorded time probes can then be printed by calling - // . If you have used unsigned longs as event - // descriptions in any of your time probes, you must have - // provided an event description table that maps the unsigned - // longs to readable strings. This map is a simple array of - // strings, and the event number is used as the index into the - // array when looking for the event description. If you have - // only used strings for the event description, this map is not - // necessary. - // - // Multiple maps can also be used to chunk up the time probes. - // Each one can be added by calling . - // Different tables are used internally by consulting the - // minimum_id for each table. It is up to the user to make sure - // that multiple tables do not share the same event id range. -public: - - typedef ACE_Timeprobe - SELF; - // Self - - typedef ACE_Unbounded_Set - EVENT_DESCRIPTIONS; - // We can hold multiple event description tables. - - ACE_Timeprobe (u_long size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE); - // Create Timeprobes with slots - - ~ACE_Timeprobe (void); - // Destructor. - - void timeprobe (u_long event); - // Record a time. is used to describe this time probe. - - void timeprobe (const char *id); - // Record a time. is used to describe this time probe. - - int event_descriptions (const char **descriptions, - u_long minimum_id); - // Record event descriptions. - - void print_times (void); - // Print the time probes. - - void print_absolute_times (void); - // Print the time probes. - - void reset (void); - // Reset the slots. All old time probes will be lost. - - ACE_Timeprobe (const ACE_Timeprobe &); - // Not implemented (stupid MSVC won't let it be protected). - - // = (Somewhat private) Accessors - - ACE_Unbounded_Set &event_descriptions (void); - // Event Descriptions - - ACE_Unbounded_Set &sorted_event_descriptions (void); - // Sorted Event Descriptions. - - u_int *current_slot_vme_address (void); - // VME slot address. - - const char *find_description_i (u_long i); - // Find description of event - - void sort_event_descriptions_i (void); - // Sort event descriptions - - ACE_timeprobe_t *timeprobes (void); - // Time probe slots - - ACE_LOCK &lock (void); - // Synchronization variable. - - u_long max_size (void); - // Max size of timestamp table - - u_long current_size (void); - // Current size of timestamp table - -protected: - - EVENT_DESCRIPTIONS event_descriptions_; - // Event Descriptions - - EVENT_DESCRIPTIONS sorted_event_descriptions_; - // Sorted Event Descriptions. - - u_int *current_slot_vme_address_; - // Added sections below here to make compatible with the VMETRO - // board test. - - ACE_timeprobe_t *timeprobes_; - // Time probe slots - - ACE_LOCK lock_; - // Synchronization variable. - - u_long max_size_; - // Max size of timestamp table - - u_long current_size_; - // Current size of timestamp table -}; - -template -class ACE_Function_Timeprobe -{ - // = TITLE - // Auto pointer like time probes. It will record on - // construction and on destruction. -public: - ACE_Function_Timeprobe (Timeprobe &timeprobe, - u_long event); - // Constructor. - - ~ACE_Function_Timeprobe (void); - // Destructor. - -protected: - Timeprobe &timeprobe_; - // Reference to timeprobe. - - u_long event_; - // Event. -}; - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Timeprobe_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timeprobe_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_COMPILE_TIMEPROBES */ -#include "ace/post.h" -#endif /* ACE_TIMEPROBE_T_H */ diff --git a/ace/Timer_Hash.cpp b/ace/Timer_Hash.cpp deleted file mode 100644 index a37df2e2fb4..00000000000 --- a/ace/Timer_Hash.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// $Id$ - -// Timer_Hash.cpp - -#if !defined (ACE_TIMER_HASH_C) -#define ACE_TIMER_HASH_C - -#include "ace/Timer_Hash.h" - -#if defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) -#include "ace/Timer_Hash_T.cpp" -#endif /* ACE_HAS_BROKEN_HPUX_TEMPLATES */ - -ACE_RCSID(ace, Timer_Hash, "$Id$") - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Free_List >; -template class ACE_Locked_Free_List, - ACE_Null_Mutex>; -template class ACE_Timer_Hash_Upcall , - ACE_SYNCH_RECURSIVE_MUTEX>; - -template class ACE_Timer_Queue_T ; - -template class ACE_Timer_Queue_Iterator_T ; - -template class ACE_Timer_List_T ; - -template class ACE_Timer_List_Iterator_T ; - -template class ACE_Timer_Heap_T ; - -template class ACE_Timer_Heap_Iterator_T ; - -template class ACE_Timer_Hash_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_List>; - -template class ACE_Timer_Hash_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_List>; - -template class ACE_Timer_Hash_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_Heap>; - -template class ACE_Timer_Hash_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_Heap>; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Free_List > -#pragma instantiate ACE_Locked_Free_List, \ - ACE_Null_Mutex> -#pragma instantiate ACE_Timer_Hash_Upcall , \ - ACE_SYNCH_RECURSIVE_MUTEX> - -#pragma instantiate ACE_Timer_Queue_T - -#pragma instantiate ACE_Timer_Queue_Iterator_T - -#pragma instantiate ACE_Timer_List_T - -#pragma instantiate ACE_Timer_List_Iterator_T - -#pragma instantiate ACE_Timer_Heap_T - -#pragma instantiate ACE_Timer_Heap_Iterator_T - -#pragma instantiate ACE_Timer_Hash_T, \ - ACE_SYNCH_RECURSIVE_MUTEX, \ - ACE_Hash_Timer_List> - -#pragma instantiate ACE_Timer_Hash_Iterator_T, \ - ACE_SYNCH_RECURSIVE_MUTEX, \ - ACE_Hash_Timer_List> - -#pragma instantiate ACE_Timer_Hash_T, \ - ACE_SYNCH_RECURSIVE_MUTEX, \ - ACE_Hash_Timer_Heap> - -#pragma instantiate ACE_Timer_Hash_Iterator_T, \ - ACE_SYNCH_RECURSIVE_MUTEX, \ - ACE_Hash_Timer_Heap> - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - -#endif /* ACE_TIMER_HASH_C */ diff --git a/ace/Timer_Hash.h b/ace/Timer_Hash.h deleted file mode 100644 index c86d3bd1730..00000000000 --- a/ace/Timer_Hash.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_Hash.h -// -// = AUTHOR -// Darrell Brunsch -// -// ============================================================================ - -#ifndef ACE_TIMER_HASH_H -#define ACE_TIMER_HASH_H -#include "ace/pre.h" - -#include "ace/Timer_Hash_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Timer_Heap_T.h" -#include "ace/Timer_List_T.h" - -// The following typedef are here for ease of use - -typedef ACE_Timer_Hash_Upcall , - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Hash_Upcall; - -typedef ACE_Timer_List_T - ACE_Hash_Timer_List; - -typedef ACE_Timer_Heap_T - ACE_Hash_Timer_Heap; - - -typedef ACE_Timer_Hash_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_List> - - ACE_Timer_Hash; - -typedef ACE_Timer_Hash_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_List> - ACE_Timer_Hash_Iterator; - -typedef ACE_Timer_Hash_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_Heap> - ACE_Timer_Hash_Heap; - -typedef ACE_Timer_Hash_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX, - ACE_Hash_Timer_Heap> - ACE_Timer_Hash_Heap_Iterator; - -#include "ace/post.h" -#endif /* ACE_TIMER_HASH_H */ diff --git a/ace/Timer_Hash_T.cpp b/ace/Timer_Hash_T.cpp deleted file mode 100644 index 85134f9f779..00000000000 --- a/ace/Timer_Hash_T.cpp +++ /dev/null @@ -1,609 +0,0 @@ -// $Id$ - -#ifndef ACE_TIMER_HASH_T_C -#define ACE_TIMER_HASH_T_C - -#include "ace/Timer_Hash_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/High_Res_Timer.h" - -ACE_RCSID(ace, Timer_Hash_T, "$Id$") - -struct Hash_Token -{ - Hash_Token (const void *act, - size_t pos, - long orig_id) - : act_ (act), - pos_ (pos), - orig_id_ (orig_id) - {} - - const void *act_; - size_t pos_; - long orig_id_; -}; - -// Default constructor - -template -ACE_Timer_Hash_Upcall::ACE_Timer_Hash_Upcall (void) - : timer_hash_ (0) -{ - // Nothing -} - -// Constructor that specifies a Timer_Hash to call up to - -template -ACE_Timer_Hash_Upcall::ACE_Timer_Hash_Upcall (ACE_Timer_Queue_T *timer_hash) - : timer_hash_ (timer_hash) -{ - // Nothing -} - -// Calls up to timer_hash's upcall functor - -template int -ACE_Timer_Hash_Upcall::timeout (ACE_Timer_Queue_T, - ACE_Null_Mutex> &timer_queue, - ACE_Event_Handler *handler, - const void *arg, - const ACE_Time_Value &cur_time) -{ - ACE_UNUSED_ARG (timer_queue); - - Hash_Token *h = ACE_reinterpret_cast (Hash_Token *, - ACE_const_cast (void *, - arg)); - int result = - this->timer_hash_->upcall_functor ().timeout (*this->timer_hash_, - handler, - h->act_, - cur_time); - delete h; - return result; -} - - -// Calls up to timer_hash's upcall functor - -template int -ACE_Timer_Hash_Upcall::cancellation (ACE_Timer_Queue_T, - ACE_Null_Mutex> &timer_queue, - ACE_Event_Handler *handler) -{ - ACE_UNUSED_ARG (timer_queue); - return this->timer_hash_->upcall_functor ().cancellation (*this->timer_hash_, - handler); -} - - -// Calls up to timer_hash's upcall functor - -template int -ACE_Timer_Hash_Upcall::deletion (ACE_Timer_Queue_T, - ACE_Null_Mutex> &timer_queue, - ACE_Event_Handler *handler, - const void *arg) -{ - ACE_UNUSED_ARG (timer_queue); - - Hash_Token *h = ACE_reinterpret_cast (Hash_Token *, - ACE_const_cast (void *, - arg)); - int result = - this->timer_hash_->upcall_functor ().deletion (*this->timer_hash_, - handler, - h->act_); - delete h; - return result; -} - - - -template -ACE_Timer_Hash_Iterator_T::ACE_Timer_Hash_Iterator_T (ACE_Timer_Hash_T &hash) - : timer_hash_ (hash) -{ - this->first (); - // Nothing -} - -// Positions the iterator at the first node in the timing hash table - -template void -ACE_Timer_Hash_Iterator_T::first (void) -{ - for (this->position_ = 0; - this->position_ < this->timer_hash_.table_size_; - this->position_++) - { - // Check for an empty entry - if (!this->timer_hash_.table_[this->position_]->is_empty ()) - { - this->iter_ = &this->timer_hash_.table_[this->position_]->iter (); - this->iter_->first (); - return; - } - } - - // Didn't find any - this->iter_ = 0; -} - -// Positions the iterator at the next node in the bucket or goes to the next -// bucket - -template void -ACE_Timer_Hash_Iterator_T::next (void) -{ - if (this->isdone ()) - return; - - // If there is no more in the current bucket, go to the next - if (this->iter_->isdone ()) - { - for (this->position_++; - this->position_ < this->timer_hash_.table_size_; - this->position_++) - { - // Check for an empty entry - if (!this->timer_hash_.table_[this->position_]->is_empty ()) - { - this->iter_ = &this->timer_hash_.table_[this->position_]->iter (); - this->iter_->first (); - return; - } - } - - // Didn't find any. - this->iter_ = 0; - } - else - this->iter_->next (); -} - -// Returns true when we are at the end (when bucket_item_ == 0) - -template int -ACE_Timer_Hash_Iterator_T::isdone (void) -{ - return this->iter_ == 0; -} - -// Returns the node at the current position in the sequence - -template ACE_Timer_Node_T * -ACE_Timer_Hash_Iterator_T::item (void) -{ - if (this->isdone ()) - return 0; - - return this->iter_->item (); -} - -template ACE_Timer_Queue_Iterator_T & -ACE_Timer_Hash_T::iter (void) -{ - this->iterator_->first (); - return *this->iterator_; -} - -// Create an empty queue. - -template -ACE_Timer_Hash_T::ACE_Timer_Hash_T (size_t table_size, - FUNCTOR *upcall_functor, - ACE_Free_List > *freelist) - : ACE_Timer_Queue_T (upcall_functor, freelist), - size_ (0), - table_ (new BUCKET *[table_size]), - table_size_ (table_size), - table_functor_ (this), - earliest_position_ (0) -{ - ACE_TRACE ("ACE_Timer_Hash_T::ACE_Timer_Hash_T"); - - this->gettimeofday (ACE_OS::gettimeofday); - - for (size_t i = 0; - i < table_size; - i++) - { - ACE_NEW (this->table_[i], - BUCKET (&this->table_functor_, - this->free_list_)); - this->table_[i]->gettimeofday (ACE_OS::gettimeofday); - } - - ACE_NEW (iterator_, - HASH_ITERATOR (*this)); -} - - -template -ACE_Timer_Hash_T::ACE_Timer_Hash_T (FUNCTOR *upcall_functor, - ACE_Free_List > *freelist) - : ACE_Timer_Queue_T (upcall_functor, freelist), - size_ (0), - table_ (new BUCKET *[ACE_DEFAULT_TIMER_HASH_TABLE_SIZE]), - table_size_ (ACE_DEFAULT_TIMER_HASH_TABLE_SIZE), - table_functor_ (this), - earliest_position_ (0) -{ - ACE_TRACE ("ACE_Timer_Hash_T::ACE_Timer_Hash_T"); - - this->gettimeofday (ACE_OS::gettimeofday); - - for (size_t i = 0; - i < this->table_size_; - i++) - { - ACE_NEW (this->table_[i], - BUCKET (&this->table_functor_, - this->free_list_)); - this->table_[i]->gettimeofday (ACE_OS::gettimeofday); - } - - ACE_NEW (iterator_, - HASH_ITERATOR (*this)); -} - -// Remove all remaining items in the Queue. - -template -ACE_Timer_Hash_T::~ACE_Timer_Hash_T (void) -{ - ACE_TRACE ("ACE_Timer_Hash_T::~ACE_Timer_Hash_T"); - ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_)); - - delete iterator_; - - for (size_t i = 0; - i < this->table_size_; - i++) - delete this->table_[i]; - - delete [] this->table_; -} - -// Checks if queue is empty. - -template int -ACE_Timer_Hash_T::is_empty (void) const -{ - ACE_TRACE ("ACE_Timer_Hash_T::is_empty"); - return this->table_[this->earliest_position_]->is_empty (); -} - -// Returns earliest time in a non-empty bucket - -template const ACE_Time_Value & -ACE_Timer_Hash_T::earliest_time (void) const -{ - ACE_TRACE ("ACE_Timer_Hash_T::earliest_time"); - return this->table_[this->earliest_position_]->earliest_time (); -} - -template void -ACE_Timer_Hash_T::dump (void) const -{ - ACE_TRACE ("ACE_Timer_Hash_T::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntable_size_ = %d"), this->table_size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nearliest_position_ = %d"), this->earliest_position_)); - - for (size_t i = 0; i < this->table_size_; i++) - if (!this->table_[i]->is_empty ()) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nBucket %d contains nodes"), i)); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// Reschedule a periodic timer. This function must be called with the -// mutex lock held. - -template void -ACE_Timer_Hash_T::reschedule (ACE_Timer_Node_T *expired) -{ - ACE_TRACE ("ACE_Timer_Hash_T::reschedule"); - - size_t position = - expired->get_timer_value ().usec () % this->table_size_; - - Hash_Token *h = ACE_reinterpret_cast (Hash_Token *, - ACE_const_cast (void *, - expired->get_act ())); - - h->orig_id_ = this->table_[position]->schedule (expired->get_type (), - h, - expired->get_timer_value (), - expired->get_interval ()); - - if (this->table_[this->earliest_position_]->is_empty () - || this->table_[position]->earliest_time () - < this->table_[this->earliest_position_]->earliest_time ()) - this->earliest_position_ = position; -} - -// Insert a new handler that expires at time future_time; if interval -// is > 0, the handler will be reinvoked periodically. - -template long -ACE_Timer_Hash_T::schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Timer_Hash_T::schedule"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - size_t position = - future_time.usec () % this->table_size_; - - Hash_Token *h; - - ACE_NEW_RETURN (h, - Hash_Token (act, - position, - 0), - -1); - - h->orig_id_ = this->table_[position]->schedule (type, - h, - future_time, - interval); - - if (this->table_[this->earliest_position_]->is_empty () - || this->table_[position]->earliest_time () - < this->table_[this->earliest_position_]->earliest_time ()) - this->earliest_position_ = position; - - ++this->size_; - - return ACE_reinterpret_cast (long, - h); -} - -// Locate and update the inteval on the timer_id - -template int -ACE_Timer_Hash_T::reset_interval (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Timer_Hash_T::reset_interval"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - // Make sure we are getting a valid , not an error - // returned by . - if (timer_id == -1) - return -1; - - Hash_Token *h = ACE_reinterpret_cast (Hash_Token *, - timer_id); - - return this->table_[h->pos_]->reset_interval (h->orig_id_, - interval); -} - -// Locate and remove the single with a value of -// from the correct table timer queue. - -template int -ACE_Timer_Hash_T::cancel (long timer_id, - const void **act, - int dont_call) -{ - ACE_TRACE ("ACE_Timer_Hash_T::cancel"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - // Make sure we are getting a valid , not an error - // returned by . - if (timer_id == -1) - return 0; - - Hash_Token *h = ACE_reinterpret_cast (Hash_Token *, - timer_id); - - int result = this->table_[h->pos_]->cancel (h->orig_id_, - act, - dont_call); - - if (h->pos_ == this->earliest_position_) - this->find_new_earliest (); - - if (act != 0) - *act = h->act_; - - delete h; - - --this->size_; - - return result; -} - -// Locate and remove all values of from the timer queue. - -template int -ACE_Timer_Hash_T::cancel (const TYPE &type, - int dont_call) -{ - ACE_TRACE ("ACE_Timer_Hash_T::cancel"); - - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - size_t i; // loop variable. - - Hash_Token **timer_ids; - - ACE_NEW_RETURN (timer_ids, - Hash_Token *[this->size_], - -1); - size_t pos = 0; - - for (i = 0; - i < this->table_size_; - i++) - { - ACE_Timer_Queue_Iterator_T, - ACE_Null_Mutex> &iter = - this->table_[i]->iter (); - - for (iter.first (); - !iter.isdone (); - iter.next ()) - if (iter.item ()->get_type () == type) - timer_ids[pos++] = - ACE_reinterpret_cast (Hash_Token *, - ACE_const_cast (void *, - iter.item ()->get_act ())); - } - - if (pos > this->size_) - return -1; - - for (i = 0; i < pos; i++) - { - this->table_[timer_ids[i]->pos_]->cancel (timer_ids[i]->orig_id_, - 0, - 1); - delete timer_ids[i]; - --this->size_; - } - - delete [] timer_ids; - - if (dont_call == 0) - this->upcall_functor ().cancellation (*this, - type); - this->find_new_earliest (); - - return pos; -} - -// Removes the earliest node and finds the new earliest position - -template ACE_Timer_Node_T * -ACE_Timer_Hash_T::remove_first (void) -{ - if (this->is_empty ()) - return 0; - - ACE_Timer_Node_T *temp = - this->table_[this->earliest_position_]->remove_first (); - - this->find_new_earliest (); - - --this->size_; - - return temp; -} - -// Finds a new earliest position - -template void -ACE_Timer_Hash_T::find_new_earliest (void) -{ - for (size_t i = 0; i < this->table_size_; i++) - if (!this->table_[i]->is_empty ()) - if (this->table_[this->earliest_position_]->is_empty () - || this->earliest_time () == ACE_Time_Value::zero - || this->table_[i]->earliest_time () <= this->earliest_time ()) - this->earliest_position_ = i; -} - -// Returns the earliest node without removing it - -template ACE_Timer_Node_T * -ACE_Timer_Hash_T::get_first (void) -{ - ACE_TRACE ("ACE_Timer_Hash_T::get_first"); - - if (this->is_empty ()) - return 0; - - return this->table_[this->earliest_position_]->get_first (); -} - -// Dummy version of expire to get rid of warnings in Sun CC 4.2 - -template int -ACE_Timer_Hash_T::expire () -{ - return ACE_Timer_Queue_T::expire(); -} - -// Specialized expire for Timer Hash - -template int -ACE_Timer_Hash_T::expire (const ACE_Time_Value &cur_time) -{ - ACE_TRACE ("ACE_Timer_Hash_T::expire"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - int number_of_timers_expired = 0; - - ACE_Timer_Node_T *expired; - - // Go through the table and expire anything that can be expired - - for (size_t i = 0; - i < this->table_size_; - i++) - { - while (!this->table_[i]->is_empty () - && this->table_[i]->earliest_time () <= cur_time) - { - expired = this->table_[i]->remove_first (); - --this->size_; - TYPE &type = expired->get_type (); - const void *act = expired->get_act (); - int reclaim = 1; - - // Check if this is an interval timer. - if (expired->get_interval () > ACE_Time_Value::zero) - { - // Make sure that we skip past values that have already - // "expired". - do - expired->set_timer_value (expired->get_timer_value () - + expired->get_interval ()); - while (expired->get_timer_value () <= cur_time); - - // Since this is an interval timer, we need to - // reschedule it. - this->reschedule (expired); - reclaim = 0; - } - - Hash_Token *h = ACE_reinterpret_cast (Hash_Token *, - ACE_const_cast (void *, - act)); - // Call the functor. - this->upcall (type, - h->act_, - cur_time); - if (reclaim) - { - // Free up the node and the token - this->free_node (expired); - delete h; - } - number_of_timers_expired++; - } - } - - return number_of_timers_expired; -} - -#endif /* ACE_TIMER_HASH_T_C */ diff --git a/ace/Timer_Hash_T.h b/ace/Timer_Hash_T.h deleted file mode 100644 index a35ff3cc2da..00000000000 --- a/ace/Timer_Hash_T.h +++ /dev/null @@ -1,264 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_Hash_T.h -// -// = AUTHOR -// Darrell Brunsch -// -// ============================================================================ - -#ifndef ACE_TIMER_HASH_T_H -#define ACE_TIMER_HASH_T_H -#include "ace/pre.h" - -#include "ace/Timer_Queue_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Free_List.h" - -// Forward declaration. -template -class ACE_Timer_Hash_T; - -template -class ACE_Timer_Hash_Upcall -{ - // = TITLE - // Functor for Timer_Hash - // - // = DESCRIPTION - // This class calls up to the Timer Hash's functor from the - // timer queues in the hash table -public: - typedef ACE_Timer_Queue_T, - ACE_Null_Mutex> - TIMER_QUEUE; - - ACE_Timer_Hash_Upcall (void); - // Default constructor (creates an invalid object, but needs to be here - // so timer queues using this functor can be constructed) - - ACE_Timer_Hash_Upcall (ACE_Timer_Queue_T *timer_hash); - // Constructor that specifies a Timer_Hash to call up to - - int timeout (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg, - const ACE_Time_Value &cur_time); - // This method is called when the timer expires - - int cancellation (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler); - // This method is called when the timer is canceled - - int deletion (TIMER_QUEUE &timer_queue, - ACE_Event_Handler *handler, - const void *arg); - // This method is called when the timer queue is destroyed and - // the timer is still contained in it - -private: - ACE_Timer_Queue_T *timer_hash_; - // Timer Queue to do the calling up to - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Hash_Upcall (const ACE_Timer_Hash_Upcall &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Hash_Upcall &)) -}; - -template -class ACE_Timer_Hash_Iterator_T : public ACE_Timer_Queue_Iterator_T -{ - // = TITLE - // Iterates over an . - // - // = DESCRIPTION - // This is a generic iterator that can be used to visit every - // node of a timer queue. Be aware that it doesn't transverse - // in the order of timeout values. -public: - ACE_Timer_Hash_Iterator_T (ACE_Timer_Hash_T &); - // Constructor. - - virtual void first (void); - // Positions the iterator at the earliest node in the Timer Queue - - virtual void next (void); - // Positions the iterator at the next node in the Timer Queue - - virtual int isdone (void); - // Returns true when there are no more nodes in the sequence - - virtual ACE_Timer_Node_T *item (void); - // Returns the node at the current position in the sequence - -protected: - ACE_Timer_Hash_T &timer_hash_; - // Pointer to the that we are iterating over. - - size_t position_; - // Current position in 's table - - ACE_Timer_Queue_Iterator_T, ACE_Null_Mutex> *iter_; - // Current iterator used on 's bucket -}; - -template -class ACE_Timer_Hash_T : public ACE_Timer_Queue_T -{ - // = TITLE - // Provides a hash table of s as an implementation for - // a timer queue. - // - // = DESCRIPTION - // This implementation uses a hash table of BUCKETs. The hash - // is based on the time_value of the event. Unlike other Timer - // Queues, ACE_Timer_Hash does not expire events in order. -public: - typedef ACE_Timer_Hash_Iterator_T - HASH_ITERATOR; - // Type of iterator - - friend class ACE_Timer_Hash_Iterator_T; - // Iterator is a friend - - typedef ACE_Timer_Queue_T INHERITED; - // Type inherited from - - // = Initialization and termination methods. - ACE_Timer_Hash_T (size_t table_size, - FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - // Default constructor. determines the size of the - // hash table. is the instance of the FUNCTOR - // to be used by the buckets. If is 0, a default - // FUNCTOR will be created. - - ACE_Timer_Hash_T (FUNCTOR *upcall_functor = 0, ACE_Free_List > *freelist = 0); - // Default constructor. is the instance of the - // FUNCTOR to be used by the queue. If is 0, Timer - // Hash will create a default FUNCTOR. the freelist of - // timer nodes. If 0, then a default freelist will be created. The default - // size will be ACE_DEFAULT_TIMERS and there will be no preallocation. - - virtual ~ACE_Timer_Hash_T (void); - // Destructor - - virtual int is_empty (void) const; - // True if queue is empty, else false. - - virtual const ACE_Time_Value &earliest_time (void) const; - // Returns the time of the earlier node in the . - - virtual long schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - // Schedule that will expire after amount of time, - // which is specified in absolute time. If it expires then is - // passed in as the value to the . If is != to - // then it is used to reschedule the - // automatically, using relative time to the current . - // This method returns a that is a pointer to a token - // which stores information about the event. This can be - // used to cancel the timer before it expires. Returns -1 on - // failure. - - virtual int reset_interval (long timer_id, - const ACE_Time_Value &interval); - // Resets the interval of the timer represented by to - // , which is specified in relative time to the current - // . If is equal to - // , the timer will become a non-rescheduling - // timer. Returns 0 if successful, -1 if not. - - virtual int cancel (const TYPE &type, - int dont_call_handle_close = 1); - // Cancel all timer associated with . If is 0 - // then the will be invoked. Returns number of timers - // cancelled. - - virtual int cancel (long timer_id, - const void **act = 0, - int dont_call_handle_close = 1); - // Cancel the single timer that matches the value (which - // was returned from the method). If act is non-NULL - // then it will be set to point to the ``magic cookie'' argument - // passed in when the timer was registered. This makes it possible - // to free up the memory and avoid memory leaks. If is - // 0 then the will be invoked. Returns 1 if cancellation - // succeeded and 0 if the wasn't found. - - virtual int expire (void); - // Run the for all timers whose values are <= - // . Also accounts for . Returns - // the number of timers canceled. - - virtual int expire (const ACE_Time_Value ¤t_time); - // Run the for all timers whose values are <= . - // This does not account for . Returns the number of - // timers canceled. - - virtual ACE_Timer_Queue_Iterator_T &iter (void); - // Returns a pointer to this 's iterator. - - virtual ACE_Timer_Node_T *remove_first (void); - // Removes the earliest node from the queue and returns it - - virtual void dump (void) const; - // Dump the state of an object. - - virtual ACE_Timer_Node_T *get_first (void); - // Reads the earliest node from the queue and returns it. - -private: - virtual void reschedule (ACE_Timer_Node_T *); - // Reschedule an "interval" . - - void find_new_earliest (void); - // Finds the earliest node - - size_t size_; - // Keeps track of the size of the queue - - BUCKET **table_; - // Table of BUCKETS - - size_t table_size_; - // Keeps track of the size of - - ACE_Timer_Hash_Upcall table_functor_; - // Functor used for the table's timer queues - - size_t earliest_position_; - // Index to the position with the earliest entry - - HASH_ITERATOR *iterator_; - // Iterator used to expire timers. - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Hash_T (const ACE_Timer_Hash_T &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Hash_T &)) -}; - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) && !defined(ACE_HAS_BROKEN_HPUX_TEMPLATES) -#include "ace/Timer_Hash_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE && !ACE_HAS_BROKEN_HPUX_TEMPLATES */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timer_Hash_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_TIMER_HASH_T_H */ diff --git a/ace/Timer_Heap.cpp b/ace/Timer_Heap.cpp deleted file mode 100644 index 8132c874f10..00000000000 --- a/ace/Timer_Heap.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// $Id$ - -#if !defined (ACE_TIMER_HEAP_C) -#define ACE_TIMER_HEAP_C - -#include "ace/Timer_Heap.h" - -ACE_RCSID(ace, Timer_Heap, "$Id$") - -#if defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) -#include "ace/Timer_Hash.h" -#include "ace/Timer_Heap_T.cpp" -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class - ACE_Timer_Heap_T< - ACE_Event_Handler*, - ACE_Timer_Hash_Upcall< - ACE_Event_Handler*, - ACE_Event_Handler_Handle_Timeout_Upcall, - ACE_Null_Mutex>, - ACE_Null_Mutex>; - -template class - ACE_Timer_Heap_Iterator_T< - ACE_Event_Handler*, - ACE_Timer_Hash_Upcall< - ACE_Event_Handler*, - ACE_Event_Handler_Handle_Timeout_Upcall, - ACE_Null_Mutex>, - ACE_Null_Mutex>; -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_HAS_BROKEN_HPUX_TEMPLATES */ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Timer_Heap_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_Heap_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Timer_Heap_T, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Timer_Heap_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - -#endif /* ACE_TIMER_HEAP_C */ diff --git a/ace/Timer_Heap.h b/ace/Timer_Heap.h deleted file mode 100644 index dcaabc00051..00000000000 --- a/ace/Timer_Heap.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_Heap.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_TIMER_HEAP_H -#define ACE_TIMER_HEAP_H -#include "ace/pre.h" - -#include "ace/Timer_Heap_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// The following typedef are here for ease of use and backward -// compatibility. - -typedef ACE_Timer_Heap_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Heap; - -typedef ACE_Timer_Heap_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Heap_Iterator; - -#include "ace/post.h" -#endif /* ACE_TIMER_HEAP_H */ diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp deleted file mode 100644 index 199fcef1cab..00000000000 --- a/ace/Timer_Heap_T.cpp +++ /dev/null @@ -1,732 +0,0 @@ -// $Id$ - -#ifndef ACE_TIMER_HEAP_T_C -#define ACE_TIMER_HEAP_T_C - -#include "ace/Timer_Heap_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(ace, Timer_Heap_T, "$Id$") - -// Define some simple macros to clarify the code. -#define ACE_HEAP_PARENT(X) (X == 0 ? 0 : (((X) - 1) / 2)) -#define ACE_HEAP_LCHILD(X) (((X)+(X))+1) - -// Constructor that takes in an to iterate over. - -template -ACE_Timer_Heap_Iterator_T::ACE_Timer_Heap_Iterator_T (ACE_Timer_Heap_T &heap) - : timer_heap_ (heap) -{ - ACE_TRACE ("ACE_Timer_Heap_Iterator::ACE_Timer_Heap_Iterator"); - this->first(); -} - -template -ACE_Timer_Heap_Iterator_T::~ACE_Timer_Heap_Iterator_T (void) -{ -} - -// Positions the iterator at the first node in the heap array - -template void -ACE_Timer_Heap_Iterator_T::first (void) -{ - this->position_ = 0; -} - -// Positions the iterator at the next node in the heap array - -template void -ACE_Timer_Heap_Iterator_T::next (void) -{ - if (this->position_ != this->timer_heap_.cur_size_) - this->position_++; -} - -// Returns true the is at the end of the heap array - -template int -ACE_Timer_Heap_Iterator_T::isdone (void) -{ - return this->position_ == this->timer_heap_.cur_size_; -} - -// Returns the node at the current position in the heap or 0 if at the end - -template ACE_Timer_Node_T * -ACE_Timer_Heap_Iterator_T::item (void) -{ - if (this->position_ != this->timer_heap_.cur_size_) - return this->timer_heap_.heap_[this->position_]; - return 0; -} - -// Constructor - -template -ACE_Timer_Heap_T::ACE_Timer_Heap_T (size_t size, - int preallocate, - FUNCTOR *upcall_functor, - ACE_Free_List > *freelist) - : ACE_Timer_Queue_T (upcall_functor, freelist), - max_size_ (size), - cur_size_ (0), - timer_ids_freelist_ (1), - preallocated_nodes_ (0), - preallocated_nodes_freelist_ (0) -{ - ACE_TRACE ("ACE_Timer_Heap_T::ACE_Timer_Heap_T"); - - // Create the heap array. - ACE_NEW (this->heap_, - ACE_Timer_Node_T *[size]); - - // Create the parallel - ACE_NEW (this->timer_ids_, - long[size]); - - // Initialize the "freelist," which uses negative values to - // distinguish freelist elements from "pointers" into the - // array. - for (size_t i = 0; i < size; i++) - this->timer_ids_[i] = -((long) (i + 1)); - - if (preallocate) - { - ACE_NEW (this->preallocated_nodes_, - ACE_Timer_Node_T[size]); - - // Add allocated array to set of such arrays for deletion on - // cleanup. - this->preallocated_node_set_.insert (this->preallocated_nodes_); - - // Form the freelist by linking the next_ pointers together. - for (size_t j = 1; j < size; j++) - this->preallocated_nodes_[j - 1].set_next (&this->preallocated_nodes_[j]); - - // NULL-terminate the freelist. - this->preallocated_nodes_[size - 1].set_next (0); - - // Assign the freelist pointer to the front of the list. - this->preallocated_nodes_freelist_ = - &this->preallocated_nodes_[0]; - } - - ACE_NEW (iterator_, - HEAP_ITERATOR (*this)); -} - -template -ACE_Timer_Heap_T::ACE_Timer_Heap_T (FUNCTOR *upcall_functor, - ACE_Free_List > *freelist) - : ACE_Timer_Queue_T (upcall_functor, freelist), - max_size_ (ACE_DEFAULT_TIMERS), - cur_size_ (0), - timer_ids_freelist_ (1), - preallocated_nodes_ (0), - preallocated_nodes_freelist_ (0) -{ - ACE_TRACE ("ACE_Timer_Heap_T::ACE_Timer_Heap_T"); - - // Create the heap array. -#if defined (__IBMCPP__) && (__IBMCPP__ >= 400) && defined (_WINDOWS) - ACE_NEW (this->heap_, - ACE_Timer_Node_T *[ACE_DEFAULT_TIMERS]); -#else - ACE_NEW (this->heap_, - ACE_Timer_Node_T *[this->max_size_]); -#endif /* defined (__IBMCPP__) && (__IBMCPP__ >= 400) && defined (_WINDOWS) */ - - // Create the parallel array. - ACE_NEW (this->timer_ids_, - long[this->max_size_]); - - // Initialize the "freelist," which uses negative values to - // distinguish freelist elements from "pointers" into the - // array. - for (size_t i = 0; - i < this->max_size_; - i++) - this->timer_ids_[i] = -((long) (i + 1)); - - ACE_NEW (iterator_, - HEAP_ITERATOR (*this)); -} - -template -ACE_Timer_Heap_T::~ACE_Timer_Heap_T (void) -{ - ACE_TRACE ("ACE_Timer_Heap::~ACE_Timer_Heap"); - - delete iterator_; - - // Clean up all the nodes still in the queue - for (size_t i = 0; i < this->cur_size_; i++) - { - this->upcall_functor ().deletion (*this, - this->heap_[i]->get_type (), - this->heap_[i]->get_act ()); - this->free_node (this->heap_[i]); - } - - delete [] this->heap_; - delete [] this->timer_ids_; - - // clean up any preallocated timer nodes - if (preallocated_nodes_ != 0) - { - ACE_Unbounded_Set_Iterator *> - set_iterator (this->preallocated_node_set_); - - for (ACE_Timer_Node_T **entry = 0; - set_iterator.next (entry) !=0; - set_iterator.advance ()) - delete [] *entry; - } -} - -template int -ACE_Timer_Heap_T::pop_freelist (void) -{ - ACE_TRACE ("ACE_Timer_Heap::pop_freelist"); - - // We need to truncate this to for backwards compatibility. - int new_id = ACE_static_cast (int, - this->timer_ids_freelist_); - - // The freelist values in the are negative, so we need - // to negate them to get the next freelist "pointer." - this->timer_ids_freelist_ = - -this->timer_ids_[this->timer_ids_freelist_]; - - return new_id; -} - -template void -ACE_Timer_Heap_T::push_freelist (int old_id) -{ - ACE_TRACE ("ACE_Timer_Heap::push_freelist"); - - // The freelist values in the are negative, so we need - // to negate them to get the next freelist "pointer." - this->timer_ids_[old_id] = -this->timer_ids_freelist_; - this->timer_ids_freelist_ = old_id; -} - -template int -ACE_Timer_Heap_T::timer_id (void) -{ - ACE_TRACE ("ACE_Timer_Heap::timer_id"); - - // Return the next item off the freelist and use it as the timer id. - return this->pop_freelist (); -} - -// Checks if queue is empty. - -template int -ACE_Timer_Heap_T::is_empty (void) const -{ - ACE_TRACE ("ACE_Timer_Heap::is_empty"); - return this->cur_size_ == 0; -} - -template ACE_Timer_Queue_Iterator_T & -ACE_Timer_Heap_T::iter (void) -{ - this->iterator_->first (); - return *this->iterator_; -} - -// Returns earliest time in a non-empty queue. - -template const ACE_Time_Value & -ACE_Timer_Heap_T::earliest_time (void) const -{ - ACE_TRACE ("ACE_Timer_Heap::earliest_time"); - return this->heap_[0]->get_timer_value (); -} - -template void -ACE_Timer_Heap_T::dump (void) const -{ - ACE_TRACE ("ACE_Timer_Heap::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmax_size_ = %d"), this->max_size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d"), this->cur_size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nheap_ = \n"))); - - for (size_t i = 0; i < this->cur_size_; i++) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%d\n"), - i)); - this->heap_[i]->dump (); - } - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_ids_ = \n"))); - - for (size_t j = 0; j < this->cur_size_; j++) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%d\t%d\n"), - j, - this->timer_ids_[j])); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template void -ACE_Timer_Heap_T::copy (int slot, - ACE_Timer_Node_T *moved_node) -{ - // Insert into its new location in the heap. - this->heap_[slot] = moved_node; - - ACE_ASSERT (moved_node->get_timer_id () >= 0 - && moved_node->get_timer_id () < (int) this->max_size_); - - // Update the corresponding slot in the parallel array. - this->timer_ids_[moved_node->get_timer_id ()] = slot; -} - -template ACE_Timer_Node_T * -ACE_Timer_Heap_T::remove (size_t slot) -{ - ACE_Timer_Node_T *removed_node = - this->heap_[slot]; - - // Return this timer id to the freelist. - this->push_freelist (removed_node->get_timer_id ()); - - // Decrement the size of the heap by one since we're removing the - // "slot"th node. - this->cur_size_--; - - // Only try to reheapify if we're not deleting the last entry. - - if (slot < this->cur_size_) - { - ACE_Timer_Node_T *moved_node = - this->heap_[this->cur_size_]; - - // Move the end node to the location being removed and update - // the corresponding slot in the parallel array. - this->copy (slot, moved_node); - - // If the time_value_> is great than or equal its - // parent it needs be moved down the heap. - size_t parent = ACE_HEAP_PARENT (slot); - - if (moved_node->get_timer_value () - >= this->heap_[parent]->get_timer_value ()) - this->reheap_down (moved_node, - slot, - ACE_HEAP_LCHILD (slot)); - else - this->reheap_up (moved_node, - slot, - parent); - } - - return removed_node; -} - -template void -ACE_Timer_Heap_T::reheap_down (ACE_Timer_Node_T *moved_node, - size_t slot, - size_t child) -{ - // Restore the heap property after a deletion. - - while (child < this->cur_size_) - { - // Choose the smaller of the two children. - if (child + 1 < this->cur_size_ - && this->heap_[child + 1]->get_timer_value () - < this->heap_[child]->get_timer_value ()) - child++; - - // Perform a if the child has a larger timeout value than - // the . - if (this->heap_[child]->get_timer_value () - < moved_node->get_timer_value ()) - { - this->copy (slot, - this->heap_[child]); - slot = child; - child = ACE_HEAP_LCHILD (child); - } - else - // We've found our location in the heap. - break; - } - - this->copy (slot, moved_node); -} - -template void -ACE_Timer_Heap_T::reheap_up (ACE_Timer_Node_T *moved_node, - size_t slot, - size_t parent) -{ - // Restore the heap property after an insertion. - - while (slot > 0) - { - // If the parent node is greater than the we need - // to copy it down. - if (moved_node->get_timer_value () - < this->heap_[parent]->get_timer_value ()) - { - this->copy (slot, this->heap_[parent]); - slot = parent; - parent = ACE_HEAP_PARENT (slot); - } - else - break; - } - - // Insert the new node into its proper resting place in the heap and - // update the corresponding slot in the parallel array. - this->copy (slot, - moved_node); -} - -template void -ACE_Timer_Heap_T::insert (ACE_Timer_Node_T *new_node) -{ - if (this->cur_size_ + 2 >= max_size_) - this->grow_heap (); - - this->reheap_up (new_node, - this->cur_size_, - ACE_HEAP_PARENT (this->cur_size_)); - this->cur_size_++; -} - -template void -ACE_Timer_Heap_T::grow_heap (void) -{ - // All the containers will double in size from max_size_ - size_t new_size = max_size_ * 2; - - // First grow the heap itself. - - ACE_Timer_Node_T **new_heap = 0; - -#if defined (__IBMCPP__) && (__IBMCPP__ >= 400) && defined (_WINDOWS) - ACE_NEW (new_heap, - ACE_Timer_Node_T *[1024]); -#else - ACE_NEW (new_heap, - ACE_Timer_Node_T *[new_size]); -#endif /* defined (__IBMCPP__) && (__IBMCPP__ >= 400) && defined (_WINDOWS) */ - ACE_OS::memcpy (new_heap, - this->heap_, - max_size_ * sizeof *new_heap); - delete [] this->heap_; - this->heap_ = new_heap; - - // Grow the array of timer ids. - - long *new_timer_ids = 0; - - ACE_NEW (new_timer_ids, - long[new_size]); - - ACE_OS::memcpy (new_timer_ids, - this->timer_ids_, - max_size_ * sizeof (long)); - - delete [] timer_ids_; - this->timer_ids_ = new_timer_ids; - - // And add the new elements to the end of the "freelist". - for (size_t i = this->max_size_; i < new_size; i++) - this->timer_ids_[i] = -((long) (i + 1)); - - // Grow the preallocation array (if using preallocation) - if (this->preallocated_nodes_ != 0) - { - // Create a new array with max_size elements to link in to - // existing list. -#if defined (__IBMCPP__) && (__IBMCPP__ >= 400) && defined (_WINDOWS) - ACE_NEW (this->preallocated_nodes_, - ACE_Timer_Node_T[88]); -#else - ACE_NEW (this->preallocated_nodes_, - ACE_Timer_Node_T[this->max_size_]); -#endif /* defined (__IBMCPP__) && (__IBMCPP__ >= 400) && defined (_WINDOWS) */ - - // Add it to the set for later deletion - this->preallocated_node_set_.insert (this->preallocated_nodes_); - - // Link new nodes together (as for original list). - for (size_t k = 1; k < this->max_size_; k++) - this->preallocated_nodes_[k - 1].set_next (&this->preallocated_nodes_[k]); - - // NULL-terminate the new list. - this->preallocated_nodes_[this->max_size_ - 1].set_next (0); - - // Link new array to the end of the existling list. - if (this->preallocated_nodes_freelist_ == 0) - this->preallocated_nodes_freelist_ = - &preallocated_nodes_[0]; - else - { - ACE_Timer_Node_T *previous = - this->preallocated_nodes_freelist_; - - for (ACE_Timer_Node_T *current = this->preallocated_nodes_freelist_->get_next (); - current != 0; - current = current->get_next ()) - previous = current; - - previous->set_next (&this->preallocated_nodes_[0]); - } - } - - this->max_size_ = new_size; -} - -// Reschedule a periodic timer. This function must be called with the -// mutex lock held. - -template void -ACE_Timer_Heap_T::reschedule (ACE_Timer_Node_T *expired) -{ - ACE_TRACE ("ACE_Timer_Heap::reschedule"); - - // If we are rescheduling then we have freed our timer id so we need - // to reacquire it. NOTE: we rely on the fact that we will get the - // same timer id we just freed. -# if !defined (ACE_NDEBUG) - int timerId = -# endif /* ACE_NDEBUG */ - this->timer_id (); - - // Just to be safe... - ACE_ASSERT (timerId == expired->get_timer_id ()); - - // Restore the heap property. - this->insert (expired); -} - -template ACE_Timer_Node_T * -ACE_Timer_Heap_T::alloc_node (void) -{ - ACE_Timer_Node_T *temp = 0; - - // Only allocate a node if we are *not* using the preallocated heap. - if (this->preallocated_nodes_ == 0) - ACE_NEW_RETURN (temp, - ACE_Timer_Node_T, - 0); - else - { - // check to see if the heap needs to grow - if (this->preallocated_nodes_freelist_ == 0) - this->grow_heap (); - - temp = this->preallocated_nodes_freelist_; - - // Remove the first element from the freelist. - this->preallocated_nodes_freelist_ = - this->preallocated_nodes_freelist_->get_next (); - } - return temp; -} - -template void -ACE_Timer_Heap_T::free_node (ACE_Timer_Node_T *node) -{ - // Only free up a node if we are *not* using the preallocated heap. - if (this->preallocated_nodes_ == 0) - delete node; - else - { - node->set_next (this->preallocated_nodes_freelist_); - this->preallocated_nodes_freelist_ = node; - } -} - -// Insert a new timer that expires at time future_time; if interval is -// > 0, the handler will be reinvoked periodically. - -template long -ACE_Timer_Heap_T::schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Timer_Heap::schedule"); - - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - if (this->cur_size_ < this->max_size_) - { - // Obtain the next unique sequence number. - int timer_id = this->timer_id (); - - // Obtain the memory to the new node. - ACE_Timer_Node_T *temp = 0; - - ACE_ALLOCATOR_RETURN (temp, - this->alloc_node (), - -1); - temp->set (type, - act, - future_time, - interval, - 0, - timer_id); - - this->insert (temp); - return timer_id; - } - else - return -1; -} - -// Locate and remove the single timer with a value of from -// the timer queue. - -template int -ACE_Timer_Heap_T::cancel (long timer_id, - const void **act, - int dont_call) -{ - ACE_TRACE ("ACE_Timer_Heap::cancel"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - // Locate the ACE_Timer_Node that corresponds to the timer_id. - - // Check to see if the timer_id is out of range - if (timer_id < 0 - || (size_t) timer_id > this->max_size_) - return 0; - - long timer_node_slot = this->timer_ids_[timer_id]; - - // Check to see if timer_id is still valid. - if (timer_node_slot < 0) - return 0; - - if (timer_id != this->heap_[timer_node_slot]->get_timer_id ()) - { - ACE_ASSERT (timer_id == this->heap_[timer_node_slot]->get_timer_id ()); - return 0; - } - else - { - ACE_Timer_Node_T *temp = - this->remove (timer_node_slot); - - if (dont_call == 0) - // Call the close hook. - this->upcall_functor ().cancellation (*this, - temp->get_type ()); - - if (act != 0) - *act = temp->get_act (); - - this->free_node (temp); - return 1; - } -} - -// Locate and update the inteval on the timer_id - -template int -ACE_Timer_Heap_T::reset_interval (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Timer_Heap_T::reset_interval"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - // Locate the ACE_Timer_Node that corresponds to the timer_id. - - // Check to see if the timer_id is out of range - if (timer_id < 0 - || (size_t) timer_id > this->max_size_) - return -1; - - long timer_node_slot = this->timer_ids_[timer_id]; - - // Check to see if timer_id is still valid. - if (timer_node_slot < 0) - return -1; - - if (timer_id != this->heap_[timer_node_slot]->get_timer_id ()) - { - ACE_ASSERT (timer_id == this->heap_[timer_node_slot]->get_timer_id ()); - return -1; - } - else - { - // Reset the timer interval - this->heap_[timer_node_slot]->set_interval (interval); - return 0; - } -} - -// Locate and remove all values of from the timer queue. - -template int -ACE_Timer_Heap_T::cancel (const TYPE &type, - int dont_call) -{ - ACE_TRACE ("ACE_Timer_Heap::cancel"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - int number_of_cancellations = 0; - - // Try to locate the ACE_Timer_Node that matches the timer_id. - - for (size_t i = 0; i < this->cur_size_; ) - { - if (this->heap_[i]->get_type () == type) - { - ACE_Timer_Node_T *temp = this->remove (i); - - number_of_cancellations++; - - this->free_node (temp); - } - else - i++; - } - - if (dont_call == 0) - this->upcall_functor ().cancellation (*this, type); - - return number_of_cancellations; -} - -// Returns the earliest node or returns 0 if the heap is empty. - -template ACE_Timer_Node_T * -ACE_Timer_Heap_T::remove_first (void) -{ - ACE_TRACE ("ACE_Timer_Heap_T::remove_first"); - - if (this->cur_size_ == 0) - return 0; - - return this->remove (0); -} - -template ACE_Timer_Node_T * -ACE_Timer_Heap_T::get_first (void) -{ - ACE_TRACE ("ACE_Timer_Heap_T::get_first"); - - return this->cur_size_ == 0 ? 0 : this->heap_[0]; -} - -#endif /* ACE_TIMER_HEAP_T_C */ diff --git a/ace/Timer_Heap_T.h b/ace/Timer_Heap_T.h deleted file mode 100644 index 54b74e660ba..00000000000 --- a/ace/Timer_Heap_T.h +++ /dev/null @@ -1,285 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_Heap_T.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_TIMER_HEAP_T_H -#define ACE_TIMER_HEAP_T_H -#include "ace/pre.h" - -#include "ace/Timer_Queue_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Free_List.h" -#include "ace/Containers.h" - -// Forward declaration -template -class ACE_Timer_Heap_T; - -template -class ACE_Timer_Heap_Iterator_T : public ACE_Timer_Queue_Iterator_T -{ - // = TITLE - // Iterates over an . - // - // = DESCRIPTION - // This is a generic iterator that can be used to visit every - // node of a timer queue. Be aware that it doesn't transverse - // in the order of timeout values. -public: - ACE_Timer_Heap_Iterator_T (ACE_Timer_Heap_T &); - // Constructor. - - ~ACE_Timer_Heap_Iterator_T (void); - // Destructor. - - virtual void first (void); - // Positions the iterator at the earliest node in the Timer Queue - - virtual void next (void); - // Positions the iterator at the next node in the Timer Queue - - virtual int isdone (void); - // Returns true when there are no more nodes in the sequence - - virtual ACE_Timer_Node_T *item (void); - // Returns the node at the current position in the sequence - -protected: - ACE_Timer_Heap_T &timer_heap_; - // Pointer to the that we are iterating over. - - size_t position_; - // Position in the array where the iterator is at -}; - -template -class ACE_Timer_Heap_T : public ACE_Timer_Queue_T -{ - // = TITLE - // Provides a very fast and predictable timer implementation. - // - // = DESCRIPTION - // This implementation uses a heap-based callout queue of - // absolute times. Therefore, in the average and worst case, - // scheduling, canceling, and expiring timers is O(log N) (where - // N is the total number of timers). In addition, we can also - // preallocate as many as there are slots in - // the heap. This allows us to completely remove the need for - // dynamic memory allocation, which is important for real-time - // systems. -public: - typedef ACE_Timer_Heap_Iterator_T HEAP_ITERATOR; - friend class ACE_Timer_Heap_Iterator_T; - - typedef ACE_Timer_Queue_T INHERITED; - - // = Initialization and termination methods. - ACE_Timer_Heap_T (size_t size, - int preallocated = 0, - FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - // The Constructor creates a heap with elements. If - // is non-0 then we'll pre-allocate all the memory - // for the . This saves time and is more - // predictable (though it requires more space). Otherwise, we'll - // just allocate the nodes as we need them. This can also take in a - // upcall functor and freelist (if 0, then defaults will be created) - - ACE_Timer_Heap_T (FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - // Default constructor. is the instance of the - // FUNCTOR to be used by the queue. If is 0, Timer - // Heap will create a default FUNCTOR. the freelist of - // timer nodes. If 0, then a default freelist will be created. The default - // size will be ACE_DEFAULT_TIMERS and there will be no preallocation. - - virtual ~ACE_Timer_Heap_T (void); - // Destructor. - - virtual int is_empty (void) const; - // True if heap is empty, else false. - - virtual const ACE_Time_Value &earliest_time (void) const; - // Returns the time of the earlier node in the Timer_Queue. - - virtual long schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - // Schedule that will expire after amount of time, - // which is specified in absolute time. If it expires then is - // passed in as the value to the . If is != to - // then it is used to reschedule the - // automatically, using relative time to the current . - // This method returns a that uniquely identifies the the - // entry in an internal list. This can be used to - // cancel the timer before it expires. The cancellation ensures - // that are unique up to values of greater than 2 - // billion timers. As long as timers don't stay around longer than - // this there should be no problems with accidentally deleting the - // wrong timer. Returns -1 on failure (which is guaranteed never to - // be a valid ). - - virtual int reset_interval (long timer_id, - const ACE_Time_Value &interval); - // Resets the interval of the timer represented by to - // , which is specified in relative time to the current - // . If is equal to - // , the timer will become a non-rescheduling - // timer. Returns 0 if successful, -1 if not. - - virtual int cancel (const TYPE &type, - int dont_call_handle_close = 1); - // Cancel all timer associated with . If is 0 - // then the will be invoked. Returns number of timers - // cancelled. - - virtual int cancel (long timer_id, - const void **act = 0, - int dont_call_handle_close = 1); - // Cancel the single timer that matches the value (which - // was returned from the method). If act is non-NULL - // then it will be set to point to the ``magic cookie'' argument - // passed in when the timer was registered. This makes it possible - // to free up the memory and avoid memory leaks. If is - // 0 then the will be invoked. Returns 1 if cancellation - // succeeded and 0 if the wasn't found. - - virtual ACE_Timer_Queue_Iterator_T &iter (void); - // Returns a pointer to this 's iterator. - - ACE_Timer_Node_T *remove_first (void); - // Removes the earliest node from the queue and returns it - - virtual void dump (void) const; - // Dump the state of an object. - - virtual ACE_Timer_Node_T *get_first (void); - // Reads the earliest node from the queue and returns it. - -protected: - virtual void reschedule (ACE_Timer_Node_T *); - // Reschedule an "interval" . - - virtual ACE_Timer_Node_T *alloc_node (void); - // Factory method that allocates a new node (uses operator new if - // we're *not* preallocating, otherwise uses an internal freelist). - - virtual void free_node (ACE_Timer_Node_T *); - // Factory method that frees a previously allocated node (uses - // operatord delete if we're *not* preallocating, otherwise uses an - // internal freelist). - -private: - ACE_Timer_Node_T *remove (size_t slot); - // Remove and return the th and restore the - // heap property. - - void insert (ACE_Timer_Node_T *new_node); - // Insert into the heap and restore the heap property. - - void grow_heap (void); - // Doubles the size of the heap and the corresponding timer_ids array. - // If preallocation is used, will also double the size of the - // preallocated array of ACE_Timer_Nodes. - - void reheap_up (ACE_Timer_Node_T *new_node, - size_t slot, - size_t parent); - // Restore the heap property, starting at . - - void reheap_down (ACE_Timer_Node_T *moved_node, - size_t slot, - size_t child); - // Restore the heap property, starting at . - - void copy (int slot, ACE_Timer_Node_T *moved_node); - // Copy into the slot of and move - // into the corresponding slot in the array. - - int timer_id (void); - // Returns a timer id that uniquely identifies this timer. This id - // can be used to cancel a timer via the method. The - // timer id returned from this method will never == -1 to avoid - // conflicts with other failure return values. - - int pop_freelist (void); - // Pops and returns a new timer id from the freelist. - - void push_freelist (int old_id); - // Pushes onto the freelist. - - size_t max_size_; - // Maximum size of the heap. - - size_t cur_size_; - // Current size of the heap. - - HEAP_ITERATOR *iterator_; - // Iterator used to expire timers. - - ACE_Timer_Node_T **heap_; - // Current contents of the Heap, which is organized as a "heap" of - // *'s. In this context, a heap is a "partially - // ordered, almost complete" binary tree, which is stored in an - // array. - - long *timer_ids_; - // An array of "pointers" that allows each in the - // to be located in O(1) time. Basically, - // contains the slot in the array where an - // * with timer id resides. Thus, the timer id passed back from - // is really an slot into the array. The - // array serves two purposes: negative values are - // treated as "pointers" for the , whereas positive - // values are treated as "pointers" into the array. - - long timer_ids_freelist_; - // "Pointer" to the first element in the freelist contained within - // the array, which is organized as a stack. - - ACE_Timer_Node_T *preallocated_nodes_; - // If this is non-0, then we preallocate number of - // objects in order to reduce dynamic allocation - // costs. In auto-growing implementation, this points to the - // last array of nodes allocated. - - ACE_Timer_Node_T *preallocated_nodes_freelist_; - // This points to the head of the freelist, - // which is organized as a stack. - - ACE_Unbounded_Set *> preallocated_node_set_; - // Set of pointers to the arrays of preallocated timer nodes. - // Used to delete the allocated memory when required. - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Heap_T (const ACE_Timer_Heap_T &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Heap_T &)) -}; - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) && !defined(ACE_HAS_BROKEN_HPUX_TEMPLATES) -#include "ace/Timer_Heap_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE && !ACE_HAS_BROKEN_HPUX_TEMPLATES */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timer_Heap_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_TIMER_HEAP_T_H */ diff --git a/ace/Timer_List.cpp b/ace/Timer_List.cpp deleted file mode 100644 index 3834178a0b0..00000000000 --- a/ace/Timer_List.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// $Id$ - -#if !defined (ACE_TIMER_LIST_C) -#define ACE_TIMER_LIST_C - -#include "ace/Timer_List.h" - -ACE_RCSID(ace, Timer_List, "$Id$") - -#if defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) -#include "ace/Timer_Hash.h" -#include "ace/Timer_List_T.cpp" - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class - ACE_Timer_List_T< - ACE_Event_Handler*, - ACE_Timer_Hash_Upcall< - ACE_Event_Handler*, - ACE_Event_Handler_Handle_Timeout_Upcall, - ACE_Null_Mutex>, - ACE_Null_Mutex>; - -template class -ACE_Timer_List_Iterator_T< - ACE_Event_Handler*, - ACE_Timer_Hash_Upcall< - ACE_Event_Handler*, - ACE_Event_Handler_Handle_Timeout_Upcall, - ACE_Null_Mutex>, - ACE_Null_Mutex>; -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_HAS_BROKEN_HPUX_TEMPLATES */ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Timer_List_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_List_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Timer_List_T, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Timer_List_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - -#endif /* ACE_TIMER_LIST_C */ diff --git a/ace/Timer_List.h b/ace/Timer_List.h deleted file mode 100644 index 3f9c6b462b3..00000000000 --- a/ace/Timer_List.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_List.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_TIMER_LIST_H -#define ACE_TIMER_LIST_H -#include "ace/pre.h" - -#include "ace/Timer_List_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// The following typedef are here for ease of use and backward -// compatibility. - -typedef ACE_Timer_List_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_List; - -typedef ACE_Timer_List_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_List_Iterator; - -#include "ace/post.h" -#endif /* ACE_TIMER_LIST_H */ diff --git a/ace/Timer_List_T.cpp b/ace/Timer_List_T.cpp deleted file mode 100644 index 8902d1fcb1f..00000000000 --- a/ace/Timer_List_T.cpp +++ /dev/null @@ -1,341 +0,0 @@ -// $Id$ - -#ifndef ACE_TIMER_LIST_T_C -#define ACE_TIMER_LIST_T_C - -#include "ace/Timer_List_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(ace, Timer_List_T, "$Id$") - -// Default Constructor - -template -ACE_Timer_List_Iterator_T::ACE_Timer_List_Iterator_T (ACE_Timer_List_T &timer_list) - : timer_list_ (timer_list) -{ - this->first(); - // Nothing -} - -template -ACE_Timer_List_Iterator_T::~ACE_Timer_List_Iterator_T (void) -{ -} - -// Positions the iterator at the node right after the dummy node - -template void -ACE_Timer_List_Iterator_T::first (void) -{ - this->position_ = this->timer_list_.head_->get_next (); -} - -// Positions the iterator at the next node in the Timer Queue - -template void -ACE_Timer_List_Iterator_T::next (void) -{ - // Make sure that if we are at the end, we don't wrap around - if (this->position_ != this->timer_list_.head_) - this->position_ = this->position_->get_next (); -} - -// Returns true when we are at - -template int -ACE_Timer_List_Iterator_T::isdone (void) -{ - return this->position_ == this->timer_list_.head_; -} - -// Returns the node at or 0 if we are at the end - -template ACE_Timer_Node_T * -ACE_Timer_List_Iterator_T::item (void) -{ - if (this->position_ != this->timer_list_.head_) - return this->position_; - return 0; -} - -// Return our instance of the iterator - -template ACE_Timer_Queue_Iterator_T & -ACE_Timer_List_T::iter (void) -{ - this->iterator_->first (); - return *this->iterator_; -} - -// Create an empty list. - -template -ACE_Timer_List_T::ACE_Timer_List_T (FUNCTOR *upcall_functor, - ACE_Free_List > *freelist) - : ACE_Timer_Queue_T (upcall_functor, freelist), - head_ (new ACE_Timer_Node_T), - timer_id_ (0) -{ - ACE_TRACE ("ACE_Timer_List_T::ACE_Timer_List"); - - this->head_->set_next (this->head_); - this->head_->set_prev (this->head_); - - ACE_NEW (iterator_, - LIST_ITERATOR (*this)); -} - - -// Checks if list is empty. - -template int -ACE_Timer_List_T::is_empty (void) const -{ - ACE_TRACE ("ACE_Timer_List_T::is_empty"); - return this->head_->get_next () == this->head_; -} - - -// Returns earliest time in a non-empty list. - -template const ACE_Time_Value & -ACE_Timer_List_T::earliest_time (void) const -{ - ACE_TRACE ("ACE_Timer_List_T::earliest_time"); - return this->head_->get_next ()->get_timer_value (); -} - - -// Remove all remaining items in the list. - -template -ACE_Timer_List_T::~ACE_Timer_List_T (void) -{ - ACE_TRACE ("ACE_Timer_List_T::~ACE_Timer_List_T"); - ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_)); - - delete iterator_; - - for (ACE_Timer_Node_T *curr = this->head_->get_next (); - curr != this->head_; - ) - { - ACE_Timer_Node_T *next = curr->get_next (); - this->upcall_functor ().deletion (*this, - next->get_type (), - next->get_act ()); - this->free_node (curr); - curr = next; - } - - // delete the dummy node - delete this->head_; -} - -template void -ACE_Timer_List_T::dump (void) const -{ - ACE_TRACE ("ACE_Timer_List_T::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - size_t count = 0; - - for (ACE_Timer_Node_T *curr = this->head_->get_next (); - curr != this->head_; - curr = curr->get_next ()) - count++; - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nsize_ = %d"), count)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_id_ = %d"), this->timer_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - - -// Reschedule a periodic timer. This function must be called with the -// lock held. - -template void -ACE_Timer_List_T::reschedule (ACE_Timer_Node_T *expired) -{ - ACE_TRACE ("ACE_Timer_List_T::reschedule"); - - ACE_Timer_Node_T *after = this->head_->get_next (); - - // Locate the proper position in the queue. - - while (after != this->head_ - && expired->get_timer_value () > after->get_timer_value ()) - after = after->get_next (); - - expired->set_next (after); - expired->set_prev (after->get_prev ()); - after->get_prev ()->set_next (expired); - after->set_prev (expired); -} - - -// Insert a new handler that expires at time future_time; if interval -// is > 0, the handler will be reinvoked periodically. - -template long -ACE_Timer_List_T::schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &future_time, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Timer_List_T::schedule"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - // Place in the middle of the list where it belongs (i.e., sorted in - // ascending order of absolute time to expire). - ACE_Timer_Node_T *after = this->head_->get_next (); - - while (after != this->head_ - && future_time > after->get_timer_value ()) - after = after->get_next (); - - ACE_Timer_Node_T *temp = this->alloc_node (); - - temp->set (type, - act, - future_time, - interval, - after->get_prev (), - after, - (long) temp); - - after->get_prev ()->set_next (temp); - after->set_prev (temp); - - return ACE_reinterpret_cast (long, temp); -} - -// Locate and update the inteval on the timer_id - -template int -ACE_Timer_List_T::reset_interval (long timer_id, - const ACE_Time_Value &interval) -{ - ACE_TRACE ("ACE_Timer_List_T::reset_interval"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - // Make sure we are getting a valid , not an error - // returned by . - if (timer_id == -1) - return -1; - - ACE_Timer_Node_T *node = - ACE_reinterpret_cast (ACE_Timer_Node_T *, - timer_id); - - node->set_interval (interval); - - return 0; -} - -// Locate and remove the single with a value of -// from the timer queue. - -template int -ACE_Timer_List_T::cancel (long timer_id, - const void **act, - int dont_call) -{ - ACE_TRACE ("ACE_Timer_List_T::cancel"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - // Make sure we are getting a valid , not an error - // returned by schedule () - if (timer_id == -1) - return 0; - - ACE_Timer_Node_T *node = - ACE_reinterpret_cast (ACE_Timer_Node_T *, - timer_id); - - // Check to see if the node looks like a true ACE_Timer_Node_T - if (timer_id == node->get_timer_id ()) - { - node->get_next ()->set_prev (node->get_prev ()); - node->get_prev ()->set_next (node->get_next ()); - - if (act != 0) - *act = node->get_act (); - - if (dont_call == 0) - this->upcall_functor ().cancellation (*this, - node->get_type ()); - this->free_node (node); - return 1; - } - - // Wasn't valid - return 0; -} - - -// Locate and remove all values of from the timer queue. - -template int -ACE_Timer_List_T::cancel (const TYPE &type, - int dont_call) -{ - ACE_TRACE ("ACE_Timer_List_T::cancel"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - int number_of_cancellations = 0; - - for (ACE_Timer_Node_T *curr = this->head_->get_next (); - curr != this->head_; - ) - { - if (curr->get_type () == type) - { - number_of_cancellations++; - - curr->get_prev ()->set_next (curr->get_next ()); - curr->get_next ()->set_prev (curr->get_prev ()); - ACE_Timer_Node_T *temp = curr; - curr = curr->get_next (); - this->free_node (temp); - } - else - curr = curr->get_next (); - } - - if (dont_call == 0) - this->upcall_functor ().cancellation (*this, type); - - return number_of_cancellations; -} - -// Reads the first node on the list and returns it. - -template ACE_Timer_Node_T * -ACE_Timer_List_T::get_first (void) -{ - ACE_TRACE ("ACE_Timer_List_T::get_first"); - - return this->head_->get_next (); -} - -// Removes the first node on the list and returns it. - -template ACE_Timer_Node_T * -ACE_Timer_List_T::remove_first (void) -{ - ACE_TRACE ("ACE_Timer_List_T::remove_first"); - - // remove the node and fix the pointers - ACE_Timer_Node_T *temp = this->head_->get_next (); - this->head_->set_next (temp->get_next ()); - temp->get_next ()->set_prev (this->head_); - - return temp; -} - -#endif /* ACE_TIMER_LIST_T_C */ diff --git a/ace/Timer_List_T.h b/ace/Timer_List_T.h deleted file mode 100644 index d8e1970f8c2..00000000000 --- a/ace/Timer_List_T.h +++ /dev/null @@ -1,205 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_List_T.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#ifndef ACE_TIMER_LIST_T_H -#define ACE_TIMER_LIST_T_H -#include "ace/pre.h" - -#include "ace/Timer_Queue_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Forward declaration. -template -class ACE_Timer_List_T; - -template -class ACE_Timer_List_Iterator_T : public ACE_Timer_Queue_Iterator_T -{ - // = TITLE - // Iterates over an . - // - // = DESCRIPTION - // This is a generic iterator that can be used to visit every - // node of a timer queue. -public: - ACE_Timer_List_Iterator_T (ACE_Timer_List_T &); - // Constructor. - - ~ACE_Timer_List_Iterator_T (void); - // Destructor. - - virtual void first (void); - // Positions the iterator at the earliest node in the Timer Queue - - virtual void next (void); - // Positions the iterator at the next node in the Timer Queue - - virtual int isdone (void); - // Returns true when there are no more nodes in the sequence - - virtual ACE_Timer_Node_T *item (void); - // Returns the node at the current position in the sequence - -protected: - ACE_Timer_List_T &timer_list_; - // Pointer to the that we are iterating over. - - ACE_Timer_Node_T *position_; -}; - -template -class ACE_Timer_List_T : public ACE_Timer_Queue_T -{ - // = TITLE - // Provides a simple implementation of timers. - // - // = DESCRIPTION - // This implementation uses a linked list of absolute times. - // Therefore, in the average case, scheduling and canceling - // timers is O(N) (where N is the total number of timers) and - // expiring timers is O(K) (where K is the total number of timers - // that are < the current time of day). - // - // More clever implementations could use a delta-list, a heap, - // or timing wheels, etc. For instance, - // is a subclass of that implements a - // heap-based callout queue. For most applications, the - // will perform substantially faster than the - // . -public: - typedef ACE_Timer_List_Iterator_T LIST_ITERATOR; - // Type of iterator - - friend class ACE_Timer_List_Iterator_T; - // Iterator is a friend - - typedef ACE_Timer_Queue_T INHERITED; - // Type inherited from - - // = Initialization and termination methods. - ACE_Timer_List_T (FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - // Default constructor. is the instance of the - // FUNCTOR to be used by the list. If is 0, a - // default FUNCTOR will be created. the freelist of - // timer nodes. If 0, then a default freelist will be created. - - virtual ~ACE_Timer_List_T (void); - // Destructor - - virtual int is_empty (void) const; - // True if queue is empty, else false. - - virtual const ACE_Time_Value &earliest_time (void) const; - // Returns the time of the earlier node in the . - - virtual long schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - // Schedule that will expire after amount of time, - // which is specified in absolute time. If it expires then is - // passed in as the value to the . If is != to - // then it is used to reschedule the - // automatically, using relative time to the current . - // This method returns a that uniquely identifies the the - // entry in an internal list. This can be used to - // cancel the timer before it expires. The cancellation ensures - // that are unique up to values of greater than 2 - // billion timers. As long as timers don't stay around longer than - // this there should be no problems with accidentally deleting the - // wrong timer. Returns -1 on failure (which is guaranteed never to - // be a valid ). - - virtual int reset_interval (long timer_id, - const ACE_Time_Value &interval); - // Resets the interval of the timer represented by to - // , which is specified in relative time to the current - // . If is equal to - // , the timer will become a non-rescheduling - // timer. Returns 0 if successful, -1 if not. - - virtual int cancel (const TYPE &type, - int dont_call_handle_close = 1); - // Cancel all timer associated with . If is 0 - // then the will be invoked. Returns number of timers - // cancelled. - - virtual int cancel (long timer_id, - const void **act = 0, - int dont_call_handle_close = 1); - // Cancel the single timer that matches the value (which - // was returned from the method). If act is non-NULL - // then it will be set to point to the ``magic cookie'' argument - // passed in when the timer was registered. This makes it possible - // to free up the memory and avoid memory leaks. If is - // 0 then the will be invoked. Returns 1 if cancellation - // succeeded and 0 if the wasn't found. - - virtual ACE_Timer_Queue_Iterator_T &iter (void); - // Returns a pointer to this 's iterator. - - virtual ACE_Timer_Node_T *remove_first (void); - // Removes the earliest node from the queue and returns it - - virtual void dump (void) const; - // Dump the state of an object. - - virtual void reschedule (ACE_Timer_Node_T *); - // Reschedule an "interval" . This should be private - // but for now it needs to be public for - - virtual ACE_Timer_Node_T *get_first (void); - // Reads the earliest node from the queue and returns it. - -protected: -/* virtual ACE_Timer_Node_T *alloc_node (void); - // Factory method that allocates a new node (uses operator new). - - virtual void free_node (ACE_Timer_Node_T *); - // Factory method that frees a previously allocated node (uses - // operator delete). -*/ -private: - ACE_Timer_Node_T *head_; - // Pointer to linked list of . - - LIST_ITERATOR *iterator_; - // Iterator used to expire timers. - - long timer_id_; - // Keeps track of the timer id that uniquely identifies each timer. - // This id can be used to cancel a timer via the - // method. - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_List_T (const ACE_Timer_List_T &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_List_T &)) -}; - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) && !defined(ACE_HAS_BROKEN_HPUX_TEMPLATES) -#include "ace/Timer_List_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE && !ACE_HAS_BROKEN_HPUX_TEMPLATES */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Timer_List_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include "ace/post.h" -#endif /* ACE_TIMER_LIST_T_H */ diff --git a/ace/Timer_Queue.cpp b/ace/Timer_Queue.cpp deleted file mode 100644 index 931da8697e0..00000000000 --- a/ace/Timer_Queue.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// $Id$ - -#if !defined (ACE_TIMER_QUEUE_C) -#define ACE_TIMER_QUEUE_C - -#include "ace/Containers.h" -#include "ace/Timer_Queue.h" - -ACE_RCSID(ace, Timer_Queue, "$Id$") - -#if defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) -#include "ace/Timer_Hash.h" -#include "ace/Timer_Queue_T.cpp" - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class - ACE_Timer_Queue_T< - ACE_Event_Handler*, - ACE_Timer_Hash_Upcall< - ACE_Event_Handler*, - ACE_Event_Handler_Handle_Timeout_Upcall, - ACE_Null_Mutex>, - ACE_Null_Mutex>; - -template class - ACE_Timer_Queue_Iterator_T< - ACE_Event_Handler*, - ACE_Timer_Hash_Upcall< - ACE_Event_Handler*, - ACE_Event_Handler_Handle_Timeout_Upcall, - ACE_Null_Mutex>, - ACE_Null_Mutex>; -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_HAS_BROKEN_HPUX_TEMPLATES */ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Unbounded_Set *>; -template class ACE_Node *>; -template class ACE_Unbounded_Set_Iterator *>; -template class ACE_Timer_Node_T; -template class ACE_Timer_Queue_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Timer_Queue_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Event_Handler_Handle_Timeout_Upcall; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_Unbounded_Set *> -#pragma instantiate ACE_Node *> -#pragma instantiate ACE_Unbounded_Set_Iterator *> -#pragma instantiate ACE_Timer_Node_T -#pragma instantiate ACE_Timer_Queue_T, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Timer_Queue_Iterator_T, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Event_Handler_Handle_Timeout_Upcall - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - -#endif /* ACE_TIMER_QUEUE_C */ diff --git a/ace/Timer_Queue.h b/ace/Timer_Queue.h deleted file mode 100644 index e754cd60f96..00000000000 --- a/ace/Timer_Queue.h +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ -/* -*- C++ -*- */ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_Queue.h -// -// = AUTHOR -// Doug Schmidt and Irfan Pyarali -// -// ============================================================================ - -#ifndef ACE_TIMER_QUEUE_H -#define ACE_TIMER_QUEUE_H -#include "ace/pre.h" - -#include "ace/Synch.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Timer_Queue_T.h" - -// The following typedef are here for ease of use and backward -// compatibility. - -typedef ACE_Timer_Node_T - ACE_Timer_Node; - -typedef ACE_Timer_Queue_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Queue; - -typedef ACE_Timer_Queue_Iterator_T, - ACE_SYNCH_RECURSIVE_MUTEX> - ACE_Timer_Queue_Iterator; - -#include "ace/post.h" -#endif /* ACE_TIMER_QUEUE_H */ diff --git a/ace/Timer_Queue.i b/ace/Timer_Queue.i deleted file mode 100644 index 41e4324e61e..00000000000 --- a/ace/Timer_Queue.i +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- C++ -*- */ - -template ACE_INLINE void -ACE_Timer_Queue_T::timer_skew (const ACE_Time_Value &skew) -{ - timer_skew_ = skew; -} - -template ACE_INLINE const ACE_Time_Value & -ACE_Timer_Queue_T::timer_skew (void) const -{ - return timer_skew_; -} - -template ACE_INLINE int -ACE_Timer_Queue_T::expire (void) -{ - if (!this->is_empty ()) - return this->expire (this->gettimeofday () + timer_skew_); - else - return 0; -} diff --git a/ace/Timer_Queue_Adapters.cpp b/ace/Timer_Queue_Adapters.cpp deleted file mode 100644 index d37466219e7..00000000000 --- a/ace/Timer_Queue_Adapters.cpp +++ /dev/null @@ -1,309 +0,0 @@ -// $Id$ - -#include "ace/Timer_Queue_Adapters.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#ifndef ACE_TIMER_QUEUE_ADAPTERS_C -# define ACE_TIMER_QUEUE_ADAPTERS_C - -ACE_RCSID(ace, Timer_Queue_Adapters, "$Id$") - -# if !defined (__ACE_INLINE__) -# include "ace/Timer_Queue_Adapters.i" -# endif /* __ACE_INLINE__ */ - -template TQ & -ACE_Async_Timer_Queue_Adapter::timer_queue (void) -{ - return this->timer_queue_; -} - -template int -ACE_Async_Timer_Queue_Adapter::cancel (long timer_id, - const void **act) -{ - // Block designated signals. - ACE_Sig_Guard sg (&this->mask_); - ACE_UNUSED_ARG (sg); - - return this->timer_queue_.cancel (timer_id, act); -} - -template int -ACE_Async_Timer_Queue_Adapter::expire (void) -{ - // Block designated signals. - ACE_Sig_Guard sg (&this->mask_); - ACE_UNUSED_ARG (sg); - - return this->timer_queue_.expire (); -} - -template int -ACE_Async_Timer_Queue_Adapter::schedule_ualarm (void) -{ - ACE_Time_Value tv = this->timer_queue_.earliest_time () - - ACE_OS::gettimeofday (); - - // Beware of negative times and zero times (which cause problems for - // ). - if (tv < ACE_Time_Value::zero) - tv = ACE_Time_Value (0, 1); - - // @@ This code should be clever enough to avoid updating the - // if we haven't actually changed the earliest time. - // Schedule a new timer. - ACE_OS::ualarm (tv); - return 0; -} - -template long -ACE_Async_Timer_Queue_Adapter::schedule (ACE_Event_Handler *eh, - const void *act, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval) -{ - ACE_UNUSED_ARG (act); - ACE_UNUSED_ARG (interval); - - // Block designated signals. - ACE_Sig_Guard sg (&this->mask_); - ACE_UNUSED_ARG (sg); - - // @@ We still need to implement interval timers... - long tid = this->timer_queue_.schedule (eh, 0, delay); - - if (tid == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("schedule_timer")), - -1); - - if (this->schedule_ualarm () == -1) - return 0; - else - return tid; -} - -template -ACE_Async_Timer_Queue_Adapter::ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *mask) - // If == 0, block *all* signals when the SIGARLM handler is - // running, else just block those in the mask. - : mask_ (mask) -{ - // The following code is necessary to selectively "block" certain - // signals when SIGALRM is running. Also, we always restart system - // calls that are interrupted by the signals. - - ACE_Sig_Action sa ((ACE_SignalHandler) 0, - this->mask_, - SA_RESTART); - - if (this->sig_handler_.register_handler (SIGALRM, this, &sa) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("register_handler"))); -} - -// This is the signal handler function for the asynchronous timer -// list. It gets invoked asynchronously when the SIGALRM signal -// occurs. - -template int -ACE_Async_Timer_Queue_Adapter::handle_signal (int signum, - siginfo_t *, - ucontext_t *) -{ - switch (signum) - { - case SIGALRM: - { - // Expire the pending timers. - - // @@ We need to figure out how to implement interval - // timers... - this->timer_queue_.expire (); - - // Only schedule a new timer if there is one in the list. - - // @@ This code should also become smarter to avoid - // unnecessary calls to ualarm(). - if (this->timer_queue_.is_empty () == 0) - return this->schedule_ualarm (); - else - return 0; - /* NOTREACHED */ - } - default: - ACE_ERROR_RETURN ((LM_ERROR, - "unexpected signal %S\n", - signum), - -1); - /* NOTREACHED */ - } -} - -template -ACE_Thread_Timer_Queue_Adapter::ACE_Thread_Timer_Queue_Adapter (ACE_Thread_Manager *tm) - : ACE_Task_Base (tm), - condition_ (mutex_), - active_ (1), // Assume that we start in active mode. - thr_id_ (ACE_OS::NULL_thread) -{ -} - -template ACE_SYNCH_MUTEX & -ACE_Thread_Timer_Queue_Adapter::mutex (void) -{ - return this->mutex_; -} - -template long -ACE_Thread_Timer_Queue_Adapter::schedule - (ACE_Event_Handler* handler, - const void *act, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval) -{ - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - - long result = this->timer_queue_.schedule (handler, act, delay, interval); - this->condition_.signal (); - return result; -} - -template int -ACE_Thread_Timer_Queue_Adapter::cancel (long timer_id, - const void **act) -{ - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - - int result = this->timer_queue_.cancel (timer_id, act); - condition_.signal (); - return result; -} - -template void -ACE_Thread_Timer_Queue_Adapter::deactivate (void) -{ - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); - - this->active_ = 0; - this->condition_.signal (); -} - -template int -ACE_Thread_Timer_Queue_Adapter::svc (void) -{ - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - - this->thr_id_ = ACE_Thread::self (); - - // Thread cancellation point, if ACE supports it. -# if !defined (ACE_LACKS_PTHREAD_CANCEL) - ACE_PTHREAD_CLEANUP_PUSH (&this->condition_.mutex ()); -# endif /* ACE_LACKS_PTHREAD_CANCEL */ - - while (this->active_) - { -# if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) - - // Temporarily suspend ownership of the timer queue mutex in - // order to dispatch deferred execution commands. These commands - // are to be treated as executing in a context "external" to the - // timer queue adapter, and thus must compete separately for this lock. - mutex_.release (); - this->dispatch_commands (); - - // Re-acquire ownership of the timer queue mutex in order - // to restore the "internal" timer queue adapter context - mutex_.acquire (); - - -# endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - - // If the queue is empty, sleep until there is a change on it. - if (this->timer_queue_.is_empty ()) - { - this->condition_.wait (); - } - else - { - // Compute the remaining time, being careful not to sleep - // for "negative" amounts of time. - ACE_Time_Value tv = this->timer_queue_.earliest_time (); - - // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("waiting until %u.%3.3u secs\n"), - // tv.sec(), tv.msec())); - this->condition_.wait (&tv); - } - - // Expire timers anyway, at worst this is a no-op. - this->timer_queue_.expire (); - } - - // Thread cancellation point, if ACE supports it. -# if !defined (ACE_LACKS_PTHREAD_CANCEL) - ACE_PTHREAD_CLEANUP_POP (0); -# endif /* ACE_LACKS_PTHREAD_CANCEL */ - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("terminating dispatching thread\n"))); - return 0; -} - - -# if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) - -// Enqueues a command object for execution just before waiting on the next -// timer event. This allows deferred execution of commands that cannot -// be performed in the timer event handler context, such as registering -// or cancelling timers on platforms where the timer queue mutex is not -// recursive. - -template int -ACE_Thread_Timer_Queue_Adapter::enqueue_command (ACE_Command_Base *cmd, - COMMAND_ENQUEUE_POSITION pos) -{ - // Serialize access to the command queue. - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, - this->command_mutex_, -1); - - if (pos == ACE_Thread_Timer_Queue_Adapter::TAIL) - { - return command_queue_.enqueue_tail (cmd); - } - else - { - return command_queue_.enqueue_head (cmd); - } -} - - -// Dispatches all command objects enqueued in the most -// recent event handler context. - -template int -ACE_Thread_Timer_Queue_Adapter::dispatch_commands (void) -{ - // Serialize access to the command queue. - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, - this->command_mutex_, -1); - - // loop through the enqueued commands - ACE_Command_Base *cmd = 0; - while (command_queue_.dequeue_head (cmd) == 0) - if (cmd) - { - cmd->execute (); - delete cmd; - } - - return 0; -} - -# endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - -#endif /* ACE_TIMER_QUEUE_ADAPTERS_C*/ diff --git a/ace/Timer_Queue_Adapters.h b/ace/Timer_Queue_Adapters.h deleted file mode 100644 index c908e4d1391..00000000000 --- a/ace/Timer_Queue_Adapters.h +++ /dev/null @@ -1,216 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_Queue_Adapters.h -// -// = AUTHOR -// Douglas C. Schmidt and Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_TIMER_QUEUE_ADAPTERS_H -# define ACE_TIMER_QUEUE_ADAPTERS_H -# include "ace/pre.h" - -# include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -# include "ace/Signal.h" - -template -class ACE_Export ACE_Async_Timer_Queue_Adapter : public ACE_Event_Handler -{ - // = TITLE - // Adapts a to be run asynchronously. - // - // = DESCRIPTION - // This implementation uses the call, which generates - // the SIGARLM signal that is caught by this class. -public: - typedef TQ TIMER_QUEUE; - - ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *mask = 0); - // Register the SIGALRM handler. If == 0 then block all - // signals when is run. Otherwise, just block the signals - // indicated in . - - long schedule (ACE_Event_Handler *type, - const void *act, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - // Schedule the timer according to the semantics of the - // . However, this timer gets dispatched via a - // signal, rather than by a user calling . - - int cancel (long timer_id, const void **act = 0); - // Cancel the and pass back the if an address is - // passed in. - - int expire (void); - // Dispatch all timers whose values are <= . Returns the - // number of timers canceled. - - TQ &timer_queue (void); - // Access the underlying . - -private: - virtual int schedule_ualarm (void); - // Perform the logic to compute the new ualarm(2) setting. - - virtual int handle_signal (int signum, siginfo_t *, ucontext_t *); - // Called back by handler. - - ACE_Sig_Handler sig_handler_; - // Handler for the signal, so that we can access our state - // without requiring any global variables. - - TQ timer_queue_; - // Implementation of the timer queue (e.g., , - // , etc.). - - ACE_Sig_Set mask_; - // Mask of signals to be blocked when we're servicing . -}; - -template -class ACE_Export ACE_Thread_Timer_Queue_Adapter : public ACE_Task_Base -{ - // = TITLE - // Adapts a Timer_Queue using a separate thread for dispatching. - // - // = DESCRIPTION - // This implementation of a Timer_Queue uses a separate thread to - // dispatch the timers. The base queue need not be thread safe, - // this class takes all the necessary locks. - // - // = NOTE - // This is a case were template parameters will be useful, but - // (IMHO) the effort and portability problems discourage their - // use. -public: - - typedef TQ TIMER_QUEUE; - // Trait for the underlying queue type. - -# if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) - - enum COMMAND_ENQUEUE_POSITION {HEAD, TAIL}; - // Typedef for the position at which to enqueue a deferred execution command. - -# endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - - ACE_Thread_Timer_Queue_Adapter (ACE_Thread_Manager * = ACE_Thread_Manager::instance ()); - // Creates the timer queue. Activation of the task is the user's - // responsibility. - - long schedule (ACE_Event_Handler* handler, - const void *act, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval = ACE_Time_Value::zero); - // Schedule the timer according to the semantics of the ; wakes - // up the dispatching thread. - - int cancel (long timer_id, const void **act = 0); - // Cancel the add return the parameter if an - // address is passed in. Also wakes up the dispatching thread. - - virtual int svc (void); - // Runs the dispatching thread. - - virtual void deactivate (void); - // Inform the dispatching thread that it should terminate. - - ACE_SYNCH_MUTEX &mutex (void); - // Access the locking mechanism, useful for iteration. - - TQ &timer_queue (void); - // Access the implementation queue, useful for iteration. - - ACE_thread_t thr_id (void); - // Return the thread id of our active object. - - virtual int activate (long flags = THR_NEW_LWP | THR_JOINABLE, - int n_threads = 1, - int force_active = 0, - long priority = ACE_DEFAULT_THREAD_PRIORITY, - int grp_id = -1, - ACE_Task_Base *task = 0, - ACE_hthread_t thread_handles[] = 0, - void *stack[] = 0, - size_t stack_size[] = 0, - ACE_thread_t thread_names[] = 0); - // We override the default method so that we can ensure - // that only a single thread is ever spawned. Otherwise, too many - // weird things can happen... - -# if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) - - int enqueue_command (ACE_Command_Base *command_, - COMMAND_ENQUEUE_POSITION pos = TAIL); - // Enqueues a command object for execution just before waiting on the next - // timer event. This allows deferred execution of commands that cannot - // be performed in the timer event handler context, such as registering - // or cancelling timers on platforms where the timer queue mutex is not - // recursive. - -# endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - -private: - -# if defined (ACE_HAS_DEFERRED_TIMER_COMMANDS) - - int dispatch_commands (void); - // Dispatches all command objects enqueued in the most - // recent event handler context. - - ACE_Unbounded_Queue command_queue_; - // Queue of commands for deferred execution. - - ACE_SYNCH_MUTEX command_mutex_; - // The mutual exclusion mechanism for the command queue. - -# endif /* ACE_HAS_DEFERRED_TIMER_COMMANDS */ - - TQ timer_queue_; - // The underlying Timer_Queue. - - ACE_SYNCH_CONDITION condition_; - // The dispatching thread sleeps on this condition while waiting to - // dispatch the next timer; it is used to wake it up if there is a - // change on the timer queue. - - ACE_SYNCH_MUTEX mutex_; - // The mutual exclusion mechanism which is required to use the - // . - - int active_; - // When deactivate is called this variable turns to false and the - // dispatching thread is signalled, to terminate its main loop. - - ACE_thread_t thr_id_; - // Thread id of our active object task. -}; - -# if defined (__ACE_INLINE__) -# include "ace/Timer_Queue_Adapters.i" -# endif /* __ACE_INLINE__ */ - -# if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -# include "ace/Timer_Queue_Adapters.cpp" -# endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -# if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -# pragma implementation ("Timer_Queue_Adapters.cpp") -# endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -# include "ace/post.h" -#endif /* ACE_TIMER_QUEUE_ADAPTERS_H */ diff --git a/ace/Timer_Queue_Adapters.i b/ace/Timer_Queue_Adapters.i deleted file mode 100644 index 621c9c08ef8..00000000000 --- a/ace/Timer_Queue_Adapters.i +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -template ACE_INLINE TQ & -ACE_Thread_Timer_Queue_Adapter::timer_queue (void) -{ - return this->timer_queue_; -} - -template ACE_INLINE ACE_thread_t -ACE_Thread_Timer_Queue_Adapter::thr_id (void) -{ - return this->thr_id_; -} - -template ACE_INLINE int -ACE_Thread_Timer_Queue_Adapter::activate (long flags, - int n_threads, - int force_active, - long priority, - int grp_id, - ACE_Task_Base *task, - ACE_hthread_t thread_handles[], - void *stack[], - size_t stack_size[], - ACE_thread_t thread_names[]) -{ - // Macros to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (n_threads); - ACE_UNUSED_ARG (force_active); - ACE_UNUSED_ARG (thread_handles); - - // Make sure that we only allow a single thread to be spawned for - // our adapter. Otherwise, too many weird things can happen. - return ACE_Task_Base::activate (flags, 1, 0, priority, grp_id, task, 0, - stack, stack_size, thread_names); -} diff --git a/ace/Timer_Queue_T.cpp b/ace/Timer_Queue_T.cpp deleted file mode 100644 index 002319070d8..00000000000 --- a/ace/Timer_Queue_T.cpp +++ /dev/null @@ -1,320 +0,0 @@ -// $Id$ - -#ifndef ACE_TIMER_QUEUE_T_C -#define ACE_TIMER_QUEUE_T_C - -#include "ace/Synch.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Signal.h" -#include "ace/Timer_Queue_T.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Timer_Queue_T.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Timer_Queue_T, "$Id$") - -template void -ACE_Timer_Node_T::dump (void) const -{ - ACE_TRACE ("ACE_Timer_Node_T::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nact_ = %x"), this->act_)); - this->timer_value_.dump (); - this->interval_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nprev_ = %x"), this->prev_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nnext_ = %x"), this->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_id_ = %d\n"), this->timer_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template -ACE_Timer_Node_T::ACE_Timer_Node_T (void) -{ - ACE_TRACE ("ACE_Timer_Node_T::ACE_Timer_Node_T"); -} - -template -ACE_Timer_Node_T::~ACE_Timer_Node_T (void) -{ - ACE_TRACE ("ACE_Timer_Node_T::~ACE_Timer_Node_T"); -} - -template -ACE_Timer_Queue_Iterator_T::ACE_Timer_Queue_Iterator_T (void) -{ -} - -template -ACE_Timer_Queue_Iterator_T::~ACE_Timer_Queue_Iterator_T (void) -{ -} - -// Determines the minimum amount of time that the Reactor must wait -// before timing out. This is computed as the smaller of (1) the -// amount the caller requested when calling handle_events() and (2) -// the earliest time registered in the Timer Queue (if any). Must be -// called with an external lock held since it returns a pointer to a -// Time_Value type stored in the Timer_Queue type itself. If some -// external lock isn't held we'll have reentrancy problems! - -template ACE_Time_Value * -ACE_Timer_Queue_T::calculate_timeout (ACE_Time_Value *max_wait_time) -{ - ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, max_wait_time)); - - if (this->is_empty ()) - // Nothing on the Timer_Queue, so use whatever the caller gave us. - return max_wait_time; - else - { - ACE_Time_Value cur_time = this->gettimeofday (); - - if (this->earliest_time () > cur_time) - { - // The earliest item on the Timer_Queue is still in the - // future. Therefore, use the smaller of (1) caller's wait - // time or (2) the delta time between now and the earliest - // time on the Timer_Queue. - - this->timeout_ = this->earliest_time () - cur_time; - if (max_wait_time == 0 || *max_wait_time > timeout_) - return &this->timeout_; - else - return max_wait_time; - } - else - { - // The earliest item on the Timer_Queue is now in the past. - // Therefore, we've got to "poll" the Reactor, i.e., it must - // just check the descriptors and then dispatch timers, etc. - this->timeout_ = ACE_Time_Value::zero; - return &this->timeout_; - } - } -} - -template ACE_Time_Value * -ACE_Timer_Queue_T::calculate_timeout (ACE_Time_Value *max_wait_time, - ACE_Time_Value *the_timeout) -{ - ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout"); - - if (the_timeout == 0) - return 0; - - if (this->is_empty ()) - { - // Nothing on the Timer_Queue, so use whatever the caller gave us. - if (max_wait_time) - *the_timeout = *max_wait_time; - else - return 0; - } - else - { - ACE_Time_Value cur_time = this->gettimeofday (); - - if (this->earliest_time () > cur_time) - { - // The earliest item on the Timer_Queue is still in the - // future. Therefore, use the smaller of (1) caller's wait - // time or (2) the delta time between now and the earliest - // time on the Timer_Queue. - - *the_timeout = this->earliest_time () - cur_time; - if (!(max_wait_time == 0 || *max_wait_time > *the_timeout)) - *the_timeout = *max_wait_time; - } - else - { - // The earliest item on the Timer_Queue is now in the past. - // Therefore, we've got to "poll" the Reactor, i.e., it must - // just check the descriptors and then dispatch timers, etc. - *the_timeout = ACE_Time_Value::zero; - } - } - return the_timeout; -} - -template void -ACE_Timer_Queue_T::dump (void) const -{ - ACE_TRACE ("ACE_Timer_Queue_T::dump"); - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->timeout_.dump (); - this->timer_skew_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -template -ACE_Timer_Queue_T::ACE_Timer_Queue_T (FUNCTOR *upcall_functor, - ACE_Free_List > *freelist) - : free_list_ (freelist == 0 ? new ACE_Locked_Free_List, ACE_Null_Mutex> : freelist), - gettimeofday_ (ACE_OS::gettimeofday), - upcall_functor_ (upcall_functor == 0 ? new FUNCTOR : upcall_functor), - delete_upcall_functor_ (upcall_functor == 0), - delete_free_list_ (freelist == 0), - timer_skew_ (0, ACE_TIMER_SKEW) -{ - ACE_TRACE ("ACE_Timer_Queue_T::ACE_Timer_Queue_T"); -} - -template -ACE_Timer_Queue_T::~ACE_Timer_Queue_T (void) -{ - ACE_TRACE ("ACE_Timer_Queue_T::~ACE_Timer_Queue_T"); - - // Cleanup the functor and free_list on the way out - if (this->delete_upcall_functor_) - delete this->upcall_functor_; - - if (this->delete_free_list_) - delete this->free_list_; -} - -template ACE_Timer_Node_T * -ACE_Timer_Queue_T::alloc_node (void) -{ - return this->free_list_->remove (); -} - -template void -ACE_Timer_Queue_T::free_node (ACE_Timer_Node_T *node) -{ - this->free_list_->add (node); -} - -template ACE_LOCK & -ACE_Timer_Queue_T::mutex (void) -{ - return this->mutex_; -} - -// Run the method for all Timers whose values are <= -// . - -template int -ACE_Timer_Queue_T::expire (const ACE_Time_Value &cur_time) -{ - ACE_TRACE ("ACE_Timer_Queue_T::expire"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); - - int number_of_timers_expired = 0; - - ACE_Timer_Node_T *expired; - - // Keep looping while there are timers remaining and the earliest - // timer is <= the passed in to the method. - - if (this->is_empty ()) - return 0; - - while (this->earliest_time () <= cur_time) - { - expired = this->remove_first (); - TYPE &type = expired->get_type (); - const void *act = expired->get_act (); - int reclaim = 1; - - // Check if this is an interval timer. - if (expired->get_interval () > ACE_Time_Value::zero) - { - // Make sure that we skip past values that have already - // "expired". - do - expired->set_timer_value (expired->get_timer_value () + expired->get_interval ()); - while (expired->get_timer_value () <= cur_time); - - // Since this is an interval timer, we need to reschedule - // it. - this->reschedule (expired); - reclaim = 0; - } - - // call the functor - this->upcall (type, act, cur_time); - - if (reclaim) - // Call the factory method to free up the node. - this->free_node (expired); - - number_of_timers_expired++; - - if (this->is_empty ()) - break; - } - - return number_of_timers_expired; -} - - -template void -ACE_Timer_Queue_T::return_node (ACE_Timer_Node_T *node) -{ - ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_)); - this->free_node (node); -} - - -template -ACE_Event_Handler_Handle_Timeout_Upcall::ACE_Event_Handler_Handle_Timeout_Upcall (void) -{ -} - -template -ACE_Event_Handler_Handle_Timeout_Upcall::~ACE_Event_Handler_Handle_Timeout_Upcall (void) -{ -} - -template int -ACE_Event_Handler_Handle_Timeout_Upcall::timeout (ACE_Timer_Queue_T, - ACE_LOCK> &timer_queue, - ACE_Event_Handler *handler, - const void *act, - const ACE_Time_Value &cur_time) -{ - // Upcall to the s handle_timeout method. - if (handler->handle_timeout (cur_time, act) == -1) - timer_queue.cancel (handler, 0); // 0 means "call handle_close()". - - return 0; -} - -template int -ACE_Event_Handler_Handle_Timeout_Upcall::cancellation (ACE_Timer_Queue_T, - ACE_LOCK> &timer_queue, - ACE_Event_Handler *handler) -{ - ACE_UNUSED_ARG (timer_queue); - - // Upcall to the s handle_close method - handler->handle_close (ACE_INVALID_HANDLE, - ACE_Event_Handler::TIMER_MASK); - return 0; -} - -template int -ACE_Event_Handler_Handle_Timeout_Upcall::deletion (ACE_Timer_Queue_T, - ACE_LOCK> &timer_queue, - ACE_Event_Handler *handler, - const void *arg) -{ - ACE_UNUSED_ARG (timer_queue); - ACE_UNUSED_ARG (handler); - ACE_UNUSED_ARG (arg); - - // Does nothing - - return 0; -} - -#endif /* ACE_TIMER_QUEUE_T_C*/ diff --git a/ace/Timer_Queue_T.h b/ace/Timer_Queue_T.h deleted file mode 100644 index fa624572013..00000000000 --- a/ace/Timer_Queue_T.h +++ /dev/null @@ -1,393 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Timer_Queue_T.h -// -// = AUTHOR -// Doug Schmidt, Irfan Pyarali, and Darrell Brunsch -// -// ============================================================================ - -#ifndef ACE_TIMER_QUEUE_T_H -#define ACE_TIMER_QUEUE_T_H -#include "ace/pre.h" - -#include "ace/Free_List.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -template -class ACE_Timer_Node_T -{ - // = TITLE - // Maintains the state associated with a Timer entry. -public: - ACE_Timer_Node_T (void); - // Default constructor - - ~ACE_Timer_Node_T (void); - // Dtor. - - void set (const TYPE &type, - const void *a, - const ACE_Time_Value &t, - const ACE_Time_Value &i, - ACE_Timer_Node_T *n, - long timer_id); - // singly linked list - - void set (const TYPE &type, - const void *a, - const ACE_Time_Value &t, - const ACE_Time_Value &i, - ACE_Timer_Node_T *p, - ACE_Timer_Node_T *n, - long timer_id); - // doubly linked list version - - // = Accessors - - TYPE &get_type (void); - // Get the type. - - void set_type (TYPE &type); - // Set the type. - - const void *get_act (void); - // Get the asynchronous completion token. - - void set_act (void *act); - // set the asynchronous completion token. - - ACE_Time_Value &get_timer_value (void); - // get the timer value. - - void set_timer_value (ACE_Time_Value timer_value); - // set the timer value. - - ACE_Time_Value &get_interval (void); - // get the timer interval. - - void set_interval (ACE_Time_Value interval); - // Set the timer interval. - - ACE_Timer_Node_T *get_prev (void); - // get the previous pointer. - - void set_prev (ACE_Timer_Node_T *prev); - // set the previous pointer. - - ACE_Timer_Node_T *get_next (void); - // get the next pointer. - - void set_next (ACE_Timer_Node_T *next); - // set the next pointer. - - long get_timer_id (void); - // get the timer_id. - - void set_timer_id (long timer_id); - // set the timer_id. - - void dump (void) const; - // Dump the state of an TYPE. - -private: - TYPE type_; - // Type of object stored in the Queue - - const void *act_; - // Asynchronous completion token associated with the timer. - - ACE_Time_Value timer_value_; - // Time until the timer expires. - - ACE_Time_Value interval_; - // If this is a periodic timer this holds the time until the next - // timeout. - - ACE_Timer_Node_T *prev_; - // Pointer to previous timer. - - ACE_Timer_Node_T *next_; - // Pointer to next timer. - - long timer_id_; - // Id of this timer (used to cancel timers before they expire). -}; - -template -class ACE_Timer_Queue_Iterator_T -{ - // = TITLE - // Generic interface for iterating over a subclass of - // . - // - // = DESCRIPTION - // This is a generic iterator that can be used to visit every - // node of a timer queue. Be aware that it isn't guaranteed - // that the transversal will be in order of timeout values. -public: - // = Initialization and termination methods. - ACE_Timer_Queue_Iterator_T (void); - // Constructor. - - virtual ~ACE_Timer_Queue_Iterator_T (void); - // Destructor. - - virtual void first (void) = 0; - // Positions the iterator at the earliest node in the Timer Queue - - virtual void next (void) = 0; - // Positions the iterator at the next node in the Timer Queue - - virtual int isdone (void) = 0; - // Returns true when there are no more nodes in the sequence - - virtual ACE_Timer_Node_T *item (void) = 0; - // Returns the node at the current position in the sequence -}; - -template -class ACE_Timer_Queue_T -{ - // = TITLE - // Provides an interface to timers. - // - // = DESCRIPTION - // This is an abstract base class that provides hook for - // implementing specialized policies such as - // and . -public: - typedef ACE_Timer_Queue_Iterator_T ITERATOR; - // Type of Iterator. - - // = Initialization and termination methods. - ACE_Timer_Queue_T (FUNCTOR *upcall_functor = 0, - ACE_Free_List > *freelist = 0); - // Default constructor. is the instance of the - // FUNCTOR to be used by the queue. If is 0, Timer - // Queue will create a default FUNCTOR. the freelist of - // timer nodes. If 0, then a default freelist will be created. - - virtual ~ACE_Timer_Queue_T (void); - // Destructor - make virtual for proper destruction of inherited - // classes. - - virtual int is_empty (void) const = 0; - // True if queue is empty, else false. - - virtual const ACE_Time_Value &earliest_time (void) const = 0; - // Returns the time of the earlier node in the Timer_Queue. - - virtual long schedule (const TYPE &type, - const void *act, - const ACE_Time_Value &delay, - const ACE_Time_Value &interval = ACE_Time_Value::zero) = 0; - // Schedule that will expire after amount of time, - // which is specified in absolute time. If it expires then is - // passed in as the value to the . If is != to - // then it is used to reschedule the - // automatically, using relative time to the current . - // This method returns a that uniquely identifies the the - // entry in an internal list. This can be used to - // cancel the timer before it expires. The cancellation ensures - // that are unique up to values of greater than 2 - // billion timers. As long as timers don't stay around longer than - // this there should be no problems with accidentally deleting the - // wrong timer. Returns -1 on failure (which is guaranteed never to - // be a valid ). - - virtual int reset_interval (long timer_id, - const ACE_Time_Value &interval) = 0; - // Resets the interval of the timer represented by to - // , which is specified in relative time to the current - // . If is equal to - // , the timer will become a non-rescheduling - // timer. Returns 0 if successful, -1 if not. - - virtual int cancel (const TYPE &type, - int dont_call_handle_close = 1) = 0; - // Cancel all timer associated with . If - // is 0 then the will be invoked, - // which typically invokes the hook. Returns number - // of timers cancelled. - - virtual int cancel (long timer_id, - const void **act = 0, - int dont_call_handle_close = 1) = 0; - // Cancel the single timer that matches the value (which - // was returned from the method). If act is non-NULL - // then it will be set to point to the ``magic cookie'' argument - // passed in when the timer was registered. This makes it possible - // to free up the memory and avoid memory leaks. If - // is 0 then the will be invoked, - // which typically calls the hook. Returns 1 if - // cancellation succeeded and 0 if the wasn't found. - - virtual int expire (const ACE_Time_Value ¤t_time); - // Run the for all timers whose values are <= . - // This does not account for . Returns the number of - // timers canceled. - - /* virtual */ int expire (void); - // Run the for all timers whose values are <= - // . Also accounts for . Returns - // the number of timers canceled. - - /* virtual */ ACE_Time_Value gettimeofday (void); - // Returns the current time of day. This allows different - // implementations of the timer queue to use special high resolution - // timers. - - void gettimeofday (ACE_Time_Value (*gettimeofday)(void)); - // Allows applications to control how the timer queue gets the time - // of day. - - virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max); - // Determine the next event to timeout. Returns if there are - // no pending timers or if all pending timers are longer than max. - - virtual ACE_Time_Value *calculate_timeout (ACE_Time_Value *max, - ACE_Time_Value *the_timeout); - // Determine the next event to timeout. Returns if there are - // no pending timers or if all pending timers are longer than max. - // should be a pointer to storage for the timeout value, - // and this value is also returned. - - // = Set/get the timer skew for the Timer_Queue. - void timer_skew (const ACE_Time_Value &skew); - const ACE_Time_Value &timer_skew (void) const; - - ACE_LOCK &mutex (void); - // Synchronization variable used by the queue - - FUNCTOR &upcall_functor (void); - // Accessor to the upcall functor - - virtual ITERATOR &iter (void) = 0; - // Returns a pointer to this 's iterator. - - virtual ACE_Timer_Node_T *remove_first (void) = 0; - // Removes the earliest node from the queue and returns it - - virtual void dump (void) const; - // Dump the state of a object. - - virtual ACE_Timer_Node_T *get_first (void) = 0; - // Reads the earliest node from the queue and returns it. - - virtual void return_node (ACE_Timer_Node_T *); - // Method used to return a timer node to the queue's ownership - // after it is returned by a method like . - -protected: - /* virtual */ void upcall (TYPE &type, - const void *act, - const ACE_Time_Value &cur_time); - // This method will call the with the , and - //