library: libCore #include "TFree.h"

# TFree

class description - source file - inheritance tree (.pdf)

## class TFree : public TObject

| Inheritance Chart:
`TObject`
| <- | `TFree` |

        public:

                          TFree()
                          TFree(TList* lfree, Long64_t first, Long64_t last)
                          TFree(const TFree&)
                  virtual ~TFree()
                   TFree* AddFree(TList* lfree, Long64_t first, Long64_t last)
           static TClass* Class()
             virtual void FillBuffer(char*& buffer)
                   TFree* GetBestFree(TList* lfree, Int_t nbytes)
                 Long64_t GetFirst() const
                 Long64_t GetLast() const
          virtual TClass* IsA() const
                   TFree& operator=(const TFree&)
             virtual void ReadBuffer(char*& buffer)
                     void SetFirst(Long64_t first)
                     void SetLast(Long64_t last)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
                    Int_t Sizeof() const
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        protected:

          Long64_t fFirst  First free word of segment
          Long64_t fLast   Last free word of segment

## Class Description

     Service class for TFile.
     Each file has a linked list of free segments. Each free segment
     is described by its firts and last address.
     When an object is written to a file via TObject::Write, a new Key (see TKey)
     is created. The first free segment big enough to accomodate the object
     is used.
     If the object size has a length corresponding to the size of the free segment,
     the free segment is deleted from the list of free segments.
     When an object is deleted from a file, a new TFree object is generated.
     If the deleted object is contiguous to an already deleted object, the free
     segments are merged in one single segment.

TFree()

    *-*-*-*-*-*-*-*-*-*-*TFree default constructor*-*-*-*-*-*-*-*-*-*-*-*-*
    *-*                  =========================

TFree(TList *lfree, Long64_t first, Long64_t last)

    *-*-*-*-*-*-*-*-*-*-*Constructor for a FREE segment*-*-*-*-*-*-*-*-*-*-*-*-*
    *-*                  ==============================

TFree* AddFree(TList *lfree, Long64_t first, Long64_t last)

    *-*-*-*-*-*-*-*-*-*Add a new free segment to the list of free segments*-*-*
    *-*                ===================================================
      If last just preceedes an existing free segment, then first becomes
         the new starting location of the free segment.
      if first just follows an existing free segment, then last becomes
         the new ending location of the free segment.
      if first just follows an existing free segment AND last just preceedes
         an existing free segment, these two segments are merged into
         one single segment.

~TFree()

    *-*-*-*-*-*-*-*-*-*-*-*TFree Destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    *-*                    ================

void FillBuffer(char *&buffer)

    *-*-*-*-*-*-*-*-*-*-*Encode FREE structure into output buffer*-*-*-*-*-*-*
    *-*                  ========================================

TFree* GetBestFree(TList *lfree, Int_t nbytes)

    *-*-*-*-*-*-*-*-*-*Return the best free segment where to store nbytes*-*-*-*
    *-*                ==================================================

void ReadBuffer(char *&buffer)

    *-*-*-*-*-*-*-*-*-*-*-*Decode one FREE structure from input buffer*-*-*-*-*
    *-*                    ===========================================

Int_t Sizeof() const

     return number of bytes occupied by this TFree on permanent storage

### Inline Functions

               Long64_t GetFirst() const
               Long64_t GetLast() const
                   void SetFirst(Long64_t first)
                   void SetLast(Long64_t last)
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
                  TFree TFree(const TFree&)
                 TFree& operator=(const TFree&)

Author: Rene Brun 28/12/94
Last update: root/base:$Name: $:$Id: TFree.cxx,v 1.5 2003/12/30 13:16:50 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *