00001
00002
00003 #include "ace/Shared_Memory_MM.h"
00004
00005 #if !defined (__ACE_INLINE__)
00006 #include "ace/Shared_Memory_MM.inl"
00007 #endif
00008
00009
00010 ACE_RCSID (ace,
00011 Shared_Memory_MM,
00012 "Shared_Memory_MM.cpp,v 4.10 2006/03/30 12:31:30 jwillemsen Exp")
00013
00014 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00015
00016 ACE_ALLOC_HOOK_DEFINE(ACE_Shared_Memory_MM)
00017
00018 void
00019 ACE_Shared_Memory_MM::dump (void) const
00020 {
00021 #if defined (ACE_HAS_DUMP)
00022 ACE_TRACE ("ACE_Shared_Memory_MM::dump");
00023 #endif
00024 }
00025
00026
00027
00028 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM (ACE_HANDLE handle,
00029 int length,
00030 int prot,
00031 int share,
00032 char *addr,
00033 off_t pos)
00034 : shared_memory_ (handle, length, prot, share, addr, pos)
00035 {
00036 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
00037 }
00038
00039 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM (const ACE_TCHAR *file_name,
00040 int len,
00041 int flags,
00042 int mode,
00043 int prot,
00044 int share,
00045 char *addr,
00046 off_t pos)
00047 : shared_memory_ (file_name, len, flags, mode,
00048 prot, share, addr, pos)
00049 {
00050 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
00051 }
00052
00053
00054
00055 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM (void)
00056 {
00057 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
00058 }
00059
00060
00061
00062 int
00063 ACE_Shared_Memory_MM::get_segment_size (void) const
00064 {
00065 ACE_TRACE ("ACE_Shared_Memory_MM::get_segment_size");
00066
00067 return static_cast<int> (this->shared_memory_.size ());
00068 }
00069
00070
00071
00072 int
00073 ACE_Shared_Memory_MM::remove (void)
00074 {
00075 ACE_TRACE ("ACE_Shared_Memory_MM::remove");
00076 return shared_memory_.remove ();
00077 }
00078
00079
00080
00081 int
00082 ACE_Shared_Memory_MM::close (void)
00083 {
00084 ACE_TRACE ("ACE_Shared_Memory_MM::close");
00085 return shared_memory_.unmap ();
00086 }
00087
00088 void *
00089 ACE_Shared_Memory_MM::malloc (size_t)
00090 {
00091 ACE_TRACE ("ACE_Shared_Memory_MM::malloc");
00092 void *addr = 0;
00093
00094 return this->shared_memory_ (addr) == -1 ? 0 : addr;
00095 }
00096
00097 ACE_HANDLE
00098 ACE_Shared_Memory_MM::get_id (void) const
00099 {
00100 ACE_TRACE ("ACE_Shared_Memory_MM::get_id");
00101 return this->shared_memory_.handle ();
00102 }
00103
00104 int
00105 ACE_Shared_Memory_MM::free (void *p)
00106 {
00107 ACE_TRACE ("ACE_Shared_Memory_MM::free");
00108 return p != 0;
00109 }
00110
00111 ACE_END_VERSIONED_NAMESPACE_DECL