File indexing completed on 2025-01-18 10:12:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TKeyXML
0013 #define ROOT_TKeyXML
0014
0015 #include "TXMLEngine.h"
0016 #include "TKey.h"
0017
0018 class TXMLFile;
0019
0020 class TKeyXML final : public TKey {
0021
0022 private:
0023 TKeyXML(const TKeyXML &) = delete;
0024 TKeyXML &operator=(const TKeyXML &) = delete;
0025
0026 protected:
0027 TKeyXML() {}
0028
0029 public:
0030 TKeyXML(TDirectory *mother, Long64_t keyid, const TObject *obj, const char *name = nullptr,
0031 const char *title = nullptr);
0032 TKeyXML(TDirectory *mother, Long64_t keyid, const void *obj, const TClass *cl, const char *name,
0033 const char *title = nullptr);
0034 TKeyXML(TDirectory *mother, Long64_t keyid, XMLNodePointer_t keynode);
0035 ~TKeyXML() override;
0036
0037
0038 void Delete(Option_t *option = "") final;
0039 void DeleteBuffer() final {}
0040 void FillBuffer(char *&) final {}
0041 char *GetBuffer() const final { return nullptr; }
0042 Long64_t GetSeekKey() const final { return fKeyNode ? 1024 : 0; }
0043 Long64_t GetSeekPdir() const final { return fKeyNode ? 1024 : 0; }
0044
0045 void Keep() final {}
0046
0047
0048
0049 Int_t Read(TObject *tobj) final;
0050 TObject *ReadObj() final;
0051 TObject *ReadObjWithBuffer(char *bufferRead) final;
0052 void *ReadObjectAny(const TClass *expectedClass) final;
0053
0054 void ReadBuffer(char *&) final {}
0055 Bool_t ReadFile() final { return kTRUE; }
0056 void SetBuffer() final { fBuffer = nullptr; }
0057 Int_t WriteFile(Int_t = 1, TFile * = nullptr) final { return 0; }
0058
0059
0060
0061 XMLNodePointer_t KeyNode() const { return fKeyNode; }
0062 Long64_t GetKeyId() const { return fKeyId; }
0063 Bool_t IsSubdir() const { return fSubdir; }
0064 void SetSubir() { fSubdir = kTRUE; }
0065 void UpdateObject(TObject *obj);
0066 void UpdateAttributes();
0067
0068 protected:
0069 Int_t Read(const char *name) final { return TKey::Read(name); }
0070 void StoreObject(const void *obj, const TClass *cl, Bool_t check_tobj = kFALSE);
0071 void StoreKeyAttributes();
0072 TXMLEngine *XMLEngine();
0073
0074 void *XmlReadAny(void *obj, const TClass *expectedClass);
0075
0076 XMLNodePointer_t fKeyNode{nullptr};
0077 Long64_t fKeyId{0};
0078 Bool_t fSubdir{kFALSE};
0079
0080 ClassDefOverride(TKeyXML, 1)
0081 };
0082
0083 #endif