From 34104cf059eeafbd1382ac7f9315e0c9a4afac2e Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Tue, 15 Feb 2005 23:07:37 +0000 Subject: Commit merged-in changes from mainline --- ace/ACE.h | 4 +- ace/ARGV.cpp | 2 +- ace/ARGV.h | 14 +- ace/Acceptor.cpp | 21 +- ace/Asynch_IO.h | 22 +- ace/CDR_Stream.cpp | 6 + ace/CDR_Stream.h | 2 +- ace/Capabilities.cpp | 15 +- ace/Condition_Recursive_Thread_Mutex.cpp | 2 +- ace/Condition_Thread_Mutex.cpp | 2 +- ace/Configuration.cpp | 13 +- ace/Configuration.h | 5 +- ace/Connector.cpp | 8 +- ace/Containers_T.cpp | 4 +- ace/Dev_Poll_Reactor.cpp | 140 ++- ace/Dev_Poll_Reactor.h | 97 +- ace/Dev_Poll_Reactor.inl | 84 +- ace/Dump.cpp | 4 +- ace/Dynamic_Service.cpp | 2 +- ace/Event.cpp | 2 +- ace/Event_Handler.cpp | 4 +- ace/FILE.cpp | 2 +- ace/Filecache.cpp | 52 +- ace/Filecache.h | 13 - ace/FlReactor.cpp | 4 - ace/FlReactor.h | 7 +- ace/Global_Macros.h | 50 +- ace/Hash_Map_Manager_T.inl | 13 +- ace/Hashable.inl | 2 +- ace/ICMP_Socket.cpp | 1 + ace/ICMP_Socket.h | 1 + ace/LSOCK_Acceptor.cpp | 2 +- ace/LSOCK_Stream.cpp | 4 +- ace/Local_Name_Space.cpp | 8 +- ace/Local_Name_Space.h | 4 +- ace/Log_Msg.cpp | 9 +- ace/Log_Msg_UNIX_Syslog.cpp | 4 +- ace/Log_Msg_UNIX_Syslog.h | 6 +- ace/Logging_Strategy.cpp | 4 +- ace/MEM_Acceptor.h | 8 +- ace/MEM_Addr.h | 23 +- ace/Makefile.am | 1338 ++++++++++++++------------- ace/Map_T.inl | 16 +- ace/Message_Block.cpp | 2 +- ace/Message_Queue.cpp | 4 +- ace/Message_Queue_T.cpp | 10 +- ace/Name_Proxy.cpp | 6 +- ace/Name_Proxy.h | 6 + ace/Naming_Context.cpp | 7 +- ace/Node.cpp | 9 +- ace/Node.h | 9 - ace/OS.h | 1 - ace/OS_NS_Thread.cpp | 24 +- ace/OS_NS_Thread.h | 3 + ace/OS_NS_Thread.inl | 3 +- ace/OS_NS_fcntl.cpp | 14 +- ace/OS_NS_math.inl | 36 +- ace/OS_NS_netdb.cpp | 6 +- ace/OS_NS_signal.inl | 28 +- ace/OS_NS_stdio.cpp | 54 +- ace/OS_NS_stdio.h | 13 - ace/OS_NS_stdio.inl | 3 +- ace/OS_NS_string.h | 12 +- ace/OS_NS_stropts.cpp | 3 +- ace/OS_NS_sys_socket.cpp | 2 +- ace/OS_NS_sys_socket.inl | 14 +- ace/OS_NS_sys_time.h | 14 +- ace/OS_NS_sys_time.inl | 14 + ace/OS_NS_sys_uio.cpp | 4 +- ace/OS_NS_sys_utsname.cpp | 2 +- ace/OS_NS_time.cpp | 37 +- ace/OS_NS_time.h | 4 + ace/OS_NS_time.inl | 6 +- ace/OS_NS_unistd.inl | 4 +- ace/OS_NS_wchar.cpp | 12 +- ace/OS_TLI.inl | 80 +- ace/OS_Thread_Adapter.cpp | 7 +- ace/Obstack_T.cpp | 12 +- ace/POSIX_Asynch_IO.cpp | 11 +- ace/POSIX_CB_Proactor.cpp | 2 +- ace/POSIX_Proactor.cpp | 16 +- ace/Parse_Node.cpp | 39 +- ace/Ping_Socket.cpp | 3 + ace/Ping_Socket.h | 2 +- ace/Process.h | 4 +- ace/Process_Manager.cpp | 8 +- ace/QoS/SOCK_Dgram_Mcast_QoS.cpp | 3 +- ace/QtReactor.cpp | 2 - ace/QtReactor.h | 6 +- ace/README | 23 +- ace/RMCast/ACE_RMCast.pc.in | 11 - ace/RMCast/Makefile.am | 127 --- ace/RMCast/README | 57 -- ace/RMCast/RMCast.cpp | 5 - ace/RMCast/RMCast.h | 253 ----- ace/RMCast/RMCast.rc | 30 - ace/RMCast/RMCast_Ack_Worker.cpp | 25 - ace/RMCast/RMCast_Ack_Worker.h | 47 - ace/RMCast/RMCast_Ack_Worker.i | 12 - ace/RMCast/RMCast_Copy_On_Write.cpp | 199 ---- ace/RMCast/RMCast_Copy_On_Write.h | 214 ----- ace/RMCast/RMCast_Copy_On_Write.i | 38 - ace/RMCast/RMCast_Export.h | 44 - ace/RMCast/RMCast_Fork.cpp | 112 --- ace/RMCast/RMCast_Fork.h | 55 -- ace/RMCast/RMCast_Fork.i | 21 - ace/RMCast/RMCast_Fragment.cpp | 189 ---- ace/RMCast/RMCast_Fragment.h | 61 -- ace/RMCast/RMCast_Fragment.i | 7 - ace/RMCast/RMCast_IO_UDP.cpp | 461 --------- ace/RMCast/RMCast_IO_UDP.h | 138 --- ace/RMCast/RMCast_IO_UDP.i | 37 - ace/RMCast/RMCast_Membership.cpp | 186 ---- ace/RMCast/RMCast_Membership.h | 104 --- ace/RMCast/RMCast_Membership.i | 8 - ace/RMCast/RMCast_Module.cpp | 102 -- ace/RMCast/RMCast_Module.h | 88 -- ace/RMCast/RMCast_Module.i | 7 - ace/RMCast/RMCast_Module_Factory.cpp | 9 - ace/RMCast/RMCast_Module_Factory.h | 67 -- ace/RMCast/RMCast_Partial_Message.cpp | 217 ----- ace/RMCast/RMCast_Partial_Message.h | 102 -- ace/RMCast/RMCast_Partial_Message.i | 15 - ace/RMCast/RMCast_Proxy.cpp | 46 - ace/RMCast/RMCast_Proxy.h | 102 -- ace/RMCast/RMCast_Proxy.i | 8 - ace/RMCast/RMCast_Reassembly.cpp | 148 --- ace/RMCast/RMCast_Reassembly.h | 71 -- ace/RMCast/RMCast_Receiver_Module.cpp | 157 ---- ace/RMCast/RMCast_Receiver_Module.h | 108 --- ace/RMCast/RMCast_Receiver_Module.i | 7 - ace/RMCast/RMCast_Reliable_Factory.cpp | 54 -- ace/RMCast/RMCast_Reliable_Factory.h | 60 -- ace/RMCast/RMCast_Reliable_Factory.i | 8 - ace/RMCast/RMCast_Reordering.cpp | 179 ---- ace/RMCast/RMCast_Reordering.h | 98 -- ace/RMCast/RMCast_Reordering.i | 8 - ace/RMCast/RMCast_Resend_Handler.cpp | 22 - ace/RMCast/RMCast_Resend_Handler.h | 44 - ace/RMCast/RMCast_Resend_Handler.i | 8 - ace/RMCast/RMCast_Resend_Worker.cpp | 31 - ace/RMCast/RMCast_Resend_Worker.h | 49 - ace/RMCast/RMCast_Resend_Worker.i | 12 - ace/RMCast/RMCast_Retransmission.cpp | 149 --- ace/RMCast/RMCast_Retransmission.h | 119 --- ace/RMCast/RMCast_Retransmission.i | 6 - ace/RMCast/RMCast_Sequencer.cpp | 27 - ace/RMCast/RMCast_Sequencer.h | 55 -- ace/RMCast/RMCast_Sequencer.i | 7 - ace/RMCast/RMCast_Singleton_Factory.cpp | 24 - ace/RMCast/RMCast_Singleton_Factory.h | 61 -- ace/RMCast/RMCast_Singleton_Factory.i | 8 - ace/RMCast/RMCast_UDP_Event_Handler.cpp | 36 - ace/RMCast/RMCast_UDP_Event_Handler.h | 59 -- ace/RMCast/RMCast_UDP_Event_Handler.i | 8 - ace/RMCast/RMCast_UDP_Proxy.cpp | 190 ---- ace/RMCast/RMCast_UDP_Proxy.h | 88 -- ace/RMCast/RMCast_UDP_Proxy.i | 7 - ace/RMCast/RMCast_UDP_Reliable_Receiver.cpp | 32 - ace/RMCast/RMCast_UDP_Reliable_Receiver.h | 49 - ace/RMCast/RMCast_UDP_Reliable_Receiver.i | 7 - ace/RMCast/RMCast_UDP_Reliable_Sender.cpp | 70 -- ace/RMCast/RMCast_UDP_Reliable_Sender.h | 78 -- ace/RMCast/RMCast_UDP_Reliable_Sender.i | 19 - ace/RMCast/RMCast_Worker.cpp | 15 - ace/RMCast/RMCast_Worker.h | 32 - ace/RMCast/rmcast.mpc | 8 - ace/Reactor.cpp | 23 +- ace/Remote_Name_Space.cpp | 29 +- ace/Remote_Name_Space.h | 4 +- ace/SOCK_Acceptor.cpp | 18 +- ace/SOCK_Connector.cpp | 12 +- ace/SOCK_Dgram_Mcast.cpp | 7 +- ace/SOCK_SEQPACK_Acceptor.cpp | 44 +- ace/SOCK_SEQPACK_Association.cpp | 20 +- ace/SOCK_SEQPACK_Connector.cpp | 25 +- ace/Select_Reactor_Base.cpp | 2 +- ace/Service_Config.cpp | 5 +- ace/Service_Config.h | 22 +- ace/Service_Object.cpp | 4 +- ace/Service_Object.h | 6 +- ace/Service_Repository.cpp | 15 +- ace/Service_Types.cpp | 8 +- ace/Signal.cpp | 6 +- ace/Sock_Connect.cpp | 10 +- ace/Stream_Modules.cpp | 6 +- ace/Svc_Conf.y | 12 +- ace/Svc_Conf_y.cpp | 12 +- ace/Svc_Handler.h | 2 +- ace/TLI.cpp | 16 +- ace/TLI_Acceptor.cpp | 2 +- ace/TLI_Connector.cpp | 2 +- ace/TMCast/ACE_TMCast.pc.in | 11 - ace/TMCast/Export.hpp | 58 -- ace/TMCast/FaultDetector.hpp | 41 - ace/TMCast/Group.cpp | 508 ---------- ace/TMCast/Group.hpp | 51 - ace/TMCast/GroupFwd.hpp | 15 - ace/TMCast/LinkListener.hpp | 168 ---- ace/TMCast/MTQueue.cpp | 24 - ace/TMCast/MTQueue.hpp | 176 ---- ace/TMCast/Makefile.am | 66 -- ace/TMCast/Messaging.hpp | 54 -- ace/TMCast/Protocol.cpp | 31 - ace/TMCast/Protocol.hpp | 107 --- ace/TMCast/README | 240 ----- ace/TMCast/TMCast.mpc | 7 - ace/TMCast/TransactionController.hpp | 387 -------- ace/TSS_T.cpp | 4 +- ace/Thread_Manager.cpp | 52 +- ace/Time_Request_Reply.h | 2 - ace/Time_Value.h | 6 +- ace/Time_Value.inl | 14 + ace/Timer_Heap_T.cpp | 5 +- ace/Timer_Queue_Adapters.h | 8 +- ace/Timer_Wheel_T.cpp | 6 +- ace/TkReactor.cpp | 2 - ace/TkReactor.h | 10 +- ace/Token_Collection.cpp | 3 +- ace/Token_Collection.h | 1 - ace/UPIPE_Stream.cpp | 2 +- ace/UUID.cpp | 32 +- ace/Unbounded_Queue.cpp | 6 +- ace/Unbounded_Set.cpp | 3 +- ace/Unbounded_Set_Ex.cpp | 629 ------------- ace/Unbounded_Set_Ex.h | 360 ------- ace/Unbounded_Set_Ex.inl | 18 - ace/Version.h | 4 +- ace/WFMO_Reactor.cpp | 2 +- ace/WIN32_Asynch_IO.cpp | 43 +- ace/WIN32_Proactor.cpp | 20 +- ace/XtReactor.cpp | 2 - ace/XtReactor.h | 9 +- ace/ace.mpc | 708 +++++++------- ace/ace.mwc | 6 +- ace/ace_wchar.h | 2 + ace/codecs.mpb | 4 +- ace/config-aix-4.x.h | 2 - ace/config-doxygen.h | 10 +- ace/config-lite.h | 44 +- ace/config-lynxos.h | 41 +- ace/config-vxworks5.x.h | 1 - ace/config-win32-common.h | 1 + ace/config-win32-msvc.h | 7 - ace/filecache.mpb | 4 +- ace/os_include/os_pthread.h | 5 + ace/other.mpb | 18 +- ace/qt_reactor.mpb | 2 - ace/svcconf.mpb | 32 +- ace/token.mpb | 14 +- ace/uuid.mpb | 4 +- 251 files changed, 1951 insertions(+), 10483 deletions(-) delete mode 100644 ace/RMCast/ACE_RMCast.pc.in delete mode 100644 ace/RMCast/Makefile.am delete mode 100644 ace/RMCast/README delete mode 100644 ace/RMCast/RMCast.cpp delete mode 100644 ace/RMCast/RMCast.h delete mode 100644 ace/RMCast/RMCast.rc delete mode 100644 ace/RMCast/RMCast_Ack_Worker.cpp delete mode 100644 ace/RMCast/RMCast_Ack_Worker.h delete mode 100644 ace/RMCast/RMCast_Ack_Worker.i delete mode 100644 ace/RMCast/RMCast_Copy_On_Write.cpp delete mode 100644 ace/RMCast/RMCast_Copy_On_Write.h delete mode 100644 ace/RMCast/RMCast_Copy_On_Write.i delete mode 100644 ace/RMCast/RMCast_Export.h delete mode 100644 ace/RMCast/RMCast_Fork.cpp delete mode 100644 ace/RMCast/RMCast_Fork.h delete mode 100644 ace/RMCast/RMCast_Fork.i delete mode 100644 ace/RMCast/RMCast_Fragment.cpp delete mode 100644 ace/RMCast/RMCast_Fragment.h delete mode 100644 ace/RMCast/RMCast_Fragment.i delete mode 100644 ace/RMCast/RMCast_IO_UDP.cpp delete mode 100644 ace/RMCast/RMCast_IO_UDP.h delete mode 100644 ace/RMCast/RMCast_IO_UDP.i delete mode 100644 ace/RMCast/RMCast_Membership.cpp delete mode 100644 ace/RMCast/RMCast_Membership.h delete mode 100644 ace/RMCast/RMCast_Membership.i delete mode 100644 ace/RMCast/RMCast_Module.cpp delete mode 100644 ace/RMCast/RMCast_Module.h delete mode 100644 ace/RMCast/RMCast_Module.i delete mode 100644 ace/RMCast/RMCast_Module_Factory.cpp delete mode 100644 ace/RMCast/RMCast_Module_Factory.h delete mode 100644 ace/RMCast/RMCast_Partial_Message.cpp delete mode 100644 ace/RMCast/RMCast_Partial_Message.h delete mode 100644 ace/RMCast/RMCast_Partial_Message.i delete mode 100644 ace/RMCast/RMCast_Proxy.cpp delete mode 100644 ace/RMCast/RMCast_Proxy.h delete mode 100644 ace/RMCast/RMCast_Proxy.i delete mode 100644 ace/RMCast/RMCast_Reassembly.cpp delete mode 100644 ace/RMCast/RMCast_Reassembly.h delete mode 100644 ace/RMCast/RMCast_Receiver_Module.cpp delete mode 100644 ace/RMCast/RMCast_Receiver_Module.h delete mode 100644 ace/RMCast/RMCast_Receiver_Module.i delete mode 100644 ace/RMCast/RMCast_Reliable_Factory.cpp delete mode 100644 ace/RMCast/RMCast_Reliable_Factory.h delete mode 100644 ace/RMCast/RMCast_Reliable_Factory.i delete mode 100644 ace/RMCast/RMCast_Reordering.cpp delete mode 100644 ace/RMCast/RMCast_Reordering.h delete mode 100644 ace/RMCast/RMCast_Reordering.i delete mode 100644 ace/RMCast/RMCast_Resend_Handler.cpp delete mode 100644 ace/RMCast/RMCast_Resend_Handler.h delete mode 100644 ace/RMCast/RMCast_Resend_Handler.i delete mode 100644 ace/RMCast/RMCast_Resend_Worker.cpp delete mode 100644 ace/RMCast/RMCast_Resend_Worker.h delete mode 100644 ace/RMCast/RMCast_Resend_Worker.i delete mode 100644 ace/RMCast/RMCast_Retransmission.cpp delete mode 100644 ace/RMCast/RMCast_Retransmission.h delete mode 100644 ace/RMCast/RMCast_Retransmission.i delete mode 100644 ace/RMCast/RMCast_Sequencer.cpp delete mode 100644 ace/RMCast/RMCast_Sequencer.h delete mode 100644 ace/RMCast/RMCast_Sequencer.i delete mode 100644 ace/RMCast/RMCast_Singleton_Factory.cpp delete mode 100644 ace/RMCast/RMCast_Singleton_Factory.h delete mode 100644 ace/RMCast/RMCast_Singleton_Factory.i delete mode 100644 ace/RMCast/RMCast_UDP_Event_Handler.cpp delete mode 100644 ace/RMCast/RMCast_UDP_Event_Handler.h delete mode 100644 ace/RMCast/RMCast_UDP_Event_Handler.i delete mode 100644 ace/RMCast/RMCast_UDP_Proxy.cpp delete mode 100644 ace/RMCast/RMCast_UDP_Proxy.h delete mode 100644 ace/RMCast/RMCast_UDP_Proxy.i delete mode 100644 ace/RMCast/RMCast_UDP_Reliable_Receiver.cpp delete mode 100644 ace/RMCast/RMCast_UDP_Reliable_Receiver.h delete mode 100644 ace/RMCast/RMCast_UDP_Reliable_Receiver.i delete mode 100644 ace/RMCast/RMCast_UDP_Reliable_Sender.cpp delete mode 100644 ace/RMCast/RMCast_UDP_Reliable_Sender.h delete mode 100644 ace/RMCast/RMCast_UDP_Reliable_Sender.i delete mode 100644 ace/RMCast/RMCast_Worker.cpp delete mode 100644 ace/RMCast/RMCast_Worker.h delete mode 100644 ace/RMCast/rmcast.mpc delete mode 100644 ace/TMCast/ACE_TMCast.pc.in delete mode 100644 ace/TMCast/Export.hpp delete mode 100644 ace/TMCast/FaultDetector.hpp delete mode 100644 ace/TMCast/Group.cpp delete mode 100644 ace/TMCast/Group.hpp delete mode 100644 ace/TMCast/GroupFwd.hpp delete mode 100644 ace/TMCast/LinkListener.hpp delete mode 100644 ace/TMCast/MTQueue.cpp delete mode 100644 ace/TMCast/MTQueue.hpp delete mode 100644 ace/TMCast/Makefile.am delete mode 100644 ace/TMCast/Messaging.hpp delete mode 100644 ace/TMCast/Protocol.cpp delete mode 100644 ace/TMCast/Protocol.hpp delete mode 100644 ace/TMCast/README delete mode 100644 ace/TMCast/TMCast.mpc delete mode 100644 ace/TMCast/TransactionController.hpp delete mode 100644 ace/Unbounded_Set_Ex.cpp delete mode 100644 ace/Unbounded_Set_Ex.h delete mode 100644 ace/Unbounded_Set_Ex.inl diff --git a/ace/ACE.h b/ace/ACE.h index 4e164359fb3..d42be3c5098 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -377,7 +377,7 @@ namespace ACE /** * Reset the limit on the number of open handles. If @a new_limit * == -1 set the limit to the maximum allowable. Otherwise, set - * the limit value to @a new_limit. If @a increase_limit_only is + * the limit value to @a new_limit. If @a increase_limit_only is * non-0 then only allow increases to the limit. */ extern ACE_Export int set_handle_limit (int new_limit = -1, @@ -598,7 +598,7 @@ namespace ACE extern ACE_Export int process_active (pid_t pid); /** - * Terminate the process abruptly with id . On Win32 platforms + * Terminate the process abruptly with id @a pid. On Win32 platforms * this uses and on POSIX platforms is uses * with the -9 (SIGKILL) signal, which cannot be caught or * ignored. Note that this call is potentially dangerous to use diff --git a/ace/ARGV.cpp b/ace/ARGV.cpp index 7e7b323fbdc..8109c3c215c 100644 --- a/ace/ARGV.cpp +++ b/ace/ARGV.cpp @@ -183,7 +183,7 @@ ACE_ARGV::add (const ACE_TCHAR *next_arg) } // Put the new argument at the end of the queue. - if (this->queue_.enqueue_tail ((ACE_TCHAR *) next_arg) == -1) + if (this->queue_.enqueue_tail (const_cast (next_arg)) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("Can't add more to ARGV queue")), -1); diff --git a/ace/ARGV.h b/ace/ARGV.h index e43ae3a719b..feba0fe6b1d 100644 --- a/ace/ARGV.h +++ b/ace/ARGV.h @@ -52,7 +52,7 @@ public: int substitute_env_args = 1); /** - * Converts into a linear string. If + * Converts @a argv into a linear string. If @a substitute_env_args * is enabled then we'll substitute the environment variables for * each $ENV encountered in the string. The operation is not * allowed on an ACE_ARGV created this way. @@ -86,18 +86,18 @@ public: const ACE_TCHAR *operator[] (size_t index); /** - * Returns the array. Caller should not delete this memory - * since the destructor will delete it. If the caller + * Returns the @c argv array. Caller should not delete this memory + * since the ACE_ARGV destructor will delete it. If the caller * modifies the array in the iterative mode, the changes are not * saved to the queue. */ ACE_TCHAR **argv (void); - /// Returns . + /// Returns @c argc. int argc (void) const; - /// Returns the . Caller should not delete this memory since - /// the destructor will delete it. + /// Returns the @c buf. Caller should not delete this memory since + /// the ACE_ARGV destructor will delete it. const ACE_TCHAR *buf (void); /// Dump the state of an object. @@ -114,7 +114,7 @@ public: int add (const ACE_TCHAR *next_arg); /** - * Add another array. The parameter must be NULL + * Add another @a argv array. The @a argv parameter must be NULL * terminated. This only works in the state. Returns * -1 on failure and 0 on success. */ diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp index 4f343653905..f187980c14f 100644 --- a/ace/Acceptor.cpp +++ b/ace/Acceptor.cpp @@ -925,19 +925,18 @@ ACE_Oneshot_Acceptor::handle_close (ACE_HANDLE 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... - // 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->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_LIB_TEXT ("close\n"))); - } + if (this->peer_acceptor_.close () == -1) + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("close\n"))); return 0; } diff --git a/ace/Asynch_IO.h b/ace/Asynch_IO.h index 4ae52ea7c3c..035c4bb01dd 100644 --- a/ace/Asynch_IO.h +++ b/ace/Asynch_IO.h @@ -573,8 +573,8 @@ public: */ int read (ACE_Message_Block &message_block, size_t bytes_to_read, - u_long offset = 0, - u_long offset_high = 0, + unsigned long offset = 0, + unsigned long offset_high = 0, const void *act = 0, int priority = 0, int signal_number = ACE_SIGRTMIN); @@ -588,8 +588,8 @@ public: */ int readv (ACE_Message_Block &message_block, size_t bytes_to_read, - u_long offset = 0, - u_long offset_high = 0, + unsigned long offset = 0, + unsigned long offset_high = 0, const void *act = 0, int priority = 0, int signal_number = ACE_SIGRTMIN); @@ -707,8 +707,8 @@ public: */ int write (ACE_Message_Block &message_block, size_t bytes_to_write, - u_long offset = 0, - u_long offset_high = 0, + unsigned long offset = 0, + unsigned long offset_high = 0, const void *act = 0, int priority = 0, int signal_number = ACE_SIGRTMIN); @@ -722,8 +722,8 @@ public: */ int writev (ACE_Message_Block &message_block, size_t bytes_to_write, - u_long offset = 0, - u_long offset_high = 0, + unsigned long offset = 0, + unsigned long offset_high = 0, const void *act = 0, int priority = 0, int signal_number = ACE_SIGRTMIN); @@ -1067,10 +1067,10 @@ public: int transmit_file (ACE_HANDLE file, Header_And_Trailer *header_and_trailer = 0, size_t bytes_to_write = 0, - u_long offset = 0, - u_long offset_high = 0, + unsigned long offset = 0, + unsigned long offset_high = 0, size_t bytes_per_send = 0, - u_long flags = 0, + unsigned long flags = 0, const void *act = 0, int priority = 0, int signal_number = ACE_SIGRTMIN); diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp index 117eb19e7e3..5d8b9dd9546 100644 --- a/ace/CDR_Stream.cpp +++ b/ace/CDR_Stream.cpp @@ -1616,6 +1616,12 @@ ACE_InputCDR::reset_contents (void) // -------------------------------------------------------------- +ACE_WChar_Codeset_Translator::~ACE_WChar_Codeset_Translator (void) +{ +} + +// -------------------------------------------------------------- + ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, const ACE_CString &x) { diff --git a/ace/CDR_Stream.h b/ace/CDR_Stream.h index 43924328cc4..1ca00bc0c1d 100644 --- a/ace/CDR_Stream.h +++ b/ace/CDR_Stream.h @@ -1072,7 +1072,7 @@ protected: class ACE_Export ACE_WChar_Codeset_Translator { public: - virtual ~ACE_WChar_Codeset_Translator () {} + virtual ~ACE_WChar_Codeset_Translator (); virtual ACE_CDR::Boolean read_wchar (ACE_InputCDR&, ACE_CDR::WChar&) = 0; diff --git a/ace/Capabilities.cpp b/ace/Capabilities.cpp index c899c1a8a48..741041bc9e4 100644 --- a/ace/Capabilities.cpp +++ b/ace/Capabilities.cpp @@ -254,7 +254,7 @@ ACE_Capabilities::getval (const ACE_TCHAR *keyname, ACE_TString &val) return -1; ACE_StringCapEntry *scap = - ACE_dynamic_cast (ACE_StringCapEntry *, cap); + dynamic_cast (cap); if (scap == 0) return -1; @@ -270,7 +270,7 @@ ACE_Capabilities::getval (const ACE_TCHAR *keyname, int &val) return -1; ACE_IntCapEntry *icap = - ACE_dynamic_cast (ACE_IntCapEntry *, cap); + dynamic_cast (cap); if (icap != 0) { val = icap->getval (); @@ -278,7 +278,7 @@ ACE_Capabilities::getval (const ACE_TCHAR *keyname, int &val) } ACE_BoolCapEntry *bcap = - ACE_dynamic_cast (ACE_BoolCapEntry *, cap); + dynamic_cast (cap); if (bcap == 0) return -1; @@ -357,19 +357,10 @@ 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>; -// I'm not sure that these instantiations are necessary for any -// platform. But it definitely won't compile on VxWorks due to a -// conflict with the template specializations in Functor_String.h -#if !defined(VXWORKS) -template class ACE_Hash; -template class ACE_Equal_To; -#endif /* VXWORKS */ #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #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/Condition_Recursive_Thread_Mutex.cpp b/ace/Condition_Recursive_Thread_Mutex.cpp index 72270ff44d6..509b0a1c2be 100644 --- a/ace/Condition_Recursive_Thread_Mutex.cpp +++ b/ace/Condition_Recursive_Thread_Mutex.cpp @@ -80,7 +80,7 @@ ACE_Condition::wait (ACE_Recursive_Thread_Mutex &mut &mutex.get_nesting_mutex ()) : ACE_OS::cond_timedwait (&this->cond_, &mutex.get_nesting_mutex (), - (ACE_Time_Value *) abstime); + const_cast (abstime)); // We are holding the mutex, whether the wait succeeded or failed. // Stash errno (in case it failed) and then we need to reset the // recursive mutex state to what it was on entry to this method. diff --git a/ace/Condition_Thread_Mutex.cpp b/ace/Condition_Thread_Mutex.cpp index 0c50c0c0373..a04e2b30847 100644 --- a/ace/Condition_Thread_Mutex.cpp +++ b/ace/Condition_Thread_Mutex.cpp @@ -109,7 +109,7 @@ ACE_Condition_Thread_Mutex::wait (ACE_Thread_Mutex &mutex, // ACE_TRACE ("ACE_Condition_Thread_Mutex::wait"); return ACE_OS::cond_timedwait (&this->cond_, &mutex.lock_, - (ACE_Time_Value *) abstime); + const_cast (abstime)); } int diff --git a/ace/Configuration.cpp b/ace/Configuration.cpp index dbfe4539fd5..5f71e30aa24 100644 --- a/ace/Configuration.cpp +++ b/ace/Configuration.cpp @@ -1,6 +1,7 @@ // $Id$ #include "ace/Configuration.h" #include "ace/Auto_Ptr.h" +#include "ace/SString.h" #include "ace/OS_NS_string.h" // Can remove this when import_config and export_config are removed from @@ -1071,8 +1072,7 @@ 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)); + ACE_Section_Key_Win32* pKey = dynamic_cast (get_internal_key (key)); if (!pKey) return -1; @@ -1463,8 +1463,7 @@ ACE_Configuration_Heap::load_key (const ACE_Configuration_Section_Key& key, { ACE_ASSERT (this->allocator_); ACE_Configuration_Section_Key_Heap* pKey = - ACE_dynamic_cast (ACE_Configuration_Section_Key_Heap*, - get_internal_key (key)); + dynamic_cast (get_internal_key (key)); if (!pKey) { @@ -1807,8 +1806,7 @@ ACE_Configuration_Heap::enumerate_values (const ACE_Configuration_Section_Key& k { ACE_ASSERT (this->allocator_); ACE_Configuration_Section_Key_Heap* pKey = - ACE_dynamic_cast (ACE_Configuration_Section_Key_Heap*, - get_internal_key (key)); + dynamic_cast (get_internal_key (key)); if (!pKey) return -1; @@ -1857,8 +1855,7 @@ ACE_Configuration_Heap::enumerate_sections (const ACE_Configuration_Section_Key& ACE_ASSERT (this->allocator_); // cast to a heap section key ACE_Configuration_Section_Key_Heap* pKey = - ACE_dynamic_cast (ACE_Configuration_Section_Key_Heap*, - get_internal_key (key)); + dynamic_cast (get_internal_key (key)); if (!pKey) return -1; // not a heap key! diff --git a/ace/Configuration.h b/ace/Configuration.h index eac6923eb70..74ab0728b26 100644 --- a/ace/Configuration.h +++ b/ace/Configuration.h @@ -31,11 +31,12 @@ #define ACE_CONFIGURATION_H #include /**/ "ace/pre.h" -#include "ace/SString.h" +#include "ace/SStringfwd.h" #include "ace/Hash_Map_With_Allocator_T.h" #include "ace/Malloc.h" #include "ace/Synch_Traits.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ @@ -521,7 +522,7 @@ public: const ACE_TCHAR* name, VALUETYPE& type); - /// Removes the the value from . returns non zero on error + /// Removes the the value @a name from @a key. returns non zero on error virtual int remove_value (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name); diff --git a/ace/Connector.cpp b/ace/Connector.cpp index bbe2119947e..f5818a14486 100644 --- a/ace/Connector.cpp +++ b/ace/Connector.cpp @@ -375,9 +375,9 @@ ACE_Connector::connect_i int use_reactor = synch_options[ACE_Synch_Options::USE_REACTOR]; if (use_reactor) - timeout = (ACE_Time_Value *) &ACE_Time_Value::zero; + timeout = const_cast (&ACE_Time_Value::zero); else - timeout = (ACE_Time_Value *) synch_options.time_value (); + timeout = const_cast (synch_options.time_value ()); int result; if (sh_copy == 0) @@ -486,7 +486,7 @@ ACE_Connector::cancel (SVC_HANDLER *sh) ACE_Event_Handler_var safe_handler (handler); NBCH *nbch = - ACE_dynamic_cast (NBCH *, handler); + dynamic_cast (handler); if (nbch == 0) return -1; @@ -667,7 +667,7 @@ ACE_Connector::close (void) ACE_Event_Handler_var safe_handler (handler); NBCH *nbch = - ACE_dynamic_cast (NBCH *, handler); + dynamic_cast (handler); ACE_ASSERT (nbch != 0); diff --git a/ace/Containers_T.cpp b/ace/Containers_T.cpp index 226bfd54012..1b7ecfca264 100644 --- a/ace/Containers_T.cpp +++ b/ace/Containers_T.cpp @@ -1074,7 +1074,7 @@ ACE_Fixed_Set_Iterator_Base::advance (void) if (this->iterated_items_ < this->s_.cur_size_) { for (++this->next_; - ACE_static_cast(size_t, this->next_) < this->s_.max_size_; + static_cast (this->next_) < this->s_.max_size_; ++this->next_) if (this->s_.search_structure_[this->next_].is_free_ == 0) { @@ -1111,7 +1111,7 @@ ACE_Fixed_Set_Iterator_Base::next_i (T *&item) { ACE_TRACE ("ACE_Fixed_Set_Iterator_Base::next_i"); - if (ACE_static_cast(size_t, this->next_) < this->s_.max_size_) + if (static_cast (this->next_) < this->s_.max_size_) do { if (this->s_.search_structure_[this->next_].is_free_ == 0) diff --git a/ace/Dev_Poll_Reactor.cpp b/ace/Dev_Poll_Reactor.cpp index bbc9473f615..b8d8eb3530d 100644 --- a/ace/Dev_Poll_Reactor.cpp +++ b/ace/Dev_Poll_Reactor.cpp @@ -11,6 +11,7 @@ ACE_RCSID (ace, # include "ace/OS_NS_unistd.h" # include "ace/OS_NS_fcntl.h" +# include "ace/OS_NS_stropts.h" # if defined (ACE_HAS_EVENT_POLL) && defined (linux) # include /**/ @@ -59,7 +60,7 @@ ACE_Dev_Poll_Reactor_Notify::open (ACE_Reactor_Impl *r, if (disable_notify_pipe == 0) { - this->dp_reactor_ = ACE_dynamic_cast (ACE_Dev_Poll_Reactor *, r); + this->dp_reactor_ = dynamic_cast (r); if (this->dp_reactor_ == 0) { @@ -180,11 +181,13 @@ ACE_Dev_Poll_Reactor_Notify::notify (ACE_Event_Handler *eh, ACE_ASSERT (temp != 0); *temp = buffer; + ACE_Dev_Poll_Handler_Guard eh_guard (eh); + if (notify_queue_.enqueue_tail (temp) == -1) return -1; - // Let us send a notify for every message - // if (notification_required) + // Now pop the pipe to force the callback for dispatching when ready. + // @todo - this only needs to write one byte for ACE_HAS_NOTIFICATION_QUEUE. ssize_t n = ACE::send (this->notification_pipe_.write_handle (), (char *) &buffer, sizeof buffer, @@ -192,10 +195,17 @@ ACE_Dev_Poll_Reactor_Notify::notify (ACE_Event_Handler *eh, if (n == -1) return -1; + // Since the notify is queued (and maybe already delivered by now) + // we can simply release the guard. The dispatch of this notification + // will decrement the reference count. + eh_guard.release (); + return 0; #else ACE_Notification_Buffer buffer (eh, mask); + ACE_Dev_Poll_Handler_Guard eh_guard (eh); + ssize_t n = ACE::send (this->notification_pipe_.write_handle (), (char *) &buffer, sizeof buffer, @@ -203,6 +213,8 @@ ACE_Dev_Poll_Reactor_Notify::notify (ACE_Event_Handler *eh, if (n == -1) return -1; + eh_guard.release (); + return 0; #endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ } @@ -382,6 +394,7 @@ ACE_Dev_Poll_Reactor_Notify::dispatch_notify (ACE_Notification_Buffer &buffer) ACE_LIB_TEXT ("enqueue_head")), -1); } +#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ // If eh == 0 then another thread is unblocking the // ACE_Dev_Poll_Reactor to update the ACE_Dev_Poll_Reactor's @@ -390,6 +403,10 @@ ACE_Dev_Poll_Reactor_Notify::dispatch_notify (ACE_Notification_Buffer &buffer) // pointer we've been passed. if (buffer.eh_ != 0) { + // Guard the handler's refcount. Recall that when the notify + // was queued, the refcount was incremented, so it need not be + // now. The guard insures that it is decremented properly. + ACE_Dev_Poll_Handler_Guard eh_guard (buffer.eh_, false); switch (buffer.mask_) { @@ -413,44 +430,6 @@ ACE_Dev_Poll_Reactor_Notify::dispatch_notify (ACE_Notification_Buffer &buffer) buffer.eh_->handle_close (ACE_INVALID_HANDLE, ACE_Event_Handler::EXCEPT_MASK); } -#else - // If eh == 0 then another thread is unblocking the - // ACE_Dev_Poll_Reactor to update the ACE_Dev_Poll_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) - { - 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; - case ACE_Event_Handler::QOS_MASK: - result = buffer.eh_->handle_qos (ACE_INVALID_HANDLE); - break; - case ACE_Event_Handler::GROUP_QOS_MASK: - result = buffer.eh_->handle_group_qos (ACE_INVALID_HANDLE); - break; - default: - // Should we bail out if we get an invalid mask? - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("invalid mask = %d\n"), - buffer.mask_)); - } - if (result == -1) - buffer.eh_->handle_close (ACE_INVALID_HANDLE, - ACE_Event_Handler::EXCEPT_MASK); - } - -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ return 1; } @@ -1188,7 +1167,21 @@ ACE_Dev_Poll_Reactor::handle_events_i (ACE_Time_Value *max_wait_time) if (result == 0 || (result == -1 && errno == ETIME)) return 0; else if (result == -1) - return -1; + { + if (errno != EINTR) + return -1; + + // Bail out -- we got here since the poll was interrupted. + // If it was due to a signal registered through our ACE_Sig_Handler, + // then it was dispatched, so we count it in the number of events + // handled rather than cause an error return. + if (ACE_Sig_Handler::sig_pending () != 0) + { + ACE_Sig_Handler::sig_pending (0); + return 1; + } + return -1; + } // Dispatch the events, if any. return this->dispatch (); @@ -1225,45 +1218,15 @@ ACE_Dev_Poll_Reactor::dispatch (void) // Perform the Template Method for dispatching all the handlers. - // First check for interrupts. - if (0 /* active_handle_count == -1 */) - { - // Bail out -- we got here since the poll (i.e. ioctl()) was - // interrupted. - if (ACE_Sig_Handler::sig_pending () != 0) - { - ACE_Sig_Handler::sig_pending (0); - -#if 0 - // If any HANDLES in the are activated as a - // result of signals they should be dispatched since - // they may be time critical... - pfds = this->ready_set_.pfds; - active_handle_count = this->ready_set_.nfds; -#endif /* 0 */ - - // 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) + 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 (0 /* active_handle_count == 0 */) - return io_handlers_dispatched - + other_handlers_dispatched - + signal_occurred; #if 0 // Next dispatch the notification handlers (if there are any to @@ -1385,7 +1348,11 @@ ACE_Dev_Poll_Reactor::dispatch_io_events (int &io_handlers_dispatched) { // Modify the reference count in an exception-safe way. - ACE_Dev_Poll_Handler_Guard (this->handler_rep_, handle); + // Note that eh could be the notify handler. It's not strictly + // necessary to manage its refcount, but since we don't enable + // the counting policy, it won't do much. Management of the + // notified handlers themselves is done in the notify handler. + ACE_Dev_Poll_Handler_Guard eh_guard (eh); // Release the lock during the upcall. ACE_Reverse_Lock reverse_lock (this->lock_); @@ -1401,6 +1368,8 @@ ACE_Dev_Poll_Reactor::dispatch_io_events (int &io_handlers_dispatched) if (ACE_BIT_ENABLED (revents, POLLOUT)) #endif /* ACE_HAS_EVENT_POLL */ { + ++io_handlers_dispatched; + const int status = this->upcall (eh, &ACE_Event_Handler::handle_output, handle); @@ -1411,8 +1380,6 @@ ACE_Dev_Poll_Reactor::dispatch_io_events (int &io_handlers_dispatched) return this->remove_handler (handle, ACE_Event_Handler::WRITE_MASK); } - - ++io_handlers_dispatched; } // Dispatch all "high priority" (e.g. out-of-band data) events. @@ -1422,6 +1389,8 @@ ACE_Dev_Poll_Reactor::dispatch_io_events (int &io_handlers_dispatched) if (ACE_BIT_ENABLED (revents, POLLPRI)) #endif /* ACE_HAS_EVENT_POLL */ { + ++io_handlers_dispatched; + const int status = this->upcall (eh, &ACE_Event_Handler::handle_exception, handle); @@ -1432,8 +1401,6 @@ ACE_Dev_Poll_Reactor::dispatch_io_events (int &io_handlers_dispatched) return this->remove_handler (handle, ACE_Event_Handler::EXCEPT_MASK); } - - ++io_handlers_dispatched; } // Dispatch all input events. @@ -1443,6 +1410,8 @@ ACE_Dev_Poll_Reactor::dispatch_io_events (int &io_handlers_dispatched) if (ACE_BIT_ENABLED (revents, POLLIN)) #endif /* ACE_HAS_EVENT_POLL */ { + ++io_handlers_dispatched; + const int status = this->upcall (eh, &ACE_Event_Handler::handle_input, handle); @@ -1453,8 +1422,6 @@ ACE_Dev_Poll_Reactor::dispatch_io_events (int &io_handlers_dispatched) return this->remove_handler (handle, ACE_Event_Handler::READ_MASK); } - - ++io_handlers_dispatched; } } // The reactor lock is reacquired upon leaving this scope. } @@ -1722,7 +1689,16 @@ ACE_Dev_Poll_Reactor::remove_handler_i (ACE_HANDLE handle, return -1; if (ACE_BIT_DISABLED (mask, ACE_Event_Handler::DONT_CALL)) - (void) eh->handle_close (handle, mask); + { + // Release the lock during the "close" upcall. + ACE_Reverse_Lock reverse_lock (this->lock_); + ACE_GUARD_RETURN (ACE_Reverse_Lock, + reverse_guard, + reverse_lock, + -1); + + (void) eh->handle_close (handle, mask); + } // Note the fact that we've changed the state of the wait_set, // i.e. the "interest set," which is used by the dispatching loop to @@ -2249,13 +2225,11 @@ ACE_Dev_Poll_Reactor::wakeup_all_threads (void) { ACE_TRACE ("ACE_Dev_Poll_Reactor::wakeup_all_threads"); -#if 0 // 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); -#endif /* 0 */ } int diff --git a/ace/Dev_Poll_Reactor.h b/ace/Dev_Poll_Reactor.h index 693a3005eb8..9d722650351 100644 --- a/ace/Dev_Poll_Reactor.h +++ b/ace/Dev_Poll_Reactor.h @@ -29,6 +29,8 @@ // The sys_epoll interface was introduced in Linux kernel 2.5.45. // Don't support backported versions since they appear to be buggy. // The obsolete ioctl()-based interface is no longer supported. +#if 0 +// linux/version.h may not be accurate. It's not for Fedora Core 2... # include /**/ # if LINUX_VERSION_CODE < KERNEL_VERSION (2,5,45) # undef ACE_HAS_EVENT_POLL @@ -36,6 +38,7 @@ # error Linux kernel 2.5.45 or better is required. # endif /* LINUX_VERSION_CODE < KERNEL_VERSION (2,5,45) */ #endif /* ACE_HAS_EVENT_POLL */ +#endif #if defined (ACE_HAS_EVENT_POLL) && defined (ACE_HAS_DEV_POLL) # error ACE_HAS_EVENT_POLL and ACE_HAS_DEV_POLL are mutually exclusive. @@ -55,7 +58,9 @@ class ACE_Sig_Handler; class ACE_Dev_Poll_Reactor; +#if defined (ACE_HAS_DEV_POLL) struct pollfd; +#endif /** * @class ACE_Dev_Poll_Event_Tuple @@ -91,23 +96,6 @@ public: /// Flag that states whether or not the event handler is suspended. char suspended; - - /// The number of outstanding upcalls occurring on the above event - /// handler. - /** - * @todo The reference count should really be maintained within the - * event handler. This approach was taken to allow for - * backward compatibility and quick implementation. One - * approach for maintaining backward compatibility while - * implementing reference counting within the event handler is - * to create an ACE_Ref_Counted_Event_Handler "mix-in" class - * that concrete ACE_Event_Handlers can inherit from - * (i.e. multiple inheritance). Thus, legacy non-reference - * counted event handlers need not pay for reference counting - * resources. - */ - unsigned long refcount; - }; // --------------------------------------------------------------------- @@ -188,10 +176,10 @@ public: /** * Called by a thread when it wants to unblock the Reactor_Impl. - * This wakeups the Reactor_Impl if currently blocked. Pass over - * both the Event_Handler *and* the mask to allow the caller to + * This wakes up the Reactor_Impl if currently blocked. Pass over + * both the Event_Handler and the mask to allow the caller to * dictate which Event_Handler method the Reactor_Impl will - * invoke. The ACE_Time_Value indicates how long to blocking + * invoke. The ACE_Time_Value indicates how long to block * trying to notify the Reactor_Impl. If timeout == 0, the * caller will block until action is possible, else will wait until * the relative time specified in *timeout elapses). @@ -215,16 +203,15 @@ public: /// the Reactor_Impl. virtual ACE_HANDLE notify_handle (void); - /// Verify whether the buffer has dispatchable info or not. + /// Verify whether the buffer has dispatchable info or not. virtual int is_dispatchable (ACE_Notification_Buffer &buffer); - /// Handle one of the notify call on the handle. This could be + /// Handle one notify call represented in @a buffer. This could be /// because of a thread trying to unblock the Reactor_Impl. virtual int dispatch_notify (ACE_Notification_Buffer &buffer); - /// Read one of the notify call on the handle into the - /// buffer. This could be because of a thread trying to unblock - /// the Reactor_Impl. + /// Read one notify call on the handle into @a buffer. + /// This could be because of a thread trying to unblock the Reactor_Impl. virtual int read_notify_pipe (ACE_HANDLE handle, ACE_Notification_Buffer &buffer); @@ -392,21 +379,6 @@ public: /// Remove all the (@c ACE_HANDLE, @c ACE_Event_Handler) tuples. int unbind_all (void); - /// Increase the reference count on the event handler corresponding - /// to the given file descriptor. - /** - * @return Returns the updated reference count. - */ - unsigned long add_ref (ACE_HANDLE handle); - - /// Decrease the reference count on the event handler corresponding - /// to the given file descriptor. - /** - * @return Returns the updated reference count. - */ - unsigned long remove_ref (ACE_HANDLE handle); - //@} - /** * @name Sanity Checking * @@ -499,7 +471,7 @@ public: ACE_Reactor_Notify *notify = 0, int mask_signals = 1); - /// Initialize ACE_Dev_Poll_Reactor with size "@a size." + /// Initialize ACE_Dev_Poll_Reactor with size @a size. /** * @note On Unix platforms, the @a size parameter should be as large * as the maximum number of file descriptors allowed for a @@ -759,9 +731,11 @@ public: * @see reset_timer_interval() * * @param event_handler event handler to schedule on reactor - * @param arg argument passed to the handle_timeout() method of event_handler - * @param delay time interval after which the timer will expire - * @param interval time interval after which the timer will be automatically rescheduled + * @param arg argument passed to the handle_timeout() method of + * event_handler. + * @param delay time interval after which the timer will expire. + * @param interval time interval for which the timer will be + * automatically rescheduled. * @return -1 on failure, a timer_id value on success */ virtual long schedule_timer (ACE_Event_Handler *event_handler, @@ -785,19 +759,19 @@ public: int dont_call_handle_close = 1); /** - * Cancel the single Event_Handler that matches the value - * (which was returned from the schedule method). If arg is + * Cancel the single event handler that matches the @a timer_id value + * (which was returned from the schedule method). If @a 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 + * 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 + * Returns 1 if cancellation succeeded and 0 if the @a timer_id * wasn't found. */ virtual int cancel_timer (long timer_id, const void **arg = 0, int dont_call_handle_close = 1); - // = High-level Event_Handler scheduling operations + // = High-level event handler scheduling operations /// Add to the 's entry. /// must already have been registered. @@ -1185,12 +1159,14 @@ public: /// Constructor /** - * The constructor increments the reference count on the event - * handler corresponding to the given handle. + * The constructor checks to see if @a eh is a reference-counted handler and + * remember that for later. If @a eh is reference counted, its reference + * count is incremented unless @a do_incr is false. + * @a do_incr should be false if the reference count was incremented + * independently of this guard, for example, on a notify handler since + * the reference count is incremented when the notify is queued. */ - ACE_Dev_Poll_Handler_Guard ( - ACE_Dev_Poll_Reactor_Handler_Repository &repository, - ACE_HANDLE handle); + ACE_Dev_Poll_Handler_Guard (ACE_Event_Handler *eh, bool do_incr = true); /// Destructor /** @@ -1199,14 +1175,17 @@ public: */ ~ACE_Dev_Poll_Handler_Guard (void); + /// Release the event handler from this guard; when the destructor is + /// called, the handler's reference count will not be decremented. + void release (void); + private: - /// Reference to the handler repository containing the event handler - /// used during the upcall. - ACE_Dev_Poll_Reactor_Handler_Repository &repository_; + /// The event handler being managed. + ACE_Event_Handler *eh_; - /// Handle corresponding to the event being dispatched. - ACE_HANDLE handle_; + /// true if eh_ is a reference-counted handler. + bool refcounted_; }; diff --git a/ace/Dev_Poll_Reactor.inl b/ace/Dev_Poll_Reactor.inl index 74ff5c2dc2a..4445b882b5a 100644 --- a/ace/Dev_Poll_Reactor.inl +++ b/ace/Dev_Poll_Reactor.inl @@ -2,12 +2,13 @@ // // $Id$ +#include "ace/Log_Msg.h" + ACE_INLINE ACE_Dev_Poll_Event_Tuple::ACE_Dev_Poll_Event_Tuple (void) : event_handler (0), mask (ACE_Event_Handler::NULL_MASK), - suspended (0), - refcount (1) + suspended (0) { } @@ -91,57 +92,29 @@ ACE_Dev_Poll_Reactor_Handler_Repository::size (void) const return this->max_size_; } -ACE_INLINE unsigned long -ACE_Dev_Poll_Reactor_Handler_Repository::add_ref (ACE_HANDLE handle) -{ - // ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::add_ref"); - - // Caller provides synchronization - - if (this->handle_in_range (handle)) - return this->handlers_[handle].refcount++; - - return 0; -} - -ACE_INLINE unsigned long -ACE_Dev_Poll_Reactor_Handler_Repository::remove_ref (ACE_HANDLE handle) -{ - // ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::remove_ref"); - - // Caller provides synchronization - - if (this->handle_in_range (handle)) - { - unsigned long & refcount = this->handlers_[handle].refcount; - - ACE_ASSERT (refcount > 0); - - refcount--; - - if (refcount != 0) - return refcount; - - // Reference count dropped to zero. Remove the event handler - // from the repository. - this->unbind (handle); - } - - return 0; -} - // ----------------------------------------------------------------- ACE_INLINE -ACE_Dev_Poll_Handler_Guard::ACE_Dev_Poll_Handler_Guard ( - ACE_Dev_Poll_Reactor_Handler_Repository &repository, - ACE_HANDLE handle) - : repository_ (repository), - handle_ (handle) +ACE_Dev_Poll_Handler_Guard::ACE_Dev_Poll_Handler_Guard + (ACE_Event_Handler *eh, + bool do_incr) + : eh_ (eh), + refcounted_ (false) { - // Caller must provide synchronization. + if (eh == 0) + return; + + this->refcounted_ = + eh->reference_counting_policy ().value () == + ACE_Event_Handler::Reference_Counting_Policy::ENABLED; - (void) repository.add_ref (handle); + if (do_incr && this->refcounted_) + eh->add_reference (); + + /** + * The below comments were here when I replaced the old refcount + * scheme was replaced. They may still need addressing. -Steve Huston + */ /** * @todo Suspend the handler so that other threads will not cause @@ -169,16 +142,25 @@ ACE_Dev_Poll_Handler_Guard::ACE_Dev_Poll_Handler_Guard ( ACE_INLINE ACE_Dev_Poll_Handler_Guard::~ACE_Dev_Poll_Handler_Guard (void) { - // Caller must provide synchronization. - - (void) this->repository_.remove_ref (this->handle_); + if (this->refcounted_ && this->eh_ != 0) + this->eh_->remove_reference (); + /** + * The below comments were here when I replaced the old refcount + * scheme was replaced. They may still need addressing. -Steve Huston + */ /** * @todo Resume the handler so that other threads will be allowed to * dispatch the handler. */ } +ACE_INLINE void +ACE_Dev_Poll_Handler_Guard::release (void) +{ + this->eh_ = 0; +} + // --------------------------------------------------------------------- ACE_INLINE int diff --git a/ace/Dump.cpp b/ace/Dump.cpp index e0f98640593..380be07f857 100644 --- a/ace/Dump.cpp +++ b/ace/Dump.cpp @@ -40,8 +40,8 @@ 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; + delete const_cast (this->dumper_); + (const_cast (this))->dumper_ = dumper; } } diff --git a/ace/Dynamic_Service.cpp b/ace/Dynamic_Service.cpp index 404916d4528..9178889675c 100644 --- a/ace/Dynamic_Service.cpp +++ b/ace/Dynamic_Service.cpp @@ -21,7 +21,7 @@ ACE_Dynamic_Service::instance (const ACE_TCHAR *name) { ACE_Service_Object *svc_obj = static_cast (ACE_Dynamic_Service_Base::instance (name)); - return ACE_dynamic_cast (TYPE *, svc_obj); + return dynamic_cast (svc_obj); } ACE_RCSID(ace, Dynamic_Service, "$Id$") diff --git a/ace/Event.cpp b/ace/Event.cpp index 06c14937acd..fde6f78840c 100644 --- a/ace/Event.cpp +++ b/ace/Event.cpp @@ -55,7 +55,7 @@ int ACE_Event::wait (const ACE_Time_Value *abstime, int use_absolute_time) { return ACE_OS::event_timedwait (&this->handle_, - (ACE_Time_Value *) abstime, + const_cast (abstime), use_absolute_time); } diff --git a/ace/Event_Handler.cpp b/ace/Event_Handler.cpp index 5db15c15e41..5ea84a6c9a3 100644 --- a/ace/Event_Handler.cpp +++ b/ace/Event_Handler.cpp @@ -249,7 +249,7 @@ ACE_Event_Handler::reference_counting_policy (void) ACE_THR_FUNC_RETURN ACE_Event_Handler::read_adapter (void *args) { - ACE_Event_Handler *this_ptr = (ACE_Event_Handler *) args; + ACE_Event_Handler *this_ptr = static_cast (args); ACE_HANDLE handle = this_ptr->get_handle (); if (handle == ACE_INVALID_HANDLE) @@ -275,7 +275,7 @@ ACE_Event_Handler::register_stdin_handler (ACE_Event_Handler *eh, ACE_UNUSED_ARG (reactor); eh->reactor (reactor); - return thr_mgr->spawn (&read_adapter, (void *) eh, flags); + return thr_mgr->spawn (&read_adapter, static_cast (eh), flags); #else // Keep compilers happy. ACE_UNUSED_ARG (flags); diff --git a/ace/FILE.cpp b/ace/FILE.cpp index 2f15a3135b1..de7c294cc6e 100644 --- a/ace/FILE.cpp +++ b/ace/FILE.cpp @@ -108,7 +108,7 @@ ACE_FILE::get_local_addr (ACE_Addr &addr) const // Perform the downcast since had better be an // . ACE_FILE_Addr *file_addr = - ACE_dynamic_cast (ACE_FILE_Addr *, &addr); + dynamic_cast (&addr); if (file_addr == 0) return -1; diff --git a/ace/Filecache.cpp b/ace/Filecache.cpp index 8d3ded1a4b6..ace8bc594a4 100644 --- a/ace/Filecache.cpp +++ b/ace/Filecache.cpp @@ -10,7 +10,9 @@ #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_fcntl.h" -ACE_RCSID(ace, Filecache, "$Id$") +ACE_RCSID (ace, + Filecache, + "$Id$") #if defined (ACE_WIN32) // Specifies no sharing flags. @@ -111,7 +113,7 @@ ACE_Filecache_Handle::handle (void) const if (this->handle_ == ACE_INVALID_HANDLE && this->file_ != 0) { ACE_Filecache_Handle *mutable_this = - (ACE_Filecache_Handle *) this; + const_cast (this); mutable_this->handle_ = ACE_OS::dup (this->file_->handle ()); } return this->handle_; @@ -139,26 +141,27 @@ ACE_Filecache_Handle::size (void) const // ACE_Filecache_Hash // ------------------ -#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) - #define ACE_Filecache_Hash \ ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> #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_LIB_TEXT (""))), +template <> +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_LIB_TEXT (""))), int_id_ (int_id), next_ (next), prev_ (prev) { } -ACE_TEMPLATE_SPECIALIZATION +template <> ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (ACE_Filecache_Hash_Entry *next, ACE_Filecache_Hash_Entry *prev) : ext_id_ (0), @@ -167,7 +170,7 @@ ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (ACE_Filecache_Hash_Entry *next, { } -ACE_TEMPLATE_SPECIALIZATION +template <> ACE_Filecache_Hash_Entry::~ACE_Hash_Map_Entry (void) { ACE_OS::free ((void *) ext_id_); @@ -176,16 +179,17 @@ ACE_Filecache_Hash_Entry::~ACE_Hash_Map_Entry (void) // 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 +template <> unsigned long ACE_Filecache_Hash::hash (const ACE_TCHAR *const &ext_id) { return ACE::hash_pjw (ext_id); } -ACE_TEMPLATE_SPECIALIZATION +template <> int -ACE_Filecache_Hash::equal (const ACE_TCHAR *const &id1, const ACE_TCHAR *const &id2) +ACE_Filecache_Hash::equal (const ACE_TCHAR *const &id1, + const ACE_TCHAR *const &id2) { return ACE_OS::strcmp (id1, id2) == 0; } @@ -193,8 +197,6 @@ ACE_Filecache_Hash::equal (const ACE_TCHAR *const &id1, const ACE_TCHAR *const & #undef ACE_Filecache_Hash #undef ACE_Filecache_Hash_Entry -#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ - // ------------- // ACE_Filecache @@ -745,31 +747,15 @@ ACE_Filecache_Object::update (void) const } #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_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_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_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_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 index 036468b7f14..c6986bd465d 100644 --- a/ace/Filecache.h +++ b/ace/Filecache.h @@ -23,7 +23,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Hash_Map_Manager_T.h" -#include "ace/SString.h" #include "ace/Null_Mutex.h" #include "ace/Synch_Traits.h" #include "ace/RW_Thread_Mutex.h" @@ -148,23 +147,11 @@ private: int mapit_; }; -#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION) - typedef ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> ACE_Filecache_Hash; typedef ACE_Hash_Map_Entry ACE_Filecache_Hash_Entry; -#else - -typedef ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_Null_Mutex> - ACE_Filecache_Hash; - -typedef ACE_Filecache_Hash::ENTRY ACE_Filecache_Hash_Entry; - -#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */ - - /** * @class ACE_Filecache * diff --git a/ace/FlReactor.cpp b/ace/FlReactor.cpp index 1b15981844b..1eed0acf20d 100644 --- a/ace/FlReactor.cpp +++ b/ace/FlReactor.cpp @@ -4,8 +4,6 @@ ACE_RCSID(ace, FlReactor, "$Id$") -#if defined (ACE_HAS_FL) - #include /**/ ACE_ALLOC_HOOK_DEFINE (ACE_FlReactor) @@ -326,5 +324,3 @@ ACE_FlReactor::cancel_timer (long timer_id, return 0; } } - -#endif /* ACE_HAS_FL */ diff --git a/ace/FlReactor.h b/ace/FlReactor.h index d0c7867bc7a..b1813fdd9bd 100644 --- a/ace/FlReactor.h +++ b/ace/FlReactor.h @@ -25,8 +25,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#if defined (ACE_HAS_FL) - +#include "ace/ACE_FlReactor_export.h" #include "ace/Select_Reactor.h" /** @@ -42,7 +41,7 @@ * events. This class adapts this simple mechanisms so they are * compatible with ACE's Reactor. */ -class ACE_Export ACE_FlReactor : public ACE_Select_Reactor +class ACE_FlReactor_Export ACE_FlReactor : public ACE_Select_Reactor { public: @@ -103,7 +102,5 @@ private: ACE_FlReactor &operator = (const ACE_FlReactor &); }; -#endif /* ACE_HAS_FL */ - #include /**/ "ace/post.h" #endif /* ACE_FLREACTOR_H */ diff --git a/ace/Global_Macros.h b/ace/Global_Macros.h index c181ed86b78..0bdc038c1df 100644 --- a/ace/Global_Macros.h +++ b/ace/Global_Macros.h @@ -70,7 +70,7 @@ private: # define ACE_ITOA(X) #X // Create a string of a server address with a "host:port" format. -# define ACE_SERVER_ADDRESS(H,P) H":"P +# define ACE_SERVER_ADDRESS(H,P) H ACE_TEXT(":") P // A couple useful inline functions for checking whether bits are // enabled or disabled. @@ -96,13 +96,15 @@ private: # define ACE_UNIMPLEMENTED_FUNC(f) f; # endif /* ACE_NEEDS_FUNC_DEFINITIONS */ -// Easy way to designate that a class is used as a pseudo-namespace. -// Insures that g++ "friendship" anamolies are properly handled. -# define ACE_CLASS_IS_NAMESPACE(CLASSNAME) \ -private: \ -CLASSNAME (void); \ -CLASSNAME (const CLASSNAME&); \ -friend class ace_dewarn_gplusplus +#if !defined (ACE_LACKS_DEPRECATED_MACROS) + // Easy way to designate that a class is used as a pseudo-namespace. + // Insures that g++ "friendship" anamolies are properly handled. + # define ACE_CLASS_IS_NAMESPACE(CLASSNAME) \ + private: \ + CLASSNAME (void); \ + CLASSNAME (const CLASSNAME&); \ + friend class ace_dewarn_gplusplus +#endif /* ACE_LACKS_DEPRECATED_MACROS */ // ---------------------------------------------------------------- @@ -132,21 +134,23 @@ friend class ace_dewarn_gplusplus # endif /* ! ACE_HAS_BROKEN_NAMESPACES */ # endif /* !ACE_NESTED_CLASS */ -/** - * @name CORBA namespace macros. - * - * CORBA namespace macros. - * - * @deprecated These macros were formerly used by TAO but are now - * deprecated, and only remain to retain some backward - * compatibility. They will be removed in a future ACE - * release. - */ -//@{ -# define ACE_CORBA_1(NAME) CORBA::NAME -# define ACE_CORBA_2(TYPE, NAME) CORBA::TYPE::NAME -# define ACE_CORBA_3(TYPE, NAME) CORBA::TYPE::NAME -//@} +#if !defined (ACE_LACKS_DEPRECATED_MACROS) + /** + * @name CORBA namespace macros. + * + * CORBA namespace macros. + * + * @deprecated These macros were formerly used by TAO but are now + * deprecated, and only remain to retain some backward + * compatibility. They will be removed in a future ACE + * release. + */ + //@{ + # define ACE_CORBA_1(NAME) CORBA::NAME + # define ACE_CORBA_2(TYPE, NAME) CORBA::TYPE::NAME + # define ACE_CORBA_3(TYPE, NAME) CORBA::TYPE::NAME + //@} +#endif /* ACE_LACKS_DEPRECATED_MACROS */ // ---------------------------------------------------------------- diff --git a/ace/Hash_Map_Manager_T.inl b/ace/Hash_Map_Manager_T.inl index d1b05afa492..05383a07e69 100644 --- a/ace/Hash_Map_Manager_T.inl +++ b/ace/Hash_Map_Manager_T.inl @@ -202,8 +202,8 @@ ACE_Hash_Map_Manager_Ex::find INT_ID &int_id) const { ACE_Hash_Map_Manager_Ex *nc_this = - (ACE_Hash_Map_Manager_Ex *) - this; + const_cast *> + (this); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1); @@ -214,8 +214,9 @@ template ::find (const EXT_ID &ext_id) const { ACE_Hash_Map_Manager_Ex *nc_this = - (ACE_Hash_Map_Manager_Ex *) - this; + const_cast *> + (this); + ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1); return nc_this->find_i (ext_id); @@ -234,8 +235,8 @@ ACE_Hash_Map_Manager_Ex::find ACE_Hash_Map_Entry *&entry) const { ACE_Hash_Map_Manager_Ex *nc_this = - (ACE_Hash_Map_Manager_Ex *) - this; + const_cast *> + (this); ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1); diff --git a/ace/Hashable.inl b/ace/Hashable.inl index 4938b231fab..69f6c3312a0 100644 --- a/ace/Hashable.inl +++ b/ace/Hashable.inl @@ -24,7 +24,7 @@ ACE_Hashable::hash (void) const // relative to the simple comparison. if (this->hash_value_ == 0) - ((ACE_Hashable *) this)->hash_value_ = this->hash_i (); + (const_cast (this))->hash_value_ = this->hash_i (); return this->hash_value_; } diff --git a/ace/ICMP_Socket.cpp b/ace/ICMP_Socket.cpp index a80297f8a10..e7ed0435be8 100644 --- a/ace/ICMP_Socket.cpp +++ b/ace/ICMP_Socket.cpp @@ -7,6 +7,7 @@ #include "ace/ACE.h" #include "ace/Log_Msg.h" #include "ace/OS_NS_netdb.h" +#include "ace/OS_NS_sys_socket.h" #if !defined (__ACE_INLINE__) # include "ace/ICMP_Socket.inl" diff --git a/ace/ICMP_Socket.h b/ace/ICMP_Socket.h index 02138656d61..b9dec78cd20 100644 --- a/ace/ICMP_Socket.h +++ b/ace/ICMP_Socket.h @@ -25,6 +25,7 @@ #if defined (ACE_HAS_ICMP_SUPPORT) && (ACE_HAS_ICMP_SUPPORT == 1) #include "ace/SOCK.h" +#include "ace/Time_Value.h" #include "ace/os_include/netinet/os_in.h" namespace ACE diff --git a/ace/LSOCK_Acceptor.cpp b/ace/LSOCK_Acceptor.cpp index 7d700f5e566..e8674429e77 100644 --- a/ace/LSOCK_Acceptor.cpp +++ b/ace/LSOCK_Acceptor.cpp @@ -19,7 +19,7 @@ ACE_LSOCK_Acceptor::get_local_addr (ACE_Addr &a) const { ACE_TRACE ("ACE_LSOCK_Acceptor::get_local_addr"); - ACE_UNIX_Addr& target = ACE_dynamic_cast (ACE_UNIX_Addr &, a); + ACE_UNIX_Addr& target = dynamic_cast (a); target = this->local_addr_; diff --git a/ace/LSOCK_Stream.cpp b/ace/LSOCK_Stream.cpp index 5b0cd23382f..d1246cec230 100644 --- a/ace/LSOCK_Stream.cpp +++ b/ace/LSOCK_Stream.cpp @@ -22,7 +22,7 @@ ACE_LSOCK_Stream::get_local_addr (ACE_Addr &addr) const // Perform the downcast since had better be an // . - ACE_UNIX_Addr *rhs_unix_addr = ACE_dynamic_cast (ACE_UNIX_Addr *, &addr); + ACE_UNIX_Addr *rhs_unix_addr = dynamic_cast (&addr); ACE_UNIX_Addr lhs_unix_addr; if (rhs_unix_addr == 0) @@ -72,7 +72,7 @@ ACE_LSOCK_Stream::send_msg (const iovec iov[], cmsghdr *cmsgptr = (cmsghdr *) cmsgbuf; #endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ - send_msg.msg_iov = (iovec *) iov; + send_msg.msg_iov = const_cast (iov); send_msg.msg_iovlen = n; send_msg.msg_name = 0; send_msg.msg_namelen = 0; diff --git a/ace/Local_Name_Space.cpp b/ace/Local_Name_Space.cpp index 6cc578a7f8c..d7382c3266c 100644 --- a/ace/Local_Name_Space.cpp +++ b/ace/Local_Name_Space.cpp @@ -1,10 +1,7 @@ -#ifndef ACE_LOCAL_NAME_SPACE_CPP -#define ACE_LOCAL_NAME_SPACE_CPP - -#include "ace/ACE.h" #include "ace/Local_Name_Space.h" -#include "ace/OS_NS_string.h" #include "ace/RW_Process_Mutex.h" +#include "ace/SString.h" +#include "ace/OS_NS_string.h" ACE_RCSID (ace, Local_Name_Space, @@ -215,4 +212,3 @@ template class ACE_Write_Guard; #pragma instantiate ACE_Write_Guard #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_LOCAL_NAME_SPACE_CPP */ diff --git a/ace/Local_Name_Space.h b/ace/Local_Name_Space.h index 1651119e55e..e8b8b4b39ca 100644 --- a/ace/Local_Name_Space.h +++ b/ace/Local_Name_Space.h @@ -17,13 +17,13 @@ #include /**/ "ace/pre.h" -#include "ace/SString.h" +#include "ace/Malloc_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Malloc_T.h" +class ACE_NS_WString; /** * @class ACE_NS_String diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp index beaa850dd31..8e0e72ef321 100644 --- a/ace/Log_Msg.cpp +++ b/ace/Log_Msg.cpp @@ -791,7 +791,7 @@ ACE_Log_Msg::open (const ACE_TCHAR *prog_name, else { status = - ACE_Log_Msg_Manager::log_backend_->open (logger_key); + ACE_Log_Msg_Manager::log_backend_->open (prog_name); } if (status == -1) @@ -804,8 +804,8 @@ ACE_Log_Msg::open (const ACE_TCHAR *prog_name, ACE_SET_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG); } } - else if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER) || - ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG)) + else if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER) + || ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG)) { // If we are closing down logger, redirect logging to stderr. ACE_CLR_BITS (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER); @@ -1787,8 +1787,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, // On some platforms sizeof (wchar_t) can be 2 // on the others 4 ... wchar_t wtchar = - ACE_static_cast(wchar_t, - va_arg (argp, int)); + static_cast (va_arg (argp, int)); #if defined (ACE_WIN32) # if defined (ACE_USES_WCHAR) ACE_OS::strcpy (fp, ACE_LIB_TEXT ("c")); diff --git a/ace/Log_Msg_UNIX_Syslog.cpp b/ace/Log_Msg_UNIX_Syslog.cpp index b502d1dd185..b4738161753 100644 --- a/ace/Log_Msg_UNIX_Syslog.cpp +++ b/ace/Log_Msg_UNIX_Syslog.cpp @@ -2,7 +2,7 @@ #include "ace/config-all.h" -#if !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SYSLOG) +#if !defined (ACE_LACKS_UNIX_SYSLOG) #include "ace/ACE.h" #include "ace/Log_Msg.h" @@ -200,4 +200,4 @@ ACE_Log_Msg_UNIX_Syslog::convert_log_mask (int lm_mask) return syslog_mask; } -#endif /* !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SYSLOG) */ +#endif /* !defined (ACE_LACKS_UNIX_SYSLOG) */ diff --git a/ace/Log_Msg_UNIX_Syslog.h b/ace/Log_Msg_UNIX_Syslog.h index 3e9940b27cc..46851c24f90 100644 --- a/ace/Log_Msg_UNIX_Syslog.h +++ b/ace/Log_Msg_UNIX_Syslog.h @@ -20,7 +20,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#if !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SYSLOG) +#if !defined (ACE_LACKS_UNIX_SYSLOG) #include "ace/Log_Msg_Backend.h" @@ -43,7 +43,7 @@ public: /** * Initialize the event logging facility. * @param logger_key The name of the calling program. This name is - * used as the @arg ident in the syslog entries. If + * used as the @c ident in the syslog entries. If * it is 0 (no name), the application name as * returned from ACE_Log_Msg::program_name() is used. */ @@ -66,7 +66,7 @@ private: int convert_log_mask (int lm_mask); }; -#endif /* !ACE_WIN32 && !ACE_HAS_WINCE */ +#endif /* !ACE_LACKS_UNIX_SYSLOG */ #include /**/ "ace/post.h" #endif /* ACE_LOG_MSG_UNIX_SYSLOG_H */ diff --git a/ace/Logging_Strategy.cpp b/ace/Logging_Strategy.cpp index 75d6011162b..fe6d4c5fc8c 100644 --- a/ace/Logging_Strategy.cpp +++ b/ace/Logging_Strategy.cpp @@ -382,9 +382,7 @@ ACE_Logging_Strategy::handle_timeout (const ACE_Time_Value &, const void *) { #if defined (ACE_LACKS_IOSTREAM_TOTALLY) - if ((size_t) ACE_OS::fseek (this->log_msg_->msg_ostream (), - 0, - SEEK_CUR) > this->max_size_) + if ((size_t) ACE_OS::ftell (this->log_msg_->msg_ostream ()) > this->max_size_) #else if ((size_t) this->log_msg_->msg_ostream ()->tellp () > this->max_size_) #endif /* ACE_LACKS_IOSTREAM_TOTALLY */ diff --git a/ace/MEM_Acceptor.h b/ace/MEM_Acceptor.h index d9771a1bf37..5e70bf080d3 100644 --- a/ace/MEM_Acceptor.h +++ b/ace/MEM_Acceptor.h @@ -65,9 +65,9 @@ public: /** * 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 + * @a local_sap is the address that we're going to listen for + * connections on. If @a reuse_addr is 1 then we'll use the + * @c SO_REUSEADDR to reuse this address. Returns 0 on success and * -1 on failure. */ int open (const ACE_MEM_Addr &local_sap, @@ -117,7 +117,7 @@ public: int get_local_addr (ACE_MEM_Addr &) const; /// Accessor to the mmap options. - /// This method has been deprecated. + /// @deprecated This method has been deprecated. ACE_MEM_SAP::MALLOC_OPTIONS& malloc_options (void); // = Meta-type info diff --git a/ace/MEM_Addr.h b/ace/MEM_Addr.h index d3add754b4a..c720eaa6e8a 100644 --- a/ace/MEM_Addr.h +++ b/ace/MEM_Addr.h @@ -41,11 +41,10 @@ public: /// Copy constructor. ACE_MEM_Addr (const ACE_MEM_Addr &); - /// Creates an from a and the remote - /// . + /// Creates an ACE_MEM_Addr from a @a port_number ACE_MEM_Addr (u_short port_number); - /// Creates an from a . + /// Creates an ACE_MEM_Addr from a @a port_name. explicit ACE_MEM_Addr (const ACE_TCHAR port_name[]); /// Default dtor. @@ -53,24 +52,24 @@ public: // = Direct initialization methods. - /// default initialization routine. + /// Default initialization routine. int initialize_local (u_short port); - /// Check if designate an enpoint withing the same host. + /// Check if @a sap designate an enpoint withing the same host. int same_host (const ACE_INET_Addr& sap); // These methods are useful after the object has been constructed. /** - * Initializes an from a and the - * remote . If is enabled then is - * converted into network byte order, otherwise it is assumed to be - * in network byte order already and are passed straight through. + * Initializes an ACE_MEM_Addr from a @a port_number. If @a encode + * is enabled then @a port_number is converted into network byte order, + * otherwise it is assumed to be in network byte order already and + * are passed straight through. */ int set (u_short port_number, int encode = 1); - /// Uses to initialize an from a + /// Uses to initialize an ACE_MEM_Addr from a /// , the remote , and the . int set (const ACE_TCHAR port_name[]); @@ -80,13 +79,13 @@ public: /// Set a pointer to the address. virtual void set_addr (void *, int len); - /// Transform the external address into string + /// Transform the external ACE_MEM_Addr address into string /// format. virtual int addr_to_string (ACE_TCHAR buffer[], size_t size, int ipaddr_format = 1) const; - /// Initializes the external from the
. + /// Initializes the external ACE_MEM_Addr from the @a address. virtual int string_to_addr (const ACE_TCHAR address[]); /// Sets the port number. diff --git a/ace/Makefile.am b/ace/Makefile.am index 11aa8118ffd..8dae7dfdc32 100644 --- a/ace/Makefile.am +++ b/ace/Makefile.am @@ -6,10 +6,10 @@ ## this file will be lost the next time it is generated. ## ## MPC Command: -## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu +## ./bin/mwc.pl -include /home/jtc/ACE/ACE-config3/MPC/config -include /home/jtc/ACE/ACE-config3/MPC/templates -type automake ACE.mwc includedir = @includedir@/ace -pkgconfigdatadir = ${prefix}/lib/pkgconfig +pkgconfigdatadir = @libdir@/pkgconfig ACE_BUILDDIR = $(top_builddir) ACE_ROOT = $(top_srcdir) @@ -17,64 +17,151 @@ ACE_ROOT = $(top_srcdir) SUBDIRS = \ . \ QoS \ - RMCast \ - SSL \ - TMCast + SSL +CLEANFILES = +BUILT_SOURCES = +pkgconfigdata_DATA = +lib_LTLIBRARIES = ## Makefile.ACE.am -Other = \ - Local_Name_Space.cpp \ - NT_Service.cpp \ - Name_Proxy.cpp \ - Name_Request_Reply.cpp \ - Name_Space.cpp \ - Naming_Context.cpp \ - Registry_Name_Space.cpp \ - Remote_Name_Space.cpp - -Codecs = \ - Codecs.cpp - -Token = \ - Local_Tokens.cpp \ - Remote_Tokens.cpp \ - Token_Collection.cpp \ - Token_Invariants.cpp \ - Token_Manager.cpp \ - Token_Request_Reply.cpp - -Svcconf = \ - DLL.cpp \ - DLL_Manager.cpp \ - Dynamic_Service_Base.cpp \ - Parse_Node.cpp \ - Service_Config.cpp \ - Service_Manager.cpp \ - Service_Object.cpp \ - Service_Repository.cpp \ - Service_Templates.cpp \ - Service_Types.cpp \ - Shared_Object.cpp \ - Svc_Conf_Lexer_Guard.cpp \ - Svc_Conf_l.cpp \ - Svc_Conf_y.cpp \ - XML_Svc_Conf.cpp -UUID = \ - UUID.cpp +lib_LTLIBRARIES += libACE.la -Filecache = \ - Filecache.cpp +libACE_la_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -DACE_HAS_ACE_TOKEN \ + -DACE_HAS_ACE_SVCCONF \ + -DACE_BUILD_DLL -ACE_OS = \ +libACE_la_SOURCES = \ + ACE.cpp \ + ACE_crc32.cpp \ + ACE_crc_ccitt.cpp \ ARGV.cpp \ + ATM_Acceptor.cpp \ + ATM_Addr.cpp \ + ATM_Connector.cpp \ + ATM_Params.cpp \ + ATM_QoS.cpp \ + ATM_Stream.cpp \ + Activation_Queue.cpp \ + Active_Map_Manager.cpp \ + Addr.cpp \ + Arg_Shifter.cpp \ Argv_Type_Converter.cpp \ + Asynch_IO.cpp \ + Asynch_IO_Impl.cpp \ + Asynch_Pseudo_Task.cpp \ + Atomic_Op.cpp \ + Auto_Event.cpp \ + Barrier.cpp \ Base_Thread_Adapter.cpp \ + Based_Pointer_Repository.cpp \ + Basic_Stats.cpp \ Basic_Types.cpp \ + CDR_Base.cpp \ + CDR_Stream.cpp \ + Capabilities.cpp \ Cleanup.cpp \ + Codecs.cpp \ + Codeset_IBM1047.cpp \ + Codeset_Registry.cpp \ + Codeset_Registry_db.cpp \ + Condition_Recursive_Thread_Mutex.cpp \ + Condition_Thread_Mutex.cpp \ + Configuration.cpp \ + Configuration_Import_Export.cpp \ + Connection_Recycling_Strategy.cpp \ + Container_Instantiations.cpp \ + Containers.cpp \ Copy_Disabled.cpp \ + DEV.cpp \ + DEV_Addr.cpp \ + DEV_Connector.cpp \ + DEV_IO.cpp \ + DLL.cpp \ + DLL_Manager.cpp \ Date_Time.cpp \ + Dev_Poll_Reactor.cpp \ + Dirent.cpp \ + Dirent_Selector.cpp \ + Dump.cpp \ + Dynamic.cpp \ + Dynamic_Service_Base.cpp \ + Event.cpp \ + Event_Handler.cpp \ + FIFO.cpp \ + FIFO_Recv.cpp \ + FIFO_Recv_Msg.cpp \ + FIFO_Send.cpp \ + FIFO_Send_Msg.cpp \ + FILE.cpp \ + FILE_Addr.cpp \ + FILE_Connector.cpp \ + FILE_IO.cpp \ + File_Lock.cpp \ + Filecache.cpp \ + Flag_Manip.cpp \ + Framework_Component.cpp \ + Functor.cpp \ + Functor_String.cpp \ + Get_Opt.cpp \ + Handle_Ops.cpp \ Handle_Set.cpp \ + Hash_Map_Manager.cpp \ + Hashable.cpp \ + High_Res_Timer.cpp \ + ICMP_Socket.cpp \ + INET_Addr.cpp \ + IOStream.cpp \ + IO_SAP.cpp \ + IPC_SAP.cpp \ + Init_ACE.cpp \ + LSOCK.cpp \ + LSOCK_Acceptor.cpp \ + LSOCK_CODgram.cpp \ + LSOCK_Connector.cpp \ + LSOCK_Dgram.cpp \ + LSOCK_Stream.cpp \ + Lib_Find.cpp \ + Local_Memory_Pool.cpp \ + Local_Name_Space.cpp \ + Local_Tokens.cpp \ + Lock.cpp \ + Log_Msg.cpp \ + Log_Msg_Backend.cpp \ + Log_Msg_Callback.cpp \ + Log_Msg_IPC.cpp \ + Log_Msg_NT_Event_Log.cpp \ + Log_Msg_UNIX_Syslog.cpp \ + Log_Record.cpp \ + Logging_Strategy.cpp \ + MEM_Acceptor.cpp \ + MEM_Addr.cpp \ + MEM_Connector.cpp \ + MEM_IO.cpp \ + MEM_SAP.cpp \ + MEM_Stream.cpp \ + MMAP_Memory_Pool.cpp \ + Malloc.cpp \ + Malloc_Allocator.cpp \ + Malloc_Instantiations.cpp \ + Manual_Event.cpp \ + Mem_Map.cpp \ + Message_Block.cpp \ + Message_Queue.cpp \ + Method_Request.cpp \ + Metrics_Cache.cpp \ + Msg_WFMO_Reactor.cpp \ + Multihomed_INET_Addr.cpp \ + Mutex.cpp \ + NT_Service.cpp \ + Name_Proxy.cpp \ + Name_Request_Reply.cpp \ + Name_Space.cpp \ + Naming_Context.cpp \ + Notification_Strategy.cpp \ OS_Errno.cpp \ OS_Log_Msg_Attributes.cpp \ OS_NS_Thread.cpp \ @@ -113,133 +200,38 @@ ACE_OS = \ OS_TLI.cpp \ OS_Thread_Adapter.cpp \ OS_main.cpp \ - Object_Manager_Base.cpp \ - Sched_Params.cpp \ - Thread_Hook.cpp \ - Time_Value.cpp \ - gethrtime.cpp - -Utils = \ - ACE.cpp \ - ACE_crc32.cpp \ - ACE_crc_ccitt.cpp \ - Active_Map_Manager.cpp \ - Arg_Shifter.cpp \ - Capabilities.cpp \ - Configuration.cpp \ - Configuration_Import_Export.cpp \ - Connection_Recycling_Strategy.cpp \ - Container_Instantiations.cpp \ - Containers.cpp \ - Dirent.cpp \ - Dirent_Selector.cpp \ - Dynamic.cpp \ - Flag_Manip.cpp \ - Framework_Component.cpp \ - Functor.cpp \ - Functor_String.cpp \ - Get_Opt.cpp \ - Handle_Ops.cpp \ - Hash_Map_Manager.cpp \ - Hashable.cpp \ - Init_ACE.cpp \ - Lib_Find.cpp \ - Message_Block.cpp \ - Method_Request.cpp \ - Notification_Strategy.cpp \ + Obchunk.cpp \ Object_Manager.cpp \ - Recyclable.cpp \ - Refcountable.cpp \ - Registry.cpp \ - SString.cpp \ - Sample_History.cpp \ - Stats.cpp \ - String_Base_Const.cpp - -Logging = \ - Dump.cpp \ - Log_Msg.cpp \ - Log_Msg_Backend.cpp \ - Log_Msg_Callback.cpp \ - Log_Msg_IPC.cpp \ - Log_Msg_NT_Event_Log.cpp \ - Log_Msg_UNIX_Syslog.cpp \ - Log_Record.cpp \ - Logging_Strategy.cpp \ - Trace.cpp - -Threads = \ - Activation_Queue.cpp \ - Atomic_Op.cpp \ - Auto_Event.cpp \ - Barrier.cpp \ - Condition_Recursive_Thread_Mutex.cpp \ - Condition_Thread_Mutex.cpp \ - Event.cpp \ - File_Lock.cpp \ - Lock.cpp \ - Manual_Event.cpp \ - Mutex.cpp \ + Object_Manager_Base.cpp \ + Obstack.cpp \ + PI_Malloc.cpp \ + POSIX_Asynch_IO.cpp \ + POSIX_CB_Proactor.cpp \ + POSIX_Proactor.cpp \ + Pagefile_Memory_Pool.cpp \ + Parse_Node.cpp \ + Ping_Socket.cpp \ + Pipe.cpp \ + Priority_Reactor.cpp \ + Proactor.cpp \ Process.cpp \ Process_Manager.cpp \ Process_Mutex.cpp \ Process_Semaphore.cpp \ + Profile_Timer.cpp \ RW_Mutex.cpp \ RW_Process_Mutex.cpp \ RW_Thread_Mutex.cpp \ - Recursive_Thread_Mutex.cpp \ - Semaphore.cpp \ - Synch_Options.cpp \ - TSS_Adapter.cpp \ - Thread.cpp \ - Thread_Adapter.cpp \ - Thread_Control.cpp \ - Thread_Exit.cpp \ - Thread_Manager.cpp \ - Thread_Mutex.cpp \ - Thread_Semaphore.cpp \ - Token.cpp - -Demux = \ - Dev_Poll_Reactor.cpp \ - Event_Handler.cpp \ - FlReactor.cpp \ - Msg_WFMO_Reactor.cpp \ - POSIX_CB_Proactor.cpp \ - POSIX_Proactor.cpp \ - Priority_Reactor.cpp \ - Proactor.cpp \ - QtReactor.cpp \ Reactor.cpp \ - SUN_Proactor.cpp \ - Select_Reactor.cpp \ - Select_Reactor_Base.cpp \ - TP_Reactor.cpp \ - TkReactor.cpp \ - WFMO_Reactor.cpp \ - WIN32_Proactor.cpp \ - XtReactor.cpp - -Connection = \ - Asynch_IO.cpp \ - Asynch_IO_Impl.cpp \ - Asynch_Pseudo_Task.cpp \ - POSIX_Asynch_IO.cpp \ - WIN32_Asynch_IO.cpp - -Sockets = \ - Addr.cpp \ - ICMP_Socket.cpp \ - INET_Addr.cpp \ - IPC_SAP.cpp \ - LSOCK.cpp \ - LSOCK_Acceptor.cpp \ - LSOCK_CODgram.cpp \ - LSOCK_Connector.cpp \ - LSOCK_Dgram.cpp \ - LSOCK_Stream.cpp \ - Multihomed_INET_Addr.cpp \ - Ping_Socket.cpp \ + Reactor_Notification_Strategy.cpp \ + Read_Buffer.cpp \ + Recursive_Thread_Mutex.cpp \ + Recyclable.cpp \ + Refcountable.cpp \ + Registry.cpp \ + Registry_Name_Space.cpp \ + Remote_Name_Space.cpp \ + Remote_Tokens.cpp \ SOCK.cpp \ SOCK_Acceptor.cpp \ SOCK_CODgram.cpp \ @@ -252,275 +244,356 @@ Sockets = \ SOCK_SEQPACK_Association.cpp \ SOCK_SEQPACK_Connector.cpp \ SOCK_Stream.cpp \ - Sock_Connect.cpp - -IPC = \ - ATM_Acceptor.cpp \ - ATM_Addr.cpp \ - ATM_Connector.cpp \ - ATM_Params.cpp \ - ATM_QoS.cpp \ - ATM_Stream.cpp \ - DEV.cpp \ - DEV_Addr.cpp \ - DEV_Connector.cpp \ - DEV_IO.cpp \ - FIFO.cpp \ - FIFO_Recv.cpp \ - FIFO_Recv_Msg.cpp \ - FIFO_Send.cpp \ - FIFO_Send_Msg.cpp \ - FILE.cpp \ - FILE_Addr.cpp \ - FILE_Connector.cpp \ - FILE_IO.cpp \ - IOStream.cpp \ - IO_SAP.cpp \ - MEM_Acceptor.cpp \ - MEM_Addr.cpp \ - MEM_Connector.cpp \ - MEM_IO.cpp \ - MEM_SAP.cpp \ - MEM_Stream.cpp \ - Pipe.cpp \ SPIPE.cpp \ SPIPE_Acceptor.cpp \ SPIPE_Addr.cpp \ SPIPE_Connector.cpp \ SPIPE_Stream.cpp \ + SString.cpp \ + SUN_Proactor.cpp \ SV_Message.cpp \ SV_Message_Queue.cpp \ SV_Semaphore_Complex.cpp \ SV_Semaphore_Simple.cpp \ SV_Shared_Memory.cpp \ + Sample_History.cpp \ + Sbrk_Memory_Pool.cpp \ + Sched_Params.cpp \ + Select_Reactor.cpp \ + Select_Reactor_Base.cpp \ + Semaphore.cpp \ + Service_Config.cpp \ + Service_Manager.cpp \ + Service_Object.cpp \ + Service_Repository.cpp \ + Service_Templates.cpp \ + Service_Types.cpp \ + Shared_Memory.cpp \ + Shared_Memory_MM.cpp \ + Shared_Memory_Pool.cpp \ + Shared_Memory_SV.cpp \ + Shared_Object.cpp \ Signal.cpp \ + Sock_Connect.cpp \ + Stats.cpp \ + String_Base_Const.cpp \ + Svc_Conf_Lexer_Guard.cpp \ + Svc_Conf_l.cpp \ + Svc_Conf_y.cpp \ + Synch_Options.cpp \ + System_Time.cpp \ TLI.cpp \ TLI_Acceptor.cpp \ TLI_Connector.cpp \ TLI_Stream.cpp \ + TP_Reactor.cpp \ + TSS_Adapter.cpp \ TTY_IO.cpp \ - UNIX_Addr.cpp \ - UPIPE_Acceptor.cpp \ - UPIPE_Connector.cpp \ - UPIPE_Stream.cpp \ - XTI_ATM_Mcast.cpp - -Streams = \ - CDR_Base.cpp \ - CDR_Stream.cpp \ - Codeset_IBM1047.cpp \ - Codeset_Registry.cpp \ - Codeset_Registry_db.cpp \ - Message_Queue.cpp \ - Reactor_Notification_Strategy.cpp \ - Task.cpp - -Memory = \ - Based_Pointer_Repository.cpp \ - Local_Memory_Pool.cpp \ - MMAP_Memory_Pool.cpp \ - Malloc.cpp \ - Malloc_Allocator.cpp \ - Malloc_Instantiations.cpp \ - Mem_Map.cpp \ - Obchunk.cpp \ - Obstack.cpp \ - PI_Malloc.cpp \ - Pagefile_Memory_Pool.cpp \ - Read_Buffer.cpp \ - Sbrk_Memory_Pool.cpp \ - Shared_Memory.cpp \ - Shared_Memory_MM.cpp \ - Shared_Memory_Pool.cpp \ - Shared_Memory_SV.cpp - -Timer = \ - Basic_Stats.cpp \ - High_Res_Timer.cpp \ - Profile_Timer.cpp \ - System_Time.cpp \ + Task.cpp \ + Thread.cpp \ + Thread_Adapter.cpp \ + Thread_Control.cpp \ + Thread_Exit.cpp \ + Thread_Hook.cpp \ + Thread_Manager.cpp \ + Thread_Mutex.cpp \ + Thread_Semaphore.cpp \ Time_Request_Reply.cpp \ + Time_Value.cpp \ Timeprobe.cpp \ Timer_Hash.cpp \ Timer_Heap.cpp \ Timer_List.cpp \ Timer_Queue.cpp \ - Timer_Wheel.cpp - -Metrics = \ - Metrics_Cache.cpp - -lib_LTLIBRARIES = libACE.la - -libACE_la_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -DACE_HAS_ACE_TOKEN \ - -DACE_HAS_ACE_SVCCONF \ - -DACE_BUILD_DLL - -libACE_la_SOURCES = \ - $(Other) \ - $(Codecs) \ - $(Token) \ - $(Svcconf) \ - $(UUID) \ - $(Filecache) \ - $(ACE_OS) \ - $(Utils) \ - $(Logging) \ - $(Threads) \ - $(Demux) \ - $(Connection) \ - $(Sockets) \ - $(IPC) \ - $(Streams) \ - $(Memory) \ - $(Timer) \ - $(Metrics) + Timer_Wheel.cpp \ + Token.cpp \ + Token_Collection.cpp \ + Token_Invariants.cpp \ + Token_Manager.cpp \ + Token_Request_Reply.cpp \ + Trace.cpp \ + UNIX_Addr.cpp \ + UPIPE_Acceptor.cpp \ + UPIPE_Connector.cpp \ + UPIPE_Stream.cpp \ + UUID.cpp \ + WFMO_Reactor.cpp \ + WIN32_Asynch_IO.cpp \ + WIN32_Proactor.cpp \ + XML_Svc_Conf.cpp \ + XTI_ATM_Mcast.cpp \ + gethrtime.cpp libACE_la_LDFLAGS = \ - -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ + -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ nobase_include_HEADERS = \ ACE.h \ + ACE.inl \ ACE_export.h \ ARGV.h \ + ARGV.inl \ ATM_Acceptor.h \ + ATM_Acceptor.inl \ ATM_Addr.h \ + ATM_Addr.inl \ ATM_Connector.h \ + ATM_Connector.inl \ ATM_Params.h \ + ATM_Params.inl \ ATM_QoS.h \ + ATM_QoS.inl \ ATM_Stream.h \ + ATM_Stream.inl \ + Acceptor.cpp \ Acceptor.h \ Activation_Queue.h \ + Activation_Queue.inl \ Active_Map_Manager.h \ + Active_Map_Manager.inl \ + Active_Map_Manager_T.cpp \ Active_Map_Manager_T.h \ + Active_Map_Manager_T.inl \ Addr.h \ + Addr.inl \ Arg_Shifter.h \ Argv_Type_Converter.h \ + Argv_Type_Converter.inl \ Array.h \ + Array_Base.cpp \ Array_Base.h \ + Array_Base.inl \ + Asynch_Acceptor.cpp \ Asynch_Acceptor.h \ + Asynch_Connector.cpp \ Asynch_Connector.h \ Asynch_IO.h \ Asynch_IO_Impl.h \ + Asynch_IO_Impl.inl \ Asynch_Pseudo_Task.h \ Atomic_Op.h \ + Atomic_Op.inl \ + Atomic_Op_T.cpp \ Atomic_Op_T.h \ + Atomic_Op_T.inl \ Auto_Event.h \ + Auto_Event.inl \ + Auto_Functor.cpp \ Auto_Functor.h \ + Auto_Functor.inl \ + Auto_IncDec_T.cpp \ Auto_IncDec_T.h \ + Auto_IncDec_T.inl \ + Auto_Ptr.cpp \ Auto_Ptr.h \ + Auto_Ptr.inl \ Barrier.h \ + Barrier.inl \ Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ Based_Pointer_Repository.h \ + Based_Pointer_T.cpp \ Based_Pointer_T.h \ + Based_Pointer_T.inl \ Basic_Stats.h \ + Basic_Stats.inl \ Basic_Types.h \ + Basic_Types.inl \ Bound_Ptr.h \ + Bound_Ptr.inl \ CDR_Base.h \ + CDR_Base.inl \ CDR_Stream.h \ + CDR_Stream.inl \ CORBA_macros.h \ + Cache_Map_Manager_T.cpp \ Cache_Map_Manager_T.h \ + Cache_Map_Manager_T.inl \ + Cached_Connect_Strategy_T.cpp \ Cached_Connect_Strategy_T.h \ + Caching_Strategies_T.cpp \ Caching_Strategies_T.h \ + Caching_Strategies_T.inl \ + Caching_Utility_T.cpp \ Caching_Utility_T.h \ Capabilities.h \ + Capabilities.inl \ Cleanup.h \ + Cleanup.inl \ + Cleanup_Strategies_T.cpp \ Cleanup_Strategies_T.h \ Codecs.h \ Codeset_IBM1047.h \ Codeset_Registry.h \ + Codeset_Registry.inl \ Condition_Recursive_Thread_Mutex.h \ + Condition_T.cpp \ Condition_T.h \ + Condition_T.inl \ Condition_Thread_Mutex.h \ + Condition_Thread_Mutex.inl \ Configuration.h \ Configuration_Import_Export.h \ Connection_Recycling_Strategy.h \ + Connector.cpp \ Connector.h \ Containers.h \ + Containers.inl \ + Containers_T.cpp \ Containers_T.h \ + Containers_T.inl \ Copy_Disabled.h \ DEV.h \ + DEV.inl \ DEV_Addr.h \ + DEV_Addr.inl \ DEV_Connector.h \ + DEV_Connector.inl \ DEV_IO.h \ + DEV_IO.inl \ DLL.h \ DLL_Manager.h \ Date_Time.h \ + Date_Time.inl \ Default_Constants.h \ Dev_Poll_Reactor.h \ + Dev_Poll_Reactor.inl \ Dirent.h \ + Dirent.inl \ Dirent_Selector.h \ + Dirent_Selector.inl \ Dump.h \ + Dump_T.cpp \ Dump_T.h \ Dynamic.h \ + Dynamic.inl \ + Dynamic_Service.cpp \ Dynamic_Service.h \ + Dynamic_Service.inl \ Dynamic_Service_Base.h \ + Env_Value_T.cpp \ Env_Value_T.h \ + Env_Value_T.inl \ Event.h \ + Event.inl \ Event_Handler.h \ + Event_Handler.inl \ + Event_Handler_T.cpp \ Event_Handler_T.h \ + Event_Handler_T.inl \ Exception_Macros.h \ FIFO.h \ + FIFO.inl \ FIFO_Recv.h \ + FIFO_Recv.inl \ FIFO_Recv_Msg.h \ + FIFO_Recv_Msg.inl \ FIFO_Send.h \ + FIFO_Send.inl \ FIFO_Send_Msg.h \ + FIFO_Send_Msg.inl \ FILE.h \ + FILE.inl \ FILE_Addr.h \ + FILE_Addr.inl \ FILE_Connector.h \ + FILE_Connector.inl \ FILE_IO.h \ + FILE_IO.inl \ File_Lock.h \ + File_Lock.inl \ Filecache.h \ - FlReactor.h \ Flag_Manip.h \ + Flag_Manip.inl \ Framework_Component.h \ + Framework_Component.inl \ + Framework_Component_T.cpp \ Framework_Component_T.h \ + Free_List.cpp \ Free_List.h \ + Free_List.inl \ Functor.h \ + Functor.inl \ Functor_String.h \ + Functor_String.inl \ + Functor_T.cpp \ Functor_T.h \ + Functor_T.inl \ + Future.cpp \ Future.h \ + Future_Set.cpp \ Future_Set.h \ Get_Opt.h \ + Get_Opt.inl \ Global_Macros.h \ + Guard_T.cpp \ Guard_T.h \ + Guard_T.inl \ Handle_Gobbler.h \ + Handle_Gobbler.inl \ Handle_Ops.h \ Handle_Set.h \ + Handle_Set.inl \ + Hash_Cache_Map_Manager_T.cpp \ Hash_Cache_Map_Manager_T.h \ + Hash_Cache_Map_Manager_T.inl \ Hash_Map_Manager.h \ + Hash_Map_Manager_T.cpp \ Hash_Map_Manager_T.h \ + Hash_Map_Manager_T.inl \ + Hash_Map_With_Allocator_T.cpp \ Hash_Map_With_Allocator_T.h \ + Hash_Map_With_Allocator_T.inl \ Hashable.h \ + Hashable.inl \ High_Res_Timer.h \ + High_Res_Timer.inl \ ICMP_Socket.h \ + ICMP_Socket.inl \ INET_Addr.h \ + INET_Addr.inl \ IOStream.h \ + IOStream_T.cpp \ IOStream_T.h \ + IOStream_T.inl \ IO_Cntl_Msg.h \ IO_SAP.h \ + IO_SAP.inl \ IPC_SAP.h \ + IPC_SAP.inl \ If_Then_Else.h \ Init_ACE.h \ + Intrusive_List.cpp \ Intrusive_List.h \ + Intrusive_List.inl \ + Intrusive_List_Node.cpp \ Intrusive_List_Node.h \ + Intrusive_List_Node.inl \ + LOCK_SOCK_Acceptor.cpp \ LOCK_SOCK_Acceptor.h \ LSOCK.h \ + LSOCK.inl \ LSOCK_Acceptor.h \ LSOCK_CODgram.h \ + LSOCK_CODgram.inl \ LSOCK_Connector.h \ + LSOCK_Connector.inl \ LSOCK_Dgram.h \ + LSOCK_Dgram.inl \ LSOCK_Stream.h \ + LSOCK_Stream.inl \ Lib_Find.h \ Local_Memory_Pool.h \ Local_Name_Space.h \ + Local_Name_Space_T.cpp \ Local_Name_Space_T.h \ Local_Tokens.h \ + Local_Tokens.inl \ Lock.h \ + Lock.inl \ + Lock_Adapter_T.cpp \ Lock_Adapter_T.h \ + Lock_Adapter_T.inl \ Log_Msg.h \ Log_Msg_Backend.h \ Log_Msg_Callback.h \ @@ -529,259 +602,466 @@ nobase_include_HEADERS = \ Log_Msg_UNIX_Syslog.h \ Log_Priority.h \ Log_Record.h \ + Log_Record.inl \ Logging_Strategy.h \ MEM_Acceptor.h \ + MEM_Acceptor.inl \ MEM_Addr.h \ + MEM_Addr.inl \ MEM_Connector.h \ + MEM_Connector.inl \ MEM_IO.h \ + MEM_IO.inl \ MEM_SAP.h \ + MEM_SAP.inl \ MEM_Stream.h \ + MEM_Stream.inl \ MMAP_Memory_Pool.h \ Malloc.h \ + Malloc.inl \ Malloc_Allocator.h \ + Malloc_Allocator.inl \ Malloc_Base.h \ + Malloc_T.cpp \ Malloc_T.h \ + Malloc_T.inl \ + Managed_Object.cpp \ Managed_Object.h \ + Managed_Object.inl \ Manual_Event.h \ + Manual_Event.inl \ + Map_Manager.cpp \ Map_Manager.h \ + Map_Manager.inl \ + Map_T.cpp \ Map_T.h \ + Map_T.inl \ Mem_Map.h \ + Mem_Map.inl \ Memory_Pool.h \ Message_Block.h \ + Message_Block.inl \ + Message_Block_T.cpp \ Message_Block_T.h \ + Message_Block_T.inl \ Message_Queue.h \ + Message_Queue.inl \ + Message_Queue_T.cpp \ Message_Queue_T.h \ + Message_Queue_T.inl \ Method_Object.h \ Method_Request.h \ Metrics_Cache.h \ + Metrics_Cache_T.cpp \ Min_Max.h \ + Module.cpp \ Module.h \ + Module.inl \ Msg_WFMO_Reactor.h \ + Msg_WFMO_Reactor.inl \ Multihomed_INET_Addr.h \ + Multihomed_INET_Addr.inl \ Mutex.h \ + Mutex.inl \ NT_Service.h \ + NT_Service.inl \ Name_Proxy.h \ Name_Request_Reply.h \ Name_Space.h \ Naming_Context.h \ + Node.cpp \ Node.h \ Notification_Strategy.h \ + Notification_Strategy.inl \ Null_Barrier.h \ Null_Condition.h \ Null_Mutex.h \ Null_Semaphore.h \ OS.h \ + OS.inl \ OS_Dirent.h \ OS_Errno.h \ + OS_Errno.inl \ OS_Log_Msg_Attributes.h \ + OS_Log_Msg_Attributes.inl \ OS_Memory.h \ + OS_Memory.inl \ OS_NS_Thread.h \ + OS_NS_Thread.inl \ OS_NS_arpa_inet.h \ + OS_NS_arpa_inet.inl \ OS_NS_ctype.h \ + OS_NS_ctype.inl \ OS_NS_dirent.h \ + OS_NS_dirent.inl \ OS_NS_dlfcn.h \ + OS_NS_dlfcn.inl \ OS_NS_errno.h \ + OS_NS_errno.inl \ OS_NS_fcntl.h \ + OS_NS_fcntl.inl \ OS_NS_macros.h \ OS_NS_math.h \ + OS_NS_math.inl \ OS_NS_netdb.h \ + OS_NS_netdb.inl \ OS_NS_poll.h \ + OS_NS_poll.inl \ OS_NS_pwd.h \ + OS_NS_pwd.inl \ OS_NS_regex.h \ + OS_NS_regex.inl \ OS_NS_signal.h \ + OS_NS_signal.inl \ OS_NS_stdio.h \ + OS_NS_stdio.inl \ OS_NS_stdlib.h \ + OS_NS_stdlib.inl \ OS_NS_string.h \ + OS_NS_string.inl \ OS_NS_strings.h \ + OS_NS_strings.inl \ OS_NS_stropts.h \ + OS_NS_stropts.inl \ OS_NS_sys_mman.h \ + OS_NS_sys_mman.inl \ OS_NS_sys_msg.h \ + OS_NS_sys_msg.inl \ OS_NS_sys_resource.h \ + OS_NS_sys_resource.inl \ OS_NS_sys_select.h \ + OS_NS_sys_select.inl \ OS_NS_sys_shm.h \ + OS_NS_sys_shm.inl \ OS_NS_sys_socket.h \ + OS_NS_sys_socket.inl \ OS_NS_sys_stat.h \ + OS_NS_sys_stat.inl \ OS_NS_sys_time.h \ + OS_NS_sys_time.inl \ OS_NS_sys_uio.h \ + OS_NS_sys_uio.inl \ OS_NS_sys_utsname.h \ + OS_NS_sys_utsname.inl \ OS_NS_sys_wait.h \ + OS_NS_sys_wait.inl \ OS_NS_time.h \ + OS_NS_time.inl \ OS_NS_unistd.h \ + OS_NS_unistd.inl \ OS_NS_wchar.h \ + OS_NS_wchar.inl \ OS_QoS.h \ OS_String.h \ + OS_String.inl \ OS_TLI.h \ + OS_TLI.inl \ OS_Thread_Adapter.h \ OS_main.h \ Obchunk.h \ + Obchunk.inl \ Object_Manager.h \ + Object_Manager.inl \ Object_Manager_Base.h \ Obstack.h \ + Obstack_T.cpp \ Obstack_T.h \ + Obstack_T.inl \ PI_Malloc.h \ + PI_Malloc.inl \ POSIX_Asynch_IO.h \ POSIX_CB_Proactor.h \ + POSIX_CB_Proactor.inl \ POSIX_Proactor.h \ + POSIX_Proactor.inl \ Pagefile_Memory_Pool.h \ + Pagefile_Memory_Pool.inl \ Pair.h \ + Pair_T.cpp \ Pair_T.h \ + Pair_T.inl \ Parse_Node.h \ + Parse_Node.inl \ Ping_Socket.h \ + Ping_Socket.inl \ Pipe.h \ + Pipe.inl \ Priority_Reactor.h \ Proactor.h \ + Proactor.inl \ Proactor_Impl.h \ Process.h \ + Process.inl \ Process_Manager.h \ + Process_Manager.inl \ Process_Mutex.h \ + Process_Mutex.inl \ Process_Semaphore.h \ + Process_Semaphore.inl \ Profile_Timer.h \ - QtReactor.h \ + Profile_Timer.inl \ + RB_Tree.cpp \ RB_Tree.h \ + RB_Tree.inl \ RW_Mutex.h \ + RW_Mutex.inl \ RW_Process_Mutex.h \ + RW_Process_Mutex.inl \ RW_Thread_Mutex.h \ + RW_Thread_Mutex.inl \ Reactor.h \ + Reactor.inl \ Reactor_Impl.h \ Reactor_Notification_Strategy.h \ + Reactor_Notification_Strategy.inl \ Reactor_Timer_Interface.h \ Read_Buffer.h \ + Read_Buffer.inl \ Recursive_Thread_Mutex.h \ + Recursive_Thread_Mutex.inl \ Recyclable.h \ + Recyclable.inl \ Refcountable.h \ + Refcountable.inl \ Refcounted_Auto_Ptr.h \ + Refcounted_Auto_Ptr.inl \ Registry.h \ Registry_Name_Space.h \ Remote_Name_Space.h \ Remote_Tokens.h \ + Remote_Tokens.inl \ + Reverse_Lock_T.cpp \ Reverse_Lock_T.h \ + Reverse_Lock_T.inl \ SOCK.h \ + SOCK.inl \ SOCK_Acceptor.h \ + SOCK_Acceptor.inl \ SOCK_CODgram.h \ + SOCK_CODgram.inl \ SOCK_Connector.h \ + SOCK_Connector.inl \ SOCK_Dgram.h \ + SOCK_Dgram.inl \ SOCK_Dgram_Bcast.h \ + SOCK_Dgram_Bcast.inl \ SOCK_Dgram_Mcast.h \ + SOCK_Dgram_Mcast.inl \ SOCK_IO.h \ + SOCK_IO.inl \ SOCK_SEQPACK_Acceptor.h \ + SOCK_SEQPACK_Acceptor.inl \ SOCK_SEQPACK_Association.h \ + SOCK_SEQPACK_Association.inl \ SOCK_SEQPACK_Connector.h \ + SOCK_SEQPACK_Connector.inl \ SOCK_Stream.h \ + SOCK_Stream.inl \ SPIPE.h \ + SPIPE.inl \ SPIPE_Acceptor.h \ SPIPE_Addr.h \ + SPIPE_Addr.inl \ SPIPE_Connector.h \ + SPIPE_Connector.inl \ SPIPE_Stream.h \ + SPIPE_Stream.inl \ SString.h \ + SString.inl \ SStringfwd.h \ SUN_Proactor.h \ + SUN_Proactor.inl \ SV_Message.h \ + SV_Message.inl \ SV_Message_Queue.h \ + SV_Message_Queue.inl \ SV_Semaphore_Complex.h \ + SV_Semaphore_Complex.inl \ SV_Semaphore_Simple.h \ + SV_Semaphore_Simple.inl \ SV_Shared_Memory.h \ + SV_Shared_Memory.inl \ Sample_History.h \ + Sample_History.inl \ Sbrk_Memory_Pool.h \ Sched_Params.h \ + Sched_Params.inl \ Select_Reactor.h \ Select_Reactor_Base.h \ + Select_Reactor_Base.inl \ + Select_Reactor_T.cpp \ Select_Reactor_T.h \ + Select_Reactor_T.inl \ Semaphore.h \ + Semaphore.inl \ Service_Config.h \ + Service_Config.inl \ Service_Manager.h \ + Service_Manager.inl \ Service_Object.h \ + Service_Object.inl \ Service_Repository.h \ + Service_Repository.inl \ Service_Templates.h \ Service_Types.h \ + Service_Types.inl \ Shared_Memory.h \ Shared_Memory_MM.h \ + Shared_Memory_MM.inl \ Shared_Memory_Pool.h \ Shared_Memory_SV.h \ + Shared_Memory_SV.inl \ Shared_Object.h \ + Shared_Object.inl \ Signal.h \ + Signal.inl \ + Singleton.cpp \ Singleton.h \ + Singleton.inl \ Sock_Connect.h \ Static_Object_Lock.h \ Stats.h \ + Stats.inl \ Strategies.h \ + Strategies_T.cpp \ Strategies_T.h \ + Strategies_T.inl \ + Stream.cpp \ Stream.h \ + Stream.inl \ + Stream_Modules.cpp \ Stream_Modules.h \ + String_Base.cpp \ String_Base.h \ + String_Base.inl \ String_Base_Const.h \ Svc_Conf.h \ Svc_Conf_Lexer_Guard.h \ Svc_Conf_Tokens.h \ + Svc_Handler.cpp \ Svc_Handler.h \ Swap.h \ + Swap.inl \ Synch.h \ Synch_Options.h \ + Synch_Options.inl \ + Synch_T.cpp \ Synch_T.h \ Synch_Traits.h \ System_Time.h \ TLI.h \ + TLI.inl \ TLI_Acceptor.h \ TLI_Connector.h \ + TLI_Connector.inl \ TLI_Stream.h \ + TLI_Stream.inl \ TP_Reactor.h \ + TP_Reactor.inl \ TSS_Adapter.h \ + TSS_Adapter.inl \ + TSS_T.cpp \ TSS_T.h \ + TSS_T.inl \ TTY_IO.h \ Task.h \ + Task.inl \ + Task_Ex_T.cpp \ Task_Ex_T.h \ + Task_Ex_T.inl \ + Task_T.cpp \ Task_T.h \ + Task_T.inl \ + Template_Instantiations.cpp \ + Test_and_Set.cpp \ Test_and_Set.h \ Thread.h \ + Thread.inl \ Thread_Adapter.h \ + Thread_Adapter.inl \ Thread_Control.h \ + Thread_Control.inl \ Thread_Exit.h \ Thread_Hook.h \ Thread_Manager.h \ + Thread_Manager.inl \ Thread_Mutex.h \ + Thread_Mutex.inl \ Thread_Semaphore.h \ + Thread_Semaphore.inl \ Time_Request_Reply.h \ Time_Value.h \ + Time_Value.inl \ Timeprobe.h \ + Timeprobe.inl \ + Timeprobe_T.cpp \ Timeprobe_T.h \ Timer_Hash.h \ + Timer_Hash_T.cpp \ Timer_Hash_T.h \ Timer_Heap.h \ + Timer_Heap_T.cpp \ Timer_Heap_T.h \ Timer_List.h \ + Timer_List_T.cpp \ Timer_List_T.h \ Timer_Queue.h \ + Timer_Queue_Adapters.cpp \ Timer_Queue_Adapters.h \ + Timer_Queue_Adapters.inl \ + Timer_Queue_T.cpp \ Timer_Queue_T.h \ + Timer_Queue_T.inl \ Timer_Queuefwd.h \ Timer_Wheel.h \ + Timer_Wheel_T.cpp \ Timer_Wheel_T.h \ - TkReactor.h \ Token.h \ + Token.inl \ Token_Collection.h \ + Token_Collection.inl \ Token_Invariants.h \ Token_Manager.h \ + Token_Manager.inl \ Token_Request_Reply.h \ + Token_Request_Reply.inl \ Trace.h \ + Typed_SV_Message.cpp \ Typed_SV_Message.h \ + Typed_SV_Message.inl \ + Typed_SV_Message_Queue.cpp \ Typed_SV_Message_Queue.h \ + Typed_SV_Message_Queue.inl \ UNIX_Addr.h \ + UNIX_Addr.inl \ UPIPE_Acceptor.h \ + UPIPE_Acceptor.inl \ UPIPE_Addr.h \ UPIPE_Connector.h \ + UPIPE_Connector.inl \ UPIPE_Stream.h \ + UPIPE_Stream.inl \ UUID.h \ + UUID.inl \ + Unbounded_Queue.cpp \ Unbounded_Queue.h \ + Unbounded_Queue.inl \ + Unbounded_Set.cpp \ Unbounded_Set.h \ - Unbounded_Set_Ex.h \ + Unbounded_Set.inl \ + Vector_T.cpp \ Vector_T.h \ + Vector_T.inl \ Version.h \ WFMO_Reactor.h \ + WFMO_Reactor.inl \ WIN32_Asynch_IO.h \ WIN32_Proactor.h \ XML_Svc_Conf.h \ XTI_ATM_Mcast.h \ - XtReactor.h \ + XTI_ATM_Mcast.inl \ ace_wchar.h \ + ace_wchar.inl \ config-WinCE.h \ config-all.h \ config-borland-common.h \ @@ -886,358 +1166,176 @@ nobase_include_HEADERS = \ post.h \ pre.h \ streams.h \ - svc_export.h \ - ACE.inl \ - ARGV.inl \ - ATM_Acceptor.inl \ - ATM_Addr.inl \ - ATM_Connector.inl \ - ATM_Params.inl \ - ATM_QoS.inl \ - ATM_Stream.inl \ - Activation_Queue.inl \ - Active_Map_Manager.inl \ - Active_Map_Manager_T.inl \ - Addr.inl \ - Argv_Type_Converter.inl \ - Array_Base.inl \ - Asynch_IO_Impl.inl \ - Atomic_Op.inl \ - Atomic_Op_T.inl \ - Auto_Event.inl \ - Auto_Functor.inl \ - Auto_IncDec_T.inl \ - Auto_Ptr.inl \ - Barrier.inl \ - Base_Thread_Adapter.inl \ - Based_Pointer_T.inl \ - Basic_Stats.inl \ - Basic_Types.inl \ - Bound_Ptr.inl \ - CDR_Base.inl \ - CDR_Stream.inl \ - Cache_Map_Manager_T.inl \ - Caching_Strategies_T.inl \ - Capabilities.inl \ - Cleanup.inl \ - Codeset_Registry.inl \ - Condition_T.inl \ - Condition_Thread_Mutex.inl \ - Containers.inl \ - Containers_T.inl \ - DEV.inl \ - DEV_Addr.inl \ - DEV_Connector.inl \ - DEV_IO.inl \ - Date_Time.inl \ - Dev_Poll_Reactor.inl \ - Dirent.inl \ - Dirent_Selector.inl \ - Dynamic.inl \ - Dynamic_Service.inl \ - Env_Value_T.inl \ - Event.inl \ - Event_Handler.inl \ - Event_Handler_T.inl \ - FIFO.inl \ - FIFO_Recv.inl \ - FIFO_Recv_Msg.inl \ - FIFO_Send.inl \ - FIFO_Send_Msg.inl \ - FILE.inl \ - FILE_Addr.inl \ - FILE_Connector.inl \ - FILE_IO.inl \ - File_Lock.inl \ - Flag_Manip.inl \ - Framework_Component.inl \ - Free_List.inl \ - Functor.inl \ - Functor_String.inl \ - Functor_T.inl \ - Get_Opt.inl \ - Guard_T.inl \ - Handle_Gobbler.inl \ - Handle_Set.inl \ - Hash_Cache_Map_Manager_T.inl \ - Hash_Map_Manager_T.inl \ - Hash_Map_With_Allocator_T.inl \ - Hashable.inl \ - High_Res_Timer.inl \ - ICMP_Socket.inl \ - INET_Addr.inl \ - IOStream_T.inl \ - IO_SAP.inl \ - IPC_SAP.inl \ - Intrusive_List.inl \ - Intrusive_List_Node.inl \ - LSOCK.inl \ - LSOCK_CODgram.inl \ - LSOCK_Connector.inl \ - LSOCK_Dgram.inl \ - LSOCK_Stream.inl \ - Local_Tokens.inl \ - Lock.inl \ - Lock_Adapter_T.inl \ - Log_Record.inl \ - MEM_Acceptor.inl \ - MEM_Addr.inl \ - MEM_Connector.inl \ - MEM_IO.inl \ - MEM_SAP.inl \ - MEM_Stream.inl \ - Malloc.inl \ - Malloc_Allocator.inl \ - Malloc_T.inl \ - Managed_Object.inl \ - Manual_Event.inl \ - Map_Manager.inl \ - Map_T.inl \ - Mem_Map.inl \ - Message_Block.inl \ - Message_Block_T.inl \ - Message_Queue.inl \ - Message_Queue_T.inl \ - Module.inl \ - Msg_WFMO_Reactor.inl \ - Multihomed_INET_Addr.inl \ - Mutex.inl \ - NT_Service.inl \ - Notification_Strategy.inl \ - OS.inl \ - OS_Errno.inl \ - OS_Log_Msg_Attributes.inl \ - OS_Memory.inl \ - OS_NS_Thread.inl \ - OS_NS_arpa_inet.inl \ - OS_NS_ctype.inl \ - OS_NS_dirent.inl \ - OS_NS_dlfcn.inl \ - OS_NS_errno.inl \ - OS_NS_fcntl.inl \ - OS_NS_math.inl \ - OS_NS_netdb.inl \ - OS_NS_poll.inl \ - OS_NS_pwd.inl \ - OS_NS_regex.inl \ - OS_NS_signal.inl \ - OS_NS_stdio.inl \ - OS_NS_stdlib.inl \ - OS_NS_string.inl \ - OS_NS_strings.inl \ - OS_NS_stropts.inl \ - OS_NS_sys_mman.inl \ - OS_NS_sys_msg.inl \ - OS_NS_sys_resource.inl \ - OS_NS_sys_select.inl \ - OS_NS_sys_shm.inl \ - OS_NS_sys_socket.inl \ - OS_NS_sys_stat.inl \ - OS_NS_sys_time.inl \ - OS_NS_sys_uio.inl \ - OS_NS_sys_utsname.inl \ - OS_NS_sys_wait.inl \ - OS_NS_time.inl \ - OS_NS_unistd.inl \ - OS_NS_wchar.inl \ - OS_String.inl \ - OS_TLI.inl \ - Obchunk.inl \ - Object_Manager.inl \ - Obstack_T.inl \ - PI_Malloc.inl \ - POSIX_CB_Proactor.inl \ - POSIX_Proactor.inl \ - Pagefile_Memory_Pool.inl \ - Pair_T.inl \ - Parse_Node.inl \ - Ping_Socket.inl \ - Pipe.inl \ - Proactor.inl \ - Process.inl \ - Process_Manager.inl \ - Process_Mutex.inl \ - Process_Semaphore.inl \ - Profile_Timer.inl \ - RB_Tree.inl \ - RW_Mutex.inl \ - RW_Process_Mutex.inl \ - RW_Thread_Mutex.inl \ - Reactor.inl \ - Reactor_Notification_Strategy.inl \ - Read_Buffer.inl \ - Recursive_Thread_Mutex.inl \ - Recyclable.inl \ - Refcountable.inl \ - Refcounted_Auto_Ptr.inl \ - Remote_Tokens.inl \ - Reverse_Lock_T.inl \ - SOCK.inl \ - SOCK_Acceptor.inl \ - SOCK_CODgram.inl \ - SOCK_Connector.inl \ - SOCK_Dgram.inl \ - SOCK_Dgram_Bcast.inl \ - SOCK_Dgram_Mcast.inl \ - SOCK_IO.inl \ - SOCK_SEQPACK_Acceptor.inl \ - SOCK_SEQPACK_Association.inl \ - SOCK_SEQPACK_Connector.inl \ - SOCK_Stream.inl \ - SPIPE.inl \ - SPIPE_Addr.inl \ - SPIPE_Connector.inl \ - SPIPE_Stream.inl \ - SString.inl \ - SUN_Proactor.inl \ - SV_Message.inl \ - SV_Message_Queue.inl \ - SV_Semaphore_Complex.inl \ - SV_Semaphore_Simple.inl \ - SV_Shared_Memory.inl \ - Sample_History.inl \ - Sched_Params.inl \ - Select_Reactor_Base.inl \ - Select_Reactor_T.inl \ - Semaphore.inl \ - Service_Config.inl \ - Service_Manager.inl \ - Service_Object.inl \ - Service_Repository.inl \ - Service_Types.inl \ - Shared_Memory_MM.inl \ - Shared_Memory_SV.inl \ - Shared_Object.inl \ - Signal.inl \ - Singleton.inl \ - Stats.inl \ - Strategies_T.inl \ - Stream.inl \ - String_Base.inl \ - Swap.inl \ - Synch_Options.inl \ - TLI.inl \ - TLI_Connector.inl \ - TLI_Stream.inl \ - TP_Reactor.inl \ - TSS_Adapter.inl \ - TSS_T.inl \ - Task.inl \ - Task_Ex_T.inl \ - Task_T.inl \ - Thread.inl \ - Thread_Adapter.inl \ - Thread_Control.inl \ - Thread_Manager.inl \ - Thread_Mutex.inl \ - Thread_Semaphore.inl \ - Time_Value.inl \ - Timeprobe.inl \ - Timer_Queue_Adapters.inl \ - Timer_Queue_T.inl \ - Token.inl \ - Token_Collection.inl \ - Token_Manager.inl \ - Token_Request_Reply.inl \ - Typed_SV_Message.inl \ - Typed_SV_Message_Queue.inl \ - UNIX_Addr.inl \ - UPIPE_Acceptor.inl \ - UPIPE_Connector.inl \ - UPIPE_Stream.inl \ - UUID.inl \ - Unbounded_Queue.inl \ - Unbounded_Set.inl \ - Unbounded_Set_Ex.inl \ - Vector_T.inl \ - WFMO_Reactor.inl \ - XTI_ATM_Mcast.inl \ - ace_wchar.inl \ - Acceptor.cpp \ - Active_Map_Manager_T.cpp \ - Array_Base.cpp \ - Asynch_Acceptor.cpp \ - Asynch_Connector.cpp \ - Atomic_Op_T.cpp \ - Auto_Functor.cpp \ - Auto_IncDec_T.cpp \ - Auto_Ptr.cpp \ - Based_Pointer_T.cpp \ - Cache_Map_Manager_T.cpp \ - Cached_Connect_Strategy_T.cpp \ - Caching_Strategies_T.cpp \ - Caching_Utility_T.cpp \ - Cleanup_Strategies_T.cpp \ - Condition_T.cpp \ - Connector.cpp \ - Containers_T.cpp \ - Dump_T.cpp \ - Dynamic_Service.cpp \ - Env_Value_T.cpp \ - Event_Handler_T.cpp \ - Framework_Component_T.cpp \ - Free_List.cpp \ - Functor_T.cpp \ - Future.cpp \ - Future_Set.cpp \ - Guard_T.cpp \ - Hash_Cache_Map_Manager_T.cpp \ - Hash_Map_Manager_T.cpp \ - Hash_Map_With_Allocator_T.cpp \ - IOStream_T.cpp \ - Intrusive_List.cpp \ - Intrusive_List_Node.cpp \ - LOCK_SOCK_Acceptor.cpp \ - Local_Name_Space_T.cpp \ - Lock_Adapter_T.cpp \ - Malloc_T.cpp \ - Managed_Object.cpp \ - Map_Manager.cpp \ - Map_T.cpp \ - Message_Block_T.cpp \ - Message_Queue_T.cpp \ - Metrics_Cache_T.cpp \ - Module.cpp \ - Node.cpp \ - Obstack_T.cpp \ - Pair_T.cpp \ - RB_Tree.cpp \ - Reverse_Lock_T.cpp \ - Select_Reactor_T.cpp \ - Singleton.cpp \ - Strategies_T.cpp \ - Stream.cpp \ - Stream_Modules.cpp \ - String_Base.cpp \ - Svc_Handler.cpp \ - Synch_T.cpp \ - TSS_T.cpp \ - Task_Ex_T.cpp \ - Task_T.cpp \ - Template_Instantiations.cpp \ - Test_and_Set.cpp \ - Timeprobe_T.cpp \ - Timer_Hash_T.cpp \ - Timer_Heap_T.cpp \ - Timer_List_T.cpp \ - Timer_Queue_Adapters.cpp \ - Timer_Queue_T.cpp \ - Timer_Wheel_T.cpp \ - Typed_SV_Message.cpp \ - Typed_SV_Message_Queue.cpp \ - Unbounded_Queue.cpp \ - Unbounded_Set.cpp \ - Unbounded_Set_Ex.cpp \ - Vector_T.cpp + svc_export.h -pkgconfigdata_DATA = ACE.pc +pkgconfigdata_DATA += ACE.pc -ACE.pc: ${top_builddir}/config.status ACE.pc.in +ACE.pc: ${top_builddir}/config.status ${srcdir}/ACE.pc.in ${top_builddir}/config.status --file $@:${srcdir}/ACE.pc.in EXTRA_DIST = \ + ACE.pc.in \ ace.rc + +## Makefile.ACE_FlReactor.am + +if BUILD_FL +if BUILD_GL +if BUILD_X11 + +lib_LTLIBRARIES += libACE_FlReactor.la + +libACE_FlReactor_la_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -DACE_FLREACTOR_BUILD_DLL + +libACE_FlReactor_la_SOURCES = \ + FlReactor.cpp + +libACE_FlReactor_la_LDFLAGS = \ + -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ + +libACE_FlReactor_la_LIBADD = \ + libACE.la + +nobase_include_HEADERS += \ + ACE_FlReactor_export.h \ + FlReactor.h + +pkgconfigdata_DATA += ACE_FlReactor.pc + +ACE_FlReactor.pc: ${top_builddir}/config.status ${srcdir}/ACE_FlReactor.pc.in + ${top_builddir}/config.status --file $@:${srcdir}/ACE_FlReactor.pc.in + +endif BUILD_X11 +endif BUILD_GL +endif BUILD_FL + +EXTRA_DIST += \ + ACE_FlReactor.pc.in + + +## Makefile.ACE_QtReactor.am + +if BUILD_QT + +BUILT_SOURCES += \ + QtReactor_moc.cpp + +CLEANFILES += \ + QtReactor_moc.cpp + +QtReactor_moc.cpp: $(srcdir)/QtReactor.h + $(QTDIR)/bin/moc $(srcdir)/QtReactor.h -o QtReactor_moc.cpp + +lib_LTLIBRARIES += libACE_QtReactor.la + +libACE_QtReactor_la_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(QTDIR)/include \ + -DQT_THREAD_SUPPORT \ + -DACE_QTREACTOR_BUILD_DLL + +libACE_QtReactor_la_SOURCES = \ + QtReactor.cpp \ + QtReactor_moc.cpp + +libACE_QtReactor_la_LDFLAGS = \ + -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ + +libACE_QtReactor_la_LIBADD = \ + libACE.la -lqt-mt + +nobase_include_HEADERS += \ + ACE_QtReactor_export.h \ + QtReactor.h + +pkgconfigdata_DATA += ACE_QtReactor.pc + +ACE_QtReactor.pc: ${top_builddir}/config.status ${srcdir}/ACE_QtReactor.pc.in + ${top_builddir}/config.status --file $@:${srcdir}/ACE_QtReactor.pc.in + +endif BUILD_QT + +EXTRA_DIST += \ + ACE_QtReactor.pc.in + + +## Makefile.ACE_TkReactor.am + +if BUILD_TK + +lib_LTLIBRARIES += libACE_TkReactor.la + +libACE_TkReactor_la_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -DACE_TKREACTOR_BUILD_DLL + +libACE_TkReactor_la_SOURCES = \ + TkReactor.cpp + +libACE_TkReactor_la_LDFLAGS = \ + -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ + +libACE_TkReactor_la_LIBADD = \ + libACE.la + +nobase_include_HEADERS += \ + ACE_TkReactor_export.h \ + TkReactor.h + +pkgconfigdata_DATA += ACE_TkReactor.pc + +ACE_TkReactor.pc: ${top_builddir}/config.status ${srcdir}/ACE_TkReactor.pc.in + ${top_builddir}/config.status --file $@:${srcdir}/ACE_TkReactor.pc.in + +endif BUILD_TK + +EXTRA_DIST += \ + ACE_TkReactor.pc.in + + +## Makefile.ACE_XtReactor.am + +if BUILD_X11 +if BUILD_XT + +lib_LTLIBRARIES += libACE_XtReactor.la + +libACE_XtReactor_la_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -DACE_XTREACTOR_BUILD_DLL + +libACE_XtReactor_la_SOURCES = \ + XtReactor.cpp + +libACE_XtReactor_la_LDFLAGS = \ + -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ + +libACE_XtReactor_la_LIBADD = \ + libACE.la + +nobase_include_HEADERS += \ + ACE_XtReactor_export.h \ + XtReactor.h + +pkgconfigdata_DATA += ACE_XtReactor.pc + +ACE_XtReactor.pc: ${top_builddir}/config.status ${srcdir}/ACE_XtReactor.pc.in + ${top_builddir}/config.status --file $@:${srcdir}/ACE_XtReactor.pc.in + +endif BUILD_XT +endif BUILD_X11 + +EXTRA_DIST += \ + ACE_XtReactor.pc.in + + ## Clean up template repositories, etc. clean-local: -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* diff --git a/ace/Map_T.inl b/ace/Map_T.inl index e786e1de5bf..82bd75794b2 100644 --- a/ace/Map_T.inl +++ b/ace/Map_T.inl @@ -256,7 +256,7 @@ template ACE_INLINE int ACE_Map_Impl_Iterator_Adapter::compare (const ACE_Iterator_Impl &rhs) const { const ACE_Map_Impl_Iterator_Adapter &rhs_local - = ACE_dynamic_cast_3_ref (const ACE_Map_Impl_Iterator_Adapter, T, IMPLEMENTATION, ENTRY, rhs); + = dynamic_cast &> (rhs); return this->implementation_ == rhs_local.implementation_; } @@ -313,7 +313,7 @@ template ACE_INLINE int ACE_Map_Impl_Reverse_Iterator_Adapter::compare (const ACE_Reverse_Iterator_Impl &rhs) const { const ACE_Map_Impl_Reverse_Iterator_Adapter &rhs_local - = ACE_dynamic_cast_3_ref (const ACE_Map_Impl_Reverse_Iterator_Adapter, T, IMPLEMENTATION, ENTRY, rhs); + = dynamic_cast &> (rhs); return this->implementation_ == rhs_local.implementation_; } @@ -579,7 +579,7 @@ template ACE_INLINE int ACE_Active_Map_Manager_Iterator_Adapter::compare (const ACE_Iterator_Impl &rhs) const { const ACE_Active_Map_Manager_Iterator_Adapter &rhs_local - = ACE_dynamic_cast_2_ref (const ACE_Active_Map_Manager_Iterator_Adapter, T, VALUE, rhs); + = dynamic_cast &> (rhs); return this->implementation_ == rhs_local.implementation_; } @@ -637,7 +637,7 @@ template ACE_INLINE int ACE_Active_Map_Manager_Reverse_Iterator_Adapter::compare (const ACE_Reverse_Iterator_Impl &rhs) const { const ACE_Active_Map_Manager_Reverse_Iterator_Adapter &rhs_local - = ACE_dynamic_cast_2_ref (const ACE_Active_Map_Manager_Reverse_Iterator_Adapter, T, VALUE, rhs); + = dynamic_cast &> (rhs); return this->implementation_ == rhs_local.implementation_; } @@ -1071,7 +1071,7 @@ template A ACE_Hash_Map_Manager_Ex_Iterator_Adapter::compare (const ACE_Iterator_Impl &rhs) const { const ACE_Hash_Map_Manager_Ex_Iterator_Adapter &rhs_local - = ACE_dynamic_cast_5_ref (const ACE_Hash_Map_Manager_Ex_Iterator_Adapter, T, KEY, VALUE, HASH_KEY, COMPARE_KEYS, rhs); + = dynamic_cast &> (rhs); return this->implementation_ == rhs_local.implementation_; } @@ -1129,7 +1129,7 @@ template A ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter::compare (const ACE_Reverse_Iterator_Impl &rhs) const { const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter &rhs_local - = ACE_dynamic_cast_5_ref (const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter, T, KEY, VALUE, HASH_KEY, COMPARE_KEYS, rhs); + = dynamic_cast &> (rhs); return this->implementation_ == rhs_local.implementation_; } @@ -1414,7 +1414,7 @@ template ACE_INLINE int ACE_Map_Manager_Iterator_Adapter::compare (const ACE_Iterator_Impl &rhs) const { const ACE_Map_Manager_Iterator_Adapter &rhs_local - = ACE_dynamic_cast_3_ref (const ACE_Map_Manager_Iterator_Adapter, T, KEY, VALUE, rhs); + = dynamic_cast &> (rhs); return this->implementation_ == rhs_local.implementation_; } @@ -1472,7 +1472,7 @@ template ACE_INLINE int ACE_Map_Manager_Reverse_Iterator_Adapter::compare (const ACE_Reverse_Iterator_Impl &rhs) const { const ACE_Map_Manager_Reverse_Iterator_Adapter &rhs_local - = ACE_dynamic_cast_3_ref (const ACE_Map_Manager_Reverse_Iterator_Adapter, T, KEY, VALUE, rhs); + = dynamic_cast &> (rhs); return this->implementation_ == rhs_local.implementation_; } diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp index b15838a8791..09b12e2b91c 100644 --- a/ace/Message_Block.cpp +++ b/ace/Message_Block.cpp @@ -322,7 +322,7 @@ ACE_Data_Block::ACE_Data_Block (size_t size, cur_size_ (0), // Reset later if memory alloc'd ok max_size_ (0), flags_ (flags), - base_ ((char *) msg_data), + base_ (const_cast (msg_data)), allocator_strategy_ (allocator_strategy), locking_strategy_ (locking_strategy), reference_count_ (1), diff --git a/ace/Message_Queue.cpp b/ace/Message_Queue.cpp index 0697a564a7e..6ba5fa5c649 100644 --- a/ace/Message_Queue.cpp +++ b/ace/Message_Queue.cpp @@ -437,7 +437,7 @@ ACE_Message_Queue_NT::deactivate (void) // Get the number of shutdown messages necessary to wake up all // waiting threads. DWORD cntr = - this->cur_thrs_ - ACE_static_cast (DWORD, this->cur_count_); + this->cur_thrs_ - static_cast (this->cur_count_); while (cntr-- > 0) ::PostQueuedCompletionStatus (this->completion_port_, 0, @@ -472,7 +472,7 @@ ACE_Message_Queue_NT::pulse (void) // waiting threads. DWORD cntr = - this->cur_thrs_ - ACE_static_cast (DWORD, this->cur_count_); + this->cur_thrs_ - static_cast (this->cur_count_); while (cntr-- > 0) ::PostQueuedCompletionStatus (this->completion_port_, 0, diff --git a/ace/Message_Queue_T.cpp b/ace/Message_Queue_T.cpp index ff017456769..58fb0053f86 100644 --- a/ace/Message_Queue_T.cpp +++ b/ace/Message_Queue_T.cpp @@ -118,7 +118,7 @@ ACE_Message_Queue_Ex::peek_dequeue_head (ACE_ME int cur_count = this->queue_.peek_dequeue_head (mb, timeout); if (cur_count != -1) - first_item = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ()); + first_item = reinterpret_cast (mb->base ()); return cur_count; } @@ -242,7 +242,7 @@ ACE_Message_Queue_Ex::dequeue_head (ACE_MESSAGE // Dequeue the message. if (cur_count != -1) { - first_item = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ()); + first_item = reinterpret_cast (mb->base ()); // Delete the message block. mb->release (); return cur_count; @@ -268,7 +268,7 @@ ACE_Message_Queue_Ex::dequeue_prio (ACE_MESSAGE // Dequeue the message. if (cur_count != -1) { - dequeued = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ()); + dequeued = reinterpret_cast (mb->base ()); // Delete the message block. mb->release (); return cur_count; @@ -294,7 +294,7 @@ ACE_Message_Queue_Ex::dequeue_tail (ACE_MESSAGE // Dequeue the message. if (cur_count != -1) { - dequeued = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ()); + dequeued = reinterpret_cast (mb->base ()); // Delete the message block. mb->release (); return cur_count; @@ -320,7 +320,7 @@ ACE_Message_Queue_Ex::dequeue_deadline (ACE_MES // Dequeue the message. if (cur_count != -1) { - dequeued = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ()); + dequeued = reinterpret_cast (mb->base ()); // Delete the message block. mb->release (); return cur_count; diff --git a/ace/Name_Proxy.cpp b/ace/Name_Proxy.cpp index a5157d5d9ac..5a3e61cbb16 100644 --- a/ace/Name_Proxy.cpp +++ b/ace/Name_Proxy.cpp @@ -49,8 +49,10 @@ ACE_Name_Proxy::open (const ACE_INET_Addr &remote_addr, // Establish binding with the ACE_Name Server at remote_addr. -ACE_Name_Proxy::ACE_Name_Proxy (const ACE_INET_Addr &remote_addr, - ACE_Synch_Options& options) +ACE_Name_Proxy::ACE_Name_Proxy ( + const ACE_INET_Addr &remote_addr, + ACE_Synch_Options& options) + : reactor_ (0) { ACE_TRACE ("ACE_Name_Proxy::ACE_Name_Proxy"); if (this->open (remote_addr, options) == -1 diff --git a/ace/Name_Proxy.h b/ace/Name_Proxy.h index a10dac70b29..594df3c3c2a 100644 --- a/ace/Name_Proxy.h +++ b/ace/Name_Proxy.h @@ -32,6 +32,7 @@ #include "ace/Service_Config.h" #include "ace/Synch_Options.h" #include "ace/Name_Request_Reply.h" +#include "ace/Event_Handler.h" /** * @class ACE_Name_Proxy @@ -85,6 +86,11 @@ private: /// Pointer to ACE_Reactor (used if we are run in "reactive-mode"). ACE_Reactor *reactor_; + +private: + // Prevent copying + ACE_Name_Proxy (const ACE_Name_Proxy &); + ACE_Name_Proxy &operator= (const ACE_Name_Proxy &); }; #include /**/ "ace/post.h" diff --git a/ace/Naming_Context.cpp b/ace/Naming_Context.cpp index 112f1dfcf0e..871f4ee0ce7 100644 --- a/ace/Naming_Context.cpp +++ b/ace/Naming_Context.cpp @@ -54,7 +54,7 @@ ACE_Naming_Context::info (ACE_TCHAR **strp, return -1; else ACE_OS::strsncpy (*strp, buf, length); - return ACE_static_cast (int, ACE_OS::strlen (buf)); + return static_cast (ACE_OS::strlen (buf)); } int @@ -156,7 +156,8 @@ ACE_Naming_Context::ACE_Naming_Context (void) ACE_Naming_Context::ACE_Naming_Context (Context_Scope_Type scope_in, int lite) : name_options_ (0), - name_space_ (0) + name_space_ (0), + netnameserver_host_ (0) { ACE_TRACE ("ACE_Naming_Context::ACE_Naming_Context"); @@ -655,7 +656,7 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[]) break; case 'b': this->base_address - (ACE_static_cast (char *, ACE_OS::atop (get_opt.opt_arg ()))); + (static_cast (ACE_OS::atop (get_opt.opt_arg ()))); break; case 'T': #if defined (ACE_HAS_TRACE) diff --git a/ace/Node.cpp b/ace/Node.cpp index f13b18cde86..91e989d739b 100644 --- a/ace/Node.cpp +++ b/ace/Node.cpp @@ -23,16 +23,14 @@ ACE_Node::~ACE_Node (void) template ACE_Node::ACE_Node (const T &i, ACE_Node *n) : next_ (n), - item_ (i), - deleted_ (false) + item_ (i) { // ACE_TRACE ("ACE_Node::ACE_Node"); } template ACE_Node::ACE_Node (ACE_Node *n, int) - : next_ (n), - deleted_ (false) + : next_ (n) { // ACE_TRACE ("ACE_Node::ACE_Node"); } @@ -40,8 +38,7 @@ ACE_Node::ACE_Node (ACE_Node *n, int) template ACE_Node::ACE_Node (const ACE_Node &s) : next_ (s.next_), - item_ (s.item_), - deleted_ (false) + item_ (s.item_) { // ACE_TRACE ("ACE_Node::ACE_Node"); } diff --git a/ace/Node.h b/ace/Node.h index 4abe6e9b69f..607d0b6f137 100644 --- a/ace/Node.h +++ b/ace/Node.h @@ -25,9 +25,6 @@ template class ACE_Unbounded_Set; template class ACE_Unbounded_Set_Iterator; template class ACE_Unbounded_Set_Const_Iterator; -template class ACE_Unbounded_Set_Ex; -template class ACE_Unbounded_Set_Ex_Iterator; -template class ACE_Unbounded_Set_Ex_Const_Iterator; template class ACE_Unbounded_Queue; template class ACE_Unbounded_Queue_Iterator; template class ACE_Unbounded_Queue_Const_Iterator; @@ -49,9 +46,6 @@ public: friend class ACE_Unbounded_Set; friend class ACE_Unbounded_Set_Iterator; friend class ACE_Unbounded_Set_Const_Iterator; - friend class ACE_Unbounded_Set_Ex; - friend class ACE_Unbounded_Set_Ex_Iterator; - friend class ACE_Unbounded_Set_Ex_Const_Iterator; friend class ACE_Unbounded_Stack; friend class ACE_Unbounded_Stack_Iterator; @@ -71,9 +65,6 @@ private: /// Current value of the item in this node. T item_; - - /// Flag that indicates whether this node is deleted. - int deleted_; }; #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) diff --git a/ace/OS.h b/ace/OS.h index 4d73985e244..98054918dab 100644 --- a/ace/OS.h +++ b/ace/OS.h @@ -264,7 +264,6 @@ class ACE_Timeout_Manager; # elif defined(__rtems__) # include "ace/os_include/os_fcntl.h" // # include "ace/os_include/sys/os_resource.h" -# include "ace/os_include/sys/os_fcntl.h" # include "ace/os_include/sys/os_time.h" # include "ace/os_include/sys/os_utsname.h" # include "ace/os_include/sys/os_wait.h" diff --git a/ace/OS_NS_Thread.cpp b/ace/OS_NS_Thread.cpp index ddb6d4aeef6..5f5cfd52fd0 100644 --- a/ace/OS_NS_Thread.cpp +++ b/ace/OS_NS_Thread.cpp @@ -403,6 +403,22 @@ ACE_TSS_Emulation::release_key (ACE_thread_key_t key) return 1; } +int +ACE_TSS_Emulation::is_key (ACE_thread_key_t key) +{ + ACE_OS_Recursive_Thread_Mutex_Guard ( + *static_cast + (ACE_OS_Object_Manager::preallocated_object[ + ACE_OS_Object_Manager::ACE_TSS_KEY_LOCK])); + + if (tss_keys_used_ != 0 && + tss_keys_used_->is_set (key) == 1) + { + return 1; + } + return 0; +} + void * ACE_TSS_Emulation::tss_open (void *ts_storage[ACE_TSS_THREAD_KEYS_MAX]) { @@ -620,7 +636,7 @@ ACE_TSS_Keys::test_and_clear (const ACE_thread_key_t key) u_int word, bit; find (key_index, word, bit); - if (ACE_BIT_ENABLED (key_bit_words_[word], 1 << bit)) + if (word < ACE_WORDS && ACE_BIT_ENABLED (key_bit_words_[word], 1 << bit)) { ACE_CLR_BITS (key_bit_words_[word], 1 << bit); return 0; @@ -638,7 +654,7 @@ ACE_TSS_Keys::is_set (const ACE_thread_key_t key) const u_int word, bit; find (key_index, word, bit); - return ACE_BIT_ENABLED (key_bit_words_[word], 1 << bit); + return word < ACE_WORDS ? ACE_BIT_ENABLED (key_bit_words_[word], 1 << bit) : 0; } /*****************************************************************************/ @@ -3515,9 +3531,7 @@ ACE_OS::thr_setspecific (ACE_thread_key_t key, void *data) // ACE_OS_TRACE ("ACE_OS::thr_setspecific"); #if defined (ACE_HAS_THREADS) # if defined (ACE_HAS_TSS_EMULATION) - ACE_KEY_INDEX (key_index, key); - - if (key_index >= ACE_TSS_Emulation::total_keys ()) + if (ACE_TSS_Emulation::is_key (key) == 0) { errno = EINVAL; data = 0; diff --git a/ace/OS_NS_Thread.h b/ace/OS_NS_Thread.h index 987f3c0f770..7775da2d2fa 100644 --- a/ace/OS_NS_Thread.h +++ b/ace/OS_NS_Thread.h @@ -863,6 +863,9 @@ public: /// new request. Returns 0 on success, 1 if the key was not reserved. static int release_key (ACE_thread_key_t key); + /// Check a key for validity. + static int is_key (ACE_thread_key_t key); + /// Returns the exit hook associated with the key. Does _not_ check /// for a valid key. static ACE_TSS_DESTRUCTOR tss_destructor (const ACE_thread_key_t key); diff --git a/ace/OS_NS_Thread.inl b/ace/OS_NS_Thread.inl index 2262fae16a2..14f783b47ea 100644 --- a/ace/OS_NS_Thread.inl +++ b/ace/OS_NS_Thread.inl @@ -3711,8 +3711,7 @@ ACE_OS::thr_getspecific (ACE_thread_key_t key, void **data) // ACE_OS_TRACE ("ACE_OS::thr_getspecific"); #if defined (ACE_HAS_THREADS) # if defined (ACE_HAS_TSS_EMULATION) - ACE_KEY_INDEX (key_index, key); - if (key_index >= ACE_TSS_Emulation::total_keys ()) + if (ACE_TSS_Emulation::is_key (key) == 0) { errno = EINVAL; data = 0; diff --git a/ace/OS_NS_fcntl.cpp b/ace/OS_NS_fcntl.cpp index d9586a8e4ac..d901c53e702 100644 --- a/ace/OS_NS_fcntl.cpp +++ b/ace/OS_NS_fcntl.cpp @@ -121,26 +121,26 @@ ACE_OS::open (const char *filename, return 0; # else unsigned long result, handle; - result = ::open_f (&handle, ACE_const_cast(char *, filename), 0); + result = ::open_f (&handle, const_cast (filename), 0); if (result != 0) { // We need to clean this up...not 100% correct! // To correct we should handle all the cases of TRUNC and CREAT if ((result == 0x200B) && (ACE_BIT_ENABLED (mode, O_CREAT))) { - result = ::create_f(ACE_const_cast(char *, filename),1,0); + result = ::create_f(const_cast (filename),1,0); if (result != 0) { errno = result; - return ACE_static_cast (ACE_HANDLE, -1); + return static_cast (-1); } else //File created...try to open it again { - result = ::open_f (&handle, ACE_const_cast(char *, filename), 0); + result = ::open_f (&handle, const_cast (filename), 0); if (result != 0) { errno = result; - return ACE_static_cast (ACE_HANDLE, -1); + return static_cast (-1); } } @@ -148,10 +148,10 @@ ACE_OS::open (const char *filename, else { errno = result; - return ACE_static_cast (ACE_HANDLE, -1); + return static_cast (-1); } } - return ACE_static_cast (ACE_HANDLE, handle); + return static_cast (handle); # endif /* defined (ACE_PSOS_LACKS_PHILE) */ #elif defined (INTEGRITY) ACE_UNUSED_ARG (sa); diff --git a/ace/OS_NS_math.inl b/ace/OS_NS_math.inl index 51db6c44966..6a55a57480a 100644 --- a/ace/OS_NS_math.inl +++ b/ace/OS_NS_math.inl @@ -1,20 +1,24 @@ // -*- C++ -*- // $Id$ -ACE_INLINE double -ACE_OS::floor (double x) -{ - // This method computes the largest integral value not greater than x. - return double (static_cast (x)); -} +namespace ACE_OS { -ACE_INLINE double -ACE_OS::ceil (double x) -{ - // This method computes the smallest integral value not less than x. - const double floor = ACE_OS::floor (x); - if (floor == x) - return floor; - else - return floor + 1; -} + ACE_INLINE double + floor (double x) + { + // This method computes the largest integral value not greater than x. + return double (static_cast (x)); + } + + ACE_INLINE double + ceil (double x) + { + // This method computes the smallest integral value not less than x. + const double floor = ACE_OS::floor (x); + if (floor == x) + return floor; + else + return floor + 1; + } + +} // ACE_OS namespace diff --git a/ace/OS_NS_netdb.cpp b/ace/OS_NS_netdb.cpp index 1915e714427..ed102852f07 100644 --- a/ace/OS_NS_netdb.cpp +++ b/ace/OS_NS_netdb.cpp @@ -208,7 +208,7 @@ ACE_OS::getmacaddress (struct macaddr_node_t *node) ACE_OS::memset (&ncb, 0, sizeof(ncb)); ncb.ncb_command = NCBENUM; - ncb.ncb_buffer = ACE_reinterpret_cast (unsigned char*,&lenum); + ncb.ncb_buffer = reinterpret_cast (&lenum); ncb.ncb_length = sizeof(lenum); result = Netbios (&ncb); @@ -229,10 +229,10 @@ ACE_OS::getmacaddress (struct macaddr_node_t *node) ADAPTERSTAT adapter; ACE_OS::memset (&ncb, 0, sizeof (ncb)); - ACE_OS::strcpy (ACE_reinterpret_cast (char*, ncb.ncb_callname), "*"); + ACE_OS::strcpy (reinterpret_cast (ncb.ncb_callname), "*"); ncb.ncb_command = NCBASTAT; ncb.ncb_lana_num = lenum.lana[i]; - ncb.ncb_buffer = ACE_reinterpret_cast (unsigned char*, &adapter); + ncb.ncb_buffer = reinterpret_cast (&adapter); ncb.ncb_length = sizeof (adapter); result = Netbios (&ncb); diff --git a/ace/OS_NS_signal.inl b/ace/OS_NS_signal.inl index e5fb4958df2..a2159ad2604 100644 --- a/ace/OS_NS_signal.inl +++ b/ace/OS_NS_signal.inl @@ -4,8 +4,10 @@ #include "ace/OS_NS_macros.h" #include "ace/OS_NS_errno.h" +namespace ACE_OS { + ACE_INLINE int -ACE_OS::kill (pid_t pid, int signum) +kill (pid_t pid, int signum) { ACE_OS_TRACE ("ACE_OS::kill"); #if defined (ACE_WIN32) || defined (CHORUS) || defined (ACE_PSOS) @@ -18,7 +20,7 @@ ACE_OS::kill (pid_t pid, int signum) } ACE_INLINE int -ACE_OS::pthread_sigmask (int how, const sigset_t *nsp, sigset_t *osp) +pthread_sigmask (int how, const sigset_t *nsp, sigset_t *osp) { #if defined (ACE_HAS_PTHREADS_STD) && !defined (ACE_LACKS_PTHREAD_SIGMASK) int result; @@ -35,9 +37,7 @@ ACE_OS::pthread_sigmask (int how, const sigset_t *nsp, sigset_t *osp) } ACE_INLINE int -ACE_OS::sigaction (int signum, - const struct sigaction *nsa, - struct sigaction *osa) +sigaction (int signum, const struct sigaction *nsa, struct sigaction *osa) { ACE_OS_TRACE ("ACE_OS::sigaction"); if (signum == 0) @@ -72,7 +72,7 @@ ACE_OS::sigaction (int signum, } ACE_INLINE int -ACE_OS::sigaddset (sigset_t *s, int signum) +sigaddset (sigset_t *s, int signum) { ACE_OS_TRACE ("ACE_OS::sigaddset"); #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) @@ -103,7 +103,7 @@ ACE_OS::sigaddset (sigset_t *s, int signum) } ACE_INLINE int -ACE_OS::sigdelset (sigset_t *s, int signum) +sigdelset (sigset_t *s, int signum) { #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) if (s == 0) @@ -133,7 +133,7 @@ ACE_OS::sigdelset (sigset_t *s, int signum) } ACE_INLINE int -ACE_OS::sigemptyset (sigset_t *s) +sigemptyset (sigset_t *s) { #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) if (s == 0) @@ -154,7 +154,7 @@ ACE_OS::sigemptyset (sigset_t *s) } ACE_INLINE int -ACE_OS::sigfillset (sigset_t *s) +sigfillset (sigset_t *s) { #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) if (s == 0) @@ -175,7 +175,7 @@ ACE_OS::sigfillset (sigset_t *s) } ACE_INLINE int -ACE_OS::sigismember (sigset_t *s, int signum) +sigismember (sigset_t *s, int signum) { #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) if (s == 0) @@ -211,7 +211,7 @@ ACE_OS::sigismember (sigset_t *s, int signum) } ACE_INLINE ACE_SignalHandler -ACE_OS::signal (int signum, ACE_SignalHandler func) +signal (int signum, ACE_SignalHandler func) { if (signum == 0) return 0; @@ -240,7 +240,7 @@ ACE_OS::signal (int signum, ACE_SignalHandler func) } ACE_INLINE int -ACE_OS::sigprocmask (int how, const sigset_t *nsp, sigset_t *osp) +sigprocmask (int how, const sigset_t *nsp, sigset_t *osp) { #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) ACE_UNUSED_ARG (how); @@ -253,7 +253,7 @@ ACE_OS::sigprocmask (int how, const sigset_t *nsp, sigset_t *osp) } ACE_INLINE int -ACE_OS::sigsuspend (const sigset_t *sigset) +sigsuspend (const sigset_t *sigset) { #if defined (ACE_HAS_SIGSUSPEND) sigset_t s; @@ -269,3 +269,5 @@ ACE_OS::sigsuspend (const sigset_t *sigset) ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_SIGSUSPEND */ } + +} /* end namespace ACE_OS */ diff --git a/ace/OS_NS_stdio.cpp b/ace/OS_NS_stdio.cpp index bc819259cda..a2c965027d7 100644 --- a/ace/OS_NS_stdio.cpp +++ b/ace/OS_NS_stdio.cpp @@ -1,9 +1,12 @@ -// -*- C++ -*- // $Id$ #include "ace/OS_NS_stdio.h" -ACE_RCSID(ace, OS_NS_stdio, "$Id$") + +ACE_RCSID (ace, + OS_NS_stdio, + "$Id$") + #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_stdio.inl" @@ -131,9 +134,9 @@ ACE_OS::fopen (const char *filename, if (fd != -1) { # if defined (__BORLANDC__) && !defined (ACE_USES_WCHAR) - FILE *fp = ::_fdopen (fd, ACE_const_cast (char *, mode)); + FILE *fp = ::_fdopen (fd, const_cast (mode)); # elif defined (__BORLANDC__) && defined (ACE_USES_WCHAR) - FILE *fp = ::_wfdopen (fd, ACE_const_cast (wchar_t *, mode)); + FILE *fp = ::_wfdopen (fd, const_cast (mode)); # elif defined (ACE_USES_WCHAR) FILE *fp = ::_wfdopen (fd, mode); # else @@ -186,9 +189,9 @@ ACE_OS::fopen (const wchar_t *filename, if (fd != -1) { # if defined (__BORLANDC__) && !defined (ACE_USES_WCHAR) - FILE *fp = ::_fdopen (fd, ACE_const_cast (char *, mode)); + FILE *fp = ::_fdopen (fd, const_cast (mode)); # elif defined (__BORLANDC__) && defined (ACE_USES_WCHAR) - FILE *fp = ::_wfdopen (fd, ACE_const_cast (wchar_t *, mode)); + FILE *fp = ::_wfdopen (fd, const_cast (mode)); # elif defined (ACE_USES_WCHAR) FILE *fp = ::_wfdopen (fd, mode); # else @@ -248,45 +251,6 @@ ACE_OS::fprintf (FILE *fp, const wchar_t *format, ...) } #endif /* ACE_HAS_WCHAR */ -char * -ACE_OS::gets (char *str, int n) -{ - ACE_OS_TRACE ("ACE_OS::gets"); - int c; - char *s = str; - - if (str == 0 || n < 0) n = 0; - if (n == 0) str = 0; - else n--; - -# if defined (DIGITAL_UNIX) - // On Tru64 getchar is a macro which calls fgetc, in that case we must explicit - // use the global namespace, because fgetc is also in the ACE_OS namespace - while ((c = ::getchar ()) != '\n') -# else - while ((c = getchar ()) != '\n') -# endif - { - - if (c == EOF && errno == EINTR) - { -# if defined (ACE_HAS_SIGNAL_SAFE_OS_CALLS) - continue; -# else - break; -# endif /* ACE_HAS_SIGNAL_SAFE_OS_CALLS */ - } - - if (c == EOF) - break; - - if (n > 0) - n--, *s++ = c; - } - if (s) *s = '\0'; - - return (c == EOF) ? 0 : str; -} // The following *printf functions aren't inline because // they use varargs. diff --git a/ace/OS_NS_stdio.h b/ace/OS_NS_stdio.h index 7a17a0f144d..a183126d63a 100644 --- a/ace/OS_NS_stdio.h +++ b/ace/OS_NS_stdio.h @@ -336,19 +336,6 @@ namespace ACE_OS { size_t nitems, FILE *fp); - /** - * The old gets () which directly maps to the evil, unprotected - * gets () has been deprecated. If you really need gets (), - * consider the following one. - * - * A better gets (). - * If n == 0, input is swallowed, but NULL is returned. - * Otherwise, reads up to n-1 bytes (not including the newline), - * then swallows rest up to newline then swallows newline - */ - extern ACE_Export - char *gets (char *str, int n = 0); - ACE_NAMESPACE_INLINE_FUNCTION void perror (const char *s); diff --git a/ace/OS_NS_stdio.inl b/ace/OS_NS_stdio.inl index e70ced3119e..421377fcbd0 100644 --- a/ace/OS_NS_stdio.inl +++ b/ace/OS_NS_stdio.inl @@ -1030,7 +1030,8 @@ ACE_OS::vsprintf (wchar_t *buffer, const wchar_t *format, va_list argptr) // The XPG4/UNIX98/C99 signature of the wide-char sprintf has a // maxlen argument. Since this method doesn't supply one, pass in - // a length that works (ULONG_MAX doesn't). If this isn't ok, use + // a length that works (ULONG_MAX doesn't on all platform since some check + // to see if the operation will remain in bounds). If this isn't ok, use // ACE_OS::snprintf(). return vswprintf (buffer, 4096, format, argptr); diff --git a/ace/OS_NS_string.h b/ace/OS_NS_string.h index 397d7c6bc70..2f357ce7ab5 100644 --- a/ace/OS_NS_string.h +++ b/ace/OS_NS_string.h @@ -334,9 +334,9 @@ namespace ACE_OS { * Unlike strncpy() this function will always add a terminating '\0' * char if maxlen > 0. So the user doesn't has to provide an extra * '\0' if the user wants a '\0' terminated dst. The function - * doesn't check for a 0 , because this will give problems - * anyway. When is 0 an empty string is made. We do not - * "touch" * if maxlen is 0. Returns . Care should be + * doesn't check for a 0 @a dst, because this will give problems + * anyway. When @a src is 0 an empty string is made. We do not + * "touch" * @a dst if maxlen is 0. Returns @a dst. Care should be * taken when replacing strncpy() calls, because in some cases a * strncpy() user is using the "not '\0' terminating" feature from * strncpy(). This happens most when the call to strncpy() was @@ -355,9 +355,9 @@ namespace ACE_OS { * Unlike strncpy() this function will always add a terminating '\0' * char if maxlen > 0. So the user doesn't has to provide an extra * '\0' if the user wants a '\0' terminated dst. The function - * doesn't check for a 0 , because this will give problems - * anyway. When is 0 an empty string is made. We do not - * "touch" * if maxlen is 0. Returns . Care should be + * doesn't check for a 0 @a dst, because this will give problems + * anyway. When @a src is 0 an empty string is made. We do not + * "touch" * @a dst if maxlen is 0. Returns @a dst. Care should be * taken when replacing strncpy() calls, because in some cases a * strncpy() user is using the "not '\0' terminating" feature from * strncpy(). This happens most when the call to strncpy() was diff --git a/ace/OS_NS_stropts.cpp b/ace/OS_NS_stropts.cpp index f8fe0b4ad7a..a8f4710a1f7 100644 --- a/ace/OS_NS_stropts.cpp +++ b/ace/OS_NS_stropts.cpp @@ -120,8 +120,7 @@ ACE_OS::ioctl (ACE_HANDLE socket, char [dwBufferLen], -1); - QOS *qos = ACE_reinterpret_cast (QOS*, - qos_buf); + QOS *qos = reinterpret_cast (qos_buf); result = ::WSAIoctl ((ACE_SOCKET) socket, io_control_code, diff --git a/ace/OS_NS_sys_socket.cpp b/ace/OS_NS_sys_socket.cpp index 1eb0500ad5f..cd4ae2d469f 100644 --- a/ace/OS_NS_sys_socket.cpp +++ b/ace/OS_NS_sys_socket.cpp @@ -55,7 +55,7 @@ ACE_OS::connect (ACE_HANDLE handle, # else ACE_UNUSED_ARG (qos_params); return ACE_OS::connect (handle, - (sockaddr *) addr, + const_cast (addr), addrlen); # endif /* ACE_HAS_WINSOCK2 */ } diff --git a/ace/OS_NS_sys_socket.inl b/ace/OS_NS_sys_socket.inl index 6695620a1bf..5e39f4f2f85 100644 --- a/ace/OS_NS_sys_socket.inl +++ b/ace/OS_NS_sys_socket.inl @@ -835,12 +835,14 @@ ACE_OS::setsockopt (ACE_HANDLE handle, #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) && defined(SO_REUSEPORT) // To work around an inconsistency with Microsofts implementation of // sockets, we will check for SO_REUSEADDR, and ignore it. Winsock - // always behaves as if SO_REUSEADDR=1. Some implementations have the - // same behaviour as Winsock, but use a new name for it. SO_REUSEPORT. - // If you want the normal behaviour for SO_REUSEADDR=0, then NT 4 sp4 and later - // supports SO_EXCLUSIVEADDRUSE. This also requires using an updated Platform SDK - // so it was decided to ignore the option for now. (Especially since ACE always - // sets SO_REUSEADDR=1, which we can mimic by doing nothing.) + // always behaves as if SO_REUSEADDR=1. Some implementations have + // the same behaviour as Winsock, but use a new name for + // it. SO_REUSEPORT. If you want the normal behaviour for + // SO_REUSEADDR=0, then NT 4 sp4 and later supports + // SO_EXCLUSIVEADDRUSE. This also requires using an updated Platform + // SDK so it was decided to ignore the option for now. (Especially + // since Windows always sets SO_REUSEADDR=1, which we can mimic by doing + // nothing.) if (level == SOL_SOCKET) { if (optname == SO_REUSEADDR) { return 0; // Not supported by Winsock diff --git a/ace/OS_NS_sys_time.h b/ace/OS_NS_sys_time.h index 8c6791f35e1..23be37b8d29 100644 --- a/ace/OS_NS_sys_time.h +++ b/ace/OS_NS_sys_time.h @@ -34,10 +34,20 @@ #define ACE_EXPORT_MACRO ACE_Export namespace ACE_OS { - +#if defined (ACE_WIN32) && defined (_WIN32_WCE) +// Something is a bit brain-damaged here and I'm not sure what... this code +// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC +// complains that the operators that return ACE_Time_Value are C-linkage +// functions that can't return a C++ class. The only way I've found to +// defeat this is to wrap the whole class in extern "C++". +// - Steve Huston, 23-Aug-2004 +extern "C++" { +#endif ACE_NAMESPACE_INLINE_FUNCTION ACE_Time_Value gettimeofday (void); - +#if defined (ACE_WIN32) && defined (_WIN32_WCE) +} +#endif } /* namespace ACE_OS */ # if defined (ACE_HAS_INLINED_OSCALLS) diff --git a/ace/OS_NS_sys_time.inl b/ace/OS_NS_sys_time.inl index a2c25b18e5d..6aec9b145dc 100644 --- a/ace/OS_NS_sys_time.inl +++ b/ace/OS_NS_sys_time.inl @@ -8,6 +8,16 @@ # include "ace/OS_NS_time.h" #endif /* VXWORKS || CHORUS || ACE_PSOS */ +#if defined (ACE_WIN32) && defined (_WIN32_WCE) +// Something is a bit brain-damaged here and I'm not sure what... this code +// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC +// complains that the operators that return ACE_Time_Value are C-linkage +// functions that can't return a C++ class. The only way I've found to +// defeat this is to wrap the whole class in extern "C++". +// - Steve Huston, 23-Aug-2004 +extern "C++" { +#endif + ACE_INLINE ACE_Time_Value ACE_OS::gettimeofday (void) { @@ -75,3 +85,7 @@ ACE_OS::gettimeofday (void) return ACE_Time_Value (tv); #endif // !defined (ACE_HAS_WINCE)&& !defined (ACE_WIN32) } + +#if defined (ACE_WIN32) && defined (_WIN32_WCE) +} +#endif diff --git a/ace/OS_NS_sys_uio.cpp b/ace/OS_NS_sys_uio.cpp index 7c52d91bab7..5b7563dc7fd 100644 --- a/ace/OS_NS_sys_uio.cpp +++ b/ace/OS_NS_sys_uio.cpp @@ -33,7 +33,7 @@ ACE_OS::readv_emulation (ACE_HANDLE handle, int i; for (i = 0; i < n; ++i) - if (ACE_static_cast (int, iov[i].iov_len) < 0) + if (static_cast (iov[i].iov_len) < 0) return -1; else length += iov[i].iov_len; @@ -117,7 +117,7 @@ ACE_OS::writev_emulation (ACE_HANDLE handle, const iovec *iov, int n) // This avoids a subtle problem where "holes" in the data // stream would occur if partial sends of a given buffer in // the iovec array occured. - if (ACE_static_cast (size_t, result) < iov[i].iov_len) + if (static_cast (result) < iov[i].iov_len) break; } } diff --git a/ace/OS_NS_sys_utsname.cpp b/ace/OS_NS_sys_utsname.cpp index 62d8476b53a..be9c24a089c 100644 --- a/ace/OS_NS_sys_utsname.cpp +++ b/ace/OS_NS_sys_utsname.cpp @@ -45,7 +45,7 @@ ACE_OS::uname (ACE_utsname *name) EK_KERNELINFO ets_kern; EK_SYSTEMINFO ets_sys; EtsGetSystemInfo (&ets_kern, &ets_sys); - sinfo.wProcessorLevel = ACE_static_cast (WORD, ets_kern.CpuType); + sinfo.wProcessorLevel = static_cast (ets_kern.CpuType); sinfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_INTEL; sinfo.dwProcessorType = ets_kern.CpuType * 100 + 86; # else diff --git a/ace/OS_NS_time.cpp b/ace/OS_NS_time.cpp index 7995a717178..a0d19c4a83d 100644 --- a/ace/OS_NS_time.cpp +++ b/ace/OS_NS_time.cpp @@ -76,26 +76,24 @@ ACE_PSOS_Time_t::ACE_PSOS_Time_t (const timespec_t& t) (tm_struct->tm_year + ACE_PSOS_Time_t::year_origin)) << ACE_PSOS_Time_t::year_shift; date_ |= (ACE_PSOS_Time_t::month_mask & - ACE_static_cast (u_long, - tm_struct->tm_mon + ACE_PSOS_Time_t::month_origin)) << + static_cast (tm_struct->tm_mon + ACE_PSOS_Time_t::month_origin)) << ACE_PSOS_Time_t::month_shift; date_ |= ACE_PSOS_Time_t::day_mask & - ACE_static_cast (u_long, tm_struct->tm_mday); + static_cast (tm_struct->tm_mday); // Encode time values from tm struct into pSOS time bit array. time_ = (ACE_PSOS_Time_t::hour_mask & - ACE_static_cast (u_long, tm_struct->tm_hour)) << + static_cast (tm_struct->tm_hour)) << ACE_PSOS_Time_t::hour_shift; time_ |= (ACE_PSOS_Time_t::minute_mask & - ACE_static_cast (u_long, tm_struct->tm_min)) << + static_cast (tm_struct->tm_min)) << ACE_PSOS_Time_t::minute_shift; time_ |= ACE_PSOS_Time_t::second_mask & - ACE_static_cast (u_int, tm_struct->tm_sec); + static_cast (tm_struct->tm_sec); // encode nanoseconds as system clock ticks - ticks_ = ACE_static_cast (u_long, - ((ACE_static_cast (double, t.tv_nsec) * - ACE_static_cast (double, KC_TICKS2SEC)) / - ACE_static_cast (double, 1000000000))); + ticks_ = static_cast (((static_cast (t.tv_nsec) * + static_cast (KC_TICKS2SEC)) / + static_cast (1000000000))); } @@ -108,23 +106,23 @@ ACE_PSOS_Time_t::operator timespec_t (void) // Decode date and time bit arrays and fill in fields of tm_struct. tm_struct.tm_year = - ACE_static_cast (int, (ACE_PSOS_Time_t::year_mask & + static_cast ((ACE_PSOS_Time_t::year_mask & (date_ >> ACE_PSOS_Time_t::year_shift))) - ACE_PSOS_Time_t::year_origin; tm_struct.tm_mon = - ACE_static_cast (int, (ACE_PSOS_Time_t::month_mask & + static_cast ((ACE_PSOS_Time_t::month_mask & (date_ >> ACE_PSOS_Time_t::month_shift))) - ACE_PSOS_Time_t::month_origin; tm_struct.tm_mday = - ACE_static_cast (int, (ACE_PSOS_Time_t::day_mask & date_)); + static_cast ((ACE_PSOS_Time_t::day_mask & date_)); tm_struct.tm_hour = - ACE_static_cast (int, (ACE_PSOS_Time_t::hour_mask & + static_cast ((ACE_PSOS_Time_t::hour_mask & (time_ >> ACE_PSOS_Time_t::hour_shift))); tm_struct.tm_min = - ACE_static_cast (int, (ACE_PSOS_Time_t::minute_mask & + static_cast ((ACE_PSOS_Time_t::minute_mask & (time_ >> ACE_PSOS_Time_t::minute_shift))); tm_struct.tm_sec = - ACE_static_cast (int, (ACE_PSOS_Time_t::second_mask & time_)); + static_cast ((ACE_PSOS_Time_t::second_mask & time_)); // Indicate values we don't know as negative numbers. tm_struct.tm_wday = -1; @@ -137,10 +135,9 @@ ACE_PSOS_Time_t::operator timespec_t (void) t.tv_sec = ACE_OS::mktime (&tm_struct); // Encode nanoseconds as system clock ticks. - t.tv_nsec = ACE_static_cast (long, - ((ACE_static_cast (double, ticks_) * - ACE_static_cast (double, 1000000000)) / - ACE_static_cast (double, KC_TICKS2SEC))); + t.tv_nsec = static_cast (((static_cast (ticks_) * + static_cast (1000000000)) / + static_cast (KC_TICKS2SEC))); return t; } diff --git a/ace/OS_NS_time.h b/ace/OS_NS_time.h index 4846794a6c2..5ee8e8ffc4a 100644 --- a/ace/OS_NS_time.h +++ b/ace/OS_NS_time.h @@ -265,7 +265,11 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR *ctime (const time_t *t); +#if defined (ACE_HAS_WINCE) && !defined (_DEBUG) + extern ACE_EXPORT_MACRO +#else ACE_NAMESPACE_INLINE_FUNCTION +#endif ACE_TCHAR *ctime_r (const time_t *clock, ACE_TCHAR *buf, int buflen); # if defined (difftime) diff --git a/ace/OS_NS_time.inl b/ace/OS_NS_time.inl index 91c51073a16..0d2a6686afb 100644 --- a/ace/OS_NS_time.inl +++ b/ace/OS_NS_time.inl @@ -132,12 +132,12 @@ ACE_OS::ctime_r (const time_t *t, ACE_TCHAR *buf, int buflen) bufp = buf; # endif /* ACE_USES_WCHAR */ -# if defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R) if (buflen < ctime_buf_size) { errno = ERANGE; return 0; } +# if defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R) # if defined (DIGITAL_UNIX) ACE_OSCALL (::_Pctime_r (t, bufp), ACE_TCHAR *, 0, bufp); # else /* DIGITAL_UNIX */ @@ -222,7 +222,7 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op) ACE_UNUSED_ARG (op); // Use .obj/gethrtime.o, which was compiled with g++. return ACE_gethrtime (); -#elif (defined(__KCC) || defined (__GNUG__)) && !defined (__MINGW32__) && defined (ACE_HAS_PENTIUM) +#elif (defined(__KCC) || defined (__GNUG__)) && !defined (__MINGW32__) && !defined(ACE_VXWORKS) && defined (ACE_HAS_PENTIUM) ACE_UNUSED_ARG (op); # if defined (ACE_LACKS_LONGLONG_T) @@ -326,7 +326,7 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op) do { asm volatile ("mftbu %0\n" "mftb %1\n" - "mftbu %2" + "mftbu %2" : "=r" (most), "=r" (least), "=r" (scratch)); } while (most != scratch); #endif diff --git a/ace/OS_NS_unistd.inl b/ace/OS_NS_unistd.inl index 28c44bc22f9..fb0380c44c7 100644 --- a/ace/OS_NS_unistd.inl +++ b/ace/OS_NS_unistd.inl @@ -184,8 +184,6 @@ ACE_OS::rmdir (const char *path) return (int) result; -#elif defined (ACE_HAS_NONCONST_RMDIR) - ACE_OSCALL_RETURN (::rmdir (const_cast (path)), int, -1); #elif defined (ACE_WIN32) && defined (__IBMCPP__) && (__IBMCPP__ >= 400) ACE_OSCALL_RETURN (::_rmdir ((char *) path), int, -1); #elif defined (ACE_HAS_WINCE) @@ -522,7 +520,7 @@ ACE_OS::getcwd (wchar_t *buf, size_t size) ACE_UNUSED_ARG (size); ACE_NOTSUP_RETURN (0); # elif defined (ACE_WIN32) - return ::_wgetcwd (buf, ACE_static_cast (int, size)); + return ::_wgetcwd (buf, static_cast (size)); # else char *narrow_buf = new char[size]; char *result = 0; diff --git a/ace/OS_NS_wchar.cpp b/ace/OS_NS_wchar.cpp index 04d7fca9926..5e09dfc0a8d 100644 --- a/ace/OS_NS_wchar.cpp +++ b/ace/OS_NS_wchar.cpp @@ -69,8 +69,8 @@ wchar_t * ACE_OS::wcschr_emulation (const wchar_t *string, wint_t c) { for (;*string ; ++string) - if (*string == ACE_static_cast (wchar_t, c)) - return ACE_const_cast (wchar_t *, string); + if (*string == static_cast (c)) + return const_cast (string); return 0; } @@ -291,7 +291,7 @@ ACE_OS::wcspbrk_emulation (const wchar_t *string, { for (scanp = charset; (sc = *scanp++) != 0;) if (sc == c) - return ACE_const_cast (wchar_t *, string - 1); + return const_cast (string - 1); } return 0; @@ -304,7 +304,7 @@ ACE_OS::wcsrchr_emulation (const wchar_t *s, wint_t c) { const wchar_t *p = s + ACE_OS::strlen (s); - while (*p != ACE_static_cast (wchar_t, c)) + while (*p != static_cast (c)) if (p == s) return 0; else @@ -318,7 +318,7 @@ ACE_OS::wcsrchr_emulation (wchar_t *s, wint_t c) { wchar_t *p = s + ACE_OS::strlen (s); - while (*p != ACE_static_cast(wchar_t, c)) + while (*p != static_cast (c)) if (p == s) return 0; else @@ -369,7 +369,7 @@ ACE_OS::wcsstr_emulation (const wchar_t *string, string--; } - return ACE_const_cast (wchar_t *, string); + return const_cast (string); } #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSSTR */ diff --git a/ace/OS_TLI.inl b/ace/OS_TLI.inl index 09595026dcd..d88655338fb 100644 --- a/ace/OS_TLI.inl +++ b/ace/OS_TLI.inl @@ -3,10 +3,10 @@ #include "ace/OS_NS_errno.h" +namespace ACE_OS { + ACE_INLINE int -ACE_OS::t_accept (ACE_HANDLE handle, - ACE_HANDLE reshandle, - struct t_call *call) +t_accept (ACE_HANDLE handle, ACE_HANDLE reshandle, struct t_call *call) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_accept (handle, reshandle, call), int, -1); @@ -20,8 +20,7 @@ ACE_OS::t_accept (ACE_HANDLE handle, } ACE_INLINE char * -ACE_OS::t_alloc (ACE_HANDLE handle, int struct_type, - int fields) +t_alloc (ACE_HANDLE handle, int struct_type, int fields) { #if defined (ACE_HAS_TLI) # if (_XOPEN_SOURCE - 0 >= 500) @@ -44,8 +43,7 @@ ACE_OS::t_alloc (ACE_HANDLE handle, int struct_type, } ACE_INLINE int -ACE_OS::t_bind (ACE_HANDLE handle, struct t_bind *req, - struct t_bind *ret) +t_bind (ACE_HANDLE handle, struct t_bind *req, struct t_bind *ret) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_bind (handle, req, ret), int, -1); @@ -59,7 +57,7 @@ ACE_OS::t_bind (ACE_HANDLE handle, struct t_bind *req, } ACE_INLINE int -ACE_OS::t_close (ACE_HANDLE handle) +t_close (ACE_HANDLE handle) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_close (handle), int, -1); @@ -71,9 +69,9 @@ ACE_OS::t_close (ACE_HANDLE handle) } ACE_INLINE int -ACE_OS::t_connect(ACE_HANDLE fildes, - struct t_call *sndcall, - struct t_call *rcvcall) +t_connect(ACE_HANDLE fildes, + struct t_call *sndcall, + struct t_call *rcvcall) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_connect (fildes, sndcall, rcvcall), int, -1); @@ -87,7 +85,7 @@ ACE_OS::t_connect(ACE_HANDLE fildes, } ACE_INLINE void -ACE_OS::t_error (const char *errmsg) +t_error (const char *errmsg) { #if defined (ACE_HAS_TLI) #if defined (ACE_HAS_BROKEN_T_ERROR) @@ -101,7 +99,7 @@ ACE_OS::t_error (const char *errmsg) } ACE_INLINE int -ACE_OS::t_free (char *ptr, int struct_type) +t_free (char *ptr, int struct_type) { #if defined (ACE_HAS_TLI) if (ptr == 0) @@ -116,7 +114,7 @@ ACE_OS::t_free (char *ptr, int struct_type) } ACE_INLINE int -ACE_OS::t_getinfo (ACE_HANDLE handle, struct t_info *info) +t_getinfo (ACE_HANDLE handle, struct t_info *info) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_getinfo (handle, info), int, -1); @@ -129,9 +127,7 @@ ACE_OS::t_getinfo (ACE_HANDLE handle, struct t_info *info) } ACE_INLINE int -ACE_OS::t_getname (ACE_HANDLE handle, - struct netbuf *namep, - int type) +t_getname (ACE_HANDLE handle, struct netbuf *namep, int type) { #if defined (ACE_HAS_XTI) struct t_bind bound, peer; @@ -181,7 +177,7 @@ ACE_OS::t_getname (ACE_HANDLE handle, } ACE_INLINE int -ACE_OS::t_getstate (ACE_HANDLE handle) +t_getstate (ACE_HANDLE handle) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_getstate (handle), int, -1); @@ -193,7 +189,7 @@ ACE_OS::t_getstate (ACE_HANDLE handle) } ACE_INLINE int -ACE_OS::t_listen (ACE_HANDLE handle, struct t_call *call) +t_listen (ACE_HANDLE handle, struct t_call *call) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_listen (handle, call), int, -1); @@ -206,7 +202,7 @@ ACE_OS::t_listen (ACE_HANDLE handle, struct t_call *call) } ACE_INLINE int -ACE_OS::t_look (ACE_HANDLE handle) +t_look (ACE_HANDLE handle) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_look (handle), int, -1); @@ -218,7 +214,7 @@ ACE_OS::t_look (ACE_HANDLE handle) } ACE_INLINE ACE_HANDLE -ACE_OS::t_open (char *path, int oflag, struct t_info *info) +t_open (char *path, int oflag, struct t_info *info) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_open (path, oflag, info), ACE_HANDLE, ACE_INVALID_HANDLE); @@ -232,9 +228,7 @@ ACE_OS::t_open (char *path, int oflag, struct t_info *info) } ACE_INLINE int -ACE_OS::t_optmgmt (ACE_HANDLE handle, - struct t_optmgmt *req, - struct t_optmgmt *ret) +t_optmgmt (ACE_HANDLE handle, struct t_optmgmt *req, struct t_optmgmt *ret) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_optmgmt (handle, req, ret), int, -1); @@ -248,10 +242,10 @@ ACE_OS::t_optmgmt (ACE_HANDLE handle, } ACE_INLINE int -ACE_OS::t_rcv (ACE_HANDLE handle, - char *buf, - unsigned int nbytes, - int *flags) +t_rcv (ACE_HANDLE handle, + char *buf, + unsigned int nbytes, + int *flags) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_rcv (handle, buf, nbytes, flags), @@ -267,7 +261,7 @@ ACE_OS::t_rcv (ACE_HANDLE handle, } ACE_INLINE int -ACE_OS::t_rcvdis (ACE_HANDLE handle, struct t_discon *discon) +t_rcvdis (ACE_HANDLE handle, struct t_discon *discon) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_rcvdis (handle, discon), int, -1); @@ -280,7 +274,7 @@ ACE_OS::t_rcvdis (ACE_HANDLE handle, struct t_discon *discon) } ACE_INLINE int -ACE_OS::t_rcvrel (ACE_HANDLE handle) +t_rcvrel (ACE_HANDLE handle) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_rcvrel (handle), int, -1); @@ -292,9 +286,9 @@ ACE_OS::t_rcvrel (ACE_HANDLE handle) } ACE_INLINE int -ACE_OS::t_rcvudata (ACE_HANDLE handle, - struct t_unitdata *unitdata, - int *flags) +t_rcvudata (ACE_HANDLE handle, + struct t_unitdata *unitdata, + int *flags) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_rcvudata (handle, unitdata, flags), @@ -309,7 +303,7 @@ ACE_OS::t_rcvudata (ACE_HANDLE handle, } ACE_INLINE int -ACE_OS::t_rcvuderr (ACE_HANDLE handle, struct t_uderr *uderr) +t_rcvuderr (ACE_HANDLE handle, struct t_uderr *uderr) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_rcvuderr (handle, uderr), int, -1); @@ -322,10 +316,10 @@ ACE_OS::t_rcvuderr (ACE_HANDLE handle, struct t_uderr *uderr) } ACE_INLINE int -ACE_OS::t_snd (ACE_HANDLE handle, - const char *buf, - unsigned int nbytes, - int flags) +t_snd (ACE_HANDLE handle, + const char *buf, + unsigned int nbytes, + int flags) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_snd (handle, (char *) buf, nbytes, flags), int, -1); @@ -340,7 +334,7 @@ ACE_OS::t_snd (ACE_HANDLE handle, } ACE_INLINE int -ACE_OS::t_snddis (ACE_HANDLE handle, struct t_call *call) +t_snddis (ACE_HANDLE handle, struct t_call *call) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_snddis (handle, call), int, -1); @@ -353,7 +347,7 @@ ACE_OS::t_snddis (ACE_HANDLE handle, struct t_call *call) } ACE_INLINE int -ACE_OS::t_sndrel (ACE_HANDLE handle) +t_sndrel (ACE_HANDLE handle) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_sndrel (handle), int, -1); @@ -365,7 +359,7 @@ ACE_OS::t_sndrel (ACE_HANDLE handle) } ACE_INLINE int -ACE_OS::t_sync (ACE_HANDLE handle) +t_sync (ACE_HANDLE handle) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_sync (handle), int, -1); @@ -377,7 +371,7 @@ ACE_OS::t_sync (ACE_HANDLE handle) } ACE_INLINE int -ACE_OS::t_unbind (ACE_HANDLE handle) +t_unbind (ACE_HANDLE handle) { #if defined (ACE_HAS_TLI) ACE_OSCALL_RETURN (::t_unbind (handle), int, -1); @@ -387,3 +381,5 @@ ACE_OS::t_unbind (ACE_HANDLE handle) ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_TLI */ } + +} /* end namespace ACE_OS */ diff --git a/ace/OS_Thread_Adapter.cpp b/ace/OS_Thread_Adapter.cpp index 85f8caf1670..1f7e94a2890 100644 --- a/ace/OS_Thread_Adapter.cpp +++ b/ace/OS_Thread_Adapter.cpp @@ -43,7 +43,7 @@ ACE_OS_Thread_Adapter::invoke (void) // Extract the arguments. ACE_THR_FUNC_INTERNAL func = - ACE_reinterpret_cast (ACE_THR_FUNC_INTERNAL, this->user_func_); + reinterpret_cast (this->user_func_); void *arg = this->arg_; // Delete ourselves since we don't need anymore. Make sure @@ -80,7 +80,7 @@ ACE_OS_Thread_Adapter::invoke (void) // Invoke the start hook to give the user a chance to // perform some initialization processing before the // is invoked. - status = hook->start (ACE_reinterpret_cast (ACE_THR_FUNC, func), + status = hook->start (reinterpret_cast (func), arg); else { @@ -109,8 +109,7 @@ ACE_OS_Thread_Adapter::invoke (void) // Task::svc_run to 0. #if 0 // Call the close> hook. - if (func == ACE_reinterpret_cast (ACE_THR_FUNC_INTERNAL, - ACE_Task_Base::svc_run)) + if (func == reinterpret_cast (ACE_Task_Base::svc_run)) { ACE_Task_Base *task_ptr = (ACE_Task_Base *) arg; ACE_Thread_Manager *thr_mgr_ptr = task_ptr->thr_mgr (); diff --git a/ace/Obstack_T.cpp b/ace/Obstack_T.cpp index b32171b7337..4fdeeae1c26 100644 --- a/ace/Obstack_T.cpp +++ b/ace/Obstack_T.cpp @@ -95,8 +95,7 @@ ACE_Obstack_T::grow (CHAR c) if (this->request (1) == 0) { - CHAR *retv = ACE_reinterpret_cast (CHAR *, - this->curr_->cur_); + CHAR *retv = reinterpret_cast (this->curr_->cur_); this->curr_->cur_ += sizeof (CHAR); *retv = c; return retv; @@ -113,8 +112,7 @@ ACE_Obstack_T::new_chunk (void) ACE_Obchunk *temp; ACE_NEW_MALLOC_RETURN (temp, - ACE_static_cast (ACE_Obchunk *, - this->allocator_strategy_->malloc + static_cast (this->allocator_strategy_->malloc (sizeof (class ACE_Obchunk) + this->size_)), ACE_Obchunk (this->size_), 0); @@ -172,8 +170,7 @@ template void ACE_Obstack_T::unwind (void* obj) { if (obj >= this->curr_->contents_ && obj < this->curr_->end_) - this->curr_->block_ = this->curr_->cur_ = ACE_reinterpret_cast (char*, - obj); + this->curr_->block_ = this->curr_->cur_ = reinterpret_cast (obj); else this->unwind_i (obj); } @@ -189,8 +186,7 @@ ACE_Obstack_T::unwind_i (void* obj) if (curr) { this->curr_ = curr; - this->curr_->block_ = this->curr_->cur_ = ACE_reinterpret_cast (char*, - obj); + this->curr_->block_ = this->curr_->cur_ = reinterpret_cast (obj); } else if (obj != 0) ACE_ERROR ((LM_ERROR, diff --git a/ace/POSIX_Asynch_IO.cpp b/ace/POSIX_Asynch_IO.cpp index bdf706b0c5b..0dccaad9210 100644 --- a/ace/POSIX_Asynch_IO.cpp +++ b/ace/POSIX_Asynch_IO.cpp @@ -96,8 +96,7 @@ int ACE_POSIX_Asynch_Result::post_completion (ACE_Proactor_Impl *proactor_impl) { // Get to the platform specific implementation. - ACE_POSIX_Proactor *posix_proactor = ACE_dynamic_cast (ACE_POSIX_Proactor *, - proactor_impl); + ACE_POSIX_Proactor *posix_proactor = dynamic_cast (proactor_impl); if (posix_proactor == 0) ACE_ERROR_RETURN ((LM_ERROR, "Dynamic cast to POSIX Proactor failed\n"), -1); @@ -1534,8 +1533,7 @@ ACE_POSIX_Asynch_Connect::connect_i (ACE_POSIX_Asynch_Connect_Result *result, if (local_sap != ACE_Addr::sap_any) { - sockaddr * laddr = ACE_reinterpret_cast (sockaddr *, - local_sap.get_addr ()); + sockaddr * laddr = reinterpret_cast (local_sap.get_addr ()); size_t size = local_sap.get_size (); if (ACE_OS::bind (handle, laddr, size) == -1) @@ -1564,8 +1562,7 @@ ACE_POSIX_Asynch_Connect::connect_i (ACE_POSIX_Asynch_Connect_Result *result, for (;;) { int rc = ACE_OS::connect (handle, - ACE_reinterpret_cast (sockaddr *, - remote_sap.get_addr ()), + reinterpret_cast (remote_sap.get_addr ()), remote_sap.get_size ()); if (rc < 0) // failure { @@ -2058,7 +2055,7 @@ ACE_POSIX_Asynch_Transmit_Handler::transmit (void) // Transmit the header. if (this->ws_.write (*this->result_->header_and_trailer ()->header (), this->result_->header_and_trailer ()->header_bytes (), - ACE_reinterpret_cast (void *, &this->header_act_), + reinterpret_cast (&this->header_act_), 0) == -1) ACE_ERROR_RETURN ((LM_ERROR, "Asynch_Transmit_Handler:transmitting header:write_stream failed\n"), diff --git a/ace/POSIX_CB_Proactor.cpp b/ace/POSIX_CB_Proactor.cpp index afae1751103..7bbaa7cc059 100644 --- a/ace/POSIX_CB_Proactor.cpp +++ b/ace/POSIX_CB_Proactor.cpp @@ -33,7 +33,7 @@ ACE_POSIX_CB_Proactor::~ACE_POSIX_CB_Proactor (void) void ACE_POSIX_CB_Proactor::aio_completion_func (sigval_t cb_data) { - ACE_POSIX_CB_Proactor * impl = ACE_static_cast (ACE_POSIX_CB_Proactor *, cb_data.sival_ptr); + ACE_POSIX_CB_Proactor * impl = static_cast (cb_data.sival_ptr); if ( impl != 0 ) impl->notify_completion (0); } diff --git a/ace/POSIX_Proactor.cpp b/ace/POSIX_Proactor.cpp index fe0ab467e9e..c23d0cccff6 100644 --- a/ace/POSIX_Proactor.cpp +++ b/ace/POSIX_Proactor.cpp @@ -1231,7 +1231,7 @@ ACE_POSIX_AIOCB_Proactor::get_result_status (ACE_POSIX_Asynch_Result *asynch_res ssize_t op_return = aio_return (asynch_result); if (op_return > 0) - transfer_count = ACE_static_cast (size_t, op_return); + transfer_count = static_cast (op_return); // else transfer_count is already 0, error_status reports the error. return 1; // completed } @@ -1331,7 +1331,7 @@ ACE_POSIX_AIOCB_Proactor::start_aio (ACE_POSIX_Asynch_Result *result, if (slot < 0) return -1; - size_t index = ACE_static_cast (size_t, slot); + size_t index = static_cast (slot); result_list_[index] = result; //Store result ptr anyway aiocb_list_cur_size_++; @@ -1393,7 +1393,7 @@ ACE_POSIX_AIOCB_Proactor::allocate_aio_slot (ACE_POSIX_Asynch_Result *result) //setup OS notification methods for this aio result->aio_sigevent.sigev_notify = SIGEV_NONE; - return ACE_static_cast (ssize_t, i); + return static_cast (i); } // start_aio_i has new return codes @@ -1849,12 +1849,12 @@ ACE_POSIX_SIG_Proactor::allocate_aio_slot (ACE_POSIX_Asynch_Result *result) result->aio_sigevent.sigev_notify = SIGEV_SIGNAL; result->aio_sigevent.sigev_signo = result->signal_number (); #if defined (__FreeBSD__) - result->aio_sigevent.sigev_value.sigval_int = ACE_static_cast (int, i); + result->aio_sigevent.sigev_value.sigval_int = static_cast (i); #else - result->aio_sigevent.sigev_value.sival_int = ACE_static_cast (int, i); + result->aio_sigevent.sigev_value.sival_int = static_cast (i); #endif /* __FreeBSD__ */ - return ACE_static_cast (ssize_t, i); + return static_cast (i); } int @@ -1899,9 +1899,9 @@ ACE_POSIX_SIG_Proactor::handle_events_i (const ACE_Time_Value *timeout) // define index to start // nothing will happen if it contains garbage #if defined (__FreeBSD__) - index = ACE_static_cast (size_t, sig_info.si_value.sigval_int); + index = static_cast (sig_info.si_value.sigval_int); #else - index = ACE_static_cast (size_t, sig_info.si_value.sival_int); + index = static_cast (sig_info.si_value.sival_int); #endif // Assume we have a correctly-functioning implementation, and that // there is one I/O to process, and it's correctly specified in the diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp index 4783472d48e..bb702ecd68a 100644 --- a/ace/Parse_Node.cpp +++ b/ace/Parse_Node.cpp @@ -83,10 +83,8 @@ ACE_Parse_Node::link (ACE_Parse_Node *n) ACE_Stream_Node::ACE_Stream_Node (const ACE_Static_Node *str_ops, const ACE_Parse_Node *str_mods) #if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) - : ACE_Parse_Node (str_ops == 0 ? ACE_static_cast (ACE_TCHAR *, - ACE_LIB_TEXT ("")) - : ACE_static_cast (ACE_TCHAR *, - str_ops->name ())), + : ACE_Parse_Node (str_ops == 0 ? static_cast (ACE_LIB_TEXT ("")) + : static_cast (str_ops->name ())), #else : ACE_Parse_Node ((str_ops == 0 ? ACE_LIB_TEXT ("") : str_ops->name ())), #endif /* defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ @@ -100,11 +98,9 @@ ACE_Stream_Node::ACE_Stream_Node (const ACE_Static_Node *str_ops, ACE_Stream_Node::~ACE_Stream_Node (void) { ACE_TRACE ("ACE_Stream_Node::~ACE_Stream_Node"); - ACE_Static_Node *n = ACE_const_cast (ACE_Static_Node *, - this->node_); + ACE_Static_Node *n = const_cast (this->node_); delete n; - ACE_Parse_Node *m = ACE_const_cast (ACE_Parse_Node *, - this->mods_); + ACE_Parse_Node *m = const_cast (this->mods_); delete m; } @@ -140,7 +136,7 @@ ACE_Parse_Node::print (void) const ACE_Parse_Node::~ACE_Parse_Node (void) { ACE_TRACE ("ACE_Parse_Node::~ACE_Parse_Node"); - delete[] ACE_const_cast (ACE_TCHAR*, this->name_); + delete[] const_cast (this->name_); delete this->next_; } @@ -447,7 +443,7 @@ ACE_Object_Node::symbol (int & yyerrno, ACE_TRACE ("ACE_Object_Node::symbol"); if (this->open_dll (yyerrno) == 0) { - ACE_TCHAR *object_name = ACE_const_cast (ACE_TCHAR *, this->object_name_); + ACE_TCHAR *object_name = const_cast (this->object_name_); this->symbol_ = this->dll_.symbol (object_name); if (this->symbol_ == 0) @@ -474,7 +470,7 @@ ACE_Object_Node::symbol (int & yyerrno, ACE_Object_Node::~ACE_Object_Node (void) { ACE_TRACE ("ACE_Object_Node::~ACE_Object_Node"); - delete[] ACE_const_cast (ACE_TCHAR *, this->object_name_); + delete[] const_cast (this->object_name_); } ACE_ALLOC_HOOK_DEFINE (ACE_Function_Node) @@ -511,8 +507,7 @@ ACE_Function_Node::symbol (int & yyerrno, // Locate the factory function in the shared // object. - ACE_TCHAR *function_name = ACE_const_cast (ACE_TCHAR *, - this->function_name_); + ACE_TCHAR *function_name = const_cast (this->function_name_); void *func_p = this->dll_.symbol (function_name); if (func_p == 0) { @@ -534,8 +529,8 @@ ACE_Function_Node::symbol (int & yyerrno, return 0; } } - ptrdiff_t temp_p = ACE_reinterpret_cast (ptrdiff_t, func_p); - func = ACE_reinterpret_cast (ACE_Service_Factory_Ptr, temp_p); + ptrdiff_t temp_p = reinterpret_cast (func_p); + func = reinterpret_cast (temp_p); // Invoke the factory function and record it's return value. this->symbol_ = (*func) (gobbler); @@ -554,8 +549,8 @@ ACE_Function_Node::symbol (int & yyerrno, ACE_Function_Node::~ACE_Function_Node (void) { ACE_TRACE ("ACE_Function_Node::~ACE_Function_Node"); - delete[] ACE_const_cast (ACE_TCHAR *, function_name_); - delete[] ACE_const_cast (ACE_TCHAR *, pathname_); + delete[] const_cast (function_name_); + delete[] const_cast (pathname_); } ACE_ALLOC_HOOK_DEFINE (ACE_Dummy_Node) @@ -596,11 +591,9 @@ ACE_Dummy_Node::apply (int & yyerrno) ACE_Dummy_Node::~ACE_Dummy_Node (void) { ACE_TRACE ("ACE_Dummy_Node::~ACE_Dummy_Node"); - ACE_Static_Node *n = ACE_const_cast (ACE_Static_Node *, - this->node_); + ACE_Static_Node *n = const_cast (this->node_); delete n; - ACE_Parse_Node *m = ACE_const_cast (ACE_Parse_Node *, - this->mods_); + ACE_Parse_Node *m = const_cast (this->mods_); delete m; } @@ -635,7 +628,7 @@ ACE_Static_Function_Node::symbol (int & yyerrno, ACE_Static_Svc_Descriptor **ssdp = 0; ACE_STATIC_SVCS &svcs = *ACE_Service_Config::static_svcs (); - ACE_TCHAR *function_name = ACE_const_cast (ACE_TCHAR *, this->function_name_); + ACE_TCHAR *function_name = const_cast (this->function_name_); for (ACE_STATIC_SVCS_ITERATOR iter (svcs); iter.next (ssdp) != 0; @@ -680,7 +673,7 @@ ACE_Static_Function_Node::symbol (int & yyerrno, ACE_Static_Function_Node::~ACE_Static_Function_Node (void) { ACE_TRACE ("ACE_Static_Function_Node::~ACE_Static_Function_Node"); - delete[] ACE_const_cast (ACE_TCHAR *, this->function_name_); + delete[] const_cast (this->function_name_); } #endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */ diff --git a/ace/Ping_Socket.cpp b/ace/Ping_Socket.cpp index 3daa2c24850..f33c555d034 100644 --- a/ace/Ping_Socket.cpp +++ b/ace/Ping_Socket.cpp @@ -6,6 +6,9 @@ #include "ace/INET_Addr.h" #include "ace/Log_Msg.h" +#include "ace/OS_NS_string.h" +#include "ace/OS_NS_sys_time.h" +#include "ace/OS_NS_sys_socket.h" #if !defined (__ACE_INLINE__) # include "ace/Ping_Socket.inl" diff --git a/ace/Ping_Socket.h b/ace/Ping_Socket.h index 41c50226de4..96981f57f56 100644 --- a/ace/Ping_Socket.h +++ b/ace/Ping_Socket.h @@ -101,7 +101,7 @@ namespace ACE char icmp_recv_buff_[PING_BUFFER_SIZE]; - unsigned long sequence_number_; + ACE_UINT16 sequence_number_; int connected_socket_; diff --git a/ace/Process.h b/ace/Process.h index 7f1685f4ef9..8ca56b21aaf 100644 --- a/ace/Process.h +++ b/ace/Process.h @@ -21,8 +21,8 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Handle_Set.h" -#include "ace/os_include/sys/os_types.h" #include "ace/Global_Macros.h" +#include "ace/os_include/sys/os_types.h" // Forward declaration class ACE_Time_Value; @@ -597,8 +597,6 @@ private: friend class ace_dewarn_gplusplus; }; -#include "ace/SString.h" - #if defined (__ACE_INLINE__) #include "ace/Process.inl" #endif /* __ACE_INLINE__ */ diff --git a/ace/Process_Manager.cpp b/ace/Process_Manager.cpp index 4aa30ef5c5d..9046f69011c 100644 --- a/ace/Process_Manager.cpp +++ b/ace/Process_Manager.cpp @@ -606,13 +606,13 @@ ACE_Process_Manager::terminate (pid_t pid) // Check for duplicates and bail out if they're already // registered... - ssize_t i = this->find_proc (pid); + ssize_t const i = this->find_proc (pid); if (i == -1) // set "no such process" error return -1; - int result = ACE::terminate_process (pid); + int const result = ACE::terminate_process (pid); if (result != -1) { @@ -621,8 +621,8 @@ ACE_Process_Manager::terminate (pid_t pid) this->remove_proc (i); return 0; } - else - return -1; + + return -1; } int diff --git a/ace/QoS/SOCK_Dgram_Mcast_QoS.cpp b/ace/QoS/SOCK_Dgram_Mcast_QoS.cpp index b02952fbeb7..28917278c31 100644 --- a/ace/QoS/SOCK_Dgram_Mcast_QoS.cpp +++ b/ace/QoS/SOCK_Dgram_Mcast_QoS.cpp @@ -240,8 +240,7 @@ ACE_SOCK_Dgram_Mcast_QoS::subscribe (const ACE_INET_Addr &mcast_addr, // XX This is windows stuff only. fredk if (ACE_OS::join_leaf (this->get_handle (), - ACE_reinterpret_cast (const sockaddr *, - &ret_mreq.IMR_MULTIADDR.s_addr), + reinterpret_cast (&ret_mreq.IMR_MULTIADDR.s_addr), sizeof ret_mreq.IMR_MULTIADDR.s_addr, qos_params) == ACE_INVALID_HANDLE && errno != ENOTSUP) diff --git a/ace/QtReactor.cpp b/ace/QtReactor.cpp index de638db08c9..ab82e9c9944 100644 --- a/ace/QtReactor.cpp +++ b/ace/QtReactor.cpp @@ -1,6 +1,5 @@ //$Id$ #include "ace/QtReactor.h" -#if defined (ACE_HAS_QT) ACE_ALLOC_HOOK_DEFINE (ACE_QtReactor) // Must be called with lock held @@ -637,4 +636,3 @@ template class ACE_Map_Reverse_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 index 26e48e21bff..b336fdd3d13 100644 --- a/ace/QtReactor.h +++ b/ace/QtReactor.h @@ -17,12 +17,12 @@ #include "ace/Select_Reactor.h" +#include "ace/ACE_QtReactor_export.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. @@ -79,7 +79,7 @@ * it is not clear if the leak is introduced by QtReactor, or rather incorrect * memory management in QtReactor_Test. */ -class ACE_Export ACE_QtReactor : public QObject, public ACE_Select_Reactor +class ACE_QtReactor_Export ACE_QtReactor : public QObject, public ACE_Select_Reactor { Q_OBJECT @@ -212,7 +212,5 @@ void read_event (int FD); void timeout_event (void); }; -#endif /*ACE_HAS_QT */ - #include /**/ "ace/post.h" #endif /* ACE_QTREACTOR_H */ diff --git a/ace/README b/ace/README index 527ecb14e2a..102e4b1ab97 100644 --- a/ace/README +++ b/ace/README @@ -407,8 +407,6 @@ ACE_HAS_NONCONST_CHDIR Platform uses non-const char * in call to chdir ACE_HAS_NONCONST_OPENDIR Platform uses non-const char * in call to opendir -ACE_HAS_NONCONST_RMDIR Platform uses non-const char * - in call to rmdir ACE_HAS_NONCONST_UNLINK Platform uses non-const char * in call to unlink ACE_HAS_NONCONST_GETBY Platform uses non-const char * @@ -510,6 +508,9 @@ ACE_HAS_PTHREAD_PROCESS_ENUM pthread.h declares an enum with PTHREAD_PROCESS_PRIVATE and PTHREAD_PROCESS_SHARED values. ACE_HAS_PTHREAD_SETSTACK Platform has pthread_attr_setstack(). +ACE_HAS_PTHREAD_NP_H Platform has FreeBSD + declares non-portable (*_np) pthread + functions in this header. 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 @@ -722,7 +723,6 @@ 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 @@ -1100,6 +1100,11 @@ ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK ACE_LACKS_MEMBER_TEMPLATES Compiler does not support member template feature. +ACE_LACKS_DEPRECATED_MACROS When this define is set, macros which + are deprecated are not defined. Usefull + to check whether deprecated macros are + not used anymore. + ---------------------------------------- The following macros determine the svc.conf file format ACE uses. @@ -1705,18 +1710,6 @@ ACE_USES_GPROF: When using gprof mainly on Linux, #define ACE_USES_GPROF will add calls to getitimer/setitimer in order to initialize profile timer and overcome the problem of gprof with multithreaded applications. -ACE_HAS_QT: ----------------------------- - Used in: - ace/QtReactor.cpp - ace/QtReactor.h - tests/QtReactor_Test.cpp - tests/QtReactor_Test.h - TAO/tao/qt_resource.h - TAO/tao/qt_resource.cpp - TAO/tests/QtTests/* - Notes: - Turns on integration with Qt. ACE_QTREACTOR_CLEAR_PENDING_EVENTS: ---------------------------- diff --git a/ace/RMCast/ACE_RMCast.pc.in b/ace/RMCast/ACE_RMCast.pc.in deleted file mode 100644 index 3eb6428d28b..00000000000 --- a/ace/RMCast/ACE_RMCast.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_RMCast -Description: ACE Reliable Multicast Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} -lACE_RMCast -Cflags: -I${includedir} diff --git a/ace/RMCast/Makefile.am b/ace/RMCast/Makefile.am deleted file mode 100644 index 78f36853be0..00000000000 --- a/ace/RMCast/Makefile.am +++ /dev/null @@ -1,127 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu - -includedir = @includedir@/ace/RMCast -pkgconfigdatadir = ${prefix}/lib/pkgconfig - -ACE_BUILDDIR = $(top_builddir) -ACE_ROOT = $(top_srcdir) - -nobase_include_HEADERS = -lib_LTLIBRARIES = -## Makefile.RMCast.am - -if BUILD_RMCAST -lib_LTLIBRARIES += libACE_RMCast.la - -libACE_RMCast_la_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -DACE_RMCAST_BUILD_DLL - -libACE_RMCast_la_SOURCES = \ - RMCast.cpp \ - RMCast_Ack_Worker.cpp \ - RMCast_Copy_On_Write.cpp \ - RMCast_Fork.cpp \ - RMCast_Fragment.cpp \ - RMCast_IO_UDP.cpp \ - RMCast_Membership.cpp \ - RMCast_Module.cpp \ - RMCast_Module_Factory.cpp \ - RMCast_Partial_Message.cpp \ - RMCast_Proxy.cpp \ - RMCast_Reassembly.cpp \ - RMCast_Receiver_Module.cpp \ - RMCast_Reliable_Factory.cpp \ - RMCast_Reordering.cpp \ - RMCast_Resend_Handler.cpp \ - RMCast_Resend_Worker.cpp \ - RMCast_Retransmission.cpp \ - RMCast_Sequencer.cpp \ - RMCast_Singleton_Factory.cpp \ - RMCast_UDP_Event_Handler.cpp \ - RMCast_UDP_Proxy.cpp \ - RMCast_UDP_Reliable_Receiver.cpp \ - RMCast_UDP_Reliable_Sender.cpp \ - RMCast_Worker.cpp - -libACE_RMCast_la_LDFLAGS = \ - -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ - -libACE_RMCast_la_LIBADD = \ - $(top_builddir)/ace/libACE.la - -nobase_include_HEADERS += \ - RMCast.h \ - RMCast_Ack_Worker.h \ - RMCast_Copy_On_Write.h \ - RMCast_Export.h \ - RMCast_Fork.h \ - RMCast_Fragment.h \ - RMCast_IO_UDP.h \ - RMCast_Membership.h \ - RMCast_Module.h \ - RMCast_Module_Factory.h \ - RMCast_Partial_Message.h \ - RMCast_Proxy.h \ - RMCast_Reassembly.h \ - RMCast_Receiver_Module.h \ - RMCast_Reliable_Factory.h \ - RMCast_Reordering.h \ - RMCast_Resend_Handler.h \ - RMCast_Resend_Worker.h \ - RMCast_Retransmission.h \ - RMCast_Sequencer.h \ - RMCast_Singleton_Factory.h \ - RMCast_UDP_Event_Handler.h \ - RMCast_UDP_Proxy.h \ - RMCast_UDP_Reliable_Receiver.h \ - RMCast_UDP_Reliable_Sender.h \ - RMCast_Worker.h \ - RMCast_Ack_Worker.i \ - RMCast_Copy_On_Write.i \ - RMCast_Fork.i \ - RMCast_Fragment.i \ - RMCast_IO_UDP.i \ - RMCast_Membership.i \ - RMCast_Module.i \ - RMCast_Partial_Message.i \ - RMCast_Proxy.i \ - RMCast_Receiver_Module.i \ - RMCast_Reliable_Factory.i \ - RMCast_Reordering.i \ - RMCast_Resend_Handler.i \ - RMCast_Resend_Worker.i \ - RMCast_Retransmission.i \ - RMCast_Sequencer.i \ - RMCast_Singleton_Factory.i \ - RMCast_UDP_Event_Handler.i \ - RMCast_UDP_Proxy.i \ - RMCast_UDP_Reliable_Receiver.i \ - RMCast_UDP_Reliable_Sender.i - -pkgconfigdata_DATA = ACE_RMCast.pc - -ACE_RMCast.pc: ${top_builddir}/config.status ACE_RMCast.pc.in - ${top_builddir}/config.status --file $@:${srcdir}/ACE_RMCast.pc.in - -endif BUILD_RMCAST - -EXTRA_DIST = \ - RMCast.rc - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ace/RMCast/README b/ace/RMCast/README deleted file mode 100644 index ed6b22bf1c6..00000000000 --- a/ace/RMCast/README +++ /dev/null @@ -1,57 +0,0 @@ -# $Id$ - - This directory will contain a simple, small-scale reliable -multicast framework for ACE. The framework is based on the ASX -components of the ACE library: the protocol is implemented as a stack -of interchangeable "modules", each one in charge of a very small task. -For example, one module implements fragmentation and reassembly, other -modules implement retransmission, send ACK and NAK messages, and -maintain receiver membership. - - The modules are replaced to achieve different levels of -reliability. For example, the retransmission module can be either the -"Best_Effort", "Semi_Reliable" or "Reliable" implementation. In the -first case no retransmissions are performed, but lost messages are -detected and reported to the receiver. The "Semi_Reliable" case -messages are held for a pre-specified amount of time, and -re-transmited if requested, but it is possible to loose some messages -if multiple re-transmissions fail. As in the "Best_Effort" case the -lost messages are detected and flagged to the application. Finally -in the "Reliable" mode the senders are flowed controlled until enough -messages are successfully transmitted. - - In general the stack looks like this: - - -SENDER: - ----------------------------------------------------------------- -Buffering : Save lost messages -Retransmission : Retransmit ----------------------------------------------------------------- -Fragmentation : Fragment messages in smaller chunks -Reassembly : and ensure that the IOVMAX limit is not - : reached ----------------------------------------------------------------- -Transport : Encapsulate the specific transport media - : such as TCP/IP, ATM, or shared memory - : Demuxes incoming data to the right chain - : Change control messages and data messages - : to the right dynamic types. ----------------------------------------------------------------- - -RECEIVER: - ----------------------------------------------------------------- -Lost detection : Detect lost messages and send control - : messages back ----------------------------------------------------------------- -Reassembly : Reassemble messages, fragment control -Fragmentation : data ----------------------------------------------------------------- -Transport : Group membership, ACT reception, - : handle keep-alive messages... ----------------------------------------------------------------- - - -@@ TODO: Piggybacking... diff --git a/ace/RMCast/RMCast.cpp b/ace/RMCast/RMCast.cpp deleted file mode 100644 index eb9887f8883..00000000000 --- a/ace/RMCast/RMCast.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// $Id$ - -#include "RMCast.h" - -ACE_RCSID(RMCast, RMCast, "$Id$") diff --git a/ace/RMCast/RMCast.h b/ace/RMCast/RMCast.h deleted file mode 100644 index 2339daa6f8e..00000000000 --- a/ace/RMCast/RMCast.h +++ /dev/null @@ -1,253 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_H -#define ACE_RMCAST_H -#include /**/ "ace/pre.h" - -#include "RMCast_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Basic_Types.h" - -class ACE_Message_Block; -class ACE_RMCast_Proxy; - -//! The RMCast namespace -/*! - Several simple data structures and enums are shared by all the - RMCast components, this is the place where we put them by default. -*/ -class ACE_RMCast_Export ACE_RMCast -{ -public: - - //! The message types - /*! - Each message includes a type field in the header used by the - receiver to correctly parse it. - Classes with the same name as the message type describe the actual - format of the message. - */ - enum Message_Type - { - // Sender initiated - RMCAST_MT_POLL, - RMCAST_MT_ACK_JOIN, - RMCAST_MT_ACK_LEAVE, - RMCAST_MT_DATA, - // Receiver initiated - RMCAST_MT_JOIN, - RMCAST_MT_LEAVE, - RMCAST_MT_ACK, - RMCAST_MT_LAST - }; - - //! Simle enum used to describe the state transitions for senders - /*! - State transition (and actions) for the senders. - This configuration is pesimistic, any invalid message is cause - enough to reclaim all the resources. This partially addresses - situations where either accidentally or intentionally a sender is - multicasting packets to the wrong group. - - - NON_EXISTENT JOINED
- ------------------------------------------
- POLL NON_EXISTENT NON_EXISTENT
- Destroy Destroy
-
- ACK NON_EXISTENT JOINED
- Noop Process/Ack
-
- JOIN JOINED NON_EXISTENT
- Send/Join_Ack Send/Join_Ack
-
- LEAVE NON_EXISTENT NON_EXISTENT
- Send/Leave_Ack Send/Leave_Ack
- Destroy
-
- ACK_JOIN NON_EXISTENT NON_EXISTENT
- Noop Destroy
-
- ACK_LEAVE NON_EXISTENT NON_EXISTENT
- Noop Destroy
-
- SEND_DATA NON_EXISTENT NON_EXISTENT
- Noop Destroy
-
- */ - enum Sender_State - { - SS_NON_EXISTENT, - SS_JOINED - }; - - - // These structures define the basic layout of the messages. - - //! This is the main message sent by senders - /*! - - +---------+----------------------+
- | 8 bits | DATA |
- +---------+----------------------+
- | 32 bits | sequence_number |
- +---------+----------------------+
- | 32 bits | message_size |
- +---------+----------------------+
- | 32 bits | fragment_offset |
- +---------+----------------------+
- ? ? ? ? ? | 32 bits | payload_size |
- ? ? ? ? ? +---------+----------------------+
- | | payload |
- +---------+----------------------+
-
- */ - struct Data - { - // Source ID is implicit in recvfrom()... - ACE_UINT32 sequence_number; - ACE_UINT32 total_size; - ACE_UINT32 fragment_offset; - - // @@ TODO: we may want to add optional fields, such as: - // - Polling clients for their status - // - Sending the range of messages in the queue - // - If we are using authentic group communication we may - // piggyback the ACK / NAK messages - - ACE_Message_Block *payload; - - //! Pass the proxy source between layers - ACE_RMCast_Proxy *source; - }; - - /*! - - +---------+----------------------+
- | 8 bits | RMCAST_MT_POLL |
- +---------+----------------------+
-
- */ - struct Poll - { - //! Pass the proxy source between layers - ACE_RMCast_Proxy *source; - }; - - //! Receivers accept new members using this message - /*! - - +---------+----------------------+
- | 8 bits | RMCAST_MT_ACK_JOIN |
- +---------+----------------------+
- | 32 bits | next_sequence_number |
- +---------+----------------------+
-
- */ - struct Ack_Join - { - ACE_UINT32 next_sequence_number; - - //! Pass the proxy source between layers - ACE_RMCast_Proxy *source; - }; - - //! Senders acknowledge when receivers try to leave - /*! - - +---------+----------------------+
- | 8 bits | ACK_LEAVE |
- +---------+----------------------+
-
- */ - struct Ack_Leave - { - //! Pass the proxy source between layers - ACE_RMCast_Proxy *source; - }; - - //! Provide feedback to the sender about messages received and sent - //! so far. - /*! - * - * This message is used to provide feedback information to senders. - * It contains two sequence numbers: - * - \param next_expected: is the sequence number of the next message - * expected, i.e. (next_expected-1) is the last message received - * without any losses before it. - * - \param highest_received: is the highest sequence number among - * all the messages successfully received. - * In other words, all messages lost (if any) are in the range: - * [next_expected,highest_received) - * - * - * +---------+----------------------+
- * | 8 bits | RMCAST_MT_ACK |
- * +---------+----------------------+
- * | 32 bits | next_expected |
- * +---------+----------------------+
- * | 32 bits | highest_received |
- * +---------+----------------------+
- *
- */ - struct Ack - { - //! The last message received without any losses before it. - ACE_UINT32 next_expected; - - //! The last message successfully received - ACE_UINT32 highest_received; - - //! Pass the proxy source between layers - ACE_RMCast_Proxy *source; - }; - - //! Receivers send this message to indicate they want to join - /* - - +---------+----------------------+
- | 8 bits | RMCAST_MT_JOIN |
- +---------+----------------------+
-
- */ - struct Join - { - //! Pass the proxy source between layers - ACE_RMCast_Proxy *source; - }; - - //! Receivers send this message to disconnect gracefully - /*! - - +---------+----------------------+
- | 8 bits | RMCAST_MT_LEAVE |
- +---------+----------------------+
-
- */ - struct Leave - { - //! Pass the proxy source between layers - ACE_RMCast_Proxy *source; - }; -}; - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_H */ diff --git a/ace/RMCast/RMCast.rc b/ace/RMCast/RMCast.rc deleted file mode 100644 index 142de8a5625..00000000000 --- a/ace/RMCast/RMCast.rc +++ /dev/null @@ -1,30 +0,0 @@ -#include "..\Version.h" - -1 VERSIONINFO - FILEVERSION ACE_MAJOR_VERSION,ACE_MINOR_VERSION,ACE_BETA_VERSION,0 - PRODUCTVERSION ACE_MAJOR_VERSION,ACE_MINOR_VERSION,ACE_BETA_VERSION,0 - FILEFLAGSMASK 0x3fL - FILEFLAGS 0x0L - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "FileDescription", "RMCast\0" - VALUE "FileVersion", ACE_VERSION "\0" - VALUE "InternalName", "RMCastDLL\0" - VALUE "LegalCopyright", "\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "RMCast.DLL\0" - VALUE "ProductName", "ACE\0" - VALUE "ProductVersion", ACE_VERSION "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END diff --git a/ace/RMCast/RMCast_Ack_Worker.cpp b/ace/RMCast/RMCast_Ack_Worker.cpp deleted file mode 100644 index d454e013056..00000000000 --- a/ace/RMCast/RMCast_Ack_Worker.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Ack_Worker.h" -#include "ace/Message_Block.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Ack_Worker.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Ack_Worker, "$Id$") - -int -ACE_RMCast_Ack_Worker::work (ACE_UINT32 const & key, - ACE_RMCast::Data const &item) -{ - if (key >= this->ack_.next_expected) - return 0; - // ACE_DEBUG ((LM_DEBUG, - // " Retransmission::ack - message %d erased\n", - // key)); - ACE_Message_Block::release (item.payload); - return this->messages_->unbind_i (this->ace_mon_, key); -} diff --git a/ace/RMCast/RMCast_Ack_Worker.h b/ace/RMCast/RMCast_Ack_Worker.h deleted file mode 100644 index b4d81e4e972..00000000000 --- a/ace/RMCast/RMCast_Ack_Worker.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#ifndef ACE_RMCAST_ACK_WORKER_H -#define ACE_RMCAST_ACK_WORKER_H -#include /**/ "ace/pre.h" - -#include "RMCast_Retransmission.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Process an Ack message in the ACE_RMCast_Retransmission module -/** - * The retransmission module uses internal iterators, thus it needs to - * create helper Worker classes to process some messages. - */ -class ACE_RMCast_Ack_Worker - : public ACE_RMCast_Worker -{ -public: - ACE_RMCast_Ack_Worker (ACE_RMCast::Ack &ack, - ACE_RMCast_Retransmission::Messages::Write_Guard &g, - ACE_RMCast_Retransmission::Messages *messages); - - virtual int work (ACE_UINT32 const & key, - ACE_RMCast::Data const &item); - -private: - ACE_RMCast_Ack_Worker (const ACE_RMCast_Ack_Worker&); - ACE_RMCast_Ack_Worker& operator= (const ACE_RMCast_Ack_Worker&); - -private: - ACE_RMCast::Ack &ack_; - - ACE_RMCast_Retransmission::Messages::Write_Guard &ace_mon_; - - ACE_RMCast_Retransmission::Messages *messages_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Ack_Worker.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_ACK_WORKER_H */ diff --git a/ace/RMCast/RMCast_Ack_Worker.i b/ace/RMCast/RMCast_Ack_Worker.i deleted file mode 100644 index 54d94d21167..00000000000 --- a/ace/RMCast/RMCast_Ack_Worker.i +++ /dev/null @@ -1,12 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Ack_Worker:: -ACE_RMCast_Ack_Worker (ACE_RMCast::Ack &ack, - ACE_RMCast_Retransmission::Messages::Write_Guard &g, - ACE_RMCast_Retransmission::Messages *messages) - : ack_ (ack) - , ace_mon_ (g) - , messages_ (messages) -{ -} diff --git a/ace/RMCast/RMCast_Copy_On_Write.cpp b/ace/RMCast/RMCast_Copy_On_Write.cpp deleted file mode 100644 index 39bf16f88a2..00000000000 --- a/ace/RMCast/RMCast_Copy_On_Write.cpp +++ /dev/null @@ -1,199 +0,0 @@ -// $Id$ - -#ifndef ACE_RMCAST_COPY_ON_WRITE_CPP -#define ACE_RMCAST_COPY_ON_WRITE_CPP - -#include "RMCast_Copy_On_Write.h" - -#if ! defined (__ACE_INLINE__) -#include "RMCast_Copy_On_Write.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Copy_On_Write, "$Id$") - -template void -ACE_RMCast_Copy_On_Write_Collection::_incr_refcnt (void) -{ - // LOCKING: no locking is required, the caller grabs the mutex. - this->refcount_++; -} - -template void -ACE_RMCast_Copy_On_Write_Collection::_decr_refcnt (void) -{ - // LOCKING: no locking is required, the caller grabs the mutex. - { - this->refcount_--; - if (this->refcount_ != 0) - return; - } - //@@ TODO: If this wrapper is going to be completely general some - // kind of functor has to be provided to remove the elements in the - // collection, in case the are no self-managed - - delete this; -} - -// **************************************************************** - -template -ACE_RMCast_Copy_On_Write:: - ACE_RMCast_Copy_On_Write (void) - : ACE_RMCast_Copy_On_Write_Container () -{ -} - -template -ACE_RMCast_Copy_On_Write:: - ~ACE_RMCast_Copy_On_Write (void) -{ - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); - - while (this->pending_writes_ != 0) - this->cond_.wait (); - - this->collection_->_decr_refcnt (); - this->collection_ = 0; -} - -template int -ACE_RMCast_Copy_On_Write:: - for_each (ACE_RMCast_Worker *worker) -{ - Read_Guard ace_mon (*this); - - ITERATOR end = ace_mon.collection->collection.end (); - for (ITERATOR i = ace_mon.collection->collection.begin (); i != end; ++i) - { - int r = worker->work ((*i).key (), (*i).item ()); - if (r == 1) - return 0; // Abort loop, but no error - if (r == -1) - return -1; - } - return 0; -} - -template KEY -ACE_RMCast_Copy_On_Write::first_key (void) -{ - Read_Guard ace_mon (*this); - ITERATOR end = ace_mon.collection->collection.end (); - ITERATOR begin = ace_mon.collection->collection.begin (); - if (begin == end) - { - return KEY (); - } - return (*begin).key (); -} - -template int -ACE_RMCast_Copy_On_Write::empty (void) -{ - Read_Guard ace_mon (*this); - ITERATOR end = ace_mon.collection->collection.end (); - ITERATOR begin = ace_mon.collection->collection.begin (); - - return end == begin; -} - -template int -ACE_RMCast_Copy_On_Write::bind (KEY const & k, - ITEM const & i) -{ - Write_Guard ace_mon (*this); - - return this->bind_i (ace_mon, k, i); -} - -template int -ACE_RMCast_Copy_On_Write::unbind (KEY const & k) -{ - Write_Guard ace_mon (*this); - - return this->unbind_i (ace_mon, k); -} - -template int -ACE_RMCast_Copy_On_Write::bind_i (Write_Guard &ace_mon, - KEY const & k, - ITEM const & i) -{ - return ace_mon.copy->collection.bind (k, i); -} - -template int -ACE_RMCast_Copy_On_Write::unbind_i (Write_Guard &ace_mon, - KEY const & k) -{ - return ace_mon.copy->collection.unbind (k); -} - -// **************************************************************** - -template -ACE_RMCast_Copy_On_Write_Container::ACE_RMCast_Copy_On_Write_Container (void) - : pending_writes_ (0) - , writing_ (0) - , cond_ (mutex_) -{ - ACE_NEW (this->collection_, Collection); -} - -// **************************************************************** - -template -ACE_RMCast_Copy_On_Write_Write_Guard:: - ACE_RMCast_Copy_On_Write_Write_Guard (Container &container) - : copy (0) - , mutex (container.mutex_) - , cond (container.cond_) - , pending_writes (container.pending_writes_) - , writing_flag (container.writing_) - , collection (container.collection_) -{ - { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex); - - this->pending_writes++; - - while (this->writing_flag != 0) - this->cond.wait (); - - this->writing_flag = 1; - } - - // Copy outside the mutex, because it may take a long time. - // Nobody can change it, because it is protected by the - // writing_flag. - - // First initialize it (with the correct reference count - ACE_NEW (this->copy, Collection); - // Copy the contents - this->copy->collection = this->collection->collection; -} - -template -ACE_RMCast_Copy_On_Write_Write_Guard:: - ~ACE_RMCast_Copy_On_Write_Write_Guard (void) -{ - Collection *tmp = 0; - { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex); - - tmp = this->collection; - this->collection = this->copy; - this->writing_flag = 0; - this->pending_writes--; - - this->cond.signal (); - } - // Delete outside the mutex, because it may take a long time. - // @@ Is this right? What happens if several readers are still - // using the old copy? - tmp->_decr_refcnt (); -} - -// **************************************************************** - -#endif /* ACE_RMCAST_COPY_ON_WRITE_CPP */ diff --git a/ace/RMCast/RMCast_Copy_On_Write.h b/ace/RMCast/RMCast_Copy_On_Write.h deleted file mode 100644 index bad0318638e..00000000000 --- a/ace/RMCast/RMCast_Copy_On_Write.h +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#ifndef ACE_RMCAST_COPY_ON_WRITE_H -#define ACE_RMCAST_COPY_ON_WRITE_H -#include /**/ "ace/pre.h" - -#include "RMCast_Worker.h" -#include "ace/Synch_Traits.h" -#include "ace/Basic_Types.h" -#include "ace/Condition_Thread_Mutex.h" - -//! A wrapper to implement reference counted collections -template -class ACE_RMCast_Copy_On_Write_Collection -{ -public: - //! Constructor - ACE_RMCast_Copy_On_Write_Collection (void); - - //! Increment the reference count - void _incr_refcnt (void); - - //! Decrement the reference count - void _decr_refcnt (void); - - //! The actual collection - COLLECTION collection; - -private: - //! The reference count - ACE_UINT32 refcount_; -}; - -// **************************************************************** - -template -class ACE_RMCast_Copy_On_Write_Read_Guard; - -template -class ACE_RMCast_Copy_On_Write_Write_Guard; - -//! Base class for the Copy_On_Write collection, used to simplify the -//! declaration of the Write_Guard -template -class ACE_RMCast_Copy_On_Write_Container -{ -public: - //! Constructor - ACE_RMCast_Copy_On_Write_Container (void); - - //! Let the Write_Guard access the internal fields. - friend class ACE_RMCast_Copy_On_Write_Write_Guard; - - //! Let the Read_Guard access the internal fields. - friend class ACE_RMCast_Copy_On_Write_Read_Guard; - - //! A shorter name for the actual collection type - typedef ACE_RMCast_Copy_On_Write_Collection Collection; - -protected: - //! Number of pending writes - int pending_writes_; - - //! If non-zero then a thread is changing the collection. - /*! - * Many threads can use the collection simulatenously, but only one - * change it. - */ - int writing_; - - //! A mutex to serialize access to the collection pointer. - ACE_SYNCH_MUTEX mutex_; - - //! A condition variable to wait to synchronize multiple writers. - ACE_SYNCH_CONDITION cond_; - - //! The collection, with reference counting added - Collection *collection_; -}; - -// **************************************************************** - -//! Implement a read guard for a reference counted collection -template -class ACE_RMCast_Copy_On_Write_Read_Guard -{ -public: - typedef ACE_RMCast_Copy_On_Write_Collection Collection; - typedef ACE_RMCast_Copy_On_Write_Container Container; - - //! Constructor - ACE_RMCast_Copy_On_Write_Read_Guard (Container &container); - - //! Destructor - ~ACE_RMCast_Copy_On_Write_Read_Guard (void); - - //! A reference to the collection - Collection *collection; - -private: - //! Synchronization - ACE_SYNCH_MUTEX &mutex_; -}; - -// **************************************************************** - -//! Implement the write guard for a reference counted collecion -/*! - * This helper class atomically increments the reference count of a - * ACE_RMCast_Copy_On_Write_Collection and reads the current - * collection in the Copy_On_Write class. - */ -template -class ACE_RMCast_Copy_On_Write_Write_Guard -{ -public: - typedef ACE_RMCast_Copy_On_Write_Collection Collection; - typedef ACE_RMCast_Copy_On_Write_Container Container; - - //! Constructor - ACE_RMCast_Copy_On_Write_Write_Guard (Container &container); - - //! Destructor - ~ACE_RMCast_Copy_On_Write_Write_Guard (void); - - //! The collection - Collection *copy; - -private: - //! Keep a reference to the mutex - ACE_SYNCH_MUTEX &mutex; - - //! Keep a reference to the condition variable - ACE_SYNCH_CONDITION &cond; - - //! Use a reference to update the pending writes count - int &pending_writes; - - //! Use a reference to update the writing flag - int &writing_flag; - - //! Use this reference to update the collection once the - //! modifications are finished. - Collection *&collection; -}; - - -// **************************************************************** - -//! Implement a copy on write wrapper for a map-like collection -/* - * - * WARNING: This class may be moved away in the future, I'm - * investigating how it could be converted into a reusable component - * in ACE. I won't make promises on when will that happen, but I - * won't promise that it will stay here either. - * - */ -template -class ACE_RMCast_Copy_On_Write : public ACE_RMCast_Copy_On_Write_Container -{ -public: - //! The Read_Guard trait - typedef ACE_RMCast_Copy_On_Write_Read_Guard Read_Guard; - - //! The Write_Guard trait - typedef ACE_RMCast_Copy_On_Write_Write_Guard Write_Guard; - - //! The underlying collection type - typedef ACE_RMCast_Copy_On_Write_Collection Collection; - - //! Constructor - ACE_RMCast_Copy_On_Write (void); - - //! Destructor - ~ACE_RMCast_Copy_On_Write (void); - - //! Iterate over all the elements invoking worker on each one. - int for_each (ACE_RMCast_Worker *worker); - - //! Get the first key - KEY first_key (void); - - /// Return non-zero if the collection is empty - int empty (void); - - //! Add a new element - int bind (KEY const & key, ITEM const & item); - - //! Remove an element - int unbind (KEY const & key); - - //! Bind assuming the Write_Guard is held - int bind_i (Write_Guard &guard, KEY const & key, ITEM const & item); - - //! Unbind assuming the Write_Guard is held - int unbind_i (Write_Guard &guard, KEY const & key); -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Copy_On_Write.i" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "RMCast_Copy_On_Write.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("RMCast_Copy_On_Write.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_COPY_ON_WRITE_H */ diff --git a/ace/RMCast/RMCast_Copy_On_Write.i b/ace/RMCast/RMCast_Copy_On_Write.i deleted file mode 100644 index c83483c0729..00000000000 --- a/ace/RMCast/RMCast_Copy_On_Write.i +++ /dev/null @@ -1,38 +0,0 @@ -// -*- C++ -*- -// $Id$ - -#include "ace/Guard_T.h" -#include "ace/Null_Mutex.h" - -template ACE_INLINE -ACE_RMCast_Copy_On_Write_Collection:: - ACE_RMCast_Copy_On_Write_Collection (void) - : refcount_ (1) -{ -} - -// **************************************************************** - -template ACE_INLINE -ACE_RMCast_Copy_On_Write_Read_Guard:: - ACE_RMCast_Copy_On_Write_Read_Guard (Container &container) - : collection (0) - , mutex_ (container.mutex_) -{ - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); - this->collection = container.collection_; - this->collection->_incr_refcnt (); -} - -template ACE_INLINE -ACE_RMCast_Copy_On_Write_Read_Guard:: - ~ACE_RMCast_Copy_On_Write_Read_Guard (void) -{ - if (this->collection != 0) - { - ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); - this->collection->_decr_refcnt (); - } -} - -// **************************************************************** diff --git a/ace/RMCast/RMCast_Export.h b/ace/RMCast/RMCast_Export.h deleted file mode 100644 index 51257c4d682..00000000000 --- a/ace/RMCast/RMCast_Export.h +++ /dev/null @@ -1,44 +0,0 @@ -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by -// generate_export_file.pl -// ------------------------------ -#if !defined (ACE_RMCAST_EXPORT_H) -#define ACE_RMCAST_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_RMCAST_HAS_DLL) -# define ACE_RMCAST_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_RMCAST_HAS_DLL */ - -#if !defined (ACE_RMCAST_HAS_DLL) -#define ACE_RMCAST_HAS_DLL 1 -#endif /* ! ACE_RMCAST_HAS_DLL */ - -#if defined (ACE_RMCAST_HAS_DLL) -# if (ACE_RMCAST_HAS_DLL == 1) -# if defined (ACE_RMCAST_BUILD_DLL) -# define ACE_RMCast_Export ACE_Proper_Export_Flag -# define ACE_RMCAST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_RMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else -# define ACE_RMCast_Export ACE_Proper_Import_Flag -# define ACE_RMCAST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_RMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_RMCAST_BUILD_DLL */ -# else -# define ACE_RMCast_Export -# define ACE_RMCAST_SINGLETON_DECLARATION(T) -# define ACE_RMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ! ACE_RMCAST_HAS_DLL == 1 */ -#else -# define ACE_RMCast_Export -# define ACE_RMCAST_SINGLETON_DECLARATION(T) -# define ACE_RMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_RMCAST_HAS_DLL */ - -#endif /* ACE_RMCAST_EXPORT_H */ - -// End of auto generated file. diff --git a/ace/RMCast/RMCast_Fork.cpp b/ace/RMCast/RMCast_Fork.cpp deleted file mode 100644 index 92c81b9d33e..00000000000 --- a/ace/RMCast/RMCast_Fork.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// $Id$ - -#include "RMCast_Fork.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Fork.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Fork, "$Id$") - -ACE_RMCast_Fork::~ACE_RMCast_Fork (void) -{ -} - -int -ACE_RMCast_Fork::open (void) -{ - int r = this->ACE_RMCast_Module::open (); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->open (); - return 0; -} - -int -ACE_RMCast_Fork::close (void) -{ - int r = this->ACE_RMCast_Module::close (); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->close (); - return 0; -} - -int -ACE_RMCast_Fork::data (ACE_RMCast::Data &data) -{ - int r = this->ACE_RMCast_Module::data (data); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->data (data); - return 0; -} - -int -ACE_RMCast_Fork::poll (ACE_RMCast::Poll &poll) -{ - int r = this->ACE_RMCast_Module::poll (poll); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->poll (poll); - return 0; -} - -int -ACE_RMCast_Fork::ack_join (ACE_RMCast::Ack_Join &ack_join) -{ - int r = this->ACE_RMCast_Module::ack_join (ack_join); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->ack_join (ack_join); - return 0; -} - -int -ACE_RMCast_Fork::ack_leave (ACE_RMCast::Ack_Leave &ack_leave) -{ - int r = this->ACE_RMCast_Module::ack_leave (ack_leave); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->ack_leave (ack_leave); - return 0; -} - -int -ACE_RMCast_Fork::ack (ACE_RMCast::Ack &ack) -{ - int r = this->ACE_RMCast_Module::ack (ack); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->ack (ack); - return 0; -} - -int -ACE_RMCast_Fork::join (ACE_RMCast::Join &join) -{ - int r = this->ACE_RMCast_Module::join (join); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->join (join); - return 0; -} - -int -ACE_RMCast_Fork::leave (ACE_RMCast::Leave &leave) -{ - int r = this->ACE_RMCast_Module::leave (leave); - if (r != 0) - return r; - if (this->secondary () != 0) - return this->secondary ()->leave (leave); - return 0; -} diff --git a/ace/RMCast/RMCast_Fork.h b/ace/RMCast/RMCast_Fork.h deleted file mode 100644 index 498ee2d6d63..00000000000 --- a/ace/RMCast/RMCast_Fork.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#ifndef ACE_RMCAST_FORK_H -#define ACE_RMCAST_FORK_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Fork messages to multiple destinations -/** - * In some instances the messages must be sent to multiple - * destinations, this module is a generic component to duplicate such - * messages. - */ -class ACE_RMCast_Export ACE_RMCast_Fork : public ACE_RMCast_Module -{ -public: - //! Constructor - ACE_RMCast_Fork (void); - - //! Destructor - virtual ~ACE_RMCast_Fork (void); - - /// Set the control module, all incoming control messages go to it - void secondary (ACE_RMCast_Module *module); - - /// Return the current control module - ACE_RMCast_Module *secondary (void) const; - - virtual int open (void); - virtual int close (void); - virtual int data (ACE_RMCast::Data &); - virtual int poll (ACE_RMCast::Poll &); - virtual int ack_join (ACE_RMCast::Ack_Join &); - virtual int ack_leave (ACE_RMCast::Ack_Leave &); - virtual int ack (ACE_RMCast::Ack &); - virtual int join (ACE_RMCast::Join &); - virtual int leave (ACE_RMCast::Leave &); - -private: - /// The control module - ACE_RMCast_Module *secondary_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Fork.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_FORK_H */ diff --git a/ace/RMCast/RMCast_Fork.i b/ace/RMCast/RMCast_Fork.i deleted file mode 100644 index bbcd4f23ae1..00000000000 --- a/ace/RMCast/RMCast_Fork.i +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Fork::ACE_RMCast_Fork (void) - : ACE_RMCast_Module () - , secondary_ (0) -{ -} - -ACE_INLINE void -ACE_RMCast_Fork::secondary (ACE_RMCast_Module *module) -{ - this->secondary_ = module; -} - - -ACE_INLINE ACE_RMCast_Module * -ACE_RMCast_Fork::secondary (void) const -{ - return this->secondary_; -} diff --git a/ace/RMCast/RMCast_Fragment.cpp b/ace/RMCast/RMCast_Fragment.cpp deleted file mode 100644 index a278b0083c6..00000000000 --- a/ace/RMCast/RMCast_Fragment.cpp +++ /dev/null @@ -1,189 +0,0 @@ -// $Id$ - -#include "RMCast_Fragment.h" -#include "ace/Message_Block.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "RMCast_Fragment.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Fragment, "$Id$") - -ACE_RMCast_Fragment:: -ACE_RMCast_Fragment (void) - : ACE_RMCast_Module () - , max_fragment_size_ (ACE_RMCAST_DEFAULT_FRAGMENT_SIZE) -{ -} - -ACE_RMCast_Fragment::~ACE_RMCast_Fragment (void) -{ -} - -int -ACE_RMCast_Fragment::data (ACE_RMCast::Data &received_data) -{ - if (this->next () == 0) - return 0; - - // The Data object sent downstream - ACE_RMCast::Data data = received_data; - - ACE_Message_Block *mb = data.payload; - - // @@ We should keep the total size precomputed - data.total_size = ACE_static_cast (ACE_UINT32, mb->total_length ()); - - // We must leave room for the header -#if defined (ACE_HAS_BROKEN_DGRAM_SENDV) - const int ACE_RMCAST_WRITEV_MAX = ACE_IOV_MAX - 2; -#else - const int ACE_RMCAST_WRITEV_MAX = ACE_IOV_MAX - 1; -#endif /* ACE_HAS_BROKEN_DGRAM_SENDV */ - - // Assume the header will be included on each fragment, so readuce - // the maximum amount of memory allowed on each fragment.... - const size_t fragment_header_size = 1 + 3 * sizeof(ACE_UINT32); - - const size_t max_fragment_payload = - this->max_fragment_size_ - fragment_header_size; - - // Iterate over all the message blocks in the chain. If there is - // enough data to send an MTU then it is sent immediately. - // The last fragment is sent with whatever data remains. - // A single fragment can expand multiple message blocks, put - // together in an array, it is also possible that a single - // message block requires multiple fragments... so the code below is - // as simple as possible, but not any simpler ;-) - - - // The first piece of each fragment is a header that contains: - // - A sequence number for reassembly, this is unrelated to - // the sequence number for re-transmission. - // NOTE: yes, this increases the bandwidth requires by 4 bytes on - // each message, I don't think this is a big deal. - // - A fragment offset for reassembly. - // - The total size of the message, so the reassembly layer knows - // when a complete message has been received. - - // Complete the initialization of the structure - - data.fragment_offset = 0; - - // The underlying transport layer can only tolerate so many elements - // in a chain, so we must count them and send a fragment if we are - // going over the limit. - - ACE_Message_Block blocks[ACE_RMCAST_WRITEV_MAX]; - - - // How many elements of the array are in use... - int iovcnt = 0; - - // The size of the current message, adding the size of all its - // message blocks. - size_t fragment_size = 0; - - for (ACE_Message_Block* b = mb; b != 0; b = b->cont ()) - { - ACE_Message_Block *current_block = &blocks[iovcnt]; - - // Add the block to the vector... - - current_block->data_block (b->data_block ()->duplicate ()); - current_block->rd_ptr (b->rd_ptr ()); - current_block->wr_ptr (b->wr_ptr ()); - current_block->cont (0); - - // Set the continuation field - if (iovcnt != 0) - blocks[iovcnt-1].cont (current_block); - - size_t current_block_length = current_block->length (); - - // Recompute the state of the fragment - fragment_size += current_block_length; - iovcnt++; - - while (fragment_size >= max_fragment_payload) - { - // We have filled a fragment. It is possible that we need - // to split the last message block in multiple fragments, - // thus the loop above... - - // First adjust the last message block to exactly fit in the - // fragment: - size_t last_sent_mb_len = - max_fragment_payload - (fragment_size - current_block_length); - - // Send only enough data of the last message block to fill - // the fragment... - current_block->wr_ptr (current_block->rd_ptr () - + last_sent_mb_len); - - data.payload = blocks; - if (this->next ()->data (data) == -1) - return -1; - - // adjust the offset - data.fragment_offset += ACE_static_cast (ACE_UINT32, - max_fragment_payload); - - // Now compute how much data is left in the last message - // block, to check if we should continue sending it... - current_block_length -= last_sent_mb_len; - if (current_block_length == 0) - { - // No more data from this message block, just continue - // the outer loop... - iovcnt = 0; - fragment_size = 0; - blocks[0].cont (0); - break; // while - } - - // There is some data left, we try to send it in a single - // fragment, if it is still too big the beginning of this - // loop will adjust things. - - // We must put the data in the right place in the array.. - char *rd_ptr = current_block->rd_ptr () + last_sent_mb_len; - char *wr_ptr = rd_ptr + current_block_length; - blocks[0].data_block (current_block->replace_data_block (0)); - - // And determine what segment of the data will be sent.. - blocks[0].rd_ptr (rd_ptr); - blocks[0].wr_ptr (wr_ptr); - blocks[0].cont (0); - - // Adjust the state of the fragment - fragment_size = current_block_length; - iovcnt = 1; - - // Notice that if is too big the start of - // this loop will continue the fragmentation. - } - - // It is also possible to fill up the iovec array before the - // fragment is completed, in this case we must send whatever we - // have: - if (iovcnt == ACE_RMCAST_WRITEV_MAX) - { - if (this->next ()->data (data) == -1) - return -1; - - iovcnt = 0; - fragment_size = 0; - blocks[0].cont (0); - } - } - - if (iovcnt == 0) - return 0; - - return this->next ()->data (data); -} diff --git a/ace/RMCast/RMCast_Fragment.h b/ace/RMCast/RMCast_Fragment.h deleted file mode 100644 index f180087ce3e..00000000000 --- a/ace/RMCast/RMCast_Fragment.h +++ /dev/null @@ -1,61 +0,0 @@ -// $Id$ - -#ifndef ACE_RMCAST_FRAGMENT_H -#define ACE_RMCAST_FRAGMENT_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -//! Default fragment size -#ifndef ACE_RMCAST_DEFAULT_FRAGMENT_SIZE -# define ACE_RMCAST_DEFAULT_FRAGMENT_SIZE 1024 -#endif /* ACE_RMCAST_DEFAULT_FRAGMENT_SIZE */ - -//! Fragmentation module -/*! - * Some transports cannot send very big messages, for example UDP - * imposes a limit of 64K, and in practice the limit is even more - * strict than that. - * This class decomposes a message into multiple fragments, using an - * application defined maximum size. - */ -class ACE_RMCast_Export ACE_RMCast_Fragment : public ACE_RMCast_Module -{ -public: - //! Constructor - ACE_RMCast_Fragment (void); - - //! Destructor - virtual ~ACE_RMCast_Fragment (void); - - //! Accessor for the max_fragment size. - /*! There is no modifier, the maximum fragment size is obtained - * using feedback from the lower layers (transport?) - * @@TODO We have not implemented the feedback mechanisms yet! - */ - size_t max_fragment_size (void) const; - - /*! - * Only data messages need fragmentation, the control messages are - * all small enough for all the transports that I know about. - * Well, actually for CAN-Bus (Controller Area Network), they may be - * too big, because the max payload there is 8 bytes, but we don't - * play with those in ACE. - */ - virtual int data (ACE_RMCast::Data &data); - -private: - //! Current fragment size limit - size_t max_fragment_size_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Fragment.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_FRAGMENT_H */ diff --git a/ace/RMCast/RMCast_Fragment.i b/ace/RMCast/RMCast_Fragment.i deleted file mode 100644 index 8e628093b8c..00000000000 --- a/ace/RMCast/RMCast_Fragment.i +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ - -ACE_INLINE size_t -ACE_RMCast_Fragment::max_fragment_size (void) const -{ - return this->max_fragment_size_; -} diff --git a/ace/RMCast/RMCast_IO_UDP.cpp b/ace/RMCast/RMCast_IO_UDP.cpp deleted file mode 100644 index d0648e0e40d..00000000000 --- a/ace/RMCast/RMCast_IO_UDP.cpp +++ /dev/null @@ -1,461 +0,0 @@ -// $Id$ - -#include "RMCast_IO_UDP.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_IO_UDP.i" -#endif /* ! __ACE_INLINE__ */ - -#include "RMCast_UDP_Proxy.h" -#include "RMCast_Module_Factory.h" - -#include "ace/Handle_Set.h" -#include "ace/Reactor.h" -#include "ace/Message_Block.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_sys_select.h" -#include "ace/os_include/arpa/os_inet.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID(RMCast, RMCast_IO_UDP, "RMCast_IO_UDP.cpp,v 1.12 2000/12/20 22:00:33 oci Exp") - -ACE_RMCast_IO_UDP::~ACE_RMCast_IO_UDP (void) -{ -} - -int -ACE_RMCast_IO_UDP::init (const ACE_INET_Addr &mcast_group, - const ACE_Addr &local, - int protocol_family, - int protocol, - int reuse_addr) -{ - this->mcast_group_ = mcast_group; - - ACE_SOCK_Dgram &dgram = this->dgram_; - return dgram.open (local, protocol_family, protocol, reuse_addr); -} - -int -ACE_RMCast_IO_UDP::subscribe (const ACE_INET_Addr &mcast_addr, - int reuse_addr, - const ACE_TCHAR *net_if, - int protocol_family, - int protocol) -{ - this->mcast_group_ = mcast_addr; - return this->dgram_.subscribe (mcast_addr, - reuse_addr, - net_if, - protocol_family, - protocol); -} - -int -ACE_RMCast_IO_UDP::handle_events (ACE_Time_Value *tv) -{ - ACE_HANDLE h = this->dgram_.get_handle (); - if (h == ACE_INVALID_HANDLE) - return -1; - - ACE_Handle_Set handle_set; - handle_set.set_bit (h); - - ACE_Countdown_Time countdown (tv); - - int r = ACE_OS::select (int(size_t(h)) + 1, - handle_set, 0, 0, - tv); - if (r == -1) - { - if (errno == EINTR) - return 0; - else - return -1; - } - else if (r == 0) - { - return 0; - } - - return this->handle_input (h); -} - -int -ACE_RMCast_IO_UDP::handle_input (ACE_HANDLE) -{ - char buffer[ACE_MAX_UDP_PACKET_SIZE]; - - ACE_INET_Addr from_address; - ssize_t r = - this->dgram_.recv (buffer, sizeof(buffer), from_address); - - if (r == -1) - { - // @@ LOG?? - ACE_ERROR ((LM_ERROR, - "RMCast_IO_UDP::handle_input () - error in recv %p\n", - ACE_TEXT (""))); - return -1; - } - - // ACE_HEX_DUMP ((LM_DEBUG, buffer, 16, "Receiver::handle_input")); - - // @@ Locking! - - int type = buffer[0]; - - if (type < 0 || type >= ACE_RMCast::RMCAST_MT_LAST) - { - // @@ Log: invalid message type!! - // @@ TODO: should we return -1? The socket is still valid, it - // makes little sense to destroy it just because one remote - // sender is sending invalid messages. Maybe we should - // strategize this too, and report the problem to the - // application, this could indicate a misconfiguration or - // something worse... - - // In any case the proxy should be destroyed, its peer is making - // something really wrong. - ACE_RMCast_UDP_Proxy *proxy; - if (this->map_.unbind (from_address, proxy) == 0) - { - this->factory_->destroy (proxy->next ()); - delete proxy; - } - return 0; - } - - ACE_RMCast_UDP_Proxy *proxy; - if (this->map_.find (from_address, proxy) != 0) - { - //ACE_DEBUG ((LM_DEBUG, - // "IO_UDP::handle_input - new proxy from <%s:%d>\n", - // from_address.get_host_addr (), - // from_address.get_port_number ())); - - // @@ We should validate the message *before* creating the - // object, all we need is some sort of validation strategy, a - // different one for the receiver and another one for the - // sender. - -#if 0 - if (type == ACE_RMCast::RMCAST_MT_ACK - || type == ACE_RMCast::RMCAST_MT_JOIN - || type == ACE_RMCast::RMCAST_MT_LEAVE - || type == ACE_RMCast::RMCAST_MT_ACK_LEAVE) - { - // All these message types indicate a problem, the should be - // generated by receivers, not received by them. - return 0; - } -#endif /* 0 */ - ACE_RMCast_Module *module = this->factory_->create (); - if (module == 0) - { - // @@ LOG?? - // Try to continue working, maybe the module can be created - // later. - return 0; - } - // This is necessary to satisfy the xgcc for Lynx on Solaris - // by including the code directly causes : - // RMCast_IO_UDP.cpp:202: error: internal error--unrecognizable insn: - // (insn 1510 1507 524 (set (mem:SI (plus:SI (reg:SI 28 r28) - // (const_int 65536))) - // (reg:SI 0 r0)) -1 (insn_list 528 (insn_list 1507 (nil))) - // (nil)) - // /usr/lynx/home2/jose/98r2/src/gcc/toplev.c:1489: Internal compiler error in function fatal_insn - // to be thrown at the end of the function. - if ((proxy = allocate_and_bind_proxy(module,from_address)) == 0) - return 0; - } - - // Have the proxy process the message and do the right thing. - if (proxy->receive_message (buffer, r) != 0) - { - (void) this->map_.unbind (from_address); - this->factory_->destroy (proxy->next ()); - delete proxy; - } - - return 0; -} - -ACE_HANDLE -ACE_RMCast_IO_UDP::get_handle (void) const -{ - return this->dgram_.get_handle (); -} - -int -ACE_RMCast_IO_UDP::data (ACE_RMCast::Data &data) -{ - return this->send_data (data, this->mcast_group_); -} - -int -ACE_RMCast_IO_UDP::poll (ACE_RMCast::Poll &poll) -{ - return this->send_poll (poll, this->mcast_group_); -} - -int -ACE_RMCast_IO_UDP::ack_join (ACE_RMCast::Ack_Join &ack_join) -{ - return this->send_ack_join (ack_join, this->mcast_group_); -} - -int -ACE_RMCast_IO_UDP::ack_leave (ACE_RMCast::Ack_Leave &ack_leave) -{ - return this->send_ack_leave (ack_leave, this->mcast_group_); -} - -int -ACE_RMCast_IO_UDP::ack (ACE_RMCast::Ack &ack) -{ - return this->send_ack (ack, this->mcast_group_); -} - -int -ACE_RMCast_IO_UDP::join (ACE_RMCast::Join &join) -{ - return this->send_join (join, this->mcast_group_); -} - -int -ACE_RMCast_IO_UDP::leave (ACE_RMCast::Leave &leave) -{ - return this->send_leave (leave, this->mcast_group_); -} - -int -ACE_RMCast_IO_UDP::send_data (ACE_RMCast::Data &data, - const ACE_INET_Addr &to) -{ - //ACE_DEBUG ((LM_DEBUG, - // "IO_UDP::send_data - pushing out to <%s:%d>\n", - // to.get_host_addr (), - // to.get_port_number ())); - - // The first message block contains the header - // @@ TODO: We could keep the header pre-initialized, and only - // update the portions that do change... - ACE_UINT32 tmp; - char header[1 + 3 * sizeof(ACE_UINT32)]; - header[0] = ACE_RMCast::RMCAST_MT_DATA; - - tmp = ACE_HTONL (data.sequence_number); - ACE_OS::memcpy (header + 1, - &tmp, sizeof(ACE_UINT32)); - tmp = ACE_HTONL (data.total_size); - ACE_OS::memcpy (header + 1 + sizeof(ACE_UINT32), - &tmp, sizeof(ACE_UINT32)); - tmp = ACE_HTONL (data.fragment_offset); - ACE_OS::memcpy (header + 1 + 2 * sizeof(ACE_UINT32), - &tmp, sizeof(ACE_UINT32)); - - iovec iov[ACE_IOV_MAX]; - int iovcnt = 1; - - iov[0].iov_base = header; - iov[0].iov_len = sizeof(header); - - ACE_Message_Block *mb = data.payload; - - for (const ACE_Message_Block *i = mb; i != 0; i = i->cont ()) - { - iov[iovcnt].iov_base = i->rd_ptr (); - iov[iovcnt].iov_len = ACE_static_cast (u_long, i->length ()); - iovcnt++; - if (iovcnt >= IOV_MAX) - return -1; - } - - // @@ This pacing stuff here reduced the number of packet lost in - // loopback tests, but it should be taken out for real applications - // (or at least made configurable!) - ACE_Time_Value tv (0, 10000); - ACE_OS::sleep (tv); - - // ACE_SOCK_MCast_Dgram disallows sending, but it actually works. - ACE_SOCK_Dgram &dgram = this->dgram_; - - if (dgram.send (iov, iovcnt, to) == -1) - return -1; - -#if 0 - ACE_HEX_DUMP ((LM_DEBUG, - (char*)iov[0].iov_base, - iov[0].iov_len, - "Sending")); -#endif - - return 0; -} - -int -ACE_RMCast_IO_UDP::send_poll (ACE_RMCast::Poll &, - const ACE_INET_Addr &to) -{ - //ACE_DEBUG ((LM_DEBUG, - // "IO_UDP::send_poll - pushing out to <%s:%d>\n", - // to.get_host_addr (), - // to.get_port_number ())); - - // @@ TODO: We could keep the header pre-initialized, and only - // update the portions that do change... - char header[16]; - header[0] = ACE_RMCast::RMCAST_MT_POLL; - - // ACE_SOCK_MCast_Dgram disallows sending, but it actually works. - ACE_SOCK_Dgram &dgram = this->dgram_; - - if (dgram.send (header, 1, to) == -1) - return -1; - - return 0; -} - -int -ACE_RMCast_IO_UDP::send_ack_join (ACE_RMCast::Ack_Join &ack_join, - const ACE_INET_Addr &to) -{ - //ACE_DEBUG ((LM_DEBUG, - // "IO_UDP::send_ack_join - pushing out to <%s:%d>\n", - // to.get_host_addr (), - // to.get_port_number ())); - - // @@ TODO: We could keep the header pre-initialized, and only - // update the portions that do change... - char header[16]; - header[0] = ACE_RMCast::RMCAST_MT_ACK_JOIN; - - ACE_UINT32 tmp = ACE_HTONL (ack_join.next_sequence_number); - ACE_OS::memcpy (header + 1, - &tmp, sizeof(ACE_UINT32)); - // ACE_SOCK_MCast_Dgram disallows sending, but it actually works. - ACE_SOCK_Dgram &dgram = this->dgram_; - - if (dgram.send (header, 1 + sizeof(ACE_UINT32), to) == -1) - return -1; - - return 0; -} - -int -ACE_RMCast_IO_UDP::send_ack_leave (ACE_RMCast::Ack_Leave &, - const ACE_INET_Addr &to) -{ - //ACE_DEBUG ((LM_DEBUG, - // "IO_UDP::send_ack_leave - pushing out to <%s:%d>\n", - // to.get_host_addr (), - // to.get_port_number ())); - - // @@ TODO: We could keep the header pre-initialized, and only - // update the portions that do change... - char header[16]; - header[0] = ACE_RMCast::RMCAST_MT_ACK_LEAVE; - - // ACE_SOCK_MCast_Dgram disallows sending, but it actually works. - ACE_SOCK_Dgram &dgram = this->dgram_; - - if (dgram.send (header, 1, to) == -1) - return -1; - - return 0; -} - -int -ACE_RMCast_IO_UDP::send_ack (ACE_RMCast::Ack &ack, - const ACE_INET_Addr &to) -{ - //ACE_DEBUG ((LM_DEBUG, - // "IO_UDP::send_ack - pushing (%d:%d) out to <%s:%d>\n", - // ack.next_expected, - // ack.highest_received, - // to.get_host_addr (), - // to.get_port_number ())); - - // @@ TODO: We could keep the header pre-initialized, and only - // update the portions that do change... - char header[16]; - header[0] = ACE_RMCast::RMCAST_MT_ACK; - - ACE_UINT32 tmp = ACE_HTONL (ack.next_expected); - ACE_OS::memcpy (header + 1, - &tmp, sizeof(ACE_UINT32)); - tmp = ACE_HTONL (ack.highest_received); - ACE_OS::memcpy (header + 1 + sizeof(ACE_UINT32), - &tmp, sizeof(ACE_UINT32)); - - // ACE_SOCK_MCast_Dgram disallows sending, but it actually works. - ACE_SOCK_Dgram &dgram = this->dgram_; - - if (dgram.send (header, 1 + 2*sizeof(ACE_UINT32), to) == -1) - return -1; - - return 0; -} - -int -ACE_RMCast_IO_UDP::send_join (ACE_RMCast::Join &, - const ACE_INET_Addr &to) -{ - //ACE_DEBUG ((LM_DEBUG, - // "IO_UDP::send_join - pushing out to <%s:%d>\n", - // to.get_host_addr (), - // to.get_port_number ())); - - // @@ TODO: We could keep the header pre-initialized, and only - // update the portions that do change... - char header[16]; - header[0] = ACE_RMCast::RMCAST_MT_JOIN; - - // ACE_SOCK_MCast_Dgram disallows sending, but it actually works. - ACE_SOCK_Dgram &dgram = this->dgram_; - - if (dgram.send (header, 1, to) == -1) - return -1; - - return 0; -} - -int -ACE_RMCast_IO_UDP::send_leave (ACE_RMCast::Leave &, - const ACE_INET_Addr &to) -{ - //ACE_DEBUG ((LM_DEBUG, - // "IO_UDP::send_leave - pushing out to <%s:%d>\n", - // to.get_host_addr (), - // to.get_port_number ())); - - // @@ TODO: We could keep the header pre-initialized, and only - // update the portions that do change... - char header[16]; - header[0] = ACE_RMCast::RMCAST_MT_LEAVE; - - // ACE_SOCK_MCast_Dgram disallows sending, but it actually works. - ACE_SOCK_Dgram &dgram = this->dgram_; - - if (dgram.send (header, 1, to) == -1) - return -1; - - return 0; -} - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Manager_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator; -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>; -template class ACE_Hash_Map_Entry; -template class ACE_Equal_To; -template class ACE_Hash; - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/RMCast/RMCast_IO_UDP.h b/ace/RMCast/RMCast_IO_UDP.h deleted file mode 100644 index 9cad38a0506..00000000000 --- a/ace/RMCast/RMCast_IO_UDP.h +++ /dev/null @@ -1,138 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = DESCRIPTION -// Encapsulate the I/O layer for a UDP based receiver -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_IO_UDP_H -#define ACE_RMCAST_IO_UDP_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" -#include "ace/SOCK_Dgram_Mcast.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/INET_Addr.h" -#include "ace/Null_Mutex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_RMCast_UDP_Proxy; -class ACE_RMCast_Module_Factory; -class ACE_Time_Value; - -class ACE_RMCast_Export ACE_RMCast_IO_UDP : public ACE_RMCast_Module -{ -public: - //! Constructor - /*! - * The argument is used to create the modules for each - * proxy that process incoming messages. The class does *not* assume - * ownership of , the caller owns it. But it does assume - * ownership of the modules returned by the factory, and it may ask - * the factory to release them eventually. - */ - ACE_RMCast_IO_UDP (ACE_RMCast_Module_Factory *factory); - - //! Destructor - ~ACE_RMCast_IO_UDP (void); - - /// Open the internal socket, but only to send multicast data. - /** - * It is not clear to me if this is a valid configuration. Maybe it - * would be a problem to expose two separate, incompatible - * interfaces (check the subscribe() method). However, the - * alternative would be to implement almost identical class for - * outgoing and incoming UDP I/O - */ - int init (const ACE_INET_Addr &mcast_group, - const ACE_Addr &local, - int protocol_family = PF_INET, - int protocol = 0, - int reuse_addr = 0); - - //! Join a new multicast group - /*! - * Start receiving data for the multicast group. - * Please read the documentation of ACE_SOCK_Dgram_Mcast for more - * details. - */ - 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); - - // The class can be used with a Reactor or using blocking I/O - // depending on what method of the following two is called. - - //! Wait for events for the period . If is zero it blocks - //! forever. - int handle_events (ACE_Time_Value *tv = 0); - - //! There is data to read, read it and process it. - int handle_input (ACE_HANDLE h); - - //! Obtain the handle for the underlying socket - ACE_HANDLE get_handle (void) const; - - //@{ - //! Send the message to the ACE_INET_Addr argument. - /*! - * These methods are used in the implementation of the - * ACE_RMCast_UDP_Proxy objects and the implementation of the - * inherited ACE_RMCast_Module methods in this class. - */ - int send_data (ACE_RMCast::Data &, const ACE_INET_Addr &); - int send_poll (ACE_RMCast::Poll &, const ACE_INET_Addr &); - int send_ack_join (ACE_RMCast::Ack_Join &, const ACE_INET_Addr &); - int send_ack_leave (ACE_RMCast::Ack_Leave &, const ACE_INET_Addr &); - int send_ack (ACE_RMCast::Ack &, const ACE_INET_Addr &); - int send_join (ACE_RMCast::Join &, const ACE_INET_Addr &); - int send_leave (ACE_RMCast::Leave &, const ACE_INET_Addr &); - //@} - - // Please read the documentation in ACE_RMCast_Module for more details - virtual int data (ACE_RMCast::Data &); - virtual int poll (ACE_RMCast::Poll &); - virtual int ack_join (ACE_RMCast::Ack_Join &); - virtual int ack_leave (ACE_RMCast::Ack_Leave &); - virtual int ack (ACE_RMCast::Ack &); - virtual int join (ACE_RMCast::Join &); - virtual int leave (ACE_RMCast::Leave &); - -private: - - // This is necessary to satisfy the stupid xgcc for Lynx on Solaris - // The compiler barfs up lisp code errors - ACE_RMCast_UDP_Proxy *allocate_and_bind_proxy (ACE_RMCast_Module *module, - const ACE_INET_Addr &); - - //! The factory used to create the modules attached to each proxy - ACE_RMCast_Module_Factory *factory_; - - //! The multicast group we subscribe and send to - ACE_INET_Addr mcast_group_; - - //! The socket used to receive and send data - ACE_SOCK_Dgram_Mcast dgram_; - - //! Use a Hash_Map to maintain the collection of proxies - typedef ACE_Hash_Map_Manager Map; - //! The collection of proxies - Map map_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_IO_UDP.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_IO_UDP_H */ diff --git a/ace/RMCast/RMCast_IO_UDP.i b/ace/RMCast/RMCast_IO_UDP.i deleted file mode 100644 index 5468ae292af..00000000000 --- a/ace/RMCast/RMCast_IO_UDP.i +++ /dev/null @@ -1,37 +0,0 @@ -// $Id$ - -#include "RMCast_UDP_Proxy.h" -#include "RMCast_Module_Factory.h" -#include "ace/OS_Memory.h" - -ACE_INLINE -ACE_RMCast_IO_UDP:: - ACE_RMCast_IO_UDP (ACE_RMCast_Module_Factory *factory) - : factory_ (factory), - dgram_ (ACE_SOCK_Dgram_Mcast::OPT_BINDADDR_NO) -{ -} - -// Workaround failure in gcc for lynx hosted on solaris -// see ACE_RMCast_IO_UDP::handle_input() for more details -ACE_INLINE ACE_RMCast_UDP_Proxy * -ACE_RMCast_IO_UDP::allocate_and_bind_proxy (ACE_RMCast_Module *module, - const ACE_INET_Addr& from_address) -{ - ACE_RMCast_UDP_Proxy *proxy; - ACE_NEW_RETURN (proxy, - ACE_RMCast_UDP_Proxy(this, - from_address), - 0); - proxy->next (module); - - if (this->map_.bind (from_address, proxy) != 0) - { - // @@ LOG?? - return 0; - } - - return proxy; -} - - diff --git a/ace/RMCast/RMCast_Membership.cpp b/ace/RMCast/RMCast_Membership.cpp deleted file mode 100644 index 7511c72f7fe..00000000000 --- a/ace/RMCast/RMCast_Membership.cpp +++ /dev/null @@ -1,186 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Membership.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Membership.i" -#endif /* ! __ACE_INLINE__ */ - -#include "RMCast_Proxy.h" -#include "ace/Guard_T.h" - -ACE_RCSID(RMCast, RMCast_Membership, "$Id$") - -ACE_RMCast_Membership::~ACE_RMCast_Membership (void) -{ -} - -int -ACE_RMCast_Membership::has_members (void) -{ - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - - Proxy_Iterator end = this->proxies_.end (); - Proxy_Iterator i = this->proxies_.begin (); - return (i != end); -} - -int -ACE_RMCast_Membership::ack (ACE_RMCast::Ack &ack) -{ - //ACE_DEBUG ((LM_DEBUG, "ACE_RMCast_Membership::ack (%d:%d)\n", - // ack.next_expected, ack.highest_received)); - - ACE_RMCast::Ack next_ack; - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - if (ack.next_expected < this->next_expected_) - { - // @@ This violates an invariant of the class, shouldn't - // happen... - //ACE_DEBUG ((LM_DEBUG, "ACE_RMCast_Membership::ack[2]\n")); - return 0; - } - else if (ack.next_expected == this->next_expected_) - { - // Nothing new, just continue.... - //ACE_DEBUG ((LM_DEBUG, "ACE_RMCast_Membership::ack[3]\n")); - return 0; - } - - int r = this->compute_ack_i (ack.source, next_ack); - if (r < 0) - return r; - if (r == 1) - return 0; - } - - //ACE_DEBUG ((LM_DEBUG, "ACE_RMCast_Membership::ack[4] (%d:%d)\n", - // next_ack.next_expected, next_ack.highest_received)); - - return this->ACE_RMCast_Module::ack (next_ack); -} - -int -ACE_RMCast_Membership::join (ACE_RMCast::Join &join) -{ - if (join.source == 0) - return 0; - - { - // ACE_DEBUG ((LM_DEBUG, - // "RMCast_Membership::join - %d\n", - // long(join.source))); - - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - if (this->proxies_.insert (join.source) == -1) - return -1; - } - (void) this->generate_ack (join.source); - - return this->ACE_RMCast_Module::join (join); -} - -int -ACE_RMCast_Membership::leave (ACE_RMCast::Leave &leave) -{ - if (leave.source == 0) - return 0; - - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - (void) this->proxies_.remove (leave.source); - } - (void) this->generate_ack (leave.source); - - return this->ACE_RMCast_Module::leave (leave); -} - -int -ACE_RMCast_Membership::generate_ack (ACE_RMCast_Proxy *proxy) -{ - ACE_RMCast::Ack next_ack; - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - int r = this->compute_ack_i (proxy, next_ack); - if (r < 0) - return r; - if (r == 1) - return 0; - } - - //ACE_DEBUG ((LM_DEBUG, "ACE_RMCast_Membership::ack[6] (%d:%d)\n", - // next_ack.next_expected, next_ack.highest_received)); - - return this->ACE_RMCast_Module::ack (next_ack); -} - -int -ACE_RMCast_Membership::compute_ack_i (ACE_RMCast_Proxy *source, - ACE_RMCast::Ack &next_ack) -{ - Proxy_Iterator end = this->proxies_.end (); - Proxy_Iterator i = this->proxies_.begin (); - if (i == end) - return 1; - - //ACE_DEBUG ((LM_DEBUG, - // "RMCast_Membership::generate_ack[1] - %d -> (%d:%d)\n", - // long(*i), - // (*i)->next_expected (), - // (*i)->highest_received ())); - - ACE_UINT32 next_expected = (*i)->next_expected (); - ACE_UINT32 highest_received = (*i)->highest_received (); - ++i; - - for (; i != end; ++i) - { - // ACE_DEBUG ((LM_DEBUG, - // "RMCast_Membership::generate_ack[2] - %d -> (%d:%d)\n", - // long(*i), - // (*i)->next_expected (), - // (*i)->highest_received ())); - - ACE_UINT32 s = (*i)->next_expected (); - if (s < next_expected) - next_expected = s; - ACE_UINT32 r = (*i)->highest_received (); - if (r > highest_received) - highest_received = r; - } -#if 0 - // @@TODO: this is an important feature, disabled until it is - // fully debugged - if (this->next_expected_ >= next_expected - || this->highest_received_ >= highest_received) - { - // No change.... - ACE_DEBUG ((LM_DEBUG, - "RMCast_Membership::generate_ack[3]\n")); - return 1; - } -#endif /* 0 */ - this->next_expected_ = next_expected; - this->highest_received_ = highest_received; - next_ack.source = source; - next_ack.next_expected = this->next_expected_; - next_ack.highest_received = this->highest_received_; - - //ACE_DEBUG ((LM_DEBUG, - // "RMCast_Membership::generate_ack[4] - (%d:%d)\n", - // next_ack.next_expected, - // next_ack.highest_received)); - - return 0; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Unbounded_Set; -template class ACE_Unbounded_Set_Iterator; -template class ACE_Node; - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/RMCast/RMCast_Membership.h b/ace/RMCast/RMCast_Membership.h deleted file mode 100644 index d6bbbe503f9..00000000000 --- a/ace/RMCast/RMCast_Membership.h +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast_Membership.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_MEMBERSHIP_H -#define ACE_RMCAST_MEMBERSHIP_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" -#include "ace/Containers.h" -#include "ace/Synch_Traits.h" -#include "ace/Thread_Mutex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_RMCast_Proxy; - -/// Track peer membership -/** - * Reliable senders of events need to know exactly how many peers are - * receiving the events, and how many events has each peer received so - * far. - * This class uses the Join, Leave and Ack messages to build that - * information, it also summarizes the Ack events and propagate only - * the global info to the upper layer. - */ -class ACE_RMCast_Export ACE_RMCast_Membership : public ACE_RMCast_Module -{ -public: - /// Constructor - ACE_RMCast_Membership (void); - - /// Destructor - virtual ~ACE_RMCast_Membership (void); - - /// Return 1 if there are still members in the group - int has_members (void); - - /// Receive an process an Ack message - /** - * After receiving the Ack message we find out what is the lowest - * sequence number received in order among all the acks received by - * the proxies in the collection. We also find out what is the - * highest sequence number received by any proxy. - * We only propagate that information back to the upper layer, and - * then only if there are any news since the last Ack. - */ - virtual int ack (ACE_RMCast::Ack &); - - /// Add a new member to the collection, using the field in - /// the Join message - virtual int join (ACE_RMCast::Join &); - - /// Remove a member from the collection, using the field in - /// the Join message - virtual int leave (ACE_RMCast::Leave &); - -private: - /// Generate an Ack message, normally due to changes in the - /// collection, such as new proxys joining or leaving - int generate_ack (ACE_RMCast_Proxy *proxy); - - /// Compute an Ack message to propagate to the upper layers. - int compute_ack_i (ACE_RMCast_Proxy *source, - ACE_RMCast::Ack &next_ack); - -protected: - /// Use an unbounded set to maintain the collection of proxies. - typedef ACE_Unbounded_Set Proxy_Collection; - typedef ACE_Unbounded_Set_Iterator Proxy_Iterator; - - /// The collection of proxies - Proxy_Collection proxies_; - - /// The smallest value of next_expected for all the proxies - ACE_UINT32 next_expected_; - - /// The highest value of highest_received for all the proxies - ACE_UINT32 highest_received_; - - /// Synchronization - ACE_SYNCH_MUTEX mutex_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Membership.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_MEMBERSHIP_H */ diff --git a/ace/RMCast/RMCast_Membership.i b/ace/RMCast/RMCast_Membership.i deleted file mode 100644 index b513c2d5141..00000000000 --- a/ace/RMCast/RMCast_Membership.i +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Membership::ACE_RMCast_Membership (void) - : next_expected_ (0) - , highest_received_ (0) -{ -} diff --git a/ace/RMCast/RMCast_Module.cpp b/ace/RMCast/RMCast_Module.cpp deleted file mode 100644 index d2b954ee03b..00000000000 --- a/ace/RMCast/RMCast_Module.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Module.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Module.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Module, "$Id$") - -ACE_RMCast_Module::~ACE_RMCast_Module (void) -{ -} - -int -ACE_RMCast_Module::next (ACE_RMCast_Module *next) -{ - if (this->next_ != 0 && next != 0) - return 1; - this->next_ = next; - return 0; -} - -ACE_RMCast_Module * -ACE_RMCast_Module::next (void) const -{ - return this->next_; -} - -int -ACE_RMCast_Module::open (void) -{ - if (this->next () != 0) - return this->next ()->open (); - return 0; -} - -int -ACE_RMCast_Module::close (void) -{ - if (this->next () != 0) - return this->next ()->close (); - return 0; -} - -int -ACE_RMCast_Module::data (ACE_RMCast::Data &data) -{ - if (this->next () != 0) - return this->next ()->data (data); - return 0; -} - -int -ACE_RMCast_Module::poll (ACE_RMCast::Poll &poll) -{ - if (this->next () != 0) - return this->next ()->poll (poll); - return 0; -} - -int -ACE_RMCast_Module::ack_join (ACE_RMCast::Ack_Join &ack_join) -{ - if (this->next () != 0) - return this->next ()->ack_join (ack_join); - return 0; -} - -int -ACE_RMCast_Module::ack_leave (ACE_RMCast::Ack_Leave &ack_leave) -{ - if (this->next () != 0) - return this->next ()->ack_leave (ack_leave); - return 0; -} - -int -ACE_RMCast_Module::ack (ACE_RMCast::Ack &ack) -{ - if (this->next () != 0) - return this->next ()->ack (ack); - return 0; -} - -int -ACE_RMCast_Module::join (ACE_RMCast::Join &join) -{ - if (this->next () != 0) - return this->next ()->join (join); - return 0; -} - -int -ACE_RMCast_Module::leave (ACE_RMCast::Leave &leave) -{ - if (this->next () != 0) - return this->next ()->leave (leave); - return 0; -} diff --git a/ace/RMCast/RMCast_Module.h b/ace/RMCast/RMCast_Module.h deleted file mode 100644 index 8497b367776..00000000000 --- a/ace/RMCast/RMCast_Module.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast_Module.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_MODULE_H -#define ACE_RMCAST_MODULE_H -#include /**/ "ace/pre.h" - -#include "RMCast.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Message_Block; -class ACE_Time_Value; - -//! Reliable Multicast Module -/*! - The reliable multicast protocol is implemented as a stack of - "Modules" each one performing one specific task. In short, this is - an instance of the pipes-and-filters architectural pattern. -*/ -class ACE_RMCast_Export ACE_RMCast_Module -{ -public: - //! Constructor - ACE_RMCast_Module (void); - - //! Destructor - virtual ~ACE_RMCast_Module (void); - - //! Modifier for the next element in the stack - virtual int next (ACE_RMCast_Module *next); - - //! Accesor for the next element in the stack - virtual ACE_RMCast_Module* next (void) const; - - //! Initialize the module, setting up the next module - virtual int open (void); - - //! Close the module. - virtual int close (void); - - //! Push data through the stack - virtual int data (ACE_RMCast::Data &); - - //! Push a polling request through the stack - virtual int poll (ACE_RMCast::Poll &); - - //! Push a message to ack a join request through the stack - virtual int ack_join (ACE_RMCast::Ack_Join &); - - //! Push a message to ack a leave request through the stack - virtual int ack_leave (ACE_RMCast::Ack_Leave &); - - //! Push an ack mesage through the stack - virtual int ack (ACE_RMCast::Ack &); - - //! Push a join message through the stack - virtual int join (ACE_RMCast::Join &); - - //! Push a leave message through the stack - virtual int leave (ACE_RMCast::Leave &); - -private: - //! The next element in the stack - ACE_RMCast_Module *next_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Module.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_MODULE_H */ diff --git a/ace/RMCast/RMCast_Module.i b/ace/RMCast/RMCast_Module.i deleted file mode 100644 index af299d706e3..00000000000 --- a/ace/RMCast/RMCast_Module.i +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Module::ACE_RMCast_Module (void) - : next_ (0) -{ -} diff --git a/ace/RMCast/RMCast_Module_Factory.cpp b/ace/RMCast/RMCast_Module_Factory.cpp deleted file mode 100644 index a693c0f0bf5..00000000000 --- a/ace/RMCast/RMCast_Module_Factory.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -#include "RMCast_Module_Factory.h" - -ACE_RCSID(RMCast, RMCast_Module_Factory, "$Id$") - -ACE_RMCast_Module_Factory::~ACE_RMCast_Module_Factory (void) -{ -} diff --git a/ace/RMCast/RMCast_Module_Factory.h b/ace/RMCast/RMCast_Module_Factory.h deleted file mode 100644 index eada18f8aca..00000000000 --- a/ace/RMCast/RMCast_Module_Factory.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast_Module_Factory.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_MODULE_FACTORY_H -#define ACE_RMCAST_MODULE_FACTORY_H -#include /**/ "ace/pre.h" - -#include "RMCast.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_RMCast_Module; -class ACE_RMCast_IO_UDP; - -//! Create Module stacks -/*! - * Different application will probably require different - * configurations in their Module stack, some will just want best - * effort semantics. Others will use Reliable communication with a - * maximum retransmission time. Furthermore, applications may want to - * receive messages in send order, or just as soon as they are - * received. - * Obviously most applications will want to change want happens once a - * message is completely received. - * - * To achieve all this flexibility the IO layer uses this factory to - * create the full stack of Modules corresponding to a single - * consumer. - * To keep the complexity under control the intention is to create - * helper Factories, such as Reliable_Module_Factory where - * applications only need to customize a few features. - */ -class ACE_RMCast_Export ACE_RMCast_Module_Factory -{ -public: - //! Destructor - virtual ~ACE_RMCast_Module_Factory (void); - - //! Create a new proxy - virtual ACE_RMCast_Module *create (void) = 0; - - //! Destroy a proxy - /*! - * Some factories may allocate modules from a pool, or return the - * same module for all proxies. Consequently, only the factory - * knows how to destroy them. - */ - virtual void destroy (ACE_RMCast_Module *) = 0; -}; - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_MODULE_FACTORY_H */ diff --git a/ace/RMCast/RMCast_Partial_Message.cpp b/ace/RMCast/RMCast_Partial_Message.cpp deleted file mode 100644 index 45718e2ce45..00000000000 --- a/ace/RMCast/RMCast_Partial_Message.cpp +++ /dev/null @@ -1,217 +0,0 @@ -// $Id$ - -#include "RMCast_Partial_Message.h" -#include "ace/OS_NS_string.h" - -#if !defined (__ACE_INLINE__) -#include "RMCast_Partial_Message.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Partial_Message, "$Id$") - -ACE_RMCast_Partial_Message:: -ACE_RMCast_Partial_Message (ACE_UINT32 message_size) - : max_hole_count_ (ACE_RMCAST_DEFAULT_HOLE_COUNT), - hole_count_ (1) -{ - ACE_NEW (this->hole_list_, - ACE_RMCast_Partial_Message::Hole[this->max_hole_count_]); - this->hole_list_[0].start = 0; - this->hole_list_[0].end = message_size; - - this->message_body_.size (message_size); - this->message_body_.wr_ptr (message_size); -} - -ACE_RMCast_Partial_Message:: -~ACE_RMCast_Partial_Message (void) -{ - delete[] this->hole_list_; -} - -int -ACE_RMCast_Partial_Message::fragment_received (ACE_UINT32 message_size, - ACE_UINT32 offset, - ACE_Message_Block *mb) -{ - if (this->message_body_.length () != message_size) - { - // ACE_DEBUG ((LM_DEBUG, - // "Partial_Message::fragment_received - " - // "invalid message length\n")); - return -1; - } - - // Just copy the data... - char *rd_ptr = this->message_body_.rd_ptr () + offset; - size_t total_length = 0; - { - for (const ACE_Message_Block *i = mb; i != 0; i = i->cont ()) - { - if (rd_ptr + i->length () > this->message_body_.wr_ptr ()) - { - // ACE_DEBUG ((LM_DEBUG, - // "Partial_Message::fragment_received - " - // "invalid payload length\n")); - return -1; - } - ACE_OS::memcpy (rd_ptr, i->rd_ptr (), i->length ()); - rd_ptr += i->length (); - total_length += i->length (); - } - } - - // The algorithm works like this: - // - // For each hole we determine if there is an intersection between - // the hole and the incoming fragment. If there is none we do - // nothing (actually since the holes are ordered we can stop the - // iteration if the - - ACE_UINT32 start = offset; - ACE_UINT32 end = ACE_static_cast (ACE_UINT32, - offset + total_length); - - while (start != end && this->hole_count_ != 0) - { - for (size_t i = 0; i < this->hole_count_; ++i) - { - Hole& hole = this->hole_list_[i]; - - // First check if the new data insersects the hole... - if (end <= hole.start) - return 0; - if (start >= hole.end) - { - if (i == this->hole_count_ - 1) - return 0; - else - continue; - } - - // The hole and the new fragment intersect, we have to - // update the hole list. - // - // There are only three cases for the value: - // start < hole.start - // start == hole.start - // hole.start < start < hole.end - // - // But the code for both start == hole.start and start < - // hole.start is identical.... - - if (start <= hole.start) - { - if (end < hole.end) - { - // NOTE: hole.start < end, because of previous test - - // In this case we shrink the hole, but it is not - // removed! - hole.start = end; - return 0; - } - else // end >= hole.end - { - start = hole.end; - // We remove the hole, and continue the iteration... - if (this->remove_hole (i) == -1) - return -1; - break; - } - } - else // hole.start < start < hole.end - { - if (end >= hole.end) - { - // Just adjust the size of the hole... - ACE_UINT32 tmp = hole.end; - hole.end = start; - start = tmp; - break; - } - else // if (end < hole.end) - { - // Nasty, we need to insert a new hole... - if (this->insert_hole (i, end, hole.end) == -1) - return -1; - // and change the old hole... - // NOTE: we have to refetch it because the array may - // have been reallocated! - this->hole_list_[i].end = start; - return 0; - } - } - } - } - return 0; - // @@ OLD COMMENTS, the algorithm has changed since! - // There are several cases: - // - // 1) The fragment is completely contained in data already received, - // nothing changes in this case. - // - // 2) Part of the fragment is contained in data already received and - // part is new data: - // 2.1) The new data closes a hole, remove it from the list - // 2.2) The beginning of the new fragment is the new data, reduce - // the size of the hole - // 2.3) The end of the new fragment is the new data, increment - // the size of the received block - // - // 3) The fragment is completely contained in a hole - // 3.1) It closes the hole, remove it from the list - // 3.2) It starts at the beginning of a hole, grow the received - // block - // 3.3) It ends at the end of a hole, reduce the hole size - // 3.4) It is in the middle of a hole, insert a new hole - // -} - -int -ACE_RMCast_Partial_Message::insert_hole (size_t i, - ACE_UINT32 start, - ACE_UINT32 end) -{ - // ACE_DEBUG ((LM_DEBUG, - // "Partial_Message::insert_hole %d = [%d,%d]\n", - // i, start, end)); - if (this->hole_count_ + 1 > this->max_hole_count_) - { - this->max_hole_count_ *= 2; - Hole *tmp; - ACE_NEW_RETURN (tmp, Hole[this->max_hole_count_], -1); - for (size_t j = 0; j != this->hole_count_; ++j) - { - tmp[j] = this->hole_list_[j]; - } - delete[] this->hole_list_; - this->hole_list_ = tmp; - } - if (this->hole_count_ != 0) - { - for (size_t j = this->hole_count_ - 1; j >= i + 1; --j) - { - this->hole_list_[j+1] = this->hole_list_[j]; - } - } - - this->hole_list_[i + 1].start = start; - this->hole_list_[i + 1].end = end; - this->hole_count_++; - - return 0; -} - -int -ACE_RMCast_Partial_Message::remove_hole (size_t i) -{ - // ACE_DEBUG ((LM_DEBUG, - // "Partial_Message::remove_hole %d\n", - // i)); - for (size_t j = i; j != this->hole_count_ - 1; ++j) - this->hole_list_[j] = this->hole_list_[j + 1]; - - this->hole_count_--; - return 0; -} diff --git a/ace/RMCast/RMCast_Partial_Message.h b/ace/RMCast/RMCast_Partial_Message.h deleted file mode 100644 index 0c14cd7828a..00000000000 --- a/ace/RMCast/RMCast_Partial_Message.h +++ /dev/null @@ -1,102 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = DESCRIPTION -// Helper class used in the reassembly layer of the realiable -// multicast library. -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_PARTIAL_MESSAGE_H -#define ACE_RMCAST_PARTIAL_MESSAGE_H -#include /**/ "ace/pre.h" - -#include "RMCast_Export.h" -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#ifndef ACE_RMCAST_DEFAULT_HOLE_COUNT -#define ACE_RMCAST_DEFAULT_HOLE_COUNT 16 -#endif /* ACE_RMCAST_DEFAULT_HOLE_COUNT */ - -//! Represent a partially received message in the -//! ACE_RMCast_Reassembly module -/*! - * This class provides temporary storage for the fragments as they are - * received in the ACE_RMCast_Reassembly module. It also keeps track - * of what portions of the message are still missing. - */ -class ACE_RMCast_Export ACE_RMCast_Partial_Message -{ -public: - //! Constructor, reserve enough memory for the complete message - ACE_RMCast_Partial_Message (ACE_UINT32 message_size); - - //! Destructor - ~ACE_RMCast_Partial_Message (void); - - //! Process a fragment - /*! - * A fragment starting at has been received, copy the - * fragment contents and update the list of holes. - */ - int fragment_received (ACE_UINT32 message_size, - ACE_UINT32 offset, - ACE_Message_Block *mb); - - //! Return 1 if the message is complete - int is_complete (void) const; - - //! Return the body of the message, the memory is *not* owned by the - //! caller - ACE_Message_Block *message_body (void); - -private: - //! Insert a new hole into the list - /*! - * The class keeps an array to represent the missing portions of the - * message. This method inserts a new hole, i.e. a new element in - * the array at index . The and arguments represent - * the offsets of the missing portion of the message. - */ - int insert_hole (size_t i, - ACE_UINT32 start, - ACE_UINT32 end); - - //! Remove a hole from the list - int remove_hole (size_t i); - -private: - //! Maintain the message storage - ACE_Message_Block message_body_; - - //! Represent a missing portion of a message - struct Hole - { - //! Offset where the missing portion of the message starts - ACE_UINT32 start; - //! Offset where the missing portion of the message ends - ACE_UINT32 end; - }; - - //! Implement a growing array of Hole structures - //@{ - Hole *hole_list_; - size_t max_hole_count_; - size_t hole_count_; - //@} -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Partial_Message.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_PARTIAL_MESSAGE_H */ diff --git a/ace/RMCast/RMCast_Partial_Message.i b/ace/RMCast/RMCast_Partial_Message.i deleted file mode 100644 index 7be89aa1932..00000000000 --- a/ace/RMCast/RMCast_Partial_Message.i +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ - -ACE_INLINE int -ACE_RMCast_Partial_Message::is_complete (void) const -{ - return (this->hole_count_ == 0) - || (this->hole_count_ == 1 - && this->hole_list_[0].start == this->hole_list_[0].end); -} - -ACE_INLINE ACE_Message_Block * -ACE_RMCast_Partial_Message::message_body (void) -{ - return &this->message_body_; -} diff --git a/ace/RMCast/RMCast_Proxy.cpp b/ace/RMCast/RMCast_Proxy.cpp deleted file mode 100644 index 6aa870ea702..00000000000 --- a/ace/RMCast/RMCast_Proxy.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Proxy.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Proxy.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Proxy, "$Id$") - -ACE_RMCast_Proxy::~ACE_RMCast_Proxy (void) -{ -} - -ACE_UINT32 -ACE_RMCast_Proxy::next_expected (void) const -{ - return this->next_expected_; -} - -ACE_UINT32 -ACE_RMCast_Proxy::highest_received (void) const -{ - return this->highest_received_; -} - -int -ACE_RMCast_Proxy::ack (ACE_RMCast::Ack &ack) -{ - this->next_expected_ = ack.next_expected; - this->highest_received_ = ack.highest_received; - return this->ACE_RMCast_Module::ack (ack); -} - -int -ACE_RMCast_Proxy::reply_ack_join (ACE_RMCast::Ack_Join &ack_join) -{ - if (this->next_expected_ < ack_join.next_sequence_number) - { - this->next_expected_ = ack_join.next_sequence_number; - this->highest_received_ = ack_join.next_sequence_number; - } - return 0; -} diff --git a/ace/RMCast/RMCast_Proxy.h b/ace/RMCast/RMCast_Proxy.h deleted file mode 100644 index 303a5e8ffe4..00000000000 --- a/ace/RMCast/RMCast_Proxy.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast_Proxy.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_PROXY_H -#define ACE_RMCAST_PROXY_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Message_Block; -class ACE_Time_Value; - -//! Local representation for remote peers -/*! - Both senders and receivers in the multicast group need to maintain - explicit representations of their "peers". For example, a sender - needs to know the list of all the receivers and what messages they - have reported as successfully received. - Likewise, the receiver needs to maintain separate state for each - remote sender, and must be able to disconnect from all of them - gracefully when needed. - The RMCast_Proxy class is an opaque representation of such a peer, - and hides all the networking details from the rest of the system. -*/ -class ACE_RMCast_Export ACE_RMCast_Proxy : public ACE_RMCast_Module -{ -public: - //! Constructor - ACE_RMCast_Proxy (void); - // Constructor - - //! Destructor - virtual ~ACE_RMCast_Proxy (void); - - //! Return the next sequence number expected by the peer. Only - //! applies to remote receiver proxies. - /*! - * Please read the documentation in ACE_RMCast::Ack - */ - virtual ACE_UINT32 next_expected (void) const; - - //! Return the highest sequence number successfully received. - //! Only applies to remote receiver proxies. - /*! - * Please read the documentation in ACE_RMCast::Ack - */ - virtual ACE_UINT32 highest_received (void) const; - - //@{ - //! Send messages directly to the peer. - /*! - * Send a message directly to the peer, i.e. the message is not - * sent through the multicast group and it may not be processed by - * all the layers in the stack. - */ - virtual int reply_data (ACE_RMCast::Data &) = 0; - virtual int reply_poll (ACE_RMCast::Poll &) = 0; - virtual int reply_ack_join (ACE_RMCast::Ack_Join &); - virtual int reply_ack_leave (ACE_RMCast::Ack_Leave &) = 0; - virtual int reply_ack (ACE_RMCast::Ack &) = 0; - virtual int reply_join (ACE_RMCast::Join &) = 0; - virtual int reply_leave (ACE_RMCast::Leave &) = 0; - //@} - - /*! - * Proxies process the ACK sequence numbers to cache the ack - * information from the peer. - */ - virtual int ack (ACE_RMCast::Ack &); - -private: - //@{ - //! Cache the sequence numbers reported from the remote peer using - //! Ack messages - ACE_UINT32 next_expected_; - ACE_UINT32 highest_received_; - //@} -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Proxy.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_PROXY_H */ diff --git a/ace/RMCast/RMCast_Proxy.i b/ace/RMCast/RMCast_Proxy.i deleted file mode 100644 index 6fee09fe9e5..00000000000 --- a/ace/RMCast/RMCast_Proxy.i +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Proxy::ACE_RMCast_Proxy (void) - : next_expected_ (0) - , highest_received_ (0) -{ -} diff --git a/ace/RMCast/RMCast_Reassembly.cpp b/ace/RMCast/RMCast_Reassembly.cpp deleted file mode 100644 index 6da9f865697..00000000000 --- a/ace/RMCast/RMCast_Reassembly.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// $Id$ - -#include "RMCast_Reassembly.h" -#include "RMCast_Partial_Message.h" -#include "ace/Message_Block.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -ACE_RCSID(RMCast, RMCast_Reassembly, "$Id$") - -ACE_RMCast_Reassembly:: -ACE_RMCast_Reassembly (void) - : ACE_RMCast_Module () -{ -} - -ACE_RMCast_Reassembly::~ACE_RMCast_Reassembly (void) -{ - (void) this->close_i (); -} - -/** - * - * We cleanup the resources in the destructor - */ -int -ACE_RMCast_Reassembly::close () -{ - this->close_i (); - return this->ACE_RMCast_Module::close (); -} - -int -ACE_RMCast_Reassembly::data (ACE_RMCast::Data &data) -{ - if (this->next () == 0) - return 0; - - // ACE_DEBUG ((LM_DEBUG, - // "Reassembly::data - %d,%d,%d\n", - // data.sequence_number, - // data.total_size, - // data.fragment_offset)); - - if (data.payload->length () + data.fragment_offset > data.total_size) - { - ACE_ERROR ((LM_ERROR, - "RMCast_Reassembly::data - invalid size\n")); - return -1; // Corrupt message? - } - - ACE_RMCast_Partial_Message *message; - - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - if (this->messages_.find (data.sequence_number, message) == -1) - { - ACE_NEW_RETURN (message, - ACE_RMCast_Partial_Message (data.total_size), - -1); - - // ACE_DEBUG ((LM_DEBUG, - // "Reassembly::data - new message\n")); - if (this->messages_.bind (data.sequence_number, - message) == -1) - return -1; // Internal error? - } - - if (message->fragment_received (data.total_size, - data.fragment_offset, - data.payload) == -1) - { - // ACE_DEBUG ((LM_DEBUG, - // "Error in fragment_received\n")); - return -1; - } - - if (!message->is_complete ()) - { - // ACE_DEBUG ((LM_DEBUG, - // "Reassembly::data - message still incomplete\n")); - return 0; - } - - if (this->messages_.unbind (data.sequence_number) == -1) - { - // ACE_DEBUG ((LM_DEBUG, - // "Reassembly::data - message now complete\n")); - return -1; - } - } - - // Push the message... - ACE_RMCast::Data downstream_data; - downstream_data.source = data.source; - downstream_data.sequence_number = data.sequence_number; - downstream_data.total_size = ACE_static_cast( - ACE_UINT32, - message->message_body ()->length ()); - downstream_data.fragment_offset = 0; - downstream_data.payload = message->message_body (); - - int r = this->next ()->data (downstream_data); - - delete message; - - return r; -} - -void -ACE_RMCast_Reassembly::close_i (void) -{ - for (Message_Map_Iterator i = this->messages_.begin (); - i != this->messages_.end (); - ++i) - { - ACE_RMCast_Partial_Message *message = (*i).int_id_; - if (message != 0) - delete message; - } - this->messages_.unbind_all (); -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Hash_Map_Manager; -template class ACE_Hash_Map_Manager_Ex,ACE_Equal_To,ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator; -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 >; -template class ACE_Hash_Map_Entry; - -template class ACE_Less_Than; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Hash_Map_Manager -#pragma instantiate ACE_Hash_Map_Manager_Ex,ACE_Equal_To,ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator -#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_Map_Iterator_Base_Ex,ACE_Equal_To,ACE_Null_Mutex > -#pragma instantiate ACE_Hash_Map_Entry - -#pragma instantiate ACE_Less_Than -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - diff --git a/ace/RMCast/RMCast_Reassembly.h b/ace/RMCast/RMCast_Reassembly.h deleted file mode 100644 index f6fc8989719..00000000000 --- a/ace/RMCast/RMCast_Reassembly.h +++ /dev/null @@ -1,71 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = DESCRIPTION -// The reassembly task for the reliable multicast library -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_REASSEMBLY_H -#define ACE_RMCAST_REASSEMBLY_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/Synch_Traits.h" -#include "ace/Thread_Mutex.h" -#include "ace/Null_Mutex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_RMCast_Partial_Message; - -//! Reassemble multiple data fragments into a single data message -/*! - Data messages may not fit in a single MTU in the transport layer, in - that case the application configure a RMCast_Fragment module on the - sender side. On the receiver side this layer reassemble the - messages sent from a single source, and passes the messages - up the stream. -*/ -class ACE_RMCast_Export ACE_RMCast_Reassembly : public ACE_RMCast_Module -{ -public: - //! Constructor - ACE_RMCast_Reassembly (void); - - //! Destructor - virtual ~ACE_RMCast_Reassembly (void); - - // = The ACE_RMCast_Module methods - virtual int close (void); - virtual int data (ACE_RMCast::Data &data); - -private: - /// Cleanup resources, but do not close the other modules in the - /// stack - void close_i (void); - -private: - //! A mutex used to synchronize all the internal operations. - ACE_SYNCH_MUTEX mutex_; - typedef - ACE_Hash_Map_Manager - Message_Map; - typedef - ACE_Hash_Map_Iterator - Message_Map_Iterator; - - //! A map, indexed by sequence number, of the partially received - //! messages. - Message_Map messages_; -}; - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_REASSEMBLY_H */ diff --git a/ace/RMCast/RMCast_Receiver_Module.cpp b/ace/RMCast/RMCast_Receiver_Module.cpp deleted file mode 100644 index 05e6ceb8c7f..00000000000 --- a/ace/RMCast/RMCast_Receiver_Module.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Receiver_Module.h" -#include "RMCast_Proxy.h" -#include "ace/Log_Msg.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Receiver_Module.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Receiver_Module, "$Id$") - -ACE_RMCast_Receiver_Module::~ACE_RMCast_Receiver_Module (void) -{ -} - -int -ACE_RMCast_Receiver_Module::data (ACE_RMCast::Data &data) -{ - switch (this->state_) - { - case RS_NON_EXISTENT: - case RS_JOINING: - if (data.source != 0) - { - //ACE_DEBUG ((LM_DEBUG, - // "Receiver_Module::data - joining\n")); - - this->state_ = RS_JOINING; - ACE_RMCast::Join join; - if (data.source->reply_join (join) != 0) - this->leaving (data.source); - } - break; - - case RS_JOINED: - // ACE_DEBUG ((LM_DEBUG, - // "Receiver_Module::data - joined\n")); - if (this->ACE_RMCast_Module::data (data) != 0) - this->leaving (data.source); - break; - - default: - case RS_LEAVING: - this->leaving (data.source); - break; - } - return 0; -} - -int -ACE_RMCast_Receiver_Module::poll (ACE_RMCast::Poll &poll) -{ - switch (this->state_) - { - case RS_NON_EXISTENT: - case RS_JOINING: - if (poll.source != 0) - { - this->state_ = RS_JOINING; - ACE_RMCast::Join join; - if (poll.source->reply_join (join) != 0) - this->leaving (poll.source); - } - break; - - case RS_JOINED: - if (this->ACE_RMCast_Module::poll (poll) != 0) - this->leaving (poll.source); - - default: - case RS_LEAVING: - this->leaving (poll.source); - break; - } - return 0; -} - -int -ACE_RMCast_Receiver_Module::ack_join (ACE_RMCast::Ack_Join &ack_join) -{ - switch (this->state_) - { - case RS_NON_EXISTENT: - if (ack_join.source != 0) - { - //ACE_DEBUG ((LM_DEBUG, - // "Receiver_Module::ack_join - joining\n")); - - this->state_ = RS_JOINING; - ACE_RMCast::Join join; - if (ack_join.source->reply_join (join) != 0) - this->leaving (ack_join.source); - } - break; - - case RS_JOINING: - case RS_JOINED: - //ACE_DEBUG ((LM_DEBUG, - // "Receiver_Module::ack_join - joined\n")); - - this->state_ = RS_JOINED; - if (this->ACE_RMCast_Module::ack_join (ack_join) != 0) - this->leaving (ack_join.source); - break; - - default: - case RS_LEAVING: - this->leaving (ack_join.source); - break; - } - return 0; -} - -int -ACE_RMCast_Receiver_Module::ack_leave (ACE_RMCast::Ack_Leave &ack_leave) -{ - //ACE_DEBUG ((LM_DEBUG, - // "Receiver_Module::ack_leave\n")); - - (void) this->ACE_RMCast_Module::ack_leave (ack_leave); - - // Returning -1 should remove the Proxy from the local set - return -1; -} - -int -ACE_RMCast_Receiver_Module::ack (ACE_RMCast::Ack &) -{ - return -1; -} - -int -ACE_RMCast_Receiver_Module::join (ACE_RMCast::Join &) -{ - return -1; -} - -int -ACE_RMCast_Receiver_Module::leave (ACE_RMCast::Leave &) -{ - return -1; -} - -void -ACE_RMCast_Receiver_Module::leaving (ACE_RMCast_Proxy *proxy) -{ - this->state_ = RS_LEAVING; - if (proxy != 0) - { - ACE_RMCast::Leave leave; - (void) proxy->reply_leave (leave); - } - (void) this->close (); -} diff --git a/ace/RMCast/RMCast_Receiver_Module.h b/ace/RMCast/RMCast_Receiver_Module.h deleted file mode 100644 index 112ad768696..00000000000 --- a/ace/RMCast/RMCast_Receiver_Module.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace/RMCast -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_RECEIVER_MODULE_H -#define ACE_RMCAST_RECEIVER_MODULE_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Keep track of the receiver module. -/** - * A receiver proxy must reject invalid messages and communicate with - * the sender to join and leave the multicast group. - * - * This module performs all the task related to - * - */ -class ACE_RMCast_Export ACE_RMCast_Receiver_Module : public ACE_RMCast_Module -{ -public: - //! Constructor - ACE_RMCast_Receiver_Module (void); - - //! Destructor - virtual ~ACE_RMCast_Receiver_Module (void); - - virtual int data (ACE_RMCast::Data &); - virtual int poll (ACE_RMCast::Poll &); - virtual int ack_join (ACE_RMCast::Ack_Join &); - virtual int ack_leave (ACE_RMCast::Ack_Leave &); - virtual int ack (ACE_RMCast::Ack &); - virtual int join (ACE_RMCast::Join &); - virtual int leave (ACE_RMCast::Leave &); - - /// Simple enum used to describe the receiver state transitions - /** - * Receivers go through several states before they can fully accept - * messages, the following comments describe those states, as well as - * the possible transitions - * This configuration is pesimistic, any invalid message is cause - * enough to reclaim all the resources. This partially addresses - * situations where either accidentally or intentionally a sender is - * multicasting packets to the wrong group. - - - NON_EXISTENT JOINING JOINED LEAVING
- ----------------------------------------------------------------
-
- DATA JOINING JOINING JOINED LEAVING
- Send/Join Send/Join Recv/Data Send/Leave
-
- POLL JOINING JOINING JOINED LEAVING
- Send/Join Send/Join Send/Ack Send/Leave
-
- ACK_JOIN JOINING JOINED JOINED LEAVING
- Send/Join Receive Msg Receive Msg Send/Leave
-
- ACK_LEAVE NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT
- Noop Destroy Destroy Destroy
-
- ACK NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT
- Noop Destroy Destroy Destroy
-
- JOIN NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT
- Noop Destroy Destroy Destroy
-
- LEAVE NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT
- Noop Destroy Destroy Destroy
-
-
- */ - enum Receiver_State - { - RS_NON_EXISTENT, - RS_JOINING, - RS_JOINED, - RS_LEAVING - }; - -private: - /// Enter the leaving state, prepare for termination - void leaving (ACE_RMCast_Proxy *proxy); - -private: - /// The current state of the receiver - int state_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Receiver_Module.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_RECEIVER_MODULE_H */ diff --git a/ace/RMCast/RMCast_Receiver_Module.i b/ace/RMCast/RMCast_Receiver_Module.i deleted file mode 100644 index 6662f7f048a..00000000000 --- a/ace/RMCast/RMCast_Receiver_Module.i +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Receiver_Module::ACE_RMCast_Receiver_Module (void) - : state_ (ACE_RMCast_Receiver_Module::RS_NON_EXISTENT) -{ -} diff --git a/ace/RMCast/RMCast_Reliable_Factory.cpp b/ace/RMCast/RMCast_Reliable_Factory.cpp deleted file mode 100644 index b471af89c3d..00000000000 --- a/ace/RMCast/RMCast_Reliable_Factory.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -#include "RMCast_Reliable_Factory.h" -#include "RMCast_Receiver_Module.h" -#include "RMCast_Reassembly.h" -#include "RMCast_Reordering.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Reliable_Factory.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Reliable_Factory, "$Id$") - -ACE_RMCast_Reliable_Factory::~ACE_RMCast_Reliable_Factory (void) -{ -} - -ACE_RMCast_Module* -ACE_RMCast_Reliable_Factory::create (void) -{ - ACE_RMCast_Module *receiver; - ACE_NEW_RETURN (receiver, ACE_RMCast_Receiver_Module, 0); - - ACE_RMCast_Module *reassembly; - ACE_NEW_RETURN (reassembly, ACE_RMCast_Reassembly, 0); - - ACE_RMCast_Module *reordering; - ACE_NEW_RETURN (reordering, ACE_RMCast_Reordering, 0); - - ACE_RMCast_Module *user = this->factory_->create (); - if (user == 0) - { - delete receiver; - delete reordering; - delete reassembly; - return 0; - } - receiver->next (reassembly); - reassembly->next (reordering); - reordering->next (user); - return receiver; -} - -void -ACE_RMCast_Reliable_Factory::destroy (ACE_RMCast_Module *receiver) -{ - ACE_RMCast_Module *reassembly = receiver->next (); - ACE_RMCast_Module *reordering = reassembly->next (); - ACE_RMCast_Module *user = reordering->next (); - this->factory_->destroy (user); - delete reordering; - delete reassembly; - delete receiver; -} diff --git a/ace/RMCast/RMCast_Reliable_Factory.h b/ace/RMCast/RMCast_Reliable_Factory.h deleted file mode 100644 index 8f9b9aa6aa1..00000000000 --- a/ace/RMCast/RMCast_Reliable_Factory.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast_Reliable_Factory.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_RELIABLE_FACTORY_H -#define ACE_RMCAST_RELIABLE_FACTORY_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module_Factory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Implement an ACE_RMCast_Module_Factory that "creates" a single -/// object. -/** - * Many applications (and even some internal components), will use a - * single ACE_RMCast_Module to process all the events, for example, a - * receiver may decide to use the same ACE_RMCast_Module to process - * all incoming events, instead of using one per remote sender. - */ -class ACE_RMCast_Export ACE_RMCast_Reliable_Factory : public ACE_RMCast_Module_Factory -{ -public: - /// Constructor - ACE_RMCast_Reliable_Factory (ACE_RMCast_Module_Factory *factory); - - //! Destructor - virtual ~ACE_RMCast_Reliable_Factory (void); - - /** - * The create() method will return always @c reliable. - */ - virtual ACE_RMCast_Module *create (void); - virtual void destroy (ACE_RMCast_Module *); - -private: - /// Delegate on another factory to create the user module - ACE_RMCast_Module_Factory *factory_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Reliable_Factory.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_RELIABLE_FACTORY_H */ diff --git a/ace/RMCast/RMCast_Reliable_Factory.i b/ace/RMCast/RMCast_Reliable_Factory.i deleted file mode 100644 index 47ba22754ec..00000000000 --- a/ace/RMCast/RMCast_Reliable_Factory.i +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Reliable_Factory:: - ACE_RMCast_Reliable_Factory (ACE_RMCast_Module_Factory *factory) - : factory_ (factory) -{ -} diff --git a/ace/RMCast/RMCast_Reordering.cpp b/ace/RMCast/RMCast_Reordering.cpp deleted file mode 100644 index 1aebf27d8ee..00000000000 --- a/ace/RMCast/RMCast_Reordering.cpp +++ /dev/null @@ -1,179 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Reordering.h" -#include "RMCast_Proxy.h" -#include "ace/Guard_T.h" -#include "ace/Message_Block.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Reordering.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Reordering, "$Id$") - -ACE_RMCast_Reordering::~ACE_RMCast_Reordering (void) -{ -} - -int -ACE_RMCast_Reordering::close (void) -{ - Messages_Iterator i = this->messages_.begin (); - Messages_Iterator end = this->messages_.end (); - - while (i != end) - { - ACE_Message_Block::release ((*i).item ().payload); - this->messages_.unbind ((*i).key ()); - i = this->messages_.begin (); - } - return this->ACE_RMCast_Module::close (); -} - -int -ACE_RMCast_Reordering::data (ACE_RMCast::Data &data) -{ - int must_ack = 0; - int result = 0; - ACE_RMCast::Ack ack; - - //ACE_DEBUG ((LM_DEBUG, "Received message (%d)\n", data.sequence_number)); - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - - if (data.sequence_number < this->next_expected_) - { - // Old message. Ack with the current status (look at the end - // of this block). - must_ack = 1; - - //ACE_DEBUG ((LM_DEBUG, ".... old message is ignored\n")); - } - - else if (data.sequence_number == this->next_expected_) - { - //ACE_DEBUG ((LM_DEBUG, ".... message is in order, received\n")); - - // Accept the message, the current thread will dispatch it, so - // it is marked as accepted (using the field). - // Any other thread will not push that message because now it - // is "old". - - this->next_expected_++; - - // Right message, process as many messages as possible from - // the queue, then ack the right level... - - // NOTE: we cannot release the mutex while dispatching - // events, otherwise: how do we stop other threads from - // delivering messages out of order? I.E. what if the - // next thread receives the next message? - if (this->next () != 0) - { - result = this->next ()->data (data); - } - - // After delivering one message there may be more messages - // pending - if (result == 0) - result = this->push_queued_messages (); - - //@@ This should be strategized, for example, only Ack if - // there is a message out of order or something, otherwise - // continue with happiness. That works well for "optimistic - // models". - must_ack = 1; - } - - else - { - //ACE_DEBUG ((LM_DEBUG, ".... message out of sequence, saved\n")); - - // Out of sequence. - if (this->highest_received_ < data.sequence_number) - { - this->highest_received_ = data.sequence_number; - } - ACE_RMCast::Data new_data = data; - new_data.payload = ACE_Message_Block::duplicate (data.payload); - (void) this->messages_.bind (data.sequence_number, new_data); - // re-ack, otherwise save it and ack. - } - - ack.next_expected = this->next_expected_; - ack.highest_received = this->highest_received_; - } - - if (must_ack && data.source != 0) - (void) data.source->reply_ack (ack); - - return result; -} - -int -ACE_RMCast_Reordering::ack_join (ACE_RMCast::Ack_Join &ack_join) -{ - //ACE_DEBUG ((LM_DEBUG, "RMCast_Reordering::ack_join - <%d,%d>\n", - // this->next_expected_, - // ack_join.next_sequence_number)); - - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - if (this->next_expected_ >= ack_join.next_sequence_number) - { - // Nothing to do in this case... - return 0; - } - - Messages_Iterator i = this->messages_.begin (); - Messages_Iterator end = this->messages_.end (); - - while (i != end - && (*i).key () < ack_join.next_sequence_number) - { - ACE_Message_Block::release ((*i).item ().payload); - this->messages_.unbind ((*i).key ()); - i = this->messages_.begin (); - } - - this->next_expected_ = ack_join.next_sequence_number; - if (this->highest_received_ < ack_join.next_sequence_number) - this->highest_received_ = ack_join.next_sequence_number; - - this->push_queued_messages (); - } - - return 0; -} - -int -ACE_RMCast_Reordering::push_queued_messages (void) -{ - Messages_Iterator i = this->messages_.begin (); - Messages_Iterator end = this->messages_.end (); - - while (i != end - && (*i).key () == this->next_expected_) - { - int r = 0; - if (this->next () != 0) - { - ACE_RMCast::Data data = (*i).item (); - r = this->next ()->data (data); - } - - ACE_Message_Block::release ((*i).item ().payload); - this->messages_.unbind ((*i).key ()); - i = this->messages_.begin (); - this->next_expected_++; - if (r != 0) - return r; - } - return 0; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/RMCast/RMCast_Reordering.h b/ace/RMCast/RMCast_Reordering.h deleted file mode 100644 index 68901480ef5..00000000000 --- a/ace/RMCast/RMCast_Reordering.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace/RMCast -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_REORDERING_H -#define ACE_RMCAST_REORDERING_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" -#include "ace/RB_Tree.h" -#include "ace/Synch_Traits.h" -#include "ace/Thread_Mutex.h" -#include "ace/Null_Mutex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_RMCast_Proxy; - -/// Pass messages up in sent order -/** - * Some applications require receivers to process messages in the same - * order that messages are sent. This module buffers out of order - * messages and only delivers a message if: - * - All the previous messages have been delivered. - * - The sender sends a notification that previous messages will not - * be resent. - * - * The module also sends the Ack feedback to the sender. - * - * NOTE: This is not the same as causal or total ordering, that could - * be implemented someday, but requires a lot more than what we have - * right now. - * - */ -class ACE_RMCast_Export ACE_RMCast_Reordering : public ACE_RMCast_Module -{ -public: - /// Constructor - ACE_RMCast_Reordering (void); - - /// Destructor - virtual ~ACE_RMCast_Reordering (void); - - /// Use a Red-Black Tree to keep the queue of messages - //@{ - typedef ACE_RB_Tree,ACE_Null_Mutex> Messages; - typedef ACE_RB_Tree_Iterator,ACE_Null_Mutex> Messages_Iterator; - //@} - - /// Remove messages still pending - virtual int close (void); - - /// Process a Data message. - /** - * Process a Data message, sending the right Ack message back. - * The message is passed up only if it is in order. - */ - virtual int data (ACE_RMCast::Data &); - - /// During the join process the server informs us of the next - /// expected message - virtual int ack_join (ACE_RMCast::Ack_Join &); - -private: - /// Push any messages that are pending in the queue - int push_queued_messages (void); - -protected: - /// The reordering buffer - Messages messages_; - - /// The smallest value of next_expected for all the proxies - ACE_UINT32 next_expected_; - - /// The highest value of highest_received for all the proxies - ACE_UINT32 highest_received_; - - /// Synchronization - ACE_SYNCH_MUTEX mutex_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Reordering.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_REORDERING_H */ diff --git a/ace/RMCast/RMCast_Reordering.i b/ace/RMCast/RMCast_Reordering.i deleted file mode 100644 index ccbf852bc67..00000000000 --- a/ace/RMCast/RMCast_Reordering.i +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Reordering::ACE_RMCast_Reordering (void) - : next_expected_ (0) - , highest_received_ (0) -{ -} diff --git a/ace/RMCast/RMCast_Resend_Handler.cpp b/ace/RMCast/RMCast_Resend_Handler.cpp deleted file mode 100644 index 4bb5d717742..00000000000 --- a/ace/RMCast/RMCast_Resend_Handler.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -#include "RMCast_Resend_Handler.h" -#include "RMCast_Retransmission.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Resend_Handler.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Resend_Handler, "$Id$") - -ACE_RMCast_Resend_Handler::~ACE_RMCast_Resend_Handler (void) -{ -} - -int -ACE_RMCast_Resend_Handler::handle_timeout (const ACE_Time_Value &, - const void *) -{ - (void) this->retransmission_->resend_all (); - return 0; -} diff --git a/ace/RMCast/RMCast_Resend_Handler.h b/ace/RMCast/RMCast_Resend_Handler.h deleted file mode 100644 index 363b0ee5cc3..00000000000 --- a/ace/RMCast/RMCast_Resend_Handler.h +++ /dev/null @@ -1,44 +0,0 @@ -// $Id$ - -#ifndef ACE_RMCAST_RESEND_HANDLER_H -#define ACE_RMCAST_RESEND_HANDLER_H -#include /**/ "ace/pre.h" - -#include "RMCast_Export.h" -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_RMCast_Retransmission; - -/// Implement an adapter to resend messages in the -/// ACE_RMCast_Retransmission layer, but based on Reactor based -/// timeouts. -class ACE_RMCast_Export ACE_RMCast_Resend_Handler : public ACE_Event_Handler -{ -public: - /// Constructor, save io_udp as the Adaptee in the Adapter pattern. - ACE_RMCast_Resend_Handler (ACE_RMCast_Retransmission *retransmission); - - /// Destructor - ~ACE_RMCast_Resend_Handler (void); - - //@{ - //! Documented in ACE_Event_Handler class - virtual int handle_timeout (const ACE_Time_Value ¤t_time, - const void *act = 0); - //@} - -private: - //! The adaptee - ACE_RMCast_Retransmission *retransmission_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Resend_Handler.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_RESEND_HANDLER_H */ diff --git a/ace/RMCast/RMCast_Resend_Handler.i b/ace/RMCast/RMCast_Resend_Handler.i deleted file mode 100644 index 9ad6cd8870d..00000000000 --- a/ace/RMCast/RMCast_Resend_Handler.i +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Resend_Handler:: -ACE_RMCast_Resend_Handler (ACE_RMCast_Retransmission *r) - : retransmission_ (r) -{ -} diff --git a/ace/RMCast/RMCast_Resend_Worker.cpp b/ace/RMCast/RMCast_Resend_Worker.cpp deleted file mode 100644 index 77f41aee1fb..00000000000 --- a/ace/RMCast/RMCast_Resend_Worker.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Resend_Worker.h" -#include "RMCast_Module.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Resend_Worker.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Resend_Worker, "$Id$") - -int -ACE_RMCast_Resend_Worker::work (ACE_UINT32 const & key, - ACE_RMCast::Data const &item) -{ - if (key > this->max_sequence_number_) - return 0; - //ACE_DEBUG ((LM_DEBUG, - // "RMCast_Resend_Worker::work - message %d resent\n", - // key)); - - ACE_RMCast::Data data = item; - int r = this->next_->data (data); - if (r != 0) - return r; - this->n++; - - return 1; // @@ Stop after the first message... -} diff --git a/ace/RMCast/RMCast_Resend_Worker.h b/ace/RMCast/RMCast_Resend_Worker.h deleted file mode 100644 index 2b49f97876a..00000000000 --- a/ace/RMCast/RMCast_Resend_Worker.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#ifndef ACE_RMCAST_RESEND_WORKER_H -#define ACE_RMCAST_RESEND_WORKER_H -#include /**/ "ace/pre.h" - -#include "RMCast.h" -#include "RMCast_Copy_On_Write.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_RMCast_Module; - -/// Process an Ack message in the ACE_RMCast_Retransmission module -/** - * The retransmission module uses internal iterators, thus it needs to - * create helper Worker classes to process some messages. - */ -class ACE_RMCast_Resend_Worker - : public ACE_RMCast_Worker -{ -public: - ACE_RMCast_Resend_Worker (ACE_RMCast_Module *next, - ACE_UINT32 max_sequence_number); - - virtual int work (ACE_UINT32 const & key, - ACE_RMCast::Data const &item); - - int n; - -private: - ACE_RMCast_Module *next_; - - ACE_UINT32 max_sequence_number_; - -private: - ACE_RMCast_Resend_Worker (const ACE_RMCast_Resend_Worker&); - ACE_RMCast_Resend_Worker& operator= (const ACE_RMCast_Resend_Worker&); -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Resend_Worker.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_RESEND_WORKER_H */ diff --git a/ace/RMCast/RMCast_Resend_Worker.i b/ace/RMCast/RMCast_Resend_Worker.i deleted file mode 100644 index d609c27f006..00000000000 --- a/ace/RMCast/RMCast_Resend_Worker.i +++ /dev/null @@ -1,12 +0,0 @@ -// $Id$ - -ACE_INLINE - -ACE_RMCast_Resend_Worker:: -ACE_RMCast_Resend_Worker (ACE_RMCast_Module *next, - ACE_UINT32 max_sequence_number) - : n (0) - , next_ (next) - , max_sequence_number_ (max_sequence_number) -{ -} diff --git a/ace/RMCast/RMCast_Retransmission.cpp b/ace/RMCast/RMCast_Retransmission.cpp deleted file mode 100644 index c6f03626e39..00000000000 --- a/ace/RMCast/RMCast_Retransmission.cpp +++ /dev/null @@ -1,149 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Retransmission.h" -#include "RMCast_Proxy.h" -#include "RMCast_Ack_Worker.h" -#include "RMCast_Resend_Worker.h" -#include "ace/Message_Block.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Retransmission.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Retransmission, "$Id$") - -ACE_RMCast_Retransmission::~ACE_RMCast_Retransmission (void) -{ -} - -int -ACE_RMCast_Retransmission::resend (ACE_UINT32 max_sequence_number) -{ - if (this->next () == 0) - return 0; - - ACE_RMCast_Resend_Worker worker (this->next (), max_sequence_number); - - if (this->messages_.for_each (&worker) == -1) - return -1; - - return worker.n; -} - -int -ACE_RMCast_Retransmission::resend_all (void) -{ - if (this->next () == 0) - return 0; - - ACE_RMCast_Resend_Worker worker (this->next (), ACE_UINT32_MAX); - - if (this->messages_.for_each (&worker) == -1) - return -1; - - return worker.n; -} - -int -ACE_RMCast_Retransmission::has_data (void) -{ - return !this->messages_.empty (); -} - -int -ACE_RMCast_Retransmission::close (void) -{ - // @@ - return 0; -} - -int -ACE_RMCast_Retransmission::data (ACE_RMCast::Data &data) -{ - if (this->next () == 0) - return 0; - - int r = this->next ()->data (data); - if (r == 0) - { - ACE_RMCast::Data copy = data; - copy.payload = ACE_Message_Block::duplicate (data.payload); - r = this->messages_.bind (data.sequence_number, copy); - } - return r; -} - -int -ACE_RMCast_Retransmission::join (ACE_RMCast::Join &join) -{ - if (join.source == 0) - return 0; - - ACE_RMCast::Ack_Join ack_join; - ack_join.source = 0; - ack_join.next_sequence_number = this->messages_.first_key (); - - (void) join.source->reply_ack_join (ack_join); - - // @@ We should force a full retransmission of all the messages! - - return 0; -} - -int -ACE_RMCast_Retransmission::leave (ACE_RMCast::Leave &leave) -{ - if (leave.source == 0) - return 0; - - ACE_RMCast::Ack_Leave ack_leave; - ack_leave.source = 0; - - (void) leave.source->reply_ack_leave (ack_leave); - - return 0; -} - -int -ACE_RMCast_Retransmission::ack (ACE_RMCast::Ack &ack) -{ - Messages::Write_Guard ace_mon (this->messages_); - - ACE_RMCast_Ack_Worker worker (ack, ace_mon, &this->messages_); - - return this->messages_.for_each (&worker); -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_RB_Tree,ACE_Null_Mutex>; -template class ACE_RB_Tree_Iterator_Base,ACE_Null_Mutex>; -template class ACE_RB_Tree_Iterator,ACE_Null_Mutex>; -template class ACE_RB_Tree_Reverse_Iterator,ACE_Null_Mutex>; -template class ACE_RB_Tree_Node; - -template class ACE_RMCast_Copy_On_Write; -template class ACE_RMCast_Copy_On_Write_Container; -template class ACE_RMCast_Copy_On_Write_Write_Guard; -template class ACE_RMCast_Copy_On_Write_Read_Guard; -template class ACE_RMCast_Copy_On_Write_Collection; -template class ACE_RMCast_Worker; - -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_RB_Tree,ACE_Null_Mutex> -#pragma instantiate ACE_RB_Tree_Iterator_Base,ACE_Null_Mutex> -#pragma instantiate ACE_RB_Tree_Iterator,ACE_Null_Mutex> -#pragma instantiate ACE_RB_Tree_Reverse_Iterator,ACE_Null_Mutex> -#pragma instantiate ACE_RB_Tree_Node - -#pragma instantiate ACE_RMCast_Copy_On_Write -#pragma instantiate ACE_RMCast_Copy_On_Write_Container -#pragma instantiate ACE_RMCast_Copy_On_Write_Write_Guard -#pragma instantiate ACE_RMCast_Copy_On_Write_Read_Guard -#pragma instantiate ACE_RMCast_Copy_On_Write_Collection -#pragma instantiate ACE_RMCast_Worker - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/RMCast/RMCast_Retransmission.h b/ace/RMCast/RMCast_Retransmission.h deleted file mode 100644 index b51d1438c2a..00000000000 --- a/ace/RMCast/RMCast_Retransmission.h +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast_Retransmission.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_RETRANSMISSION_H -#define ACE_RMCAST_RETRANSMISSION_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" -#include "RMCast_Copy_On_Write.h" -#include "ace/RB_Tree.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Store messages for retransmission in reliable configurations -/** - * Reliable configurations of the RMCast framework need to store - * messages on the sender side to resend them if one or more clients - * do not receive them successfully. - */ -class ACE_RMCast_Export ACE_RMCast_Retransmission : public ACE_RMCast_Module -{ -public: - // = Initialization and termination methods. - /// Constructor - ACE_RMCast_Retransmission (void); - - /// Destructor - virtual ~ACE_RMCast_Retransmission (void); - - /// Use a Red-Black Tree to keep the queue of messages - typedef ACE_RB_Tree,ACE_Null_Mutex> Collection; - typedef ACE_RB_Tree_Iterator,ACE_Null_Mutex> Collection_Iterator; - - /// The messages are stored in the Copy_On_Write wrapper to provide - /// an efficient, but thread safe interface. - typedef ACE_RMCast_Copy_On_Write Messages; - - /// Resend messages - /** - * Resends all the messages up to \param max_sequence_number - * Returns the number of messages sent, or -1 if there where any - * errors. - */ - int resend (ACE_UINT32 max_sequence_number); - - /// Resend all messages - /** - * Resends all the messages currently in the queue. - */ - int resend_all (void); - - /// Return 0 if there is no pending data to send - int has_data (void); - - /// Cleanup all the stored messages - virtual int close (void); - - /// Pass the message downstream, but also save it in the - /// retransmission queue - /** - * Sequence number are assigned by the ACE_RMCast_Fragmentation - * class, consequently this class first passes the message - * downstream, to obtain the sequence number and then stores the - * message for later retransmission. - */ - virtual int data (ACE_RMCast::Data &data); - - /// Process an Ack message from the remote receivers. - /** - * Normally this Ack message will be a summary of all the Ack - * messages received by the ACE_RMCast_Membership class - */ - virtual int ack (ACE_RMCast::Ack &); - - /// Detect when new members join the group and Ack_Join them - /** - * When a new receiver joins the group this module sends an Ack_Join - * message with the next sequence number that the receiver should - * expect. - * The sequence number is obtained from the current list of cached - * messages. - */ - virtual int join (ACE_RMCast::Join &); - - /// A receiver is leaving - /** - * Normally the ACE_RMCast_Membership module could do this, but, - * because this module processes the Join messages, it seems more - * natural to process the Leave messages too. - */ - virtual int leave (ACE_RMCast::Leave &); - -protected: - - /// The retransmission buffer - Messages messages_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Retransmission.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_RETRANSMISSION_H */ diff --git a/ace/RMCast/RMCast_Retransmission.i b/ace/RMCast/RMCast_Retransmission.i deleted file mode 100644 index e67b41120ce..00000000000 --- a/ace/RMCast/RMCast_Retransmission.i +++ /dev/null @@ -1,6 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Retransmission::ACE_RMCast_Retransmission (void) -{ -} diff --git a/ace/RMCast/RMCast_Sequencer.cpp b/ace/RMCast/RMCast_Sequencer.cpp deleted file mode 100644 index 7ee857ca762..00000000000 --- a/ace/RMCast/RMCast_Sequencer.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_Sequencer.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Sequencer.i" -#endif /* ! __ACE_INLINE__ */ - -#include "ace/Guard_T.h" - -ACE_RCSID(RMCast, RMCast_Sequencer, "$Id$") - -ACE_RMCast_Sequencer::~ACE_RMCast_Sequencer (void) -{ -} - -int -ACE_RMCast_Sequencer::data (ACE_RMCast::Data &data) -{ - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1); - data.sequence_number = this->sequence_number_generator_++; - } - return this->ACE_RMCast_Module::data (data); -} diff --git a/ace/RMCast/RMCast_Sequencer.h b/ace/RMCast/RMCast_Sequencer.h deleted file mode 100644 index 28f83a1d4b3..00000000000 --- a/ace/RMCast/RMCast_Sequencer.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace/RMCast -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_SEQUENCER_H -#define ACE_RMCAST_SEQUENCER_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module.h" -#include "ace/Synch_Traits.h" -#include "ace/Thread_Mutex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Assign sequence numbers to outgoing messages -/** - * On the sender side we must assign sequence numbers to the messages - * before they are put in the retransmission queue. - */ -class ACE_RMCast_Export ACE_RMCast_Sequencer : public ACE_RMCast_Module -{ -public: - /// Constructor - ACE_RMCast_Sequencer (void); - - /// Destructor - virtual ~ACE_RMCast_Sequencer (void); - - virtual int data (ACE_RMCast::Data &); - -protected: - /// Create the sequence numbers - ACE_UINT32 sequence_number_generator_; - - /// Synchronization - ACE_SYNCH_MUTEX mutex_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Sequencer.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_SEQUENCER_H */ diff --git a/ace/RMCast/RMCast_Sequencer.i b/ace/RMCast/RMCast_Sequencer.i deleted file mode 100644 index e7b7ff0f492..00000000000 --- a/ace/RMCast/RMCast_Sequencer.i +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Sequencer::ACE_RMCast_Sequencer (void) - : sequence_number_generator_ (0) -{ -} diff --git a/ace/RMCast/RMCast_Singleton_Factory.cpp b/ace/RMCast/RMCast_Singleton_Factory.cpp deleted file mode 100644 index 5e5bd9f0930..00000000000 --- a/ace/RMCast/RMCast_Singleton_Factory.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ - -#include "RMCast_Singleton_Factory.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_Singleton_Factory.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_Singleton_Factory, "$Id$") - -ACE_RMCast_Singleton_Factory::~ACE_RMCast_Singleton_Factory (void) -{ -} - -ACE_RMCast_Module* -ACE_RMCast_Singleton_Factory::create (void) -{ - return this->singleton_; -} - -void -ACE_RMCast_Singleton_Factory::destroy (ACE_RMCast_Module *) -{ -} diff --git a/ace/RMCast/RMCast_Singleton_Factory.h b/ace/RMCast/RMCast_Singleton_Factory.h deleted file mode 100644 index 6ab5819bf30..00000000000 --- a/ace/RMCast/RMCast_Singleton_Factory.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast_Singleton_Factory.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_SINGLETON_FACTORY_H -#define ACE_RMCAST_SINGLETON_FACTORY_H -#include /**/ "ace/pre.h" - -#include "RMCast_Module_Factory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Implement an ACE_RMCast_Module_Factory that "creates" a single -/// object. -/** - * Many applications (and even some internal components), will use a - * single ACE_RMCast_Module to process all the events, for example, a - * receiver may decide to use the same ACE_RMCast_Module to process - * all incoming events, instead of using one per remote sender. - */ -class ACE_RMCast_Export ACE_RMCast_Singleton_Factory : public ACE_RMCast_Module_Factory -{ -public: - /// Constructor - /** - * @param singleton This object is returned by any call to - * create(). - */ - ACE_RMCast_Singleton_Factory (ACE_RMCast_Module *singleton); - - //! Destructor - virtual ~ACE_RMCast_Singleton_Factory (void); - - virtual ACE_RMCast_Module *create (void); - virtual void destroy (ACE_RMCast_Module *); - -private: - /// The singleton object - ACE_RMCast_Module *singleton_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_Singleton_Factory.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_SINGLETON_FACTORY_H */ diff --git a/ace/RMCast/RMCast_Singleton_Factory.i b/ace/RMCast/RMCast_Singleton_Factory.i deleted file mode 100644 index a45837dfa93..00000000000 --- a/ace/RMCast/RMCast_Singleton_Factory.i +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_Singleton_Factory:: - ACE_RMCast_Singleton_Factory (ACE_RMCast_Module *singleton) - : singleton_ (singleton) -{ -} diff --git a/ace/RMCast/RMCast_UDP_Event_Handler.cpp b/ace/RMCast/RMCast_UDP_Event_Handler.cpp deleted file mode 100644 index 6f7ae18f19e..00000000000 --- a/ace/RMCast/RMCast_UDP_Event_Handler.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// -// $Id$ -// - -#include "RMCast_UDP_Event_Handler.h" -#include "RMCast_IO_UDP.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_UDP_Event_Handler.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_UDP_Event_Handler, "$Id$") - -ACE_RMCast_UDP_Event_Handler::~ACE_RMCast_UDP_Event_Handler (void) -{ -} - -ACE_HANDLE -ACE_RMCast_UDP_Event_Handler::get_handle (void) const -{ - return this->io_udp_->get_handle (); -} - -int -ACE_RMCast_UDP_Event_Handler::handle_input (ACE_HANDLE h) -{ - return this->io_udp_->handle_input (h); -} - -int -ACE_RMCast_UDP_Event_Handler::handle_timeout (const ACE_Time_Value &, - const void *) -{ - // @@ return this->io_udp_->handle_timeout (); - return 0; -} diff --git a/ace/RMCast/RMCast_UDP_Event_Handler.h b/ace/RMCast/RMCast_UDP_Event_Handler.h deleted file mode 100644 index e8873ed67fd..00000000000 --- a/ace/RMCast/RMCast_UDP_Event_Handler.h +++ /dev/null @@ -1,59 +0,0 @@ -// $Id$ - -#ifndef ACE_RMCAST_UDP_EVENT_HANDLER_H -#define ACE_RMCAST_UDP_EVENT_HANDLER_H -#include /**/ "ace/pre.h" - -#include "RMCast_Export.h" -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_RMCast_IO_UDP; -class ACE_INET_Addr; - -//! Implement an Adapter for the ACE_RMCast_IO_UDP class -/*! - * Applications may wish to use the ACE_Reactor to demultiplex I/O - * events for an ACE_RMCast_IO_UDP object. However other application - * may choose to make ACE_RMCast_IO_UDP active, or they may dedicate - * their own threads for its events. - * To avoid couplin ACE_RMCast_IO_UDP with the Reactor we don't make - * it derived from ACE_Event_Handler or any other class in the Reactor - * framework, instead, this simple Adapter can forward the Reactor - * messages to an ACE_RMCast_IO_UDP object. - */ -class ACE_RMCast_Export ACE_RMCast_UDP_Event_Handler : public ACE_Event_Handler -{ -public: - //! Constructor, save io_udp as the Adaptee in the Adapter pattern. - ACE_RMCast_UDP_Event_Handler (ACE_RMCast_IO_UDP *io_udp); - - //! Destructor - /*! - * Notice that this class does not own the ACE_RMCast_IO_UDP - * adaptee, so it does not destroy it. - */ - ~ACE_RMCast_UDP_Event_Handler (void); - - //@{ - //! Documented in ACE_Event_Handler class - virtual ACE_HANDLE get_handle (void) const; - virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); - virtual int handle_timeout (const ACE_Time_Value ¤t_time, - const void *act = 0); - //@} - -private: - //! The adaptee - ACE_RMCast_IO_UDP *io_udp_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_UDP_Event_Handler.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_UDP_EVENT_HANDLER_H */ diff --git a/ace/RMCast/RMCast_UDP_Event_Handler.i b/ace/RMCast/RMCast_UDP_Event_Handler.i deleted file mode 100644 index 99b4c0ac7e5..00000000000 --- a/ace/RMCast/RMCast_UDP_Event_Handler.i +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -ACE_INLINE -ACE_RMCast_UDP_Event_Handler:: -ACE_RMCast_UDP_Event_Handler (ACE_RMCast_IO_UDP *io) - : io_udp_ (io) -{ -} diff --git a/ace/RMCast/RMCast_UDP_Proxy.cpp b/ace/RMCast/RMCast_UDP_Proxy.cpp deleted file mode 100644 index cb669397756..00000000000 --- a/ace/RMCast/RMCast_UDP_Proxy.cpp +++ /dev/null @@ -1,190 +0,0 @@ -// $Id$ - -#include "RMCast_UDP_Proxy.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_UDP_Proxy.i" -#endif /* ! __ACE_INLINE__ */ - -#include "RMCast_Module.h" -#include "RMCast_IO_UDP.h" -#include "ace/Message_Block.h" -#include "ace/OS_Memory.h" -#include "ace/OS_NS_string.h" -#include "ace/os_include/arpa/os_inet.h" - -ACE_RCSID(RMCast, RMCast_UDP_Proxy, "$Id$") - -ACE_RMCast_UDP_Proxy::ACE_RMCast_UDP_Proxy (ACE_RMCast_IO_UDP *io_udp, - const ACE_INET_Addr &addr) - : io_udp_ (io_udp) - , peer_addr_ (addr) -{ -} - -ACE_RMCast_UDP_Proxy::~ACE_RMCast_UDP_Proxy (void) -{ -} - -int -ACE_RMCast_UDP_Proxy::receive_message (char *buffer, size_t size) -{ - int type = buffer[0]; - - // @@ What should we do with invalid messages like this? - // - if (type < 0 || type >= ACE_RMCast::RMCAST_MT_LAST) - return 0; - - if (type == ACE_RMCast::RMCAST_MT_POLL) - { - ACE_RMCast::Poll poll; - poll.source = this; - return this->poll (poll); - } - - else if (type == ACE_RMCast::RMCAST_MT_ACK_JOIN) - { - ACE_RMCast::Ack_Join ack_join; - ack_join.source = this; - - const size_t header_size = 1 + sizeof(ACE_UINT32); - if (size < header_size) - { - // The message is too small - return 0; - } - - ACE_UINT32 tmp; - - ACE_OS::memcpy (&tmp, buffer + 1, - sizeof(tmp)); - ack_join.next_sequence_number = ACE_NTOHL (tmp); - return this->ack_join (ack_join); - } - - else if (type == ACE_RMCast::RMCAST_MT_ACK_LEAVE) - { - ACE_RMCast::Ack_Leave ack_leave; - ack_leave.source = this; - return this->ack_leave (ack_leave); - } - - else if (type == ACE_RMCast::RMCAST_MT_DATA) - { - ACE_RMCast::Data data; - data.source = this; - const size_t header_size = 1 + 3 * sizeof(ACE_UINT32); - if (size < header_size) - { - // The message is too small - return 0; - } - - ACE_UINT32 tmp; - - ACE_OS::memcpy (&tmp, buffer + 1, - sizeof(tmp)); - data.sequence_number = ACE_NTOHL (tmp); - - ACE_OS::memcpy (&tmp, buffer + 1 + sizeof(tmp), - sizeof(tmp)); - data.total_size = ACE_NTOHL (tmp); - - ACE_OS::memcpy (&tmp, buffer + 1 + 2 * sizeof(tmp), - sizeof(tmp)); - data.fragment_offset = ACE_NTOHL (tmp); - - // Pass it up the module... - ACE_Message_Block *mb; - ACE_NEW_RETURN (mb, ACE_Message_Block, -1); - mb->size (size - header_size); - mb->copy (buffer + header_size, size - header_size); - - data.payload = mb; - return this->data (data); - } - - else if (type == ACE_RMCast::RMCAST_MT_JOIN) - { - ACE_RMCast::Join join; - join.source = this; - return this->join (join); - } - - else if (type == ACE_RMCast::RMCAST_MT_LEAVE) - { - ACE_RMCast::Leave leave; - leave.source = this; - return this->leave (leave); - } - - else if (type == ACE_RMCast::RMCAST_MT_ACK) - { - ACE_RMCast::Ack ack; - ack.source = this; - - const size_t header_size = 1 + sizeof(ACE_UINT32); - if (size < header_size) - { - // The message is too small - return 0; - } - - ACE_UINT32 tmp; - - ACE_OS::memcpy (&tmp, buffer + 1, - sizeof(tmp)); - ack.next_expected = ACE_NTOHL (tmp); - ACE_OS::memcpy (&tmp, buffer + 1 + sizeof(ACE_UINT32), - sizeof(tmp)); - ack.highest_received = ACE_NTOHL (tmp); - - return this->ack (ack); - } - - return 0; -} - -int -ACE_RMCast_UDP_Proxy::reply_data (ACE_RMCast::Data &data) -{ - return this->io_udp_->send_data (data, this->peer_addr_); -} - -int -ACE_RMCast_UDP_Proxy::reply_poll (ACE_RMCast::Poll &poll) -{ - return this->io_udp_->send_poll (poll, this->peer_addr_); -} - -int -ACE_RMCast_UDP_Proxy::reply_ack_join (ACE_RMCast::Ack_Join &ack_join) -{ - (void) this->ACE_RMCast_Proxy::reply_ack_join (ack_join); - return this->io_udp_->send_ack_join (ack_join, this->peer_addr_); -} - -int -ACE_RMCast_UDP_Proxy::reply_ack_leave (ACE_RMCast::Ack_Leave &ack_leave) -{ - return this->io_udp_->send_ack_leave (ack_leave, this->peer_addr_); -} - -int -ACE_RMCast_UDP_Proxy::reply_ack (ACE_RMCast::Ack &ack) -{ - return this->io_udp_->send_ack (ack, this->peer_addr_); -} - -int -ACE_RMCast_UDP_Proxy::reply_join (ACE_RMCast::Join &join) -{ - return this->io_udp_->send_join (join, this->peer_addr_); -} - -int -ACE_RMCast_UDP_Proxy::reply_leave (ACE_RMCast::Leave &leave) -{ - return this->io_udp_->send_leave (leave, this->peer_addr_); -} diff --git a/ace/RMCast/RMCast_UDP_Proxy.h b/ace/RMCast/RMCast_UDP_Proxy.h deleted file mode 100644 index 01db65f66d1..00000000000 --- a/ace/RMCast/RMCast_UDP_Proxy.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// RMCast_UDP_Proxy.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef ACE_RMCAST_UDP_PROXY_H -#define ACE_RMCAST_UDP_PROXY_H -#include /**/ "ace/pre.h" - -#include "RMCast_Proxy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/INET_Addr.h" - -class ACE_RMCast_IO_UDP; - -/// Define the proxy implementation for UDP based communication -/** - * Proxy objects are transport specific, they are responsible for - * storing the remote peer addressing information. - * This class implements the UDP version of a proxy. - */ -class ACE_RMCast_Export ACE_RMCast_UDP_Proxy : public ACE_RMCast_Proxy -{ -public: - /// Constructor - /** - * The \param io_udp argument is kept to send the replys through the - * right socket. - * The \param peer_addr is the address used byu the peer to receive - * responses. - */ - ACE_RMCast_UDP_Proxy (ACE_RMCast_IO_UDP *io_udp, - const ACE_INET_Addr &peer_addr); - - /// Destructor - virtual ~ACE_RMCast_UDP_Proxy (void); - - /// Receive a message, parse and send it upstream in the right - /// format. - int receive_message (char *buffer, size_t size); - - /// Make the peer address available - const ACE_INET_Addr &peer_addr (void) const; - - //@{ - /** - * Implement the ACE_RMCast_Proxy methods, in this case we use the - * @var io_udp_ object to send the data, using the address of our - * remote peer. - */ - virtual int reply_data (ACE_RMCast::Data &); - virtual int reply_poll (ACE_RMCast::Poll &); - virtual int reply_ack_join (ACE_RMCast::Ack_Join &); - virtual int reply_ack_leave (ACE_RMCast::Ack_Leave &); - virtual int reply_ack (ACE_RMCast::Ack &); - virtual int reply_join (ACE_RMCast::Join &); - virtual int reply_leave (ACE_RMCast::Leave &); - //@} - -private: - /// The IO facade - ACE_RMCast_IO_UDP *io_udp_; - - /// The remote peer's address - ACE_INET_Addr peer_addr_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_UDP_Proxy.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_UDP_PROXY_H */ diff --git a/ace/RMCast/RMCast_UDP_Proxy.i b/ace/RMCast/RMCast_UDP_Proxy.i deleted file mode 100644 index b7a85e78ce2..00000000000 --- a/ace/RMCast/RMCast_UDP_Proxy.i +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ - -ACE_INLINE const ACE_INET_Addr& -ACE_RMCast_UDP_Proxy::peer_addr (void) const -{ - return this->peer_addr_; -} diff --git a/ace/RMCast/RMCast_UDP_Reliable_Receiver.cpp b/ace/RMCast/RMCast_UDP_Reliable_Receiver.cpp deleted file mode 100644 index 8c41e9bb663..00000000000 --- a/ace/RMCast/RMCast_UDP_Reliable_Receiver.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// $Id$ - -#include "RMCast_UDP_Reliable_Receiver.h" -#include "RMCast_UDP_Event_Handler.h" -#include "ace/Reactor.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_UDP_Reliable_Receiver.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_UDP_Reliable_Receiver, "$Id$") - -ACE_RMCast_UDP_Reliable_Receiver::ACE_RMCast_UDP_Reliable_Receiver (ACE_RMCast_Module *user_module) - : user_factory_ (user_module) - , factory_ (&user_factory_) - , io_udp_ (&factory_) -{ -} - -ACE_RMCast_UDP_Reliable_Receiver::~ACE_RMCast_UDP_Reliable_Receiver (void) -{ -} - -void -ACE_RMCast_UDP_Reliable_Receiver::reactive_incoming_messages (ACE_Reactor *reactor) -{ - ACE_RMCast_UDP_Event_Handler *eh; - ACE_NEW (eh, ACE_RMCast_UDP_Event_Handler (&this->io_udp_)); - - /// @@ TODO Make sure it is removed from the Reactor at some point - (void) reactor->register_handler (eh, ACE_Event_Handler::READ_MASK); -} diff --git a/ace/RMCast/RMCast_UDP_Reliable_Receiver.h b/ace/RMCast/RMCast_UDP_Reliable_Receiver.h deleted file mode 100644 index 56797861b4b..00000000000 --- a/ace/RMCast/RMCast_UDP_Reliable_Receiver.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#ifndef ACE_RMCAST_UDP_RELIABLE_RECEIVER_H -#define ACE_RMCAST_UDP_RELIABLE_RECEIVER_H -#include /**/ "ace/pre.h" - -#include "RMCast_Singleton_Factory.h" -#include "RMCast_Reliable_Factory.h" -#include "RMCast_IO_UDP.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Reactor; - -class ACE_RMCast_Export ACE_RMCast_UDP_Reliable_Receiver : public ACE_RMCast_Module -{ -public: - /// Constructor - ACE_RMCast_UDP_Reliable_Receiver (ACE_RMCast_Module *user_control); - - /// Destructor - virtual ~ACE_RMCast_UDP_Reliable_Receiver (void); - - /// Open the UDP I/O module. - int init (const ACE_INET_Addr &mcast_group); - - /// Use the reactor to handle incoming messages - void reactive_incoming_messages (ACE_Reactor *reactor); - -private: - /// All the proxys give their messages to user module - ACE_RMCast_Singleton_Factory user_factory_; - - /// This factory creates the per-proxy stack - ACE_RMCast_Reliable_Factory factory_; - - /// Handle all the UDP I/O - ACE_RMCast_IO_UDP io_udp_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_UDP_Reliable_Receiver.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_UDP_RELIABLE_RECEIVER_H */ diff --git a/ace/RMCast/RMCast_UDP_Reliable_Receiver.i b/ace/RMCast/RMCast_UDP_Reliable_Receiver.i deleted file mode 100644 index 01b2ebe2cad..00000000000 --- a/ace/RMCast/RMCast_UDP_Reliable_Receiver.i +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ - -ACE_INLINE int -ACE_RMCast_UDP_Reliable_Receiver::init (const ACE_INET_Addr &mcast_group) -{ - return this->io_udp_.subscribe (mcast_group); -} diff --git a/ace/RMCast/RMCast_UDP_Reliable_Sender.cpp b/ace/RMCast/RMCast_UDP_Reliable_Sender.cpp deleted file mode 100644 index 641fb3403ac..00000000000 --- a/ace/RMCast/RMCast_UDP_Reliable_Sender.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// $Id$ - -#include "RMCast_UDP_Reliable_Sender.h" -#include "RMCast_UDP_Event_Handler.h" -#include "RMCast_Resend_Handler.h" -#include "ace/Reactor.h" - -#if !defined (__ACE_INLINE__) -# include "RMCast_UDP_Reliable_Sender.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(RMCast, RMCast_UDP_Reliable_Sender, "$Id$") - -ACE_RMCast_UDP_Reliable_Sender::ACE_RMCast_UDP_Reliable_Sender (ACE_RMCast_Module *user_control) - : user_control_ (user_control) - - // We use a singleton factory, all proxys send their messages to the - // retransmission module. There should be only control messages - // coming back, so this is OK. - , factory_ (&membership_) - , io_udp_ (&factory_) -{ - // Control messages are received by the membership module and passed - // up to the both the retransmission and user modules, we use a fork - // module to do that - this->membership_.next (&this->fork_); - - this->fork_.next (&this->retransmission_); - this->fork_.secondary (user_control); - - // Messages are passed down to the sequencer module - this->next (&this->sequencer_); - - // then to the retransmission module - this->sequencer_.next (&this->retransmission_); - - // Then fork the messages, at this point control messages are sent - // back to the user, other messages continue down to the - // fragmentation layer. - this->retransmission_.next (&this->fragment_); - - // The fragmentation layer delegates all messages to the UDP I/O - // module, that sends every message back to the application. - this->fragment_.next (&this->io_udp_); -} - -ACE_RMCast_UDP_Reliable_Sender::~ACE_RMCast_UDP_Reliable_Sender (void) -{ -} - -void -ACE_RMCast_UDP_Reliable_Sender::reactive_incoming_messages (ACE_Reactor *reactor) -{ - ACE_RMCast_UDP_Event_Handler *eh; - ACE_NEW (eh, ACE_RMCast_UDP_Event_Handler (&this->io_udp_)); - - /// @@ TODO Make sure it is removed from the Reactor at some point - (void) reactor->register_handler (eh, ACE_Event_Handler::READ_MASK); -} - -void -ACE_RMCast_UDP_Reliable_Sender::reactive_resends (ACE_Reactor *reactor, - const ACE_Time_Value &period) -{ - ACE_RMCast_Resend_Handler *eh; - ACE_NEW (eh, ACE_RMCast_Resend_Handler (&this->retransmission_)); - - /// @@ TODO make sure it is removed from the Reactor at some point - (void) reactor->schedule_timer (eh, 0, period, period); -} diff --git a/ace/RMCast/RMCast_UDP_Reliable_Sender.h b/ace/RMCast/RMCast_UDP_Reliable_Sender.h deleted file mode 100644 index 9b1fa01143b..00000000000 --- a/ace/RMCast/RMCast_UDP_Reliable_Sender.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#ifndef ACE_RMCAST_UDP_RELIABLE_SENDER_H -#define ACE_RMCAST_UDP_RELIABLE_SENDER_H -#include /**/ "ace/pre.h" - -#include "RMCast_Singleton_Factory.h" -#include "RMCast_IO_UDP.h" -#include "RMCast_Sequencer.h" -#include "RMCast_Retransmission.h" -#include "RMCast_Membership.h" -#include "RMCast_Fragment.h" -#include "RMCast_Fork.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Reactor; - -class ACE_RMCast_Export ACE_RMCast_UDP_Reliable_Sender : public ACE_RMCast_Module -{ -public: - /// Constructor - ACE_RMCast_UDP_Reliable_Sender (ACE_RMCast_Module *user_control); - - /// Destructor - virtual ~ACE_RMCast_UDP_Reliable_Sender (void); - - /// Open the UDP I/O module. - int init (const ACE_INET_Addr &mcast_group); - - /// Use the reactor to handle incoming messages - void reactive_incoming_messages (ACE_Reactor *reactor); - - /// Use the reactor to periodically resend messages - void reactive_resends (ACE_Reactor *reactor, - const ACE_Time_Value &period); - - /// Check if there is still some messages to send, return 0 if not. - int has_data (void); - - /// Check if there are any members still connected - int has_members (void); - -private: - /// The application-level control module - ACE_RMCast_Module *user_control_; - - /// Assign sequence numbers - ACE_RMCast_Sequencer sequencer_; - - /// The retransmission module - ACE_RMCast_Retransmission retransmission_; - - /// All the proxys give their messages to the retransmission module - ACE_RMCast_Singleton_Factory factory_; - - /// Handle all the UDP I/O - ACE_RMCast_IO_UDP io_udp_; - - /// The membership module - ACE_RMCast_Membership membership_; - - /// The fragmentation module - ACE_RMCast_Fragment fragment_; - - /// Redirect control messages to the user supplied module - ACE_RMCast_Fork fork_; -}; - -#if defined (__ACE_INLINE__) -#include "RMCast_UDP_Reliable_Sender.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* ACE_RMCAST_UDP_RELIABLE_SENDER_H */ diff --git a/ace/RMCast/RMCast_UDP_Reliable_Sender.i b/ace/RMCast/RMCast_UDP_Reliable_Sender.i deleted file mode 100644 index 93868a86ede..00000000000 --- a/ace/RMCast/RMCast_UDP_Reliable_Sender.i +++ /dev/null @@ -1,19 +0,0 @@ -// $Id$ - -ACE_INLINE int -ACE_RMCast_UDP_Reliable_Sender::init (const ACE_INET_Addr &mcast_group) -{ - return this->io_udp_.init (mcast_group, ACE_Addr::sap_any); -} - -ACE_INLINE int -ACE_RMCast_UDP_Reliable_Sender::has_data (void) -{ - return this->retransmission_.has_data (); -} - -ACE_INLINE int -ACE_RMCast_UDP_Reliable_Sender::has_members (void) -{ - return this->membership_.has_members (); -} diff --git a/ace/RMCast/RMCast_Worker.cpp b/ace/RMCast/RMCast_Worker.cpp deleted file mode 100644 index 6f24892eace..00000000000 --- a/ace/RMCast/RMCast_Worker.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ - -#ifndef ACE_RMCAST_WORKER_CPP -#define ACE_RMCAST_WORKER_CPP - -#include "RMCast_Worker.h" - -ACE_RCSID(RMCast, RMCast_Worker, "$Id$") - -template -ACE_RMCast_Worker::~ACE_RMCast_Worker (void) -{ -} - -#endif /* ACE_RMCAST_WORKER_CPP */ diff --git a/ace/RMCast/RMCast_Worker.h b/ace/RMCast/RMCast_Worker.h deleted file mode 100644 index 6431b192904..00000000000 --- a/ace/RMCast/RMCast_Worker.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -// - -#ifndef ACE_RMCAST_WORKER_H -#define ACE_RMCAST_WORKER_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -template -class ACE_RMCast_Worker -{ -public: - virtual ~ACE_RMCast_Worker (void); - - virtual int work (KEY const & key, - ITEM const & item) = 0; -}; - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "RMCast_Worker.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("RMCast_Worker.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_RMCAST_WORKER_H */ diff --git a/ace/RMCast/rmcast.mpc b/ace/RMCast/rmcast.mpc deleted file mode 100644 index 5f98b38d8b0..00000000000 --- a/ace/RMCast/rmcast.mpc +++ /dev/null @@ -1,8 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(RMCast) : acelib, core { - requires += rmcast - sharedname = ACE_RMCast - dynamicflags = ACE_RMCAST_BUILD_DLL -} diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp index eec9855a892..c1287d30ae5 100644 --- a/ace/Reactor.cpp +++ b/ace/Reactor.cpp @@ -11,11 +11,16 @@ #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) + || defined (ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL) \ + || defined (ACE_USE_DEV_POLL_REACTOR_FOR_REACTOR_IMPL) # if defined (ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL) # include "ace/TP_Reactor.h" # else -# include "ace/Select_Reactor.h" +# if defined (ACE_USE_DEV_POLL_REACTOR_FOR_REACTOR_IMPL) +# include "ace/Dev_Poll_Reactor.h" +# else +# include "ace/Select_Reactor.h" +# endif /* ACE_USE_DEV_POLL_REACTOR_FOR_REACTOR_IMPL */ # 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) @@ -50,14 +55,20 @@ ACE_Reactor::ACE_Reactor (ACE_Reactor_Impl *impl, #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) + || defined (ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL) \ + || defined (ACE_USE_DEV_POLL_REACTOR_FOR_REACTOR_IMPL) +# if defined (ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL) ACE_NEW (impl, ACE_TP_Reactor); - #else +# else +# if defined (ACE_USE_DEV_POLL_REACTOR_FOR_REACTOR_IMPL) + ACE_NEW (impl, + ACE_Dev_Poll_Reactor); +# else ACE_NEW (impl, ACE_Select_Reactor); - #endif /* ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL */ +# endif /* ACE_USE_DEV_POLL_REACTOR_FOR_REACTOR_IMPL */ +# 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, diff --git a/ace/Remote_Name_Space.cpp b/ace/Remote_Name_Space.cpp index a8f91571ad7..55c50a275c7 100644 --- a/ace/Remote_Name_Space.cpp +++ b/ace/Remote_Name_Space.cpp @@ -1,6 +1,7 @@ #include "ace/Remote_Name_Space.h" #include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" +#include "ace/SString.h" #include "ace/OS_NS_string.h" ACE_RCSID (ace, @@ -46,11 +47,11 @@ ACE_Remote_Name_Space::bind (const ACE_NS_WString &name, ACE_Auto_Basic_Array_Ptr name_urep (name.rep ()); ACE_Auto_Basic_Array_Ptr value_urep (value.rep ()); ACE_UINT32 name_len = - ACE_static_cast (ACE_UINT32, name.length () * sizeof (ACE_WCHAR_T)); + static_cast (name.length () * sizeof (ACE_WCHAR_T)); ACE_UINT32 value_len = - ACE_static_cast (ACE_UINT32, value.length () * sizeof (ACE_WCHAR_T)); + static_cast (value.length () * sizeof (ACE_WCHAR_T)); ACE_UINT32 type_len = - ACE_static_cast (ACE_UINT32, ACE_OS::strlen (type)); + static_cast (ACE_OS::strlen (type)); ACE_Name_Request request (ACE_Name_Request::BIND, name_urep.get (), name_len, @@ -70,11 +71,11 @@ ACE_Remote_Name_Space::rebind (const ACE_NS_WString &name, ACE_Auto_Basic_Array_Ptr name_urep (name.rep ()); ACE_Auto_Basic_Array_Ptr value_urep (value.rep ()); ACE_UINT32 name_len = - ACE_static_cast (ACE_UINT32, name.length () * sizeof (ACE_WCHAR_T)); + static_cast (name.length () * sizeof (ACE_WCHAR_T)); ACE_UINT32 value_len = - ACE_static_cast (ACE_UINT32, value.length () * sizeof (ACE_WCHAR_T)); + static_cast (value.length () * sizeof (ACE_WCHAR_T)); ACE_UINT32 type_len = - ACE_static_cast (ACE_UINT32, ACE_OS::strlen (type)); + static_cast (ACE_OS::strlen (type)); ACE_Name_Request request (ACE_Name_Request::REBIND, name_urep.get (), name_len, @@ -93,7 +94,7 @@ ACE_Remote_Name_Space::resolve (const ACE_NS_WString &name, ACE_TRACE ("ACE_Remote_Name_Space::resolve"); ACE_Auto_Basic_Array_Ptr name_urep (name.rep ()); ACE_UINT32 name_len = - ACE_static_cast (ACE_UINT32, name.length () * sizeof (ACE_WCHAR_T)); + static_cast (name.length () * sizeof (ACE_WCHAR_T)); ACE_Name_Request request (ACE_Name_Request::RESOLVE, name_urep.get (), name_len, @@ -122,7 +123,7 @@ ACE_Remote_Name_Space::unbind (const ACE_NS_WString &name) ACE_TRACE ("ACE_Remote_Name_Space::unbind"); ACE_Auto_Basic_Array_Ptr name_urep (name.rep ()); ACE_UINT32 name_len = - ACE_static_cast (ACE_UINT32, name.length () * sizeof (ACE_WCHAR_T)); + static_cast (name.length () * sizeof (ACE_WCHAR_T)); ACE_Name_Request request (ACE_Name_Request::UNBIND, name_urep.get (), name_len, @@ -137,7 +138,7 @@ ACE_Remote_Name_Space::list_names (ACE_WSTRING_SET &set, ACE_TRACE ("ACE_Remote_Name_Space::list_names"); ACE_Auto_Basic_Array_Ptr pattern_urep (pattern.rep ()); ACE_UINT32 pattern_len = - ACE_static_cast (ACE_UINT32, pattern.length () * sizeof (ACE_WCHAR_T)); + static_cast (pattern.length () * sizeof (ACE_WCHAR_T)); ACE_Name_Request request (ACE_Name_Request::LIST_NAMES, pattern_urep.get (), pattern_len, @@ -171,7 +172,7 @@ ACE_Remote_Name_Space::list_values (ACE_WSTRING_SET &set, ACE_TRACE ("ACE_Remote_Name_Space::list_values"); ACE_Auto_Basic_Array_Ptr pattern_urep (pattern.rep ()); ACE_UINT32 pattern_len = - ACE_static_cast (ACE_UINT32, pattern.length () * sizeof (ACE_WCHAR_T)); + static_cast (pattern.length () * sizeof (ACE_WCHAR_T)); ACE_Name_Request request (ACE_Name_Request::LIST_VALUES, pattern_urep.get (), pattern_len, @@ -206,7 +207,7 @@ ACE_Remote_Name_Space::list_types (ACE_WSTRING_SET &set, ACE_TRACE ("ACE_Remote_Name_Space::list_types"); ACE_Auto_Basic_Array_Ptr pattern_urep (pattern.rep ()); ACE_UINT32 pattern_len = - ACE_static_cast (ACE_UINT32, pattern.length () * sizeof (ACE_WCHAR_T)); + static_cast (pattern.length () * sizeof (ACE_WCHAR_T)); ACE_Name_Request request (ACE_Name_Request::LIST_TYPES, pattern_urep.get (), pattern_len, @@ -241,7 +242,7 @@ ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set, ACE_TRACE ("ACE_Remote_Name_Space::list_name_entries"); ACE_Auto_Basic_Array_Ptr pattern_urep (pattern.rep ()); ACE_UINT32 pattern_len = - ACE_static_cast (ACE_UINT32, pattern.length () * sizeof (ACE_WCHAR_T)); + static_cast (pattern.length () * sizeof (ACE_WCHAR_T)); ACE_Name_Request request (ACE_Name_Request::LIST_NAME_ENTRIES, pattern_urep.get (), pattern_len, @@ -282,7 +283,7 @@ ACE_Remote_Name_Space::list_value_entries (ACE_BINDING_SET &set, ACE_TRACE ("ACE_Remote_Name_Space::list_value_entries"); ACE_Auto_Basic_Array_Ptr pattern_urep (pattern.rep ()); ACE_UINT32 pattern_len = - ACE_static_cast (ACE_UINT32, pattern.length () * sizeof (ACE_WCHAR_T)); + static_cast (pattern.length () * sizeof (ACE_WCHAR_T)); ACE_Name_Request request (ACE_Name_Request::LIST_VALUE_ENTRIES, pattern_urep.get (), pattern_len, @@ -323,7 +324,7 @@ ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set, ACE_TRACE ("ACE_Remote_Name_Space::list_type_entries"); ACE_Auto_Basic_Array_Ptr pattern_urep (pattern.rep ()); ACE_UINT32 pattern_len = - ACE_static_cast (ACE_UINT32, pattern.length () * sizeof (ACE_WCHAR_T)); + static_cast (pattern.length () * sizeof (ACE_WCHAR_T)); ACE_Name_Request request (ACE_Name_Request::LIST_TYPE_ENTRIES, pattern_urep.get (), pattern_len, diff --git a/ace/Remote_Name_Space.h b/ace/Remote_Name_Space.h index 95c7b051770..95c0d9c4531 100644 --- a/ace/Remote_Name_Space.h +++ b/ace/Remote_Name_Space.h @@ -22,10 +22,12 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/SString.h" #include "ace/Name_Proxy.h" #include "ace/Name_Space.h" + +class ACE_NS_WString; + typedef ACE_Unbounded_Set ACE_WSTRING_SET; /** diff --git a/ace/SOCK_Acceptor.cpp b/ace/SOCK_Acceptor.cpp index 151c29b3ce0..ffb187b5e17 100644 --- a/ace/SOCK_Acceptor.cpp +++ b/ace/SOCK_Acceptor.cpp @@ -229,8 +229,7 @@ ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, if (protocol_family == PF_INET6) { sockaddr_in6 local_inet6_addr; - ACE_OS::memset (ACE_reinterpret_cast (void *, - &local_inet6_addr), + ACE_OS::memset (reinterpret_cast (&local_inet6_addr), 0, sizeof local_inet6_addr); @@ -241,15 +240,13 @@ ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, local_inet6_addr.sin6_addr = in6addr_any; } else - local_inet6_addr = *ACE_reinterpret_cast (sockaddr_in6 *, - local_sap.get_addr ()); + local_inet6_addr = *reinterpret_cast (local_sap.get_addr ()); // We probably don't need a bind_port written here. // There are currently no supported OS's that define // ACE_LACKS_WILDCARD_BIND. if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - &local_inet6_addr), + reinterpret_cast (&local_inet6_addr), sizeof local_inet6_addr) == -1) error = 1; } @@ -258,8 +255,7 @@ ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, if (protocol_family == PF_INET) { sockaddr_in local_inet_addr; - ACE_OS::memset (ACE_reinterpret_cast (void *, - &local_inet_addr), + ACE_OS::memset (reinterpret_cast (&local_inet_addr), 0, sizeof local_inet_addr); @@ -268,8 +264,7 @@ ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, local_inet_addr.sin_port = 0; } else - local_inet_addr = *ACE_reinterpret_cast (sockaddr_in *, - local_sap.get_addr ()); + local_inet_addr = *reinterpret_cast (local_sap.get_addr ()); if (local_inet_addr.sin_port == 0) { if (ACE::bind_port (this->get_handle (), @@ -277,8 +272,7 @@ ACE_SOCK_Acceptor::shared_open (const ACE_Addr &local_sap, error = 1; } else if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - &local_inet_addr), + reinterpret_cast (&local_inet_addr), sizeof local_inet_addr) == -1) error = 1; } diff --git a/ace/SOCK_Connector.cpp b/ace/SOCK_Connector.cpp index fe7fa79103d..86c09b92f1d 100644 --- a/ace/SOCK_Connector.cpp +++ b/ace/SOCK_Connector.cpp @@ -81,8 +81,7 @@ ACE_SOCK_Connector::shared_connect_start (ACE_SOCK_Stream &new_stream, if (local_sap != ACE_Addr::sap_any) { - sockaddr *laddr = ACE_reinterpret_cast (sockaddr *, - local_sap.get_addr ()); + sockaddr *laddr = reinterpret_cast (local_sap.get_addr ()); int size = local_sap.get_size (); if (ACE_OS::bind (new_stream.get_handle (), @@ -168,8 +167,7 @@ ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, return -1; int result = ACE_OS::connect (new_stream.get_handle (), - ACE_reinterpret_cast (sockaddr *, - remote_sap.get_addr ()), + reinterpret_cast (remote_sap.get_addr ()), remote_sap.get_size ()); return this->shared_connect_finish (new_stream, @@ -206,8 +204,7 @@ ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, return -1; int result = ACE_OS::connect (new_stream.get_handle (), - ACE_reinterpret_cast (sockaddr *, - remote_sap.get_addr ()), + reinterpret_cast (remote_sap.get_addr ()), remote_sap.get_size (), qos_params); @@ -254,8 +251,7 @@ ACE_SOCK_Connector::complete (ACE_SOCK_Stream &new_stream, if (remote_sap != 0) { int len = remote_sap->get_size (); - sockaddr *addr = ACE_reinterpret_cast (sockaddr *, - remote_sap->get_addr ()); + sockaddr *addr = reinterpret_cast (remote_sap->get_addr ()); if (ACE_OS::getpeername (h, addr, &len) == -1) diff --git a/ace/SOCK_Dgram_Mcast.cpp b/ace/SOCK_Dgram_Mcast.cpp index 243ac51dd5c..b4755a848be 100644 --- a/ace/SOCK_Dgram_Mcast.cpp +++ b/ace/SOCK_Dgram_Mcast.cpp @@ -92,13 +92,13 @@ ACE_SOCK_Dgram_Mcast::dump (void) const ip_mreq *pm = iter.next (); // Get subscribed address (w/out port# info - not relevant). - ACE_INET_Addr ip_addr (ACE_static_cast (u_short, 0), + ACE_INET_Addr ip_addr (static_cast (0), ACE_NTOHL (pm->IMR_MULTIADDR.s_addr)); ACE_SDM_helpers::addr_to_string (ip_addr, addr_string, sizeof addr_string, 1); // Get interface address/specification. - ACE_INET_Addr if_addr (ACE_static_cast (u_short, 0), + ACE_INET_Addr if_addr (static_cast (0), ACE_NTOHL (pm->imr_interface.s_addr)); ACE_SDM_helpers::addr_to_string (if_addr, iface_string, sizeof iface_string, 1); @@ -984,8 +984,7 @@ ACE_SOCK_Dgram_Mcast::make_multicast_ifaddr (ip_mreq *ret_mreq, return -1; sockaddr_in *socket_address; - socket_address = ACE_reinterpret_cast (sockaddr_in*, - &if_address.ifr_addr); + socket_address = reinterpret_cast (&if_address.ifr_addr); lmreq.imr_interface.s_addr = socket_address->sin_addr.s_addr; #endif /* ACE_WIN32 || __INTERIX */ } diff --git a/ace/SOCK_SEQPACK_Acceptor.cpp b/ace/SOCK_SEQPACK_Acceptor.cpp index fa45e5d83a0..7ec5fadbbde 100644 --- a/ace/SOCK_SEQPACK_Acceptor.cpp +++ b/ace/SOCK_SEQPACK_Acceptor.cpp @@ -171,8 +171,7 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Addr &local_sap, if (protocol_family == PF_INET6) { sockaddr_in6 local_inet6_addr; - ACE_OS::memset (ACE_reinterpret_cast (void *, - &local_inet6_addr), + ACE_OS::memset (reinterpret_cast (&local_inet6_addr), 0, sizeof local_inet6_addr); @@ -183,15 +182,13 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Addr &local_sap, local_inet6_addr.sin6_addr = in6addr_any; } else - local_inet6_addr = *ACE_reinterpret_cast (sockaddr_in6 *, - local_sap.get_addr ()); + local_inet6_addr = *reinterpret_cast (local_sap.get_addr ()); // We probably don't need a bind_port written here. // There are currently no supported OS's that define // ACE_LACKS_WILDCARD_BIND. if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - &local_inet6_addr), + reinterpret_cast (&local_inet6_addr), sizeof local_inet6_addr) == -1) error = 1; } @@ -200,8 +197,7 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Addr &local_sap, if (protocol_family == PF_INET) { sockaddr_in local_inet_addr; - ACE_OS::memset (ACE_reinterpret_cast (void *, - &local_inet_addr), + ACE_OS::memset (reinterpret_cast (&local_inet_addr), 0, sizeof local_inet_addr); @@ -210,16 +206,14 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Addr &local_sap, local_inet_addr.sin_port = 0; } else - local_inet_addr = *ACE_reinterpret_cast (sockaddr_in *, - local_sap.get_addr ()); + local_inet_addr = *reinterpret_cast (local_sap.get_addr ()); if (local_inet_addr.sin_port == 0) { if (ACE::bind_port (this->get_handle ()) == -1) error = 1; } else if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - &local_inet_addr), + reinterpret_cast (&local_inet_addr), sizeof local_inet_addr) == -1) error = 1; } @@ -256,8 +250,7 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa if (protocol_family == PF_INET6) { sockaddr_in6 local_inet6_addr; - ACE_OS::memset (ACE_reinterpret_cast (void *, - &local_inet6_addr), + ACE_OS::memset (reinterpret_cast (&local_inet6_addr), 0, sizeof local_inet6_addr); @@ -268,15 +261,13 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa local_inet6_addr.sin6_addr = in6addr_any; } else - local_inet6_addr = *ACE_reinterpret_cast (sockaddr_in6 *, - local_sap.get_addr ()); + local_inet6_addr = *reinterpret_cast (local_sap.get_addr ()); // We probably don't need a bind_port written here. // There are currently no supported OS's that define // ACE_LACKS_WILDCARD_BIND. if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - &local_inet6_addr), + reinterpret_cast (&local_inet6_addr), sizeof local_inet6_addr) == -1) error = 1; } @@ -285,8 +276,7 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa if (protocol_family == PF_INET) { sockaddr_in local_inet_addr; - ACE_OS::memset (ACE_reinterpret_cast (void *, - &local_inet_addr), + ACE_OS::memset (reinterpret_cast (&local_inet_addr), 0, sizeof local_inet_addr); @@ -295,8 +285,7 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa local_inet_addr.sin_port = 0; } else - local_inet_addr = *ACE_reinterpret_cast (sockaddr_in *, - local_sap.get_addr ()); + local_inet_addr = *reinterpret_cast (local_sap.get_addr ()); // A port number of 0 means that the user is requesting that the // operating system choose an arbitrary, unused port. Since some @@ -362,8 +351,7 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa // bind the primary first if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast(sockaddr *, - &(local_inet_addrs[0])), + reinterpret_cast (&(local_inet_addrs[0])), sizeof(sockaddr)) == -1) { error = 1; @@ -391,8 +379,7 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa // now call bindx if (!error && sctp_bindx(this->get_handle (), - ACE_reinterpret_cast(sockaddr *, - local_sockaddr), + reinterpret_cast (local_sockaddr), num_addresses - 1, SCTP_BINDX_ADD_ADDR)) { @@ -405,9 +392,8 @@ ACE_SOCK_SEQPACK_Acceptor::shared_open (const ACE_Multihomed_INET_Addr &local_sa // Call bind size_t name_len = (sizeof local_inet_addr) * num_addresses; if (ACE_OS::bind (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - local_inet_addrs), - ACE_static_cast (int, name_len)) == -1) + reinterpret_cast (local_inet_addrs), + static_cast (name_len)) == -1) error = 1; #endif /* ACE_HAS_LKSCTP */ } diff --git a/ace/SOCK_SEQPACK_Association.cpp b/ace/SOCK_SEQPACK_Association.cpp index 671da106056..45eed58d1a4 100644 --- a/ace/SOCK_SEQPACK_Association.cpp +++ b/ace/SOCK_SEQPACK_Association.cpp @@ -57,7 +57,7 @@ ACE_SOCK_SEQPACK_Association::abort (void) if (-1 == ACE_OS::setsockopt (this->get_handle (), SOL_SOCKET, SO_LINGER, - ACE_reinterpret_cast (const char *, &slinger), + reinterpret_cast (&slinger), sizeof (linger))) { return -1; @@ -177,20 +177,19 @@ ACE_SOCK_SEQPACK_Association::get_local_addrs (ACE_INET_Addr *addrs, size_t &siz ** the number of bytes written to addr_structs. ** Use name_size to get the data types right across the call. */ - int name_size = ACE_static_cast (int, physical_size); + int name_size = static_cast (physical_size); if (ACE_OS::getsockname (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - addr_structs.get()), + reinterpret_cast (addr_structs.get()), &name_size) == -1) return -1; /* Calculate the NEW physical size of the array */ name_size /= sizeof (sockaddr_in); - size = ACE_static_cast (size_t, name_size); + size = static_cast (name_size); /* Copy each sockaddr_in to the address structure of an ACE_Addr from the passed-in array */ - const int addrlen (ACE_static_cast (int, sizeof (sockaddr_in))); + const int addrlen (static_cast (sizeof (sockaddr_in))); for (int i = 0; i < name_size; ++i) { addrs[i].set_addr (&(addr_structs[i]), addrlen); @@ -312,20 +311,19 @@ ACE_SOCK_SEQPACK_Association::get_remote_addrs (ACE_INET_Addr *addrs, size_t &si ** the number of bytes written to addr_structs. ** Use name_size to get the data types right across the call. */ - int name_size = ACE_static_cast (int, physical_size); + int name_size = static_cast (physical_size); if (ACE_OS::getpeername (this->get_handle (), - ACE_reinterpret_cast (sockaddr *, - addr_structs.get()), + reinterpret_cast (addr_structs.get()), &name_size) == -1) return -1; /* Calculate the NEW physical size of the array */ name_size /= sizeof (sockaddr_in); - size = ACE_static_cast (size_t, name_size); + size = static_cast (name_size); /* Copy each sockaddr_in to the address structure of an ACE_Addr from the passed-in array */ - const int addrlen (ACE_static_cast (int, sizeof (sockaddr_in))); + const int addrlen (static_cast (sizeof (sockaddr_in))); for (int i = 0; i < name_size; ++i) { addrs[i].set_addr (&(addr_structs[i]), addrlen); diff --git a/ace/SOCK_SEQPACK_Connector.cpp b/ace/SOCK_SEQPACK_Connector.cpp index 3db27f24e26..b7cb5471755 100644 --- a/ace/SOCK_SEQPACK_Connector.cpp +++ b/ace/SOCK_SEQPACK_Connector.cpp @@ -93,8 +93,7 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & if (local_sap != ACE_Addr::sap_any) { - sockaddr *laddr = ACE_reinterpret_cast (sockaddr *, - local_sap.get_addr ()); + sockaddr *laddr = reinterpret_cast (local_sap.get_addr ()); int size = local_sap.get_size (); if (ACE_OS::bind (new_association.get_handle (), @@ -149,8 +148,7 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & // bind to the primary addr first if (ACE_OS::bind(new_association.get_handle (), - ACE_reinterpret_cast(sockaddr *, - &(local_inet_addrs[0])), + reinterpret_cast (&(local_inet_addrs[0])), sizeof(sockaddr))) { ACE_Errno_Guard error (errno); @@ -167,8 +165,7 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & // get sockaddr_in for the local handle if (ACE_OS::getsockname(new_association.get_handle (), - ACE_reinterpret_cast(sockaddr *, - &portst), + reinterpret_cast (&portst), &sn)) { ACE_Errno_Guard error (errno); @@ -192,7 +189,7 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & // bind other ifaces if (sctp_bindx(new_association.get_handle(), - ACE_reinterpret_cast(sockaddr *, local_sockaddr), + reinterpret_cast (local_sockaddr), num_addresses - 1, SCTP_BINDX_ADD_ADDR)) { @@ -208,9 +205,8 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_start (ACE_SOCK_SEQPACK_Association & // Call bind size_t name_len = (sizeof (sockaddr_in)) * num_addresses; if (ACE_OS::bind (new_association.get_handle (), - ACE_reinterpret_cast (sockaddr *, - local_inet_addrs), - ACE_static_cast (int, name_len)) == -1) + reinterpret_cast (local_inet_addrs), + static_cast (name_len)) == -1) { // Save/restore errno. ACE_Errno_Guard error (errno); @@ -295,8 +291,7 @@ ACE_SOCK_SEQPACK_Connector::connect (ACE_SOCK_SEQPACK_Association &new_associati return -1; int result = ACE_OS::connect (new_association.get_handle (), - ACE_reinterpret_cast (sockaddr *, - remote_sap.get_addr ()), + reinterpret_cast (remote_sap.get_addr ()), remote_sap.get_size ()); return this->shared_connect_finish (new_association, @@ -328,8 +323,7 @@ ACE_SOCK_SEQPACK_Connector::connect (ACE_SOCK_SEQPACK_Association &new_associati return -1; int result = ACE_OS::connect (new_association.get_handle (), - ACE_reinterpret_cast (sockaddr *, - remote_sap.get_addr ()), + reinterpret_cast (remote_sap.get_addr ()), remote_sap.get_size ()); return this->shared_connect_finish (new_association, @@ -374,8 +368,7 @@ ACE_SOCK_SEQPACK_Connector::complete (ACE_SOCK_SEQPACK_Association &new_associat if (remote_sap != 0) { int len = remote_sap->get_size (); - sockaddr *addr = ACE_reinterpret_cast (sockaddr *, - remote_sap->get_addr ()); + sockaddr *addr = reinterpret_cast (remote_sap->get_addr ()); if (ACE_OS::getpeername (h, addr, &len) == -1) diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp index 294417c0511..735babf577a 100644 --- a/ace/Select_Reactor_Base.cpp +++ b/ace/Select_Reactor_Base.cpp @@ -686,7 +686,7 @@ ACE_Select_Reactor_Notify::open (ACE_Reactor_Impl *r, if (disable_notify_pipe == 0) { this->select_reactor_ = - ACE_dynamic_cast (ACE_Select_Reactor_Impl *, r); + dynamic_cast (r); if (select_reactor_ == 0) { diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index 16bfe2510c8..58d164b0de7 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -18,8 +18,9 @@ #include "ace/Reactor.h" #include "ace/Thread_Manager.h" #include "ace/DLL.h" -#include "ace/OS_NS_stdio.h" #include "ace/XML_Svc_Conf.h" +#include "ace/SString.h" +#include "ace/OS_NS_stdio.h" #include "ace/OS_NS_time.h" #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_stat.h" @@ -687,7 +688,7 @@ ACE_Service_Config::open_i (const ACE_TCHAR program_name[], { ACE_OS::fprintf (pidf, "%ld\n", - ACE_static_cast(long, ACE_OS::getpid())); + static_cast (ACE_OS::getpid())); ACE_OS::fclose (pidf); } } diff --git a/ace/Service_Config.h b/ace/Service_Config.h index 584c457dd3f..ff8363bc345 100644 --- a/ace/Service_Config.h +++ b/ace/Service_Config.h @@ -24,8 +24,7 @@ #include "ace/Unbounded_Queue.h" #include "ace/Unbounded_Set.h" -#include "ace/SString.h" -#include "ace/XML_Svc_Conf.h" +#include "ace/SStringfwd.h" #include "ace/OS_NS_signal.h" // Forward decl. @@ -41,7 +40,9 @@ class ACE_DLL; #if (ACE_USES_CLASSIC_SVC_CONF == 1) class ACE_Svc_Conf_Param; -#endif /* ACE_USES_CLASSIC_SVC_CONF ==1 */ +#else +class ACE_XML_Svc_Conf; +#endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */ extern "C" { @@ -156,15 +157,15 @@ public: /** * Performs an open without parsing command-line arguments. The - * indicates where to write the logging output, which + * @a logger_key indicates where to write the logging output, which * is typically either a STREAM pipe or a socket address. If - * is 1 then static services are not loaded, - * otherwise, they are loaded. If is + * @a ignore_static_svcs is 1 then static services are not loaded, + * otherwise, they are loaded. If @a ignore_default_svc_conf_file is * non-0 then the configuration file will be ignored. * Returns zero upon success, -1 if the file is not found or cannot * be opened (errno is set accordingly), otherwise returns the * number of errors encountered loading the services in the - * specified svc.conf configuration file. If is + * specified svc.conf configuration file. If @a ignore_debug_flag is * non-0 then the application is responsible for setting the * appropriately. */ @@ -218,7 +219,7 @@ public: * for setting the @c ACE_Log_Msg::priority_mask * appropriately. * - * @retval -1 the configuration file is not found or cannot + * @retval -1 The configuration file is not found or cannot * be opened (errno is set accordingly). * @retval 0 Success. * @retval >0 The number of errors encountered while processing @@ -452,11 +453,6 @@ private: #include "ace/Service_Config.inl" #endif /* __ACE_INLINE__ */ -// These must go here to avoid circular includes... (only left here -// for to not break applications which rely on this - no real need any -// longer) -#include "ace/Reactor.h" -#include "ace/Svc_Conf_Tokens.h" #include /**/ "ace/post.h" diff --git a/ace/Service_Object.cpp b/ace/Service_Object.cpp index 3db9dc257c7..42786291f87 100644 --- a/ace/Service_Object.cpp +++ b/ace/Service_Object.cpp @@ -61,7 +61,7 @@ ACE_Service_Type::~ACE_Service_Type (void) this->fini (); - delete [] (ACE_TCHAR *) this->name_; + delete [] const_cast (this->name_); } int @@ -121,6 +121,6 @@ ACE_Service_Type::name (const ACE_TCHAR *n) { ACE_TRACE ("ACE_Service_Type::name"); - delete [] (ACE_TCHAR *) this->name_; + delete [] const_cast (this->name_); this->name_ = ACE::strnew (n); } diff --git a/ace/Service_Object.h b/ace/Service_Object.h index 6cf4379cced..d96e5c59255 100644 --- a/ace/Service_Object.h +++ b/ace/Service_Object.h @@ -153,13 +153,13 @@ class ACE_Export ACE_Service_Object_Ptr { public: // = Initialization and termination methods. - /// Acquire ownership of the . + /// Acquire ownership of the @a so. ACE_Service_Object_Ptr (ACE_Service_Object *so); - /// Release the held by calling its hook. + /// Release the held ACE_Service_Object by calling its hook. ~ACE_Service_Object_Ptr (void); - /// Smart pointer to access the underlying . + /// Smart pointer to access the underlying ACE_Service_Object. ACE_Service_Object *operator-> (); private: diff --git a/ace/Service_Repository.cpp b/ace/Service_Repository.cpp index 4952f95fc1b..c872df591ff 100644 --- a/ace/Service_Repository.cpp +++ b/ace/Service_Repository.cpp @@ -112,8 +112,7 @@ ACE_Service_Repository::open (int size) ACE_Service_Type *[size], -1); - this->service_vector_ = ACE_const_cast (const ACE_Service_Type **, - temp); + this->service_vector_ = const_cast (temp); this->total_size_ = size; return 0; } @@ -154,8 +153,7 @@ ACE_Service_Repository::fini (void) ACE_LIB_TEXT ("finalizing %s\n"), this->service_vector_[i]->name ())); ACE_Service_Type *s = - ACE_const_cast (ACE_Service_Type *, - this->service_vector_[i]); + const_cast (this->service_vector_[i]); // Collect errors. retval += s->fini (); } @@ -182,8 +180,7 @@ ACE_Service_Repository::close (void) for (int i = this->current_size_ - 1; i >= 0; i--) { - ACE_Service_Type *s = ACE_const_cast (ACE_Service_Type *, - this->service_vector_[i]); + ACE_Service_Type *s = const_cast (this->service_vector_[i]); --this->current_size_; delete s; } @@ -284,8 +281,7 @@ ACE_Service_Repository::insert (const ACE_Service_Type *sr) } else { - s = ACE_const_cast (ACE_Service_Type *, - this->service_vector_[i]); + s = const_cast (this->service_vector_[i]); this->service_vector_[i] = sr; return_value = 0; } @@ -365,8 +361,7 @@ ACE_Service_Repository::remove (const ACE_TCHAR name[], ACE_Service_Type **ps) if (i == -1) return -1; - s = ACE_const_cast (ACE_Service_Type *, - this->service_vector_[i]); + s = const_cast (this->service_vector_[i]); --this->current_size_; if (this->current_size_ >= 1) diff --git a/ace/Service_Types.cpp b/ace/Service_Types.cpp index fb0b13c1837..e941bf4a610 100644 --- a/ace/Service_Types.cpp +++ b/ace/Service_Types.cpp @@ -46,7 +46,7 @@ ACE_Service_Type_Impl::~ACE_Service_Type_Impl (void) // It's ok to call this, even though we may have already deleted it // in the fini() method since it would then be NULL. - delete [] (ACE_TCHAR *) this->name_; + delete [] const_cast (this->name_); } int @@ -59,8 +59,8 @@ ACE_Service_Type_Impl::fini (void) const this->name_, this->flags_)); - delete [] (ACE_TCHAR *) this->name_; - ((ACE_Service_Type_Impl *) this)->name_ = 0; + delete [] const_cast (this->name_); + (const_cast (this))->name_ = 0; if (ACE_BIT_ENABLED (this->flags_, ACE_Service_Type::DELETE_OBJ)) @@ -74,7 +74,7 @@ ACE_Service_Type_Impl::fini (void) const if (ACE_BIT_ENABLED (this->flags_, ACE_Service_Type::DELETE_THIS)) - delete (ACE_Service_Type_Impl *) this; + delete const_cast (this); return 0; } diff --git a/ace/Signal.cpp b/ace/Signal.cpp index 0978b21fad3..ba6688c90e1 100644 --- a/ace/Signal.cpp +++ b/ace/Signal.cpp @@ -392,7 +392,7 @@ ACE_Sig_Handler::remove_handler (int signum, // Register either the new disposition or restore the default. return new_disp->register_action (signum, old_disp); } - else + return -1; } @@ -697,8 +697,8 @@ ACE_Sig_Handlers::register_handler (int signum, return ace_sig_adapter->sigkey (); } } - else - return -1; + + return -1; } // Remove the ACE_Event_Handler currently associated with . diff --git a/ace/Sock_Connect.cpp b/ace/Sock_Connect.cpp index 138f0150d09..caa60a11b2a 100644 --- a/ace/Sock_Connect.cpp +++ b/ace/Sock_Connect.cpp @@ -488,8 +488,8 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, ACE_LIB_TEXT ("ioctl (get broadaddr)"))); else { - ACE_OS::memcpy (ACE_reinterpret_cast(sockaddr_in *, &ip_addr), - ACE_reinterpret_cast(sockaddr_in *, &if_req.ifr_broadaddr), + ACE_OS::memcpy (reinterpret_cast (&ip_addr), + reinterpret_cast (&if_req.ifr_broadaddr), sizeof if_req.ifr_broadaddr); ACE_OS::memcpy ((void *) &host_addr, @@ -587,7 +587,7 @@ ACE::get_ip_interfaces (size_t &count, continue; // We assume IPv4 addresses here - addrp = ACE_reinterpret_cast(struct sockaddr_in *, &(lpii->iiAddress)); + addrp = reinterpret_cast (&(lpii->iiAddress)); if (addrp->sin_addr.s_addr == INADDR_ANY) continue; @@ -997,7 +997,7 @@ ACE::get_ip_interfaces (size_t &count, p_if->ifa_addr->sa_family == AF_INET) { struct sockaddr_in *addr = - ACE_reinterpret_cast(sockaddr_in *, p_if->ifa_addr); + reinterpret_cast (p_if->ifa_addr); // Sometimes the kernel returns 0.0.0.0 as the interface // address, skip those... @@ -1098,7 +1098,7 @@ ACE::get_ip_interfaces (size_t &count, { #if !defined(_UNICOS) struct sockaddr_in *addr = - ACE_reinterpret_cast(sockaddr_in *, &pcur->ifr_addr); + reinterpret_cast (&pcur->ifr_addr); // Sometimes the kernel returns 0.0.0.0 as the interface // address, skip those... diff --git a/ace/Stream_Modules.cpp b/ace/Stream_Modules.cpp index 6afe507f06b..3e4b4a6f1b7 100644 --- a/ace/Stream_Modules.cpp +++ b/ace/Stream_Modules.cpp @@ -143,7 +143,7 @@ ACE_Stream_Head::info (ACE_TCHAR **strp, size_t length) const return -1; else ACE_OS::strsncpy (*strp, name, length); - return ACE_static_cast (int, ACE_OS::strlen (name)); + return static_cast (ACE_OS::strlen (name)); } template int @@ -286,7 +286,7 @@ ACE_Stream_Tail::info (ACE_TCHAR **strp, size_t length) const return -1; else ACE_OS::strsncpy (*strp, name, length); - return ACE_static_cast (int, ACE_OS::strlen (name)); + return static_cast (ACE_OS::strlen (name)); } template int @@ -365,7 +365,7 @@ ACE_Thru_Task::info (ACE_TCHAR **strp, return -1; else ACE_OS::strsncpy (*strp, name, length); - return ACE_static_cast (int, ACE_OS::strlen (name)); + return static_cast (ACE_OS::strlen (name)); } template int diff --git a/ace/Svc_Conf.y b/ace/Svc_Conf.y index 002d4d59b00..c34b71eedcb 100644 --- a/ace/Svc_Conf.y +++ b/ace/Svc_Conf.y @@ -172,9 +172,7 @@ module svc_type, ACE_SVC_CONF_PARAM->yyerrno); ACE_Stream_Type *st = - ACE_dynamic_cast (ACE_Stream_Type *, - ACE_const_cast (ACE_Service_Type_Impl *, - module->record ()->type ())); + dynamic_cast (const_cast (module->record ()->type ())); if (mt->init (args.argc (), args.argv ()) == -1 || st->push (mt) == -1) @@ -224,9 +222,7 @@ module ACE_SVC_CONF_PARAM->yyerrno); ACE_Stream_Type *st = - ACE_dynamic_cast (ACE_Stream_Type *, - ACE_const_cast (ACE_Service_Type_Impl *, - stream->record ()->type ())); + dynamic_cast (const_cast (stream->record ()->type ())); if (mt != 0 && st->remove (mt) == -1) { ACE_ERROR ((LM_ERROR, @@ -363,9 +359,7 @@ ace_get_module (ACE_Static_Node *str_rec, const ACE_Service_Type_Impl *type = sr->type (); ACE_Stream_Type *st = sr == 0 ? 0 - : ACE_dynamic_cast (ACE_Stream_Type *, - ACE_const_cast (ACE_Service_Type_Impl *, - type)); + : dynamic_cast (const_cast (type)); ACE_Module_Type *mt = st == 0 ? 0 : st->find (svc_name); if (sr == 0 || st == 0 || mt == 0) diff --git a/ace/Svc_Conf_y.cpp b/ace/Svc_Conf_y.cpp index 96d83d8147e..9826310aebb 100644 --- a/ace/Svc_Conf_y.cpp +++ b/ace/Svc_Conf_y.cpp @@ -1079,9 +1079,7 @@ case 25: svc_type, ACE_SVC_CONF_PARAM->yyerrno); ACE_Stream_Type *st = - ACE_dynamic_cast (ACE_Stream_Type *, - ACE_const_cast (ACE_Service_Type_Impl *, - module->record ()->type ())); + dynamic_cast (const_cast (module->record ()->type ())); if (mt->init (args.argc (), args.argv ()) == -1 || st->push (mt) == -1) @@ -1135,9 +1133,7 @@ case 29: ACE_SVC_CONF_PARAM->yyerrno); ACE_Stream_Type *st = - ACE_dynamic_cast (ACE_Stream_Type *, - ACE_const_cast (ACE_Service_Type_Impl *, - stream->record ()->type ())); + dynamic_cast (const_cast (stream->record ()->type ())); if (mt != 0 && st->remove (mt) == -1) { ACE_ERROR ((LM_ERROR, @@ -1495,9 +1491,7 @@ ace_get_module (ACE_Static_Node *str_rec, const ACE_Service_Type_Impl *type = sr->type (); ACE_Stream_Type *st = sr == 0 ? 0 - : ACE_dynamic_cast (ACE_Stream_Type *, - ACE_const_cast (ACE_Service_Type_Impl *, - type)); + : dynamic_cast (const_cast (type)); ACE_Module_Type *mt = st == 0 ? 0 : st->find (svc_name); if (sr == 0 || st == 0 || mt == 0) diff --git a/ace/Svc_Handler.h b/ace/Svc_Handler.h index 8a9173a4bb7..2fd4f15320e 100644 --- a/ace/Svc_Handler.h +++ b/ace/Svc_Handler.h @@ -26,8 +26,8 @@ class ACE_Connection_Recycling_Strategy; #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Task.h" -#include "ace/Service_Config.h" #include "ace/Recyclable.h" +#include "ace/Reactor.h" /** * @class ACE_Svc_Handler diff --git a/ace/TLI.cpp b/ace/TLI.cpp index 22c747bade0..3efa611ef74 100644 --- a/ace/TLI.cpp +++ b/ace/TLI.cpp @@ -129,15 +129,15 @@ ACE_TLI::set_option (int level, int option, void *optval, int optlen) struct t_optmgmt req, ret; ACE_NEW_RETURN (req.opt.buf, char[sizeof (struct t_opthdr) + optlen], -1); # if (_XOPEN_SOURCE - 0 >= 500) - auto_ptr req_opt_buf_p (ACE_reinterpret_cast (char*, req.opt.buf)); + auto_ptr req_opt_buf_p (reinterpret_cast (req.opt.buf)); # else ACE_Auto_Array_Ptr req_opt_buf_p (req.opt.buf); # endif /* XPG5 vs XPG4 */ struct t_opthdr *opthdr = - ACE_reinterpret_cast (struct t_opthdr *, req.opt.buf); + reinterpret_cast (req.opt.buf); ACE_NEW_RETURN (ret.opt.buf, char[sizeof (struct t_opthdr) + optlen], -1); # if (_XOPEN_SOURCE - 0 >= 500) - auto_ptr ret_opt_buf_p (ACE_reinterpret_cast (char*, ret.opt.buf)); + auto_ptr ret_opt_buf_p (reinterpret_cast (ret.opt.buf)); # else ACE_Auto_Array_Ptr ret_opt_buf_p (ret.opt.buf); # endif /* XPG5 vs XPG4 */ @@ -167,7 +167,7 @@ ACE_TLI::set_option (int level, int option, void *optval, int optlen) return -1; } - opthdr = ACE_reinterpret_cast (struct opthdr *, this->so_opt_req.opt.buf); + opthdr = reinterpret_cast (this->so_opt_req.opt.buf); opthdr->level = level; opthdr->name = option; opthdr->len = OPTLEN (optlen); @@ -194,15 +194,15 @@ ACE_TLI::get_option (int level, int option, void *optval, int &optlen) struct t_optmgmt req, ret; ACE_NEW_RETURN (req.opt.buf, char[sizeof (struct t_opthdr)], -1); # if (_XOPEN_SOURCE - 0 >= 500) - auto_ptr req_opt_buf_p (ACE_reinterpret_cast (char*, req.opt.buf)); + auto_ptr req_opt_buf_p (reinterpret_cast (req.opt.buf)); # else ACE_Auto_Array_Ptr req_opt_buf_p (req.opt.buf); # endif /* XPG5 vs XPG4 */ struct t_opthdr *opthdr = - ACE_reinterpret_cast (struct t_opthdr *, req.opt.buf); + reinterpret_cast (req.opt.buf); ACE_NEW_RETURN (ret.opt.buf, char[sizeof (struct t_opthdr) + optlen], -1); # if (_XOPEN_SOURCE - 0 >= 500) - auto_ptr ret_opt_buf_p (ACE_reinterpret_cast (char*, ret.opt.buf)); + auto_ptr ret_opt_buf_p (reinterpret_cast (ret.opt.buf)); # else ACE_Auto_Array_Ptr ret_opt_buf_p (ret.opt.buf); # endif /* XPG5 vs XPG4 */ @@ -217,7 +217,7 @@ ACE_TLI::get_option (int level, int option, void *optval, int &optlen) return -1; else { - opthdr = ACE_reinterpret_cast (struct t_opthdr *, ret.opt.buf); + opthdr = reinterpret_cast (ret.opt.buf); if (opthdr->status == T_NOTSUPPORT) { errno = ENOTSUP; diff --git a/ace/TLI_Acceptor.cpp b/ace/TLI_Acceptor.cpp index 193a64aecb9..180bcc95717 100644 --- a/ace/TLI_Acceptor.cpp +++ b/ace/TLI_Acceptor.cpp @@ -160,7 +160,7 @@ open_new_endpoint (ACE_HANDLE listen_handle, #if defined (I_PUSH) && !defined (ACE_HAS_FORE_ATM_XTI) else if (rwf != 0 && ACE_OS::ioctl (fd, I_PUSH, - ACE_const_cast (char *, "tirdwr")) + const_cast ("tirdwr")) == ACE_INVALID_HANDLE) fd = ACE_INVALID_HANDLE; #else diff --git a/ace/TLI_Connector.cpp b/ace/TLI_Connector.cpp index 1a717f338b6..d48d854f8e1 100644 --- a/ace/TLI_Connector.cpp +++ b/ace/TLI_Connector.cpp @@ -178,7 +178,7 @@ ACE_TLI_Connector::connect (ACE_TLI_Stream &new_stream, if (new_stream.get_rwflag ()) result = ACE_OS::ioctl (new_stream.get_handle (), I_PUSH, - ACE_const_cast (char *, "tirdwr")); + const_cast ("tirdwr")); #endif /* I_PUSH */ } else if (!(errno == EWOULDBLOCK || errno == ETIME)) diff --git a/ace/TMCast/ACE_TMCast.pc.in b/ace/TMCast/ACE_TMCast.pc.in deleted file mode 100644 index a56956f81b2..00000000000 --- a/ace/TMCast/ACE_TMCast.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_TMCast -Description: ACE Transaction Multicast Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} -lACE_TMCast -Cflags: -I${includedir} diff --git a/ace/TMCast/Export.hpp b/ace/TMCast/Export.hpp deleted file mode 100644 index bf04f7ee114..00000000000 --- a/ace/TMCast/Export.hpp +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl ACE_TMCast -// ------------------------------ -#ifndef TMCAST_EXPORT_H -#define TMCAST_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (TMCAST_HAS_DLL) -# define TMCAST_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && TMCAST_HAS_DLL */ - -#if !defined (TMCAST_HAS_DLL) -#define TMCAST_HAS_DLL 1 -#endif /* ! TMCAST_HAS_DLL */ - -#if defined (TMCAST_HAS_DLL) && (TMCAST_HAS_DLL == 1) -# if defined (TMCAST_BUILD_DLL) -# define ACE_TMCast_Export ACE_Proper_Export_Flag -# define TMCAST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define TMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* TMCAST_BUILD_DLL */ -# define ACE_TMCast_Export ACE_Proper_Import_Flag -# define TMCAST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define TMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* TMCAST_BUILD_DLL */ -#else /* TMCAST_HAS_DLL == 1 */ -# define ACE_TMCast_Export -# define TMCAST_SINGLETON_DECLARATION(T) -# define TMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* TMCAST_HAS_DLL == 1 */ - -// Set TMCAST_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (TMCAST_NTRACE) -# if (ACE_NTRACE == 1) -# define TMCAST_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define TMCAST_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !TMCAST_NTRACE */ - -#if (TMCAST_NTRACE == 1) -# define TMCAST_TRACE(X) -#else /* (TMCAST_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define TMCAST_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (TMCAST_NTRACE == 1) */ - -#endif /* TMCAST_EXPORT_H */ - -// End of auto generated file. diff --git a/ace/TMCast/FaultDetector.hpp b/ace/TMCast/FaultDetector.hpp deleted file mode 100644 index c3de622806d..00000000000 --- a/ace/TMCast/FaultDetector.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// file : ACE_TMCast/FaultDetector.hpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#include "Protocol.hpp" - -namespace ACE_TMCast -{ - class FaultDetector - { - public: - FaultDetector () - : silence_period_ (-1) - { - } - - public: - class Failed {}; - - - void - insync () - { - silence_period_ = 0; - } - - void - outsync () - { - if (++silence_period_ >= Protocol::FATAL_SILENCE_FRAME) - { - // cerr << "Silence period has been passed." << endl; - // cerr << "Decalring the node failed." << endl; - throw Failed (); - } - } - - private: - short silence_period_; - }; -} diff --git a/ace/TMCast/Group.cpp b/ace/TMCast/Group.cpp deleted file mode 100644 index ac4484f4c67..00000000000 --- a/ace/TMCast/Group.cpp +++ /dev/null @@ -1,508 +0,0 @@ -// file : ACE_TMCast/Group.cpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#include "Group.hpp" - -#include - -// OS primitives -#include -#include -#include -#include - -#include "Messaging.hpp" - -#include "Protocol.hpp" - -// Components - -#include "LinkListener.hpp" -#include "FaultDetector.hpp" -#include "TransactionController.hpp" - -namespace ACE_TMCast -{ - bool - operator== (std::type_info const* pa, std::type_info const& b) - { - return *pa == b; - } - - // - // - // - class Terminate : public virtual Message {}; - - - // - // - // - class Failure : public virtual Message {}; - - - // - // - // - class Scheduler - { - public: - Scheduler (ACE_INET_Addr const& addr, - char const* id, - MessageQueue& out_send_data, - MessageQueue& out_recv_data, - MessageQueue& out_control) - - : cond_ (mutex_), - - addr_ (addr), - sock_ (), - - out_control_ (out_control), - - in_data_ (mutex_), - in_link_data_(mutex_), - in_control_ (mutex_), - - sync_schedule (ACE_OS::gettimeofday ()), - - transaction_controller_ (in_data_, out_send_data, out_recv_data) - { - ACE_OS::strncpy (id_, id, Protocol::MEMBER_ID_LENGTH); - id_[Protocol::MEMBER_ID_LENGTH - 1] = '\0'; - - sock_.set_option (IP_MULTICAST_TTL, 32); // @@ ttl is hardcoded - - in_data_.subscribe (cond_); - in_link_data_.subscribe (cond_); - in_control_.subscribe (cond_); - - if (ACE_OS::thr_create (&thread_thunk, - this, - THR_JOINABLE, - &thread_) != 0) ::abort (); - } - - virtual ~Scheduler () - { - { - MessageQueueAutoLock lock (in_control_); - - in_control_.push (MessagePtr (new Terminate)); - } - - if (ACE_OS::thr_join (thread_, &thread_, 0) != 0) ::abort (); - - // cerr << "Scheduler is down." << endl; - } - - public: - MessageQueue& - in_data () - { - return in_data_; - } - - private: - static ACE_THR_FUNC_RETURN - thread_thunk (void* arg) - { - Scheduler* obj = reinterpret_cast (arg); - obj->execute (); - return 0; - } - - void - execute () - { - try - { - sock_.join (addr_); - auto_ptr ll (new LinkListener (sock_, in_link_data_)); - - { - AutoLock lock (mutex_); - - // Loop - // - // - - while (true) - { - cond_.wait (&sync_schedule); - - // "Loop of Fairness" - - bool done = false; - - do - { - // control message - // - // - if (!in_control_.empty ()) - { - done = true; - break; - } - - // outsync - // - // - if (sync_schedule < ACE_OS::gettimeofday ()) - { - // OUTSYNC - - outsync (); - - // schedule next outsync - sync_schedule = - ACE_OS::gettimeofday () + - ACE_Time_Value (0, Protocol::SYNC_PERIOD); - } - - // link message - // - // - if (!in_link_data_.empty ()) - { - MessagePtr m (in_link_data_.front ()); - in_link_data_.pop (); - - std::type_info const* exp = &typeid (*m); - - if (exp == typeid (LinkFailure)) - { - // cerr << "link failure" << endl; - throw false; - } - else if (exp == typeid (LinkData)) - { - - LinkData* data = dynamic_cast (m.get ()); - - // INSYNC, TL, CT - - // Filter out loopback. - // - if (ACE_OS::strcmp (data->header().member_id.id, id_) != 0) - { - insync (); - transaction_list (); - current_transaction (data->header().current, - data->payload (), - data->size ()); - } - } - else - { - // cerr << "unknown message type from link listener: " - // << typeid (*m).name () << endl; - abort (); - } - } - - // api message - // - // - if (!in_data_.empty ()) - { - // API - - api (); - } - - } while (!in_link_data_.empty() || - sync_schedule < ACE_OS::gettimeofday ()); - - if (done) break; - } - } - } - catch (...) - { - // cerr << "Exception in scheduler loop." << endl; - MessageQueueAutoLock lock (out_control_); - out_control_.push (MessagePtr (new Failure)); - } - } - - // Events - // - // Order: - // - // INSYNC, TSL, VOTE, BEGIN - // API - // OUTSYNC - // - - void - insync () - { - fault_detector_.insync (); - } - - void - outsync () - { - char buf[Protocol::MAX_MESSAGE_SIZE]; - - Protocol::MessageHeader* hdr = - reinterpret_cast (buf); - - void* data = buf + sizeof (Protocol::MessageHeader); - - hdr->length = sizeof (Protocol::MessageHeader); - hdr->check_sum = 0; - - ACE_OS::strcpy (hdr->member_id.id, id_); - - size_t size (0); - - transaction_controller_.outsync (hdr->current, data, size); - - hdr->length += size; - - fault_detector_.outsync (); - - // sock_.send (buf, hdr->length, addr_); - sock_.send (buf, hdr->length); - } - - void - transaction_list () - { - } - - void - current_transaction (Protocol::Transaction const& t, - void const* payload, - size_t size) - { - transaction_controller_.current_transaction (t, payload, size); - } - - void - api () - { - transaction_controller_.api (); - } - - private: - ACE_thread_t thread_; - - ACE_Thread_Mutex mutex_; - ACE_Condition cond_; - - typedef ACE_Guard AutoLock; - - char id_[Protocol::MEMBER_ID_LENGTH]; - - ACE_INET_Addr addr_; - ACE_SOCK_Dgram_Mcast sock_; - - MessageQueue& out_control_; - - MessageQueue in_data_; - MessageQueue in_link_data_; - MessageQueue in_control_; - - // Protocol state - // - // - - ACE_Time_Value sync_schedule; - - FaultDetector fault_detector_; - TransactionController transaction_controller_; - }; - - - // - // - // - class Group::GroupImpl - { - public: - virtual ~GroupImpl () - { - } - - GroupImpl (ACE_INET_Addr const& addr, char const* id) - throw (Group::Failed) - : send_cond_ (mutex_), - recv_cond_ (mutex_), - failed_ (false), - in_send_data_ (mutex_), - in_recv_data_ (mutex_), - in_control_ (mutex_), - scheduler_ (new Scheduler (addr, - id, - in_send_data_, - in_recv_data_, - in_control_)), - out_data_ (scheduler_->in_data ()) - { - in_send_data_.subscribe (send_cond_); - in_recv_data_.subscribe (recv_cond_); - - in_control_.subscribe (send_cond_); - in_control_.subscribe (recv_cond_); - } - - void - send (void const* msg, size_t size) - throw (Group::InvalidArg, Group::Failed, Group::Aborted) - { - if (size > Protocol::MAX_PAYLOAD_SIZE) throw InvalidArg (); - - // Note the potential deadlock if I lock mutex_ and out_data_ in - // reverse order. - - MessageQueueAutoLock l1 (out_data_); - AutoLock l2 (mutex_); - - throw_if_failed (); - - out_data_.push (MessagePtr (new Send (msg, size))); - - l1.unlock (); // no need to keep it locked - - while (true) - { - throw_if_failed (); - - if (!in_send_data_.empty ()) - { - MessagePtr m (in_send_data_.front ()); - in_send_data_.pop (); - - std::type_info const* exp = &typeid (*m); - - if (exp == typeid (ACE_TMCast::Aborted)) - { - throw Group::Aborted (); - } - else if (exp == typeid (Commited)) - { - return; - } - else - { - // cerr << "send: group-scheduler messaging protocol violation; " - // << "unexpected message " << typeid (*m).name () - // << " " << typeid (Aborted).name () << endl; - - abort (); - } - } - - // cerr << "send: waiting on condition" << endl; - send_cond_.wait (); - // cerr << "send: wokeup on condition" << endl; - } - } - - - - size_t - recv (void* msg, size_t size) throw (Group::Failed, Group::InsufficienSpace) - { - AutoLock lock (mutex_); - - while (true) - { - throw_if_failed (); - - if (!in_recv_data_.empty ()) - { - MessagePtr m (in_recv_data_.front ()); - in_recv_data_.pop (); - - std::type_info const* exp = &typeid (*m); - - if (exp == typeid (Recv)) - { - Recv* data = dynamic_cast (m.get ()); - - if (size < data->size ()) throw Group::InsufficienSpace (); - - memcpy (msg, data->payload (), data->size ()); - - return data->size (); - } - else - { - // cerr << "recv: group-scheduler messaging protocol violation. " - // << "unexpected message " << typeid (*m).name () << endl; - - abort (); - } - } - - recv_cond_.wait (); - } - } - - private: - void - throw_if_failed () - { - if (!failed_ && !in_control_.empty ()) failed_ = true; - - if (failed_) throw Group::Failed (); - } - - private: - ACE_Thread_Mutex mutex_; - ACE_Condition send_cond_; - ACE_Condition recv_cond_; - - typedef ACE_Guard AutoLock; - - bool failed_; - - MessageQueue in_send_data_; - MessageQueue in_recv_data_; - MessageQueue in_control_; - - auto_ptr scheduler_; - - MessageQueue& out_data_; - }; - - - // Group - // - // - Group:: - Group (ACE_INET_Addr const& addr, char const* id) - throw (Group::Failed) - : pimpl_ (new GroupImpl (addr, id)) - { - } - - Group:: - ~Group () - { - } - - void - Group::send (void const* msg, size_t size) throw (Group::InvalidArg, Group::Failed, Group::Aborted) - { - pimpl_->send (msg, size); - } - - size_t - Group::recv (void* msg, size_t size) throw (Group::Failed, Group::InsufficienSpace) - { - return pimpl_->recv (msg, size); - } -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Condition; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Condition -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/TMCast/Group.hpp b/ace/TMCast/Group.hpp deleted file mode 100644 index 13c49f210bb..00000000000 --- a/ace/TMCast/Group.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// file : ACE_TMCast/Group.hpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#ifndef TMCAST_GROUP_HPP -#define TMCAST_GROUP_HPP - -#include -#include - -#include "Export.hpp" - -namespace ACE_TMCast -{ - class ACE_TMCast_Export Group - { - public: - class Aborted {}; - class Failed {}; - class InvalidArg {}; - class InsufficienSpace {}; - - public: - ~Group (); - - Group (ACE_INET_Addr const& addr, char const* id) throw (Failed); - - public: - void - send (void const* msg, size_t size) throw (InvalidArg, Failed, Aborted); - - size_t - recv (void* msg, size_t size) throw (Failed, InsufficienSpace); - - private: - bool - failed (); - - private: - class GroupImpl; - auto_ptr pimpl_; - - private: - Group (Group const&); - - Group& - operator= (Group const&); - }; -} - -#endif // TMCAST_GROUP_HPP diff --git a/ace/TMCast/GroupFwd.hpp b/ace/TMCast/GroupFwd.hpp deleted file mode 100644 index b4ed7304ff7..00000000000 --- a/ace/TMCast/GroupFwd.hpp +++ /dev/null @@ -1,15 +0,0 @@ -// file : ACE_TMCast/GroupFwd.hpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#ifndef TMCAST_GROUP_FWD_HPP -#define TMCAST_GROUP_FWD_HPP - -#include "Export.hpp" - -namespace ACE_TMCast -{ - class ACE_TMCast_Export Group; -} - -#endif // TMCAST_GROUP_FWD_HPP diff --git a/ace/TMCast/LinkListener.hpp b/ace/TMCast/LinkListener.hpp deleted file mode 100644 index adff941a229..00000000000 --- a/ace/TMCast/LinkListener.hpp +++ /dev/null @@ -1,168 +0,0 @@ -// file : ACE_TMCast/LinkListener.hpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -// OS primitives -#include -#include -#include -#include - - -#include "Messaging.hpp" -#include "Protocol.hpp" - -namespace ACE_TMCast -{ - // - // - // - class LinkFailure : public virtual Message {}; - - - // - // - // - class LinkData : public virtual Message - { - public: - LinkData (Protocol::MessageHeader const* header, - void* payload, - size_t size) - : size_ (size) - { - ACE_OS::memcpy (&header_, header, sizeof (Protocol::MessageHeader)); - ACE_OS::memcpy (payload_, payload, size_); - } - - Protocol::MessageHeader const& - header () const - { - return header_; - } - - void const* - payload () const - { - return payload_; - } - - size_t - size () const - { - return size_; - } - - private: - Protocol::MessageHeader header_; - char payload_[Protocol::MAX_MESSAGE_SIZE]; - size_t size_; - }; - - typedef - ACE_Refcounted_Auto_Ptr - LinkDataPtr; - - // - // - // - class LinkListener - { - private: - class Terminate : public virtual Message {}; - - public: - LinkListener (ACE_SOCK_Dgram_Mcast& sock, MessageQueue& out) - : sock_(sock), out_ (out) - { - if (ACE_OS::thr_create (&thread_thunk, - this, - THR_JOINABLE, - &thread_) != 0) ::abort (); - } - - ~LinkListener () - { - { - MessageQueueAutoLock lock (control_); - - control_.push (MessagePtr (new Terminate)); - } - - if (ACE_OS::thr_join (thread_, &thread_, 0) != 0) ::abort (); - - // cerr << "Link listener is down." << endl; - } - - - static ACE_THR_FUNC_RETURN - thread_thunk (void* arg) - { - LinkListener* obj = reinterpret_cast (arg); - - obj->execute (); - return 0; - } - - void - execute () - { - char msg[Protocol::MAX_MESSAGE_SIZE]; - - ssize_t header_size = sizeof (Protocol::MessageHeader); - - // OS::Time timeout (1000000); // one millisecond - - ACE_Time_Value timeout (0, 1000); // one millisecond - - try - { - while (true) - { - // Check control message queue - - { - MessageQueueAutoLock lock (control_); - - if (!control_.empty ()) break; - } - - ACE_INET_Addr junk; - ssize_t n = sock_.recv (msg, - Protocol::MAX_MESSAGE_SIZE, - junk, - 0, - &timeout); - - if (n != -1) - { - if (n < header_size) throw false; - - Protocol::MessageHeader* header = - reinterpret_cast (msg); - - MessageQueueAutoLock lock (out_); - - out_.push (MessagePtr (new LinkData (header, - msg + header_size, - n - header_size))); - } - } - } - catch (...) - { - MessageQueueAutoLock lock (out_); - - out_.push (MessagePtr (new LinkFailure)); - } - } - - private: - typedef ACE_Guard AutoLock; - - ACE_thread_t thread_; - ACE_SOCK_Dgram_Mcast& sock_; - MessageQueue& out_; - MessageQueue control_; - }; -} diff --git a/ace/TMCast/MTQueue.cpp b/ace/TMCast/MTQueue.cpp deleted file mode 100644 index 32d10eb23b7..00000000000 --- a/ace/TMCast/MTQueue.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// file : ACE_TMCast/MTQueue.cpp -// author : Steve Huston -// cvs-id : $Id$ - -#include "LinkListener.hpp" -#include "MTQueue.hpp" - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Node >; -template class ACE_Unbounded_Queue >; -template class ACE_Unbounded_Queue_Iterator >; -template class ACE_Node* >; -template class ACE_Unbounded_Set* >; -template class ACE_Unbounded_Set_Iterator *>; -template class ACE_Unbounded_Set_Const_Iterator *>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Node > -#pragma instantiate ACE_Unbounded_Queue > -#pragma instantiate ACE_Unbounded_Queue_Iterator > -#pragma instantiate ACE_Node *> -#pragma instantiate ACE_Unbounded_Set *> -#pragma instantiate ACE_Unbounded_Set_Iterator *> -#pragma instantiate ACE_Unbounded_Set_Const_Iterator *> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/TMCast/MTQueue.hpp b/ace/TMCast/MTQueue.hpp deleted file mode 100644 index 47fafa943c1..00000000000 --- a/ace/TMCast/MTQueue.hpp +++ /dev/null @@ -1,176 +0,0 @@ -// file : ACE_TMCast/MTQueue.hpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#ifndef TMCAST_MT_QUEUE_HPP -#define TMCAST_MT_QUEUE_HPP - -#include "ace/Auto_Ptr.h" -#include "ace/Unbounded_Set.h" -#include "ace/Unbounded_Queue.h" -#include "ace/os_include/sys/os_types.h" - -namespace ACE_TMCast -{ - template > - class MTQueue - { - public: - typedef T ElementType; - typedef M MutexType; - typedef C ConditionalType; - typedef Q QueueType; - - public: - - MTQueue () - : mutexp_ (new MutexType), - mutex_ (*mutexp_), - queue_ (), - signal_ (false) - { - } - - MTQueue (MutexType& mutex) - : mutexp_ (), - mutex_ (mutex), - queue_ (), - signal_ (false) - { - } - - public: - bool - empty () const - { - return queue_.is_empty (); - } - - size_t - size () const - { - return queue_.size (); - } - - // typedef typename QueueType::Empty Empty; - - class Empty {}; - - T& - front () - { - ACE_Unbounded_Queue_Iterator f (queue_); - T* tmp; - if (!f.next (tmp)) throw Empty (); - - return *tmp; - } - - - T const& - front () const - { - ACE_Unbounded_Queue_Const_Iterator f (queue_); - T* tmp; - if (!f.next (tmp)) throw Empty (); - - return *tmp; - } - - /* - T& - back () - { - return queue_.back (); - } - - - T const& - back () const - { - return queue_.back (); - } - */ - - void - push (T const& t) - { - signal_ = empty (); - queue_.enqueue_tail (t); - } - - void - pop () - { - T junk; - queue_.dequeue_head (junk); - } - - public: - void - lock () const - { - mutex_.acquire (); - } - - void - unlock () const - { - if (signal_) - { - signal_ = false; - - for (ConditionalSetConstIterator_ i (cond_set_); - !i.done (); - i.advance ()) - { - ConditionalType** c; - - i.next (c); - - (*c)->signal (); - } - } - - mutex_.release (); - } - - void - subscribe (ConditionalType& c) - { - //@@ should check for duplicates - // - cond_set_.insert (&c); - } - - void - unsubscribe (ConditionalType& c) - { - //@@ should check for absence - // - cond_set_.remove (&c); - } - - private: - auto_ptr mutexp_; - MutexType& mutex_; - QueueType queue_; - - typedef - ACE_Unbounded_Set - ConditionalSet_; - - typedef - ACE_Unbounded_Set_Const_Iterator - ConditionalSetConstIterator_; - - ConditionalSet_ cond_set_; - - mutable bool signal_; - }; -} - -#endif // TMCAST_MT_QUEUE_HPP diff --git a/ace/TMCast/Makefile.am b/ace/TMCast/Makefile.am deleted file mode 100644 index ec78776e1a3..00000000000 --- a/ace/TMCast/Makefile.am +++ /dev/null @@ -1,66 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu - -includedir = @includedir@/ace/TMCast -pkgconfigdatadir = ${prefix}/lib/pkgconfig - -ACE_BUILDDIR = $(top_builddir) -ACE_ROOT = $(top_srcdir) - -nobase_include_HEADERS = -lib_LTLIBRARIES = -## Makefile.TMCast.am - -if BUILD_EXCEPTIONS -if BUILD_THREADS -lib_LTLIBRARIES += libACE_TMCast.la - -libACE_TMCast_la_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -DTMCAST_BUILD_DLL - -libACE_TMCast_la_SOURCES = \ - Group.cpp \ - MTQueue.cpp \ - Protocol.cpp - -libACE_TMCast_la_LDFLAGS = \ - -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ - -libACE_TMCast_la_LIBADD = \ - $(top_builddir)/ace/libACE.la - -nobase_include_HEADERS += \ - Export.hpp \ - FaultDetector.hpp \ - Group.hpp \ - GroupFwd.hpp \ - LinkListener.hpp \ - MTQueue.hpp \ - Messaging.hpp \ - Protocol.hpp \ - TransactionController.hpp - -pkgconfigdata_DATA = ACE_TMCast.pc - -ACE_TMCast.pc: ${top_builddir}/config.status ACE_TMCast.pc.in - ${top_builddir}/config.status --file $@:${srcdir}/ACE_TMCast.pc.in - -endif BUILD_THREADS -endif BUILD_EXCEPTIONS - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ace/TMCast/Messaging.hpp b/ace/TMCast/Messaging.hpp deleted file mode 100644 index 886745d1120..00000000000 --- a/ace/TMCast/Messaging.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// file : ACE_TMCast/Messaging.hpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#ifndef TMCAST_MESSAGING_HPP -#define TMCAST_MESSAGING_HPP - -#include -#include - -#include "MTQueue.hpp" - -namespace ACE_TMCast -{ - class Message - { - public: - virtual - ~Message () {} - }; - - typedef - ACE_Refcounted_Auto_Ptr - MessagePtr; - - typedef - MTQueue > - MessageQueue; - - struct MessageQueueAutoLock - { - MessageQueueAutoLock (MessageQueue& q) - : q_ (q) - { - q_.lock (); - } - - void - unlock () - { - q_.unlock (); - } - - ~MessageQueueAutoLock () - { - q_.unlock (); - } - - private: - MessageQueue& q_; - }; -} - -#endif // TMCAST_MESSAGING_HPP diff --git a/ace/TMCast/Protocol.cpp b/ace/TMCast/Protocol.cpp deleted file mode 100644 index ea4c6b39020..00000000000 --- a/ace/TMCast/Protocol.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// file : ACE_TMCast/Protocol.cpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#include "Protocol.hpp" - -namespace ACE_TMCast -{ - namespace Protocol - { - /* - namespace - { - char const* labels[] = { - "NONE", "BEGIN", "COMMIT", "ABORT", "COMMITED", "ABORTED"}; - } - - std::string - tslabel (Protocol::TransactionStatus s) - { - return labels[s]; - } - - std::ostream& - operator << (std::ostream& o, Transaction const& t) - { - return o << "{" << t.id << "; " << tslabel (t.status) << "}"; - } - */ - } -} diff --git a/ace/TMCast/Protocol.hpp b/ace/TMCast/Protocol.hpp deleted file mode 100644 index 6cdf374f4f9..00000000000 --- a/ace/TMCast/Protocol.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// file : ACE_TMCast/Protocol.hpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#ifndef TMCAST_PROTOCOL_HPP -#define TMCAST_PROTOCOL_HPP - -namespace ACE_TMCast -{ - namespace Protocol - { - // - // - // - unsigned long const MEMBER_ID_LENGTH = 38; - - struct MemberId - { - char id[MEMBER_ID_LENGTH]; - /* - unsigned long ip; - unsigned short port; - */ - }; - - // - // - // - typedef unsigned short TransactionId; - - - - typedef unsigned char TransactionStatus; - - TransactionStatus const TS_BEGIN = 1; - TransactionStatus const TS_COMMIT = 2; - TransactionStatus const TS_ABORT = 3; - TransactionStatus const TS_COMMITED = 4; - TransactionStatus const TS_ABORTED = 5; - - struct Transaction - { - TransactionId id; - TransactionStatus status; - }; - - // Transaction List (TL) - - // unsigned long const TL_LENGTH = 1; - - // typedef Transaction TransactionList[TL_LENGTH]; - - - // - // - // - struct MessageHeader - { - unsigned long length; - - unsigned long check_sum; - - MemberId member_id; - - Transaction current; - - //TransactionList transaction_list; - }; - - - // - // - // - - unsigned long const MAX_MESSAGE_SIZE = 768; - - unsigned long const - MAX_PAYLOAD_SIZE = MAX_MESSAGE_SIZE - sizeof (MessageHeader); - - // Protocol timing - // - // - - unsigned long const SYNC_PERIOD = 30000; // in mks - - unsigned short const VOTING_FRAME = 4; // in SYNC_PERIOD's - unsigned short const SEPARATION_FRAME = 5; // in SYNC_PERIOD's - - // FATAL_SILENCE_FRAME in SYNC_PERIOD's - // Generally it's a good idea to set it to < VOTING_FRAME + SEPARATION_FRAME - // - - short const FATAL_SILENCE_FRAME = VOTING_FRAME + SEPARATION_FRAME - 2; - - // short const FATAL_SILENCE_FRAME = 10000; - - // Helpers - - // std::string - // tslabel (Protocol::TransactionStatus s); - - // std::ostream& - // operator << (std::ostream& o, Transaction const& t); - } -} - -#endif // TMCAST_PROTOCOL_HPP diff --git a/ace/TMCast/README b/ace/TMCast/README deleted file mode 100644 index 9600b17fe2c..00000000000 --- a/ace/TMCast/README +++ /dev/null @@ -1,240 +0,0 @@ - - -Introduction ------------- - -TMCast (stands for Transaction MultiCast) is an implementation of a -transactional multicast protocol. In essence, the idea is to represent -each message delivery to members of a multicast group as a transaction -- an atomic, consistent and isolated action. A multicast transaction -can be viewed as an atomic transition of the group members to a new -state. If we define [Mo] as a set of operational (non-faulty) members -of the group, [Mf] as a set of faulty members of the group, [Ma] as a -set of members that view transition [Tn] as aborted and [Mc] as a set -of members that view transition [Tn] as committed, then this atomic -transition [Tn] should satisfy one of the following equations: - -Mo(Tn-1) = Ma(T) U Mf(T) -Mo(Tn-1) = Mc(T) U Mf(T) - -Or, in other words, after transaction T has been committed (aborted), -all operational (before transaction T) members are either in the -committed (aborted) or failed state. - -Thus, for each member of the group, outcome of the transaction can be -commit, abort or a member failure. It is important for a member to -exhibit a failfast (error latency is less than transaction cycle) -behavior. Or, in other words, if a member transitioned into a wrong -state, it is guaranteed to fail instead of delivering a wrong result. - -In order to achieve such an error detection in a decentralized -environment, certain limitations were imposed. One of the most -user-visible limitation is the fact that the lifetime of the group -with only one member is very short. This is because there is not way -for a member to distinguish "no members yet" case from "my link to the -group is down". In such a situation, the member assumes the latter -case. There is also a military saying that puts it quite nicely: two -is one, one is nothing. - - - -State of Implementation ------------------------ - -The current implementation is in a prototypical stage. The following -parts are not implemented or still under development: - -* Handling of network partitioning (TODO) - -* Redundant network support (TODO) - -* Member failure detection (partial implementation) - - -Examples --------- - -There is a simple example available in examples/TMCast/Member with -the corresponding README. - - -Architecture ------------- - -Primary goals of the protocol are to (1) mask transient failures of the -underlying multicast protocol (or, more precisely, allow to recover -from transient failures) and (2) exhibit failfast behavior in cases of -permanent failures. - -The distinction between transient and permanent failures is based on -timeouts thus what can be a transient failure in one configuration of -the protocol could be a permanent failure in the other. - -[Maybe talk more about a transient/permanent threshold and its effect -on performance/resource utilization/etc.] - -[Maybe add a terminology section.] - -Each member of a multicast group has its unique (group-wise) id: - -struct MemberId -{ - char id[MEMBER_ID_LENGTH]; -}; - -Each payload delivery is part of a transaction. Each transaction is -identified by TransactionId: - -typedef unsigned short TransactionId; - - -Each transaction has a status code which identifies its state, as viewed by -a group member: - - -typedef unsigned char TransactionStatus; - -TransactionStatus const TS_BEGIN = 1; -TransactionStatus const TS_COMMIT = 2; -TransactionStatus const TS_ABORT = 3; -TransactionStatus const TS_COMMITTED = 4; -TransactionStatus const TS_ABORTED = 5; - -Thus each transaction is described by its id and status: - -struct Transaction -{ - TransactionId id; - TransactionStatus status; -}; - -The outcome of some predefined number of recent transactions is stored -in TransactionList: - -typedef Transaction TransactionList[TL_LENGTH]; - - -Each message sent to a multicast group has the following header: - -struct MessageHeader -{ - unsigned long length; - unsigned long check_sum; - MemberId member_id; - Transaction current; - TransactionList transaction_list; -}; - -[Maybe describe each field here.] - -A new member joins the group with transaction id 0 and status -TS_COMMITTED. - -Each member sends a periodic 'pulse' messages with some predefined interval -advertising its current view of the group. This includes the state of the -current transaction and the history of the recent transactions. - - -If a member of the group needs a payload delivery it starts a new -transaction by sending a message with current transaction set to - -{++current_id, TS_BEGIN} - -and payload appended after the header. - - -Each member joins a transaction in one of the following ways: - -* A member that began the transaction joins it 'to commit' (TS_COMMIT) - -* A member that received TS_BEGIN joins current transaction 'to commit' - (TS_COMMIT). - -* A member that received TS_COMMIT or TS_ABORT but did not receive TS_BEGIN - joins current transaction 'to abort' (TS_ABORT). - - -After a member has joined the transaction it starts participating in the -transaction's voting phase. On this phase members of the group decide the -fate of the transaction. Each member sends a predefined number of messages -where it announces its vote. In between those messages the member is receiving -and processing votes from other members and can be influenced by their -'opinion'. - -In their decision-making, members follow the principle of the majority. As -the voting progresses (and comes close to an end) members become more and -more reluctant to deviate from the decision of the majority. - -[Maybe add an equation that measures member's willingness to change -its mind.] - -At the end of the voting phase each member declares the current transaction -either committed (TS_COMMITTED) or aborted (TS_ABORTED). If this decision does -not agree with the majority the member declares itself failed. - -In addition, each member builds a 'majority view' of the transaction history -(based on transaction_list). If it deviates from the member's own history the -member declares itself failed. - -Here are some example scenarios of how the protocol behaves in different -situations. Let's say we have three members of the group S, R1, R2. S -initiates a transaction. R1 and R2 join it. - -Scenario 1. (two-step voting) - -1. S initiates a transaction (TS_BEGIN) -2a. R1 receives TS_BEGIN, joins for commit -2b. R2 receives TS_BEGIN, joins for commit -3a. S announces TS_COMMIT (first vote) -3b. R1 announces TS_COMMIT (first vote) -3c. R2 announces TS_COMMIT (first vote) -4a. S announces TS_COMMIT (second vote) -4b. R1 announces TS_COMMIT (second vote) -4c. R2 announces TS_COMMIT (second vote) -5a. S announces TS_COMMITTED (end of vote) -5b. R1 announces TS_COMMITTED (end of vote) -5c. R2 announces TS_COMMITTED (end of vote) - - -Scenario 2. (two-step voting) - -1. S initiates a transaction (TS_BEGIN) -2a. R1 receives TS_BEGIN, joins for commit -2b. R2 didn't receive TS_BEGIN -3a. S announces TS_COMMIT (first vote) -3b. R1 announces TS_COMMIT (first vote) -3c. R2 received R1's TS_COMMIT announces TS_ABORT (first vote) -4a. S received R2's TS_ABORT announces TS_ABORT (second vote) -4b. R1 received R2's TS_ABORT announces TS_ABORT (second vote) -4c. R2 announces TS_ABORT (second vote) -5a. S announces TS_ABORTED (end of vote) -5b. R1 announces TS_ABORTED (end of vote) -5c. R2 announces TS_ABORTED (end of vote) - - -Scenario 3. (three-step voting) - -1. S initiates a transaction (TS_BEGIN) -2a. R1 receives TS_BEGIN, joins for commit -2b. R2 didn't receive TS_BEGIN -3a. S announces TS_COMMIT (first vote) -3b. R1 announces TS_COMMIT (first vote) -3c. R2 still didn't receive anything -4a. S announces TS_COMMIT (second vote) -4b. R1 announces TS_COMMIT (second vote) -4c. R2 received R1's TS_COMMIT, announces TS_ABORT (first vote) - -5a. S received R2's TS_ABORT but it is the end of the voting phase and - majority (S and R1) vote for commit, announces TS_COMMIT (third vote) -5b. R1 received R2's TS_ABORT but it is the end of the voting phase and - majority (S and R1) vote for commit, announces TS_COMMIT (third vote) -5c. R2 announces TS_ABORT (second vote) - -6a. S announces TS_COMMITTED (end of vote) -6b. R1 announces TS_COMMITTED (end of vote) -6c. R2 discovers that the the majority has declared current transaction - committed and thus declares itself failed. - - --- -Boris Kolpackov diff --git a/ace/TMCast/TMCast.mpc b/ace/TMCast/TMCast.mpc deleted file mode 100644 index 28bebc8bcba..00000000000 --- a/ace/TMCast/TMCast.mpc +++ /dev/null @@ -1,7 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : acelib, core, exceptions, threads { - sharedname = ACE_TMCast - dynamicflags += TMCAST_BUILD_DLL -} diff --git a/ace/TMCast/TransactionController.hpp b/ace/TMCast/TransactionController.hpp deleted file mode 100644 index cbeb0f5a7c9..00000000000 --- a/ace/TMCast/TransactionController.hpp +++ /dev/null @@ -1,387 +0,0 @@ -// file : ACE_TMCast/TransactionController.hpp -// author : Boris Kolpackov -// cvs-id : $Id$ - -#include "ace/OS_NS_string.h" -#include "ace/Synch.h" -#include "ace/Refcounted_Auto_Ptr.h" - -#include "Protocol.hpp" -#include "Messaging.hpp" - -#include - -namespace ACE_TMCast -{ - - // Messages - // - // - class Send : public virtual Message - { - public: - Send (void const* msg, size_t size) - : size_ (size) - { - ACE_OS::memcpy (payload_, msg, size_); - } - - void const* - payload () const - { - return payload_; - } - - size_t - size () const - { - return size_; - } - - private: - size_t size_; - char payload_[Protocol::MAX_PAYLOAD_SIZE]; - }; - - typedef - ACE_Refcounted_Auto_Ptr - SendPtr; - - - class Recv : public virtual Message - { - public: - Recv (void const* msg, size_t size) - : size_ (size) - { - ACE_OS::memcpy (payload_, msg, size_); - } - - void const* - payload () const - { - return payload_; - } - - size_t - size () const - { - return size_; - } - - private: - size_t size_; - char payload_[Protocol::MAX_PAYLOAD_SIZE]; - }; - - typedef - ACE_Refcounted_Auto_Ptr - RecvPtr; - - class Aborted : public virtual Message {}; - - class Commited : public virtual Message {}; - - - // - // - // - class TransactionController - { - public: - TransactionController (MessageQueue& in, - MessageQueue& send_out, - MessageQueue& recv_out) - : trace_ (false), - voting_duration_ (0), - separation_duration_ (0), - in_ (in), - send_out_ (send_out), - recv_out_ (recv_out) - { - current_.id = 0; - current_.status = Protocol::TS_COMMITED; - } - - public: - class Failure {}; - - - void - outsync (Protocol::Transaction& c, void* payload, size_t& size) - { - if (current_.status == Protocol::TS_COMMIT || - current_.status == Protocol::TS_ABORT) - { - if (++voting_duration_ >= Protocol::VOTING_FRAME) - { - // end of voting frame - - if (current_.status == Protocol::TS_COMMIT) - { - { - if (initiated_) - { - MessageQueueAutoLock lock (send_out_); - send_out_.push (MessagePtr (new Commited)); - } - else // joined transaction - { - MessageQueueAutoLock lock (recv_out_); - recv_out_.push (MessagePtr (recv_.release ())); - recv_ = RecvPtr (); - } - } - - current_.status = Protocol::TS_COMMITED; - - // if (trace_) cerr << "commited transaction with id " - // << current_.id << endl; - } - else // TS_ABORT - { - if (initiated_) - { - MessageQueueAutoLock lock (send_out_); - send_out_.push (MessagePtr (new Aborted)); - } - else - { - // free revc_ buffer if necessary - // - if (recv_.get ()) recv_ = RecvPtr (); - } - - - current_.status = Protocol::TS_ABORTED; - - // if (trace_) cerr << "aborted transaction with id " - // << current_.id << endl; - } - - // start transaction separation frame (counts down) - // +1 because it will be decremented on this iteration - separation_duration_ = Protocol::SEPARATION_FRAME + 1; - } - } - - // Set current outsync info - - c.id = current_.id; - c.status = current_.status; - - - // Do some post-processing - - switch (current_.status) - { - case Protocol::TS_COMMITED: - case Protocol::TS_ABORTED: - { - if (separation_duration_ > 0) --separation_duration_; - break; - } - case Protocol::TS_BEGIN: - { - // transfer payload - - size = send_->size (); - memcpy (payload, send_->payload (), size); - - send_ = SendPtr (); - - // get redy to vote for 'commit' - - current_.status = Protocol::TS_COMMIT; - voting_duration_ = 0; - } - } - } - - void - current_transaction (Protocol::Transaction const& t, - void const* payload, - size_t size) - { - Protocol::TransactionId& id = current_.id; - Protocol::TransactionStatus& s = current_.status; - - if (id == 0 && t.id != 0) // catch up - { - switch (t.status) - { - case Protocol::TS_BEGIN: - case Protocol::TS_COMMIT: - case Protocol::TS_ABORT: - { - id = t.id - 1; - s = Protocol::TS_COMMITED; - break; - } - case Protocol::TS_ABORTED: - case Protocol::TS_COMMITED: - { - id = t.id; - s = t.status; - break; - } - } - - // if (trace_) cerr << "caught up with id " << id << endl; - } - - bool stable (s == Protocol::TS_COMMITED || s == Protocol::TS_ABORTED); - - switch (t.status) - { - case Protocol::TS_BEGIN: - { - if (!stable || t.id != id + 1) - { - // Transaction is in progress or hole in transaction id's - - // cerr << "unexpected request to join " << t - // << " while on " << current_ << endl; - - // if (!stable) cerr << "voting progress is " << voting_duration_ - // << "/" << Protocol::VOTING_FRAME << endl; - - if (t.id == id) // collision - { - if (!stable && s != Protocol::TS_ABORT) - { - // abort both - // cerr << "aborting both transactions" << endl; - - s = Protocol::TS_ABORT; - voting_duration_ = 0; //@@ reset voting frame - } - } - else - { - // @@ delicate case. need to think more - - // cerr << "Declaring node failed." << endl; - throw Failure (); - } - } - else - { - // join the transaction - - initiated_ = false; - - recv_ = RecvPtr (new Recv (payload, size)); - - id = t.id; - s = Protocol::TS_COMMIT; - voting_duration_ = 0; - - // if (trace_) cerr << "joining-for-commit transaction with id " - // << id << endl; - } - break; - } - case Protocol::TS_COMMIT: - { - if (stable && id == t.id - 1) - { - // not begin and and we haven't joined - - // join for abort - - initiated_ = false; - - current_.id = t.id; - current_.status = Protocol::TS_ABORT; - voting_duration_ = 0; - - // if (trace_) cerr << "joining-for-abort transaction with id " - // << current_.id << endl; - } - break; - } - case Protocol::TS_ABORT: - { - if ((!stable && id == t.id && s == Protocol::TS_COMMIT) || - (stable && id == t.id - 1)) // abort current || new transaction - { - // if (trace_) cerr << "voting-for-abort on transaction with id " - // << current_.id << endl; - - id = t.id; - s = Protocol::TS_ABORT; - - voting_duration_ = 0; //@@ reseting voting_duration_ - } - else - { - } - - break; - } - case Protocol::TS_ABORTED: - case Protocol::TS_COMMITED: - { - // nothing for now - break; - } - } - } - - void - api () - { - if ((current_.status == Protocol::TS_COMMITED || - current_.status == Protocol::TS_ABORTED) && - separation_duration_ == 0) // no transaction in progress - { - // start new transaction - - // Note that in_ is already locked by Scheduler - - MessagePtr m (in_.front ()); - in_.pop (); - - if (typeid (*m) == typeid (Send)) - { - send_ = SendPtr (dynamic_cast (m.release ())); - } - else - { - // cerr << "Expecting Send but received " << typeid (*m).name () - // << endl; - - ::abort (); - } - - current_.id++; - current_.status = Protocol::TS_BEGIN; - - initiated_ = true; - - // if (trace_) cerr << "starting transaction with id " << current_.id - // << endl; - } - } - - private: - typedef ACE_Guard AutoLock; - - bool trace_; - - Protocol::Transaction current_; - - bool initiated_; - - unsigned short voting_duration_; - unsigned short separation_duration_; - - MessageQueue& in_; - MessageQueue& send_out_; - MessageQueue& recv_out_; - - SendPtr send_; - RecvPtr recv_; - }; -} diff --git a/ace/TSS_T.cpp b/ace/TSS_T.cpp index fc25332dd1f..645a6f0612b 100644 --- a/ace/TSS_T.cpp +++ b/ace/TSS_T.cpp @@ -100,7 +100,7 @@ ACE_TSS::ts_init (void) const // once! if (this->once_ == 0) { - if (ACE_Thread::keycreate (ACE_const_cast (ACE_thread_key_t *, &this->key_), + if (ACE_Thread::keycreate (const_cast (&this->key_), #if defined (ACE_HAS_THR_C_DEST) &ACE_TSS_C_cleanup, #else @@ -112,7 +112,7 @@ ACE_TSS::ts_init (void) const { // This *must* come last to avoid race conditions! Note that // we need to "cast away const..." - * ACE_const_cast (int*, &this->once_) = 1; + * const_cast (&this->once_) = 1; return 0; } } diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index 4669856de3d..e4511fdb00c 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -630,40 +630,38 @@ ACE_Thread_Manager::spawn_i (ACE_THR_FUNC func, 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) + // 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; + *t_handle = thr_handle; # else /* ! ACE_HAS_WINCE */ - (void) ::DuplicateHandle (::GetCurrentProcess (), - thr_handle, - ::GetCurrentProcess (), - t_handle, - 0, - TRUE, - DUPLICATE_SAME_ACCESS); + (void) ::DuplicateHandle (::GetCurrentProcess (), + thr_handle, + ::GetCurrentProcess (), + t_handle, + 0, + TRUE, + DUPLICATE_SAME_ACCESS); # endif /* ! ACE_HAS_WINCE */ #else /* ! ACE_HAS_WTHREADS */ - if (t_handle != 0) - *t_handle = thr_handle; + if (t_handle != 0) + *t_handle = thr_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 ()); - } + // 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 diff --git a/ace/Time_Request_Reply.h b/ace/Time_Request_Reply.h index 583cb94e6cc..551da8dfb82 100644 --- a/ace/Time_Request_Reply.h +++ b/ace/Time_Request_Reply.h @@ -23,8 +23,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/SString.h" - /** * @class ACE_Time_Request * diff --git a/ace/Time_Value.h b/ace/Time_Value.h index 047177604e9..a95c7caad22 100644 --- a/ace/Time_Value.h +++ b/ace/Time_Value.h @@ -326,9 +326,6 @@ private: /// Store the values as a timeval. timeval tv_; }; -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif /** * @class ACE_Countdown_Time @@ -377,6 +374,9 @@ private: ACE_Countdown_Time (const ACE_Countdown_Time &); ACE_Countdown_Time &operator= (const ACE_Countdown_Time &); }; +#if defined (ACE_WIN32) && defined (_WIN32_WCE) +} +#endif #if defined (__ACE_INLINE__) #include "ace/Time_Value.inl" diff --git a/ace/Time_Value.inl b/ace/Time_Value.inl index f139d5f7daa..62ef44ce983 100644 --- a/ace/Time_Value.inl +++ b/ace/Time_Value.inl @@ -4,6 +4,16 @@ #include "ace/OS_NS_sys_time.h" +#if defined (ACE_WIN32) && defined (_WIN32_WCE) +// Something is a bit brain-damaged here and I'm not sure what... this code +// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC +// complains that the operators that return ACE_Time_Value are C-linkage +// functions that can't return a C++ class. The only way I've found to +// defeat this is to wrap the whole class in extern "C++". +// - Steve Huston, 23-Aug-2004 +extern "C++" { +#endif + // Returns the value of the object as a timeval. ACE_INLINE @@ -335,3 +345,7 @@ operator - (const ACE_Time_Value &tv1, delta.normalize (); return delta; } + +#if defined (ACE_WIN32) && defined (_WIN32_WCE) +} +#endif diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp index 537c2e85734..81224fa354b 100644 --- a/ace/Timer_Heap_T.cpp +++ b/ace/Timer_Heap_T.cpp @@ -234,8 +234,7 @@ ACE_Timer_Heap_T::pop_freelist (void) } // We need to truncate this to for backwards compatibility. - int new_id = ACE_static_cast (int, - this->timer_ids_curr_); + int new_id = static_cast (this->timer_ids_curr_); return new_id; } @@ -509,7 +508,7 @@ ACE_Timer_Heap_T::grow_heap (void) // 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] = -(ACE_static_cast (ssize_t, i) + 1); + this->timer_ids_[i] = -(static_cast (i) + 1); // Grow the preallocation array (if using preallocation) if (this->preallocated_nodes_ != 0) diff --git a/ace/Timer_Queue_Adapters.h b/ace/Timer_Queue_Adapters.h index e02fb262af6..ed8d0cd8ecc 100644 --- a/ace/Timer_Queue_Adapters.h +++ b/ace/Timer_Queue_Adapters.h @@ -45,14 +45,14 @@ public: /// Constructor /** - * Register the SIGALRM handler. If == 0 then block all + * Register the SIGALRM handler. If @a mask == 0 then block all * signals when is run. Otherwise, just block the signals - * indicated in . + * indicated in @a mask. */ ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *mask = 0); /// Schedule the timer according to the semantics of the - /// . + /// ACE_Timer_List. /** * This timer gets dispatched via a signal, rather than by a user * calling expire(). Note that interval timers are not implemented @@ -138,7 +138,7 @@ public: const ACE_Time_Value &future_time, const ACE_Time_Value &interval = ACE_Time_Value::zero); - /// Cancel the and return the parameter if an + /// Cancel the @a timer_id and return the @a act parameter if an /// address is passed in. Also wakes up the dispatching thread. int cancel (long timer_id, const void **act = 0); diff --git a/ace/Timer_Wheel_T.cpp b/ace/Timer_Wheel_T.cpp index 109cd123b38..f32b29b8853 100644 --- a/ace/Timer_Wheel_T.cpp +++ b/ace/Timer_Wheel_T.cpp @@ -273,7 +273,7 @@ template u_int ACE_Timer_Wheel_T::calculate_spoke (const ACE_Time_Value& t) const { - return ACE_static_cast(u_int, (t.msec () >> this->res_bits_) & (this->spoke_count_ - 1)); + return static_cast ((t.msec () >> this->res_bits_) & (this->spoke_count_ - 1)); } /// Generates a unique timer_id for the given spoke. It should be pretty @@ -304,7 +304,7 @@ ACE_Timer_Wheel_T::generate_timer_id (u_int spoke) # pragma warning(push) # pragma warning(disable : 4311) #endif /* ACE_WIN64 */ - long next_cnt = ACE_reinterpret_cast (long, root->get_act ()); + long next_cnt = reinterpret_cast (root->get_act ()); #if defined (ACE_WIN64) # pragma warning(pop) #endif /* ACE_WIN64 */ @@ -359,7 +359,7 @@ ACE_Timer_Wheel_T::generate_timer_id (u_int spoke) # pragma warning(push) # pragma warning(disable : 4312) #endif /* ACE_WIN64 */ - root->set_act (ACE_reinterpret_cast (void*, next_cnt)); + root->set_act (reinterpret_cast (next_cnt)); #if defined (ACE_WIN64) # pragma warning(pop) #endif /* ACE_WIN64 */ diff --git a/ace/TkReactor.cpp b/ace/TkReactor.cpp index eb14225cade..5fb8b56db71 100644 --- a/ace/TkReactor.cpp +++ b/ace/TkReactor.cpp @@ -1,6 +1,5 @@ #include "ace/TkReactor.h" -#if defined (ACE_HAS_TK) #include "ace/SOCK_Acceptor.h" #include "ace/SOCK_Connector.h" @@ -435,4 +434,3 @@ ACE_TkReactor::cancel_timer (long timer_id, } } -#endif /* ACE_HAS_TK */ diff --git a/ace/TkReactor.h b/ace/TkReactor.h index 7868eb6650c..024d341b937 100644 --- a/ace/TkReactor.h +++ b/ace/TkReactor.h @@ -20,8 +20,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#if defined (ACE_HAS_TK) - +#include "ace/ACE_TkReactor_export.h" #include "ace/Select_Reactor.h" #include /**/ @@ -31,7 +30,7 @@ * @brief This little class is necessary due to the way that Microsoft * implements sockets to be pointers rather than indices. */ -class ACE_Export ACE_TkReactorID +class ACE_TkReactor_Export ACE_TkReactorID { public: /// Underlying handle. @@ -43,7 +42,7 @@ public: class ACE_TkReactor; -class ACE_Export ACE_TkReactor_Input_Callback +class ACE_TkReactor_Export ACE_TkReactor_Input_Callback { public: ACE_TkReactor *reactor_; @@ -56,7 +55,7 @@ public: * @brief An object-oriented event demultiplexor and event handler * dispatcher that uses the Tk functions. */ -class ACE_Export ACE_TkReactor : public ACE_Select_Reactor +class ACE_TkReactor_Export ACE_TkReactor : public ACE_Select_Reactor { public: // = Initialization and termination methods. @@ -128,6 +127,5 @@ private: ACE_TkReactor &operator = (const ACE_TkReactor &); }; -#endif /* ACE_HAS_TK */ #include /**/ "ace/post.h" #endif /* ACE_TK_REACTOR_H */ diff --git a/ace/Token_Collection.cpp b/ace/Token_Collection.cpp index c85c7f7e08f..5287cd6208a 100644 --- a/ace/Token_Collection.cpp +++ b/ace/Token_Collection.cpp @@ -22,8 +22,7 @@ ACE_Token_Collection::ACE_Token_Collection (int debug, name = ACE_LIB_TEXT ("no name"); ACE_OS::strsncpy (this->name_, - ACE_const_cast (ACE_TCHAR *, - name), + const_cast (name), ACE_MAXTOKENNAMELEN); } diff --git a/ace/Token_Collection.h b/ace/Token_Collection.h index 981095b0538..1f42c8406cf 100644 --- a/ace/Token_Collection.h +++ b/ace/Token_Collection.h @@ -33,7 +33,6 @@ #if defined (ACE_HAS_TOKENS_LIBRARY) #include "ace/Local_Tokens.h" -#include "ace/SString.h" #include "ace/Null_Mutex.h" /** diff --git a/ace/UPIPE_Stream.cpp b/ace/UPIPE_Stream.cpp index e452db9f56e..4df8d5fc547 100644 --- a/ace/UPIPE_Stream.cpp +++ b/ace/UPIPE_Stream.cpp @@ -110,7 +110,7 @@ ACE_UPIPE_Stream::send (const char *buffer, return this->stream_.put (mb_p, timeout) == -1 ? -1 - : ACE_static_cast (ssize_t, n); + : static_cast (n); } // Receive a buffer. diff --git a/ace/UUID.cpp b/ace/UUID.cpp index 89b1c56a1a4..917f73b254d 100644 --- a/ace/UUID.cpp +++ b/ace/UUID.cpp @@ -164,15 +164,15 @@ namespace ACE_Utils } } - this->timeLow_ = ACE_static_cast (ACE_UINT32, timeLow); - this->timeMid_ = ACE_static_cast (ACE_UINT16, timeMid); - this->timeHiAndVersion_ = ACE_static_cast (ACE_UINT16, timeHiAndVersion); - this->clockSeqHiAndReserved_ = ACE_static_cast (u_char, clockSeqHiAndReserved); - this->clockSeqLow_ = ACE_static_cast (u_char, clockSeqLow); + this->timeLow_ = static_cast (timeLow); + this->timeMid_ = static_cast (timeMid); + this->timeHiAndVersion_ = static_cast (timeHiAndVersion); + this->clockSeqHiAndReserved_ = static_cast (clockSeqHiAndReserved); + this->clockSeqLow_ = static_cast (clockSeqLow); UUID_node::NodeID nodeID; for (int i = 0; i < UUID_node::NODE_ID_SIZE; ++i) - nodeID [i] = ACE_static_cast (u_char, node[i]); + nodeID [i] = static_cast (node[i]); this->node_->nodeID (nodeID); @@ -332,12 +332,12 @@ namespace ACE_Utils } else { - nodeID [0] = ACE_static_cast (u_char, ACE_OS::rand()); - nodeID [1] = ACE_static_cast (u_char, ACE_OS::rand()); - nodeID [2] = ACE_static_cast (u_char, ACE_OS::rand()); - nodeID [3] = ACE_static_cast (u_char, ACE_OS::rand()); - nodeID [4] = ACE_static_cast (u_char, ACE_OS::rand()); - nodeID [5] = ACE_static_cast (u_char, ACE_OS::rand()); + nodeID [0] = static_cast (ACE_OS::rand()); + nodeID [1] = static_cast (ACE_OS::rand()); + nodeID [2] = static_cast (ACE_OS::rand()); + nodeID [3] = static_cast (ACE_OS::rand()); + nodeID [4] = static_cast (ACE_OS::rand()); + nodeID [5] = static_cast (ACE_OS::rand()); } this->get_timestamp (timeLast_); @@ -358,11 +358,11 @@ namespace ACE_Utils // Construct a Version 1 UUID with the information in the arguements. - uuid.timeLow (ACE_static_cast (ACE_UINT32, timestamp & 0xFFFFFFFF)); - uuid.timeMid (ACE_static_cast(ACE_UINT16, (timestamp >> 32) & 0xFFFF)); + uuid.timeLow (static_cast (timestamp & 0xFFFFFFFF)); + uuid.timeMid (static_cast ((timestamp >> 32) & 0xFFFF)); - ACE_UINT16 tHAV = ACE_static_cast (ACE_UINT16, (timestamp >> 48) & 0xFFFF); + ACE_UINT16 tHAV = static_cast ((timestamp >> 48) & 0xFFFF); tHAV |= (version << 12); uuid.timeHiAndVersion (tHAV); @@ -387,7 +387,7 @@ namespace ACE_Utils ACE_OS::sprintf (buf, "%d", - ACE_static_cast (int, ACE_OS::getpid ())); + static_cast (ACE_OS::getpid ())); uuid.pid (buf); } } diff --git a/ace/Unbounded_Queue.cpp b/ace/Unbounded_Queue.cpp index d265d9b9fd2..332fddb4428 100644 --- a/ace/Unbounded_Queue.cpp +++ b/ace/Unbounded_Queue.cpp @@ -166,8 +166,7 @@ ACE_Unbounded_Queue::enqueue_head (const T &new_item) // Create a new node that points to the original head. ACE_NEW_MALLOC_RETURN (temp, - ACE_static_cast(ACE_Node *, - this->allocator_->malloc (sizeof (ACE_Node))), + static_cast *> (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 @@ -193,8 +192,7 @@ ACE_Unbounded_Queue::enqueue_tail (const T &new_item) // Create a new dummy node. ACE_NEW_MALLOC_RETURN (temp, - ACE_static_cast(ACE_Node *, - this->allocator_->malloc (sizeof (ACE_Node))), + static_cast *> (this->allocator_->malloc (sizeof (ACE_Node))), ACE_Node (this->head_->next_), -1); // Link this dummy pointer into the list. diff --git a/ace/Unbounded_Set.cpp b/ace/Unbounded_Set.cpp index 124c6223049..54ffa30a0f2 100644 --- a/ace/Unbounded_Set.cpp +++ b/ace/Unbounded_Set.cpp @@ -37,8 +37,7 @@ ACE_Unbounded_Set::insert_tail (const T &item) // Create a new dummy node. ACE_NEW_MALLOC_RETURN (temp, - ACE_static_cast(ACE_Node*, - this->allocator_->malloc (sizeof (ACE_Node))), + static_cast*> (this->allocator_->malloc (sizeof (ACE_Node))), ACE_Node (this->head_->next_), -1); // Link this pointer into the list. diff --git a/ace/Unbounded_Set_Ex.cpp b/ace/Unbounded_Set_Ex.cpp deleted file mode 100644 index e59e33857f9..00000000000 --- a/ace/Unbounded_Set_Ex.cpp +++ /dev/null @@ -1,629 +0,0 @@ -// $Id$ - -#ifndef ACE_UNBOUNDED_SET_EX_C -#define ACE_UNBOUNDED_SET_EX_C - -#include "ace/Unbounded_Set_Ex.h" -#include "ace/Malloc_Base.h" -#include "ace/Log_Msg.h" -#include "ace/os_include/os_errno.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "ace/Unbounded_Set_Ex.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (ace, - Unbounded_Set_Ex, - "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Set_Ex) - -template size_t -ACE_Unbounded_Set_Ex::size (void) const -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::size"); - return this->cur_size_; -} - -template int -ACE_Unbounded_Set_Ex::insert_tail (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::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_static_cast(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_Ex::reset (void) -{ - ACE_TRACE ("reset"); - - this->delete_nodes (); -} - -template void -ACE_Unbounded_Set_Ex::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Unbounded_Set_Ex::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nhead_ = %u"), this->head_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nhead_->next_ = %u"), this->head_->next_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_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_Ex_Iterator iter (*(ACE_Unbounded_Set_Ex *) this); - iter.next (item) != 0; - iter.advance ()) - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("count = %d\n"), count++)); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_HAS_DUMP */ -} - -template void -ACE_Unbounded_Set_Ex::copy_nodes (const ACE_Unbounded_Set_Ex &us) -{ - for (ACE_Node *curr = us.head_->next_; - curr != us.head_; - curr = curr->next_) - { - if (!curr->deleted_) - this->insert_tail (curr->item_); - } -} - -template void -ACE_Unbounded_Set_Ex::delete_nodes (void) -{ - ACE_Node *curr = this->head_->next_; - ACE_ASSERT (number_of_iterators_ == 0); - // Keep looking until we've hit the dummy node. - - while (curr != this->head_) - { - ACE_Node *temp = curr; - curr = curr->next_; - if (!temp->deleted_) - this->cur_size_--; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - } - - // Reset the list to be a circular list with just a dummy node. - this->head_->next_ = this->head_; -} - -template void -ACE_Unbounded_Set_Ex::cleanup () -{ - /// curr is the address of the chaining - ACE_Node **curr = &(this->head_->next_); - ACE_ASSERT (number_of_iterators_ == 0); - - // Keep looking until we've hit the dummy node. - while (*curr != this->head_) - { - if ((*curr)->deleted_) - { - ACE_Node *temp = *curr; - *curr = (*curr)->next_; // skip the deleted, curr is still the same - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - } - else - { - curr = &((*curr)->next_); - } - } -} - -template -ACE_Unbounded_Set_Ex::~ACE_Unbounded_Set_Ex (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::~ACE_Unbounded_Set_Ex"); - - this->delete_nodes (); - - // Delete the dummy node. - ACE_DES_FREE_TEMPLATE (head_, - this->allocator_->free, - ACE_Node, - ); - this->head_ = 0; -} - -template -ACE_Unbounded_Set_Ex::ACE_Unbounded_Set_Ex (ACE_Allocator *alloc) - : head_ (0), - cur_size_ (0), - allocator_ (alloc), - number_of_iterators_ (0) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::ACE_Unbounded_Set_Ex"); - - 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_Ex::ACE_Unbounded_Set_Ex (const ACE_Unbounded_Set_Ex &us) - : head_ (0), - cur_size_ (0), - allocator_ (us.allocator_), - number_of_iterators_ (0) -{ - ACE_TRACE ("ACE_Unbounded_Set_Ex::ACE_Unbounded_Set_Ex"); - - 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_Ex::operator= (const ACE_Unbounded_Set_Ex &us) -{ - ACE_TRACE ("ACE_Unbounded_Set_Ex::operator="); - - if (this != &us) - { - this->delete_nodes (); - this->copy_nodes (us); - } -} - -template int -ACE_Unbounded_Set_Ex::find (const T &item) const -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::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->deleted_)) - 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_Ex::insert (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::insert"); - if (this->find (item) == 0) - return 1; - else - return this->insert_tail (item); -} - -template int -ACE_Unbounded_Set_Ex::remove (const T &item) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::remove"); - - // Insert the item to be founded into the dummy node. - this->head_->item_ = item; - this->head_->deleted_ = false; - - ACE_Node *curr = this->head_; - - while (!(curr->next_->item_ == item) || curr->next_->deleted_) - curr = curr->next_; - - if (curr->next_ == this->head_) - return -1; // Item was not found. - else - { - this->cur_size_--; - ACE_Node *temp = curr->next_; - if (number_of_iterators_>0) - { - temp->deleted_=true; - } - else - { - // Skip over the node that we're deleting. - curr->next_ = temp->next_; - ACE_DES_FREE_TEMPLATE (temp, - this->allocator_->free, - ACE_Node, - ); - } - return 0; - } -} - -template ACE_Unbounded_Set_Ex_Iterator -ACE_Unbounded_Set_Ex::begin (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::begin"); - return ACE_Unbounded_Set_Ex_Iterator (*this); -} - -template ACE_Unbounded_Set_Ex_Iterator -ACE_Unbounded_Set_Ex::end (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex::end"); - return ACE_Unbounded_Set_Ex_Iterator (*this, 1); -} - -template void -ACE_Unbounded_Set_Ex::iterator_add (void) const -{ - number_of_iterators_++; -} - -template void -ACE_Unbounded_Set_Ex::iterator_leave (void) -{ - ACE_ASSERT (number_of_iterators_ > 0); - number_of_iterators_--; - if (number_of_iterators_ == 0) - cleanup (); -} - -template void -ACE_Unbounded_Set_Ex::const_iterator_leave (void) const -{ - ACE_ASSERT (number_of_iterators_ > 0); - number_of_iterators_--; -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Set_Ex_Iterator) - -template void -ACE_Unbounded_Set_Ex_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Unbounded_Set_Ex_Iterator::ACE_Unbounded_Set_Ex_Iterator (ACE_Unbounded_Set_Ex &s, int end) - : current_ (end == 0 ? s.head_->next_ : s.head_ ), set_ (&s) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::ACE_Unbounded_Set_Ex_Iterator"); - // the first one may be deleted - while (this->current_->deleted_ && this->current_ != this->set_->head_) - this->current_ = this->current_->next_; - registered_in_set_ = (!end && this->current_ != this->set_->head_); - if (registered_in_set_) - set_->iterator_add (); -} - -template -ACE_Unbounded_Set_Ex_Iterator::ACE_Unbounded_Set_Ex_Iterator (const ACE_Unbounded_Set_Ex_Iterator &o) - : current_ (o.current_), set_ (o.set_), - registered_in_set_ (o.registered_in_set_) -{ - if (registered_in_set_) - set_->iterator_add (); -} - -template void -ACE_Unbounded_Set_Ex_Iterator::operator= (const ACE_Unbounded_Set_Ex_Iterator &o) -{ - if (this == &o) - return; - if (registered_in_set_) - set_->iterator_leave (); - this->set_ = o.set_; - this->current_ = o.current_; - this->registered_in_set_ = o.registered_in_set_; - if (registered_in_set_) - set_->iterator_add (); -} - - -template -ACE_Unbounded_Set_Ex_Iterator::~ACE_Unbounded_Set_Ex_Iterator () -{ - if (registered_in_set_) - set_->iterator_leave (); -} - -template int -ACE_Unbounded_Set_Ex_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::advance"); - this->current_ = this->current_->next_; - while (this->current_->deleted_ && this->current_ != this->set_->head_) - this->current_ = this->current_->next_; - int completed = (this->current_ == this->set_->head_); - if (completed && registered_in_set_) - { - set_->iterator_leave (); - registered_in_set_ = false; - } - return !completed; -} - -template int -ACE_Unbounded_Set_Ex_Iterator::first (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::first"); - this->current_ = this->set_->head_->next_; - while (this->current_->deleted_ && this->current_ != this->set_->head_) - this->current_ = this->current_->next_; - int non_empty = (this->current_ != this->set_->head_); - if (non_empty && !registered_in_set_) - { - registered_in_set_ = true; - set_->iterator_add (); - } - return non_empty; -} - -template int -ACE_Unbounded_Set_Ex_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::done"); - - return this->current_ == this->set_->head_; -} - -template int -ACE_Unbounded_Set_Ex_Iterator::next (T *&item) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::next"); - int completed = (this->current_ == this->set_->head_); - if (completed) - { - if (registered_in_set_) - { - set_->iterator_leave (); - registered_in_set_ = false; - } - return 0; - } - item = &this->current_->item_; - return 1; -} - -template ACE_Unbounded_Set_Ex_Iterator -ACE_Unbounded_Set_Ex_Iterator::operator++ (int) -{ - //ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::operator++ (int)"); - ACE_Unbounded_Set_Ex_Iterator retv (*this); - - // postfix operator - - this->advance (); - return retv; -} - -template ACE_Unbounded_Set_Ex_Iterator& -ACE_Unbounded_Set_Ex_Iterator::operator++ (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::operator++ (void)"); - - // prefix operator - - this->advance (); - return *this; -} - -template T& -ACE_Unbounded_Set_Ex_Iterator::operator* (void) -{ - //ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::operator*"); - T *retv = 0; - - int result = this->next (retv); - ACE_ASSERT (result != 0); - ACE_UNUSED_ARG (result); - - return *retv; -} - -template bool -ACE_Unbounded_Set_Ex_Iterator::operator== (const ACE_Unbounded_Set_Ex_Iterator &rhs) const -{ - //ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::operator=="); - return (this->set_ == rhs.set_ && this->current_ == rhs.current_); -} - -template bool -ACE_Unbounded_Set_Ex_Iterator::operator!= (const ACE_Unbounded_Set_Ex_Iterator &rhs) const -{ - //ACE_TRACE ("ACE_Unbounded_Set_Ex_Iterator::operator!="); - return (this->set_ != rhs.set_ || this->current_ != rhs.current_); -} - -ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_Set_Ex_Const_Iterator) - -template void -ACE_Unbounded_Set_Ex_Const_Iterator::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::dump"); -#endif /* ACE_HAS_DUMP */ -} - -template -ACE_Unbounded_Set_Ex_Const_Iterator::ACE_Unbounded_Set_Ex_Const_Iterator (const ACE_Unbounded_Set_Ex &s, int end) - : current_ (end == 0 ? s.head_->next_ : s.head_ ), set_ (&s) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::ACE_Unbounded_Set_Ex_Const_Iterator"); - // the first one may be deleted - while (this->current_->deleted_ && this->current_ != this->set_->head_) - this->current_ = this->current_->next_; - registered_in_set_ = (!end && this->current_ != this->set_->head_); - if (registered_in_set_) - set_->iterator_add (); -} - -template -ACE_Unbounded_Set_Ex_Const_Iterator::ACE_Unbounded_Set_Ex_Const_Iterator - (const ACE_Unbounded_Set_Ex_Const_Iterator &o) - : current_ (o.current_), - set_ (o.set_), - registered_in_set_ (o.registered_in_set_) -{ - if (registered_in_set_) - set_->iterator_add (); -} - -template -void ACE_Unbounded_Set_Ex_Const_Iterator::operator= - (const ACE_Unbounded_Set_Ex_Const_Iterator& o) -{ - if (this == &o) - return; - if (registered_in_set_) - set_->const_iterator_leave (); - this->set_ = o.set_; - this->current_ = o.current_; - this->registered_in_set_ = o.registered_in_set_; - if (registered_in_set_) - set_->iterator_add (); -} - -template -ACE_Unbounded_Set_Ex_Const_Iterator::~ACE_Unbounded_Set_Ex_Const_Iterator () -{ - if (registered_in_set_) - set_->const_iterator_leave (); -} - -template int -ACE_Unbounded_Set_Ex_Const_Iterator::advance (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::advance"); - this->current_ = this->current_->next_; - while (this->current_->deleted_ && this->current_ != this->set_->head_) - this->current_ = this->current_->next_; - int completed = (this->current_ == this->set_->head_); - if (completed && registered_in_set_) - { - set_->const_iterator_leave (); - registered_in_set_ = false; - } - return !completed; -} - -template int -ACE_Unbounded_Set_Ex_Const_Iterator::first (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::first"); - this->current_ = this->set_->head_->next_; - while (this->current_->deleted_ && this->current_ != this->set_->head_) - this->current_ = this->current_->next_; - int non_empty = (this->current_ != this->set_->head_); - if (non_empty && !registered_in_set_) - { - registered_in_set_ = true; - set_->iterator_add (); - } - return non_empty; -} - -template int -ACE_Unbounded_Set_Ex_Const_Iterator::done (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::done"); - - return this->current_ == this->set_->head_; -} - -template int -ACE_Unbounded_Set_Ex_Const_Iterator::next (T *&item) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::next"); - int completed = (this->current_ == this->set_->head_); - if (completed) - { - if (registered_in_set_) - { - set_->const_iterator_leave (); - registered_in_set_ = false; - } - return 0; - } - item = &this->current_->item_; - return 1; -} - -template ACE_Unbounded_Set_Ex_Const_Iterator -ACE_Unbounded_Set_Ex_Const_Iterator::operator++ (int) -{ - //ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::operator++ (int)"); - ACE_Unbounded_Set_Ex_Const_Iterator retv (*this); - - // postfix operator - - this->advance (); - return retv; -} - -template ACE_Unbounded_Set_Ex_Const_Iterator& -ACE_Unbounded_Set_Ex_Const_Iterator::operator++ (void) -{ - // ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::operator++ (void)"); - - // prefix operator - - this->advance (); - return *this; -} - -template T& -ACE_Unbounded_Set_Ex_Const_Iterator::operator* (void) -{ - //ACE_TRACE ("ACE_Unbounded_Set_Ex_Const_Iterator::operator*"); - T *retv = 0; - - int result = this->next (retv); - ACE_ASSERT (result != 0); - ACE_UNUSED_ARG (result); - - return *retv; -} - -#endif /* ACE_UNBOUNDED_SET_EX_C */ diff --git a/ace/Unbounded_Set_Ex.h b/ace/Unbounded_Set_Ex.h deleted file mode 100644 index 60dfda38cfa..00000000000 --- a/ace/Unbounded_Set_Ex.h +++ /dev/null @@ -1,360 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Unbounded_Set_Ex.h - * - * $Id$ - * - * @author Douglas C. Schmidt - * ACE_Unbounded_Set Extension by Rudolf Weber - * - * If iterators are working in an Unbounded_Set_Ex, the elements are not - * deleted physically, but marked as deleted. - * There is a bookkeeping of the iterators active in the set. - * It is an error if a set is reset() or destructed while iterators are - * still working on the set. - * - * CAUTION: Pay attention to the state of the iterators. - * Deleting a set, or an element in a set, is only feasible - * when no iterator is active. - * - */ -//============================================================================= - -#ifndef ACE_UNBOUNDED_SET_EX_H -#define ACE_UNBOUNDED_SET_EX_H -#include /**/ "ace/pre.h" - -#include "ace/Node.h" -#include "ace/os_include/os_stddef.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class ACE_Allocator; - -/** - * @class ACE_Unbounded_Set_Ex_Iterator - * - * @brief Implement an iterator over an unbounded set. - */ -template -class ACE_Unbounded_Set_Ex_Iterator -{ -public: - // = Initialization method. - ACE_Unbounded_Set_Ex_Iterator (ACE_Unbounded_Set_Ex &s, int end = 0); - ACE_Unbounded_Set_Ex_Iterator (const ACE_Unbounded_Set_Ex_Iterator &o); - void operator= (const ACE_Unbounded_Set_Ex_Iterator &o); - ~ACE_Unbounded_Set_Ex_Iterator (); - - // = Iteration methods. - - /// Pass back the that hasn't been seen in the Set. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - - /// Move to the first element in the set. Returns 0 if the - /// set is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - // = STL styled iteration, compare, and reference functions. - - /// Postfix advance. - ACE_Unbounded_Set_Ex_Iterator operator++ (int); - - /// Prefix advance. - ACE_Unbounded_Set_Ex_Iterator& operator++ (void); - - /// Returns a reference to the internal element is pointing to. - T& operator* (void); - - /// Check if two iterators point to the same position - bool operator== (const ACE_Unbounded_Set_Ex_Iterator &) const; - bool operator!= (const ACE_Unbounded_Set_Ex_Iterator &) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /// Pointer to the current node in the iteration. - ACE_Node *current_; - - /// Pointer to the set we're iterating over. - ACE_Unbounded_Set_Ex *set_; - - // Flag that indicates whether this iterator is registered at the set. - int registered_in_set_; -}; - -/** - * @class ACE_Unbounded_Set_Ex_Const_Iterator - * - * @brief Implement a const iterator over an unbounded set. - * - * The bookkeeping operations are regarded as const. (The member - * number_of_iterators_ in ACE_Unbounded_Set_Ex is `mutable'.) - * Some asynchronous activity may cause a deletion under a Const_Iterator - * so Const_Iterators are registered too. - * However, the cleanup operation isn't const at all, thus it is not - * called from const iterators. - * - */ -template -class ACE_Unbounded_Set_Ex_Const_Iterator -{ -public: - // = Initialization method. - ACE_Unbounded_Set_Ex_Const_Iterator (const ACE_Unbounded_Set_Ex &s, int end = 0); - ACE_Unbounded_Set_Ex_Const_Iterator (const ACE_Unbounded_Set_Ex_Const_Iterator& o); - void operator= (const ACE_Unbounded_Set_Ex_Const_Iterator& o); - ~ACE_Unbounded_Set_Ex_Const_Iterator (); - - // = Iteration methods. - - /// Pass back the that hasn't been seen in the Set. - /// Returns 0 when all items have been seen, else 1. - int next (T *&next_item); - - /// Move forward by one element in the set. Returns 0 when all the - /// items in the set have been seen, else 1. - int advance (void); - - /// Move to the first element in the set. Returns 0 if the - /// set is empty, else 1. - int first (void); - - /// Returns 1 when all items have been seen, else 0. - int done (void) const; - - /// Dump the state of an object. - void dump (void) const; - - // = STL styled iteration, compare, and reference functions. - - /// Postfix advance. - ACE_Unbounded_Set_Ex_Const_Iterator operator++ (int); - - /// Prefix advance. - ACE_Unbounded_Set_Ex_Const_Iterator& operator++ (void); - - /// Returns a reference to the internal element is pointing to. - T& operator* (void); - - /// Check if two iterators point to the same position - bool operator== (const ACE_Unbounded_Set_Ex_Const_Iterator &) const; - bool operator!= (const ACE_Unbounded_Set_Ex_Const_Iterator &) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /// Pointer to the current node in the iteration. - ACE_Node *current_; - - /// Pointer to the set we're iterating over. - const ACE_Unbounded_Set_Ex *set_; - - // Flag that indicates whether this iterator is registered at the set. - int registered_in_set_; -}; - -/** - * @class ACE_Unbounded_Set_Ex - * - * @brief Implement a simple unordered set of of unbounded size. - * - * 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. - * - * Requirements and Performance Characteristics - * - Internal Structure - * Circular linked list - * - Duplicates allowed? - * No - * - Random access allowed? - * No - * - Search speed - * Linear - * - Insert/replace speed - * Linear - * - Iterator still valid after change to container? - * Yes - * - Frees memory for removed elements? - * Yes - * - Items inserted by - * Value - * - Requirements for contained type - * -# Default constructor - * -# Copy constructor - * -# operator= - * -# operator== - * - */ -template -class ACE_Unbounded_Set_Ex -{ -public: - friend class ACE_Unbounded_Set_Ex_Iterator; - friend class ACE_Unbounded_Set_Ex_Const_Iterator; - - // Trait definition. - typedef ACE_Unbounded_Set_Ex_Iterator ITERATOR; - typedef ACE_Unbounded_Set_Ex_Iterator iterator; - typedef ACE_Unbounded_Set_Ex_Const_Iterator CONST_ITERATOR; - typedef ACE_Unbounded_Set_Ex_Const_Iterator const_iterator; - - // = Initialization and termination methods. - /// Constructor. Use user specified allocation strategy - /// if specified. - /** - * Initialize an empty set using the allocation strategy of the user if - * provided. - */ - ACE_Unbounded_Set_Ex (ACE_Allocator *alloc = 0); - - /// Copy constructor. - /** - * Initialize this set to be an exact copy of the set provided. - */ - ACE_Unbounded_Set_Ex (const ACE_Unbounded_Set_Ex &); - - /// Assignment operator. - /** - * Perform a deep copy of the rhs into the lhs. - */ - void operator= (const ACE_Unbounded_Set_Ex &); - - /// Destructor. - /** - * Destroy the nodes of the set. - */ - ~ACE_Unbounded_Set_Ex (void); - - // = Check boundary conditions. - - /// Returns 1 if the container is empty, otherwise returns 0. - /** - * Constant time is_empty check. - */ - int is_empty (void) const; - - /// Returns 0. - /** - * Always returns 0 since the set can never fill up. - */ - int is_full (void) const; - - // = Classic unordered set operations. - - ///Linear insertion of an item. - /** - * Insert into the set (doesn't allow duplicates). - * Returns -1 if failures occur, 1 if item is already present, else - * 0. - */ - int insert (const T &new_item); - - /// Insert at the tail of the set (doesn't check for - /// duplicates). - /** - * Constant time insert at the end of the set. - */ - int insert_tail (const T &item); - - ///Linear remove operation. - /** - * 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 remove (const T &item); - - /// Finds if occurs in the set. Returns 0 if find succeeds, - /// else -1. - /** - * Performs a linear find operation. - */ - int find (const T &item) const; - - /// Size of the set. - /** - * Access the size of the set. - */ - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Reset the to be empty. - /** - * Delete the nodes of the set. - */ - void reset (void); - - // = STL-styled unidirectional iterator factory. - ACE_Unbounded_Set_Ex_Iterator begin (void); - ACE_Unbounded_Set_Ex_Iterator end (void); - - /// An Iterator has to register itself here. - void iterator_add () const; - /// A non-const Iterator has to unregister itself here. - void iterator_leave (); - /// A Const_Iterator has to unregister itself here. - void const_iterator_leave () const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - /// Delete all the nodes in the Set. - void delete_nodes (void); - - /// Copy nodes into this set. - void copy_nodes (const ACE_Unbounded_Set_Ex &); - - /// Really delete all nodes marked for deletion. - void cleanup (); - - /// Head of the linked list of Nodes. - ACE_Node *head_; - - /// Current size of the set. - size_t cur_size_; - - /// Allocation strategy of the set. - ACE_Allocator *allocator_; - - /// Number of iterators working on this set. - mutable int number_of_iterators_; -}; - -#if defined (__ACE_INLINE__) -#include "ace/Unbounded_Set_Ex.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Unbounded_Set_Ex.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Unbounded_Set_Ex.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* ACE_UNBOUNDED_SET_EX_H */ diff --git a/ace/Unbounded_Set_Ex.inl b/ace/Unbounded_Set_Ex.inl deleted file mode 100644 index 989b7666b49..00000000000 --- a/ace/Unbounded_Set_Ex.inl +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/Global_Macros.h" - -template ACE_INLINE int -ACE_Unbounded_Set_Ex::is_empty (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set_Ex::is_empty"); - return this->head_ == this->head_->next_; -} - -template ACE_INLINE int -ACE_Unbounded_Set_Ex::is_full (void) const -{ - ACE_TRACE ("ACE_Unbounded_Set_Ex::is_full"); - return 0; // We should implement a "node of last resort for this..." -} diff --git a/ace/Version.h b/ace/Version.h index e44e01cb284..2242e04a6ea 100644 --- a/ace/Version.h +++ b/ace/Version.h @@ -3,5 +3,5 @@ #define ACE_MAJOR_VERSION 5 #define ACE_MINOR_VERSION 4 -#define ACE_BETA_VERSION 3 -#define ACE_VERSION "5.4.3" +#define ACE_BETA_VERSION 4 +#define ACE_VERSION "5.4.4" diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp index 7ec38b8da2b..1e4bb6a9720 100644 --- a/ace/WFMO_Reactor.cpp +++ b/ace/WFMO_Reactor.cpp @@ -2560,7 +2560,7 @@ ACE_WFMO_Reactor_Notify::purge_pending_notifications (ACE_Event_Handler *eh, return -1; // This shouldn't happen... ACE_Notification_Buffer *buffer = - ACE_reinterpret_cast (ACE_Notification_Buffer *, mb->base ()); + reinterpret_cast (mb->base ()); // If this is not a Reactor notify (it is for a particular handler), // and it matches the specified handler (or purging all), diff --git a/ace/WIN32_Asynch_IO.cpp b/ace/WIN32_Asynch_IO.cpp index 1e15721cd0f..b88ae61b5f4 100644 --- a/ace/WIN32_Asynch_IO.cpp +++ b/ace/WIN32_Asynch_IO.cpp @@ -81,8 +81,7 @@ int ACE_WIN32_Asynch_Result::post_completion (ACE_Proactor_Impl *proactor) { // Get to the platform specific implementation. - ACE_WIN32_Proactor *win32_proactor = ACE_dynamic_cast (ACE_WIN32_Proactor *, - proactor); + ACE_WIN32_Proactor *win32_proactor = dynamic_cast (proactor); if (win32_proactor == 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -460,7 +459,7 @@ ACE_WIN32_Asynch_Read_Stream::readv (ACE_Message_Block &message_block, if (msg_space > ULONG_MAX) this_chunk_length = ULONG_MAX; else - this_chunk_length = ACE_static_cast (u_long, msg_space); + this_chunk_length = static_cast (msg_space); // Collect the data in the iovec. iov[iovcnt].iov_base = msg->wr_ptr () + wr_ptr_offset; iov[iovcnt].iov_len = this_chunk_length; @@ -511,8 +510,8 @@ ACE_WIN32_Asynch_Read_Stream::readv (ACE_Message_Block &message_block, DWORD bytes_recvd = 0; u_long flags = 0; - int initiate_result = ::WSARecv (ACE_reinterpret_cast (SOCKET, result->handle ()), - ACE_reinterpret_cast (WSABUF *, iov), + int initiate_result = ::WSARecv (reinterpret_cast (result->handle ()), + reinterpret_cast (iov), iovcnt, &bytes_recvd, &flags, @@ -575,7 +574,7 @@ ACE_WIN32_Asynch_Read_Stream::shared_read (ACE_WIN32_Asynch_Read_Stream_Result * errno = ERANGE; return -1; } - DWORD bytes_to_read = ACE_static_cast (DWORD, result->bytes_to_read ()); + DWORD bytes_to_read = static_cast (result->bytes_to_read ()); u_long bytes_read; result->set_error (0); // Clear error before starting IO. @@ -884,7 +883,7 @@ ACE_WIN32_Asynch_Write_Stream::writev (ACE_Message_Block &message_block, if (msg_len > ULONG_MAX) this_chunk_length = ULONG_MAX; else - this_chunk_length = ACE_static_cast (u_long, msg_len); + this_chunk_length = static_cast (msg_len); // Collect the data in the iovec. iov[iovcnt].iov_base = msg->rd_ptr () + rd_ptr_offset; iov[iovcnt].iov_len = this_chunk_length; @@ -933,8 +932,8 @@ ACE_WIN32_Asynch_Write_Stream::writev (ACE_Message_Block &message_block, u_long bytes_sent = 0; - int initiate_result = ::WSASend (ACE_reinterpret_cast (SOCKET, result->handle ()), - ACE_reinterpret_cast (WSABUF *, iov), + int initiate_result = ::WSASend (reinterpret_cast (result->handle ()), + reinterpret_cast (iov), iovcnt, &bytes_sent, 0, // flags @@ -997,7 +996,7 @@ ACE_WIN32_Asynch_Write_Stream::shared_write (ACE_WIN32_Asynch_Write_Stream_Resul errno = ERANGE; return -1; } - DWORD bytes_to_write = ACE_static_cast (DWORD, result->bytes_to_write ()); + DWORD bytes_to_write = static_cast (result->bytes_to_write ()); result->set_error (0); // Clear error before starting IO. @@ -1336,7 +1335,7 @@ ACE_WIN32_Asynch_Read_File::readv (ACE_Message_Block &message_block, errno = ERANGE; return -1; } - DWORD dword_bytes_to_read = ACE_static_cast (DWORD, bytes_to_read); + DWORD dword_bytes_to_read = static_cast (bytes_to_read); // last one should be completely 0 buffer_pointers[buffer_pointers_count].Buffer = 0; @@ -1741,7 +1740,7 @@ ACE_WIN32_Asynch_Write_File::writev (ACE_Message_Block &message_block, errno = ERANGE; return -1; } - DWORD dword_bytes_to_write = ACE_static_cast (DWORD, bytes_to_write); + DWORD dword_bytes_to_write = static_cast (bytes_to_write); // last one should be completely 0 buffer_pointers[buffer_pointers_count].Buffer = 0; @@ -2050,7 +2049,7 @@ ACE_WIN32_Asynch_Accept::accept (ACE_Message_Block &message_block, errno = ERANGE; return -1; } - DWORD dword_bytes_to_read = ACE_static_cast (DWORD, bytes_to_read); + DWORD dword_bytes_to_read = static_cast (bytes_to_read); int close_accept_handle = 0; // If the is invalid, we will create a new socket. @@ -2095,8 +2094,8 @@ ACE_WIN32_Asynch_Accept::accept (ACE_Message_Block &message_block, (SOCKET) result->accept_handle (), result->message_block ().wr_ptr (), dword_bytes_to_read, - ACE_static_cast (DWORD, address_size), - ACE_static_cast (DWORD, address_size), + static_cast (address_size), + static_cast (address_size), &bytes_read, result); if (initiate_result == 1) @@ -2546,8 +2545,7 @@ ACE_WIN32_Asynch_Connect::connect_i (ACE_WIN32_Asynch_Connect_Result *result, if (local_sap != ACE_Addr::sap_any) { - sockaddr * laddr = ACE_reinterpret_cast (sockaddr *, - local_sap.get_addr ()); + sockaddr * laddr = reinterpret_cast (local_sap.get_addr ()); int size = local_sap.get_size (); if (ACE_OS::bind (handle, laddr, size) == -1) @@ -2576,8 +2574,7 @@ ACE_WIN32_Asynch_Connect::connect_i (ACE_WIN32_Asynch_Connect_Result *result, for (;;) { int rc = ACE_OS::connect (handle, - ACE_reinterpret_cast (sockaddr *, - remote_sap.get_addr ()), + reinterpret_cast (remote_sap.get_addr ()), remote_sap.get_size ()); if (rc < 0) // failure @@ -3026,8 +3023,8 @@ ACE_WIN32_Asynch_Transmit_File::transmit_file (ACE_HANDLE file, errno = ERANGE; return -1; } - DWORD dword_bytes_to_write = ACE_static_cast (DWORD, bytes_to_write); - DWORD dword_bytes_per_send = ACE_static_cast (DWORD, bytes_per_send); + DWORD dword_bytes_to_write = static_cast (bytes_to_write); + DWORD dword_bytes_per_send = static_cast (bytes_per_send); ACE_WIN32_Asynch_Transmit_File_Result *result = 0; ACE_NEW_RETURN (result, @@ -3365,7 +3362,7 @@ ACE_WIN32_Asynch_Read_Dgram::recv (ACE_Message_Block *message_block, if (msg_space > ULONG_MAX) this_chunk_length = ULONG_MAX; else - this_chunk_length = ACE_static_cast (u_long, msg_space); + this_chunk_length = static_cast (msg_space); // Collect the data in the iovec. iov[iovcnt].iov_base = msg->wr_ptr () + wr_ptr_offset; iov[iovcnt].iov_len = this_chunk_length; @@ -3692,7 +3689,7 @@ ACE_WIN32_Asynch_Write_Dgram::send (ACE_Message_Block *message_block, if (msg_len > ULONG_MAX) this_chunk_length = ULONG_MAX; else - this_chunk_length = ACE_static_cast (u_long, msg_len); + this_chunk_length = static_cast (msg_len); // Collect the data in the iovec. iov[iovcnt].iov_base = msg->rd_ptr () + rd_ptr_offset; iov[iovcnt].iov_len = this_chunk_length; diff --git a/ace/WIN32_Proactor.cpp b/ace/WIN32_Proactor.cpp index f4e9a3283ff..62458aed76f 100644 --- a/ace/WIN32_Proactor.cpp +++ b/ace/WIN32_Proactor.cpp @@ -44,7 +44,7 @@ ACE_WIN32_Proactor::ACE_WIN32_Proactor (size_t number_of_threads, int used_with_reactor_event_loop) : completion_port_ (0), // This *MUST* be 0, *NOT* ACE_INVALID_HANDLE !!! - number_of_threads_ (ACE_static_cast (DWORD, number_of_threads)), + number_of_threads_ (static_cast (number_of_threads)), used_with_reactor_event_loop_ (used_with_reactor_event_loop) { // Create the completion port. @@ -121,9 +121,9 @@ ACE_WIN32_Proactor::register_handle (ACE_HANDLE handle, const void *completion_key) { #if defined (ACE_WIN64) - ULONG_PTR comp_key (ACE_reinterpret_cast (ULONG_PTR, completion_key)); + ULONG_PTR comp_key (reinterpret_cast (completion_key)); #else - ULONG comp_key (ACE_reinterpret_cast (ULONG, completion_key)); + ULONG comp_key (reinterpret_cast (completion_key)); #endif /* ACE_WIN64 */ // No locking is needed here as no state changes. @@ -635,8 +635,7 @@ ACE_WIN32_Proactor::handle_events (unsigned long milli_seconds) result_err = errno ; this->application_specific_code (asynch_result, - ACE_static_cast (size_t, - bytes_transferred), + static_cast (bytes_transferred), (void *) completion_key, result_err); } @@ -683,14 +682,13 @@ ACE_WIN32_Proactor::post_completion (ACE_WIN32_Asynch_Result *result) { // This cast is ok since the original API calls restricted the transfer // counts to DWORD range. - bytes_transferred = ACE_static_cast (DWORD, - result->bytes_transferred ()); + bytes_transferred = static_cast (result->bytes_transferred ()); completion_key = result->completion_key(); } #if defined (ACE_WIN64) - ULONG_PTR comp_key (ACE_reinterpret_cast (ULONG_PTR, completion_key)); + ULONG_PTR comp_key (reinterpret_cast (completion_key)); #else - ULONG comp_key (ACE_reinterpret_cast (ULONG, completion_key)); + ULONG comp_key (reinterpret_cast (completion_key)); #endif /* ACE_WIN64 */ // Post a completion @@ -753,13 +751,13 @@ ACE_WIN32_Proactor::close_dispatch_threads (int) size_t ACE_WIN32_Proactor::number_of_threads (void) const { - return ACE_static_cast (size_t, this->number_of_threads_); + return static_cast (this->number_of_threads_); } void ACE_WIN32_Proactor::number_of_threads (size_t threads) { - this->number_of_threads_ = ACE_static_cast (DWORD, threads); + this->number_of_threads_ = static_cast (threads); } ACE_WIN32_Asynch_Timer::ACE_WIN32_Asynch_Timer diff --git a/ace/XtReactor.cpp b/ace/XtReactor.cpp index 609f0077b64..6fb2c898ba3 100644 --- a/ace/XtReactor.cpp +++ b/ace/XtReactor.cpp @@ -1,7 +1,6 @@ // $Id$ #include "ace/XtReactor.h" -#if defined (ACE_HAS_XT) #include "ace/SOCK_Acceptor.h" #include "ace/SOCK_Connector.h" @@ -446,4 +445,3 @@ ACE_XtReactor::cancel_timer (long timer_id, } } -#endif /* ACE_HAS_XT */ diff --git a/ace/XtReactor.h b/ace/XtReactor.h index 87b129af19b..e51fc87722e 100644 --- a/ace/XtReactor.h +++ b/ace/XtReactor.h @@ -22,9 +22,7 @@ #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (ACE_HAS_XT) - +#include "ace/ACE_XtReactor_export.h" #include "ace/Select_Reactor.h" //#define String XtString @@ -37,7 +35,7 @@ * @brief This little class is necessary due to the way that Microsoft * implements sockets to be pointers rather than indices. */ -class ACE_Export ACE_XtReactorID +class ACE_XtReactor_Export ACE_XtReactorID { public: /// Magic cookie. @@ -56,7 +54,7 @@ public: * @brief An object-oriented event demultiplexor and event handler * dispatcher that uses the X Toolkit functions. */ -class ACE_Export ACE_XtReactor : public ACE_Select_Reactor +class ACE_XtReactor_Export ACE_XtReactor : public ACE_Select_Reactor { public: // = Initialization and termination methods. @@ -132,7 +130,6 @@ private: ACE_XtReactor (const ACE_XtReactor &); ACE_XtReactor &operator = (const ACE_XtReactor &); }; -#endif /* ACE_HAS_XT */ #include /**/ "ace/post.h" #endif /* ACE_XTREACTOR_H */ diff --git a/ace/ace.mpc b/ace/ace.mpc index 7f251355452..1959cb09e44 100644 --- a/ace/ace.mpc +++ b/ace/ace.mpc @@ -1,15 +1,12 @@ // -*- MPC -*- now wouldn't this be cool... // $Id$ -project(ACE) : acedefaults, aceversion, core, qt_reactor, other, codecs, token, svcconf, uuid, filecache { +project(ACE) : acedefaults, core, other, codecs, token, svcconf, uuid, filecache { libout = $(ACE_ROOT)/lib sharedname = ACE dynamicflags = ACE_BUILD_DLL install = $(ACE_ROOT)/lib - // This mpc file could be greatly simplified by putting the separate components - // in subdirectories. - // Old OS files. put these back and remove the OS_NS*, Cleanup.cpp, and // Object_Manager_Base.cpp to improve compile times at the cost of // footprint. dhinton @@ -20,379 +17,339 @@ project(ACE) : acedefaults, aceversion, core, qt_reactor, other, codecs, token, //Synch.cpp Source_Files(ACE_COMPONENTS) { - ACE_OS { - Basic_Types.cpp - Time_Value.cpp - Cleanup.cpp - Object_Manager_Base.cpp - OS_main.cpp - OS_NS_arpa_inet.cpp - OS_NS_ctype.cpp - OS_NS_dirent.cpp - OS_NS_dlfcn.cpp - OS_NS_errno.cpp - OS_NS_fcntl.cpp - OS_NS_math.cpp - OS_NS_netdb.cpp - OS_NS_poll.cpp - OS_NS_pwd.cpp - OS_NS_regex.cpp - OS_NS_signal.cpp - OS_NS_stdio.cpp - OS_NS_stdlib.cpp - OS_NS_string.cpp - OS_NS_strings.cpp - OS_NS_stropts.cpp - OS_NS_sys_mman.cpp - OS_NS_sys_msg.cpp - OS_NS_sys_resource.cpp - OS_NS_sys_select.cpp - OS_NS_sys_shm.cpp - OS_NS_sys_socket.cpp - OS_NS_sys_stat.cpp - OS_NS_sys_time.cpp - OS_NS_sys_uio.cpp - OS_NS_sys_utsname.cpp - OS_NS_sys_wait.cpp - OS_NS_Thread.cpp - OS_NS_time.cpp - OS_NS_unistd.cpp - OS_NS_wchar.cpp - OS_QoS.cpp - OS_TLI.cpp - OS_Errno.cpp - ARGV.cpp - Argv_Type_Converter.cpp - Base_Thread_Adapter.cpp - OS_Thread_Adapter.cpp - OS_Log_Msg_Attributes.cpp - Thread_Hook.cpp - Sched_Params.cpp - Handle_Set.cpp - Copy_Disabled.cpp - Date_Time.cpp - gethrtime.cpp - } - - Utils { - ACE.cpp - ACE_crc32.cpp - ACE_crc_ccitt.cpp - Active_Map_Manager.cpp - Arg_Shifter.cpp - Capabilities.cpp - Containers.cpp - Configuration.cpp - Configuration_Import_Export.cpp - Dirent.cpp - Dirent_Selector.cpp - Dynamic.cpp - Flag_Manip.cpp - Framework_Component.cpp - Functor.cpp - Functor_String.cpp - Get_Opt.cpp - Hash_Map_Manager.cpp - Connection_Recycling_Strategy.cpp - Hashable.cpp - Notification_Strategy.cpp - Recyclable.cpp - Refcountable.cpp - Handle_Ops.cpp - Init_ACE.cpp - Lib_Find.cpp - Message_Block.cpp - Method_Request.cpp - Object_Manager.cpp - Registry.cpp - String_Base_Const.cpp - SString.cpp - Stats.cpp - Container_Instantiations.cpp - Sample_History.cpp - } - - Logging { - Dump.cpp - Log_Msg.cpp - Log_Msg_Callback.cpp - Log_Msg_Backend.cpp - Log_Msg_IPC.cpp - Log_Msg_NT_Event_Log.cpp - Log_Msg_UNIX_Syslog.cpp - Log_Record.cpp - Logging_Strategy.cpp - Trace.cpp - } - - Threads { - Activation_Queue.cpp - Atomic_Op.cpp - Process.cpp - Process_Manager.cpp - TSS_Adapter.cpp - Auto_Event.cpp - Manual_Event.cpp - Barrier.cpp - Condition_Thread_Mutex.cpp - Condition_Recursive_Thread_Mutex.cpp - Event.cpp - Lock.cpp - Mutex.cpp - RW_Mutex.cpp - RW_Thread_Mutex.cpp - Recursive_Thread_Mutex.cpp - Semaphore.cpp - Thread_Mutex.cpp - Thread_Semaphore.cpp - Synch_Options.cpp - Process_Semaphore.cpp - Process_Mutex.cpp - RW_Process_Mutex.cpp - File_Lock.cpp - Thread.cpp - Thread_Manager.cpp - Thread_Adapter.cpp - Thread_Exit.cpp - Thread_Control.cpp - Token.cpp - } - - Demux { - Event_Handler.cpp - FlReactor.cpp - Msg_WFMO_Reactor.cpp - POSIX_Proactor.cpp - POSIX_CB_Proactor.cpp - WIN32_Proactor.cpp - Priority_Reactor.cpp - Proactor.cpp - Reactor.cpp - Select_Reactor.cpp - Select_Reactor_Base.cpp - SUN_Proactor.cpp - Dev_Poll_Reactor.cpp - TP_Reactor.cpp - TkReactor.cpp - WFMO_Reactor.cpp - XtReactor.cpp - QtReactor.cpp - } - - Connection { - Asynch_IO.cpp - Asynch_IO_Impl.cpp - Asynch_Pseudo_Task.cpp - POSIX_Asynch_IO.cpp - WIN32_Asynch_IO.cpp - } - - Sockets { - Addr.cpp - INET_Addr.cpp - IPC_SAP.cpp - ICMP_Socket.cpp - LSOCK.cpp - LSOCK_Acceptor.cpp - LSOCK_CODgram.cpp - LSOCK_Connector.cpp - LSOCK_Dgram.cpp - LSOCK_Stream.cpp - Multihomed_INET_Addr.cpp - Ping_Socket.cpp - SOCK.cpp - SOCK_Acceptor.cpp - SOCK_CODgram.cpp - Sock_Connect.cpp - SOCK_Connector.cpp - SOCK_Dgram.cpp - SOCK_Dgram_Bcast.cpp - SOCK_Dgram_Mcast.cpp - SOCK_IO.cpp - SOCK_SEQPACK_Acceptor.cpp - SOCK_SEQPACK_Association.cpp - SOCK_SEQPACK_Connector.cpp - SOCK_Stream.cpp - } - - IPC { - ATM_Addr.cpp - ATM_Acceptor.cpp - ATM_Connector.cpp - ATM_Params.cpp - ATM_QoS.cpp - ATM_Stream.cpp - XTI_ATM_Mcast.cpp - DEV.cpp - DEV_Addr.cpp - DEV_Connector.cpp - DEV_IO.cpp - FIFO.cpp - FIFO_Recv.cpp - FIFO_Recv_Msg.cpp - FIFO_Send.cpp - FIFO_Send_Msg.cpp - FILE_Addr.cpp - FILE.cpp - FILE_Connector.cpp - FILE_IO.cpp - IO_SAP.cpp - IOStream.cpp - Pipe.cpp - Signal.cpp - SPIPE_Addr.cpp - SPIPE.cpp - SPIPE_Acceptor.cpp - SPIPE_Connector.cpp - SPIPE_Stream.cpp - SV_Message.cpp - SV_Message_Queue.cpp - SV_Semaphore_Complex.cpp - SV_Semaphore_Simple.cpp - SV_Shared_Memory.cpp - TLI.cpp - TLI_Acceptor.cpp - TLI_Connector.cpp - TLI_Stream.cpp - TTY_IO.cpp - UNIX_Addr.cpp - UPIPE_Acceptor.cpp - UPIPE_Connector.cpp - UPIPE_Stream.cpp - MEM_Acceptor.cpp - MEM_Addr.cpp - MEM_Connector.cpp - MEM_IO.cpp - MEM_SAP.cpp - MEM_Stream.cpp - } - - Streams { - CDR_Base.cpp - CDR_Stream.cpp - Codeset_IBM1047.cpp - Codeset_Registry.cpp - Codeset_Registry_db.cpp - Message_Queue.cpp - Reactor_Notification_Strategy.cpp - Task.cpp - } - - Memory { - Based_Pointer_Repository.cpp - Malloc.cpp - PI_Malloc.cpp - Local_Memory_Pool.cpp - MMAP_Memory_Pool.cpp - Malloc_Allocator.cpp - Malloc_Instantiations.cpp - Mem_Map.cpp - Obchunk.cpp - Obstack.cpp - Pagefile_Memory_Pool.cpp - Read_Buffer.cpp - Sbrk_Memory_Pool.cpp - Shared_Memory.cpp - Shared_Memory_MM.cpp - Shared_Memory_SV.cpp - Shared_Memory_Pool.cpp - } - - Timer { - Basic_Stats.cpp - High_Res_Timer.cpp - Profile_Timer.cpp - System_Time.cpp - Time_Request_Reply.cpp - Timeprobe.cpp - Timer_Hash.cpp - Timer_Heap.cpp - Timer_List.cpp - Timer_Queue.cpp - Timer_Wheel.cpp - } - - Metrics { - Metrics_Cache.cpp - } + ACE.cpp + ACE_crc_ccitt.cpp + ACE_crc32.cpp + Activation_Queue.cpp + Active_Map_Manager.cpp + Addr.cpp + Arg_Shifter.cpp + ARGV.cpp + Argv_Type_Converter.cpp + Asynch_IO.cpp + Asynch_IO_Impl.cpp + Asynch_Pseudo_Task.cpp + ATM_Acceptor.cpp + ATM_Addr.cpp + ATM_Connector.cpp + ATM_Params.cpp + ATM_QoS.cpp + ATM_Stream.cpp + Atomic_Op.cpp + Auto_Event.cpp + Barrier.cpp + Base_Thread_Adapter.cpp + Based_Pointer_Repository.cpp + Basic_Stats.cpp + Basic_Types.cpp + Capabilities.cpp + CDR_Base.cpp + CDR_Stream.cpp + Cleanup.cpp + Codeset_IBM1047.cpp + Codeset_Registry.cpp + Codeset_Registry_db.cpp + Condition_Recursive_Thread_Mutex.cpp + Condition_Thread_Mutex.cpp + Configuration.cpp + Configuration_Import_Export.cpp + Connection_Recycling_Strategy.cpp + Container_Instantiations.cpp + Containers.cpp + Copy_Disabled.cpp + Date_Time.cpp + DEV.cpp + DEV_Addr.cpp + DEV_Connector.cpp + DEV_IO.cpp + Dev_Poll_Reactor.cpp + Dirent.cpp + Dirent_Selector.cpp + Dump.cpp + Dynamic.cpp + Event.cpp + Event_Handler.cpp + FIFO.cpp + FIFO_Recv.cpp + FIFO_Recv_Msg.cpp + FIFO_Send.cpp + FIFO_Send_Msg.cpp + FILE.cpp + FILE_Addr.cpp + FILE_Connector.cpp + FILE_IO.cpp + File_Lock.cpp + Flag_Manip.cpp + Framework_Component.cpp + Functor.cpp + Functor_String.cpp + Get_Opt.cpp + gethrtime.cpp + Handle_Ops.cpp + Handle_Set.cpp + Hash_Map_Manager.cpp + Hashable.cpp + High_Res_Timer.cpp + ICMP_Socket.cpp + INET_Addr.cpp + Init_ACE.cpp + IO_SAP.cpp + IOStream.cpp + IPC_SAP.cpp + Lib_Find.cpp + Local_Memory_Pool.cpp + Lock.cpp + Log_Msg.cpp + Log_Msg_Backend.cpp + Log_Msg_Callback.cpp + Log_Msg_IPC.cpp + Log_Msg_NT_Event_Log.cpp + Log_Msg_UNIX_Syslog.cpp + Log_Record.cpp + Logging_Strategy.cpp + LSOCK.cpp + LSOCK_Acceptor.cpp + LSOCK_CODgram.cpp + LSOCK_Connector.cpp + LSOCK_Dgram.cpp + LSOCK_Stream.cpp + Malloc.cpp + Malloc_Allocator.cpp + Malloc_Instantiations.cpp + Manual_Event.cpp + MEM_Acceptor.cpp + MEM_Addr.cpp + MEM_Connector.cpp + MEM_IO.cpp + Mem_Map.cpp + MEM_SAP.cpp + MEM_Stream.cpp + Message_Block.cpp + Message_Queue.cpp + Method_Request.cpp + Metrics_Cache.cpp + MMAP_Memory_Pool.cpp + Msg_WFMO_Reactor.cpp + Multihomed_INET_Addr.cpp + Mutex.cpp + Notification_Strategy.cpp + Obchunk.cpp + Object_Manager.cpp + Object_Manager_Base.cpp + Obstack.cpp + OS_Errno.cpp + OS_Log_Msg_Attributes.cpp + OS_main.cpp + OS_NS_arpa_inet.cpp + OS_NS_ctype.cpp + OS_NS_dirent.cpp + OS_NS_dlfcn.cpp + OS_NS_errno.cpp + OS_NS_fcntl.cpp + OS_NS_math.cpp + OS_NS_netdb.cpp + OS_NS_poll.cpp + OS_NS_pwd.cpp + OS_NS_regex.cpp + OS_NS_signal.cpp + OS_NS_stdio.cpp + OS_NS_stdlib.cpp + OS_NS_string.cpp + OS_NS_strings.cpp + OS_NS_stropts.cpp + OS_NS_sys_mman.cpp + OS_NS_sys_msg.cpp + OS_NS_sys_resource.cpp + OS_NS_sys_select.cpp + OS_NS_sys_shm.cpp + OS_NS_sys_socket.cpp + OS_NS_sys_stat.cpp + OS_NS_sys_time.cpp + OS_NS_sys_uio.cpp + OS_NS_sys_utsname.cpp + OS_NS_sys_wait.cpp + OS_NS_Thread.cpp + OS_NS_time.cpp + OS_NS_unistd.cpp + OS_NS_wchar.cpp + OS_QoS.cpp + OS_Thread_Adapter.cpp + OS_TLI.cpp + Pagefile_Memory_Pool.cpp + PI_Malloc.cpp + Ping_Socket.cpp + Pipe.cpp + POSIX_Asynch_IO.cpp + POSIX_CB_Proactor.cpp + POSIX_Proactor.cpp + Priority_Reactor.cpp + Proactor.cpp + Process.cpp + Process_Manager.cpp + Process_Mutex.cpp + Process_Semaphore.cpp + Profile_Timer.cpp + Reactor.cpp + Reactor_Notification_Strategy.cpp + Read_Buffer.cpp + Recursive_Thread_Mutex.cpp + Recyclable.cpp + Refcountable.cpp + Registry.cpp + RW_Mutex.cpp + RW_Process_Mutex.cpp + RW_Thread_Mutex.cpp + Sample_History.cpp + Sbrk_Memory_Pool.cpp + Sched_Params.cpp + Select_Reactor.cpp + Select_Reactor_Base.cpp + Semaphore.cpp + Shared_Memory.cpp + Shared_Memory_MM.cpp + Shared_Memory_Pool.cpp + Shared_Memory_SV.cpp + Signal.cpp + SOCK.cpp + SOCK_Acceptor.cpp + SOCK_CODgram.cpp + Sock_Connect.cpp + SOCK_Connector.cpp + SOCK_Dgram.cpp + SOCK_Dgram_Bcast.cpp + SOCK_Dgram_Mcast.cpp + SOCK_IO.cpp + SOCK_SEQPACK_Acceptor.cpp + SOCK_SEQPACK_Association.cpp + SOCK_SEQPACK_Connector.cpp + SOCK_Stream.cpp + SPIPE.cpp + SPIPE_Acceptor.cpp + SPIPE_Addr.cpp + SPIPE_Connector.cpp + SPIPE_Stream.cpp + SString.cpp + Stats.cpp + String_Base_Const.cpp + SUN_Proactor.cpp + SV_Message.cpp + SV_Message_Queue.cpp + SV_Semaphore_Complex.cpp + SV_Semaphore_Simple.cpp + SV_Shared_Memory.cpp + Synch_Options.cpp + System_Time.cpp + Task.cpp + Thread.cpp + Thread_Adapter.cpp + Thread_Control.cpp + Thread_Exit.cpp + Thread_Hook.cpp + Thread_Manager.cpp + Thread_Mutex.cpp + Thread_Semaphore.cpp + Time_Request_Reply.cpp + Time_Value.cpp + Timeprobe.cpp + Timer_Hash.cpp + Timer_Heap.cpp + Timer_List.cpp + Timer_Queue.cpp + Timer_Wheel.cpp + TLI.cpp + TLI_Acceptor.cpp + TLI_Connector.cpp + TLI_Stream.cpp + Token.cpp + TP_Reactor.cpp + Trace.cpp + TSS_Adapter.cpp + TTY_IO.cpp + UNIX_Addr.cpp + UPIPE_Acceptor.cpp + UPIPE_Connector.cpp + UPIPE_Stream.cpp + WFMO_Reactor.cpp + WIN32_Asynch_IO.cpp + WIN32_Proactor.cpp + XTI_ATM_Mcast.cpp } Template_Files { - Acceptor.cpp - Active_Map_Manager_T.cpp - Array_Base.cpp - Asynch_Acceptor.cpp - Asynch_Connector.cpp - Atomic_Op_T.cpp - Auto_Functor.cpp - Auto_IncDec_T.cpp - Auto_Ptr.cpp - Based_Pointer_T.cpp - Cache_Map_Manager_T.cpp - Cached_Connect_Strategy_T.cpp - Caching_Strategies_T.cpp - Caching_Utility_T.cpp - Cleanup_Strategies_T.cpp - Condition_T.cpp - Connector.cpp - Containers_T.cpp - Dump_T.cpp - Dynamic_Service.cpp - Env_Value_T.cpp - Event_Handler_T.cpp - Framework_Component_T.cpp - Free_List.cpp - Functor_T.cpp - Future.cpp - Future_Set.cpp - Guard_T.cpp - Hash_Cache_Map_Manager_T.cpp - Hash_Map_Manager_T.cpp - Hash_Map_With_Allocator_T.cpp - IOStream_T.cpp - Intrusive_List.cpp - Intrusive_List_Node.cpp - LOCK_SOCK_Acceptor.cpp - Local_Name_Space_T.cpp - Lock_Adapter_T.cpp - Malloc_T.cpp - Managed_Object.cpp - Map_Manager.cpp - Map_T.cpp - Message_Block_T.cpp - Message_Queue_T.cpp - Module.cpp - Node.cpp - Obstack_T.cpp - Pair_T.cpp - RB_Tree.cpp - Reverse_Lock_T.cpp - Select_Reactor_T.cpp - Singleton.cpp - Strategies_T.cpp - Stream.cpp - Stream_Modules.cpp - String_Base.cpp - Svc_Handler.cpp - Synch_T.cpp - TSS_T.cpp - Task_Ex_T.cpp - Task_T.cpp - Template_Instantiations.cpp - Test_and_Set.cpp - Timeprobe_T.cpp - Timer_Hash_T.cpp - Timer_Heap_T.cpp - Timer_List_T.cpp - Timer_Queue_Adapters.cpp - Timer_Queue_T.cpp - Timer_Wheel_T.cpp - Typed_SV_Message.cpp - Typed_SV_Message_Queue.cpp - Unbounded_Queue.cpp - Unbounded_Set.cpp - Unbounded_Set_Ex.cpp - Vector_T.cpp + Acceptor.cpp + Active_Map_Manager_T.cpp + Array_Base.cpp + Asynch_Acceptor.cpp + Asynch_Connector.cpp + Atomic_Op_T.cpp + Auto_Functor.cpp + Auto_IncDec_T.cpp + Auto_Ptr.cpp + Based_Pointer_T.cpp + Cache_Map_Manager_T.cpp + Cached_Connect_Strategy_T.cpp + Caching_Strategies_T.cpp + Caching_Utility_T.cpp + Cleanup_Strategies_T.cpp + Condition_T.cpp + Connector.cpp + Containers_T.cpp + Dump_T.cpp + Dynamic_Service.cpp + Env_Value_T.cpp + Event_Handler_T.cpp + Framework_Component_T.cpp + Free_List.cpp + Functor_T.cpp + Future.cpp + Future_Set.cpp + Guard_T.cpp + Hash_Cache_Map_Manager_T.cpp + Hash_Map_Manager_T.cpp + Hash_Map_With_Allocator_T.cpp + IOStream_T.cpp + Intrusive_List.cpp + Intrusive_List_Node.cpp + LOCK_SOCK_Acceptor.cpp + Local_Name_Space_T.cpp + Lock_Adapter_T.cpp + Malloc_T.cpp + Managed_Object.cpp + Map_Manager.cpp + Map_T.cpp + Message_Block_T.cpp + Message_Queue_T.cpp + Module.cpp + Node.cpp + Obstack_T.cpp + Pair_T.cpp + RB_Tree.cpp + Reverse_Lock_T.cpp + Select_Reactor_T.cpp + Singleton.cpp + Strategies_T.cpp + Stream.cpp + Stream_Modules.cpp + String_Base.cpp + Svc_Handler.cpp + Synch_T.cpp + TSS_T.cpp + Task_Ex_T.cpp + Task_T.cpp + Template_Instantiations.cpp + Test_and_Set.cpp + Timeprobe_T.cpp + Timer_Hash_T.cpp + Timer_Heap_T.cpp + Timer_List_T.cpp + Timer_Queue_Adapters.cpp + Timer_Queue_T.cpp + Timer_Wheel_T.cpp + Typed_SV_Message.cpp + Typed_SV_Message_Queue.cpp + Unbounded_Queue.cpp + Unbounded_Set.cpp + Vector_T.cpp } Inline_Files { @@ -408,7 +365,6 @@ project(ACE) : acedefaults, aceversion, core, qt_reactor, other, codecs, token, Reverse_Lock_T.inl Swap.inl TSS_T.inl - Unbounded_Set_Ex.inl ace_wchar.inl } @@ -459,7 +415,6 @@ project(ACE) : acedefaults, aceversion, core, qt_reactor, other, codecs, token, TSS_T.h Timer_Queuefwd.h UPIPE_Addr.h - Unbounded_Set_Ex.h Version.h ace_wchar.h config-WinCE.h @@ -492,6 +447,7 @@ project(ACE) : acedefaults, aceversion, core, qt_reactor, other, codecs, token, README ../VERSION } + verbatim(gnuace, local) { "Svc_Conf_y.cpp: Svc_Conf.y" " $(YACC) -l -d Svc_Conf.y" diff --git a/ace/ace.mwc b/ace/ace.mwc index 0ae6180ea24..fc541981260 100644 --- a/ace/ace.mwc +++ b/ace/ace.mwc @@ -3,8 +3,10 @@ workspace { ace.mpc + ace_flreactor.mpc + ace_qtreactor.mpc + ace_tkreactor.mpc + ace_xtreactor.mpc QoS - RMCast SSL - TMCast } diff --git a/ace/ace_wchar.h b/ace/ace_wchar.h index 8b115c13cb6..d118c3ce3b6 100644 --- a/ace/ace_wchar.h +++ b/ace/ace_wchar.h @@ -264,6 +264,7 @@ typedef ACE_Wide_To_Ascii ACE_OS_WString; #define ACE_TEXT_OpenFileMapping ::OpenFileMappingW #define ACE_TEXT_OpenSCManager ::OpenSCManagerW #define ACE_TEXT_OpenService ::OpenServiceW +#define ACE_TEXT_OutputDebugString ::OutputDebugStringW #define ACE_TEXT_RegisterEventSource ::RegisterEventSourceW #define ACE_TEXT_RegisterServiceCtrlHandler ::RegisterServiceCtrlHandlerW #define ACE_TEXT_RegConnectRegistry ::RegConnectRegistryW @@ -312,6 +313,7 @@ typedef ACE_Wide_To_Ascii ACE_OS_WString; #define ACE_TEXT_OpenFileMapping ::OpenFileMappingA #define ACE_TEXT_OpenSCManager ::OpenSCManagerA #define ACE_TEXT_OpenService ::OpenServiceA +#define ACE_TEXT_OutputDebugString ::OutputDebugStringA #define ACE_TEXT_RegisterEventSource ::RegisterEventSourceA #define ACE_TEXT_RegisterServiceCtrlHandler ::RegisterServiceCtrlHandlerA #define ACE_TEXT_RegConnectRegistry ::RegConnectRegistryA diff --git a/ace/codecs.mpb b/ace/codecs.mpb index 2acc9343db7..d8c85fffddb 100644 --- a/ace/codecs.mpb +++ b/ace/codecs.mpb @@ -3,8 +3,6 @@ feature(ace_codecs) { Source_Files(ACE_COMPONENTS) { - Codecs { - Codecs.cpp - } + Codecs.cpp } } diff --git a/ace/config-aix-4.x.h b/ace/config-aix-4.x.h index 6358813be38..5c9ea452378 100644 --- a/ace/config-aix-4.x.h +++ b/ace/config-aix-4.x.h @@ -48,8 +48,6 @@ # if (__xlC__ < 0x0500) # define ACE_LACKS_PLACEMENT_OPERATOR_DELETE # endif /* __xlC__ < 0x0500 */ -# define ACE_TEMPLATES_REQUIRE_PRAGMA - // If compiling without thread support, turn off ACE's thread capability. # endif // These are for Visual Age C++ only diff --git a/ace/config-doxygen.h b/ace/config-doxygen.h index 79c26b05ce8..2555cd82bda 100644 --- a/ace/config-doxygen.h +++ b/ace/config-doxygen.h @@ -58,13 +58,6 @@ /// Enable support for the SSL wrappers #define ACE_HAS_SSL 1 -/// Several GUI Reactors that are only enabled in some platforms. -#define ACE_HAS_XT -#define ACE_HAS_FL -#define ACE_HAS_QT -#define ACE_HAS_TK -#define ACE_HAS_GTK - /// Enable exceptions #define ACE_HAS_EXCEPTIONS @@ -110,6 +103,9 @@ /// Doxygen is capable of parsing using #define ACE_HAS_USING_KEYWORD +/// Generate icmp documentation +#define ACE_HAS_ICMP_SUPPORT 1 + /// Parse some ACE_SSL classes that depend on recent versions of /// OpenSSL. #define OPENSSL_VERSION_NUMBER 0x00905820L diff --git a/ace/config-lite.h b/ace/config-lite.h index 309d52c1499..7ea8ef8cb14 100644 --- a/ace/config-lite.h +++ b/ace/config-lite.h @@ -195,26 +195,30 @@ # define ACE_INLINE #endif /* __ACE_INLINE__ */ -// ========================================================================= -// EXPLICIT macro -// ========================================================================= - -/** - * @deprecated explicit is deprecated. ACE requires C++ - * "explicit" keyword support. - */ -# define ACE_EXPLICIT explicit - -// ========================================================================= -// MUTABLE macro -// ========================================================================= - -/** - * @deprecated ACE_MUTABLE is deprecated. ACE requires C++ "mutable" - * keyword support. - */ -# define ACE_MUTABLE mutable -# define ACE_CONST_WHEN_MUTABLE const +#if !defined (ACE_LACKS_DEPRECATED_MACROS) + // ========================================================================= + // EXPLICIT macro + // ========================================================================= + + /** + * @deprecated explicit is deprecated. ACE requires C++ + * "explicit" keyword support. + */ + # define ACE_EXPLICIT explicit +#endif /* ACE_LACKS_DEPRECATED_MACROS */ + +#if !defined (ACE_LACKS_DEPRECATED_MACROS) + // ========================================================================= + // MUTABLE macro + // ========================================================================= + + /** + * @deprecated ACE_MUTABLE is deprecated. ACE requires C++ "mutable" + * keyword support. + */ + # define ACE_MUTABLE mutable + # define ACE_CONST_WHEN_MUTABLE const +#endif /* ACE_LACKS_DEPRECATED_MACROS */ // ============================================================================ // EXPORT macros diff --git a/ace/config-lynxos.h b/ace/config-lynxos.h index 2183ebf1d3d..a9394f87cdb 100644 --- a/ace/config-lynxos.h +++ b/ace/config-lynxos.h @@ -14,8 +14,6 @@ #define ACE_CONFIG_H #include /**/ "ace/pre.h" -#include /* Get _POSIX_VERSION macro */ - #if ! defined (__ACE_INLINE__) # define __ACE_INLINE__ #endif /* ! __ACE_INLINE__ */ @@ -24,7 +22,7 @@ # include "ace/config-g++-common.h" #endif /* __GNUG__ */ -#if _POSIX_VERSION >= 199506L +#if ACE_LYNXOS_MAJOR > 3 || (ACE_LYNXOS_MAJOR == 3 && ACE_LYNXOS_MINOR > 0) // LynxOS 3.1.0 or greater need ipc_1c.h to be included before net/if.h // to avoid macro conflict. # define ACE_NEEDS_IPC_1C_H @@ -125,14 +123,14 @@ #if ACE_MT_SAFE == 1 // Platform supports threads. # define ACE_HAS_PTHREADS -# if _POSIX_VERSION >= 199506L +# if ACE_LYNXOS_MAJOR > 3 || (ACE_LYNXOS_MAJOR == 3 && ACE_LYNXOS_MINOR > 0) /* LynxOS 3.1.0 or greater */ # define ACE_HAS_PTHREADS_STD # else /* LynxOS < 3.1.0 */ # define ACE_HAS_PTHREADS_DRAFT4 # define ACE_HAS_STDARG_THR_DEST # define ACE_LACKS_MUTEXATTR_PSHARED - // Without TSS emulation, you'll only have 3 native TSS keys, on + // Without TSS emulation, you'll only have 3 native TSS keys on // LynxOS 3.0.0/ppc. # define ACE_HAS_TSS_EMULATION # endif /* LynxOS < 3.1.0 */ @@ -148,8 +146,7 @@ #define ACE_HAS_AIO_CALLS #define ACE_POSIX_AIOCB_PROACTOR -// AIOCB Proactor works on Lynx. But it is not -// multi-threaded. +// AIOCB Proactor works on Lynx. But it is not multi-threaded. // Lynx OS 3.0.0 lacks POSIX call . So,we cannot use // SIG Proactor also, with multiple threads. So, let us use the AIOCB // Proactor. Once is available on Lynx, we can turn @@ -164,13 +161,13 @@ #define ACE_HAS_USING_KEYWORD #if __GNUC__ == 2 && __GNUC_MINOR__ == 9 - // config-g++-common.h defines these incorrectly for LynxOS 3.x - // with G++ version 2.9-gnupro-98r2 -# define ACE_HAS_STD_TEMPLATE_CLASS_MEMBER_SPECIALIZATION -# define ACE_HAS_STD_TEMPLATE_SPECIALIZATION -# define ACE_HAS_TEMPLATE_SPECIALIZATION -# define ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION -# undef ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES + // config-g++-common.h defines these incorrectly for LynxOS 3.x + // with G++ version 2.9-gnupro-98r2 +# define ACE_HAS_STD_TEMPLATE_CLASS_MEMBER_SPECIALIZATION +# define ACE_HAS_STD_TEMPLATE_SPECIALIZATION +# define ACE_HAS_TEMPLATE_SPECIALIZATION +# define ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION +# undef ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES #endif /* __GNUC__ == 2 && __GNUC_MINOR__ == 9 */ // By default, don't include RCS Id strings in object code. @@ -181,19 +178,15 @@ // System include files are not in sys/, this gets rid of warning. #define __NO_INCLUDE_WARN__ -// socket.h from LynxOS 4.0.x defines SOCK_MAXADDRLEN. Versions -// of socket.h found on earlier releases of LynxOS do not define it. -#include -#if _POSIX_VERSION >= 199506L && defined (SOCK_MAXADDRLEN) - -// "changes signedness" error (OS.i and many other files) +#if ACE_LYNXOS_MAJOR > 3 /* LynxOS 4.x */ + // "changes signedness" error (OS.i and many other files) # define ACE_HAS_SOCKLEN_T - -// LSOCK.cpp uses a macro from param.h, not included + // LSOCK.cpp uses a macro from param.h, not included # define ALIGNBYTES (sizeof(int) - 1) # define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES) - -#endif /* _POSIX_VERSION && SOCK_MAXADDRLEN */ +#else /* LynxOS 3.x */ +# define ACE_LACKS_AUTO_PTR +#endif /* ACE_LYNXOS_MAJOR > 3 */ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_H */ diff --git a/ace/config-vxworks5.x.h b/ace/config-vxworks5.x.h index 2a69c3e7e2f..4a2b0383737 100644 --- a/ace/config-vxworks5.x.h +++ b/ace/config-vxworks5.x.h @@ -108,7 +108,6 @@ #define ACE_HAS_NONCONST_SWAB #define ACE_HAS_NONCONST_READV #define ACE_HAS_NONCONST_CHDIR -#define ACE_HAS_NONCONST_RMDIR #define ACE_HAS_NONCONST_UNLINK #define ACE_HAS_NONCONST_OPENDIR #define ACE_LACKS_UNIX_SYSLOG diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index 63cc21f58e5..0847e2bf491 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -228,6 +228,7 @@ #define ACE_LACKS_PWD_FUNCTIONS #define ACE_LACKS_WAIT #define ACE_LACKS_SOCKETPAIR +#define ACE_LACKS_UNIX_SYSLOG #define ACE_HAS_SNPRINTF #define ACE_HAS_VFWPRINTF diff --git a/ace/config-win32-msvc.h b/ace/config-win32-msvc.h index 6262f39b820..bb319cef13e 100644 --- a/ace/config-win32-msvc.h +++ b/ace/config-win32-msvc.h @@ -139,12 +139,5 @@ # endif /* !STRICT */ # endif /* ACE_HAS_STRICT */ -// Define QT_DLL for QtReactor to be compiled correct -# if defined (ACE_HAS_QT) -# if !defined (QT_DLL) /* may already be defined */ -# define QT_DLL -# endif /* !QT_DLL */ -# endif - #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_H */ diff --git a/ace/filecache.mpb b/ace/filecache.mpb index a1b94c41fef..f5da84a3314 100644 --- a/ace/filecache.mpb +++ b/ace/filecache.mpb @@ -3,8 +3,6 @@ feature(ace_filecache) { Source_Files(ACE_COMPONENTS) { - Filecache { - Filecache.cpp - } + Filecache.cpp } } diff --git a/ace/os_include/os_pthread.h b/ace/os_include/os_pthread.h index bcdcbdc6d05..6eccef3a418 100644 --- a/ace/os_include/os_pthread.h +++ b/ace/os_include/os_pthread.h @@ -66,6 +66,11 @@ extern "C" pthread_t pthread_self (void); } #endif /* !ACE_LACKS_PTHREAD_H */ +#if defined (ACE_HAS_PTHREAD_NP_H) +// FreeBSD declares _np (non-portable) pthread extensions in +# include /**/ +#endif + // @todo: need to reoganize to put includes at the top and the rest of the // code at the bottom. Also, move the classes out of this file. #if defined (ACE_HAS_PTHREADS) diff --git a/ace/other.mpb b/ace/other.mpb index a2f0015b0db..9599ab8282b 100644 --- a/ace/other.mpb +++ b/ace/other.mpb @@ -3,15 +3,13 @@ feature(ace_other) { Source_Files(ACE_COMPONENTS) { - Other { - Local_Name_Space.cpp - Name_Proxy.cpp - Name_Request_Reply.cpp - Name_Space.cpp - Naming_Context.cpp - Registry_Name_Space.cpp - Remote_Name_Space.cpp - NT_Service.cpp - } + Local_Name_Space.cpp + Name_Proxy.cpp + Name_Request_Reply.cpp + Name_Space.cpp + Naming_Context.cpp + Registry_Name_Space.cpp + Remote_Name_Space.cpp + NT_Service.cpp } } diff --git a/ace/qt_reactor.mpb b/ace/qt_reactor.mpb index e596b5e5d5c..ea302f05bda 100644 --- a/ace/qt_reactor.mpb +++ b/ace/qt_reactor.mpb @@ -7,8 +7,6 @@ feature(qt): ace_qt, qt_moc { } Source_Files(ACE_COMPONENTS) { - Demux { QtReactor_moc.cpp - } } } diff --git a/ace/svcconf.mpb b/ace/svcconf.mpb index 5f5ba112e86..c05fd56ce09 100644 --- a/ace/svcconf.mpb +++ b/ace/svcconf.mpb @@ -5,22 +5,20 @@ feature(ace_svcconf) { macros += ACE_HAS_ACE_SVCCONF Source_Files(ACE_COMPONENTS) { - Svcconf { - DLL.cpp - DLL_Manager.cpp - Dynamic_Service_Base.cpp - Parse_Node.cpp - Service_Config.cpp - Service_Manager.cpp - Service_Object.cpp - Service_Repository.cpp - Service_Types.cpp - Service_Templates.cpp - Shared_Object.cpp - Svc_Conf_l.cpp - Svc_Conf_y.cpp - Svc_Conf_Lexer_Guard.cpp - XML_Svc_Conf.cpp - } + DLL.cpp + DLL_Manager.cpp + Dynamic_Service_Base.cpp + Parse_Node.cpp + Service_Config.cpp + Service_Manager.cpp + Service_Object.cpp + Service_Repository.cpp + Service_Types.cpp + Service_Templates.cpp + Shared_Object.cpp + Svc_Conf_l.cpp + Svc_Conf_y.cpp + Svc_Conf_Lexer_Guard.cpp + XML_Svc_Conf.cpp } } diff --git a/ace/token.mpb b/ace/token.mpb index 7795ec54328..e2a03f6edc8 100644 --- a/ace/token.mpb +++ b/ace/token.mpb @@ -5,13 +5,11 @@ feature(ace_token) { macros += ACE_HAS_ACE_TOKEN Source_Files(ACE_COMPONENTS) { - Token { - Local_Tokens.cpp - Remote_Tokens.cpp - Token_Collection.cpp - Token_Invariants.cpp - Token_Manager.cpp - Token_Request_Reply.cpp - } + Local_Tokens.cpp + Remote_Tokens.cpp + Token_Collection.cpp + Token_Invariants.cpp + Token_Manager.cpp + Token_Request_Reply.cpp } } diff --git a/ace/uuid.mpb b/ace/uuid.mpb index a7f9db9eb64..3357a6e61b8 100644 --- a/ace/uuid.mpb +++ b/ace/uuid.mpb @@ -3,8 +3,6 @@ feature(ace_uuid) { Source_Files(ACE_COMPONENTS) { - UUID { - UUID.cpp - } + UUID.cpp } } -- cgit v1.2.1