00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACE_SHARED_MALLOC_MM_H
00015 #define ACE_SHARED_MALLOC_MM_H
00016 #include "ace/pre.h"
00017
00018 #include "ace/Shared_Memory.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif
00023
00024 #include "ace/Mem_Map.h"
00025
00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class ACE_Export ACE_Shared_Memory_MM : public ACE_Shared_Memory
00038 {
00039 public:
00040
00041
00042 ACE_Shared_Memory_MM (void);
00043
00044
00045 ACE_Shared_Memory_MM (ACE_HANDLE handle,
00046 int length = -1,
00047 int prot = PROT_RDWR,
00048 int share = ACE_MAP_PRIVATE,
00049 char *addr = 0,
00050 off_t pos = 0);
00051
00052
00053 ACE_Shared_Memory_MM (const ACE_TCHAR *file_name,
00054 int len = -1,
00055 int flags = O_RDWR | O_CREAT,
00056 int mode = ACE_DEFAULT_FILE_PERMS,
00057 int prot = PROT_RDWR,
00058 int share = ACE_MAP_SHARED,
00059 char *addr = 0, off_t pos = 0);
00060
00061
00062 int open (ACE_HANDLE handle,
00063 int length = -1,
00064 int prot = PROT_RDWR,
00065 int share = ACE_MAP_PRIVATE,
00066 char *addr = 0,
00067 off_t pos = 0);
00068
00069
00070 int open (const ACE_TCHAR *file_name,
00071 int len = -1,
00072 int flags = O_RDWR | O_CREAT,
00073 int mode = ACE_DEFAULT_FILE_PERMS,
00074 int prot = PROT_RDWR,
00075 int share = ACE_MAP_SHARED,
00076 char *addr = 0,
00077 off_t pos = 0);
00078
00079
00080 const ACE_TCHAR *filename (void) const;
00081
00082
00083 virtual int close (void);
00084
00085
00086 virtual int remove (void);
00087
00088
00089
00090 virtual void *malloc (size_t size = 0);
00091
00092
00093
00094 virtual int free (void *p);
00095
00096
00097 virtual int get_segment_size (void) const;
00098
00099
00100 virtual ACE_HANDLE get_id (void) const;
00101
00102
00103 void dump (void) const;
00104
00105
00106 ACE_ALLOC_HOOK_DECLARE;
00107
00108 private:
00109
00110 ACE_Mem_Map shared_memory_;
00111 };
00112
00113 ACE_END_VERSIONED_NAMESPACE_DECL
00114
00115 #if defined (__ACE_INLINE__)
00116 #include "ace/Shared_Memory_MM.inl"
00117 #endif
00118
00119 #include "ace/post.h"
00120 #endif