chore(Deps/Acelite): Update to 6.5.10 (#3450)

This commit is contained in:
Kargatum
2020-11-11 22:09:02 +07:00
committed by GitHub
parent a93565b6da
commit e27201cee2
921 changed files with 18238 additions and 33164 deletions

3231
deps/acelite/ACE-INSTALL.html vendored Normal file

File diff suppressed because it is too large Load Diff

28
deps/acelite/ACE.mwc vendored Normal file
View File

@@ -0,0 +1,28 @@
workspace {
exclude {
TAO
}
// The associate scope does not add directories to the workspace;
// it only associates a name with one or more directories.
associate(examples) {
examples
}
associate(tests) {
performance-tests
tests
}
associate(gperf) {
gperf
}
// The '--' is a special key that indicates that the associated
// projects should be of the form @NAME@ in the generated Makefile.am.
associate(--) {
ACEXML
ASNMP
protocols
KOKYU
TAO
}
}

View File

@@ -1,16 +1,8 @@
#
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL3 v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 # Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL3 v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
# #
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
if(CMAKE_SYSTEM_NAME MATCHES "Windows") if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
add_subdirectory(ace)
else()
add_library(ace SHARED IMPORTED GLOBAL) add_library(ace SHARED IMPORTED GLOBAL)
set_target_properties(ace set_target_properties(ace
@@ -19,4 +11,352 @@ else()
"${ACE_LIBRARY}" "${ACE_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES INTERFACE_INCLUDE_DIRECTORIES
"${ACE_INCLUDE_DIR}") "${ACE_INCLUDE_DIR}")
else()
# NOTE: Do not use glob here, it would include files we don't want
set(ACE_SOURCES
ace/ACE.cpp
ace/ACE_crc32.cpp
ace/ACE_crc_ccitt.cpp
ace/ATM_Acceptor.cpp
ace/ATM_Addr.cpp
ace/ATM_Connector.cpp
ace/ATM_Params.cpp
ace/ATM_QoS.cpp
ace/ATM_Stream.cpp
ace/Activation_Queue.cpp
ace/Active_Map_Manager.cpp
ace/Addr.cpp
ace/Argv_Type_Converter.cpp
ace/Assert.cpp
ace/Asynch_IO.cpp
ace/Asynch_IO_Impl.cpp
ace/Asynch_Pseudo_Task.cpp
ace/Atomic_Op.cpp
ace/Barrier.cpp
ace/Base_Thread_Adapter.cpp
ace/Based_Pointer_Repository.cpp
ace/Basic_Stats.cpp
ace/Basic_Types.cpp
ace/CDR_Base.cpp
ace/CDR_Size.cpp
ace/CDR_Stream.cpp
ace/Capabilities.cpp
ace/Cleanup.cpp
ace/Codecs.cpp
ace/Codeset_IBM1047.cpp
ace/Codeset_Registry.cpp
ace/Codeset_Registry_db.cpp
ace/Condition_Attributes.cpp
ace/Condition_Recursive_Thread_Mutex.cpp
ace/Condition_Thread_Mutex.cpp
ace/Configuration.cpp
ace/Configuration_Import_Export.cpp
ace/Connection_Recycling_Strategy.cpp
ace/Containers.cpp
ace/Copy_Disabled.cpp
ace/DEV.cpp
ace/DEV_Addr.cpp
ace/DEV_Connector.cpp
ace/DEV_IO.cpp
ace/DLL.cpp
ace/DLL_Manager.cpp
ace/Date_Time.cpp
ace/Dev_Poll_Reactor.cpp
ace/Dirent.cpp
ace/Dirent_Selector.cpp
ace/Dump.cpp
ace/Dynamic.cpp
ace/Dynamic_Message_Strategy.cpp
ace/Dynamic_Service_Base.cpp
ace/Dynamic_Service_Dependency.cpp
ace/Encoding_Converter.cpp
ace/Encoding_Converter_Factory.cpp
ace/Event_Base.cpp
ace/Event_Handler.cpp
ace/Event_Handler_Handle_Timeout_Upcall.cpp
ace/FIFO.cpp
ace/FIFO_Recv.cpp
ace/FIFO_Recv_Msg.cpp
ace/FIFO_Send.cpp
ace/FIFO_Send_Msg.cpp
ace/FILE.cpp
ace/FILE_Addr.cpp
ace/FILE_Connector.cpp
ace/FILE_IO.cpp
ace/File_Lock.cpp
ace/Filecache.cpp
ace/Flag_Manip.cpp
ace/Framework_Component.cpp
ace/Functor.cpp
ace/Functor_String.cpp
ace/Get_Opt.cpp
ace/Handle_Ops.cpp
ace/Handle_Set.cpp
ace/Hashable.cpp
ace/High_Res_Timer.cpp
ace/ICMP_Socket.cpp
ace/INET_Addr.cpp
ace/IOStream.cpp
ace/IO_Cntl_Msg.cpp
ace/IO_SAP.cpp
ace/IPC_SAP.cpp
ace/Init_ACE.cpp
ace/LSOCK.cpp
ace/LSOCK_Acceptor.cpp
ace/LSOCK_CODgram.cpp
ace/LSOCK_Connector.cpp
ace/LSOCK_Dgram.cpp
ace/LSOCK_Stream.cpp
ace/Lib_Find.cpp
ace/Local_Memory_Pool.cpp
ace/Local_Name_Space.cpp
ace/Local_Tokens.cpp
ace/Lock.cpp
ace/Log_Category.cpp
ace/Log_Msg.cpp
ace/Log_Msg_Android_Logcat.cpp
ace/Log_Msg_Backend.cpp
ace/Log_Msg_Callback.cpp
ace/Log_Msg_IPC.cpp
ace/Log_Msg_NT_Event_Log.cpp
ace/Log_Msg_UNIX_Syslog.cpp
ace/Log_Record.cpp
ace/Logging_Strategy.cpp
ace/MEM_Acceptor.cpp
ace/MEM_Addr.cpp
ace/MEM_Connector.cpp
ace/MEM_IO.cpp
ace/MEM_SAP.cpp
ace/MEM_Stream.cpp
ace/MMAP_Memory_Pool.cpp
ace/Malloc.cpp
ace/Malloc_Allocator.cpp
ace/Mem_Map.cpp
ace/Message_Block.cpp
ace/Message_Queue.cpp
ace/Message_Queue_NT.cpp
ace/Message_Queue_Vx.cpp
ace/Method_Request.cpp
ace/Monitor_Admin.cpp
ace/Monitor_Admin_Manager.cpp
ace/Monitor_Base.cpp
ace/Monitor_Control_Action.cpp
ace/Monitor_Control_Types.cpp
ace/Monitor_Point_Registry.cpp
ace/Monitor_Size.cpp
ace/Monotonic_Time_Policy.cpp
ace/Msg_WFMO_Reactor.cpp
ace/Multihomed_INET_Addr.cpp
ace/Mutex.cpp
ace/NT_Service.cpp
ace/Name_Proxy.cpp
ace/Name_Request_Reply.cpp
ace/Name_Space.cpp
ace/Naming_Context.cpp
ace/Netlink_Addr.cpp
ace/Notification_Queue.cpp
ace/Notification_Strategy.cpp
ace/Null_Mutex.cpp
ace/OS_Errno.cpp
ace/OS_Log_Msg_Attributes.cpp
ace/OS_NS_Thread.cpp
ace/OS_NS_arpa_inet.cpp
ace/OS_NS_ctype.cpp
ace/OS_NS_devctl.cpp
ace/OS_NS_dirent.cpp
ace/OS_NS_dlfcn.cpp
ace/OS_NS_errno.cpp
ace/OS_NS_fcntl.cpp
ace/OS_NS_math.cpp
ace/OS_NS_netdb.cpp
ace/OS_NS_poll.cpp
ace/OS_NS_pwd.cpp
ace/OS_NS_regex.cpp
ace/OS_NS_signal.cpp
ace/OS_NS_stdio.cpp
ace/OS_NS_stdlib.cpp
ace/OS_NS_string.cpp
ace/OS_NS_strings.cpp
ace/OS_NS_stropts.cpp
ace/OS_NS_sys_mman.cpp
ace/OS_NS_sys_msg.cpp
ace/OS_NS_sys_resource.cpp
ace/OS_NS_sys_select.cpp
ace/OS_NS_sys_sendfile.cpp
ace/OS_NS_sys_shm.cpp
ace/OS_NS_sys_socket.cpp
ace/OS_NS_sys_stat.cpp
ace/OS_NS_sys_time.cpp
ace/OS_NS_sys_uio.cpp
ace/OS_NS_sys_utsname.cpp
ace/OS_NS_sys_wait.cpp
ace/OS_NS_time.cpp
ace/OS_NS_unistd.cpp
ace/OS_NS_wchar.cpp
ace/OS_NS_wctype.cpp
ace/OS_QoS.cpp
ace/OS_TLI.cpp
ace/OS_Thread_Adapter.cpp
ace/OS_main.cpp
ace/Obchunk.cpp
ace/Object_Manager.cpp
ace/Object_Manager_Base.cpp
ace/Obstack.cpp
ace/PI_Malloc.cpp
ace/POSIX_Asynch_IO.cpp
ace/POSIX_CB_Proactor.cpp
ace/POSIX_Proactor.cpp
ace/Pagefile_Memory_Pool.cpp
ace/Parse_Node.cpp
ace/Ping_Socket.cpp
ace/Pipe.cpp
ace/Priority_Reactor.cpp
ace/Proactor.cpp
ace/Proactor_Impl.cpp
ace/Process.cpp
ace/Process_Manager.cpp
ace/Process_Mutex.cpp
ace/Process_Semaphore.cpp
ace/Profile_Timer.cpp
ace/RW_Mutex.cpp
ace/RW_Process_Mutex.cpp
ace/RW_Thread_Mutex.cpp
ace/Reactor.cpp
ace/Reactor_Impl.cpp
ace/Reactor_Notification_Strategy.cpp
ace/Reactor_Timer_Interface.cpp
ace/Read_Buffer.cpp
ace/Recursive_Thread_Mutex.cpp
ace/Recyclable.cpp
ace/Registry.cpp
ace/Registry_Name_Space.cpp
ace/Remote_Name_Space.cpp
ace/Remote_Tokens.cpp
ace/SOCK.cpp
ace/SOCK_Acceptor.cpp
ace/SOCK_CODgram.cpp
ace/SOCK_Connector.cpp
ace/SOCK_Dgram.cpp
ace/SOCK_Dgram_Bcast.cpp
ace/SOCK_Dgram_Mcast.cpp
ace/SOCK_IO.cpp
ace/SOCK_Netlink.cpp
ace/SOCK_SEQPACK_Acceptor.cpp
ace/SOCK_SEQPACK_Association.cpp
ace/SOCK_SEQPACK_Connector.cpp
ace/SOCK_Stream.cpp
ace/SPIPE.cpp
ace/SPIPE_Acceptor.cpp
ace/SPIPE_Addr.cpp
ace/SPIPE_Connector.cpp
ace/SPIPE_Stream.cpp
ace/SString.cpp
ace/SUN_Proactor.cpp
ace/SV_Message.cpp
ace/SV_Message_Queue.cpp
ace/SV_Semaphore_Complex.cpp
ace/SV_Semaphore_Simple.cpp
ace/SV_Shared_Memory.cpp
ace/Sample_History.cpp
ace/Sbrk_Memory_Pool.cpp
ace/Sched_Params.cpp
ace/Select_Reactor_Base.cpp
ace/Semaphore.cpp
ace/Service_Config.cpp
ace/Service_Gestalt.cpp
ace/Service_Manager.cpp
ace/Service_Object.cpp
ace/Service_Repository.cpp
ace/Service_Types.cpp
ace/Shared_Memory.cpp
ace/Shared_Memory_MM.cpp
ace/Shared_Memory_Pool.cpp
ace/Shared_Memory_SV.cpp
ace/Shared_Object.cpp
ace/Sig_Adapter.cpp
ace/Sig_Handler.cpp
ace/Signal.cpp
ace/Sock_Connect.cpp
ace/Stack_Trace.cpp
ace/Stats.cpp
ace/String_Base_Const.cpp
ace/Svc_Conf_Lexer.cpp
ace/Svc_Conf_y.cpp
ace/Synch_Options.cpp
ace/System_Time.cpp
ace/TLI.cpp
ace/TLI_Acceptor.cpp
ace/TLI_Connector.cpp
ace/TLI_Stream.cpp
ace/TP_Reactor.cpp
ace/TSS_Adapter.cpp
ace/TTY_IO.cpp
ace/Task.cpp
ace/Thread.cpp
ace/Thread_Adapter.cpp
ace/Thread_Control.cpp
ace/Thread_Exit.cpp
ace/Thread_Hook.cpp
ace/Thread_Manager.cpp
ace/Thread_Mutex.cpp
ace/Thread_Semaphore.cpp
ace/Throughput_Stats.cpp
ace/Time_Policy.cpp
ace/Time_Value.cpp
ace/Timeprobe.cpp
ace/Token.cpp
ace/Token_Collection.cpp
ace/Token_Invariants.cpp
ace/Token_Manager.cpp
ace/Token_Request_Reply.cpp
ace/Trace.cpp
ace/UNIX_Addr.cpp
ace/UPIPE_Acceptor.cpp
ace/UPIPE_Connector.cpp
ace/UPIPE_Stream.cpp
ace/UTF16_Encoding_Converter.cpp
ace/UTF32_Encoding_Converter.cpp
ace/UTF8_Encoding_Converter.cpp
ace/UUID.cpp
ace/WFMO_Reactor.cpp
ace/WIN32_Asynch_IO.cpp
ace/WIN32_Proactor.cpp
ace/XML_Svc_Conf.cpp
ace/XTI_ATM_Mcast.cpp
ace/ace_wchar.cpp)
if (USE_COREPCH)
set(PRIVATE_PCH_HEADER ace/PrecompiledHeaders/WinAcePCH.h)
endif()
# Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_library(ace STATIC
${ACE_SOURCES})
target_include_directories(ace
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(ace
PUBLIC
ACE_AS_STATIC_LIBS
$<$<PLATFORM_ID:FreeBSD>:_WANT_SEMUN>)
target_link_libraries(ace
PRIVATE
acore-dependency-interface)
set_target_properties(ace
PROPERTIES
FOLDER
"deps")
# Generate precompiled header
if(USE_COREPCH)
add_cxx_pch(ace ${PRIVATE_PCH_HEADER})
endif()
endif() endif()

46
deps/acelite/COPYING vendored
View File

@@ -8,7 +8,7 @@
(henceforth referred to as "DOC software") are copyrighted by (henceforth referred to as "DOC software") are copyrighted by
[5]Douglas C. Schmidt and his [6]research group at [7]Washington [5]Douglas C. Schmidt and his [6]research group at [7]Washington
University, [8]University of California, Irvine, and [9]Vanderbilt University, [8]University of California, Irvine, and [9]Vanderbilt
University, Copyright (c) 1993-2015, all rights reserved. Since DOC University, Copyright (c) 1993-2019, all rights reserved. Since DOC
software is open-source, freely available software, you are free to software is open-source, freely available software, you are free to
use, modify, copy, and distribute--perpetually and irrevocably--the use, modify, copy, and distribute--perpetually and irrevocably--the
DOC software source code and object code produced from the source, as DOC software source code and object code produced from the source, as
@@ -86,26 +86,26 @@
References References
1. http://www.cs.wustl.edu/~schmidt/ACE.html 1. https://www.dre.vanderbilt.edu/~schmidt/ACE.html
2. http://www.cs.wustl.edu/~schmidt/TAO.html 2. https://www.dre.vanderbilt.edu/~schmidt/TAO.html
3. http://www.dre.vanderbilt.edu/CIAO/ 3. https://www.dre.vanderbilt.edu/CIAO/
4. http://www.dre.vanderbilt.edu/cosmic/ 4. https://www.dre.vanderbilt.edu/cosmic/
5. http://www.dre.vanderbilt.edu/~schmidt/ 5. https://www.dre.vanderbilt.edu/~schmidt/
6. http://www.cs.wustl.edu/~schmidt/ACE-members.html 6. https://www.dre.vanderbilt.edu/~schmidt/ACE-members.html
7. http://www.wustl.edu/ 7. https://www.wustl.edu/
8. http://www.uci.edu/ 8. https://www.uci.edu/
9. http://www.vanderbilt.edu/ 9. https://www.vanderbilt.edu/
10. mailto:doc_group@cs.wustl.edu 10. mailto:d.schmidt@vanderbilt.edu
11. http://www.cs.wustl.edu/~schmidt/ACE-users.html 11. https://www.dre.vanderbilt.edu/~schmidt/ACE-users.html
12. http://www.cs.wustl.edu/~schmidt/ACE.html 12. https://www.dre.vanderbilt.edu/~schmidt/ACE.html
13. http://www.cs.wustl.edu/~schmidt/TAO.html 13. https://www.dre.vanderbilt.edu/~schmidt/TAO.html
14. http://www.dre.vanderbilt.edu/CIAO/ 14. https://www.dre.vanderbilt.edu/CIAO/
15. http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/DAnCE/ 15. https://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/DAnCE/
16. http://www.dre.vanderbilt.edu/cosmic/ 16. https://www.dre.vanderbilt.edu/cosmic/
17. http://www.dre.vanderbilt.edu/ 17. https://www.dre.vanderbilt.edu/
18. http://www.isis.vanderbilt.edu/ 18. https://www.isis.vanderbilt.edu/
19. http://www.cs.wustl.edu/~schmidt/doc-center.html 19. https://www.cs.wustl.edu/~schmidt/doc-center.html
20. http://www.cs.wustl.edu/~schmidt/commercial-support.html 20. https://www.dre.vanderbilt.edu/~schmidt/commercial-support.html
21. mailto:d.schmidt@vanderbilt.edu 21. mailto:d.schmidt@vanderbilt.edu
22. http://www.dre.vanderbilt.edu/~schmidt/ 22. https://www.dre.vanderbilt.edu/~schmidt/
23. http://www.cs.wustl.edu/ACE.html 23. https://www.dre.vanderbilt.edu/~schmidt/ACE.html

307
deps/acelite/NEWS vendored
View File

@@ -1,3 +1,308 @@
USER VISIBLE CHANGES BETWEEN ACE-6.5.9 and ACE-6.5.10
=====================================================
. Add support for Embarcadero C++ Builder 10.4 Sydney using the
classic compiler. ACE/TAO compile with the new 32/64 bit clang
compilers but runtime tests show several runtime problems which
makes them not safe to use
. Make a change in the ACE Process Manager to resolve an internal
compiler error with Visual Studio 2019 16.5.x compilers
. Android enhancements for if_nameindex
USER VISIBLE CHANGES BETWEEN ACE-6.5.8 and ACE-6.5.9
====================================================
. On Windows, ACE no longer defines _WIN32_WINNT. ACE wrappers for
if_nametoindex and if_indextoname are available if the version of the
Windows SDK supports them.
. IPv6 extended datagram receive info now supported on macOS.
. ACE_(U)INT8/16/32/64 map to (u)int8/16/32/64_t when C++11 has been
enabled.
. CDR_Base uses ACE_INT64 for LongLong, all old emulated support
has been removed
. Updated debian and rpm packaging support
USER VISIBLE CHANGES BETWEEN ACE-6.5.7 and ACE-6.5.8
====================================================
. Added instructions to ACE-INSTALL.html for building ACE/TAO for Android on
Windows.
. Embarcadero C++ Builder Rio fixes
. Renamed `VERSION` file to `VERSION.txt` to avoid conflicting with the
`version` standard header.
USER VISIBLE CHANGES BETWEEN ACE-6.5.6 and ACE-6.5.7
====================================================
. Fixed compile problem with glibc 2.30 and newer
. gnuace makefiles: Updated handling of generated files and
use requires/avoids to make postbuild steps conditional
. Removed references to the ACE_LACKS_MONOTONIC_TIME preprocessor macro because
it was equivalent to ACE_LACKS_CLOCK_MONOTONIC.
. Exposed support status of monotonic times features using preprocessor macros.
See "Testing for Monotonic Time Support" in docs/ACE-monotonic-timer.html for
details.
. Added support for ARM and ARM64 stack traces with Microsoft Visual C++.
. The "optional argument for the receive address in ACE_SOCK_Dgram::recv"
feature from ACE-6.5.5 is now supported on Windows. This includes enhanced
support for sendmsg/recvmsg on Windows.
USER VISIBLE CHANGES BETWEEN ACE-6.5.5 and ACE-6.5.6
====================================================
. On Linux, the ACE_Log_Msg format specifier `%t` is now replaced with the
system thread id provided by gettid(), instead of the much longer pthread id.
. Added support for MQX
. Enhanced Android support
USER VISIBLE CHANGES BETWEEN ACE-6.5.4 and ACE-6.5.5
====================================================
. Fixed several broken links due to the removal of
Douglas Schmidt website at WashU
. On Android:
. ACE_Log_Msg (and therefore ACE_DEBUG and ACE_ERROR) now uses
Android's logging system (aka Logcat) by default in addition to stderr
because stdout and stderr are discarded under normal circumstances.
To disable this at runtime, run:
ACE_LOG_MSG->clr_flags (ACE_Log_Msg::SYSLOG)
To disable this at compile time include these lines in config.h:
#define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR
#define ACE_DEFAULT_LOG_BACKEND_FLAGS 0
. When statically linking to OpenSSL, prevent usage of the preloaded and
unpredictable system SSL library when using ace_openssl.
. minizip has been moved from ACE to DANCE
. Add initial support for Visual Studio 2019
. Validated ACE for usage SLES15.0 x86_64 using 32bit g++ compiler
. Add optional argument for the receive address in ACE_SOCK_Dgram::recv
USER VISIBLE CHANGES BETWEEN ACE-6.5.3 and ACE-6.5.4
====================================================
. Fix ACE_Vector::end(), which now correctly
represents the end of the elements of the vector
instead of the end of the base array.
USER VISIBLE CHANGES BETWEEN ACE-6.5.2 and ACE-6.5.3
====================================================
. Enhance Android support
. Fix AIX and Solaris linking rpath errors
. Add support for SSL_INCDIR/SSL_LIBDIR and XERCESC_INCDIR/XERCESC_LIBDIR
to specify a custom include/lib dir as required for vcpkg versions of
openssl/xercesc
USER VISIBLE CHANGES BETWEEN ACE-6.5.1 and ACE-6.5.2
====================================================
. Enhanced C++Builder XE2 support
. ACE_QtReactor can be built with Qt version 5 using the qt5 MPC feature
USER VISIBLE CHANGES BETWEEN ACE-6.5.0 and ACE-6.5.1
====================================================
. At the moment C++11 or newer is enabled ACE_Strong_Bound_Ptr
doesn't provide the convenience functions to use a
std::auto_ptr anymore
. Optimized CDR std::(w)string insertion and extraction
when C++11 or newer is enabled
. Solved Visual Studio 2017 solution loading due to duplicate
files generated in a project file
USER VISIBLE CHANGES BETWEEN ACE-6.4.8 and ACE-6.5.0
====================================================
. The ACE core libraries now use std::unique_ptr instead
of std::auto_ptr when C++11 or newer is enabled
USER VISIBLE CHANGES BETWEEN ACE-6.4.7 and ACE-6.4.8
====================================================
. Enhanced Embarcadero C++ Builder support
. ACE XML_Utils enhancements
. Debian packaging enhancements
. Support for clang6 and gcc8
. Enhanced Android support
. Remove addr_any restriction from ipv6_only UDP
USER VISIBLE CHANGES BETWEEN ACE-6.4.6 and ACE-6.4.7
====================================================
. Added a new, optional argument named ipv6_only to:
ACE_Acceptor::ACE_Acceptor
ACE_Acceptor::open
ACE_SOCK_Dgram::ACE_SOCK_Dgram
ACE_SOCK_Dgram::open
If ipv6_only is 0/false (the default) the socket will accept
both IPv6 and IPv4 connections/datagrams. If ipv6_only is
1/true the socket will only accept IPv6.
This behavior only applies when ACE_HAS_IPV6 is true and the
local-side IP address is the generic localhost IP address.
. Integrated some changes from XSC into XML Utils
. Enable ACE_HAS_CPP11 when we have clang with C++11 enabled
. Added support for cross compiling using MinGW on a Linux host
. Added support for FreeBSD 11
. Fixed issue ACE_Singleton was broken after ACE::fini, ACE::init (GitHub #554)
USER VISIBLE CHANGES BETWEEN ACE-6.4.5 and ACE-6.4.6
====================================================
. Fixed some Codacy and C++ Core guidelines reported issues
. VxWorks 7 (SR0510) support
. Support make install on newer Apple MacOS versions
USER VISIBLE CHANGES BETWEEN ACE-6.4.4 and ACE-6.4.5
====================================================
. Add support for OpenSSL 1.1. ACE users on Windows have
to add openssl11=1 to their default.features file so
that the correct OpenSSL library names are used.
USER VISIBLE CHANGES BETWEEN ACE-6.4.3 and ACE-6.4.4
====================================================
. Enhanced support for Embarcadero C++ Builder 10.2 (Tokyo).
Support for bcc32/bcc64/bcc32c has been enhanced and by
default the clang based versions are used. When the old
bcc32 has to be used set the CLASSIC environment variable
to 1. At this moment runtime test results for bcc64/bcc32c
show some structural problems
. Add support for Oracle Studio 12.5
. Removed usage of ACE_REGISTER and register keyword because
they trigger deprecated warnings with newer gcc and clang
versions
. Add support for gcc 7
. Enhanced Android support
. Fix ACE_INET_Addr::set(domain_name, AF_UNSPEC) to be set to IPv4 address
when IPv6 is enabled and the domain_name could be resolved to IPv4 address.
USER VISIBLE CHANGES BETWEEN ACE-6.4.2 and ACE-6.4.3
====================================================
. Enhancements for Visual Studio 2017
. Enhancements for Android
USER VISIBLE CHANGES BETWEEN ACE-6.4.1 and ACE-6.4.2
====================================================
. Added support for Mac OS X on x86_64 to get the network adapter
address in ACE_OS::getmacaddress().
. Added support for the December 2016 updates to VxWorks 7.
USER VISIBLE CHANGES BETWEEN ACE-6.4.0 and ACE-6.4.1
====================================================
. The ACE_DEBUG environment variable can again be used to set the
internal debug flag. This used to work but was mistakenly changed
in an earlier release.
. Corrected usage of ACE_Singleton and template instantation to be
valid C++ (GCC cross-compiler arm-linux-gnueabihf-g++ requires it).
. Added support for detecting the Mac OS X version when configured with
ace/config-macosx.h and include/makeinclude/platform_macosx.GNU.
Also on 10.11 El Capitan, use rpath to avoid a problem with SIP.
. Added support for Android NDK r12b (Platform API 24) and improved
cross compilation support
USER VISIBLE CHANGES BETWEEN ACE-6.3.4 and ACE-6.4.0
====================================================
. Added support for obtaining the micro version number
. Reduced include of ace/Auto_Ptr.h in header files
USER VISIBLE CHANGES BETWEEN ACE-6.3.3 and ACE-6.3.4
====================================================
. ACE_SSL_Context::set_mode() can no longer be used to select a specific
SSL/TLS protocol version, use ACE_SSL_Context::filter_versions() for that.
This follows general advice by the OpenSSL project to go through
SSL_CTX_set_options() to limit the list of protocols available. The purpose
of ACE_SSL_Context::set_mode() is now limited to explicitly restricting
behaviour to client or server (defaults to both).
. Improve Oracle Studio support
. CIAO and DAnCE are forked to their own github repositories
and are not part anymore of the ACE+TAO release packages
. Fixed several Coverity reported issues
. Added ACE configuration for FACE safety profiles (see config-face-safety.h).
FACE, or Future Airborne Capability Environment http://www.opengroup.org/face,
specifies a restricted subset of OS functions and rules for controlling
dynamic memory allocation. When built in this configuration on a platform
that supports it, ACE conforms to the FACE requirements.
. ACE uses new netdb.h functions (getaddrinfo/getnameinfo) if they are
available, in place of deprecated functions (gethostbyname/addr).
USER VISIBLE CHANGES BETWEEN ACE-6.3.2 and ACE-6.3.3
====================================================
. Visual Studio 2015 has adequate C++11 support, because of this
ACE_HAS_CPP11 is now defined with this compiler. A large amount
of warnings given by this new compiler have been fixed
. As part of the release script we generate vc12 and vc14
solution files which are packaged as part of the release
. Added support for VxWorks 7 (kernel mode and RTP).
See the comments in include/makeinclude/platform_vxworks7.0.GNU for details.
. Ended daily maintenance for OpenVMS
. Fixed a defect in ACE_INET_Addr when there is a non-empty interface
address list and set_port_number() is called.
USER VISIBLE CHANGES BETWEEN ACE-6.3.1 and ACE-6.3.2 USER VISIBLE CHANGES BETWEEN ACE-6.3.1 and ACE-6.3.2
==================================================== ====================================================
@@ -131,7 +436,7 @@ USER VISIBLE CHANGES BETWEEN ACE-6.2.4 and ACE-6.2.5
USER VISIBLE CHANGES BETWEEN ACE-6.2.3 and ACE-6.2.4 USER VISIBLE CHANGES BETWEEN ACE-6.2.3 and ACE-6.2.4
==================================================== ====================================================
. Added support for FC20 and ended support for FC19 . Added support for FC20 and ended maintenance for FC19
. Extended C++11 feature test suite . Extended C++11 feature test suite

87
deps/acelite/PROBLEM-REPORT-FORM vendored Normal file
View File

@@ -0,0 +1,87 @@
[Please use the PRF form below to submit bug reports, problem reports,
etc., to the ACE developers and interested users. Send it to
ace-bugs@list.isis.vanderbilt.edu, you must be subscribed to the list
in order to be able to post to it. If you are using OCI, MicroFocus, or
Riverace's versions of ACE do not send bugs to this mailing list, but
instead contact those companies for support. Please also send your
PRF as plain ASCII text, _not_ uuencoded or as an attachment.
We prefer that all bug reports be submitted through github issues.
See https://github.com/DOCGroup/ACE_TAO/issues for more information
about how to do this. If you are unsure as to whether your problem
is a real bug or not then please submit your question to the mailing
list using the following form. Not using the problem report form
will make it harder or impossible to identify the problem, and in
many cases we will be unable to help at all. Also please try to
browse the existing github isssues and the ChangeLog files to find
out if your problem has been solved in a more recent version of ACE.
To subscribe to the list see
https://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html
Replace/remove all the explanatory text in brackets before mailing.
Please send this form as ASCII text only. Do _not_ send it as an
attachment, or as tar'ed, compressed and/or uuencoded text. And
limit line lengths to less than 80 characters.
PLEASE make your Subject: line as descriptive as possible.
Subjects like "ACE bug" or "bug report" are not helpful!
Also, do _not_ include the word "help" in the Subject!]
When including your config.h and platform_macros.GNU files as requested
below, only include the contents if you use the recommended method of
including the platform-specific file in your file. If you use a link
to the platform-specific file, simply state which one - DO NOT
include an entire platform-specific configuration file in the form.
8<----------8<----------8<----------8<----------8<----------8<----------8<----
To: ace-bugs@list.isis.vanderbilt.edu
Subject: [area]: [synopsis]
ACE VERSION: 6.5.10
HOST MACHINE and OPERATING SYSTEM:
If on Windows based OS's, which version of WINSOCK do you
use?:
TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
COMPILER NAME AND VERSION (AND PATCHLEVEL):
THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
specific file, simply state which one]:
THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
use a link to a platform-specific file, simply state which one
(unless this isn't used in this case, e.g., with Microsoft Visual
C++)]:
CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
(used by MPC when you generate your own makefiles):
AREA/CLASS/EXAMPLE AFFECTED:
[What example failed? What module failed to compile?]
DOES THE PROBLEM AFFECT:
COMPILATION?
LINKING?
On Unix systems, did you run make realclean first?
EXECUTION?
OTHER (please specify)?
[Please indicate whether ACE, your application, or both are affected.]
SYNOPSIS:
[Brief description of the problem]
DESCRIPTION:
[Detailed description of problem. Don't just say "<blah>
doesn't work, here's a fix," explain what your program does
to get to the <blah> state. ]
REPEAT BY:
[What you did to get the error; include test program or session
transcript if at all possible. ]
SAMPLE FIX/WORKAROUND:
[If available ]

110
deps/acelite/README vendored
View File

@@ -1,11 +1,9 @@
This document is also available at the following URL: This document is also available at the following URL:
http://www.dre.vanderbilt.edu/~schmidt/ACE.html https://www.dre.vanderbilt.edu/~schmidt/ACE.html
All software and documentation is available via both anonymous ftp and All software and documentation is available via both anonymous ftp and
the http.] http.
THE ADAPTIVE COMMUNICATION ENVIRONMENT (ACE) THE ADAPTIVE COMMUNICATION ENVIRONMENT (ACE)
@@ -45,7 +43,7 @@ ACE is currently used in commercial projects and products by dozens of
companies including Ericsson, Bellcore, Siemens, Motorola, Kodak, companies including Ericsson, Bellcore, Siemens, Motorola, Kodak,
Boeing, Lucent, DEC, Lockheed Martin, and SAIC. Commercial support Boeing, Lucent, DEC, Lockheed Martin, and SAIC. Commercial support
for ACE is available from several companies as listed at for ACE is available from several companies as listed at
http://www.cs.wustl.edu/~schmidt/commercial-support.html http://www.dre.vanderbilt.edu/~schmidt/commercial-support.html
---------------------------------------- ----------------------------------------
@@ -55,28 +53,28 @@ The lower-level portions of ACE provide a set of portable and
type-secure C++ wrappers that encapsulate the following C language OS type-secure C++ wrappers that encapsulate the following C language OS
interfaces: interfaces:
. IPC mechanisms . IPC mechanisms
-- e.g., Internet- and UNIX-domain sockets, TLI, Named -- e.g., Internet- and UNIX-domain sockets, TLI, Named
Pipes (for UNIX and Win32) and STREAM pipes; Pipes (for UNIX and Win32) and STREAM pipes;
. Event demultiplexing . Event demultiplexing
-- e.g., select(), poll(), and Win32 -- e.g., select(), poll(), and Win32
WaitForMultipleObjects and I/O completion ports; WaitForMultipleObjects and I/O completion ports;
. Multi-threading and synchronization . Multi-threading and synchronization
-- e.g., Solaris threads, POSIX Pthreads, and Win32 -- e.g., Solaris threads, POSIX Pthreads, and Win32
threads; threads;
. Explicit dynamic linking . Explicit dynamic linking
-- e.g., dlopen/dlsym on UNIX and LoadLibrary/GetProc -- e.g., dlopen/dlsym on UNIX and LoadLibrary/GetProc
on Win32; on Win32;
. Memory-mapped files and shared memory management . Memory-mapped files and shared memory management
-- e.g., BSD mmap(), SYSV shared memory, and Win32 -- e.g., BSD mmap(), SYSV shared memory, and Win32
shared memory; shared memory;
. System V IPC . System V IPC
-- e.g., shared memory, semaphores, message queues. -- e.g., shared memory, semaphores, message queues.
The OS Adaptation Layer shields the upper levels of ACE from platform The OS Adaptation Layer shields the upper levels of ACE from platform
dependencies associated with the underlying OS interfaces. dependencies associated with the underlying OS interfaces.
@@ -91,25 +89,25 @@ supports the dynamic configuration of concurrent distributed services
into applications. The framework portion of ACE contains the into applications. The framework portion of ACE contains the
following class categories: following class categories:
. The Reactor . The Reactor
-- Supports both Reactive and Proactive I/O; -- Supports both Reactive and Proactive I/O;
. The Service Configurator . The Service Configurator
-- Support dynamic (re)configuration of objects; -- Support dynamic (re)configuration of objects;
. The ADAPTIVE Service Executive . The ADAPTIVE Service Executive
-- A user-level implementation of System V STREAMS, -- A user-level implementation of System V STREAMS,
that supports modular integration of that supports modular integration of
hierarchically-related communicaion services; hierarchically-related communication services;
. Concurrency . Concurrency
-- Various types of higher-level concurrency -- Various types of higher-level concurrency
control and synchronization patterns (such as control and synchronization patterns (such as
Polymorphic Futures and Active Objects); Polymorphic Futures and Active Objects);
. Shared Malloc . Shared Malloc
-- Components for managing dynamically allocation -- Components for managing dynamically allocation
of shared and local memory; of shared and local memory;
---------------------------------------- ----------------------------------------
@@ -119,13 +117,13 @@ Finally, ACE provides a standard library of distributed services that
are packaged as components. These service components play two roles are packaged as components. These service components play two roles
in ACE: in ACE:
1. They provide reusable components for common distributed 1. They provide reusable components for common distributed
system tasks such as logging, naming, locking, and time system tasks such as logging, naming, locking, and time
synchronization. synchronization.
2. They illustrate how to utilize ACE features such as the 2. They illustrate how to utilize ACE features such as the
Reactor, Service Configurator, Service Initialization, Reactor, Service Configurator, Service Initialization,
Concurrency, and IPC components. Concurrency, and IPC components.
---------------------------------------- ----------------------------------------
@@ -138,19 +136,19 @@ Ericsson, Motorola, and Lucent; medical imaging systems at Siemens and
Kodak; and many academic research projects. Two example middleware Kodak; and many academic research projects. Two example middleware
applications provided with the ACE release include: applications provided with the ACE release include:
1. The ACE ORB (TAO) -- TAO is a real-time implementation of 1. The ACE ORB (TAO) -- TAO is a real-time implementation of
CORBA built using the framework components and patterns CORBA built using the framework components and patterns
provided by ACE. provided by ACE.
2. JAWS -- JAWS is a high-performance, adaptive Web server 2. JAWS -- JAWS is a high-performance, adaptive Web server
built using the components in ACE. built using the components in ACE.
---------------------------------------- ----------------------------------------
OBTAINING ACE OBTAINING ACE
ACE may be obtained electronically from ACE may be obtained electronically from
http://download.dre.vanderbilt.edu. This release contains the source https://download.dre.vanderbilt.edu. This release contains the source
code, test drivers, and example applications (including JAWS) for C++ code, test drivers, and example applications (including JAWS) for C++
wrapper libraries and the higher-level ACE network programming wrapper libraries and the higher-level ACE network programming
framework developed as part of the ADAPTIVE project at the University framework developed as part of the ADAPTIVE project at the University
@@ -186,8 +184,7 @@ A mailing list, ace-users@list.isis.vanderbilt.edu, is available for
discussing bug fixes, enhancements, and porting issues regarding ACE. discussing bug fixes, enhancements, and porting issues regarding ACE.
Please send mail to me at the Please send mail to me at the
ace-users-request@list.isis.vanderbilt.edu if you'd like to join the ace-users-request@list.isis.vanderbilt.edu if you'd like to join the
mailing list. There is also a USENET newsgroup called mailing list. Please see
comp.soft-sys.ace. Please see
http://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html for details on http://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html for details on
how to subscribe to the mailing list. how to subscribe to the mailing list.
@@ -195,8 +192,7 @@ how to subscribe to the mailing list.
BUILDING AND INSTALLING ACE BUILDING AND INSTALLING ACE
Please refer to the Please refer to the $ACE_ROOT/ACE-INSTALL.html file for
http://www.dre.vanderbilt.edu/~schmidt/ACE-install.html file for
information on how to build and test the ACE wrappers. The information on how to build and test the ACE wrappers. The
BIBLIOGRAPHY file contains information on where to obtain articles BIBLIOGRAPHY file contains information on where to obtain articles
that describe the ACE wrappers and the ADAPTIVE system in more detail. that describe the ACE wrappers and the ADAPTIVE system in more detail.
@@ -208,11 +204,9 @@ $ACE_ROOT/PROBLEM-REPORT-FORM. Please use the same form to submit
questions, comments, etc. To ensure that you see responses, please do questions, comments, etc. To ensure that you see responses, please do
one of the following: one of the following:
1) Subscribe to the ace-users mail list, by sending email with 1) Subscribe to the ace-users mail list, by sending email with
contents "subscribe ace-users" to contents "subscribe ace-users" to
ace-users-request@list.isis.vanderbilt.edu. ace-users-request@list.isis.vanderbilt.edu.
2) Or, monitor the comp.soft-sys.ace newsgroup for responses.
---------------------------------------- ----------------------------------------

3
deps/acelite/THANKS vendored
View File

@@ -2324,7 +2324,7 @@ Tim Pinkawa <tpinkawa at eagleseven dot com>
Ed Blackmond <ed dot blackmond at themis dot com> Ed Blackmond <ed dot blackmond at themis dot com>
Dave <dwh0403 at 163 dot com> Dave <dwh0403 at 163 dot com>
Inma Perea <inma dot perea dot fdz at gmail dot com> Inma Perea <inma dot perea dot fdz at gmail dot com>
David Ward <dpward at mit dot edu> David Ward <david dot ward at ll dot mit dot edu>
Anatoli Sakhnik <sakhnik at gmail dot com> Anatoli Sakhnik <sakhnik at gmail dot com>
Max Zhou <earthdog at 126 dot com> Max Zhou <earthdog at 126 dot com>
Daynesh Mangal <daynesh at gmail dot com> Daynesh Mangal <daynesh at gmail dot com>
@@ -2394,6 +2394,7 @@ David Lifshitz <dlifshitz at macadamian dot com>
Milo H. Fields <mfields at paladin-sys dot com> Milo H. Fields <mfields at paladin-sys dot com>
Thomas Schmidt <TC dot Schmidt at gmx dot net> Thomas Schmidt <TC dot Schmidt at gmx dot net>
Joe Zendle <jzendle at gmail dot com> Joe Zendle <jzendle at gmail dot com>
Cesar Mello <cmello at gmail dot com>
I would particularly like to thank Paul Stephenson, who worked with me I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson in the early 1990's. Paul devised the recursive Makefile at Ericsson in the early 1990's. Paul devised the recursive Makefile

8
deps/acelite/VERSION.txt vendored Normal file
View File

@@ -0,0 +1,8 @@
This is ACE version 6.5.10, released Wed Jul 01 09:54:36 CEST 2020
If you have any problems with or questions about ACE, please send
e-mail to the ACE mailing list (ace-bugs@list.isis.vanderbilt.edu),
using the form found in the file PROBLEM-REPORT-FORM. In order
to post to the list you must subscribe to it.
See http://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html

View File

@@ -108,6 +108,12 @@ ACE::beta_version (void)
return ACE_BETA_VERSION; return ACE_BETA_VERSION;
} }
u_int
ACE::micro_version (void)
{
return ACE_MICRO_VERSION;
}
const ACE_TCHAR * const ACE_TCHAR *
ACE::compiler_name (void) ACE::compiler_name (void)
{ {
@@ -158,7 +164,9 @@ ACE::nibble2hex (u_int n)
bool bool
ACE::debug (void) ACE::debug (void)
{ {
static const char* debug = ACE_OS::getenv ("ACELIB_DEBUG"); //FUZZ: disable check_for_ace_log_categories
static const char *debug = ACE_OS::getenv ("ACE_DEBUG");
//FUZZ: enable check_for_ace_log_categories
return (ACE::debug_ != 0) ? ACE::debug_ : (debug != 0 ? (*debug != '0') : false); return (ACE::debug_ != 0) ? ACE::debug_ : (debug != 0 ? (*debug != '0') : false);
} }
@@ -909,7 +917,7 @@ ACE::recv_n_i (ACE_HANDLE handle,
// number of (char *ptr, int len) tuples. However, the count N is the // number of (char *ptr, int len) tuples. However, the count N is the
// *total* number of trailing arguments, *not* a couple of the number // *total* number of trailing arguments, *not* a couple of the number
// of tuple pairs! // of tuple pairs!
#if !defined (ACE_LACKS_VA_FUNCTIONS)
ssize_t ssize_t
ACE::recv (ACE_HANDLE handle, size_t n, ...) ACE::recv (ACE_HANDLE handle, size_t n, ...)
{ {
@@ -919,9 +927,16 @@ ACE::recv (ACE_HANDLE handle, size_t n, ...)
#if defined (ACE_HAS_ALLOCA) #if defined (ACE_HAS_ALLOCA)
iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else #else
# ifdef ACE_HAS_ALLOC_HOOKS
ACE_ALLOCATOR_RETURN (iovp, (iovec *)
ACE_Allocator::instance ()->malloc (total_tuples *
sizeof (iovec)),
-1);
# else
ACE_NEW_RETURN (iovp, ACE_NEW_RETURN (iovp,
iovec[total_tuples], iovec[total_tuples],
-1); -1);
# endif /* ACE_HAS_ALLOC_HOOKS */
#endif /* !defined (ACE_HAS_ALLOCA) */ #endif /* !defined (ACE_HAS_ALLOCA) */
va_start (argp, n); va_start (argp, n);
@@ -934,11 +949,17 @@ ACE::recv (ACE_HANDLE handle, size_t n, ...)
ssize_t const result = ACE_OS::recvv (handle, iovp, total_tuples); ssize_t const result = ACE_OS::recvv (handle, iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA) #if !defined (ACE_HAS_ALLOCA)
# ifdef ACE_HAS_ALLOC_HOOKS
ACE_Allocator::instance ()->free (iovp);
# else
delete [] iovp; delete [] iovp;
# endif /* ACE_HAS_ALLOC_HOOKS */
#endif /* !defined (ACE_HAS_ALLOCA) */ #endif /* !defined (ACE_HAS_ALLOCA) */
va_end (argp); va_end (argp);
return result; return result;
} }
#endif /* ACE_LACKS_VA_FUNCTIONS */
ssize_t ssize_t
ACE::recvv (ACE_HANDLE handle, ACE::recvv (ACE_HANDLE handle,
@@ -993,7 +1014,6 @@ ACE::recvv_n_i (ACE_HANDLE handle,
if (result != -1) if (result != -1)
{ {
// Blocking subsided. Continue data transfer. // Blocking subsided. Continue data transfer.
n = 0;
continue; continue;
} }
} }
@@ -1057,7 +1077,6 @@ ACE::recvv_n_i (ACE_HANDLE handle,
{ {
// Blocking subsided in <timeout> period. Continue // Blocking subsided in <timeout> period. Continue
// data transfer. // data transfer.
n = 0;
continue; continue;
} }
} }
@@ -1684,7 +1703,7 @@ ACE::send_n_i (ACE_HANDLE handle,
// the ints (basically, an varargs version of writev). The count N is // the ints (basically, an varargs version of writev). The count N is
// the *total* number of trailing arguments, *not* a couple of the // the *total* number of trailing arguments, *not* a couple of the
// number of tuple pairs! // number of tuple pairs!
#if !defined (ACE_LACKS_VA_FUNCTIONS)
ssize_t ssize_t
ACE::send (ACE_HANDLE handle, size_t n, ...) ACE::send (ACE_HANDLE handle, size_t n, ...)
{ {
@@ -1694,9 +1713,16 @@ ACE::send (ACE_HANDLE handle, size_t n, ...)
#if defined (ACE_HAS_ALLOCA) #if defined (ACE_HAS_ALLOCA)
iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else #else
# ifdef ACE_HAS_ALLOC_HOOKS
ACE_ALLOCATOR_RETURN (iovp, (iovec *)
ACE_Allocator::instance ()->malloc (total_tuples *
sizeof (iovec)),
-1);
# else
ACE_NEW_RETURN (iovp, ACE_NEW_RETURN (iovp,
iovec[total_tuples], iovec[total_tuples],
-1); -1);
# endif /* ACE_HAS_ALLOC_HOOKS */
#endif /* !defined (ACE_HAS_ALLOCA) */ #endif /* !defined (ACE_HAS_ALLOCA) */
va_start (argp, n); va_start (argp, n);
@@ -1709,11 +1735,16 @@ ACE::send (ACE_HANDLE handle, size_t n, ...)
ssize_t result = ACE_OS::sendv (handle, iovp, total_tuples); ssize_t result = ACE_OS::sendv (handle, iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA) #if !defined (ACE_HAS_ALLOCA)
# ifdef ACE_HAS_ALLOC_HOOKS
ACE_Allocator::instance ()->free (iovp);
# else
delete [] iovp; delete [] iovp;
# endif /* ACE_HAS_ALLOC_HOOKS */
#endif /* !defined (ACE_HAS_ALLOCA) */ #endif /* !defined (ACE_HAS_ALLOCA) */
va_end (argp); va_end (argp);
return result; return result;
} }
#endif /* ACE_LACKS_VA_FUNCTIONS */
ssize_t ssize_t
ACE::sendv (ACE_HANDLE handle, ACE::sendv (ACE_HANDLE handle,
@@ -1773,7 +1804,6 @@ ACE::sendv_n_i (ACE_HANDLE handle,
if (result != -1) if (result != -1)
{ {
// Blocking subsided. Continue data transfer. // Blocking subsided. Continue data transfer.
n = 0;
continue; continue;
} }
} }
@@ -1843,7 +1873,6 @@ ACE::sendv_n_i (ACE_HANDLE handle,
{ {
// Blocking subsided in <timeout> period. Continue // Blocking subsided in <timeout> period. Continue
// data transfer. // data transfer.
n = 0;
continue; continue;
} }
} }
@@ -2162,9 +2191,9 @@ ACE::writev_n (ACE_HANDLE handle,
int int
ACE::handle_ready (ACE_HANDLE handle, ACE::handle_ready (ACE_HANDLE handle,
const ACE_Time_Value *timeout, const ACE_Time_Value *timeout,
int read_ready, bool read_ready,
int write_ready, bool write_ready,
int exception_ready) bool exception_ready)
{ {
#if defined (ACE_HAS_POLL) #if defined (ACE_HAS_POLL)
ACE_UNUSED_ARG (exception_ready); ACE_UNUSED_ARG (exception_ready);
@@ -2285,6 +2314,7 @@ ACE::format_hexdump (const char *buffer,
// We can fit 16 bytes output in text mode per line, 4 chars per byte. // We can fit 16 bytes output in text mode per line, 4 chars per byte.
size_t maxlen = (obuf_sz / 68) * 16; size_t maxlen = (obuf_sz / 68) * 16;
const ACE_TCHAR *const obuf_start = obuf;
if (size > maxlen) if (size > maxlen)
size = maxlen; size = maxlen;
@@ -2299,22 +2329,20 @@ ACE::format_hexdump (const char *buffer,
for (j = 0 ; j < 16; j++) for (j = 0 ; j < 16; j++)
{ {
c = (u_char) buffer[(i << 4) + j]; // or, buffer[i*16+j] c = (u_char) buffer[(i << 4) + j]; // or, buffer[i*16+j]
ACE_OS::sprintf (obuf, ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
ACE_TEXT ("%02x "), ACE_TEXT ("%02x "),
c); c);
obuf += 3; obuf += 3;
if (j == 7) if (j == 7)
{ {
ACE_OS::sprintf (obuf, *obuf++ = ACE_TEXT (' ');
ACE_TEXT (" "));
++obuf;
} }
textver[j] = ACE_OS::ace_isprint (c) ? c : u_char ('.'); textver[j] = ACE_OS::ace_isprint (c) ? c : u_char ('.');
} }
textver[j] = 0; textver[j] = 0;
ACE_OS::sprintf (obuf, ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
ACE_TEXT (" %ls\n"), ACE_TEXT (" %ls\n"),
#else #else
@@ -2331,35 +2359,31 @@ ACE::format_hexdump (const char *buffer,
for (i = 0 ; i < size % 16; i++) for (i = 0 ; i < size % 16; i++)
{ {
c = (u_char) buffer[size - size % 16 + i]; c = (u_char) buffer[size - size % 16 + i];
ACE_OS::sprintf (obuf, ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
ACE_TEXT ("%02x "), ACE_TEXT ("%02x "),
c); c);
obuf += 3; obuf += 3;
if (i == 7) if (i == 7)
{ {
ACE_OS::sprintf (obuf, *obuf++ = ACE_TEXT (' ');
ACE_TEXT (" "));
++obuf;
} }
textver[i] = ACE_OS::ace_isprint (c) ? c : u_char ('.'); textver[i] = ACE_OS::ace_isprint (c) ? c : u_char ('.');
} }
for (i = size % 16; i < 16; i++) for (i = size % 16; i < 16; i++)
{ {
ACE_OS::sprintf (obuf, ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
ACE_TEXT (" ")); ACE_TEXT (" "));
obuf += 3; obuf += 3;
if (i == 7) if (i == 7)
{ {
ACE_OS::sprintf (obuf, *obuf++ = ACE_TEXT (' ');
ACE_TEXT (" "));
++obuf;
} }
textver[i] = ' '; textver[i] = ' ';
} }
textver[i] = 0; textver[i] = 0;
ACE_OS::sprintf (obuf, ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
ACE_TEXT (" %ls\n"), ACE_TEXT (" %ls\n"),
#else #else
@@ -2370,11 +2394,10 @@ ACE::format_hexdump (const char *buffer,
return size; return size;
} }
// Returns the current timestamp in the form /// Returns the current timestamp in the form
// "hour:minute:second:microsecond." The month, day, and year are /// "hour:minute:second:microsecond." The month, day, and year are
// also stored in the beginning of the date_and_time array /// also stored in the beginning of the date_and_time array
// using ISO-8601 format. /// using ISO-8601 format.
ACE_TCHAR * ACE_TCHAR *
ACE::timestamp (ACE_TCHAR date_and_time[], ACE::timestamp (ACE_TCHAR date_and_time[],
size_t date_and_timelen, size_t date_and_timelen,
@@ -2386,13 +2409,12 @@ ACE::timestamp (ACE_TCHAR date_and_time[],
return_pointer_to_first_digit); return_pointer_to_first_digit);
} }
// Returns the given timestamp in the form /// Returns the given timestamp in the form
// "hour:minute:second:microsecond." The month, day, and year are /// "hour:minute:second:microsecond." The month, day, and year are
// also stored in the beginning of the date_and_time array /// also stored in the beginning of the date_and_time array
// using ISO-8601 format. /// using ISO-8601 format.
// 012345678901234567890123456 /// 012345678901234567890123456
// 2010-12-02 12:56:00.123456<nul> /// 2010-12-02 12:56:00.123456<nul>
ACE_TCHAR * ACE_TCHAR *
ACE::timestamp (const ACE_Time_Value& time_value, ACE::timestamp (const ACE_Time_Value& time_value,
ACE_TCHAR date_and_time[], ACE_TCHAR date_and_time[],
@@ -2429,8 +2451,7 @@ ACE::timestamp (const ACE_Time_Value& time_value,
return &date_and_time[10 + (return_pointer_to_first_digit != 0)]; return &date_and_time[10 + (return_pointer_to_first_digit != 0)];
} }
// This function rounds the request to a multiple of the page size. /// This function rounds the request to a multiple of the page size.
size_t size_t
ACE::round_to_pagesize (size_t len) ACE::round_to_pagesize (size_t len)
{ {
@@ -2612,8 +2633,7 @@ ACE::handle_timed_complete (ACE_HANDLE h,
return h; return h;
} }
// Wait up to <timeout> amount of time to accept a connection. /// Wait up to @a timeout amount of time to accept a connection.
int int
ACE::handle_timed_accept (ACE_HANDLE listener, ACE::handle_timed_accept (ACE_HANDLE listener,
ACE_Time_Value *timeout, ACE_Time_Value *timeout,
@@ -2682,9 +2702,8 @@ ACE::handle_timed_accept (ACE_HANDLE listener,
} }
} }
// Make the current process a UNIX daemon. This is based on Stevens /// Make the current process a UNIX daemon. This is based on Stevens
// code from APUE. /// code from APUE.
int int
ACE::daemonize (const ACE_TCHAR pathname[], ACE::daemonize (const ACE_TCHAR pathname[],
bool close_all_handles, bool close_all_handles,
@@ -2770,7 +2789,7 @@ ACE::fork (const ACE_TCHAR *program_name,
{ {
case 0: // grandchild returns 0. case 0: // grandchild returns 0.
return 0; return 0;
case -1: // assumes all errnos are < 256 case static_cast<pid_t>(-1): // assumes all errnos are < 256
ACE_OS::_exit (errno); ACE_OS::_exit (errno);
default: // child terminates, orphaning grandchild default: // child terminates, orphaning grandchild
ACE_OS::_exit (0); ACE_OS::_exit (0);
@@ -2816,7 +2835,7 @@ ACE::max_handles (void)
# endif /* RLIM_INFINITY */ # endif /* RLIM_INFINITY */
#endif /* RLIMIT_NOFILE && !ACE_LACKS_RLIMIT */ #endif /* RLIMIT_NOFILE && !ACE_LACKS_RLIMIT */
#if defined (_SC_OPEN_MAX) #if defined (_SC_OPEN_MAX) && !defined (ACE_LACKS_SYSCONF)
return static_cast<int> (ACE_OS::sysconf (_SC_OPEN_MAX)); return static_cast<int> (ACE_OS::sysconf (_SC_OPEN_MAX));
#elif defined (FD_SETSIZE) #elif defined (FD_SETSIZE)
return FD_SETSIZE; return FD_SETSIZE;
@@ -2888,7 +2907,7 @@ ACE::set_handle_limit (int new_limit,
return 0; return 0;
} }
// Euclid's greatest common divisor algorithm. /// Euclid's greatest common divisor algorithm.
u_long u_long
ACE::gcd (u_long x, u_long y) ACE::gcd (u_long x, u_long y)
{ {
@@ -2903,7 +2922,7 @@ ACE::gcd (u_long x, u_long y)
} }
// Calculates the minimum enclosing frame size for the given values. /// Calculates the minimum enclosing frame size for the given values.
u_long u_long
ACE::minimum_frame_size (u_long period1, u_long period2) ACE::minimum_frame_size (u_long period1, u_long period2)
{ {
@@ -3104,7 +3123,9 @@ ACE::sock_error (int error)
return ACE_TEXT ("destination address required"); return ACE_TEXT ("destination address required");
/* NOTREACHED */ /* NOTREACHED */
default: default:
ACE_OS::sprintf (unknown_msg, ACE_TEXT ("unknown error: %d"), error); ACE_OS::snprintf (unknown_msg,
sizeof unknown_msg / sizeof unknown_msg[0],
ACE_TEXT ("unknown error: %d"), error);
return unknown_msg; return unknown_msg;
/* NOTREACHED */ /* NOTREACHED */
} }
@@ -3188,9 +3209,15 @@ ACE::strndup (const char *str, size_t n)
continue; continue;
char *s; char *s;
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (s,
(char *) ACE_Allocator::instance()->malloc (len + 1),
0);
#else
ACE_ALLOCATOR_RETURN (s, ACE_ALLOCATOR_RETURN (s,
(char *) ACE_OS::malloc (len + 1), (char *) ACE_OS::malloc (len + 1),
0); 0);
#endif /* ACE_HAS_ALLOC_HOOKS */
return ACE_OS::strsncpy (s, str, len + 1); return ACE_OS::strsncpy (s, str, len + 1);
} }
@@ -3209,11 +3236,18 @@ ACE::strndup (const wchar_t *str, size_t n)
len++) len++)
continue; continue;
wchar_t *s; size_t const size = (len + 1) * sizeof (wchar_t);
wchar_t *s = 0;
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (s, ACE_ALLOCATOR_RETURN (s,
static_cast<wchar_t *> ( static_cast<wchar_t*> (
ACE_OS::malloc ((len + 1) * sizeof (wchar_t))), ACE_Allocator::instance ()->malloc (size)),
0); 0);
#else
ACE_ALLOCATOR_RETURN (s,
static_cast<wchar_t*> (ACE_OS::malloc (size)),
0);
#endif /* ACE_HAS_ALLOC_HOOKS */
return ACE_OS::strsncpy (s, str, len + 1); return ACE_OS::strsncpy (s, str, len + 1);
} }
#endif /* ACE_HAS_WCHAR */ #endif /* ACE_HAS_WCHAR */
@@ -3233,9 +3267,17 @@ ACE::strnnew (const char *str, size_t n)
continue; continue;
char *s; char *s;
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (s,
static_cast<char*> (ACE_Allocator::instance ()->malloc (sizeof (char) * (len + 1))),
0);
#else
ACE_NEW_RETURN (s, ACE_NEW_RETURN (s,
char[len + 1], char[len + 1],
0); 0);
#endif /* ACE_HAS_ALLOC_HOOKS */
return ACE_OS::strsncpy (s, str, len + 1); return ACE_OS::strsncpy (s, str, len + 1);
} }
@@ -3288,9 +3330,16 @@ ACE::strnew (const char *s)
if (s == 0) if (s == 0)
return 0; return 0;
char *t = 0; char *t = 0;
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (t,
static_cast<char*> (ACE_Allocator::instance ()->malloc (sizeof (char) * (ACE_OS::strlen (s) + 1))),
0);
#else
ACE_NEW_RETURN (t, ACE_NEW_RETURN (t,
char [ACE_OS::strlen (s) + 1], char [ACE_OS::strlen (s) + 1],
0); 0);
#endif /* ACE_HAS_ALLOC_HOOKS */
return ACE_OS::strcpy (t, s); return ACE_OS::strcpy (t, s);
} }
@@ -3300,10 +3349,19 @@ ACE::strnew (const wchar_t *s)
{ {
if (s == 0) if (s == 0)
return 0; return 0;
size_t const n = ACE_OS::strlen (s) + 1;
wchar_t *t = 0; wchar_t *t = 0;
ACE_NEW_RETURN (t, #if defined (ACE_HAS_ALLOC_HOOKS)
wchar_t[ACE_OS::strlen (s) + 1], ACE_ALLOCATOR_RETURN (t,
0); static_cast<wchar_t*> (
ACE_Allocator::instance ()->malloc (
sizeof (wchar_t) * (n))),
0);
#else
ACE_NEW_RETURN (t, wchar_t[n], 0);
#endif /* ACE_HAS_ALLOC_HOOKS */
return ACE_OS::strcpy (t, s); return ACE_OS::strcpy (t, s);
} }
#endif /* ACE_HAS_WCHAR */ #endif /* ACE_HAS_WCHAR */

View File

@@ -11,7 +11,7 @@
* in order to manage the namespace better. These functions are put * in order to manage the namespace better. These functions are put
* here rather than in @c ACE_OS in order to separate concerns. * here rather than in @c ACE_OS in order to separate concerns.
* *
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//============================================================================= //=============================================================================
@@ -54,14 +54,18 @@ class ACE_Handle_Set;
namespace ACE namespace ACE
{ {
// = ACE version information. // = ACE version information.
/// e.g., the "5" in ACE 5.1.12. /// e.g., the "6" in ACE 6.3.4
extern ACE_Export u_int major_version (void); extern ACE_Export u_int major_version (void);
/// e.g., the "1" in ACE 5.1.12. /// e.g., the "3" in ACE 6.3.4
extern ACE_Export u_int minor_version (void); extern ACE_Export u_int minor_version (void);
/// e.g., the "12" in ACE 5.1.12. /// e.g., the "4" in ACE 6.3.4
/// Returns 0 for "stable" (non-beta) releases. /// Returns 0 for "stable" (non-micro) releases.
extern ACE_Export u_int micro_version (void);
/// e.g., the "4" in ACE 6.3.4
/// Returns 0 for "stable" (non-micro) releases.
extern ACE_Export u_int beta_version (void); extern ACE_Export u_int beta_version (void);
// = C++ compiler version information. // = C++ compiler version information.
@@ -211,7 +215,9 @@ namespace ACE
* *
* @return -1 on error, else total number of bytes received. * @return -1 on error, else total number of bytes received.
*/ */
#if !defined (ACE_LACKS_VA_FUNCTIONS)
extern ACE_Export ssize_t recv (ACE_HANDLE handle, size_t n, ...); extern ACE_Export ssize_t recv (ACE_HANDLE handle, size_t n, ...);
#endif /* ACE_LACKS_VA_FUNCTIONS */
extern ACE_Export ssize_t recvv (ACE_HANDLE handle, extern ACE_Export ssize_t recvv (ACE_HANDLE handle,
iovec *iov, iovec *iov,
@@ -292,7 +298,9 @@ namespace ACE
size_t *bytes_transferred = 0); size_t *bytes_transferred = 0);
/// Varargs variant. /// Varargs variant.
#if !defined (ACE_LACKS_VA_FUNCTIONS)
extern ACE_Export ssize_t send (ACE_HANDLE handle, size_t n, ...); extern ACE_Export ssize_t send (ACE_HANDLE handle, size_t n, ...);
#endif /* ACE_LACKS_VA_FUNCTIONS */
extern ACE_Export ssize_t sendv (ACE_HANDLE handle, extern ACE_Export ssize_t sendv (ACE_HANDLE handle,
const iovec *iov, const iovec *iov,
@@ -718,9 +726,9 @@ namespace ACE
/// @retval 1 the handle is ready /// @retval 1 the handle is ready
extern ACE_Export int handle_ready (ACE_HANDLE handle, extern ACE_Export int handle_ready (ACE_HANDLE handle,
const ACE_Time_Value *timeout, const ACE_Time_Value *timeout,
int read_ready, bool read_ready,
int write_ready, bool write_ready,
int exception_ready); bool exception_ready);
/// Wait for @a timeout before proceeding to a @c recv operation. /// Wait for @a timeout before proceeding to a @c recv operation.
/// @a val keeps track of whether we're in non-blocking mode or /// @a val keeps track of whether we're in non-blocking mode or
@@ -869,7 +877,6 @@ namespace ACE
int iovcnt, int iovcnt,
const ACE_Time_Value *timeout, const ACE_Time_Value *timeout,
size_t *bytes_transferred); size_t *bytes_transferred);
} }
// Close versioned namespace, if enabled by the user. // Close versioned namespace, if enabled by the user.

View File

@@ -1,7 +1,4 @@
// -*- C++ -*- // -*- C++ -*-
//
// $Id: ACE.inl 95761 2012-05-15 18:23:04Z johnnyw $
#include "ace/OS_NS_unistd.h" #include "ace/OS_NS_unistd.h"
#include "ace/OS_NS_Thread.h" #include "ace/OS_NS_Thread.h"
#include "ace/OS_NS_ctype.h" #include "ace/OS_NS_ctype.h"
@@ -10,7 +7,6 @@
// Open versioned namespace, if enabled by the user. // Open versioned namespace, if enabled by the user.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Wrappers for methods that have been moved to ACE_OS. // Wrappers for methods that have been moved to ACE_OS.
ACE_INLINE ssize_t ACE_INLINE ssize_t
@@ -220,7 +216,7 @@ ACE::sendv_n (ACE_HANDLE handle,
ACE_INLINE ssize_t ACE_INLINE ssize_t
ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len) ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len)
{ {
#if defined (ACE_WIN32) || defined (HPUX) #if defined (ACE_WIN32) || defined (HPUX) || defined (ACE_MQX)
return ACE_OS::send (handle, (const char *) buf, len); return ACE_OS::send (handle, (const char *) buf, len);
#else #else
return ACE_OS::write (handle, (const char *) buf, len); return ACE_OS::write (handle, (const char *) buf, len);
@@ -230,7 +226,7 @@ ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len)
ACE_INLINE ssize_t ACE_INLINE ssize_t
ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len) ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len)
{ {
#if defined (ACE_WIN32) || defined (ACE_OPENVMS) #if defined (ACE_WIN32) || defined (ACE_OPENVMS) || defined (ACE_MQX)
return ACE_OS::recv (handle, (char *) buf, len); return ACE_OS::recv (handle, (char *) buf, len);
#else #else
return ACE_OS::read (handle, (char *) buf, len); return ACE_OS::read (handle, (char *) buf, len);
@@ -240,25 +236,29 @@ ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len)
ACE_INLINE int ACE_INLINE int
ACE::handle_read_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout) ACE::handle_read_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
{ {
return ACE::handle_ready (handle, timeout, 1, 0, 0); return ACE::handle_ready (handle, timeout, true, false, false);
} }
ACE_INLINE int ACE_INLINE int
ACE::handle_write_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout) ACE::handle_write_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
{ {
return ACE::handle_ready (handle, timeout, 0, 1, 0); return ACE::handle_ready (handle, timeout, false, true, false);
} }
ACE_INLINE int ACE_INLINE int
ACE::handle_exception_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout) ACE::handle_exception_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
{ {
return ACE::handle_ready (handle, timeout, 0, 0, 1); return ACE::handle_ready (handle, timeout, false, false, true);
} }
ACE_INLINE void ACE_INLINE void
ACE::strdelete (char *s) ACE::strdelete (char *s)
{ {
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free(s);
#else
delete [] s; delete [] s;
#endif /* ACE_HAS_ALLOC_HOOKS */
} }
#if defined (ACE_HAS_WCHAR) #if defined (ACE_HAS_WCHAR)

View File

@@ -1,5 +1,3 @@
// $Id: ACE_crc32.cpp 91286 2010-08-05 09:04:31Z johnnyw $
#include "ace/ACE.h" #include "ace/ACE.h"
namespace namespace

View File

@@ -1,5 +1,3 @@
// $Id: ACE_crc_ccitt.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/ACE.h" #include "ace/ACE.h"
namespace namespace

View File

@@ -1,5 +1,4 @@
// -*- C++ -*- // -*- C++ -*-
// $Id: ACE_export.h 91683 2010-09-09 09:07:49Z johnnyw $
// Definition for Win32 Export directives. // Definition for Win32 Export directives.
// This file is generated automatically by // This file is generated automatically by
// generate_export_file.pl // generate_export_file.pl
@@ -8,7 +7,7 @@
#ifndef ACE_EXPORT_H #ifndef ACE_EXPORT_H
#define ACE_EXPORT_H #define ACE_EXPORT_H
#include "ace/config-lite.h" #include /**/ "ace/config-lite.h"
#if defined (ACE_AS_STATIC_LIBS) #if defined (ACE_AS_STATIC_LIBS)
@@ -43,21 +42,10 @@
# define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) # define ACE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
#endif /* ACE_HAS_DLL */ #endif /* ACE_HAS_DLL */
// Added by hand to help with ACE_OS namespace
#if defined (__TANDEM) && defined (USE_EXPLICIT_EXPORT)
#define ACE_NAMESPACE_STORAGE_CLASS ACE_EXPORT_MACRO extern
#else
#define ACE_NAMESPACE_STORAGE_CLASS extern ACE_EXPORT_MACRO #define ACE_NAMESPACE_STORAGE_CLASS extern ACE_EXPORT_MACRO
#endif
#if defined (__ACE_INLINE__) #if defined (__ACE_INLINE__)
# if defined (_MSC_VER) || defined (__MINGW32__) || defined (CYGWIN32) || \ # define ACE_NAMESPACE_INLINE_FUNCTION inline
(defined (__SUNPRO_CC) && __SUNPRO_CC >= 0x560) || \
(defined (__HP_aCC) && (__HP_aCC >= 60500))
# define ACE_NAMESPACE_INLINE_FUNCTION inline
# else
# define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS inline
# endif
# define ACE_INLINE_TEMPLATE_FUNCTION inline # define ACE_INLINE_TEMPLATE_FUNCTION inline
#else #else
# define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS # define ACE_NAMESPACE_INLINE_FUNCTION ACE_NAMESPACE_STORAGE_CLASS

View File

@@ -13,8 +13,8 @@
// Open versioned namespace, if enabled by the user. // Open versioned namespace, if enabled by the user.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE (ACE_ARGV_Queue_Entry) ACE_ALLOC_HOOK_DEFINE_Tt (ACE_ARGV_Queue_Entry_T)
ACE_ALLOC_HOOK_DEFINE (ACE_ARGV) ACE_ALLOC_HOOK_DEFINE_Tt (ACE_ARGV_T)
template <typename CHAR_TYPE> template <typename CHAR_TYPE>
void void
@@ -88,8 +88,14 @@ ACE_ARGV_T<CHAR_TYPE>::ACE_ARGV_T (const CHAR_TYPE buf[],
return; return;
// Make an internal copy of the string. // Make an internal copy of the string.
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR(this->buf_,
static_cast<char*> (ACE_Allocator::instance()->malloc(sizeof (CHAR_TYPE) * (ACE_OS::strlen (buf) + 1))));
#else
ACE_NEW (this->buf_, ACE_NEW (this->buf_,
CHAR_TYPE[ACE_OS::strlen (buf) + 1]); CHAR_TYPE[ACE_OS::strlen (buf) + 1]);
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_OS::strcpy (this->buf_, buf); ACE_OS::strcpy (this->buf_, buf);
// Create this->argv_. // Create this->argv_.
@@ -201,8 +207,13 @@ ACE_ARGV_T<CHAR_TYPE>::ACE_ARGV_T (CHAR_TYPE *first_argv[],
ACE_OS::strcat (this->buf_, second_buf); ACE_OS::strcat (this->buf_, second_buf);
// Delete the first and second buffers // Delete the first and second buffers
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free (first_buf);
ACE_Allocator::instance()->free (second_buf);
#else
delete [] first_buf; delete [] first_buf;
delete [] second_buf; delete [] second_buf;
#endif /* ACE_HAS_ALLOC_HOOKS */
} }
template <typename CHAR_TYPE> template <typename CHAR_TYPE>
@@ -260,11 +271,19 @@ ACE_ARGV_T<CHAR_TYPE>::add (const CHAR_TYPE *next_arg, bool quote_arg)
for (int i = 0; this->argv_[i] != 0; i++) for (int i = 0; this->argv_[i] != 0; i++)
ACE_OS::free ((void *) this->argv_[i]); ACE_OS::free ((void *) this->argv_[i]);
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free (this->argv_);
#else
delete [] this->argv_; delete [] this->argv_;
#endif /* ACE_HAS_ALLOC_HOOKS */
this->argv_ = 0; this->argv_ = 0;
} }
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free (this->buf_);
#else
delete [] this->buf_; delete [] this->buf_;
#endif /* ACE_HAS_ALLOC_HOOKS */
this->buf_ = 0; this->buf_ = 0;
return 0; return 0;
@@ -290,10 +309,21 @@ ACE_ARGV_T<CHAR_TYPE>::~ACE_ARGV_T (void)
if (this->argv_ != 0) if (this->argv_ != 0)
for (int i = 0; this->argv_[i] != 0; i++) for (int i = 0; this->argv_[i] != 0; i++)
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free ((void *) this->argv_[i]);
#else
ACE_OS::free ((void *) this->argv_[i]); ACE_OS::free ((void *) this->argv_[i]);
#endif /* ACE_HAS_ALLOC_HOOKS */
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free (this->argv_);
ACE_Allocator::instance()->free (this->buf_);
#else
delete [] this->argv_; delete [] this->argv_;
delete [] this->buf_; delete [] this->buf_;
#endif /* ACE_HAS_ALLOC_HOOKS */
} }
// Create buf_ out of the queue_. This is only used in the // Create buf_ out of the queue_. This is only used in the
@@ -309,11 +339,21 @@ ACE_ARGV_T<CHAR_TYPE>::create_buf_from_queue (void)
if (this->argc_ <= 0) if (this->argc_ <= 0)
return -1; return -1;
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free (this->buf_);
#else
delete [] this->buf_; delete [] this->buf_;
#endif /* ACE_HAS_ALLOC_HOOKS */
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (this->buf_,
static_cast<char*> (ACE_Allocator::instance()->malloc(sizeof (CHAR_TYPE) * (this->length_ + this->argc_))),
-1);
#else
ACE_NEW_RETURN (this->buf_, ACE_NEW_RETURN (this->buf_,
CHAR_TYPE[this->length_ + this->argc_], CHAR_TYPE[this->length_ + this->argc_],
-1); -1);
#endif /* ACE_HAS_ALLOC_HOOKS */
// Get an iterator over the queue // Get an iterator over the queue
ACE_Unbounded_Queue_Iterator<ACE_ARGV_Queue_Entry_T<CHAR_TYPE> > iter (this->queue_); ACE_Unbounded_Queue_Iterator<ACE_ARGV_Queue_Entry_T<CHAR_TYPE> > iter (this->queue_);

View File

@@ -4,9 +4,7 @@
/** /**
* @file ARGV.h * @file ARGV.h
* *
* $Id: ARGV.h 95972 2012-07-26 10:20:42Z johnnyw $ * @author Doug Schmidt <d.schmidt@vanderbilt.edu>
*
* @author Doug Schmidt <schmidt@cs.wustl.edu>
* @author Everett Anderson <eea1@cs.wustl.edu> * @author Everett Anderson <eea1@cs.wustl.edu>
*/ */
//========================================================================== //==========================================================================
@@ -36,7 +34,6 @@ template <typename CHAR_TYPE>
class ACE_ARGV_Queue_Entry_T class ACE_ARGV_Queue_Entry_T
{ {
public: public:
// = Initialization and termination.
/// Initialize a ACE_ARGV_Queue_Entry_T. /// Initialize a ACE_ARGV_Queue_Entry_T.
ACE_ARGV_Queue_Entry_T (void); ACE_ARGV_Queue_Entry_T (void);
@@ -96,7 +93,6 @@ template <typename CHAR_TYPE>
class ACE_ARGV_T class ACE_ARGV_T
{ {
public: public:
// = Initialization and termination.
/** /**
* Splits the specified string into an argument vector. Arguments in the * Splits the specified string into an argument vector. Arguments in the
* string are delimited by whitespace. Whitespace-containing arguments * string are delimited by whitespace. Whitespace-containing arguments
@@ -299,7 +295,7 @@ private:
/// The array of string arguments. /// The array of string arguments.
CHAR_TYPE **argv_; CHAR_TYPE **argv_;
/// Buffer containing the <argv> contents. /// Buffer containing the argv contents.
CHAR_TYPE *buf_; CHAR_TYPE *buf_;
/// Total length of the arguments in the queue, not counting /// Total length of the arguments in the queue, not counting

View File

@@ -1,6 +1,4 @@
/* -*- C++ -*- */ /* -*- C++ -*- */
// $Id: ARGV.inl 80826 2008-03-04 14:51:23Z wotte $
#include "ace/Global_Macros.h" #include "ace/Global_Macros.h"
// Open versioned namespace, if enabled by the user. // Open versioned namespace, if enabled by the user.

View File

@@ -1,7 +1,5 @@
#include "ace/ATM_Acceptor.h" #include "ace/ATM_Acceptor.h"
#if defined (ACE_HAS_ATM) #if defined (ACE_HAS_ATM)
#if defined (ACE_HAS_LINUX_ATM) #if defined (ACE_HAS_LINUX_ATM)
@@ -12,7 +10,6 @@
#include "ace/ATM_Acceptor.inl" #include "ace/ATM_Acceptor.inl"
#endif /* __ACE_INLINE__ */ #endif /* __ACE_INLINE__ */
// Open versioned namespace, if enabled by the user. // Open versioned namespace, if enabled by the user.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL

View File

@@ -57,9 +57,7 @@ class ACE_Time_Value;
*/ */
class ACE_Export ACE_ATM_Acceptor class ACE_Export ACE_ATM_Acceptor
{ {
public: public:
// = Initialization and termination methods.
/// Default constructor. /// Default constructor.
ACE_ATM_Acceptor (void); ACE_ATM_Acceptor (void);

View File

@@ -13,8 +13,6 @@
#include "ace/ATM_Addr.inl" #include "ace/ATM_Addr.inl"
#endif /* __ACE_INLINE__ */ #endif /* __ACE_INLINE__ */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_ATM_Addr) ACE_ALLOC_HOOK_DEFINE(ACE_ATM_Addr)

View File

@@ -63,7 +63,6 @@ public:
static const int OPT_FLAGS_PMP; static const int OPT_FLAGS_PMP;
static const int DEFAULT_SELECTOR; static const int DEFAULT_SELECTOR;
// = Initialization methods.
/// Default constructor. /// Default constructor.
ACE_ATM_Addr (u_char selector = DEFAULT_SELECTOR); ACE_ATM_Addr (u_char selector = DEFAULT_SELECTOR);
@@ -91,7 +90,6 @@ public:
/// Default dtor. /// Default dtor.
~ACE_ATM_Addr (void); ~ACE_ATM_Addr (void);
// = Initialization methods (useful after object construction).
/// Default initialization for non-address values (e.g., /// Default initialization for non-address values (e.g.,
/// t_atm_sap_addr.SVE_tag_addr, t_atm_sap_addr.SVE_tag_selector) /// t_atm_sap_addr.SVE_tag_addr, t_atm_sap_addr.SVE_tag_selector)
void init (u_char selector = DEFAULT_SELECTOR); void init (u_char selector = DEFAULT_SELECTOR);

View File

@@ -4,8 +4,6 @@
#include "ace/Handle_Set.h" #include "ace/Handle_Set.h"
#if !defined (__ACE_INLINE__) #if !defined (__ACE_INLINE__)
#include "ace/ATM_Connector.inl" #include "ace/ATM_Connector.inl"
#endif /* __ACE_INLINE__ */ #endif /* __ACE_INLINE__ */

View File

@@ -49,7 +49,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_ATM_Connector class ACE_Export ACE_ATM_Connector
{ {
public: public:
// = Initialization methods.
/// Default constructor. /// Default constructor.
ACE_ATM_Connector (void); ACE_ATM_Connector (void);

View File

@@ -2,8 +2,6 @@
#if defined (ACE_HAS_ATM) #if defined (ACE_HAS_ATM)
#if !defined (__ACE_INLINE__) #if !defined (__ACE_INLINE__)
#include "ace/ATM_Params.inl" #include "ace/ATM_Params.inl"
#endif /* __ACE_INLINE__ */ #endif /* __ACE_INLINE__ */

View File

@@ -1,7 +1,5 @@
#include "ace/ATM_QoS.h" #include "ace/ATM_QoS.h"
#if defined (ACE_HAS_ATM) #if defined (ACE_HAS_ATM)
#if !defined (__ACE_INLINE__) #if !defined (__ACE_INLINE__)

View File

@@ -8,7 +8,6 @@
*/ */
//========================================================================== //==========================================================================
#ifndef ACE_ATM_QoS_H #ifndef ACE_ATM_QoS_H
#define ACE_ATM_QoS_H #define ACE_ATM_QoS_H
#include /**/ "ace/pre.h" #include /**/ "ace/pre.h"
@@ -63,7 +62,6 @@ public:
static const int DEFAULT_SELECTOR; static const int DEFAULT_SELECTOR;
static const int DEFAULT_PKT_SIZE; static const int DEFAULT_PKT_SIZE;
// = Initializattion and termination methods.
/// Default constructor. /// Default constructor.
ACE_ATM_QoS(int = DEFAULT_PKT_SIZE); ACE_ATM_QoS(int = DEFAULT_PKT_SIZE);

View File

@@ -8,7 +8,6 @@
*/ */
//============================================================================= //=============================================================================
#ifndef ACE_ATM_STREAM_H #ifndef ACE_ATM_STREAM_H
#define ACE_ATM_STREAM_H #define ACE_ATM_STREAM_H
#include /**/ "ace/pre.h" #include /**/ "ace/pre.h"
@@ -46,7 +45,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_ATM_Stream class ACE_Export ACE_ATM_Stream
{ {
public: public:
// = Initialization and termination methods.
/// Default constructor. /// Default constructor.
ACE_ATM_Stream (void); ACE_ATM_Stream (void);

View File

@@ -1,5 +1,3 @@
//$Id: Abstract_Timer_Queue.cpp 95334 2011-12-15 12:52:50Z msmit $
#ifndef ACE_ABSTRACT_TIMER_QUEUE_CPP #ifndef ACE_ABSTRACT_TIMER_QUEUE_CPP
#define ACE_ABSTRACT_TIMER_QUEUE_CPP #define ACE_ABSTRACT_TIMER_QUEUE_CPP
#include "ace/config-all.h" #include "ace/config-all.h"

View File

@@ -1,5 +1,3 @@
//$Id: Abstract_Timer_Queue.h 95368 2011-12-19 13:38:49Z mcorino $
#ifndef ACE_ABSTRACT_TIMER_QUEUE_H #ifndef ACE_ABSTRACT_TIMER_QUEUE_H
#define ACE_ABSTRACT_TIMER_QUEUE_H #define ACE_ABSTRACT_TIMER_QUEUE_H
@@ -13,6 +11,8 @@
* Brunsch, Irfan Pyarali and a cast of thousands. * Brunsch, Irfan Pyarali and a cast of thousands.
*/ */
#include "ace/Versioned_Namespace.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward declares // Forward declares
@@ -184,7 +184,7 @@ public:
/** /**
* Determine the next event to timeout. Returns @a max if there are * Determine the next event to timeout. Returns @a max if there are
* no pending timers or if all pending timers are longer than max. * no pending timers or if all pending timers are longer than max.
* <the_timeout> should be a pointer to storage for the timeout value, * @a the_timeout should be a pointer to storage for the timeout value,
* and this value is also returned. This method does not acquire a * and this value is also returned. This method does not acquire a
* lock internally since it doesn't modify internal state. If you * lock internally since it doesn't modify internal state. If you
* need to call this method when the queue is being modified * need to call this method when the queue is being modified

View File

@@ -15,7 +15,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Acceptor) ACE_ALLOC_HOOK_DEFINE_Tca(ACE_Acceptor)
template <typename SVC_HANDLER, typename PEER_ACCEPTOR> void template <typename SVC_HANDLER, typename PEER_ACCEPTOR> void
ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::dump (void) const ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::dump (void) const
@@ -172,11 +172,11 @@ ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info (ACE_TCHAR **strp,
else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1)
return -1; return -1;
ACE_OS::sprintf (buf, ACE_OS::snprintf (buf, BUFSIZ,
ACE_TEXT ("%s\t %s %s"), ACE_TEXT ("%s\t %s %s"),
ACE_TEXT ("ACE_Acceptor"), ACE_TEXT ("ACE_Acceptor"),
addr_str, addr_str,
ACE_TEXT ("# acceptor factory\n")); ACE_TEXT ("# acceptor factory\n"));
if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
return -1; return -1;
@@ -447,7 +447,7 @@ ACE_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::handle_input (ACE_HANDLE listener)
return 0; return 0;
} }
ACE_ALLOC_HOOK_DEFINE(ACE_Strategy_Acceptor) ACE_ALLOC_HOOK_DEFINE_Tca(ACE_Strategy_Acceptor)
template <typename SVC_HANDLER, typename PEER_ACCEPTOR> int template <typename SVC_HANDLER, typename PEER_ACCEPTOR> int
ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::suspend (void) ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::suspend (void)
@@ -832,15 +832,15 @@ ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info (ACE_TCHAR **strp,
return -1; return -1;
// @@ Should add the protocol in... // @@ Should add the protocol in...
ACE_OS::sprintf (buf, ACE_OS::snprintf (buf, BUFSIZ,
ACE_TEXT ("%s\t %s #%s\n"), ACE_TEXT ("%s\t %s #%s\n"),
this->service_name_ == 0 this->service_name_ == 0
? ACE_TEXT ("<unknown>") ? ACE_TEXT ("<unknown>")
: this->service_name_, : this->service_name_,
service_addr_str, service_addr_str,
this->service_description_ == 0 this->service_description_ == 0
? ACE_TEXT ("<unknown>") ? ACE_TEXT ("<unknown>")
: this->service_description_); : this->service_description_);
if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
return -1; return -1;
@@ -856,7 +856,7 @@ ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::fini (void)
return this->ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::handle_close (); return this->ACE_Strategy_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::handle_close ();
} }
ACE_ALLOC_HOOK_DEFINE(ACE_Oneshot_Acceptor) ACE_ALLOC_HOOK_DEFINE_Tca(ACE_Oneshot_Acceptor)
template <typename SVC_HANDLER, typename PEER_ACCEPTOR> void template <typename SVC_HANDLER, typename PEER_ACCEPTOR> void
ACE_Oneshot_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::dump (void) const ACE_Oneshot_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::dump (void) const
@@ -1199,11 +1199,11 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, PEER_ACCEPTOR>::info (ACE_TCHAR **strp,
else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1)
return -1; return -1;
ACE_OS::sprintf (buf, ACE_OS::snprintf (buf, BUFSIZ,
ACE_TEXT ("%s\t %s %s"), ACE_TEXT ("%s\t %s %s"),
ACE_TEXT ("ACE_Oneshot_Acceptor"), ACE_TEXT ("ACE_Oneshot_Acceptor"),
addr_str, addr_str,
ACE_TEXT ("#oneshot acceptor factory\n")); ACE_TEXT ("#oneshot acceptor factory\n"));
if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
return -1; return -1;

View File

@@ -4,7 +4,7 @@
/** /**
* @file Acceptor.h * @file Acceptor.h
* *
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//============================================================================= //=============================================================================
@@ -59,7 +59,6 @@ template <typename SVC_HANDLER, typename PEER_ACCEPTOR>
class ACE_Acceptor : public ACE_Service_Object class ACE_Acceptor : public ACE_Service_Object
{ {
public: public:
// Useful STL-style traits. // Useful STL-style traits.
typedef typename PEER_ACCEPTOR::PEER_ADDR addr_type; typedef typename PEER_ACCEPTOR::PEER_ADDR addr_type;
typedef PEER_ACCEPTOR acceptor_type; typedef PEER_ACCEPTOR acceptor_type;
@@ -68,7 +67,7 @@ public:
/// "Do-nothing" constructor. /// "Do-nothing" constructor.
ACE_Acceptor (ACE_Reactor * = 0, ACE_Acceptor (ACE_Reactor * = 0,
int use_select = 1); int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT);
/** /**
* Open the contained @c PEER_ACCEPTOR object to begin listening, and * Open the contained @c PEER_ACCEPTOR object to begin listening, and
@@ -106,7 +105,7 @@ public:
ACE_Acceptor (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr, ACE_Acceptor (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr,
ACE_Reactor *reactor = ACE_Reactor::instance (), ACE_Reactor *reactor = ACE_Reactor::instance (),
int flags = 0, int flags = 0,
int use_select = 1, int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
int reuse_addr = 1); int reuse_addr = 1);
/** /**
@@ -148,7 +147,7 @@ public:
virtual int open (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr, virtual int open (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr,
ACE_Reactor *reactor = ACE_Reactor::instance (), ACE_Reactor *reactor = ACE_Reactor::instance (),
int flags = 0, int flags = 0,
int use_select = 1, int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
int reuse_addr = 1); int reuse_addr = 1);
/// Close down the Acceptor's resources. /// Close down the Acceptor's resources.
@@ -281,7 +280,6 @@ class ACE_Strategy_Acceptor
: public ACE_Acceptor <SVC_HANDLER, PEER_ACCEPTOR> : public ACE_Acceptor <SVC_HANDLER, PEER_ACCEPTOR>
{ {
public: public:
// Useful STL-style traits. // Useful STL-style traits.
typedef ACE_Creation_Strategy<SVC_HANDLER> typedef ACE_Creation_Strategy<SVC_HANDLER>
creation_strategy_type; creation_strategy_type;
@@ -302,7 +300,7 @@ public:
/// Default constructor. /// Default constructor.
ACE_Strategy_Acceptor (const ACE_TCHAR service_name[] = 0, ACE_Strategy_Acceptor (const ACE_TCHAR service_name[] = 0,
const ACE_TCHAR service_description[] = 0, const ACE_TCHAR service_description[] = 0,
int use_select = 1, int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
int reuse_addr = 1); int reuse_addr = 1);
/** /**
@@ -319,7 +317,7 @@ public:
ACE_Scheduling_Strategy<SVC_HANDLER> * = 0, ACE_Scheduling_Strategy<SVC_HANDLER> * = 0,
const ACE_TCHAR service_name[] = 0, const ACE_TCHAR service_name[] = 0,
const ACE_TCHAR service_description[] = 0, const ACE_TCHAR service_description[] = 0,
int use_select = 1, int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
int reuse_addr = 1); int reuse_addr = 1);
/** /**
@@ -359,7 +357,7 @@ public:
virtual int open (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr, virtual int open (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr,
ACE_Reactor *reactor, ACE_Reactor *reactor,
int flags = 0, int flags = 0,
int use_select = 1, int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
int reuse_addr = 1); int reuse_addr = 1);
/** /**
@@ -376,7 +374,7 @@ public:
ACE_Scheduling_Strategy<SVC_HANDLER> * = 0, ACE_Scheduling_Strategy<SVC_HANDLER> * = 0,
const ACE_TCHAR *service_name = 0, const ACE_TCHAR *service_name = 0,
const ACE_TCHAR *service_description = 0, const ACE_TCHAR *service_description = 0,
int use_select = 1, int use_select = ACE_DEFAULT_ACCEPTOR_USE_SELECT,
int reuse_addr = 1); int reuse_addr = 1);
/// Close down the Strategy_Acceptor's resources. /// Close down the Strategy_Acceptor's resources.
@@ -538,7 +536,6 @@ template <typename SVC_HANDLER, typename PEER_ACCEPTOR>
class ACE_Oneshot_Acceptor : public ACE_Service_Object class ACE_Oneshot_Acceptor : public ACE_Service_Object
{ {
public: public:
// Useful STL-style traits. // Useful STL-style traits.
typedef typename PEER_ACCEPTOR::PEER_ADDR addr_type; typedef typename PEER_ACCEPTOR::PEER_ADDR addr_type;
typedef PEER_ACCEPTOR acceptor_type; typedef PEER_ACCEPTOR acceptor_type;

View File

@@ -11,6 +11,8 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE (ACE_Activation_Queue)
void void
ACE_Activation_Queue::dump (void) const ACE_Activation_Queue::dump (void) const
{ {

View File

@@ -5,7 +5,7 @@
* @file Activation_Queue.h * @file Activation_Queue.h
* *
* @author Andres Kruse <Andres.Kruse@cern.ch> * @author Andres Kruse <Andres.Kruse@cern.ch>
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//============================================================================= //=============================================================================
@@ -147,7 +147,6 @@ protected:
bool delete_queue_; bool delete_queue_;
private: private:
/// Allocation strategy of the queue. /// Allocation strategy of the queue.
ACE_Allocator *allocator_; ACE_Allocator *allocator_;

View File

@@ -1,7 +1,4 @@
// -*- C++ -*- // -*- C++ -*-
//
// $Id: Activation_Queue.inl 80826 2008-03-04 14:51:23Z wotte $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE size_t ACE_INLINE size_t

View File

@@ -1,5 +1,3 @@
// $Id: Active_Map_Manager.cpp 91286 2010-08-05 09:04:31Z johnnyw $
#include "ace/Active_Map_Manager.h" #include "ace/Active_Map_Manager.h"
#if !defined (__ACE_INLINE__) #if !defined (__ACE_INLINE__)

View File

@@ -4,8 +4,6 @@
/** /**
* @file Active_Map_Manager.h * @file Active_Map_Manager.h
* *
* $Id: Active_Map_Manager.h 93359 2011-02-11 11:33:12Z mcorino $
*
* @author Irfan Pyarali * @author Irfan Pyarali
*/ */
//============================================================================= //=============================================================================
@@ -82,7 +80,6 @@ public:
void increment_slot_generation_count (void); void increment_slot_generation_count (void);
private: private:
/** /**
* @brief Data for the Active Object Map Key. * @brief Data for the Active Object Map Key.
* *

View File

@@ -1,7 +1,4 @@
// -*- C++ -*- // -*- C++ -*-
//
// $Id: Active_Map_Manager.inl 80826 2008-03-04 14:51:23Z wotte $
#include "ace/OS_NS_string.h" #include "ace/OS_NS_string.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL

View File

@@ -1,5 +1,3 @@
// $Id: Active_Map_Manager_T.cpp 80826 2008-03-04 14:51:23Z wotte $
#ifndef ACE_ACTIVE_MAP_MANAGER_T_CPP #ifndef ACE_ACTIVE_MAP_MANAGER_T_CPP
#define ACE_ACTIVE_MAP_MANAGER_T_CPP #define ACE_ACTIVE_MAP_MANAGER_T_CPP
@@ -15,7 +13,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Active_Map_Manager) ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Active_Map_Manager)
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -4,8 +4,6 @@
/** /**
* @file Active_Map_Manager_T.h * @file Active_Map_Manager_T.h
* *
* $Id: Active_Map_Manager_T.h 84316 2009-02-03 19:46:05Z johnnyw $
*
* @author Irfan Pyarali * @author Irfan Pyarali
*/ */
//============================================================================= //=============================================================================
@@ -39,7 +37,6 @@ template <class T>
class ACE_Active_Map_Manager : public ACE_Map_Manager<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> class ACE_Active_Map_Manager : public ACE_Map_Manager<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex>
{ {
public: public:
// = Traits. // = Traits.
typedef ACE_Active_Map_Manager_Key key_type; typedef ACE_Active_Map_Manager_Key key_type;
typedef T mapped_type; typedef T mapped_type;
@@ -52,7 +49,6 @@ public:
typedef ITERATOR iterator; typedef ITERATOR iterator;
typedef REVERSE_ITERATOR reverse_iterator; typedef REVERSE_ITERATOR reverse_iterator;
// = Initialization and termination methods.
/// Initialize a Active_Map_Manager with the ACE_DEFAULT_MAP_SIZE. /// Initialize a Active_Map_Manager with the ACE_DEFAULT_MAP_SIZE.
ACE_Active_Map_Manager (ACE_Allocator *alloc = 0); ACE_Active_Map_Manager (ACE_Allocator *alloc = 0);
@@ -187,7 +183,6 @@ protected:
typedef ACE_Map_Manager<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> ACE_AMM_BASE; typedef ACE_Map_Manager<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> ACE_AMM_BASE;
private: private:
// = Disallow these operations. // = Disallow these operations.
ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Active_Map_Manager<T> &)) ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Active_Map_Manager<T> &))
ACE_UNIMPLEMENTED_FUNC (ACE_Active_Map_Manager (const ACE_Active_Map_Manager<T> &)) ACE_UNIMPLEMENTED_FUNC (ACE_Active_Map_Manager (const ACE_Active_Map_Manager<T> &))

View File

@@ -1,7 +1,4 @@
// -*- C++ -*- // -*- C++ -*-
//
// $Id: Active_Map_Manager_T.inl 80826 2008-03-04 14:51:23Z wotte $
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template <class T> ACE_INLINE int template <class T> ACE_INLINE int

View File

@@ -6,6 +6,9 @@
#include "ace/Log_Category.h" #include "ace/Log_Category.h"
#include "ace/os_include/sys/os_socket.h" #include "ace/os_include/sys/os_socket.h"
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL

View File

@@ -4,7 +4,7 @@
/** /**
* @file Addr.h * @file Addr.h
* *
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//============================================================================= //=============================================================================
@@ -30,7 +30,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_Addr class ACE_Export ACE_Addr
{ {
public: public:
// = Initialization and termination methods.
/// Initializes instance variables. /// Initializes instance variables.
ACE_Addr (int type = -1, int size = -1); ACE_Addr (int type = -1, int size = -1);

View File

@@ -1,7 +1,4 @@
// -*- C++ -*- // -*- C++ -*-
//
// $Id: Addr.inl 87295 2009-11-02 14:45:59Z johnnyw $
// Return the address of the address. // Return the address of the address.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL

View File

@@ -1,5 +1,3 @@
// $Id: Arg_Shifter.cpp 91286 2010-08-05 09:04:31Z johnnyw $
#ifndef ACE_ARG_SHIFTER_T_CPP #ifndef ACE_ARG_SHIFTER_T_CPP
#define ACE_ARG_SHIFTER_T_CPP #define ACE_ARG_SHIFTER_T_CPP
@@ -8,6 +6,9 @@
#include "ace/OS_NS_strings.h" #include "ace/OS_NS_strings.h"
#include "ace/OS_Errno.h" #include "ace/OS_Errno.h"
#include "ace/OS_Memory.h" #include "ace/OS_Memory.h"
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -47,9 +48,13 @@ ACE_Arg_Shifter_T<CHAR_TYPE>::init (void)
{ {
// If not provided with one, allocate a temporary array. // If not provided with one, allocate a temporary array.
if (this->temp_ == 0) if (this->temp_ == 0)
#if defined (ACE_HAS_ALLOC_HOOKS)
this->temp_ = reinterpret_cast<const CHAR_TYPE **>
(ACE_Allocator::instance ()->malloc (sizeof (CHAR_TYPE*) * this->total_size_));
#else
ACE_NEW (this->temp_, ACE_NEW (this->temp_,
const CHAR_TYPE *[this->total_size_]); const CHAR_TYPE *[this->total_size_]);
#endif /* ACE_HAS_ALLOC_HOOKS */
if (this->temp_ != 0) if (this->temp_ != 0)
{ {
// Fill the temporary array. // Fill the temporary array.
@@ -72,7 +77,12 @@ template <typename CHAR_TYPE>
ACE_Arg_Shifter_T<CHAR_TYPE>::~ACE_Arg_Shifter_T (void) ACE_Arg_Shifter_T<CHAR_TYPE>::~ACE_Arg_Shifter_T (void)
{ {
// Delete the temporary vector. // Delete the temporary vector.
#if defined (ACE_HAS_ALLOC_HOOKS)
if (this->temp_)
ACE_Allocator::instance ()->free (this->temp_);
#else
delete [] temp_; delete [] temp_;
#endif /* ACE_HAS_ALLOC_HOOKS */
} }
template <typename CHAR_TYPE> template <typename CHAR_TYPE>
@@ -120,33 +130,20 @@ template <typename CHAR_TYPE>
int int
ACE_Arg_Shifter_T<CHAR_TYPE>::cur_arg_strncasecmp (const CHAR_TYPE *flag) ACE_Arg_Shifter_T<CHAR_TYPE>::cur_arg_strncasecmp (const CHAR_TYPE *flag)
{ {
// Check for a current argument if (!this->is_anything_left ())
if (this->is_anything_left()) return -1;
{
size_t const flag_length = ACE_OS::strlen (flag);
// Check for presence of the flag const size_t flag_length = ACE_OS::strlen (flag);
if (ACE_OS::strncasecmp(this->temp_[current_index_], const CHAR_TYPE *arg = this->temp_[this->current_index_];
flag,
flag_length) == 0) if (ACE_OS::strncasecmp (arg, flag, flag_length) != 0)
{ return -1;
if (ACE_OS::strlen(temp_[current_index_]) == flag_length)
{ const size_t arg_length = ACE_OS::strlen (arg);
// match and lengths are equal size_t remaining = flag_length;
return 0; while (remaining < arg_length && arg[remaining] == CHAR_TYPE (' '))
} ++remaining;
else return (arg_length == flag_length) ? 0 : static_cast<int> (remaining);
{
// matches, with more info to boot!
size_t const remaining = ACE_OS::strspn
(this->temp_[current_index_] + flag_length,
ACE_TEXT (" ")) + flag_length;
return static_cast<int> (remaining);
}
}
}
// failure
return -1;
} }
template <typename CHAR_TYPE> template <typename CHAR_TYPE>

View File

@@ -4,8 +4,6 @@
/** /**
* @file Arg_Shifter.h * @file Arg_Shifter.h
* *
* $Id: Arg_Shifter.h 95972 2012-07-26 10:20:42Z johnnyw $
*
* @author Seth Widoff * @author Seth Widoff
*/ */
//============================================================================= //=============================================================================
@@ -55,7 +53,6 @@ template <typename CHAR_TYPE>
class ACE_Arg_Shifter_T class ACE_Arg_Shifter_T
{ {
public: public:
// = Initialization and termination methods.
/** /**
* Initialize the ACE_Arg_Shifter to the vector over which to * Initialize the ACE_Arg_Shifter to the vector over which to
* iterate. Optionally, also provide the temporary array for * iterate. Optionally, also provide the temporary array for
@@ -77,13 +74,13 @@ public:
* (the default) the object will allocate and free the temporary * (the default) the object will allocate and free the temporary
* vector transparently. * vector transparently.
*/ */
ACE_Arg_Shifter_T (int& argc, ACE_Arg_Shifter_T (int &argc,
const CHAR_TYPE **argv, const CHAR_TYPE **argv,
const CHAR_TYPE **temp = 0); const CHAR_TYPE **temp = 0);
/// Same behavior as the preceding constructor, but without the /// Same behavior as the preceding constructor, but without the
/// "const" qualifier. /// "const" qualifier.
ACE_Arg_Shifter_T (int& argc, ACE_Arg_Shifter_T (int &argc,
CHAR_TYPE **argv, CHAR_TYPE **argv,
CHAR_TYPE **temp = 0); CHAR_TYPE **temp = 0);
@@ -100,12 +97,12 @@ public:
* *
* Safe to call without checking that a current arg exists * Safe to call without checking that a current arg exists
* *
* In the following examples, a pointer to the char* "value" is ret * In the following examples, a pointer to the char* "value" is returned
* *
* eg: main -foobar value, main -FooBar value * eg: main -foobar value, main -FooBar value
* main -FOOBARvalue * main -FOOBARvalue
* *
* all of the above will all match the @a flag == -FooBar * all of the above will match the @a flag == -FooBar
* and will return a char* to "value" * and will return a char* to "value"
* *
* main -foobar 4 would succeed and return a char* to "4" * main -foobar 4 would succeed and return a char* to "4"
@@ -125,7 +122,7 @@ public:
* together '-foobarflagVALUE', the flag is NOT consumed * together '-foobarflagVALUE', the flag is NOT consumed
* and the cur arg is left pointing to the entire flag/value pair * and the cur arg is left pointing to the entire flag/value pair
*/ */
const CHAR_TYPE *get_the_parameter (const CHAR_TYPE* flag); const CHAR_TYPE *get_the_parameter (const CHAR_TYPE *flag);
/** /**
* Check if the current argument matches (case insensitive) @a flag * Check if the current argument matches (case insensitive) @a flag
@@ -136,7 +133,7 @@ public:
* 0 is returned. * 0 is returned.
* *
* ie: when current_arg = "-foobar" or "-FOOBAR" or "-fooBAR" * ie: when current_arg = "-foobar" or "-FOOBAR" or "-fooBAR"
* this->cur_arg_strncasecmp ("-FooBar); * this->cur_arg_strncasecmp ("-FooBar");
* will return 0 * will return 0
* *
* ------------------------------------------------------------ * ------------------------------------------------------------
@@ -144,11 +141,19 @@ public:
* Case B: Perfect Match (case insensitive) but the current_arg * Case B: Perfect Match (case insensitive) but the current_arg
* is longer than the flag. Returns a number equal to the index * is longer than the flag. Returns a number equal to the index
* in the char* indicating the start of the extra characters * in the char* indicating the start of the extra characters
* after any initial spaces (see below).
* *
* ie: when current_arg = "-foobar98023" * ie: when current_arg = "-foobar98023"
* this->cur_arg_strncasecmp ("-FooBar); * this->cur_arg_strncasecmp ("-FooBar");
* will return 7 * will return 7
* *
* Spaces separating the flag from its value (that are still part
* of the same argv element) are counted as part of the return value
*
* ie: when current_arg = "-foobar 98023"
* this->cur_arg_strncasecmp ("-FooBar");
* will return 8
*
* Notice: this number will always be > 0 * Notice: this number will always be > 0
* *
* ------------------------------------------------------------ * ------------------------------------------------------------
@@ -182,16 +187,16 @@ public:
private: private:
/// Copy Constructor should not be used. /// Copy Constructor should not be used.
ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T (const ACE_Arg_Shifter_T<CHAR_TYPE>&)) ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T (const ACE_Arg_Shifter_T<CHAR_TYPE> &))
/// Assignment '=' operator should not be used. /// Assignment '=' operator should not be used.
ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T operator= (const ACE_Arg_Shifter_T<CHAR_TYPE>&)) ACE_UNIMPLEMENTED_FUNC (ACE_Arg_Shifter_T operator= (const ACE_Arg_Shifter_T<CHAR_TYPE> &))
/// Refactor the constructor logic. /// Refactor the constructor logic.
void init (void); void init (void);
/// The size of the argument vector. /// The size of the argument vector.
int& argc_; int &argc_;
/// The size of argv_. /// The size of argv_.
int total_size_; int total_size_;

View File

@@ -37,7 +37,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_Argv_Type_Converter class ACE_Export ACE_Argv_Type_Converter
{ {
public: public:
ACE_Argv_Type_Converter (int &argc, char** argv); ACE_Argv_Type_Converter (int &argc, char** argv);
#if defined (ACE_USES_WCHAR) #if defined (ACE_USES_WCHAR)
@@ -56,7 +55,6 @@ public:
int& get_argc (void); int& get_argc (void);
private: private:
/// Copy Constructor should not be used. /// Copy Constructor should not be used.
ACE_Argv_Type_Converter (const ACE_Argv_Type_Converter&); ACE_Argv_Type_Converter (const ACE_Argv_Type_Converter&);

View File

@@ -4,7 +4,7 @@
/** /**
* @file Array_Base.h * @file Array_Base.h
* *
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//============================================================================= //=============================================================================
@@ -41,7 +41,6 @@ template<class T>
class ACE_Array_Base class ACE_Array_Base
{ {
public: public:
// Old/ACE-style traits. // Old/ACE-style traits.
typedef T TYPE; typedef T TYPE;
typedef ACE_Array_Iterator<T> ITERATOR; typedef ACE_Array_Iterator<T> ITERATOR;
@@ -59,8 +58,6 @@ public:
ACE_DECLARE_STL_REVERSE_ITERATORS ACE_DECLARE_STL_REVERSE_ITERATORS
// = Initialization and termination methods.
/// Dynamically create an uninitialized array. /// Dynamically create an uninitialized array.
ACE_Array_Base (size_type size = 0, ACE_Array_Base (size_type size = 0,
ACE_Allocator * the_allocator = 0); ACE_Allocator * the_allocator = 0);
@@ -205,7 +202,6 @@ template <class T>
class ACE_Array_Iterator class ACE_Array_Iterator
{ {
public: public:
// = Initialization method.
ACE_Array_Iterator (ACE_Array_Base<T> &); ACE_Array_Iterator (ACE_Array_Base<T> &);
// = Iteration methods. // = Iteration methods.

View File

@@ -13,65 +13,64 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
template<typename InputIterator> template<typename InputIterator>
ACE_Array_Map<Key, Value, EqualTo>::ACE_Array_Map (InputIterator f, ACE_Array_Map<Key, Value, EqualTo, Alloc>::ACE_Array_Map (InputIterator f,
InputIterator l) InputIterator l)
: size_ (l - f) : size_ (l - f)
, capacity_ (size_) , capacity_ (size_)
, nodes_ (size_ == 0 ? 0 : new value_type[size_]) , nodes_ (size_ == 0 ? 0 : this->alloc_.allocate (size_))
{ {
(void) std::copy (f, (void) std::uninitialized_copy (f,
l, l,
ACE_make_checked_array_iterator (this->begin (), ACE_make_checked_array_iterator (this->begin (),
this->size_)); this->size_));
// iterator n = this->begin ();
// for (InputIterator i = f; i != l; ++i, ++n)
// *n = *i;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_Array_Map<Key, Value, EqualTo>::ACE_Array_Map ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::ACE_Array_Map (
ACE_Array_Map<Key, Value, EqualTo> const & map) ACE_Array_Map<Key, Value, EqualTo, Alloc> const & map)
: size_ (map.size_) : size_ (map.size_)
, capacity_ (map.size_) , capacity_ (map.size_)
, nodes_ (size_ == 0 ? 0 : new value_type[size_]) , nodes_ (size_ == 0 ? 0 : this->alloc_.allocate (size_))
{ {
std::copy (map.begin (), (void) std::uninitialized_copy (map.begin (),
map.end (), map.end (),
ACE_make_checked_array_iterator (this->begin (), ACE_make_checked_array_iterator (this->begin (),
this->size_)); this->size_));
// iterator f = map.begin ();
// iterator l = map.end ();
// iterator n = this->begin ();
// for (iterator i = f; i != l; ++i, ++n)
// *n = *i;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_Array_Map<Key, Value, EqualTo>::~ACE_Array_Map (void) ACE_Array_Map<Key, Value, EqualTo, Alloc>::~ACE_Array_Map (void)
{ {
delete[] this->nodes_; for (size_t idx = 0; idx != capacity_; ++idx)
{
#if defined (ACE_HAS_BCC32)
using std::pair;
(nodes_ + idx)->~pair<key_type, mapped_type>();
#else
(nodes_ + idx)->~value_type();
#endif
}
alloc_.deallocate(this->nodes_, capacity_);
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
void void
ACE_Array_Map<Key, Value, EqualTo>::swap ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::swap (
ACE_Array_Map<Key, Value, EqualTo> & map) ACE_Array_Map<Key, Value, EqualTo, Alloc> & map)
{ {
std::swap (this->size_, map.size_); std::swap (this->size_, map.size_);
std::swap (this->capacity_, map.capacity_); std::swap (this->capacity_, map.capacity_);
std::swap (this->nodes_, map.nodes_); std::swap (this->nodes_, map.nodes_);
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
std::pair<typename ACE_Array_Map<Key, Value, EqualTo>::iterator, bool> std::pair<typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::iterator, bool>
ACE_Array_Map<Key, Value, EqualTo>::insert ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::insert (
typename ACE_Array_Map<Key, Value, EqualTo>::value_type const & x) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::value_type const & x)
{ {
// Linear insertion due to linear duplicate key search. // Linear insertion due to linear duplicate key search.
@@ -96,10 +95,10 @@ ACE_Array_Map<Key, Value, EqualTo>::insert (
return std::make_pair (i, inserted); return std::make_pair (i, inserted);
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
template<typename InputIterator> template<typename InputIterator>
void void
ACE_Array_Map<Key, Value, EqualTo>::insert (InputIterator f, InputIterator l) ACE_Array_Map<Key, Value, EqualTo, Alloc>::insert (InputIterator f, InputIterator l)
{ {
this->grow (l - f); // Preallocate storage. this->grow (l - f); // Preallocate storage.
@@ -109,10 +108,10 @@ ACE_Array_Map<Key, Value, EqualTo>::insert (InputIterator f, InputIterator l)
} }
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
void void
ACE_Array_Map<Key, Value, EqualTo>::erase ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::erase (
typename ACE_Array_Map<Key, Value, EqualTo>::iterator pos) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::iterator pos)
{ {
iterator const first = this->begin (); iterator const first = this->begin ();
iterator const last = this->end (); iterator const last = this->end ();
@@ -136,10 +135,10 @@ ACE_Array_Map<Key, Value, EqualTo>::erase (
} }
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
typename ACE_Array_Map<Key, Value, EqualTo>::size_type typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::size_type
ACE_Array_Map<Key, Value, EqualTo>::erase ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::erase (
typename ACE_Array_Map<Key, Value, EqualTo>::key_type const & k) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::key_type const & k)
{ {
iterator pos = this->find (k); iterator pos = this->find (k);
@@ -150,28 +149,28 @@ ACE_Array_Map<Key, Value, EqualTo>::erase (
return old_size - this->size_; return old_size - this->size_;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
void void
ACE_Array_Map<Key, Value, EqualTo>::erase ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::erase (
typename ACE_Array_Map<Key, Value, EqualTo>::iterator first, typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::iterator first,
typename ACE_Array_Map<Key, Value, EqualTo>::iterator last) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::iterator last)
{ {
if (this->begin () <= first && first < last && last < this->end ()) if (this->begin () <= first && first < last && last < this->end ())
for (iterator i = first; i != last; ++i) for (iterator i = first; i != last; ++i)
this->erase (i); this->erase (i);
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
void void
ACE_Array_Map<Key, Value, EqualTo>::clear (void) ACE_Array_Map<Key, Value, EqualTo, Alloc>::clear (void)
{ {
this->size_ = 0; // No need to deallocate array nor destroy elements. this->size_ = 0; // No need to deallocate array nor destroy elements.
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
typename ACE_Array_Map<Key, Value, EqualTo>::iterator typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::iterator
ACE_Array_Map<Key, Value, EqualTo>::find ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::find (
typename ACE_Array_Map<Key, Value, EqualTo>::key_type const & k) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::key_type const & k)
{ {
iterator const the_end = this->end (); iterator const the_end = this->end ();
@@ -184,10 +183,10 @@ ACE_Array_Map<Key, Value, EqualTo>::find (
return this->end (); return this->end ();
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
typename ACE_Array_Map<Key, Value, EqualTo>::const_iterator typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::const_iterator
ACE_Array_Map<Key, Value, EqualTo>::find ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::find (
typename ACE_Array_Map<Key, Value, EqualTo>::key_type const & k) const typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::key_type const & k) const
{ {
const_iterator const the_end = this->end (); const_iterator const the_end = this->end ();
@@ -200,10 +199,10 @@ ACE_Array_Map<Key, Value, EqualTo>::find (
return this->end (); return this->end ();
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
void void
ACE_Array_Map<Key, Value, EqualTo>::grow ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::grow (
typename ACE_Array_Map<Key, Value, EqualTo>::size_type s) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::size_type s)
{ {
if (this->size () + s > this->capacity_) if (this->size () + s > this->capacity_)
{ {
@@ -212,7 +211,7 @@ ACE_Array_Map<Key, Value, EqualTo>::grow (
// Strongly exception safe. // Strongly exception safe.
ACE_Array_Map<Key, Value, EqualTo> temp (this->size () + s); ACE_Array_Map<Key, Value, EqualTo, Alloc> temp (this->size () + s);
std::copy (this->begin (), std::copy (this->begin (),
this->end (), this->end (),
@@ -231,10 +230,10 @@ ACE_Array_Map<Key, Value, EqualTo>::grow (
// --------------------------------------------------------------- // ---------------------------------------------------------------
template <typename Key, typename Value, class EqualTo> template <typename Key, typename Value, class EqualTo, class Alloc>
bool bool
operator== (ACE_Array_Map<Key, Value, EqualTo> const & lhs, operator== (ACE_Array_Map<Key, Value, EqualTo, Alloc> const & lhs,
ACE_Array_Map<Key, Value, EqualTo> const & rhs) ACE_Array_Map<Key, Value, EqualTo, Alloc> const & rhs)
{ {
// Do not include Array_Map capacity in comparison. It isn't useful // Do not include Array_Map capacity in comparison. It isn't useful
// in this case. // in this case.
@@ -246,10 +245,10 @@ operator== (ACE_Array_Map<Key, Value, EqualTo> const & lhs,
rhs.size ()))); rhs.size ())));
} }
template <typename Key, typename Value, class EqualTo> template <typename Key, typename Value, class EqualTo, class Alloc>
bool bool
operator< (ACE_Array_Map<Key, Value, EqualTo> const & lhs, operator< (ACE_Array_Map<Key, Value, EqualTo, Alloc> const & lhs,
ACE_Array_Map<Key, Value, EqualTo> const & rhs) ACE_Array_Map<Key, Value, EqualTo, Alloc> const & rhs)
{ {
return std::lexicographical_compare (lhs.begin (), lhs.end (), return std::lexicographical_compare (lhs.begin (), lhs.end (),
rhs.begin (), rhs.end ()); rhs.begin (), rhs.end ());

View File

@@ -29,9 +29,18 @@
#include <utility> #include <utility>
#include <iterator> #include <iterator>
#include <functional> #include <functional>
#include <memory>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#if defined __SUNPRO_CC && !defined _RWSTD_ALLOCATOR
# define ACE_ARRAY_MAP_DEFAULT_ALLOCATOR(K, V) std::allocator_interface< \
std::allocator<void>, \
std::pair<K, V> >
#else
# define ACE_ARRAY_MAP_DEFAULT_ALLOCATOR(K, V) std::allocator<std::pair<K, V> >
#endif
/** /**
* @class ACE_Array_Map * @class ACE_Array_Map
* *
@@ -82,24 +91,25 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* -# Copy constructor * -# Copy constructor
* -# operator= * -# operator=
*/ */
template<typename Key, typename Value, class EqualTo = std::equal_to<Key> > template<typename Key, typename Value, class EqualTo = std::equal_to<Key>,
class Alloc = ACE_ARRAY_MAP_DEFAULT_ALLOCATOR (Key, Value) >
class ACE_Array_Map class ACE_Array_Map
{ {
public: public:
// STL-style typedefs/traits. // STL-style typedefs/traits.
typedef Key key_type; typedef Key key_type;
typedef Value data_type; typedef Value mapped_type;
typedef std::pair<key_type, data_type> value_type; typedef Value data_type;
typedef value_type * iterator; typedef std::pair<key_type, mapped_type> value_type;
typedef value_type const * const_iterator; typedef Alloc allocator_type;
typedef value_type & reference; typedef value_type & reference;
typedef value_type const & const_reference; typedef value_type const & const_reference;
typedef value_type * pointer; typedef value_type * pointer;
typedef value_type const * const_pointer; typedef value_type const * const_pointer;
typedef ptrdiff_t difference_type; typedef value_type * iterator;
typedef size_t size_type; typedef value_type const * const_iterator;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
ACE_DECLARE_STL_REVERSE_ITERATORS ACE_DECLARE_STL_REVERSE_ITERATORS
/// Default Constructor. /// Default Constructor.
@@ -233,14 +243,16 @@ public:
* @par * @par
* map["Foo"] = 12; * map["Foo"] = 12;
*/ */
data_type & operator[] (key_type const & k); mapped_type & operator[] (key_type const & k);
allocator_type get_allocator() const { return alloc_; }
private: private:
/// Increase size of underlying buffer by @a s. /// Increase size of underlying buffer by @a s.
void grow (size_type s); void grow (size_type s);
private: /// The allocator.
allocator_type alloc_;
/// Number of elements in the map. /// Number of elements in the map.
size_type size_; size_type size_;
@@ -253,20 +265,19 @@ private:
/// Underlying array containing keys and data. /// Underlying array containing keys and data.
value_type * nodes_; value_type * nodes_;
}; };
// -------------------------------------------------------------- // --------------------------------------------------------------
/// @c ACE_Array_Map equality operator. /// @c ACE_Array_Map equality operator.
template <typename Key, typename Value, class EqualTo> template <typename Key, typename Value, class EqualTo, class Alloc>
bool operator== (ACE_Array_Map<Key, Value, EqualTo> const & lhs, bool operator== (ACE_Array_Map<Key, Value, EqualTo, Alloc> const & lhs,
ACE_Array_Map<Key, Value, EqualTo> const & rhs); ACE_Array_Map<Key, Value, EqualTo, Alloc> const & rhs);
/// @c ACE_Array_Map lexicographical comparison operator. /// @c ACE_Array_Map lexicographical comparison operator.
template <typename Key, typename Value, class EqualTo> template <typename Key, typename Value, class EqualTo, class Alloc>
bool operator< (ACE_Array_Map<Key, Value, EqualTo> const & lhs, bool operator< (ACE_Array_Map<Key, Value, EqualTo, Alloc> const & lhs,
ACE_Array_Map<Key, Value, EqualTo> const & rhs); ACE_Array_Map<Key, Value, EqualTo, Alloc> const & rhs);
// -------------------------------------------------------------- // --------------------------------------------------------------

View File

@@ -1,129 +1,130 @@
// -*- C++ -*- // -*- C++ -*-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE ACE_INLINE
ACE_Array_Map<Key, Value, EqualTo>::ACE_Array_Map ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::ACE_Array_Map (
typename ACE_Array_Map<Key, Value, EqualTo>::size_type s) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::size_type s)
: size_ (0) : size_ (0)
, capacity_ (s) , capacity_ (s)
, nodes_ (s == 0 ? 0 : new value_type[s]) , nodes_ (s == 0 ? 0 : this->alloc_.allocate (s))
{ {
std::uninitialized_fill_n (this->nodes_, s, value_type ());
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE ACE_Array_Map<Key, Value, EqualTo> & ACE_INLINE ACE_Array_Map<Key, Value, EqualTo, Alloc> &
ACE_Array_Map<Key, Value, EqualTo>::operator= ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::operator= (
ACE_Array_Map<Key, Value, EqualTo> const & map) ACE_Array_Map<Key, Value, EqualTo, Alloc> const & map)
{ {
// Strongly exception-safe assignment. // Strongly exception-safe assignment.
ACE_Array_Map<Key, Value, EqualTo> temp (map); ACE_Array_Map<Key, Value, EqualTo, Alloc> temp (map);
this->swap (temp); this->swap (temp);
return *this; return *this;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::iterator ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::iterator
ACE_Array_Map<Key, Value, EqualTo>::begin (void) ACE_Array_Map<Key, Value, EqualTo, Alloc>::begin (void)
{ {
return this->nodes_; return this->nodes_;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::iterator ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::iterator
ACE_Array_Map<Key, Value, EqualTo>::end (void) ACE_Array_Map<Key, Value, EqualTo, Alloc>::end (void)
{ {
return this->nodes_ + this->size_; return this->nodes_ + this->size_;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::const_iterator ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::const_iterator
ACE_Array_Map<Key, Value, EqualTo>::begin (void) const ACE_Array_Map<Key, Value, EqualTo, Alloc>::begin (void) const
{ {
return this->nodes_; return this->nodes_;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::const_iterator ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::const_iterator
ACE_Array_Map<Key, Value, EqualTo>::end (void) const ACE_Array_Map<Key, Value, EqualTo, Alloc>::end (void) const
{ {
return this->nodes_ + this->size_; return this->nodes_ + this->size_;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::reverse_iterator ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::reverse_iterator
ACE_Array_Map<Key, Value, EqualTo>::rbegin (void) ACE_Array_Map<Key, Value, EqualTo, Alloc>::rbegin (void)
{ {
return reverse_iterator (this->end ()); return reverse_iterator (this->end ());
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::reverse_iterator ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::reverse_iterator
ACE_Array_Map<Key, Value, EqualTo>::rend (void) ACE_Array_Map<Key, Value, EqualTo, Alloc>::rend (void)
{ {
return reverse_iterator (this->begin ()); return reverse_iterator (this->begin ());
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::const_reverse_iterator ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::const_reverse_iterator
ACE_Array_Map<Key, Value, EqualTo>::rbegin (void) const ACE_Array_Map<Key, Value, EqualTo, Alloc>::rbegin (void) const
{ {
return const_reverse_iterator (this->end ()); return const_reverse_iterator (this->end ());
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::const_reverse_iterator ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::const_reverse_iterator
ACE_Array_Map<Key, Value, EqualTo>::rend (void) const ACE_Array_Map<Key, Value, EqualTo, Alloc>::rend (void) const
{ {
return const_reverse_iterator (this->begin ()); return const_reverse_iterator (this->begin ());
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::size_type ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::size_type
ACE_Array_Map<Key, Value, EqualTo>::size (void) const ACE_Array_Map<Key, Value, EqualTo, Alloc>::size (void) const
{ {
return this->size_; return this->size_;
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::size_type ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::size_type
ACE_Array_Map<Key, Value, EqualTo>::max_size (void) const ACE_Array_Map<Key, Value, EqualTo, Alloc>::max_size (void) const
{ {
return size_type (-1) / sizeof (value_type); return size_type (-1) / sizeof (value_type);
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE bool ACE_INLINE bool
ACE_Array_Map<Key, Value, EqualTo>::is_empty (void) const ACE_Array_Map<Key, Value, EqualTo, Alloc>::is_empty (void) const
{ {
return this->size_ == 0; return this->size_ == 0;
} }
// The following method is deprecated. // The following method is deprecated.
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE bool ACE_INLINE bool
ACE_Array_Map<Key, Value, EqualTo>::empty (void) const ACE_Array_Map<Key, Value, EqualTo, Alloc>::empty (void) const
{ {
return this->is_empty (); return this->is_empty ();
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::size_type ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::size_type
ACE_Array_Map<Key, Value, EqualTo>::count ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::count (
typename ACE_Array_Map<Key, Value, EqualTo>::key_type const & k) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::key_type const & k)
{ {
return return
(this->find (k) == this->end () ? 0 : 1); // Only one datum per key. (this->find (k) == this->end () ? 0 : 1); // Only one datum per key.
} }
template<typename Key, typename Value, class EqualTo> template<typename Key, typename Value, class EqualTo, class Alloc>
ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo>::data_type & ACE_INLINE typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::mapped_type &
ACE_Array_Map<Key, Value, EqualTo>::operator[] ( ACE_Array_Map<Key, Value, EqualTo, Alloc>::operator[] (
typename ACE_Array_Map<Key, Value, EqualTo>::key_type const & k) typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::key_type const & k)
{ {
iterator i = (this->insert (value_type (k, data_type ()))).first; iterator i = (this->insert (value_type (k, mapped_type ()))).first;
return (*i).second; return (*i).second;
} }

View File

@@ -14,7 +14,12 @@ __ace_assert(const char *file, int line, const ACE_TCHAR *expression)
log->set (file, line, -1, error, log->restart (), log->set (file, line, -1, error, log->restart (),
log->msg_ostream (), log->msg_callback ()); log->msg_ostream (), log->msg_callback ());
log->log (LM_ERROR, ACE_TEXT ("ACE_ASSERT: file %N, line %l assertion failed for '%s'.%a\n"), expression, -1); #ifdef ACE_LACKS_VA_FUNCTIONS
#define LOG_ARGS
#else
#define LOG_ARGS(X) X
#endif
log->log LOG_ARGS ((LM_ERROR, ACE_TEXT ("ACE_ASSERT: file %N, line %l assertion failed for '%s'.%a\n"), expression, -1));
} }
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -4,7 +4,7 @@
/** /**
* @file Assert.h * @file Assert.h
* *
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//============================================================================= //=============================================================================

View File

@@ -171,7 +171,7 @@ public:
* another accept should be initiated. If the method returns a non-zero * another accept should be initiated. If the method returns a non-zero
* value, another accept is initiated. * value, another accept is initiated.
* *
* The default implemenation always returns the value passed as the * The default implementation always returns the value passed as the
* @c open() method's @a reissue_accept argument. That value can also * @c open() method's @a reissue_accept argument. That value can also
* be changed using the @c reissue_accept() method. * be changed using the @c reissue_accept() method.
*/ */

View File

@@ -143,7 +143,6 @@ protected:
virtual HANDLER *make_handler (void); virtual HANDLER *make_handler (void);
private: private:
/// Asynch_Connect used to make life easier :-) /// Asynch_Connect used to make life easier :-)
ACE_Asynch_Connect asynch_connect_; ACE_Asynch_Connect asynch_connect_;

View File

@@ -101,7 +101,6 @@ class ACE_Time_Value;
*/ */
class ACE_Export ACE_Asynch_Result class ACE_Export ACE_Asynch_Result
{ {
public: public:
/// Number of bytes transferred by the operation. /// Number of bytes transferred by the operation.
size_t bytes_transferred (void) const; size_t bytes_transferred (void) const;
@@ -198,7 +197,6 @@ class ACE_Asynch_Operation_Impl;
*/ */
class ACE_Export ACE_Asynch_Operation class ACE_Export ACE_Asynch_Operation
{ {
public: public:
/** /**
* Initializes the factory with information which will be used with * Initializes the factory with information which will be used with
@@ -288,7 +286,6 @@ class ACE_Asynch_Read_Stream_Impl;
*/ */
class ACE_Export ACE_Asynch_Read_Stream : public ACE_Asynch_Operation class ACE_Export ACE_Asynch_Read_Stream : public ACE_Asynch_Operation
{ {
public: public:
/// A do nothing constructor. /// A do nothing constructor.
ACE_Asynch_Read_Stream (void); ACE_Asynch_Read_Stream (void);
@@ -379,7 +376,6 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Result class ACE_Export Result : public ACE_Asynch_Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Read_Stream_Result; friend class ACE_POSIX_Asynch_Read_Stream_Result;
@@ -432,7 +428,6 @@ class ACE_Asynch_Write_Stream_Result_Impl;
*/ */
class ACE_Export ACE_Asynch_Write_Stream : public ACE_Asynch_Operation class ACE_Export ACE_Asynch_Write_Stream : public ACE_Asynch_Operation
{ {
public: public:
/// A do nothing constructor. /// A do nothing constructor.
ACE_Asynch_Write_Stream (void); ACE_Asynch_Write_Stream (void);
@@ -535,7 +530,6 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Result class ACE_Export Result : public ACE_Asynch_Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Write_Stream_Result; friend class ACE_POSIX_Asynch_Write_Stream_Result;
@@ -591,7 +585,6 @@ class ACE_Asynch_Read_File_Result_Impl;
*/ */
class ACE_Export ACE_Asynch_Read_File : public ACE_Asynch_Read_Stream class ACE_Export ACE_Asynch_Read_File : public ACE_Asynch_Read_Stream
{ {
public: public:
/// A do nothing constructor. /// A do nothing constructor.
ACE_Asynch_Read_File (void); ACE_Asynch_Read_File (void);
@@ -691,7 +684,6 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Read_Stream::Result class ACE_Export Result : public ACE_Asynch_Read_Stream::Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Read_File_Result; friend class ACE_POSIX_Asynch_Read_File_Result;
@@ -742,7 +734,6 @@ class ACE_Asynch_Write_File_Result_Impl;
*/ */
class ACE_Export ACE_Asynch_Write_File : public ACE_Asynch_Write_Stream class ACE_Export ACE_Asynch_Write_File : public ACE_Asynch_Write_Stream
{ {
public: public:
/// A do nothing constructor. /// A do nothing constructor.
ACE_Asynch_Write_File (void); ACE_Asynch_Write_File (void);
@@ -827,7 +818,6 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Write_Stream::Result class ACE_Export Result : public ACE_Asynch_Write_Stream::Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Write_File_Result; friend class ACE_POSIX_Asynch_Write_File_Result;
@@ -876,7 +866,6 @@ class ACE_Asynch_Accept_Impl;
*/ */
class ACE_Export ACE_Asynch_Accept : public ACE_Asynch_Operation class ACE_Export ACE_Asynch_Accept : public ACE_Asynch_Operation
{ {
public: public:
/// A do nothing constructor. /// A do nothing constructor.
ACE_Asynch_Accept (void); ACE_Asynch_Accept (void);
@@ -959,7 +948,6 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Result class ACE_Export Result : public ACE_Asynch_Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Accept_Result; friend class ACE_POSIX_Asynch_Accept_Result;
@@ -983,13 +971,13 @@ public:
ACE_Asynch_Accept_Result_Impl *implementation (void) const; ACE_Asynch_Accept_Result_Impl *implementation (void) const;
protected: protected:
/// Contructor. Implementation will not be deleted. /// Constructor. Implementation will not be deleted.
Result (ACE_Asynch_Accept_Result_Impl *implementation); Result (ACE_Asynch_Accept_Result_Impl *implementation);
/// Destructor. /// Destructor.
virtual ~Result (void); virtual ~Result (void);
/// Impelmentation class. /// Implementation class.
ACE_Asynch_Accept_Result_Impl *implementation_; ACE_Asynch_Accept_Result_Impl *implementation_;
}; };
private: private:
@@ -1013,7 +1001,6 @@ class ACE_Asynch_Connect_Impl;
*/ */
class ACE_Export ACE_Asynch_Connect : public ACE_Asynch_Operation class ACE_Export ACE_Asynch_Connect : public ACE_Asynch_Operation
{ {
public: public:
/// A do nothing constructor. /// A do nothing constructor.
ACE_Asynch_Connect (void); ACE_Asynch_Connect (void);
@@ -1065,7 +1052,6 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Result class ACE_Export Result : public ACE_Asynch_Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Connect_Result; friend class ACE_POSIX_Asynch_Connect_Result;
@@ -1080,13 +1066,13 @@ public:
ACE_Asynch_Connect_Result_Impl *implementation (void) const; ACE_Asynch_Connect_Result_Impl *implementation (void) const;
protected: protected:
/// Contructor. Implementation will not be deleted. /// Constructor. Implementation will not be deleted.
Result (ACE_Asynch_Connect_Result_Impl *implementation); Result (ACE_Asynch_Connect_Result_Impl *implementation);
/// Destructor. /// Destructor.
virtual ~Result (void); virtual ~Result (void);
/// Impelmentation class. /// Implementation class.
ACE_Asynch_Connect_Result_Impl *implementation_; ACE_Asynch_Connect_Result_Impl *implementation_;
}; };
private: private:
@@ -1118,7 +1104,6 @@ class ACE_Asynch_Transmit_File_Impl;
*/ */
class ACE_Export ACE_Asynch_Transmit_File : public ACE_Asynch_Operation class ACE_Export ACE_Asynch_Transmit_File : public ACE_Asynch_Operation
{ {
public: public:
// Forward declarations // Forward declarations
class Header_And_Trailer; class Header_And_Trailer;
@@ -1191,7 +1176,6 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Result class ACE_Export Result : public ACE_Asynch_Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Transmit_File_Result; friend class ACE_POSIX_Asynch_Transmit_File_Result;
@@ -1243,7 +1227,6 @@ public:
*/ */
class ACE_Export Header_And_Trailer class ACE_Export Header_And_Trailer
{ {
public: public:
/// Constructor. /// Constructor.
Header_And_Trailer (ACE_Message_Block *header = 0, Header_And_Trailer (ACE_Message_Block *header = 0,
@@ -1329,7 +1312,6 @@ class ACE_Addr;
*/ */
class ACE_Export ACE_Asynch_Read_Dgram : public ACE_Asynch_Operation class ACE_Export ACE_Asynch_Read_Dgram : public ACE_Asynch_Operation
{ {
public: public:
/// A do nothing constructor. /// A do nothing constructor.
ACE_Asynch_Read_Dgram (void); ACE_Asynch_Read_Dgram (void);
@@ -1404,14 +1386,12 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Result class ACE_Export Result : public ACE_Asynch_Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Read_Dgram_Result; friend class ACE_POSIX_Asynch_Read_Dgram_Result;
friend class ACE_WIN32_Asynch_Read_Dgram_Result; friend class ACE_WIN32_Asynch_Read_Dgram_Result;
public: public:
/// The number of bytes which were requested at the start of the /// The number of bytes which were requested at the start of the
/// asynchronous read. /// asynchronous read.
size_t bytes_to_read (void) const; size_t bytes_to_read (void) const;
@@ -1465,7 +1445,6 @@ class ACE_Asynch_Write_Dgram_Result_Impl;
*/ */
class ACE_Export ACE_Asynch_Write_Dgram : public ACE_Asynch_Operation class ACE_Export ACE_Asynch_Write_Dgram : public ACE_Asynch_Operation
{ {
public: public:
/// A do nothing constructor. /// A do nothing constructor.
ACE_Asynch_Write_Dgram (void); ACE_Asynch_Write_Dgram (void);
@@ -1540,14 +1519,12 @@ public:
*/ */
class ACE_Export Result : public ACE_Asynch_Result class ACE_Export Result : public ACE_Asynch_Result
{ {
/// The concrete implementation result classes only construct this /// The concrete implementation result classes only construct this
/// class. /// class.
friend class ACE_POSIX_Asynch_Write_Dgram_Result; friend class ACE_POSIX_Asynch_Write_Dgram_Result;
friend class ACE_WIN32_Asynch_Write_Dgram_Result; friend class ACE_WIN32_Asynch_Write_Dgram_Result;
public: public:
/// The number of bytes which were requested at the start of the /// The number of bytes which were requested at the start of the
/// asynchronous write. /// asynchronous write.
size_t bytes_to_write (void) const; size_t bytes_to_write (void) const;
@@ -1719,7 +1696,6 @@ class ACE_Asynch_Acceptor;
*/ */
class ACE_Export ACE_Service_Handler : public ACE_Handler class ACE_Export ACE_Service_Handler : public ACE_Handler
{ {
/// The Acceptor is the factory and therefore should have special /// The Acceptor is the factory and therefore should have special
/// privileges. /// privileges.
friend class ACE_Asynch_Acceptor<ACE_Service_Handler>; friend class ACE_Asynch_Acceptor<ACE_Service_Handler>;

View File

@@ -32,7 +32,7 @@ single_cpu_increment (volatile long *value)
(defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))))
return ace_atomic_add_long ( return ace_atomic_add_long (
reinterpret_cast<volatile unsigned long*> (value), 1); reinterpret_cast<volatile unsigned long*> (value), 1);
#elif defined(__GNUC__) && defined(PPC) #elif defined(__GNUC__) && defined(__PPC__)
long tmp; long tmp;
asm("lwz %0,%1" : "=r" (tmp) : "m" (*value) ); asm("lwz %0,%1" : "=r" (tmp) : "m" (*value) );
asm("addi %0,%0,1" : "+r" (tmp) ); asm("addi %0,%0,1" : "+r" (tmp) );
@@ -56,7 +56,7 @@ single_cpu_decrement (volatile long *value)
(defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))))
return ace_atomic_add_long ( return ace_atomic_add_long (
reinterpret_cast<volatile unsigned long*> (value), -1); reinterpret_cast<volatile unsigned long*> (value), -1);
#elif defined(__GNUC__) && defined(PPC) #elif defined(__GNUC__) && defined(__PPC__)
long tmp; long tmp;
asm("lwz %0,%1" : "=r" (tmp) : "m" (*value) ); asm("lwz %0,%1" : "=r" (tmp) : "m" (*value) );
asm("addi %0,%0,-1" : "+r" (tmp) ); asm("addi %0,%0,-1" : "+r" (tmp) );
@@ -79,7 +79,7 @@ single_cpu_exchange (volatile long *value, long rhs)
(defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))))
return ace_atomic_swap_long ( return ace_atomic_swap_long (
reinterpret_cast<volatile unsigned long*> (value), rhs); reinterpret_cast<volatile unsigned long*> (value), rhs);
#elif defined(__GNUC__) && defined(PPC) #elif defined(__GNUC__) && defined(__PPC__)
long tmp; long tmp;
asm("lwz %0,%1" : "=r" (tmp) : "m" (rhs) ); asm("lwz %0,%1" : "=r" (tmp) : "m" (rhs) );
asm("stw %0,%1" : "+r" (tmp), "=m" (*value) ); asm("stw %0,%1" : "+r" (tmp), "=m" (*value) );
@@ -102,7 +102,7 @@ single_cpu_exchange_add (volatile long *value, long rhs)
(defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))))
return ace_atomic_swap_add_long ( return ace_atomic_swap_add_long (
reinterpret_cast<volatile unsigned long*> (value), rhs); reinterpret_cast<volatile unsigned long*> (value), rhs);
#elif defined(__GNUC__) && defined(PPC) #elif defined(__GNUC__) && defined(__PPC__)
long tmp; long tmp;
asm("add %0,%1,%2" : "=r" (tmp) : "r" (*value), "r" (rhs) ); asm("add %0,%1,%2" : "=r" (tmp) : "r" (*value), "r" (rhs) );
asm("stw %0,%1" : "+r" (tmp), "=m" (*value) ); asm("stw %0,%1" : "+r" (tmp), "=m" (*value) );

View File

@@ -4,7 +4,7 @@
/** /**
* @file Atomic_Op.h * @file Atomic_Op.h
* *
* @author Douglas C. Schmidt <schmidt@uci.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//============================================================================= //=============================================================================
@@ -142,14 +142,12 @@ public:
static void init_functions (void); static void init_functions (void);
private: private:
/// This function cannot be supported by this template specialization. /// This function cannot be supported by this template specialization.
/// If you need access to an underlying lock, use the ACE_Atomic_Op_Ex /// If you need access to an underlying lock, use the ACE_Atomic_Op_Ex
/// template instead. /// template instead.
ACE_Thread_Mutex &mutex (void); ACE_Thread_Mutex &mutex (void);
private: private:
/// Current object decorated by the atomic op. /// Current object decorated by the atomic op.
volatile long value_; volatile long value_;
@@ -242,14 +240,12 @@ public:
static void init_functions (void); static void init_functions (void);
private: private:
/// This function cannot be supported by this template specialization. /// This function cannot be supported by this template specialization.
/// If you need access to an underlying lock, use the ACE_Atomic_Op_Ex /// If you need access to an underlying lock, use the ACE_Atomic_Op_Ex
/// template instead. /// template instead.
ACE_Thread_Mutex &mutex (void); ACE_Thread_Mutex &mutex (void);
private: private:
/// Current object decorated by the atomic op. /// Current object decorated by the atomic op.
volatile unsigned long value_; volatile unsigned long value_;

View File

@@ -104,14 +104,12 @@ protected:
ACE_Atomic_Op_GCC (const ACE_Atomic_Op_GCC<T> &c); ACE_Atomic_Op_GCC (const ACE_Atomic_Op_GCC<T> &c);
private: private:
// This function cannot be supported by this template specialization. // This function cannot be supported by this template specialization.
// If you need access to an underlying lock, use the ACE_Atomic_Op_Ex // If you need access to an underlying lock, use the ACE_Atomic_Op_Ex
// template instead. // template instead.
ACE_Thread_Mutex &mutex (void); ACE_Thread_Mutex &mutex (void);
private: private:
/// Current object decorated by the atomic op. /// Current object decorated by the atomic op.
volatile T value_; volatile T value_;
}; };

View File

@@ -7,6 +7,10 @@
# include "ace/Log_Category.h" # include "ace/Log_Category.h"
#endif /* ACE_HAS_DUMP */ #endif /* ACE_HAS_DUMP */
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
#if !defined (ACE_LACKS_PRAGMA_ONCE) #if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once # pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */ #endif /* ACE_LACKS_PRAGMA_ONCE */
@@ -17,8 +21,8 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Atomic_Op_Ex) ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Atomic_Op_Ex)
ACE_ALLOC_HOOK_DEFINE(ACE_Atomic_Op) ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Atomic_Op)
// ************************************************* // *************************************************
template <class ACE_LOCK, class TYPE> ACE_LOCK & template <class ACE_LOCK, class TYPE> ACE_LOCK &

View File

@@ -4,7 +4,7 @@
/** /**
* @file Atomic_Op_T.h * @file Atomic_Op_T.h
* *
* @author Douglas C. Schmidt <schmidt@uci.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//============================================================================= //=============================================================================
@@ -144,11 +144,8 @@ template <class ACE_LOCK, typename TYPE>
class ACE_Atomic_Op_Ex class ACE_Atomic_Op_Ex
{ {
public: public:
typedef typename ACE_Type_Traits<TYPE>::parameter_type arg_type; typedef typename ACE_Type_Traits<TYPE>::parameter_type arg_type;
// = Initialization methods.
/// Initialize @c value_ to 0. /// Initialize @c value_ to 0.
ACE_Atomic_Op_Ex (ACE_LOCK & mtx); ACE_Atomic_Op_Ex (ACE_LOCK & mtx);
@@ -209,8 +206,8 @@ public:
/// Dump the state of an object. /// Dump the state of an object.
void dump (void) const; void dump (void) const;
// ACE_ALLOC_HOOK_DECLARE; /// Declare the dynamic allocation hooks.
// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE;
/// Manage copying... /// Manage copying...
ACE_Atomic_Op_Ex (ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> const &); ACE_Atomic_Op_Ex (ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> const &);
@@ -259,7 +256,6 @@ template <class ACE_LOCK, typename TYPE>
class ACE_Atomic_Op class ACE_Atomic_Op
{ {
public: public:
typedef typename ACE_Type_Traits<TYPE>::parameter_type arg_type; typedef typename ACE_Type_Traits<TYPE>::parameter_type arg_type;
/// Initialize @c value_ to 0. /// Initialize @c value_ to 0.
@@ -323,6 +319,9 @@ public:
/// Dump the state of an object. /// Dump the state of an object.
void dump (void) const; void dump (void) const;
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
/** /**
* Explicitly return @c value_ (by reference). This gives the user * Explicitly return @c value_ (by reference). This gives the user
* full, unrestricted access to the underlying value. This method * full, unrestricted access to the underlying value. This method

View File

@@ -1,11 +1,54 @@
#include "ace/Auto_Event.h" #include "ace/Auto_Event.h"
#if !defined (__ACE_INLINE__) #if !defined (__ACE_INLINE__)
//#include "ace/Auto_Event.inl" #include "ace/Auto_Event.inl"
#endif /* __ACE_INLINE__ */ #endif /* __ACE_INLINE__ */
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Auto_Event_T)
template <class TIME_POLICY>
ACE_Auto_Event_T<TIME_POLICY>::ACE_Auto_Event_T (
int initial_state,
int type,
const char *name,
void *arg)
: ACE_Event_T<TIME_POLICY> (0,
initial_state,
type,
ACE_TEXT_CHAR_TO_TCHAR (name),
arg)
{
}
#if defined (ACE_HAS_WCHAR)
template <class TIME_POLICY>
ACE_Auto_Event_T<TIME_POLICY>::ACE_Auto_Event_T (
int initial_state,
int type,
const wchar_t *name,
void *arg)
: ACE_Event_T<TIME_POLICY> (0,
initial_state,
type,
ACE_TEXT_WCHAR_TO_TCHAR (name),
arg)
{
}
#endif /* ACE_HAS_WCHAR */
template <class TIME_POLICY>
void
ACE_Auto_Event_T<TIME_POLICY>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
ACE_Event_T<TIME_POLICY>::dump ();
#endif /* ACE_HAS_DUMP */
}
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -6,7 +6,7 @@
* *
* Moved from Synch.h. * Moved from Synch.h.
* *
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//========================================================================== //==========================================================================
@@ -42,40 +42,21 @@ public:
ACE_Auto_Event_T (int initial_state = 0, ACE_Auto_Event_T (int initial_state = 0,
int type = USYNC_THREAD, int type = USYNC_THREAD,
const char *name = 0, const char *name = 0,
void *arg = 0) : ACE_Event_T<TIME_POLICY> (0, void *arg = 0);
initial_state,
type,
ACE_TEXT_CHAR_TO_TCHAR (name),
arg)
{
}
#if defined (ACE_HAS_WCHAR) #if defined (ACE_HAS_WCHAR)
/// Constructor which will create auto event (wchar_t version) /// Constructor which will create auto event (wchar_t version)
ACE_Auto_Event_T (int initial_state, ACE_Auto_Event_T (int initial_state,
int type, int type,
const wchar_t *name, const wchar_t *name,
void *arg = 0) : ACE_Event_T<TIME_POLICY> (0, void *arg = 0);
initial_state,
type,
ACE_TEXT_WCHAR_TO_TCHAR (name),
arg)
{
}
#endif /* ACE_HAS_WCHAR */ #endif /* ACE_HAS_WCHAR */
/// Default dtor. /// Default dtor.
virtual ~ACE_Auto_Event_T (void) virtual ~ACE_Auto_Event_T (void);
{
}
/// Dump the state of an object. /// Dump the state of an object.
void dump (void) const void dump (void) const;
{
#if defined (ACE_HAS_DUMP)
ACE_Event_T<TIME_POLICY>::dump ();
#endif /* ACE_HAS_DUMP */
}
/// Declare the dynamic allocation hooks /// Declare the dynamic allocation hooks
ACE_ALLOC_HOOK_DECLARE; ACE_ALLOC_HOOK_DECLARE;

View File

@@ -1,4 +1,10 @@
// -*- C++ -*- // -*- C++ -*-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template <class TIME_POLICY>
ACE_INLINE
ACE_Auto_Event_T<TIME_POLICY>::~ACE_Auto_Event_T (void)
{
}
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -12,9 +12,13 @@
#include "ace/Auto_IncDec_T.inl" #include "ace/Auto_IncDec_T.inl"
#endif /* __ACE_INLINE__ */ #endif /* __ACE_INLINE__ */
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Auto_IncDec) ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Auto_IncDec)
template <class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE> void template <class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE> void
ACE_Auto_IncDec<ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>::dump (void) const ACE_Auto_IncDec<ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>::dump (void) const

View File

@@ -48,6 +48,9 @@ public:
/// Dump the state of an object. /// Dump the state of an object.
void dump (void) const; void dump (void) const;
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
protected: protected:
/// Reference to the @c ACE_SAFELY_INCREMENTABLE_DECREMENTABLE counter /// Reference to the @c ACE_SAFELY_INCREMENTABLE_DECREMENTABLE counter
/// we're incrementing/decrementing. /// we're incrementing/decrementing.

View File

@@ -3,16 +3,18 @@
#include "ace/Auto_Ptr.h" #include "ace/Auto_Ptr.h"
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
#if !defined (__ACE_INLINE__) #if !defined (__ACE_INLINE__)
#include "ace/Auto_Ptr.inl" #include "ace/Auto_Ptr.inl"
#endif /* __ACE_INLINE__ */ #endif /* __ACE_INLINE__ */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Auto_Basic_Ptr) ACE_ALLOC_HOOK_DEFINE_Tt(ACE_Auto_Basic_Ptr)
ACE_ALLOC_HOOK_DEFINE(ACE_Auto_Basic_Array_Ptr) ACE_ALLOC_HOOK_DEFINE_Tt(ACE_Auto_Basic_Array_Ptr)
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -4,7 +4,7 @@
/** /**
* @file Auto_Ptr.h * @file Auto_Ptr.h
* *
* @author Doug Schmidt <schmidt@uci.edu> * @author Doug Schmidt <d.schmidt@vanderbilt.edu>
* @author Irfan Pyarali <irfan@cs.wustl.edu> * @author Irfan Pyarali <irfan@cs.wustl.edu>
* @author Jack Reeves <jack@fx.com> * @author Jack Reeves <jack@fx.com>
* @author Dr. Harald M. Mueller <mueller@garwein.hai.siemens.co.at> * @author Dr. Harald M. Mueller <mueller@garwein.hai.siemens.co.at>
@@ -30,7 +30,6 @@
# pragma warning(disable: 4284) # pragma warning(disable: 4284)
#endif /* _MSC_VER */ #endif /* _MSC_VER */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/** /**
@@ -45,7 +44,6 @@ class ACE_Auto_Basic_Ptr
public: public:
typedef X element_type; typedef X element_type;
// = Initialization and termination methods
explicit ACE_Auto_Basic_Ptr (X * p = 0) : p_ (p) {} explicit ACE_Auto_Basic_Ptr (X * p = 0) : p_ (p) {}
ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr<X> & ap); ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr<X> & ap);
@@ -70,12 +68,21 @@ protected:
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (ACE_HAS_CPP17)
// C++17 has removed std::auto_ptr but this is heavily used
// in ACE and TAO tests so for the moment we are providing
// our own auto_ptr implementation
# define ACE_LACKS_AUTO_PTR
# include <memory>
#endif /* ACE_HAS_CPP17 */
#if !defined (ACE_LACKS_AUTO_PTR) && \ #if !defined (ACE_LACKS_AUTO_PTR) && \
defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \ defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \
(ACE_HAS_STANDARD_CPP_LIBRARY != 0) (ACE_HAS_STANDARD_CPP_LIBRARY != 0)
#include <memory> #include <memory>
#if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) && \ #if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) && \
(ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0) (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0)
using std::auto_ptr;
#endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ #endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */
#else /* ACE_HAS_STANDARD_CPP_LIBRARY */ #else /* ACE_HAS_STANDARD_CPP_LIBRARY */
@@ -90,7 +97,6 @@ class auto_ptr : public ACE_Auto_Basic_Ptr<X>
public: public:
typedef X element_type; typedef X element_type;
// = Initialization and termination methods
explicit auto_ptr (X * p = 0) : ACE_Auto_Basic_Ptr<X> (p) {} explicit auto_ptr (X * p = 0) : ACE_Auto_Basic_Ptr<X> (p) {}
auto_ptr (auto_ptr<X> & ap) : ACE_Auto_Basic_Ptr<X> (ap.release ()) {} auto_ptr (auto_ptr<X> & ap) : ACE_Auto_Basic_Ptr<X> (ap.release ()) {}
@@ -111,7 +117,6 @@ class ACE_Auto_Ptr : public ACE_Auto_Basic_Ptr <X>
public: public:
typedef X element_type; typedef X element_type;
// = Initialization and termination methods
explicit ACE_Auto_Ptr (X * p = 0) : ACE_Auto_Basic_Ptr<X> (p) {} explicit ACE_Auto_Ptr (X * p = 0) : ACE_Auto_Basic_Ptr<X> (p) {}
X *operator-> () const; X *operator-> () const;
@@ -131,7 +136,6 @@ class ACE_Auto_Basic_Array_Ptr
public: public:
typedef X element_type; typedef X element_type;
// = Initialization and termination methods.
explicit ACE_Auto_Basic_Array_Ptr (X * p = 0) : p_ (p) {} explicit ACE_Auto_Basic_Array_Ptr (X * p = 0) : p_ (p) {}
ACE_Auto_Basic_Array_Ptr (ACE_Auto_Basic_Array_Ptr<X> & ap); ACE_Auto_Basic_Array_Ptr (ACE_Auto_Basic_Array_Ptr<X> & ap);
@@ -167,7 +171,6 @@ class ACE_Auto_Array_Ptr : public ACE_Auto_Basic_Array_Ptr<X>
public: public:
typedef X element_type; typedef X element_type;
// = Initialization and termination methods.
explicit ACE_Auto_Array_Ptr (X *p = 0) explicit ACE_Auto_Array_Ptr (X *p = 0)
: ACE_Auto_Basic_Array_Ptr<X> (p) {} : ACE_Auto_Basic_Array_Ptr<X> (p) {}

View File

@@ -1,6 +1,10 @@
// -*- C++ -*- // -*- C++ -*-
#include "ace/Global_Macros.h" #include "ace/Global_Macros.h"
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template<class X> ACE_INLINE void template<class X> ACE_INLINE void
@@ -117,7 +121,12 @@ ACE_Auto_Basic_Array_Ptr<X>::reset (X *p)
{ {
ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::reset"); ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::reset");
if (this->get () != p) if (this->get () != p)
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free(this->get ());
#else
delete [] this->get (); delete [] this->get ();
#endif /* ACE_HAS_ALLOC_HOOKS */
this->p_ = p; this->p_ = p;
} }
@@ -143,7 +152,11 @@ template<class X> ACE_INLINE
ACE_Auto_Basic_Array_Ptr<X>::~ACE_Auto_Basic_Array_Ptr (void) ACE_Auto_Basic_Array_Ptr<X>::~ACE_Auto_Basic_Array_Ptr (void)
{ {
ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::~ACE_Auto_Basic_Array_Ptr"); ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::~ACE_Auto_Basic_Array_Ptr");
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free(this->get ());
#else
delete [] this->get (); delete [] this->get ();
#endif /* ACE_HAS_ALLOC_HOOKS */
} }
template<class X> ACE_INLINE X & template<class X> ACE_INLINE X &

View File

@@ -9,6 +9,10 @@
#include "ace/Guard_T.h" #include "ace/Guard_T.h"
#include "ace/OS_NS_errno.h" #include "ace/OS_NS_errno.h"
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
#if defined (ACE_HAS_DUMP) #if defined (ACE_HAS_DUMP)
# include "ace/Log_Category.h" # include "ace/Log_Category.h"
#endif /* ACE_HAS_DUMP */ #endif /* ACE_HAS_DUMP */

View File

@@ -6,7 +6,7 @@
* *
* Moved from Synch.h. * Moved from Synch.h.
* *
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu> * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
*/ */
//========================================================================== //==========================================================================

View File

@@ -87,7 +87,6 @@ class ACE_Service_Gestalt;
class ACE_Export ACE_Base_Thread_Adapter class ACE_Export ACE_Base_Thread_Adapter
{ {
public: public:
virtual ~ACE_Base_Thread_Adapter (void); virtual ~ACE_Base_Thread_Adapter (void);
/// Virtual method invoked by the thread entry point. /// Virtual method invoked by the thread entry point.

View File

@@ -5,6 +5,10 @@
#include "ace/Synch_Traits.h" #include "ace/Synch_Traits.h"
#include "ace/RW_Thread_Mutex.h" #include "ace/RW_Thread_Mutex.h"
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/** /**
@@ -30,8 +34,12 @@ public:
/// Synchronize concurrent access to the map. /// Synchronize concurrent access to the map.
ACE_SYNCH_MUTEX lock_; ACE_SYNCH_MUTEX lock_;
ACE_ALLOC_HOOK_DECLARE;
}; };
ACE_ALLOC_HOOK_DEFINE(ACE_Based_Pointer_Repository_Rep);
ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository (void) ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository (void)
{ {
ACE_TRACE ("ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository"); ACE_TRACE ("ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository");

View File

@@ -41,7 +41,6 @@ class ACE_Export ACE_Based_Pointer_Repository
public: public:
// = Use ACE_Null_Mutex to allow locking while iterating. // = Use ACE_Null_Mutex to allow locking while iterating.
// = Initialization and termination methods.
ACE_Based_Pointer_Repository (void); ACE_Based_Pointer_Repository (void);
~ACE_Based_Pointer_Repository (void); ~ACE_Based_Pointer_Repository (void);
@@ -64,7 +63,6 @@ public:
int unbind (void *addr); int unbind (void *addr);
private: private:
/// Use the "Cheshire-Cat" technique to hide the implementation in /// Use the "Cheshire-Cat" technique to hide the implementation in
/// order to avoid circular #include dependencies. /// order to avoid circular #include dependencies.
ACE_Based_Pointer_Repository_Rep *rep_; ACE_Based_Pointer_Repository_Rep *rep_;

View File

@@ -13,6 +13,8 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Based_Pointer_Basic)
template <class CONCRETE> template <class CONCRETE>
ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (void) ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (void)
{ {

View File

@@ -157,7 +157,6 @@ template <class CONCRETE>
class ACE_Based_Pointer : public ACE_Based_Pointer_Basic<CONCRETE> class ACE_Based_Pointer : public ACE_Based_Pointer_Basic<CONCRETE>
{ {
public: public:
// = Initialization method.
/// Constructor. See constructor for ACE_Based_Pointer_Basic for /// Constructor. See constructor for ACE_Based_Pointer_Basic for
/// details. /// details.
ACE_Based_Pointer (void); ACE_Based_Pointer (void);

View File

@@ -29,8 +29,8 @@
* - ACE_UINT16 * - ACE_UINT16
* - ACE_INT32 * - ACE_INT32
* - ACE_UINT32 * - ACE_UINT32
* - ACE_UINT64
* - ACE_INT64 * - ACE_INT64
* - ACE_UINT64
* *
* Byte-order (endian-ness) determination: * Byte-order (endian-ness) determination:
* ACE_BYTE_ORDER, to either ACE_BIG_ENDIAN or ACE_LITTLE_ENDIAN * ACE_BYTE_ORDER, to either ACE_BIG_ENDIAN or ACE_LITTLE_ENDIAN
@@ -70,6 +70,17 @@
# include <inttypes.h> # include <inttypes.h>
# endif # endif
# if defined (ACE_HAS_CPP11)
# define ACE_HAS_INT8_T
# define ACE_HAS_UINT8_T
# define ACE_HAS_INT16_T
# define ACE_HAS_UINT16_T
# define ACE_HAS_INT32_T
# define ACE_HAS_UINT32_T
# define ACE_HAS_INT64_T
# define ACE_HAS_UINT64_T
# endif /* ACE_HAS_CPP11 */
#ifdef ACE_LACKS_INTPTR_T #ifdef ACE_LACKS_INTPTR_T
# include "ace/If_Then_Else.h" # include "ace/If_Then_Else.h"
@@ -208,28 +219,28 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// typedefs for whatever we can. Some of these are needed for certain // typedefs for whatever we can. Some of these are needed for certain
// cases of ACE_UINT64, so do them before the 64-bit stuff. // cases of ACE_UINT64, so do them before the 64-bit stuff.
#if defined (ACE_INT8_TYPE) #if defined (ACE_HAS_INT8_T)
typedef ACE_INT8_TYPE ACE_INT8;
#elif defined (ACE_HAS_INT8_T)
typedef int8_t ACE_INT8; typedef int8_t ACE_INT8;
#elif defined (ACE_INT8_TYPE)
typedef ACE_INT8_TYPE ACE_INT8;
#elif !defined (ACE_LACKS_SIGNED_CHAR) #elif !defined (ACE_LACKS_SIGNED_CHAR)
typedef signed char ACE_INT8; typedef signed char ACE_INT8;
#else #else
typedef char ACE_INT8; typedef char ACE_INT8;
#endif /* defined (ACE_INT8_TYPE) */ #endif /* defined (ACE_INT8_TYPE) */
#if defined (ACE_UINT8_TYPE) #if defined (ACE_HAS_UINT8_T)
typedef ACE_UINT8_TYPE ACE_UINT8;
#elif defined (ACE_HAS_UINT8_T)
typedef uint8_t ACE_UINT8; typedef uint8_t ACE_UINT8;
#elif defined (ACE_UINT8_TYPE)
typedef ACE_UINT8_TYPE ACE_UINT8;
#else #else
typedef unsigned char ACE_UINT8; typedef unsigned char ACE_UINT8;
#endif /* defined (ACE_UINT8_TYPE) */ #endif /* defined (ACE_UINT8_TYPE) */
#if defined (ACE_INT16_TYPE) #if defined (ACE_HAS_INT16_T)
typedef ACE_INT16_TYPE ACE_INT16;
#elif defined (ACE_HAS_INT16_T)
typedef int16_t ACE_INT16; typedef int16_t ACE_INT16;
#elif defined (ACE_INT16_TYPE)
typedef ACE_INT16_TYPE ACE_INT16;
#elif ACE_SIZEOF_SHORT == 2 #elif ACE_SIZEOF_SHORT == 2
typedef short ACE_INT16; typedef short ACE_INT16;
#elif ACE_SIZEOF_INT == 2 #elif ACE_SIZEOF_INT == 2
@@ -238,10 +249,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
# error Have to add to the ACE_INT16 type setting # error Have to add to the ACE_INT16 type setting
#endif /* defined (ACE_INT16_TYPE) */ #endif /* defined (ACE_INT16_TYPE) */
#if defined (ACE_UINT16_TYPE) #if defined (ACE_HAS_UINT16_T)
typedef ACE_UINT16_TYPE ACE_UINT16;
#elif defined (ACE_HAS_UINT16_T)
typedef uint16_t ACE_UINT16; typedef uint16_t ACE_UINT16;
#elif defined (ACE_UINT16_TYPE)
typedef ACE_UINT16_TYPE ACE_UINT16;
#elif ACE_SIZEOF_SHORT == 2 #elif ACE_SIZEOF_SHORT == 2
typedef unsigned short ACE_UINT16; typedef unsigned short ACE_UINT16;
#elif ACE_SIZEOF_INT == 2 #elif ACE_SIZEOF_INT == 2
@@ -250,10 +261,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
# error Have to add to the ACE_UINT16 type setting # error Have to add to the ACE_UINT16 type setting
#endif /* defined (ACE_UINT16_TYPE) */ #endif /* defined (ACE_UINT16_TYPE) */
#if defined (ACE_INT32_TYPE) #if defined (ACE_HAS_INT32_T)
typedef ACE_INT32_TYPE ACE_INT32;
#elif defined (ACE_HAS_INT32_T)
typedef int32_t ACE_INT32; typedef int32_t ACE_INT32;
#elif defined (ACE_INT32_TYPE)
typedef ACE_INT32_TYPE ACE_INT32;
#elif ACE_SIZEOF_INT == 4 #elif ACE_SIZEOF_INT == 4
typedef int ACE_INT32; typedef int ACE_INT32;
#elif ACE_SIZEOF_LONG == 4 #elif ACE_SIZEOF_LONG == 4
@@ -262,10 +273,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
# error Have to add to the ACE_INT32 type setting # error Have to add to the ACE_INT32 type setting
#endif /* defined (ACE_INT32_TYPE) */ #endif /* defined (ACE_INT32_TYPE) */
#if defined (ACE_UINT32_TYPE) #if defined (ACE_HAS_UINT32_T)
typedef ACE_UINT32_TYPE ACE_UINT32;
#elif defined (ACE_HAS_UINT32_T)
typedef uint32_t ACE_UINT32; typedef uint32_t ACE_UINT32;
#elif defined (ACE_UINT32_TYPE)
typedef ACE_UINT32_TYPE ACE_UINT32;
#elif ACE_SIZEOF_INT == 4 #elif ACE_SIZEOF_INT == 4
typedef unsigned int ACE_UINT32; typedef unsigned int ACE_UINT32;
#elif ACE_SIZEOF_LONG == 4 #elif ACE_SIZEOF_LONG == 4
@@ -274,10 +285,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
# error Have to add to the ACE_UINT32 type setting # error Have to add to the ACE_UINT32 type setting
#endif /* defined (ACE_UINT32_TYPE) */ #endif /* defined (ACE_UINT32_TYPE) */
#if defined (ACE_INT64_TYPE) #if defined (ACE_HAS_INT64_T)
typedef ACE_INT64_TYPE ACE_INT64;
#elif defined (ACE_HAS_INT64_T)
typedef int64_t ACE_INT64; typedef int64_t ACE_INT64;
#elif defined (ACE_INT64_TYPE)
typedef ACE_INT64_TYPE ACE_INT64;
#elif ACE_SIZEOF_LONG == 8 #elif ACE_SIZEOF_LONG == 8
typedef long ACE_INT64; typedef long ACE_INT64;
#elif ACE_SIZEOF_LONG_LONG == 8 #elif ACE_SIZEOF_LONG_LONG == 8
@@ -289,10 +300,10 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
typedef long long ACE_INT64; typedef long long ACE_INT64;
#endif /* defined (ACE_INT64_TYPE) */ #endif /* defined (ACE_INT64_TYPE) */
#if defined (ACE_UINT64_TYPE) #if defined (ACE_HAS_UINT64_T)
typedef ACE_UINT64_TYPE ACE_UINT64;
#elif defined (ACE_HAS_UINT64_T)
typedef uint64_t ACE_UINT64; typedef uint64_t ACE_UINT64;
#elif defined (ACE_UINT64_TYPE)
typedef ACE_UINT64_TYPE ACE_UINT64;
#elif ACE_SIZEOF_LONG == 8 #elif ACE_SIZEOF_LONG == 8
typedef unsigned long ACE_UINT64; typedef unsigned long ACE_UINT64;
#elif ACE_SIZEOF_LONG_LONG == 8 #elif ACE_SIZEOF_LONG_LONG == 8
@@ -393,8 +404,14 @@ ACE_END_VERSIONED_NAMESPACE_DECL
# define ACE_IDL_NSTOHL(X) ((X) << 16) # define ACE_IDL_NSTOHL(X) ((X) << 16)
# endif /* ACE_LITTLE_ENDIAN */ # endif /* ACE_LITTLE_ENDIAN */
#define ACE_HTONS(x) htons(x) // MQX doesn't define these macros correctly.
#define ACE_NTOHS(x) ntohs(x) # if defined (ACE_LITTLE_ENDIAN) && defined (ACE_MQX)
# define ACE_HTONS(x) x
# define ACE_NTOHS(x) x
# else
# define ACE_HTONS(x) htons(x)
# define ACE_NTOHS(x) ntohs(x)
# endif
# define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \ # define ACE_LONGLONG_TO_PTR(PTR_TYPE, L) \
reinterpret_cast<PTR_TYPE> (static_cast<intptr_t> (L)) reinterpret_cast<PTR_TYPE> (static_cast<intptr_t> (L))
@@ -423,9 +440,6 @@ ACE_END_VERSIONED_NAMESPACE_DECL
# define ACE_UINT64_LITERAL(n) n ## ui64 # define ACE_UINT64_LITERAL(n) n ## ui64
# define ACE_INT64_LITERAL(n) n ## i64 # define ACE_INT64_LITERAL(n) n ## i64
# endif /* defined (__MINGW32__) */ # endif /* defined (__MINGW32__) */
#elif defined (__TANDEM)
# define ACE_UINT64_LITERAL(n) n ## LL
# define ACE_INT64_LITERAL(n) n ## LL
#else /* ! ACE_WIN32 */ #else /* ! ACE_WIN32 */
# define ACE_UINT64_LITERAL(n) n ## ull # define ACE_UINT64_LITERAL(n) n ## ull
# define ACE_INT64_LITERAL(n) n ## ll # define ACE_INT64_LITERAL(n) n ## ll

17
deps/acelite/ace/Bound_Ptr.cpp vendored Normal file
View File

@@ -0,0 +1,17 @@
/* -*- C++ -*- */
#ifndef ACE_BOUND_PTR_CPP
#define ACE_BOUND_PTR_CPP
#include "ace/Bound_Ptr.h"
#if !defined (__ACE_INLINE__)
#include "ace/Bound_Ptr.inl"
#endif /* __ACE_INLINE__ */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Bound_Ptr_Counter)
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_BOUND_PTR_CPP */

View File

@@ -20,7 +20,9 @@
# pragma once # pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */ #endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Auto_Ptr.h" #if !defined (ACE_HAS_CPP11)
# include "ace/Auto_Ptr.h"
#endif /* !ACE_HAS_CPP11 */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -72,13 +74,11 @@ public:
static bool object_was_deleted (ACE_Bound_Ptr_Counter<ACE_LOCK> *counter); static bool object_was_deleted (ACE_Bound_Ptr_Counter<ACE_LOCK> *counter);
private: private:
/// Allocate a new ACE_Bound_Ptr_Counter<ACE_LOCK> instance, /// Allocate a new ACE_Bound_Ptr_Counter<ACE_LOCK> instance,
/// returning NULL if it cannot be created. /// returning NULL if it cannot be created.
static ACE_Bound_Ptr_Counter<ACE_LOCK> *internal_create (long init_obj_ref_count); static ACE_Bound_Ptr_Counter<ACE_LOCK> *internal_create (long init_obj_ref_count);
private: private:
/// Reference count of underlying object. Is set to -1 once the /// Reference count of underlying object. Is set to -1 once the
/// object has been destroyed to indicate to all weak pointers that /// object has been destroyed to indicate to all weak pointers that
/// it is no longer valid. /// it is no longer valid.
@@ -114,9 +114,11 @@ public:
/// object \<p\> immediately. /// object \<p\> immediately.
explicit ACE_Strong_Bound_Ptr (X *p = 0); explicit ACE_Strong_Bound_Ptr (X *p = 0);
#if !defined (ACE_HAS_CPP11)
/// Constructor that initializes an ACE_Strong_Bound_Ptr by stealing /// Constructor that initializes an ACE_Strong_Bound_Ptr by stealing
/// ownership of an object from an auto_ptr. /// ownership of an object from an auto_ptr.
explicit ACE_Strong_Bound_Ptr (std::unique_ptr<X> p); explicit ACE_Strong_Bound_Ptr (auto_ptr<X> p);
#endif /* !ACE_HAS_CPP11 */
/// Copy constructor binds @c this and @a r to the same object. /// Copy constructor binds @c this and @a r to the same object.
ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr<X, ACE_LOCK> &r); ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr<X, ACE_LOCK> &r);
@@ -214,10 +216,12 @@ public:
/// underlying object. /// underlying object.
void reset (X *p = 0); void reset (X *p = 0);
#if !defined (ACE_HAS_CPP11)
/// Resets the ACE_Strong_Bound_Ptr to refer to a different /// Resets the ACE_Strong_Bound_Ptr to refer to a different
/// underlying object, ownership of which is stolen from the /// underlying object, ownership of which is stolen from the
/// auto_ptr. /// auto_ptr.
void reset (std::unique_ptr<X> p); void reset (auto_ptr<X> p);
#endif /* !ACE_HAS_CPP11 */
/// Allows us to check for NULL on all ACE_Strong_Bound_Ptr /// Allows us to check for NULL on all ACE_Strong_Bound_Ptr
/// objects. /// objects.
@@ -379,7 +383,17 @@ private:
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/Bound_Ptr.inl" #include "ace/Bound_Ptr.inl"
#endif /* __ACE_INLINE__ */
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "ace/Bound_Ptr.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
#pragma implementation ("Bound_Ptr.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
#include /**/ "ace/post.h" #include /**/ "ace/post.h"

View File

@@ -1,6 +1,4 @@
/* -*- C++ -*- */ /* -*- C++ -*- */
// Bound_Ptr.i
#include "ace/Guard_T.h" #include "ace/Guard_T.h"
#if !defined (ACE_NEW_THROWS_EXCEPTIONS) #if !defined (ACE_NEW_THROWS_EXCEPTIONS)
# include "ace/Log_Category.h" # include "ace/Log_Category.h"
@@ -148,12 +146,14 @@ ACE_Strong_Bound_Ptr<X, ACE_LOCK>::ACE_Strong_Bound_Ptr (X *p)
{ {
} }
#if !defined (ACE_HAS_CPP11)
template <class X, class ACE_LOCK> inline template <class X, class ACE_LOCK> inline
ACE_Strong_Bound_Ptr<X, ACE_LOCK>::ACE_Strong_Bound_Ptr (std::unique_ptr<X> p) ACE_Strong_Bound_Ptr<X, ACE_LOCK>::ACE_Strong_Bound_Ptr (auto_ptr<X> p)
: counter_ (COUNTER::create_strong ()), : counter_ (COUNTER::create_strong ()),
ptr_ (p.release()) ptr_ (p.release())
{ {
} }
#endif /* !ACE_HAS_CPP11 */
template <class X, class ACE_LOCK> inline template <class X, class ACE_LOCK> inline
ACE_Strong_Bound_Ptr<X, ACE_LOCK>::ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr<X, ACE_LOCK> &r) ACE_Strong_Bound_Ptr<X, ACE_LOCK>::ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr<X, ACE_LOCK> &r)
@@ -303,8 +303,9 @@ ACE_Strong_Bound_Ptr<X, ACE_LOCK>::reset (X *p)
delete old_ptr; delete old_ptr;
} }
#if !defined (ACE_HAS_CPP11)
template<class X, class ACE_LOCK> inline void template<class X, class ACE_LOCK> inline void
ACE_Strong_Bound_Ptr<X, ACE_LOCK>::reset(std::unique_ptr<X> p) ACE_Strong_Bound_Ptr<X, ACE_LOCK>::reset (auto_ptr<X> p)
{ {
COUNTER *old_counter = this->counter_; COUNTER *old_counter = this->counter_;
X_t *old_ptr = this->ptr_; X_t *old_ptr = this->ptr_;
@@ -313,6 +314,7 @@ ACE_Strong_Bound_Ptr<X, ACE_LOCK>::reset(std::unique_ptr<X> p)
if (COUNTER::detach_strong (old_counter) == 0) if (COUNTER::detach_strong (old_counter) == 0)
delete old_ptr; delete old_ptr;
} }
#endif /* !ACE_HAS_CPP11 */
template <class X, class ACE_LOCK> inline template <class X, class ACE_LOCK> inline
ACE_Weak_Bound_Ptr<X, ACE_LOCK>::ACE_Weak_Bound_Ptr (X *p) ACE_Weak_Bound_Ptr<X, ACE_LOCK>::ACE_Weak_Bound_Ptr (X *p)

View File

@@ -52,7 +52,7 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n)
} }
#else #else
char const * const o4 = ACE_ptr_align_binary (orig, 4); char const * const o4 = ACE_ptr_align_binary (orig, 4);
// this is an _if_, not a _while_. The mistmatch can only be by 2. // this is an _if_, not a _while_. The mismatch can only be by 2.
if (orig != o4) if (orig != o4)
{ {
ACE_CDR::swap_2 (orig, target); ACE_CDR::swap_2 (orig, target);
@@ -74,7 +74,7 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n)
// end marks our barrier for not falling outside. // end marks our barrier for not falling outside.
char const * const end = orig + 2 * (n & (~3)); char const * const end = orig + 2 * (n & (~3));
// See if we're aligned for writting in 64 or 32 bit chunks... // See if we're aligned for writing in 64 or 32 bit chunks...
#if ACE_SIZEOF_LONG == 8 && \ #if ACE_SIZEOF_LONG == 8 && \
!((defined(__amd64__) || defined (__x86_64__)) && defined(__GNUG__)) !((defined(__amd64__) || defined (__x86_64__)) && defined(__GNUG__))
if (target == ACE_ptr_align_binary (target, 8)) if (target == ACE_ptr_align_binary (target, 8))
@@ -110,25 +110,22 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n)
__asm mov 4[edx], ebx; __asm mov 4[edx], ebx;
#elif ACE_SIZEOF_LONG == 8 #elif ACE_SIZEOF_LONG == 8
// 64 bit architecture. // 64 bit architecture.
ACE_REGISTER unsigned long a = unsigned long a = * reinterpret_cast<const unsigned long*> (orig);
* reinterpret_cast<const unsigned long*> (orig);
ACE_REGISTER unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8;
ACE_REGISTER unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8;
a = (a1 | a2); a = (a1 | a2);
* reinterpret_cast<unsigned long*> (target) = a; * reinterpret_cast<unsigned long*> (target) = a;
#else #else
ACE_REGISTER ACE_UINT32 a = ACE_UINT32 a = * reinterpret_cast<const ACE_UINT32*> (orig);
* reinterpret_cast<const ACE_UINT32*> (orig); ACE_UINT32 b = * reinterpret_cast<const ACE_UINT32*> (orig + 4);
ACE_REGISTER ACE_UINT32 b =
* reinterpret_cast<const ACE_UINT32*> (orig + 4);
ACE_REGISTER ACE_UINT32 a1 = (a & 0x00ff00ffU) << 8; ACE_UINT32 a1 = (a & 0x00ff00ffU) << 8;
ACE_REGISTER ACE_UINT32 b1 = (b & 0x00ff00ffU) << 8; ACE_UINT32 b1 = (b & 0x00ff00ffU) << 8;
ACE_REGISTER ACE_UINT32 a2 = (a & 0xff00ff00U) >> 8; ACE_UINT32 a2 = (a & 0xff00ff00U) >> 8;
ACE_REGISTER ACE_UINT32 b2 = (b & 0xff00ff00U) >> 8; ACE_UINT32 b2 = (b & 0xff00ff00U) >> 8;
a = (a1 | a2); a = (a1 | a2);
b = (b1 | b2); b = (b1 | b2);
@@ -181,11 +178,10 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n)
__asm mov 4[edx], bx; __asm mov 4[edx], bx;
#elif ACE_SIZEOF_LONG == 8 #elif ACE_SIZEOF_LONG == 8
// 64 bit architecture. // 64 bit architecture.
ACE_REGISTER unsigned long a = unsigned long a = * reinterpret_cast<const unsigned long*> (orig);
* reinterpret_cast<const unsigned long*> (orig);
ACE_REGISTER unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8; unsigned long a1 = (a & 0x00ff00ff00ff00ffUL) << 8;
ACE_REGISTER unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8; unsigned long a2 = (a & 0xff00ff00ff00ff00UL) >> 8;
a = (a1 | a2); a = (a1 | a2);
@@ -206,15 +202,13 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n)
* reinterpret_cast<ACE_UINT16*> (target + 6) = b4; * reinterpret_cast<ACE_UINT16*> (target + 6) = b4;
#endif #endif
#else #else
ACE_REGISTER ACE_UINT32 a = ACE_UINT32 a = * reinterpret_cast<const ACE_UINT32*> (orig);
* reinterpret_cast<const ACE_UINT32*> (orig); ACE_UINT32 b = * reinterpret_cast<const ACE_UINT32*> (orig + 4);
ACE_REGISTER ACE_UINT32 b =
* reinterpret_cast<const ACE_UINT32*> (orig + 4);
ACE_REGISTER ACE_UINT32 a1 = (a & 0x00ff00ff) << 8; ACE_UINT32 a1 = (a & 0x00ff00ff) << 8;
ACE_REGISTER ACE_UINT32 b1 = (b & 0x00ff00ff) << 8; ACE_UINT32 b1 = (b & 0x00ff00ff) << 8;
ACE_REGISTER ACE_UINT32 a2 = (a & 0xff00ff00) >> 8; ACE_UINT32 a2 = (a & 0xff00ff00) >> 8;
ACE_REGISTER ACE_UINT32 b2 = (b & 0xff00ff00) >> 8; ACE_UINT32 b2 = (b & 0xff00ff00) >> 8;
a = (a1 | a2); a = (a1 | a2);
b = (b1 | b2); b = (b1 | b2);
@@ -248,10 +242,12 @@ ACE_CDR::swap_2_array (char const * orig, char* target, size_t n)
ACE_CDR::swap_2 (orig, target); ACE_CDR::swap_2 (orig, target);
orig += 2; orig += 2;
target += 2; target += 2;
// fallthrough
case 2: case 2:
ACE_CDR::swap_2 (orig, target); ACE_CDR::swap_2 (orig, target);
orig += 2; orig += 2;
target += 2; target += 2;
// fallthrough
case 1: case 1:
ACE_CDR::swap_2 (orig, target); ACE_CDR::swap_2 (orig, target);
} }
@@ -296,10 +292,8 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n)
{ {
while (orig < end) while (orig < end)
{ {
ACE_REGISTER unsigned long a = unsigned long a = * reinterpret_cast<const long*> (orig);
* reinterpret_cast<const long*> (orig); unsigned long b = * reinterpret_cast<const long*> (orig + 8);
ACE_REGISTER unsigned long b =
* reinterpret_cast<const long*> (orig + 8);
#if defined(ACE_HAS_INTEL_ASSEMBLY) #if defined(ACE_HAS_INTEL_ASSEMBLY)
asm ("bswapq %1" : "=r" (a) : "0" (a)); asm ("bswapq %1" : "=r" (a) : "0" (a));
@@ -307,14 +301,14 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n)
asm ("rol $32, %1" : "=r" (a) : "0" (a)); asm ("rol $32, %1" : "=r" (a) : "0" (a));
asm ("rol $32, %1" : "=r" (b) : "0" (b)); asm ("rol $32, %1" : "=r" (b) : "0" (b));
#else #else
ACE_REGISTER unsigned long a84 = (a & 0x000000ff000000ffL) << 24; unsigned long a84 = (a & 0x000000ff000000ffL) << 24;
ACE_REGISTER unsigned long b84 = (b & 0x000000ff000000ffL) << 24; unsigned long b84 = (b & 0x000000ff000000ffL) << 24;
ACE_REGISTER unsigned long a73 = (a & 0x0000ff000000ff00L) << 8; unsigned long a73 = (a & 0x0000ff000000ff00L) << 8;
ACE_REGISTER unsigned long b73 = (b & 0x0000ff000000ff00L) << 8; unsigned long b73 = (b & 0x0000ff000000ff00L) << 8;
ACE_REGISTER unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8; unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8;
ACE_REGISTER unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8; unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8;
ACE_REGISTER unsigned long a51 = (a & 0xff000000ff000000L) >> 24; unsigned long a51 = (a & 0xff000000ff000000L) >> 24;
ACE_REGISTER unsigned long b51 = (b & 0xff000000ff000000L) >> 24; unsigned long b51 = (b & 0xff000000ff000000L) >> 24;
a = (a84 | a73 | a62 | a51); a = (a84 | a73 | a62 | a51);
b = (b84 | b73 | b62 | b51); b = (b84 | b73 | b62 | b51);
@@ -332,10 +326,8 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n)
// We are out of luck, we have to write in 4 byte chunks. // We are out of luck, we have to write in 4 byte chunks.
while (orig < end) while (orig < end)
{ {
ACE_REGISTER unsigned long a = unsigned long a = * reinterpret_cast<const long*> (orig);
* reinterpret_cast<const long*> (orig); unsigned long b = * reinterpret_cast<const long*> (orig + 8);
ACE_REGISTER unsigned long b =
* reinterpret_cast<const long*> (orig + 8);
#if defined(ACE_HAS_INTEL_ASSEMBLY) #if defined(ACE_HAS_INTEL_ASSEMBLY)
asm ("bswapq %1" : "=r" (a) : "0" (a)); asm ("bswapq %1" : "=r" (a) : "0" (a));
@@ -343,14 +335,14 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n)
asm ("rol $32, %1" : "=r" (a) : "0" (a)); asm ("rol $32, %1" : "=r" (a) : "0" (a));
asm ("rol $32, %1" : "=r" (b) : "0" (b)); asm ("rol $32, %1" : "=r" (b) : "0" (b));
#else #else
ACE_REGISTER unsigned long a84 = (a & 0x000000ff000000ffL) << 24; unsigned long a84 = (a & 0x000000ff000000ffL) << 24;
ACE_REGISTER unsigned long b84 = (b & 0x000000ff000000ffL) << 24; unsigned long b84 = (b & 0x000000ff000000ffL) << 24;
ACE_REGISTER unsigned long a73 = (a & 0x0000ff000000ff00L) << 8; unsigned long a73 = (a & 0x0000ff000000ff00L) << 8;
ACE_REGISTER unsigned long b73 = (b & 0x0000ff000000ff00L) << 8; unsigned long b73 = (b & 0x0000ff000000ff00L) << 8;
ACE_REGISTER unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8; unsigned long a62 = (a & 0x00ff000000ff0000L) >> 8;
ACE_REGISTER unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8; unsigned long b62 = (b & 0x00ff000000ff0000L) >> 8;
ACE_REGISTER unsigned long a51 = (a & 0xff000000ff000000L) >> 24; unsigned long a51 = (a & 0xff000000ff000000L) >> 24;
ACE_REGISTER unsigned long b51 = (b & 0xff000000ff000000L) >> 24; unsigned long b51 = (b & 0xff000000ff000000L) >> 24;
a = (a84 | a73 | a62 | a51); a = (a84 | a73 | a62 | a51);
b = (b84 | b73 | b62 | b51); b = (b84 | b73 | b62 | b51);
@@ -382,14 +374,10 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n)
while (orig < end) while (orig < end)
{ {
#if defined (ACE_HAS_PENTIUM) && defined (__GNUG__) #if defined (ACE_HAS_PENTIUM) && defined (__GNUG__)
ACE_REGISTER unsigned int a = unsigned int a = *reinterpret_cast<const unsigned int*> (orig);
*reinterpret_cast<const unsigned int*> (orig); unsigned int b = *reinterpret_cast<const unsigned int*> (orig + 4);
ACE_REGISTER unsigned int b = unsigned int c = *reinterpret_cast<const unsigned int*> (orig + 8);
*reinterpret_cast<const unsigned int*> (orig + 4); unsigned int d = *reinterpret_cast<const unsigned int*> (orig + 12);
ACE_REGISTER unsigned int c =
*reinterpret_cast<const unsigned int*> (orig + 8);
ACE_REGISTER unsigned int d =
*reinterpret_cast<const unsigned int*> (orig + 12);
asm ("bswap %1" : "=r" (a) : "0" (a)); asm ("bswap %1" : "=r" (a) : "0" (a));
asm ("bswap %1" : "=r" (b) : "0" (b)); asm ("bswap %1" : "=r" (b) : "0" (b));
@@ -418,14 +406,10 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n)
__asm mov 8[esi], ebx __asm mov 8[esi], ebx
__asm mov 12[esi], eax __asm mov 12[esi], eax
#else #else
ACE_REGISTER ACE_UINT32 a = ACE_UINT32 a = * reinterpret_cast<const ACE_UINT32*> (orig);
* reinterpret_cast<const ACE_UINT32*> (orig); ACE_UINT32 b = * reinterpret_cast<const ACE_UINT32*> (orig + 4);
ACE_REGISTER ACE_UINT32 b = ACE_UINT32 c = * reinterpret_cast<const ACE_UINT32*> (orig + 8);
* reinterpret_cast<const ACE_UINT32*> (orig + 4); ACE_UINT32 d = * reinterpret_cast<const ACE_UINT32*> (orig + 12);
ACE_REGISTER ACE_UINT32 c =
* reinterpret_cast<const ACE_UINT32*> (orig + 8);
ACE_REGISTER ACE_UINT32 d =
* reinterpret_cast<const ACE_UINT32*> (orig + 12);
// Expect the optimizer reordering this A LOT. // Expect the optimizer reordering this A LOT.
// We leave it this way for clarity. // We leave it this way for clarity.
@@ -452,10 +436,12 @@ ACE_CDR::swap_4_array (char const * orig, char* target, size_t n)
ACE_CDR::swap_4 (orig, target); ACE_CDR::swap_4 (orig, target);
orig += 4; orig += 4;
target += 4; target += 4;
// fallthrough
case 2: case 2:
ACE_CDR::swap_4 (orig, target); ACE_CDR::swap_4 (orig, target);
orig += 4; orig += 4;
target += 4; target += 4;
// fallthrough
case 1: case 1:
ACE_CDR::swap_4 (orig, target); ACE_CDR::swap_4 (orig, target);
} }
@@ -598,21 +584,6 @@ ACE_CDR::consolidate (ACE_Message_Block *dst,
return 0; return 0;
} }
#if defined (NONNATIVE_LONGLONG)
bool
ACE_CDR::LongLong::operator== (const ACE_CDR::LongLong &rhs) const
{
return this->h == rhs.h && this->l == rhs.l;
}
bool
ACE_CDR::LongLong::operator!= (const ACE_CDR::LongLong &rhs) const
{
return this->l != rhs.l || this->h != rhs.h;
}
#endif /* NONNATIVE_LONGLONG */
#if defined (NONNATIVE_LONGDOUBLE) #if defined (NONNATIVE_LONGDOUBLE)
ACE_CDR::LongDouble& ACE_CDR::LongDouble&
ACE_CDR::LongDouble::assign (const ACE_CDR::LongDouble::NativeImpl& rhs) ACE_CDR::LongDouble::assign (const ACE_CDR::LongDouble::NativeImpl& rhs)
@@ -843,7 +814,7 @@ ACE_CDR::Fixed ACE_CDR::Fixed::from_integer (ACE_CDR::ULongLong val)
ACE_CDR::Fixed ACE_CDR::Fixed::from_floating (LongDouble val) ACE_CDR::Fixed ACE_CDR::Fixed::from_floating (LongDouble val)
{ {
#ifdef ACE_OPENVMS #if defined ACE_OPENVMS || (defined ACE_VXWORKS && !defined __RTP__)
typedef double BigFloat; typedef double BigFloat;
#elif defined NONNATIVE_LONGDOUBLE #elif defined NONNATIVE_LONGDOUBLE
typedef LongDouble::NativeImpl BigFloat; typedef LongDouble::NativeImpl BigFloat;
@@ -852,7 +823,7 @@ ACE_CDR::Fixed ACE_CDR::Fixed::from_floating (LongDouble val)
#endif #endif
Fixed f; Fixed f;
f.digits_ = 0; f.digits_ = f.scale_ = 0;
bool negative = false; bool negative = false;
if (val < 0) if (val < 0)
{ {
@@ -864,7 +835,10 @@ ACE_CDR::Fixed ACE_CDR::Fixed::from_floating (LongDouble val)
const size_t digits_left = const size_t digits_left =
static_cast<size_t> (1 + ((val > 0) ? std::log10 (val) : 0)); static_cast<size_t> (1 + ((val > 0) ? std::log10 (val) : 0));
if (digits_left > MAX_DIGITS) if (digits_left > MAX_DIGITS)
return f; {
ACE_OS::memset (f.value_, 0, sizeof f.value_);
return f;
}
f.digits_ = MAX_DIGITS; f.digits_ = MAX_DIGITS;
f.scale_ = 0; f.scale_ = 0;
@@ -914,42 +888,25 @@ void ACE_CDR::Fixed::normalize (UShort min_scale)
if (this->value_[15] & 0xf0 || !this->scale_) if (this->value_[15] & 0xf0 || !this->scale_)
return; return;
size_t bytes = 0; // number of bytes to shift down // Calculate the number of nibbles that can be moved.
while (2 * (bytes + 1) < this->scale_ ACE_CDR::Octet nibbles = 0;
&& this->scale_ - 2 * (bytes + 1) >= min_scale while (this->digit(nibbles) == 0 && this->scale_ - nibbles > min_scale)
&& !this->value_[14 - bytes]) ++nibbles;
++bytes;
const bool extra_nibble = 2 * (bytes + 1) <= this->scale_ // Move and clear the nibbles.
&& this->scale_ - 2 * (bytes + 1) >= min_scale for (ACE_CDR::Octet idx = nibbles; idx != this->digits_; ++idx) {
&& !(this->value_[14 - bytes] & 0xf); this->digit (idx - nibbles, this->digit (idx));
const size_t nibbles = 1 /*[15].high*/ + bytes * 2 + extra_nibble; this->digit (idx, 0);
this->digits_ -= static_cast<Octet> (nibbles); }
this->scale_ -= static_cast<Octet> (nibbles);
if (extra_nibble) this->scale_ -= nibbles;
{ this->digits_ -= nibbles;
const bool sign = this->sign ();
std::memmove (this->value_ + bytes + 1, this->value_, 15 - bytes);
std::memset (this->value_, 0, bytes + 1);
this->value_[15] |= sign ? NEGATIVE : POSITIVE;
}
else
{
this->value_[15] = (this->value_[14 - bytes] & 0xf) << 4
| (this->value_[15] & 0xf);
for (size_t i = 14; i > bytes; --i)
this->value_[i] = (this->value_[i - bytes - 1] & 0xf) << 4
| (this->value_[i - bytes] >> 4);
this->value_[bytes] = this->value_[0] >> 4;
std::memset (this->value_, 0, bytes);
}
} }
ACE_CDR::Fixed ACE_CDR::Fixed::from_string (const char *str) ACE_CDR::Fixed ACE_CDR::Fixed::from_string (const char *str)
{ {
const bool negative = str && *str == '-'; const bool negative = *str == '-';
if (negative || (str && *str == '+')) if (negative || *str == '+')
++str; ++str;
const size_t span = ACE_OS::strspn (str, ".0123456789"); const size_t span = ACE_OS::strspn (str, ".0123456789");
@@ -1157,14 +1114,16 @@ ACE_CDR::Fixed::ConstIterator ACE_CDR::Fixed::pre_add (const ACE_CDR::Fixed &f)
if (f.digits_ - f.scale_ > this->digits_ - this->scale_) if (f.digits_ - f.scale_ > this->digits_ - this->scale_)
{ {
this->digits_ += f.digits_ - f.scale_ - this->digits_ + this->scale_; ACE_CDR::Octet new_digits = this->digits_ + (f.digits_ - f.scale_) - (this->digits_ - this->scale_);
if (this->digits_ > MAX_DIGITS) if (new_digits > MAX_DIGITS)
{ {
for (size_t i = 0; i < static_cast<size_t> (this->digits_ - MAX_DIGITS); ++i) for (size_t i = 0; i < static_cast<size_t> (new_digits - MAX_DIGITS); ++i)
this->digit (static_cast<int> (i), 0); this->digit (static_cast<int> (i), 0);
this->normalize (this->scale_ - MAX_DIGITS - this->digits_); this->normalize (this->scale_ - (new_digits - MAX_DIGITS));
this->digits_ = MAX_DIGITS; this->digits_ = MAX_DIGITS;
} }
else
this->digits_ = new_digits;
} }
return rhs_iter; return rhs_iter;
} }
@@ -1391,10 +1350,15 @@ ACE_CDR::Fixed &ACE_CDR::Fixed::operator/= (const Fixed &rhs)
if (neg) if (neg)
this->value_[15] = (this->value_[15] & 0xf0) | POSITIVE; this->value_[15] = (this->value_[15] & 0xf0) | POSITIVE;
Fixed r, q = this->div_helper2 (rhs_no_scale, r); Fixed r;
Fixed q = this->div_helper2 (rhs_no_scale, r);
q.scale_ = this->scale_;
if (!r) if (!r) {
return *this = neg ? -q : q;; *this = neg ? -q : q;
this->normalize ();
return *this;
}
const int shift = q.lshift (MAX_DIGITS); const int shift = q.lshift (MAX_DIGITS);
if (shift) if (shift)
@@ -1458,6 +1422,7 @@ ACE_CDR::Fixed ACE_CDR::Fixed::div_helper1 (const Fixed &rhs, Fixed &r) const
if (q > 9) if (q > 9)
q = 9; q = 9;
Fixed t = from_integer (LongLong (q)) * rhs; Fixed t = from_integer (LongLong (q)) * rhs;
t.scale_ = this->scale_;
for (int i = 0; i < 2 && t > *this; ++i) for (int i = 0; i < 2 && t > *this; ++i)
{ {
--q; --q;

View File

@@ -21,7 +21,6 @@
*/ */
//============================================================================= //=============================================================================
#ifndef ACE_CDR_BASE_H #ifndef ACE_CDR_BASE_H
#define ACE_CDR_BASE_H #define ACE_CDR_BASE_H
@@ -206,53 +205,9 @@ public:
typedef ACE_UINT16 UShort; typedef ACE_UINT16 UShort;
typedef ACE_INT32 Long; typedef ACE_INT32 Long;
typedef ACE_UINT32 ULong; typedef ACE_UINT32 ULong;
typedef ACE_INT64 LongLong;
typedef ACE_UINT64 ULongLong; typedef ACE_UINT64 ULongLong;
# if (defined (_MSC_VER)) || (defined (__BORLANDC__))
typedef __int64 LongLong;
# elif ACE_SIZEOF_LONG == 8
typedef long LongLong;
# elif defined(__TANDEM)
typedef long long LongLong;
# elif ACE_SIZEOF_LONG_LONG == 8
# if defined (sun) && !defined (ACE_LACKS_U_LONGLONG_T)
// sun #defines u_longlong_t, maybe other platforms do also.
// Use it, at least with g++, so that its -pedantic doesn't
// complain about no ANSI C++ long long.
typedef longlong_t LongLong;
# else
typedef long long LongLong;
# endif /* sun */
# else /* no native 64 bit integer type */
# define NONNATIVE_LONGLONG
struct ACE_Export LongLong
{
# if defined (ACE_BIG_ENDIAN)
ACE_CDR::Long h;
ACE_CDR::Long l;
# else
ACE_CDR::Long l;
ACE_CDR::Long h;
# endif /* ! ACE_BIG_ENDIAN */
/**
* @name Overloaded Relation Operators.
*
* The canonical comparison operators.
*/
//@{
bool operator== (const LongLong &rhs) const;
bool operator!= (const LongLong &rhs) const;
//@}
};
# endif /* no native 64 bit integer type */
# if defined (NONNATIVE_LONGLONG)
# define ACE_CDR_LONGLONG_INITIALIZER {0,0}
# else
# define ACE_CDR_LONGLONG_INITIALIZER 0
# endif /* NONNATIVE_LONGLONG */
# if ACE_SIZEOF_FLOAT == 4 # if ACE_SIZEOF_FLOAT == 4
typedef float Float; typedef float Float;
# else /* ACE_SIZEOF_FLOAT != 4 */ # else /* ACE_SIZEOF_FLOAT != 4 */
@@ -362,7 +317,7 @@ public:
/// See OMG 2012-07-02 IDL-to-C++ Mapping v1.3 section 5.13 /// See OMG 2012-07-02 IDL-to-C++ Mapping v1.3 section 5.13
/// This class doesn't exactly match the IDL-to-C++ mapping because /// This class doesn't exactly match the IDL-to-C++ mapping because
/// it is meant for use inside a union in the IDL compiler and therefore /// it is meant for use inside a union in the IDL compiler and therefore
/// has no constructors. Standards-based middlware libraries such as /// has no constructors. Standards-based middleware libraries such as
/// ORBs and DDSs can wrap this class in a class of their own to provide /// ORBs and DDSs can wrap this class in a class of their own to provide
/// the exact interface described by the mapping specification. /// the exact interface described by the mapping specification.
class ACE_Export Fixed class ACE_Export Fixed

View File

@@ -66,6 +66,9 @@ ACE_CDR::swap_2 (const char *orig, char* target)
// function. // function.
*reinterpret_cast<unsigned short *> (target) = *reinterpret_cast<unsigned short *> (target) =
_byteswap_ushort (*reinterpret_cast<unsigned short const *> (orig)); _byteswap_ushort (*reinterpret_cast<unsigned short const *> (orig));
#elif defined (ACE_HAS_BUILTIN_BSWAP16)
*reinterpret_cast<uint16_t *> (target) =
__builtin_bswap16 (*reinterpret_cast<uint16_t const *> (orig));
#elif defined (ACE_HAS_BSWAP16) #elif defined (ACE_HAS_BSWAP16)
*reinterpret_cast<uint16_t *> (target) = *reinterpret_cast<uint16_t *> (target) =
bswap16 (*reinterpret_cast<uint16_t const *> (orig)); bswap16 (*reinterpret_cast<uint16_t const *> (orig));
@@ -86,8 +89,8 @@ ACE_CDR::swap_2 (const char *orig, char* target)
__asm rol ax, 8; __asm rol ax, 8;
__asm mov [ecx], ax; __asm mov [ecx], ax;
#else #else
ACE_REGISTER ACE_UINT16 usrc = * reinterpret_cast<const ACE_UINT16*> (orig); ACE_UINT16 usrc = * reinterpret_cast<const ACE_UINT16*> (orig);
ACE_REGISTER ACE_UINT16* udst = reinterpret_cast<ACE_UINT16*> (target); ACE_UINT16* udst = reinterpret_cast<ACE_UINT16*> (target);
*udst = (usrc << 8) | (usrc >> 8); *udst = (usrc << 8) | (usrc >> 8);
#endif /* ACE_HAS_PENTIUM */ #endif /* ACE_HAS_PENTIUM */
} }
@@ -100,6 +103,9 @@ ACE_CDR::swap_4 (const char* orig, char* target)
// function. // function.
*reinterpret_cast<unsigned long *> (target) = *reinterpret_cast<unsigned long *> (target) =
_byteswap_ulong (*reinterpret_cast<unsigned long const *> (orig)); _byteswap_ulong (*reinterpret_cast<unsigned long const *> (orig));
#elif defined (ACE_HAS_BUILTIN_BSWAP32)
*reinterpret_cast<uint32_t *> (target) =
__builtin_bswap32 (*reinterpret_cast<uint32_t const *> (orig));
#elif defined (ACE_HAS_BSWAP32) #elif defined (ACE_HAS_BSWAP32)
*reinterpret_cast<uint32_t *> (target) = *reinterpret_cast<uint32_t *> (target) =
bswap32 (*reinterpret_cast<uint32_t const *> (orig)); bswap32 (*reinterpret_cast<uint32_t const *> (orig));
@@ -108,7 +114,7 @@ ACE_CDR::swap_4 (const char* orig, char* target)
bswap_32 (*reinterpret_cast<uint32_t const *> (orig)); bswap_32 (*reinterpret_cast<uint32_t const *> (orig));
#elif defined(ACE_HAS_INTEL_ASSEMBLY) #elif defined(ACE_HAS_INTEL_ASSEMBLY)
// We have ACE_HAS_PENTIUM, so we know the sizeof's. // We have ACE_HAS_PENTIUM, so we know the sizeof's.
ACE_REGISTER unsigned int j = unsigned int j =
*reinterpret_cast<const unsigned int*> (orig); *reinterpret_cast<const unsigned int*> (orig);
asm ("bswap %1" : "=r" (j) : "0" (j)); asm ("bswap %1" : "=r" (j) : "0" (j));
*reinterpret_cast<unsigned int*> (target) = j; *reinterpret_cast<unsigned int*> (target) = j;
@@ -121,7 +127,7 @@ ACE_CDR::swap_4 (const char* orig, char* target)
__asm bswap eax; __asm bswap eax;
__asm mov [ecx], eax; __asm mov [ecx], eax;
#else #else
ACE_REGISTER ACE_UINT32 x = * reinterpret_cast<const ACE_UINT32*> (orig); ACE_UINT32 x = * reinterpret_cast<const ACE_UINT32*> (orig);
x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24);
* reinterpret_cast<ACE_UINT32*> (target) = x; * reinterpret_cast<ACE_UINT32*> (target) = x;
#endif /* ACE_HAS_INTRINSIC_BYTESWAP */ #endif /* ACE_HAS_INTRINSIC_BYTESWAP */
@@ -135,6 +141,9 @@ ACE_CDR::swap_8 (const char* orig, char* target)
// function. // function.
*reinterpret_cast<unsigned __int64 *> (target) = *reinterpret_cast<unsigned __int64 *> (target) =
_byteswap_uint64 (*reinterpret_cast<unsigned __int64 const *> (orig)); _byteswap_uint64 (*reinterpret_cast<unsigned __int64 const *> (orig));
#elif defined (ACE_HAS_BUILTIN_BSWAP64)
*reinterpret_cast<uint64_t *> (target) =
__builtin_bswap64 (*reinterpret_cast<uint64_t const *> (orig));
#elif defined (ACE_HAS_BSWAP64) #elif defined (ACE_HAS_BSWAP64)
*reinterpret_cast<uint64_t *> (target) = *reinterpret_cast<uint64_t *> (target) =
bswap64 (*reinterpret_cast<uint64_t const *> (orig)); bswap64 (*reinterpret_cast<uint64_t const *> (orig));
@@ -143,16 +152,14 @@ ACE_CDR::swap_8 (const char* orig, char* target)
bswap_64 (*reinterpret_cast<uint64_t const *> (orig)); bswap_64 (*reinterpret_cast<uint64_t const *> (orig));
#elif (defined (__amd64__) || defined (__x86_64__)) && defined(__GNUG__) \ #elif (defined (__amd64__) || defined (__x86_64__)) && defined(__GNUG__) \
&& !defined(ACE_LACKS_INLINE_ASSEMBLY) && !defined(ACE_LACKS_INLINE_ASSEMBLY)
ACE_REGISTER unsigned long x = unsigned long x =
* reinterpret_cast<const unsigned long*> (orig); * reinterpret_cast<const unsigned long*> (orig);
asm ("bswapq %1" : "=r" (x) : "0" (x)); asm ("bswapq %1" : "=r" (x) : "0" (x));
*reinterpret_cast<unsigned long*> (target) = x; *reinterpret_cast<unsigned long*> (target) = x;
#elif defined(ACE_HAS_PENTIUM) && defined(__GNUG__) \ #elif defined(ACE_HAS_PENTIUM) && defined(__GNUG__) \
&& !defined(ACE_LACKS_INLINE_ASSEMBLY) && !defined(ACE_LACKS_INLINE_ASSEMBLY)
ACE_REGISTER unsigned int i = unsigned int i =*reinterpret_cast<const unsigned int*> (orig);
*reinterpret_cast<const unsigned int*> (orig); unsigned int j = *reinterpret_cast<const unsigned int*> (orig + 4);
ACE_REGISTER unsigned int j =
*reinterpret_cast<const unsigned int*> (orig + 4);
asm ("bswap %1" : "=r" (i) : "0" (i)); asm ("bswap %1" : "=r" (i) : "0" (i));
asm ("bswap %1" : "=r" (j) : "0" (j)); asm ("bswap %1" : "=r" (j) : "0" (j));
*reinterpret_cast<unsigned int*> (target + 4) = i; *reinterpret_cast<unsigned int*> (target + 4) = i;
@@ -170,20 +177,17 @@ ACE_CDR::swap_8 (const char* orig, char* target)
__asm mov [edx], ebx; __asm mov [edx], ebx;
#elif ACE_SIZEOF_LONG == 8 #elif ACE_SIZEOF_LONG == 8
// 64 bit architecture. // 64 bit architecture.
ACE_REGISTER unsigned long x = unsigned long x = * reinterpret_cast<const unsigned long*> (orig);
* reinterpret_cast<const unsigned long*> (orig); unsigned long x84 = (x & 0x000000ff000000ffUL) << 24;
ACE_REGISTER unsigned long x84 = (x & 0x000000ff000000ffUL) << 24; unsigned long x73 = (x & 0x0000ff000000ff00UL) << 8;
ACE_REGISTER unsigned long x73 = (x & 0x0000ff000000ff00UL) << 8; unsigned long x62 = (x & 0x00ff000000ff0000UL) >> 8;
ACE_REGISTER unsigned long x62 = (x & 0x00ff000000ff0000UL) >> 8; unsigned long x51 = (x & 0xff000000ff000000UL) >> 24;
ACE_REGISTER unsigned long x51 = (x & 0xff000000ff000000UL) >> 24;
x = (x84 | x73 | x62 | x51); x = (x84 | x73 | x62 | x51);
x = (x << 32) | (x >> 32); x = (x << 32) | (x >> 32);
*reinterpret_cast<unsigned long*> (target) = x; *reinterpret_cast<unsigned long*> (target) = x;
#else #else
ACE_REGISTER ACE_UINT32 x = ACE_UINT32 x = * reinterpret_cast<const ACE_UINT32*> (orig);
* reinterpret_cast<const ACE_UINT32*> (orig); ACE_UINT32 y = * reinterpret_cast<const ACE_UINT32*> (orig + 4);
ACE_REGISTER ACE_UINT32 y =
* reinterpret_cast<const ACE_UINT32*> (orig + 4);
x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24);
y = (y << 24) | ((y & 0xff00) << 8) | ((y & 0xff0000) >> 8) | (y >> 24); y = (y << 24) | ((y & 0xff00) << 8) | ((y & 0xff0000) >> 8) | (y >> 24);
* reinterpret_cast<ACE_UINT32*> (target) = y; * reinterpret_cast<ACE_UINT32*> (target) = y;

View File

@@ -44,7 +44,7 @@ public:
ACE_SizeCDR (ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, ACE_SizeCDR (ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION,
ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION);
/// Returns @c false if an error has ocurred. /// Returns @c false if an error has occurred.
bool good_bit (void) const; bool good_bit (void) const;
/// Reset current size. /// Reset current size.
@@ -78,6 +78,10 @@ public:
ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x); ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x);
ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length, ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length,
const ACE_CDR::WChar *x); const ACE_CDR::WChar *x);
ACE_CDR::Boolean write_string (const std::string &x);
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_CDR::Boolean write_wstring (const std::wstring &x);
#endif
//@} //@}
/// @note the portion written starts at <x> and ends /// @note the portion written starts at <x> and ends
@@ -112,7 +116,7 @@ public:
ACE_CDR::ULong length); ACE_CDR::ULong length);
/// ///
/// Adjust to @a size and count <size> octets. /// Adjust to @a size and count @a size octets.
void adjust (size_t size); void adjust (size_t size);
/// As above, but now the size and alignment requirements may be /// As above, but now the size and alignment requirements may be
@@ -153,7 +157,7 @@ private:
ACE_CDR::ULong length); ACE_CDR::ULong length);
private: private:
/// Set to false when an error ocurrs. /// Set to false when an error occurs.
bool good_bit_; bool good_bit_;
/// Current size. /// Current size.
@@ -223,6 +227,12 @@ extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss,
const ACE_CDR::Char* x); const ACE_CDR::Char* x);
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss,
const ACE_CDR::WChar* x); const ACE_CDR::WChar* x);
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss,
const std::string& x);
#if !defined(ACE_LACKS_STD_WSTRING)
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss,
const std::wstring& x);
#endif
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -143,6 +143,26 @@ ACE_SizeCDR::write_wstring (const ACE_CDR::WChar *x)
return this->write_wstring (0, 0); return this->write_wstring (0, 0);
} }
ACE_INLINE ACE_CDR::Boolean
ACE_SizeCDR::write_string (const std::string &x)
{
ACE_CDR::ULong len =
static_cast<ACE_CDR::ULong> (x.size ());
return this->write_string (len,
x.empty () ? 0 : x.c_str ());
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_INLINE ACE_CDR::Boolean
ACE_SizeCDR::write_wstring (const std::wstring &x)
{
ACE_CDR::ULong len =
static_cast<ACE_CDR::ULong> (x.size ());
return this->write_wstring (len,
x.empty () ? 0 : x.c_str ());
}
#endif
ACE_INLINE ACE_CDR::Boolean ACE_INLINE ACE_CDR::Boolean
ACE_SizeCDR::write_char_array (const ACE_CDR::Char *x, ACE_SizeCDR::write_char_array (const ACE_CDR::Char *x,
ACE_CDR::ULong length) ACE_CDR::ULong length)
@@ -372,6 +392,22 @@ operator<< (ACE_SizeCDR &ss, const ACE_CDR::WChar *x)
return (ACE_CDR::Boolean) ss.good_bit (); return (ACE_CDR::Boolean) ss.good_bit ();
} }
ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_SizeCDR &ss, const std::string& x)
{
ss.write_string (x);
return (ACE_CDR::Boolean) ss.good_bit ();
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_SizeCDR &ss, const std::wstring& x)
{
ss.write_wstring (x);
return (ACE_CDR::Boolean) ss.good_bit ();
}
#endif
// The following use the helper classes // The following use the helper classes
ACE_INLINE ACE_CDR::Boolean ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_boolean x) operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_boolean x)

View File

@@ -1520,9 +1520,15 @@ ACE_InputCDR::read_string (ACE_CDR::Char *&x)
// the memory is allocated. // the memory is allocated.
if (len > 0 && len <= this->length()) if (len > 0 && len <= this->length())
{ {
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (x,
static_cast<ACE_CDR::Char*> (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::Char) * (len))),
0);
#else
ACE_NEW_RETURN (x, ACE_NEW_RETURN (x,
ACE_CDR::Char[len], ACE_CDR::Char[len],
0); 0);
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_Auto_Basic_Array_Ptr<ACE_CDR::Char> safe_data (x); ACE_Auto_Basic_Array_Ptr<ACE_CDR::Char> safe_data (x);
@@ -1536,9 +1542,16 @@ ACE_InputCDR::read_string (ACE_CDR::Char *&x)
{ {
// Convert any null strings to empty strings since empty // Convert any null strings to empty strings since empty
// strings can cause crashes. (See bug 58.) // strings can cause crashes. (See bug 58.)
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (x,
static_cast<ACE_CDR::Char*> (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::Char) * (1))),
0);
#else
ACE_NEW_RETURN (x, ACE_NEW_RETURN (x,
ACE_CDR::Char[1], ACE_CDR::Char[1],
0); 0);
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_OS::strcpy (const_cast<char *&> (x), ""); ACE_OS::strcpy (const_cast<char *&> (x), "");
return true; return true;
} }
@@ -1601,9 +1614,15 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x)
ACE_OutputCDR::wchar_maxbytes_); ACE_OutputCDR::wchar_maxbytes_);
//allocating one extra for the null character needed by applications //allocating one extra for the null character needed by applications
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (x,
static_cast<ACE_CDR::WChar*> (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::WChar) * (len + 1))),
0);
#else
ACE_NEW_RETURN (x, ACE_NEW_RETURN (x,
ACE_CDR::WChar [len + 1], ACE_CDR::WChar [len + 1],
false); false);
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_auto_ptr_reset (safe_data, x); ACE_auto_ptr_reset (safe_data, x);
@@ -1622,9 +1641,15 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x)
} }
else else
{ {
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_ALLOCATOR_RETURN (x,
static_cast<ACE_CDR::WChar*> (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::WChar) * (len))),
0);
#else
ACE_NEW_RETURN (x, ACE_NEW_RETURN (x,
ACE_CDR::WChar [len], ACE_CDR::WChar [len],
false); false);
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_auto_ptr_reset (safe_data, x); ACE_auto_ptr_reset (safe_data, x);
@@ -1640,9 +1665,16 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x)
{ {
// Convert any null strings to empty strings since empty // Convert any null strings to empty strings since empty
// strings can cause crashes. (See bug 58.) // strings can cause crashes. (See bug 58.)
ACE_NEW_RETURN (x, #if defined (ACE_HAS_ALLOC_HOOKS)
ACE_CDR::WChar[1], ACE_ALLOCATOR_RETURN (x,
false); static_cast<ACE_CDR::WChar*> (ACE_Allocator::instance()->malloc(sizeof (ACE_CDR::WChar) * (1))),
0);
#else
ACE_NEW_RETURN (x,
ACE_CDR::WChar [1],
false);
#endif /* ACE_HAS_ALLOC_HOOKS */
x[0] = '\x00'; x[0] = '\x00';
return true; return true;
} }
@@ -1652,6 +1684,146 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x)
return false; return false;
} }
// As of C++11 std::string guarantees contiguous memory storage.
// That provides the opportunity to optimize CDR streaming.
ACE_CDR::Boolean
ACE_InputCDR::read_string (std::string& x)
{
#if defined (ACE_HAS_CPP11)
// @@ This is a slight violation of "Optimize for the common case",
// i.e. normally the translator will be 0, but OTOH the code is
// smaller and should be better for the cache ;-) ;-)
if (this->char_translator_ != 0)
{
this->good_bit_ = this->char_translator_->read_string (*this, x);
return this->good_bit_;
}
ACE_CDR::ULong len = 0;
if (!this->read_ulong (len))
return false;
// A check for the length being too great is done later in the
// call to read_char_array but we want to have it done before
// the memory is allocated.
if (len > 0 && len <= this->length())
{
try
{
x.resize (len-1); // no need to include the terminating '\0' here
}
catch (const std::bad_alloc&)
{
return false;
}
if (len == 0 || this->read_char_array (&x[0], len-1))
{
return this->skip_char (); // skip the terminating '\0'
}
}
this->good_bit_ = false;
x.clear ();
return false;
#else
ACE_CDR::Char *buf = 0;
ACE_CDR::Boolean const marshal_flag = this->read_string (buf);
x.assign (buf);
ACE::strdelete (buf);
return marshal_flag;
#endif
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_CDR::Boolean
ACE_InputCDR::read_wstring (std::wstring& x)
{
#if defined (ACE_HAS_CPP11)
// @@ This is a slight violation of "Optimize for the common case",
// i.e. normally the translator will be 0, but OTOH the code is
// smaller and should be better for the cache ;-) ;-)
if (this->wchar_translator_ != 0)
{
this->good_bit_ = this->wchar_translator_->read_wstring (*this, x);
return this->good_bit_;
}
if (ACE_OutputCDR::wchar_maxbytes_ == 0)
{
errno = EACCES;
return (this->good_bit_ = false);
}
ACE_CDR::ULong len = 0;
if (!this->read_ulong (len))
{
return false;
}
// A check for the length being too great is done later in the
// call to read_char_array but we want to have it done before
// the memory is allocated.
if (len > 0 && len <= this->length ())
{
if (static_cast<ACE_CDR::Short> (this->major_version_) == 1
&& static_cast<ACE_CDR::Short> (this->minor_version_) == 2)
{
len /=
ACE_Utils::truncate_cast<ACE_CDR::ULong> (
ACE_OutputCDR::wchar_maxbytes_);
try
{
x.resize (len);
}
catch (const std::bad_alloc&)
{
return false;
}
if (this->read_wchar_array (&x[0], len))
{
return true;
}
}
else
{
try
{
x.resize (len-1); // no need to include the terminating '\0' here
}
catch (const std::bad_alloc&)
{
return false;
}
if (len == 1 || this->read_wchar_array (&x[0], len-1))
{
return this->skip_wchar (); // skip the terminating '\0'
}
}
}
else if (len == 0)
{
x.clear ();
return true;
}
this->good_bit_ = false;
x.clear ();
return false;
#else
ACE_CDR::WChar *buf = 0;
ACE_CDR::Boolean const marshal_flag = this->read_wstring (buf);
x.assign (buf);
ACE::strdelete (buf);
return marshal_flag;
#endif
}
#endif
ACE_CDR::Boolean ACE_CDR::Boolean
ACE_InputCDR::read_array (void* x, ACE_InputCDR::read_array (void* x,
size_t size, size_t size,
@@ -2195,12 +2367,36 @@ ACE_Char_Codeset_Translator::~ACE_Char_Codeset_Translator (void)
{ {
} }
ACE_CDR::Boolean
ACE_Char_Codeset_Translator::read_string (ACE_InputCDR &cdr,
std::string &x)
{
ACE_CDR::Char *buf = 0;
ACE_CDR::Boolean const marshal_flag = this->read_string (cdr, buf);
x.assign (buf);
ACE::strdelete (buf);
return marshal_flag;
}
// -------------------------------------------------------------- // --------------------------------------------------------------
ACE_WChar_Codeset_Translator::~ACE_WChar_Codeset_Translator (void) ACE_WChar_Codeset_Translator::~ACE_WChar_Codeset_Translator (void)
{ {
} }
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_CDR::Boolean
ACE_WChar_Codeset_Translator::read_wstring (ACE_InputCDR &cdr,
std::wstring &x)
{
ACE_CDR::WChar *buf = 0;
ACE_CDR::Boolean const marshal_flag = this->read_wstring (cdr, buf);
x.assign (buf);
ACE::strdelete (buf);
return marshal_flag;
}
#endif
// -------------------------------------------------------------- // --------------------------------------------------------------
ACE_CDR::Boolean ACE_CDR::Boolean

View File

@@ -56,6 +56,7 @@
#include "Monitor_Size.h" #include "Monitor_Size.h"
#endif /* ACE_HAS_MONITOR_POINTS==1 */ #endif /* ACE_HAS_MONITOR_POINTS==1 */
#include <string>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -121,7 +122,7 @@ public:
/// with the alignment of @a data. /// with the alignment of @a data.
/** /**
* Create an output stream from an arbitrary buffer, care must be * Create an output stream from an arbitrary buffer, care must be
* exercised with alignment, because this contructor will align if * exercised with alignment, because this constructor will align if
* needed. In this case @a data will not point to the start of the * needed. In this case @a data will not point to the start of the
* output stream. @c begin()->rd_ptr() points to the start of the * output stream. @c begin()->rd_ptr() points to the start of the
* output stream. See @c ACE_ptr_align_binary() to properly align a * output stream. See @c ACE_ptr_align_binary() to properly align a
@@ -138,11 +139,11 @@ public:
ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION); ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION);
/// Build a CDR stream with an initial data block, it will *not* remove /// Build a CDR stream with an initial data block, it will *not* remove
/// <data_block>, since it did not allocated it. It's important to be /// @a data_block, since it did not allocated it. It's important to be
// careful with the alignment of <data_block>. /// careful with the alignment of @a data_block.
/** /**
* Create an output stream from an arbitrary data block, care must be * Create an output stream from an arbitrary data block, care must be
* exercised with alignment, because this contructor will align if * exercised with alignment, because this constructor will align if
* needed. In this case @a data_block will not point to the * needed. In this case @a data_block will not point to the
* start of the output stream. begin()->rd_ptr() points to the start * start of the output stream. begin()->rd_ptr() points to the start
* off the output stream. See ACE_ptr_align_binary() to properly align a * off the output stream. See ACE_ptr_align_binary() to properly align a
@@ -221,6 +222,24 @@ public:
ACE_CDR::ULong bound_; ACE_CDR::ULong bound_;
ACE_CDR::Boolean nocopy_; ACE_CDR::Boolean nocopy_;
}; };
struct ACE_Export from_std_string
{
from_std_string (const std::string &s,
ACE_CDR::ULong b);
const std::string &val_;
ACE_CDR::ULong bound_;
};
#if !defined(ACE_LACKS_STD_WSTRING)
struct ACE_Export from_std_wstring
{
from_std_wstring (const std::wstring &ws,
ACE_CDR::ULong b);
const std::wstring &val_;
ACE_CDR::ULong bound_;
};
#endif
//@} //@}
/** /**
@@ -250,6 +269,11 @@ public:
ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x); ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x);
ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length, ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length,
const ACE_CDR::WChar *x); const ACE_CDR::WChar *x);
ACE_CDR::Boolean write_string (const std::string &x);
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_CDR::Boolean write_wstring (const std::wstring &x);
#endif
//@} //@}
/// @note the portion written starts at @a x and ends /// @note the portion written starts at @a x and ends
@@ -330,7 +354,7 @@ public:
* type to insert. This requirement is satisfied by using one of the * type to insert. This requirement is satisfied by using one of the
* placeholder-writing methods to align the stream for the anticipated * placeholder-writing methods to align the stream for the anticipated
* value and obtain the correct location. * value and obtain the correct location.
* Treatment of @a x with repect to byte swapping is the same as for when * Treatment of @a x with respect to byte swapping is the same as for when
* any value is inserted. * any value is inserted.
* *
* @param x The value to insert into the specified location. * @param x The value to insert into the specified location.
@@ -375,7 +399,7 @@ public:
ACE_CDR::Boolean append_string (ACE_InputCDR &); ACE_CDR::Boolean append_string (ACE_InputCDR &);
//@} //@}
/// Returns @c false if an error has ocurred. /// Returns @c false if an error has occurred.
/** /**
* @note The only expected error is to run out of memory. * @note The only expected error is to run out of memory.
*/ */
@@ -500,7 +524,6 @@ public:
#endif /* ACE_HAS_MONITOR_POINTS==1 */ #endif /* ACE_HAS_MONITOR_POINTS==1 */
private: private:
// Find the message block in the chain of message blocks // Find the message block in the chain of message blocks
// that the provide location locates. // that the provide location locates.
ACE_Message_Block* find (char* loc); ACE_Message_Block* find (char* loc);
@@ -645,7 +668,7 @@ public:
/** /**
* Create an input stream from an arbitrary buffer. The buffer must * Create an input stream from an arbitrary buffer. The buffer must
* be properly aligned because this contructor will *not* work if * be properly aligned because this constructor will *not* work if
* the buffer is aligned unproperly.See ACE_ptr_align_binary() for * the buffer is aligned unproperly.See ACE_ptr_align_binary() for
* instructions on how to align a pointer properly and use * instructions on how to align a pointer properly and use
* ACE_CDR::MAX_ALIGNMENT for the correct alignment. * ACE_CDR::MAX_ALIGNMENT for the correct alignment.
@@ -677,7 +700,7 @@ public:
ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION, ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION,
ACE_Lock* lock = 0); ACE_Lock* lock = 0);
/// Create an input stream from an ACE_Data_Block. The <flag> /// Create an input stream from an ACE_Data_Block. The @a flag
/// indicates whether the @a data can be deleted by the CDR stream /// indicates whether the @a data can be deleted by the CDR stream
/// or not /// or not
ACE_InputCDR (ACE_Data_Block *data, ACE_InputCDR (ACE_Data_Block *data,
@@ -733,7 +756,7 @@ public:
ACE_InputCDR &rhs_; ACE_InputCDR &rhs_;
}; };
/// Transfer the contents from <rhs> to a new CDR /// Transfer the contents from @a rhs to a new CDR
ACE_InputCDR (Transfer_Contents rhs); ACE_InputCDR (Transfer_Contents rhs);
/// Destructor /// Destructor
@@ -794,6 +817,25 @@ public:
const ACE_CDR::WChar *&val_; const ACE_CDR::WChar *&val_;
ACE_CDR::ULong bound_; ACE_CDR::ULong bound_;
}; };
/// Helper classes for extracting bounded strings into std::string/wstring.
struct ACE_Export to_std_string
{
to_std_string (std::string &s,
ACE_CDR::ULong b);
std::string &val_;
ACE_CDR::ULong bound_;
};
#if !defined(ACE_LACKS_STD_WSTRING)
struct ACE_Export to_std_wstring
{
to_std_wstring (std::wstring &ws,
ACE_CDR::ULong b);
std::wstring &val_;
ACE_CDR::ULong bound_;
};
#endif /* ACE_LACKS_STD_WSTRING */
//@} //@}
/** /**
@@ -818,6 +860,10 @@ public:
ACE_CDR::Boolean read_string (ACE_CDR::Char *&x); ACE_CDR::Boolean read_string (ACE_CDR::Char *&x);
ACE_CDR::Boolean read_string (ACE_CString &x); ACE_CDR::Boolean read_string (ACE_CString &x);
ACE_CDR::Boolean read_wstring (ACE_CDR::WChar*& x); ACE_CDR::Boolean read_wstring (ACE_CDR::WChar*& x);
ACE_CDR::Boolean read_string (std::string& x);
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_CDR::Boolean read_wstring (std::wstring& x);
#endif
//@} //@}
/** /**
@@ -1036,7 +1082,6 @@ protected:
#endif /* ACE_HAS_MONITOR_POINTS==1 */ #endif /* ACE_HAS_MONITOR_POINTS==1 */
private: private:
ACE_CDR::Boolean read_1 (ACE_CDR::Octet *x); ACE_CDR::Boolean read_1 (ACE_CDR::Octet *x);
ACE_CDR::Boolean read_2 (ACE_CDR::UShort *x); ACE_CDR::Boolean read_2 (ACE_CDR::UShort *x);
ACE_CDR::Boolean read_4 (ACE_CDR::ULong *x); ACE_CDR::Boolean read_4 (ACE_CDR::ULong *x);
@@ -1048,7 +1093,7 @@ private:
// We could use void* or char* to make the interface more // We could use void* or char* to make the interface more
// consistent, but using native types let us exploit the strict // consistent, but using native types let us exploit the strict
// alignment requirements of CDR streams and implement the // alignment requirements of CDR streams and implement the
// operations using asignment. // operations using assignment.
/** /**
* Read an array of @a length elements, each of @a size bytes and the * Read an array of @a length elements, each of @a size bytes and the
@@ -1114,6 +1159,12 @@ public:
virtual ACE_CDR::Boolean read_string (ACE_InputCDR&, virtual ACE_CDR::Boolean read_string (ACE_InputCDR&,
ACE_CDR::Char *&) = 0; ACE_CDR::Char *&) = 0;
/// Read a std::string from the stream, including the length, converting
/// the characters from the stream codeset to the native codeset
/// (provide non-optimized default implementation)
virtual ACE_CDR::Boolean read_string (ACE_InputCDR&,
std::string &);
/// Read an array of characters from the stream, converting the /// Read an array of characters from the stream, converting the
/// characters from the stream codeset to the native codeset. /// characters from the stream codeset to the native codeset.
virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR&, virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR&,
@@ -1210,6 +1261,13 @@ public:
ACE_CDR::WChar&) = 0; ACE_CDR::WChar&) = 0;
virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR&, virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR&,
ACE_CDR::WChar *&) = 0; ACE_CDR::WChar *&) = 0;
#if !defined(ACE_LACKS_STD_WSTRING)
/// Read a std::wstring from the stream, including the length, converting
/// the characters from the stream codeset to the native codeset
/// (provide non-optimized default implementation)
virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR&,
std::wstring &);
#endif
virtual ACE_CDR::Boolean read_wchar_array (ACE_InputCDR&, virtual ACE_CDR::Boolean read_wchar_array (ACE_InputCDR&,
ACE_CDR::WChar*, ACE_CDR::WChar*,
ACE_CDR::ULong) = 0; ACE_CDR::ULong) = 0;
@@ -1344,6 +1402,16 @@ extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
const ACE_CDR::Char* x); const ACE_CDR::Char* x);
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
const ACE_CDR::WChar* x); const ACE_CDR::WChar* x);
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
ACE_OutputCDR::from_std_string x);
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
const std::string& x);
#if !defined(ACE_LACKS_STD_WSTRING)
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
ACE_OutputCDR::from_std_wstring x);
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
const std::wstring& x);
#endif
// Not used by CORBA or TAO // Not used by CORBA or TAO
extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
@@ -1389,6 +1457,16 @@ extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
ACE_CDR::Char*& x); ACE_CDR::Char*& x);
extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
ACE_CDR::WChar*& x); ACE_CDR::WChar*& x);
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_InputCDR &os,
ACE_InputCDR::to_std_string x);
extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
std::string& x);
#if !defined(ACE_LACKS_STD_WSTRING)
extern ACE_Export ACE_CDR::Boolean operator<< (ACE_InputCDR &os,
ACE_InputCDR::to_std_wstring x);
extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
std::wstring& x);
#endif
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -127,6 +127,40 @@ ACE_InputCDR::to_wstring::to_wstring (const ACE_CDR::WChar *&ws,
{ {
} }
ACE_INLINE
ACE_InputCDR::to_std_string::to_std_string (std::string &s,
ACE_CDR::ULong b)
: val_ (s),
bound_ (b)
{
}
ACE_INLINE
ACE_OutputCDR::from_std_string::from_std_string (const std::string &ws,
ACE_CDR::ULong b)
: val_ (ws),
bound_ (b)
{
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_INLINE
ACE_InputCDR::to_std_wstring::to_std_wstring (std::wstring &s,
ACE_CDR::ULong b)
: val_ (s),
bound_ (b)
{
}
ACE_INLINE
ACE_OutputCDR::from_std_wstring::from_std_wstring (const std::wstring &ws,
ACE_CDR::ULong b)
: val_ (ws),
bound_ (b)
{
}
#endif
ACE_INLINE ACE_INLINE
ACE_InputCDR::Transfer_Contents::Transfer_Contents (ACE_InputCDR &rhs) ACE_InputCDR::Transfer_Contents::Transfer_Contents (ACE_InputCDR &rhs)
: rhs_ (rhs) : rhs_ (rhs)
@@ -301,6 +335,26 @@ ACE_OutputCDR::write_wstring (const ACE_CDR::WChar *x)
return this->write_wstring (0, 0); return this->write_wstring (0, 0);
} }
ACE_INLINE ACE_CDR::Boolean
ACE_OutputCDR::write_string (const std::string &x)
{
ACE_CDR::ULong const len =
static_cast<ACE_CDR::ULong> (x.size ());
return this->write_string (len,
x.empty () ? 0 : x.c_str ());
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_INLINE ACE_CDR::Boolean
ACE_OutputCDR::write_wstring (const std::wstring &x)
{
ACE_CDR::ULong const len =
static_cast<ACE_CDR::ULong> (x.size ());
return this->write_wstring (len,
x.empty () ? 0 : x.c_str ());
}
#endif
ACE_INLINE ACE_CDR::Boolean ACE_INLINE ACE_CDR::Boolean
ACE_OutputCDR::write_char_array (const ACE_CDR::Char *x, ACE_OutputCDR::write_char_array (const ACE_CDR::Char *x,
ACE_CDR::ULong length) ACE_CDR::ULong length)
@@ -1220,6 +1274,46 @@ operator<< (ACE_OutputCDR &os, const ACE_CDR::WChar *x)
return (ACE_CDR::Boolean) os.good_bit (); return (ACE_CDR::Boolean) os.good_bit ();
} }
ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_std_string x)
{
ACE_CDR::ULong len =
static_cast<ACE_CDR::ULong> (x.val_.size ());
os.write_string (len, x.val_.c_str ());
return
(ACE_CDR::Boolean) (os.good_bit () && (!x.bound_ || len <= x.bound_));
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_std_wstring x)
{
ACE_CDR::ULong len =
static_cast<ACE_CDR::ULong> (x.val_.size ());
os.write_wstring (len, x.val_.c_str ());
return
(ACE_CDR::Boolean) (os.good_bit () && (!x.bound_ || len <= x.bound_));
}
#endif
ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_OutputCDR &os, const std::string& x)
{
os.write_string (x);
return (ACE_CDR::Boolean) os.good_bit ();
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_OutputCDR &os, const std::wstring& x)
{
os.write_wstring (x);
return (ACE_CDR::Boolean) os.good_bit ();
}
#endif
// The following use the helper classes // The following use the helper classes
ACE_INLINE ACE_CDR::Boolean ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_boolean x) operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_boolean x)
@@ -1359,6 +1453,20 @@ operator>> (ACE_InputCDR &is, ACE_CDR::WChar *&x)
return is.read_wstring (x) && is.good_bit (); return is.read_wstring (x) && is.good_bit ();
} }
ACE_INLINE ACE_CDR::Boolean
operator>> (ACE_InputCDR &is, std::string& x)
{
return is.read_string (x) && is.good_bit ();
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_INLINE ACE_CDR::Boolean
operator>> (ACE_InputCDR &is, std::wstring& x)
{
return is.read_wstring (x) && is.good_bit ();
}
#endif
// The following use the helper classes // The following use the helper classes
ACE_INLINE ACE_CDR::Boolean ACE_INLINE ACE_CDR::Boolean
operator>> (ACE_InputCDR &is, ACE_InputCDR::to_boolean x) operator>> (ACE_InputCDR &is, ACE_InputCDR::to_boolean x)
@@ -1406,6 +1514,29 @@ operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wstring x)
|| ACE_OS::strlen (x.val_) <= x.bound_)); || ACE_OS::strlen (x.val_) <= x.bound_));
} }
ACE_INLINE ACE_CDR::Boolean
operator>> (ACE_InputCDR &is, ACE_InputCDR::to_std_string x)
{
// check if the bounds are satisfied
return
(is.read_string (x.val_)
&& is.good_bit ()
&& (!x.bound_
|| static_cast<ACE_CDR::ULong> (x.val_.size ()) <= x.bound_));
}
#if !defined(ACE_LACKS_STD_WSTRING)
ACE_INLINE ACE_CDR::Boolean
operator>> (ACE_InputCDR &is, ACE_InputCDR::to_std_wstring x)
{
// check if the bounds are satisfied
return
(is.read_wstring (x.val_)
&& is.good_bit ()
&& (!x.bound_
|| static_cast<ACE_CDR::ULong> (x.val_.size ()) <= x.bound_));
}
#endif
// *************************************************************************** // ***************************************************************************
// We must define these methods here because they use the "read_*" inlined // We must define these methods here because they use the "read_*" inlined
// methods of the ACE_InputCDR class // methods of the ACE_InputCDR class
@@ -1515,7 +1646,11 @@ ACE_OutputCDR::append_string (ACE_InputCDR &stream)
ACE_CDR::Char *x = 0; ACE_CDR::Char *x = 0;
ACE_CDR::Boolean const flag = ACE_CDR::Boolean const flag =
(stream.read_string (x) ? this->write_string (x) : false); (stream.read_string (x) ? this->write_string (x) : false);
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free(x);
#else
delete [] x; delete [] x;
#endif /* ACE_HAS_ALLOC_HOOKS */
return flag; return flag;
} }
@@ -1525,7 +1660,11 @@ ACE_OutputCDR::append_wstring (ACE_InputCDR &stream)
ACE_CDR::WChar *x = 0; ACE_CDR::WChar *x = 0;
ACE_CDR::Boolean const flag = ACE_CDR::Boolean const flag =
(stream.read_wstring (x) ? this->write_wstring (x) : false); (stream.read_wstring (x) ? this->write_wstring (x) : false);
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free(x);
#else
delete [] x; delete [] x;
#endif /* ACE_HAS_ALLOC_HOOKS */
return flag; return flag;
} }

View File

@@ -46,7 +46,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_CE_Screen_Output : public ACE_Log_Msg_Callback class ACE_Export ACE_CE_Screen_Output : public ACE_Log_Msg_Callback
{ {
public: public:
ACE_CE_Screen_Output (HWND hEdit); ACE_CE_Screen_Output (HWND hEdit);
ACE_CE_Screen_Output (void); ACE_CE_Screen_Output (void);
@@ -89,11 +88,9 @@ public:
ACE_CE_Screen_Output& operator << (FILE* pFile); ACE_CE_Screen_Output& operator << (FILE* pFile);
private: private:
ACE_CE_Screen_Output (ACE_CE_Screen_Output&); ACE_CE_Screen_Output (ACE_CE_Screen_Output&);
private: private:
HWND handler_; HWND handler_;
/// FILE pointer that used to save output to file. This class does /// FILE pointer that used to save output to file. This class does

View File

@@ -1,360 +0,0 @@
# Copyright (C)
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# NOTE: Do not use glob here, it would include files we don't want
set(ace_STAT_SRCS
ACE.cpp
ACE_crc32.cpp
ACE_crc_ccitt.cpp
ace_wchar.cpp
Activation_Queue.cpp
Active_Map_Manager.cpp
Addr.cpp
Argv_Type_Converter.cpp
Assert.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
Atomic_Op_Sparc.c
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_Size.cpp
CDR_Stream.cpp
Cleanup.cpp
Codecs.cpp
Codeset_IBM1047.cpp
Codeset_Registry.cpp
Codeset_Registry_db.cpp
Condition_Attributes.cpp
Condition_Recursive_Thread_Mutex.cpp
Condition_Thread_Mutex.cpp
Configuration.cpp
Configuration_Import_Export.cpp
Connection_Recycling_Strategy.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
DLL.cpp
DLL_Manager.cpp
Dump.cpp
Dynamic.cpp
Dynamic_Message_Strategy.cpp
Dynamic_Service_Base.cpp
Dynamic_Service_Dependency.cpp
Encoding_Converter.cpp
Encoding_Converter_Factory.cpp
Event.cpp
Event_Handler.cpp
Event_Handler_Handle_Timeout_Upcall.cpp
Event_Base.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
Hashable.cpp
High_Res_Timer.cpp
ICMP_Socket.cpp
INET_Addr.cpp
Init_ACE.cpp
IO_Cntl_Msg.cpp
IO_SAP.cpp
IOStream.cpp
IPC_SAP.cpp
Lib_Find.cpp
Local_Memory_Pool.cpp
Local_Name_Space.cpp
Local_Tokens.cpp
Lock.cpp
Log_Category.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
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
Message_Queue_NT.cpp
Message_Queue_Vx.cpp
Method_Request.cpp
MMAP_Memory_Pool.cpp
Monitor_Admin.cpp
Monitor_Admin_Manager.cpp
Monitor_Base.cpp
Monitor_Control_Action.cpp
Monitor_Control_Types.cpp
Monitor_Point_Registry.cpp
Monitor_Size.cpp
Msg_WFMO_Reactor.cpp
Multihomed_INET_Addr.cpp
Mutex.cpp
Name_Proxy.cpp
Name_Request_Reply.cpp
Name_Space.cpp
Naming_Context.cpp
Netlink_Addr.cpp
Notification_Queue.cpp
Notification_Strategy.cpp
NT_Service.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_sendfile.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
Parse_Node.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
Proactor_Impl.cpp
Process.cpp
Process_Manager.cpp
Process_Mutex.cpp
Process_Semaphore.cpp
Profile_Timer.cpp
Reactor.cpp
Reactor_Impl.cpp
Reactor_Notification_Strategy.cpp
Reactor_Timer_Interface.cpp
Read_Buffer.cpp
Recursive_Thread_Mutex.cpp
Recyclable.cpp
Registry.cpp
Registry_Name_Space.cpp
Remote_Name_Space.cpp
Remote_Tokens.cpp
Rtems_init.c
RW_Mutex.cpp
RW_Process_Mutex.cpp
RW_Thread_Mutex.cpp
Sample_History.cpp
Sbrk_Memory_Pool.cpp
Sched_Params.cpp
Select_Reactor_Base.cpp
Semaphore.cpp
Service_Config.cpp
Service_Gestalt.cpp
Service_Manager.cpp
Service_Object.cpp
Service_Repository.cpp
Service_Types.cpp
Shared_Memory.cpp
Shared_Memory_MM.cpp
Shared_Memory_Pool.cpp
Shared_Memory_SV.cpp
Shared_Object.cpp
Sig_Adapter.cpp
Sig_Handler.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_Netlink.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
Stack_Trace.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
Svc_Conf_Lexer.cpp
Svc_Conf_y.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
Throughput_Stats.cpp
Time_Policy.cpp
Time_Value.cpp
Timeprobe.cpp
TLI.cpp
TLI_Acceptor.cpp
TLI_Connector.cpp
TLI_Stream.cpp
Token.cpp
Token_Collection.cpp
Token_Invariants.cpp
Token_Manager.cpp
Token_Request_Reply.cpp
TP_Reactor.cpp
Trace.cpp
TSS_Adapter.cpp
TTY_IO.cpp
UNIX_Addr.cpp
UPIPE_Acceptor.cpp
UPIPE_Connector.cpp
UPIPE_Stream.cpp
UTF16_Encoding_Converter.cpp
UTF32_Encoding_Converter.cpp
UTF8_Encoding_Converter.cpp
UUID.cpp
WFMO_Reactor.cpp
WIN32_Asynch_IO.cpp
WIN32_Proactor.cpp
XML_Svc_Conf.cpp
XTI_ATM_Mcast.cpp
)
if (USE_COREPCH)
set(PRIVATE_PCH_HEADER PrecompiledHeaders/WinAcePCH.h)
endif()
# Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_library(ace SHARED
${ace_STAT_SRCS}
)
target_include_directories(ace
PUBLIC
${CMAKE_SOURCE_DIR}/deps/acelite
PRIVATE
${CMAKE_SOURCE_DIR}/deps/zlib)
# Needed for PCH support
set_source_files_properties(Atomic_Op_Sparc.c Rtems_init.c PROPERTIES LANGUAGE CXX)
add_definitions(-DACE_BUILD_DLL)
if (MINGW) # GCC ignores "#prama comment"
target_link_libraries(ace ws2_32 iphlpapi netapi32 mswsock)
endif()
target_link_libraries(ace
PRIVATE
acore-dependency-interface)
# Generate precompiled header
if(USE_COREPCH)
add_cxx_pch(ace ${PRIVATE_PCH_HEADER})
endif()
install(TARGETS ace RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}")

View File

@@ -16,11 +16,9 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Manager) ACE_ALLOC_HOOK_DEFINE_Tc7(ACE_Cache_Map_Manager)
ACE_ALLOC_HOOK_DEFINE_Tc5(ACE_Cache_Map_Iterator)
ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Iterator) ACE_ALLOC_HOOK_DEFINE_Tc5(ACE_Cache_Map_Reverse_Iterator)
ACE_ALLOC_HOOK_DEFINE(ACE_Cache_Map_Reverse_Iterator)
template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES> template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class REVERSE_ITERATOR_IMPL, class CACHING_STRATEGY, class ATTRIBUTES>
ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_s, ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES>::ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_s,

View File

@@ -59,7 +59,6 @@ template <class KEY, class VALUE, class CMAP_TYPE, class ITERATOR_IMPL, class RE
class ACE_Cache_Map_Manager class ACE_Cache_Map_Manager
{ {
public: public:
// = Traits. // = Traits.
typedef KEY key_type; typedef KEY key_type;
typedef VALUE mapped_type; typedef VALUE mapped_type;
@@ -91,8 +90,6 @@ public:
*/ */
typedef std::pair<VALUE, ATTRIBUTES> CACHE_VALUE; typedef std::pair<VALUE, ATTRIBUTES> CACHE_VALUE;
// = Initialization and termination methods.
/// Initialize a <Cache_Map_Manager> with <caching_strategy> and /// Initialize a <Cache_Map_Manager> with <caching_strategy> and
/// @a size entries. /// @a size entries.
ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_strategy, ACE_Cache_Map_Manager (CACHING_STRATEGY &caching_strategy,
@@ -217,6 +214,9 @@ public:
/// The caching strategy used on the cache. /// The caching strategy used on the cache.
CACHING_STRATEGY &caching_strategy (void); CACHING_STRATEGY &caching_strategy (void);
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
protected: protected:
/// The underlying map which needs to be cached. /// The underlying map which needs to be cached.
@@ -226,11 +226,9 @@ protected:
CACHING_STRATEGY &caching_strategy_; CACHING_STRATEGY &caching_strategy_;
private: private:
// = Disallow these operations. // = Disallow these operations.
ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES> &)) ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES> &))
ACE_UNIMPLEMENTED_FUNC (ACE_Cache_Map_Manager (const ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES> &)) ACE_UNIMPLEMENTED_FUNC (ACE_Cache_Map_Manager (const ACE_Cache_Map_Manager<KEY, VALUE, CMAP_TYPE, ITERATOR_IMPL, REVERSE_ITERATOR_IMPL, CACHING_STRATEGY, ATTRIBUTES> &))
}; };
/** /**
@@ -244,9 +242,7 @@ private:
template <class KEY, class VALUE, class IMPLEMENTATION, class CACHING_STRATEGY, class ATTRIBUTES> template <class KEY, class VALUE, class IMPLEMENTATION, class CACHING_STRATEGY, class ATTRIBUTES>
class ACE_Cache_Map_Iterator class ACE_Cache_Map_Iterator
{ {
public: public:
// = Traits. // = Traits.
/// The actual value mapped to the key in the cache. The <attributes> /// The actual value mapped to the key in the cache. The <attributes>
/// are used by the strategy and is transparent to the cache user. /// are used by the strategy and is transparent to the cache user.
@@ -322,7 +318,6 @@ template <class KEY, class VALUE, class REVERSE_IMPLEMENTATION, class CACHING_ST
class ACE_Cache_Map_Reverse_Iterator class ACE_Cache_Map_Reverse_Iterator
{ {
public: public:
// = Traits. // = Traits.
/// The actual value mapped to the key in the cache. The <attributes> /// The actual value mapped to the key in the cache. The <attributes>
/// are used by the strategy and is transparent to the cache user. /// are used by the strategy and is transparent to the cache user.

View File

@@ -15,6 +15,9 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE_Tcoccc (ACE_Cached_Connect_Strategy_Ex)
ACE_ALLOC_HOOK_DEFINE_Tcoccc (ACE_Bounded_Cached_Connect_Strategy)
template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX>
ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::ACE_Cached_Connect_Strategy_Ex ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>::ACE_Cached_Connect_Strategy_Ex
(CACHING_STRATEGY &caching_s, (CACHING_STRATEGY &caching_s,
@@ -152,12 +155,12 @@ ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATE
sh = entry->int_id_.first; sh = entry->int_id_.first;
// Is the connection clean? // Is the connection clean?
int state_result = int const state_result =
ACE::handle_ready (sh->peer ().get_handle (), ACE::handle_ready (sh->peer ().get_handle (),
&ACE_Time_Value::zero, &ACE_Time_Value::zero,
1, // read ready true, // read ready
0, // write ready false, // write ready
1);// exception ready true);// exception ready
if (state_result == 1) if (state_result == 1)
{ {
@@ -555,7 +558,6 @@ ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATE
} }
} }
ACE_ALLOC_HOOK_DEFINE(ACE_Cached_Connect_Strategy_Ex)
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX> template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX>
@@ -605,9 +607,9 @@ ACE_Bounded_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_S
// Is the connection clean? // Is the connection clean?
int state_result= ACE::handle_ready (sh->peer ().get_handle (), int state_result= ACE::handle_ready (sh->peer ().get_handle (),
&ACE_Time_Value::zero, &ACE_Time_Value::zero,
1, // read ready true, // read ready
0, // write ready false, // write ready
1);// exception ready true);// exception ready
if (state_result == 1) if (state_result == 1)
{ {
@@ -721,8 +723,6 @@ ACE_Bounded_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_S
return 0; return 0;
} }
ACE_ALLOC_HOOK_DEFINE(ACE_Bounded_Cached_Connect_Strategy)
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_CACHED_CONNECT_STRATEGY_T_CPP */ #endif /* ACE_CACHED_CONNECT_STRATEGY_T_CPP */

View File

@@ -102,8 +102,10 @@ public:
// = Accessor. // = Accessor.
CACHING_STRATEGY &caching_strategy (void); CACHING_STRATEGY &caching_strategy (void);
protected: /// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
protected:
/// Find an idle handle. /// Find an idle handle.
int find (ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> &search_addr, int find (ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> &search_addr,
ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, std::pair<SVC_HANDLER *, ATTRIBUTES> > *&entry); ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, std::pair<SVC_HANDLER *, ATTRIBUTES> > *&entry);
@@ -203,7 +205,6 @@ template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1,
class ACE_Bounded_Cached_Connect_Strategy class ACE_Bounded_Cached_Connect_Strategy
: public ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX> : public ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>
{ {
typedef ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX> typedef ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATEGY, ATTRIBUTES, MUTEX>
CCSEBASE; CCSEBASE;
@@ -212,7 +213,6 @@ class ACE_Bounded_Cached_Connect_Strategy
REFCOUNTED_HASH_RECYCLABLE_ADDRESS; REFCOUNTED_HASH_RECYCLABLE_ADDRESS;
public: public:
/// Constructor /// Constructor
ACE_Bounded_Cached_Connect_Strategy (size_t max_size, ACE_Bounded_Cached_Connect_Strategy (size_t max_size,
CACHING_STRATEGY &caching_s, CACHING_STRATEGY &caching_s,
@@ -222,14 +222,13 @@ public:
MUTEX *lock = 0, MUTEX *lock = 0,
int delete_lock = 0); int delete_lock = 0);
/// Destructor /// Destructor
virtual ~ACE_Bounded_Cached_Connect_Strategy (void); virtual ~ACE_Bounded_Cached_Connect_Strategy (void);
/// Declare the dynamic allocation hooks. /// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE; ACE_ALLOC_HOOK_DECLARE;
protected: protected:
virtual int find_or_create_svc_handler_i (SVC_HANDLER *&sh, virtual int find_or_create_svc_handler_i (SVC_HANDLER *&sh,
const ACE_PEER_CONNECTOR_ADDR &remote_addr, const ACE_PEER_CONNECTOR_ADDR &remote_addr,
ACE_Time_Value *timeout, ACE_Time_Value *timeout,
@@ -242,7 +241,6 @@ protected:
int &found); int &found);
protected: protected:
/// Max items in the cache, used as a bound for the creation of svc_handlers. /// Max items in the cache, used as a bound for the creation of svc_handlers.
size_t max_size_; size_t max_size_;
}; };

View File

@@ -47,10 +47,11 @@ ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>::ACE_FIFO_Caching_Strateg
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
ACE_ALLOC_HOOK_DEFINE(ACE_LRU_Caching_Strategy) ACE_ALLOC_HOOK_DEFINE_Tccc(ACE_Caching_Strategy_Adapter)
ACE_ALLOC_HOOK_DEFINE(ACE_LFU_Caching_Strategy) ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_LRU_Caching_Strategy)
ACE_ALLOC_HOOK_DEFINE(ACE_FIFO_Caching_Strategy) ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_LFU_Caching_Strategy)
ACE_ALLOC_HOOK_DEFINE(ACE_Null_Caching_Strategy) ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_FIFO_Caching_Strategy)
ACE_ALLOC_HOOK_DEFINE_Tcc(ACE_Null_Caching_Strategy)
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -107,9 +107,7 @@ template <class ATTRIBUTES, class CACHING_UTILITY, class IMPLEMENTATION>
class ACE_Caching_Strategy_Adapter class ACE_Caching_Strategy_Adapter
: public ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> : public ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>
{ {
public: public:
/// Constructor. /// Constructor.
ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation = 0, ACE_Caching_Strategy_Adapter (IMPLEMENTATION *implementation = 0,
bool delete_implementation = false); bool delete_implementation = false);
@@ -162,8 +160,10 @@ public:
/// Dumps the state of the object. /// Dumps the state of the object.
void dump (void) const; void dump (void) const;
private: /// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
private:
/// Implementation class. /// Implementation class.
IMPLEMENTATION *implementation_; IMPLEMENTATION *implementation_;
@@ -197,7 +197,6 @@ template <class ATTRIBUTES, class CACHING_UTILITY>
class ACE_LRU_Caching_Strategy class ACE_LRU_Caching_Strategy
{ {
public: public:
// Traits. // Traits.
typedef ATTRIBUTES CACHING_ATTRIBUTES; typedef ATTRIBUTES CACHING_ATTRIBUTES;
@@ -257,8 +256,10 @@ public:
/// Dumps the state of the object. /// Dumps the state of the object.
void dump (void) const; void dump (void) const;
private: /// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
private:
/// This element is the one which is the deciding factor for purging /// This element is the one which is the deciding factor for purging
/// of an ITEM. /// of an ITEM.
ATTRIBUTES timer_; ATTRIBUTES timer_;
@@ -296,9 +297,7 @@ private:
template <class ATTRIBUTES, class CACHING_UTILITY> template <class ATTRIBUTES, class CACHING_UTILITY>
class ACE_LFU_Caching_Strategy class ACE_LFU_Caching_Strategy
{ {
public: public:
// Traits. // Traits.
typedef ATTRIBUTES CACHING_ATTRIBUTES; typedef ATTRIBUTES CACHING_ATTRIBUTES;
@@ -356,8 +355,10 @@ public:
/// Dumps the state of the object. /// Dumps the state of the object.
void dump (void) const; void dump (void) const;
private: /// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
private:
/// The level about which the purging will happen automagically. /// The level about which the purging will happen automagically.
double purge_percent_; double purge_percent_;
@@ -389,9 +390,7 @@ private:
template<class ATTRIBUTES, class CACHING_UTILITY> template<class ATTRIBUTES, class CACHING_UTILITY>
class ACE_FIFO_Caching_Strategy class ACE_FIFO_Caching_Strategy
{ {
public: public:
typedef ATTRIBUTES CACHING_ATTRIBUTES; typedef ATTRIBUTES CACHING_ATTRIBUTES;
// = Initialisation and termination. // = Initialisation and termination.
@@ -447,8 +446,10 @@ public:
/// Dumps the state of the object. /// Dumps the state of the object.
void dump (void) const; void dump (void) const;
private: /// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
private:
/// The order is the deciding factor for the item to be removed from /// The order is the deciding factor for the item to be removed from
/// the cache. /// the cache.
ATTRIBUTES order_; ATTRIBUTES order_;
@@ -476,9 +477,7 @@ private:
template<class ATTRIBUTES, class CACHING_UTILITY> template<class ATTRIBUTES, class CACHING_UTILITY>
class ACE_Null_Caching_Strategy class ACE_Null_Caching_Strategy
{ {
public: public:
// = Traits. // = Traits.
typedef ATTRIBUTES CACHING_ATTRIBUTES; typedef ATTRIBUTES CACHING_ATTRIBUTES;
@@ -524,8 +523,10 @@ public:
/// Dumps the state of the object. /// Dumps the state of the object.
void dump (void) const; void dump (void) const;
private: /// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
private:
/// This is the helper class which will decide and expunge entries /// This is the helper class which will decide and expunge entries
/// from the cache. /// from the cache.
CACHING_UTILITY caching_utility_; CACHING_UTILITY caching_utility_;

View File

@@ -43,7 +43,6 @@ template <class KEY, class VALUE, class CONTAINER, class ITERATOR, class ATTRIBU
class ACE_Pair_Caching_Utility : private ACE_Copy_Disabled class ACE_Pair_Caching_Utility : private ACE_Copy_Disabled
{ {
public: public:
typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY; typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY;
/// Constructor. /// Constructor.
@@ -91,9 +90,7 @@ protected:
template <class KEY, class VALUE, class CONTAINER, class ITERATOR, class ATTRIBUTES> template <class KEY, class VALUE, class CONTAINER, class ITERATOR, class ATTRIBUTES>
class ACE_Recyclable_Handler_Caching_Utility : private ACE_Copy_Disabled class ACE_Recyclable_Handler_Caching_Utility : private ACE_Copy_Disabled
{ {
public: public:
typedef ACE_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY; typedef ACE_Recyclable_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY;
typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY_BASE; typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY_BASE;
@@ -202,7 +199,6 @@ template <class KEY, class VALUE, class CONTAINER, class ITERATOR, class ATTRIBU
class ACE_Handler_Caching_Utility : private ACE_Copy_Disabled class ACE_Handler_Caching_Utility : private ACE_Copy_Disabled
{ {
public: public:
typedef ACE_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY; typedef ACE_Handler_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY;
typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY_BASE; typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY_BASE;
@@ -257,7 +253,6 @@ template <class KEY, class VALUE, class CONTAINER, class ITERATOR, class ATTRIBU
class ACE_Null_Caching_Utility : private ACE_Copy_Disabled class ACE_Null_Caching_Utility : private ACE_Copy_Disabled
{ {
public: public:
typedef ACE_Null_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY; typedef ACE_Null_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY;
typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY_BASE; typedef ACE_Cleanup_Strategy<KEY, VALUE, CONTAINER> CLEANUP_STRATEGY_BASE;

View File

@@ -283,7 +283,6 @@ ACE_Capabilities::getval (const ACE_TCHAR *keyname, int &val)
return 0; return 0;
} }
#if !defined (ACE_IS_SPLITTING)
static int static int
is_empty (const ACE_TCHAR *line) is_empty (const ACE_TCHAR *line)
{ {
@@ -301,7 +300,6 @@ is_line (const ACE_TCHAR *line)
return *line != ACE_TEXT ('\0'); return *line != ACE_TEXT ('\0');
} }
#endif /* !ACE_IS_SPLITTING */
int int
ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name) ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name)
@@ -347,4 +345,8 @@ ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name)
return -1; return -1;
} }
ACE_ALLOC_HOOK_DEFINE(ACE_StringCapEntry)
ACE_ALLOC_HOOK_DEFINE(ACE_IntCapEntry)
ACE_ALLOC_HOOK_DEFINE(ACE_BoolCapEntry)
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL

View File

@@ -25,11 +25,6 @@
#include "ace/SString.h" #include "ace/SString.h"
#include "ace/Functor_String.h" #include "ace/Functor_String.h"
#if defined (ACE_IS_SPLITTING)
# include "ace/OS_NS_ctype.h"
#endif /* ACE_IS_SPLITTING */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/** /**
@@ -45,11 +40,9 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_CapEntry class ACE_Export ACE_CapEntry
{ {
public: public:
virtual ~ACE_CapEntry (void); virtual ~ACE_CapEntry (void);
protected: protected:
enum enum
{ {
ACE_INTCAP = 0, ACE_INTCAP = 0,
@@ -60,9 +53,7 @@ protected:
ACE_CapEntry (int captype); ACE_CapEntry (int captype);
protected: protected:
int captype_; int captype_;
}; };
/** /**
@@ -78,6 +69,7 @@ class ACE_Export ACE_IntCapEntry : public ACE_CapEntry
public: public:
ACE_IntCapEntry (int val); ACE_IntCapEntry (int val);
int getval (void) const; int getval (void) const;
ACE_ALLOC_HOOK_DECLARE;
protected: protected:
int val_; int val_;
@@ -96,6 +88,7 @@ class ACE_Export ACE_StringCapEntry : public ACE_CapEntry
public: public:
ACE_StringCapEntry (const ACE_TString &val); ACE_StringCapEntry (const ACE_TString &val);
ACE_TString getval (void) const; ACE_TString getval (void) const;
ACE_ALLOC_HOOK_DECLARE;
protected: protected:
ACE_TString val_; ACE_TString val_;
@@ -114,6 +107,7 @@ class ACE_Export ACE_BoolCapEntry : public ACE_CapEntry
public: public:
ACE_BoolCapEntry (int val); ACE_BoolCapEntry (int val);
int getval (void) const; int getval (void) const;
ACE_ALLOC_HOOK_DECLARE;
protected: protected:
int val_; int val_;
@@ -138,7 +132,6 @@ protected:
class ACE_Export ACE_Capabilities class ACE_Export ACE_Capabilities
{ {
public: public:
typedef ACE_Hash_Map_Manager_Ex<ACE_TString, ACE_CapEntry *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex> CAPABILITIES_MAP; typedef ACE_Hash_Map_Manager_Ex<ACE_TString, ACE_CapEntry *, ACE_Hash<ACE_TString>, ACE_Equal_To<ACE_TString>, ACE_Null_Mutex> CAPABILITIES_MAP;
/// The Constructor /// The Constructor
@@ -148,7 +141,6 @@ public:
~ACE_Capabilities(void); ~ACE_Capabilities(void);
public: public:
/// Get a string entry. /// Get a string entry.
int getval (const ACE_TCHAR *ent, ACE_TString &val); int getval (const ACE_TCHAR *ent, ACE_TString &val);
@@ -160,7 +152,6 @@ public:
int getent (const ACE_TCHAR *fname, const ACE_TCHAR *name); int getent (const ACE_TCHAR *fname, const ACE_TCHAR *name);
protected: protected:
/// Parse an integer property /// Parse an integer property
const ACE_TCHAR *parse (const ACE_TCHAR *buf, int &cap); const ACE_TCHAR *parse (const ACE_TCHAR *buf, int &cap);
@@ -184,31 +175,10 @@ protected:
void resetcaps (void); void resetcaps (void);
private: private:
/// This is the set of ACE_CapEntry. /// This is the set of ACE_CapEntry.
CAPABILITIES_MAP caps_; CAPABILITIES_MAP caps_;
}; };
#if defined (ACE_IS_SPLITTING)
int
is_empty (const ACE_TCHAR *line)
{
while (*line && ACE_OS::ace_isspace (*line))
++line;
return *line == ACE_TEXT ('\0') || *line == ACE_TEXT ('#');
}
int
is_line (const ACE_TCHAR *line)
{
while (*line && ACE_OS::ace_isspace (*line))
++line;
return *line != ACE_TEXT ('\0');
}
#endif /* ACE_IS_SPLITTING */
ACE_END_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__) #if defined (__ACE_INLINE__)

View File

@@ -8,6 +8,10 @@
#include "ace/OS_NS_string.h" #include "ace/OS_NS_string.h"
#include "ace/os_include/os_typeinfo.h" #include "ace/os_include/os_typeinfo.h"
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL
void void
@@ -52,9 +56,15 @@ ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (void *object,
ACE_Cleanup_Info_Node::~ACE_Cleanup_Info_Node (void) ACE_Cleanup_Info_Node::~ACE_Cleanup_Info_Node (void)
{ {
if (this->name_) if (this->name_)
#if defined (ACE_HAS_ALLOC_HOOKS)
ACE_Allocator::instance()->free ((void *) name_);
#else
ACE_OS::free ((void *) name_); ACE_OS::free ((void *) name_);
#endif /* ACE_HAS_ALLOC_HOOKS */
} }
ACE_ALLOC_HOOK_DEFINE(ACE_Cleanup_Info_Node)
bool bool
ACE_Cleanup_Info_Node::operator== (const ACE_Cleanup_Info_Node &o) const ACE_Cleanup_Info_Node::operator== (const ACE_Cleanup_Info_Node &o) const
{ {

Some files were not shown because too many files have changed in this diff Show More