Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Shared_Memory_MM.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: Shared_Memory_MM.i,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00003 
00004 // Shared_Memory_MM.i
00005 
00006 // Return the name of file that is mapped (if any).
00007 
00008 ACE_INLINE const ACE_TCHAR *
00009 ACE_Shared_Memory_MM::filename (void) const
00010 {
00011   return this->shared_memory_.filename ();
00012 }
00013 
00014 ACE_INLINE int
00015 ACE_Shared_Memory_MM::open (ACE_HANDLE handle,
00016                             int length,
00017                             int prot,
00018                             int share,
00019                             char *addr,
00020                             off_t pos)
00021 {
00022   ACE_TRACE ("ACE_Shared_Memory_MM::open");
00023   return shared_memory_.map (handle, length, prot, share, addr, pos);
00024 }
00025 
00026 ACE_INLINE int
00027 ACE_Shared_Memory_MM::open (const ACE_TCHAR *file_name,
00028                             int len,
00029                             int flags,
00030                             int mode,
00031                             int prot,
00032                             int share,
00033                             char *addr,
00034                             off_t pos)
00035 {
00036   ACE_TRACE ("ACE_Shared_Memory_MM::open");
00037   return shared_memory_.map (file_name, len, flags, mode,
00038                              prot, share, addr, pos);
00039 }
00040 
00041 // The overall size of the segment.
00042 
00043 ACE_INLINE int
00044 ACE_Shared_Memory_MM::get_segment_size (void) const
00045 {
00046   ACE_TRACE ("ACE_Shared_Memory_MM::get_segment_size");
00047   // This cast is legit since the original length in open() is an int.
00048   return ACE_static_cast (int, this->shared_memory_.size ());
00049 }
00050 
00051 // Unmaps the shared memory segment.
00052 
00053 ACE_INLINE int
00054 ACE_Shared_Memory_MM::remove (void)
00055 {
00056   ACE_TRACE ("ACE_Shared_Memory_MM::remove");
00057   return shared_memory_.remove ();
00058 }
00059 
00060 // Closes (unmaps) the shared memory segment.
00061 
00062 ACE_INLINE int
00063 ACE_Shared_Memory_MM::close (void)
00064 {
00065   ACE_TRACE ("ACE_Shared_Memory_MM::close");
00066   return shared_memory_.unmap ();
00067 }
00068 
00069 ACE_INLINE void *
00070 ACE_Shared_Memory_MM::malloc (size_t)
00071 {
00072   ACE_TRACE ("ACE_Shared_Memory_MM::malloc");
00073   void *addr;
00074 
00075   return this->shared_memory_ (addr) == -1 ? 0 : addr;
00076 }
00077 
00078 ACE_INLINE ACE_HANDLE
00079 ACE_Shared_Memory_MM::get_id (void) const
00080 {
00081   ACE_TRACE ("ACE_Shared_Memory_MM::get_id");
00082   return this->shared_memory_.handle ();
00083 }
00084 
00085 ACE_INLINE int
00086 ACE_Shared_Memory_MM::free (void *p)
00087 {
00088   ACE_TRACE ("ACE_Shared_Memory_MM::free");
00089   return p != 0;
00090 }

Generated on Mon Jun 16 11:21:13 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002