/usr/include/root/TKey.h is in libroot-io-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | // @(#)root/io:$Id$
// 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
//////////////////////////////////////////////////////////////////////////
// //
// TKey //
// //
// Header description of a logical record on file. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TDatime
#include "TDatime.h"
#endif
#ifndef ROOT_TBuffer
#include "TBuffer.h"
#endif
class TClass;
class TBrowser;
class TDirectory;
class TFile;
class TKey : public TNamed {
private:
enum EStatusBits {
kIsDirectoryFile = BIT(14)
};
TKey(const TKey&); // TKey objects are not copiable.
TKey& operator=(const TKey&); // 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; //! Offset to be added to the pid index in this key/buffer. This is actually saved in the high bits of fSeekPdir
TDirectory *fMotherDir; //! pointer to mother directory
virtual Int_t Read(const char *name) { return TObject::Read(name); }
virtual void Create(Int_t nbytes, TFile* f = 0);
void Build(TDirectory* motherDir, const char* classname, Long64_t filepos);
virtual void Reset(); // Currently only for the use of TBasket.
virtual Int_t WriteFileKeepBuffer(TFile *f = 0);
public:
TKey();
TKey(TDirectory* motherDir);
TKey(TDirectory* motherDir, const TKey &orig, UShort_t pidOffset);
TKey(const char *name, const char *title, const TClass *cl, Int_t nbytes, TDirectory* motherDir = 0);
TKey(const TString &name, const TString &title, const TClass *cl, Int_t nbytes, TDirectory* motherDir = 0);
TKey(const TObject *obj, const char *name, Int_t bufsize, TDirectory* motherDir = 0);
TKey(const void *obj, const TClass *cl, const char *name, Int_t bufsize, TDirectory* motherDir = 0);
TKey(Long64_t pointer, Int_t nbytes, TDirectory* motherDir = 0);
virtual ~TKey();
virtual void Browse(TBrowser *b);
virtual void Delete(Option_t *option="");
virtual void DeleteBuffer();
virtual void FillBuffer(char *&buffer);
virtual const char *GetClassName() const {return fClassName.Data();}
virtual const char *GetIconName() const;
virtual const char *GetTitle() const;
virtual char *GetBuffer() const {return fBuffer+fKeylen;}
TBuffer *GetBufferRef() const {return fBufferRef;}
Short_t GetCycle() const;
const TDatime &GetDatime() const {return fDatime;}
TFile *GetFile() const;
Short_t GetKeep() const;
Int_t GetKeylen() const {return fKeylen;}
TDirectory* GetMotherDir() const { return fMotherDir; }
Int_t GetNbytes() const {return fNbytes;}
Int_t GetObjlen() const {return fObjlen;}
Int_t GetVersion() const {return fVersion;}
virtual Long64_t GetSeekKey() const {return fSeekKey;}
virtual Long64_t GetSeekPdir() const {return fSeekPdir;}
virtual ULong_t Hash() const;
virtual void IncrementPidOffset(UShort_t offset);
Bool_t IsFolder() const;
virtual void Keep();
virtual void ls(Option_t *option="") const;
virtual void Print(Option_t *option="") const;
virtual Int_t Read(TObject *obj);
virtual TObject *ReadObj();
virtual TObject *ReadObjWithBuffer(char *bufferRead);
virtual void *ReadObjectAny(const TClass *expectedClass);
virtual void ReadBuffer(char *&buffer);
void ReadKeyBuffer(char *&buffer);
virtual Bool_t ReadFile();
virtual void SetBuffer() { 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
|