OpenDDS  Snapshot(2023/04/28-20:55)
ShmemAllocator.h
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.opendds.org/license.html
4  */
5 
6 #ifndef OPENDDS_DCPS_TRANSPORT_SHMEM_SHMEMALLOCATOR_H
7 #define OPENDDS_DCPS_TRANSPORT_SHMEM_SHMEMALLOCATOR_H
8 
10 
11 #include <ace/Local_Memory_Pool.h>
12 #include <ace/Malloc_T.h>
14 #include <ace/PI_Malloc.h>
15 #include <ace/Process_Mutex.h>
16 #include <ace/Shared_Memory_Pool.h>
17 
19 
20 namespace OpenDDS {
21 namespace DCPS {
22 
23 class ShmemInst;
24 
25 #if defined ACE_WIN32 && !defined ACE_HAS_WINCE
26 # define OPENDDS_SHMEM_WINDOWS
28 typedef HANDLE ShmemSharedSemaphore;
29 
30 #elif !defined ACE_LACKS_SYSV_SHMEM \
31  && defined ACE_HAS_POSIX_SEM \
32  && !defined ACE_LACKS_UNNAMED_SEMAPHORE
33 # define OPENDDS_SHMEM_UNIX
35 typedef sem_t ShmemSharedSemaphore;
36 # if !defined ACE_HAS_POSIX_SEM_TIMEOUT && \
37  !defined ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION
38 # define OPENDDS_SHMEM_UNIX_EMULATE_SEM_TIMEOUT
39 # endif
40 
41 // No Support for this Platform, Trying to Use Shared Memory Transport Will
42 // Yield a Runtime Error
43 #else
44 # define OPENDDS_SHMEM_UNSUPPORTED
45 // These are just place holders
48 #endif
49 
51 
52 } // namespace DCPS
53 } // namespace OpenDDS
54 
56 
57 #endif /* OPENDDS_DCPS_TRANSPORT_SHMEM_SHMEMALLOCATOR_H */
ACE_Local_Memory_Pool ShmemPool
ACE_Malloc_T< ShmemPool, ACE_Process_Mutex, ACE_PI_Control_Block > ShmemAllocator
int ShmemSharedSemaphore
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28