sharelib/SegmentHeader.h

Go to the documentation of this file.
00001 #ifndef SEGMENT_HEADER_H
00002 #define SEGMENT_HEADER_H
00003 
00012 #include "DefaultAllocator.h"
00013 #include "DefaultRefCounter.h"
00014 #include "MutexLock.h"
00015 
00016 namespace Share {
00017   typedef DefaultAllocator TSegmentAllocator;      
00018   typedef DefaultRefCounter TSegmentRefCounter;    
00019 
00027   class SegmentHeader {
00028     public:
00029 
00035       SHARE_EXPORT SegmentHeader (const char *name, size_t dataSize);
00036 
00041       SHARE_EXPORT static size_t sizeNeeded (const char *name, size_t dataSize);
00042 
00046       SHARE_EXPORT void *alloc (size_t size) throw (ShareException);
00047 
00051       SHARE_EXPORT void free (void *addr) throw ();
00052 
00056       SHARE_EXPORT size_t size();
00057 
00061       SHARE_EXPORT size_t available();
00062  
00066       SHARE_EXPORT void notifyAttach();
00067 
00071       SHARE_EXPORT void notifyDetach();
00072 
00076       SHARE_EXPORT int refCount();
00077 
00081       SHARE_EXPORT void unlink();
00082 
00086       SHARE_EXPORT bool isUnlinked();
00087 
00091       SHARE_EXPORT bool shouldBeDestroyed();
00092 
00096       typedef RelocPtr<char> TStringZ;
00097 
00098     protected:
00102       TSegmentAllocator allocator_;
00103 
00107       TSegmentRefCounter refCounter_;
00108 
00112       TStringZ mutexName_;
00113 
00117       Mutex mutex_;
00118   };
00119 }
00120 
00121 #endif // SEGMENT_HEADER_H

Generated on Sun Aug 26 17:42:59 2007 for ShareLibrary by  doxygen 1.5.2