Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
abstract_shared_mem.h
Go to the documentation of this file.
1 // Copyright 2011 Google Inc.
16 
17 #ifndef PAGESPEED_KERNEL_BASE_ABSTRACT_SHARED_MEM_H_
18 #define PAGESPEED_KERNEL_BASE_ABSTRACT_SHARED_MEM_H_
19 
20 #include <cstddef>
23 
24 namespace net_instaweb {
25 
26 class AbstractMutex;
27 class MessageHandler;
28 
32  public:
34 
37  virtual ~AbstractSharedMemSegment();
38 
42  virtual volatile char* Base() = 0;
43 
45  virtual size_t SharedMutexSize() const = 0;
46 
56  virtual bool InitializeSharedMutex(size_t offset,
57  MessageHandler* handler) = 0;
58  virtual AbstractMutex* AttachToSharedMutex(size_t offset) = 0;
59 
60  private:
61 
62 };
63 
87  public:
89  virtual ~AbstractSharedMem();
90 
92  virtual size_t SharedMutexSize() const = 0;
93 
101  const GoogleString& name, size_t size, MessageHandler* handler) = 0;
102 
106  const GoogleString& name, size_t size, MessageHandler* handler) = 0;
107 
110  virtual void DestroySegment(const GoogleString& name,
111  MessageHandler* handler) = 0;
112 
116  virtual bool IsDummy() { return false; }
117 
118  private:
119 
120 };
121 
122 }
123 
124 #endif
virtual AbstractSharedMemSegment * AttachToSegment(const GoogleString &name, size_t size, MessageHandler *handler)=0
virtual AbstractSharedMemSegment * CreateSegment(const GoogleString &name, size_t size, MessageHandler *handler)=0
Abstract interface for implementing a mutex.
Definition: abstract_mutex.h:28
virtual void DestroySegment(const GoogleString &name, MessageHandler *handler)=0
virtual bool IsDummy()
Definition: abstract_shared_mem.h:116
virtual volatile char * Base()=0
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: abstract_shared_mem.h:86
virtual size_t SharedMutexSize() const =0
Returns the number of bytes a mutex inside shared memory takes.
virtual size_t SharedMutexSize() const =0
Size of mutexes inside shared memory segments.
virtual bool InitializeSharedMutex(size_t offset, MessageHandler *handler)=0
Definition: message_handler.h:39
Definition: abstract_shared_mem.h:31