// @(#)root/io // Author: Rene Brun 28/12/94 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TKey #define ROOT_TKey #include "TNamed.h" #include "TDatime.h" #include "TClass.h" #ifdef R__LESS_INCLUDES class TBuffer; #else #include "TBuffer.h" #endif class TBrowser; class TDirectory; class TFile; class TKey : public TNamed { private: enum EStatusBits { kIsDirectoryFile = BIT(14), kReproducible = BIT(15) }; TKey(const TKey&) = delete; // TKey objects are not copiable. TKey& operator=(const TKey&) = delete; // TKey objects are not copiable. protected: Int_t fVersion; ///< Key version identifier Int_t fNbytes; ///< Number of bytes for the object on file Int_t fObjlen; ///< Length of uncompressed object in bytes TDatime fDatime; ///< Date/Time of insertion in file Short_t fKeylen; ///< Number of bytes for the key itself Short_t fCycle; ///< Cycle number Long64_t fSeekKey; ///< Location of object on file Long64_t fSeekPdir; ///< Location of parent directory on file TString fClassName; ///< Object Class name Int_t fLeft; ///< Number of bytes left in current segment char *fBuffer; ///< Object buffer TBuffer *fBufferRef; ///< Pointer to the TBuffer object UShort_t fPidOffset; /// T *ReadObject() { return reinterpret_cast(ReadObjectAny(TClass::GetClass())); } virtual void *ReadObjectAny(const TClass *expectedClass); virtual void ReadBuffer(char *&buffer); void ReadKeyBuffer(char *&buffer); virtual Bool_t ReadFile(); virtual void SetBuffer() { DeleteBuffer(); fBuffer = new char[fNbytes];} virtual void SetParent(const TObject *parent); void SetMotherDir(TDirectory* dir) { fMotherDir = dir; } virtual Int_t Sizeof() const; virtual Int_t WriteFile(Int_t cycle=1, TFile* f = 0); ClassDef(TKey,4); //Header description of a logical record on file. }; #endif