ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
TMapFile Class Reference

This class implements a shared memory region mapped to a file.

Objects can be placed into this shared memory area using the Add() member function. To actually place a copy of the object is shared memory call Update() also whenever the mapped object(s) change(s) call Update() to put a fresh copy in the shared memory. This extra step is necessary since it is not possible to share objects with virtual pointers between processes (the vtbl ptr points to the originators unique address space and can not be used by the consumer process(es)). Consumer processes can map the memory region from this file and access the objects stored in it via the Get() method (which returns a copy of the object stored in the shared memory with correct vtbl ptr set). Only objects of classes with a Streamer() member function defined can be shared.

I know the current implementation is not ideal (you need to copy to and from the shared memory file) but the main problem is with the class' virtual_table pointer. This pointer points to a table unique for every process. Therefore, different options are:

  1. One could allocate an object directly in shared memory in the producer, but the consumer still has to copy the object from shared memory into a local object which has the correct vtbl pointer for that process (copy ctor's can be used for creating the local copy).
  2. Another possibility is to only allow objects without virtual functions in shared memory (like simple C structs), or to forbid (how?) the consumer from calling any virtual functions of the objects in shared memory.
  3. A last option is to copy the object internals to shared memory and copy them again from there. This is what is done in the TMapFile (using the object Streamer() to make a deep copy).

Option 1) saves one copy, but requires solid copy ctor's (along the full inheritance chain) to rebuild the object in the consumer. Most classes don't provide these copy ctor's, especially not when objects contain collections, etc. 2) is too limiting or dangerous (calling accidentally a virtual function will segv). So since we have a robust Streamer mechanism I opted for 3).

Definition at line 34 of file TMapFile.h.

Public Types

enum  { kDefaultMapSize = 0x80000 }
 
- Public Types inherited from TObject
enum  EStatusBits {
  kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4),
  kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13)
}
 
enum  { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff }
 
enum  { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) }
 

Public Member Functions

virtual ~TMapFile ()
 TMapFiles may not be deleted, since we want to keep the complete TMapFile object in the mapped file for later re-use. More...
 
void operator delete (void *vp)
 Need special "operator delete" in which we close the shared memory. More...
 
void Browse (TBrowser *b)
 Browse contents of TMapFile. More...
 
void Close (Option_t *option="")
 Close a mapped file. More...
 
voidGetBaseAddr () const
 
voidGetBreakval () const
 Return the current location in the memory region for this malloc heap which represents the end of memory in use. More...
 
TDirectoryGetDirectory () const
 
Int_t GetFd () const
 
voidGetMmallocDesc () const
 
const char * GetName () const
 Returns name of object. More...
 
Int_t GetSize () const
 
const char * GetOption () const
 
const char * GetTitle () const
 Returns title of object. More...
 
TMapRecGetFirst () const
 
TMapRecGetLast () const
 
Bool_t IsFolder () const
 Returns kTRUE in case object is a folder (i.e. contains browsable lists). More...
 
Bool_t IsWritable () const
 
voidOrgAddress (void *addr) const
 
void Print (Option_t *option="") const
 Print some info about the mapped file. More...
 
void ls (Option_t *option="") const
 List contents of TMapFile. More...
 
Bool_t cd (const char *path=0)
 Cd to associated directory. More...
 
void Add (const TObject *obj, const char *name="")
 Add an object to the list of objects to be stored in shared memory. More...
 
void Update (TObject *obj=0)
 Update an object (or all objects, if obj == 0) in shared memory. More...
 
TObjectRemove (TObject *obj)
 
TObjectRemove (const char *name)
 
void RemoveAll ()
 Remove all objects from shared memory. More...
 
TObjectGet (const char *name, TObject *retObj=0)
 Return pointer to object retrieved from shared memory. More...
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method. More...
 
virtual void Copy (TObject &object) const
 Copy this to obj. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object. More...
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current pad. More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 Execute method on this object with the given parameter string, e.g. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py). More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
virtual Bool_t IsSortable () const
 
Bool_t IsOnHeap () const
 
Bool_t IsZombie () const
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 
voidoperator new (size_t sz)
 
voidoperator new[] (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz, void *vp)
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
void SetBit (UInt_t f)
 
void ResetBit (UInt_t f)
 
Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
void InvertBit (UInt_t f)
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 

Static Public Member Functions

static TMapFileCreate (const char *name, Option_t *option="READ", Int_t size=kDefaultMapSize, const char *title="")
 Create a memory mapped file. More...
 
static TMapFileWhichMapFile (void *addr)
 
static void SetMapAddress (Long_t addr)
 Set preferred map address. More...
 
- Static Public Member Functions inherited from TObject
static Long_t GetDtorOnly ()
 Return destructor only flag. More...
 
static void SetDtorOnly (void *obj)
 Set destructor only flag. More...
 
static Bool_t GetObjectStat ()
 Get status of object stat flag. More...
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable. More...
 

Protected Member Functions

 TMapFile ()
 
 TMapFile (const char *name, const char *title, Option_t *option, Int_t size, TMapFile *&newMapFile)
 Create a memory mapped file. More...
 
 TMapFile (const TMapFile &f, Long_t offset=0)
 Private copy ctor. More...
 
void operator= (const TMapFile &rhs)
 
TMapFileFindShadowMapFile ()
 Returns shadow map file. More...
 
void InitDirectory ()
 Create the directory associated to this mapfile. More...
 
TObjectRemove (TObject *obj, Bool_t lock)
 Remove object from shared memory. More...
 
TObjectRemove (const char *name, Bool_t lock)
 Remove object by name from shared memory. More...
 
void SumBuffer (Int_t bufsize)
 Increment statistics for buffer sizes of objects in this file. More...
 
Int_t GetBestBuffer ()
 Return the best buffer size for objects in this file. More...
 
void CreateSemaphore (Int_t pid=0)
 Create semaphore used for synchronizing access to shared memory. More...
 
Int_t AcquireSemaphore ()
 Acquire semaphore. Returns 0 if OK, -1 on error. More...
 
Int_t ReleaseSemaphore ()
 Release semaphore. Returns 0 if OK, -1 on error. More...
 
void DeleteSemaphore ()
 Delete the semaphore. More...
 
- Protected Member Functions inherited from TObject
void MakeZombie ()
 
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected). More...
 

Static Protected Member Functions

static voidMapToAddress ()
 Return the base address at which we would like the next TMapFile's mapped data to start. More...
 

Private Attributes

Int_t fFd
 Descriptor of mapped file. More...
 
Int_t fVersion
 ROOT version (or -1 for shadow map file) More...
 
char * fName
 Name of mapped file. More...
 
char * fTitle
 Title of mapped file. More...
 
char * fOption
 Directory creation options. More...
 
voidfMmallocDesc
 Pointer to mmalloc descriptor. More...
 
ULong_t fBaseAddr
 Base address of mapped memory region. More...
 
Int_t fSize
 Original start size of memory mapped region. More...
 
TMapRecfFirst
 List of streamed objects is shared memory. More...
 
TMapRecfLast
 Last object in list of shared objects. More...
 
Long_t fOffset
 Offset in bytes for region mapped by reader. More...
 
TDirectoryfDirectory
 Pointer to directory associated to this mapfile. More...
 
TListfBrowseList
 List of KeyMapFile objects. More...
 
Bool_t fWritable
 TRUE if mapped file opened in RDWR mode. More...
 
Int_t fSemaphore
 Modification semaphore (or getpid() for WIN32) More...
 
ULong_t fhSemaphore
 HANDLE of WIN32 Mutex object to implement semaphore. More...
 
TObjectfGetting
 Don't deadlock in update mode, when from Get() Add() is called. More...
 
Int_t fWritten
 Number of objects written sofar. More...
 
Double_t fSumBuffer
 Sum of buffer sizes of objects written sofar. More...
 
Double_t fSum2Buffer
 Sum of squares of buffer sizes of objects written so far. More...
 

Static Private Attributes

static Long_t fgMapAddress = 0
 Map to this address, set address via SetMapAddress() More...
 
static voidfgMmallocDesc = 0
 Used in Close() and operator delete() More...
 

Friends

class TMapRec
 

#include <TMapFile.h>

Inheritance diagram for TMapFile:
[legend]

Member Enumeration Documentation

anonymous enum
Enumerator
kDefaultMapSize 

Definition at line 84 of file TMapFile.h.

Constructor & Destructor Documentation

TMapFile::TMapFile ( )
protected

Referenced by Create(), and TMapFile().

TMapFile::TMapFile ( const char *  name,
const char *  title,
Option_t option,
Int_t  size,
TMapFile *&  newMapFile 
)
protected

Create a memory mapped file.

This opens a file (to which the memory will be mapped) and attaches a memory region to it. Option can be either: "NEW", "CREATE", "RECREATE", "UPDATE" or "READ" (see TFile). The default open mode is "READ". The size argument specifies the maximum size of shared memory file in bytes. This protected ctor is called via the static Create() method.

Definition at line 204 of file TMapFile.cxx.

TMapFile::TMapFile ( const TMapFile f,
Long_t  offset = 0 
)
protected

Private copy ctor.

Used by the the ctor to create a new version of TMapFile in the memory mapped heap. It's main purpose is to correctly create the string data members.

Definition at line 487 of file TMapFile.cxx.

TMapFile::~TMapFile ( )
virtual

TMapFiles may not be deleted, since we want to keep the complete TMapFile object in the mapped file for later re-use.

To enforce this the delete operator has been made private. Use Close() to properly terminate a TMapFile (also done via the TROOT dtor).

Definition at line 521 of file TMapFile.cxx.

Member Function Documentation

Int_t TMapFile::AcquireSemaphore ( )
protected

Acquire semaphore. Returns 0 if OK, -1 on error.

Definition at line 843 of file TMapFile.cxx.

Referenced by Add(), Browse(), Get(), Remove(), RemoveAll(), and Update().

void TMapFile::Add ( const TObject obj,
const char *  name = "" 
)

Add an object to the list of objects to be stored in shared memory.

To place the object actually into shared memory call Update().

Definition at line 561 of file TMapFile.cxx.

Referenced by TDirectoryFile::Append().

void TMapFile::Browse ( TBrowser b)
virtual

Browse contents of TMapFile.

Reimplemented from TObject.

Definition at line 1007 of file TMapFile.cxx.

Bool_t TMapFile::cd ( const char *  path = 0)

Cd to associated directory.

Definition at line 1034 of file TMapFile.cxx.

void TMapFile::Close ( Option_t option = "")

Close a mapped file.

First detach mapped memory then close file. No member functions of a TMapFile that was opened in write mode may be called after Close() (this includes, of course, "delete" which would call the dtors). The option="dtor" is only used when called via the ~TMapFile.

Definition at line 920 of file TMapFile.cxx.

Referenced by ~TMapFile().

TMapFile * TMapFile::Create ( const char *  name,
Option_t option = "READ",
Int_t  size = kDefaultMapSize,
const char *  title = "" 
)
static

Create a memory mapped file.

This opens a file (to which the memory will be mapped) and attaches a memory region to it. Option can be either: "NEW", "CREATE", "RECREATE", "UPDATE" or "READ" (see TFile). The default open mode is "READ". The size argument specifies the maximum size of shared memory file in bytes. TMapFile's can only be created via this method. Create() enforces that a TMapFile is always on the memory mapped heap (when "NEW", "CREATE" or "RECREATE" are used).

Definition at line 1104 of file TMapFile.cxx.

void TMapFile::CreateSemaphore ( Int_t  pid = 0)
protected

Create semaphore used for synchronizing access to shared memory.

Definition at line 788 of file TMapFile.cxx.

Referenced by TMapFile().

void TMapFile::DeleteSemaphore ( )
protected

Delete the semaphore.

Definition at line 818 of file TMapFile.cxx.

Referenced by Close().

TMapFile * TMapFile::FindShadowMapFile ( )
protected

Returns shadow map file.

Definition at line 965 of file TMapFile.cxx.

Referenced by Close().

TObject * TMapFile::Get ( const char *  name,
TObject delObj = 0 
)

Return pointer to object retrieved from shared memory.

The object must be deleted after use. If delObj is a pointer to a previously allocated object it will be deleted. Returns 0 in case object with the given name does not exist.

Definition at line 741 of file TMapFile.cxx.

Referenced by TKeyMapFile::Browse().

void* TMapFile::GetBaseAddr ( ) const
inline

Definition at line 92 of file TMapFile.h.

Int_t TMapFile::GetBestBuffer ( )
protected

Return the best buffer size for objects in this file.

The best buffer size is estimated based on the current mean value and standard deviation of all objects written so far to this file. Returns mean value + one standard deviation.

Definition at line 1083 of file TMapFile.cxx.

Referenced by Update().

void * TMapFile::GetBreakval ( ) const
inline

Return the current location in the memory region for this malloc heap which represents the end of memory in use.

Returns 0 if map file was closed.

Definition at line 166 of file TMapFile.h.

Referenced by Print(), and WhichMapFile().

TDirectory* TMapFile::GetDirectory ( ) const
inline

Definition at line 94 of file TMapFile.h.

Int_t TMapFile::GetFd ( ) const
inline

Definition at line 95 of file TMapFile.h.

TMapRec* TMapFile::GetFirst ( ) const
inline

Definition at line 101 of file TMapFile.h.

Referenced by Browse(), Get(), and ls().

TMapRec* TMapFile::GetLast ( ) const
inline

Definition at line 102 of file TMapFile.h.

void* TMapFile::GetMmallocDesc ( ) const
inline

Definition at line 96 of file TMapFile.h.

const char* TMapFile::GetName ( ) const
inlinevirtual

Returns name of object.

This default method returns the class name. Classes that give objects a name should override this method.

Reimplemented from TObject.

Definition at line 97 of file TMapFile.h.

Referenced by InitDirectory().

const char* TMapFile::GetOption ( ) const
inlinevirtual

Reimplemented from TObject.

Definition at line 99 of file TMapFile.h.

Int_t TMapFile::GetSize ( ) const
inline

Definition at line 98 of file TMapFile.h.

const char* TMapFile::GetTitle ( ) const
inlinevirtual

Returns title of object.

This default method returns the class title (i.e. description). Classes that give objects a title should override this method.

Reimplemented from TObject.

Definition at line 100 of file TMapFile.h.

Referenced by InitDirectory().

void TMapFile::InitDirectory ( )
protected

Create the directory associated to this mapfile.

Definition at line 546 of file TMapFile.cxx.

Referenced by TMapFile().

Bool_t TMapFile::IsFolder ( ) const
virtual

Returns kTRUE in case object is a folder (i.e. contains browsable lists).

Reimplemented from TObject.

Definition at line 998 of file TMapFile.cxx.

Bool_t TMapFile::IsWritable ( ) const
inline

Definition at line 104 of file TMapFile.h.

void TMapFile::ls ( Option_t option = "") const
virtual

List contents of TMapFile.

Reimplemented from TObject.

Definition at line 1044 of file TMapFile.cxx.

void * TMapFile::MapToAddress ( )
staticprotected

Return the base address at which we would like the next TMapFile's mapped data to start.

For now, we let the system decide (start address 0). There are a lot of issues to deal with here to make this work reasonably, including:

  • Avoid memory collisions with existing mapped address spaces
  • Reclaim address spaces when their mmalloc heaps are unmapped
  • When mmalloc heaps are shared between processes they have to be mapped at the same addresses in each

Once created, a mmalloc heap that is to be mapped back in must be mapped at the original address. I.e. each TMapFile will expect to be remapped at it's original address. This becomes a problem if the desired address is already in use.

Definition at line 1163 of file TMapFile.cxx.

Referenced by TMapFile().

void TMapFile::operator delete ( void ptr)

Need special "operator delete" in which we close the shared memory.

This has to be done after the dtor chain has been finished.

Definition at line 1179 of file TMapFile.cxx.

void TMapFile::operator= ( const TMapFile rhs)
protected
void* TMapFile::OrgAddress ( void addr) const
inline

Definition at line 105 of file TMapFile.h.

Referenced by Browse(), Get(), and ls().

void TMapFile::Print ( Option_t option = "") const
virtual

Print some info about the mapped file.

Reimplemented from TObject.

Definition at line 981 of file TMapFile.cxx.

Int_t TMapFile::ReleaseSemaphore ( )
protected

Release semaphore. Returns 0 if OK, -1 on error.

Definition at line 888 of file TMapFile.cxx.

Referenced by Add(), Browse(), Get(), Remove(), RemoveAll(), and Update().

TObject * TMapFile::Remove ( TObject obj,
Bool_t  lock 
)
protected

Remove object from shared memory.

Returns pointer to removed object if successful, 0 otherwise.

Definition at line 640 of file TMapFile.cxx.

Referenced by Add().

TObject * TMapFile::Remove ( const char *  name,
Bool_t  lock 
)
protected

Remove object by name from shared memory.

Returns pointer to removed object if successful, 0 otherwise.

Definition at line 679 of file TMapFile.cxx.

TObject* TMapFile::Remove ( TObject obj)
inline

Definition at line 112 of file TMapFile.h.

Referenced by Remove().

TObject* TMapFile::Remove ( const char *  name)
inline

Definition at line 113 of file TMapFile.h.

Referenced by Remove().

void TMapFile::RemoveAll ( )

Remove all objects from shared memory.

Definition at line 716 of file TMapFile.cxx.

TMapFile::SetMapAddress ( Long_t  addr)
static
Initial value:
{
gROOT->Reset()
#define gROOT
Definition: TROOT.h:344

Set preferred map address.

Find out preferred map address as follows:

  1. Run consumer program to find the preferred map address. Remember begin of mapped region, i.e. 0x40b4c000
    $ root
    root [0] m = TMapFile::Create("dummy.map", "recreate", 10000000);
    root [1] m.Print()
    Memory mapped file: dummy.map
    Option: CREATE
    Mapped Memory region: 0x40b4c000 - 0x40d95f00 (2.29 MB)
    Current breakval: 0x40b53000
    root [2] .q
    $ rm dummy.map
  2. Add to producer program, just before creating the TMapFile: TMapFile::SetMapAddress(0x40b4c000);

Repeat this if more than one map file is being used. The above procedure allow programs using, e.g., different number of shared libraries (that cause the default mapping address to be different) to create shared memory regions in the same location without overwriting a shared library. The above assumes the consumer program is larger (i.e. has more shared memory occupied) than the producer. If this is not true inverse the procedure.

Definition at line 1141 of file TMapFile.cxx.

void TMapFile::SumBuffer ( Int_t  bufsize)
protected

Increment statistics for buffer sizes of objects in this file.

Definition at line 1069 of file TMapFile.cxx.

Referenced by Update().

void TMapFile::Update ( TObject obj = 0)

Update an object (or all objects, if obj == 0) in shared memory.

Definition at line 600 of file TMapFile.cxx.

TMapFile * TMapFile::WhichMapFile ( void addr)
inlinestatic

Definition at line 174 of file TMapFile.h.

Friends And Related Function Documentation

friend class TMapRec
friend

Definition at line 36 of file TMapFile.h.

Referenced by Add().

Member Data Documentation

ULong_t TMapFile::fBaseAddr
private

Base address of mapped memory region.

Definition at line 45 of file TMapFile.h.

Referenced by FindShadowMapFile(), GetBaseAddr(), Print(), TMapFile(), and WhichMapFile().

TList* TMapFile::fBrowseList
private

List of KeyMapFile objects.

Definition at line 51 of file TMapFile.h.

Referenced by Browse(), TMapFile(), and ~TMapFile().

TDirectory* TMapFile::fDirectory
private

Pointer to directory associated to this mapfile.

Definition at line 50 of file TMapFile.h.

Referenced by cd(), GetDirectory(), InitDirectory(), TMapFile(), and ~TMapFile().

Int_t TMapFile::fFd
private

Descriptor of mapped file.

Definition at line 39 of file TMapFile.h.

Referenced by Close(), GetFd(), and TMapFile().

TMapRec* TMapFile::fFirst
private

List of streamed objects is shared memory.

Definition at line 47 of file TMapFile.h.

Referenced by Add(), GetFirst(), ls(), Remove(), RemoveAll(), TMapFile(), and Update().

TObject* TMapFile::fGetting
private

Don't deadlock in update mode, when from Get() Add() is called.

Definition at line 55 of file TMapFile.h.

Referenced by Add(), Get(), and TMapFile().

Long_t TMapFile::fgMapAddress = 0
staticprivate

Map to this address, set address via SetMapAddress()

Definition at line 60 of file TMapFile.h.

Referenced by MapToAddress(), and SetMapAddress().

void * TMapFile::fgMmallocDesc = 0
staticprivate

Used in Close() and operator delete()

Definition at line 61 of file TMapFile.h.

Referenced by ~TMapFile().

ULong_t TMapFile::fhSemaphore
private

HANDLE of WIN32 Mutex object to implement semaphore.

Definition at line 54 of file TMapFile.h.

Referenced by AcquireSemaphore(), DeleteSemaphore(), ReleaseSemaphore(), and TMapFile().

TMapRec* TMapFile::fLast
private

Last object in list of shared objects.

Definition at line 48 of file TMapFile.h.

Referenced by Add(), GetLast(), Remove(), RemoveAll(), and TMapFile().

void* TMapFile::fMmallocDesc
private

Pointer to mmalloc descriptor.

Definition at line 44 of file TMapFile.h.

Referenced by AcquireSemaphore(), Add(), Browse(), Close(), Get(), GetBreakval(), GetMmallocDesc(), IsFolder(), ls(), Print(), Remove(), RemoveAll(), TMapFile(), Update(), and ~TMapFile().

char* TMapFile::fName
private

Name of mapped file.

Definition at line 41 of file TMapFile.h.

Referenced by GetName(), Print(), and TMapFile().

Long_t TMapFile::fOffset
private

Offset in bytes for region mapped by reader.

Definition at line 49 of file TMapFile.h.

Referenced by Browse(), Get(), GetFirst(), GetLast(), ls(), OrgAddress(), TMapFile(), and WhichMapFile().

char* TMapFile::fOption
private

Directory creation options.

Definition at line 43 of file TMapFile.h.

Referenced by GetOption(), Print(), and TMapFile().

Int_t TMapFile::fSemaphore
private

Modification semaphore (or getpid() for WIN32)

Definition at line 53 of file TMapFile.h.

Referenced by AcquireSemaphore(), DeleteSemaphore(), ReleaseSemaphore(), and TMapFile().

Int_t TMapFile::fSize
private

Original start size of memory mapped region.

Definition at line 46 of file TMapFile.h.

Referenced by FindShadowMapFile(), GetSize(), and TMapFile().

Double_t TMapFile::fSum2Buffer
private

Sum of squares of buffer sizes of objects written so far.

Definition at line 58 of file TMapFile.h.

Referenced by GetBestBuffer(), SumBuffer(), and TMapFile().

Double_t TMapFile::fSumBuffer
private

Sum of buffer sizes of objects written sofar.

Definition at line 57 of file TMapFile.h.

Referenced by GetBestBuffer(), SumBuffer(), and TMapFile().

char* TMapFile::fTitle
private

Title of mapped file.

Definition at line 42 of file TMapFile.h.

Referenced by GetTitle(), Print(), and TMapFile().

Int_t TMapFile::fVersion
private

ROOT version (or -1 for shadow map file)

Definition at line 40 of file TMapFile.h.

Referenced by FindShadowMapFile(), IsFolder(), TMapFile(), and ~TMapFile().

Bool_t TMapFile::fWritable
private

TRUE if mapped file opened in RDWR mode.

Definition at line 52 of file TMapFile.h.

Referenced by AcquireSemaphore(), Add(), Close(), IsWritable(), Remove(), RemoveAll(), TMapFile(), Update(), and ~TMapFile().

Int_t TMapFile::fWritten
private

Number of objects written sofar.

Definition at line 56 of file TMapFile.h.

Referenced by GetBestBuffer(), SumBuffer(), and TMapFile().

Collaboration diagram for TMapFile:
[legend]

The documentation for this class was generated from the following files: