75 const char *keydatetime,
Int_t cycle,
const char *classname)
76 :
TKey(mother), fKeyId(keyid), fObjId(objid)
93 const char *classname)
96 Int_t len2 = (keyname == 0) ? 0 : strlen(keyname);
99 if ((len1 > 0) && (strcmp(
GetName(), keyname) != 0))
103 len2 = (keytitle == 0) ? 0 : strlen(keytitle);
106 if ((len1 > 0) && (strcmp(
GetTitle(), keytitle) != 0))
110 len1 = (tm == 0) ? 0 : strlen(tm);
111 len2 = (keydatime == 0) ? 0 : strlen(keydatime);
114 if ((len1 > 0) && (strcmp(tm, keydatime) != 0))
121 len2 = (classname == 0) ? 0 : strlen(classname);
124 if ((len1 > 0) && (strcmp(
GetClassName(), classname) != 0))
170 if (!
f->WriteKeyData(
this)) {
172 Error(
"StoreKeyObject",
"Cannot write data to key tables");
196 return res == 0 ? 0 : 1;
208 if (
gROOT->GetForceStyle())
210 if (tobj->IsA() == TDirectoryFile::Class()) {
233 if (
gROOT->GetForceStyle())
235 if (tobj->IsA() == TDirectoryFile::Class()) {
256 if (res && (expectedClass == TDirectoryFile::Class())) {
292 if (expectedClass != 0) {
301 Warning(
"XmlReadAny",
"Trying to read an emulated class (%s) to store in a compiled pointer (%s)",
306 return ((
char *)res) + delta;
void InitMap() override
Create the fMap container and initialize them with the null object.
Converts data to SQL statements or read data from SQL tables.
void * SqlReadAny(Long64_t keyid, Long64_t objid, TClass **cl, void *obj=nullptr)
Recreate object from sql structure.
TClass instances represent classes, structs and namespaces in the ROOT type system.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
void Set()
Set Date/Time to current time as reported by the system.
A ROOT file is structured in Directories (like a file system).
Int_t ReadKeys(Bool_t forceRead=kTRUE) override
Read the linked list of keys.
void SetSeekDir(Long64_t v) override
Describe directory structure in memory.
virtual Long64_t GetSeekDir() const
virtual Int_t AppendKey(TKey *)
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
void SetName(const char *newname) override
Set the name for directory If the directory name is changed after the directory was written once,...
virtual void SetMother(TObject *mother)
virtual TList * GetListOfKeys() const
TKeySQL represents meta-information about object, which was written to SQL database.
void * ReadObjectAny(const TClass *expectedClass) final
Read object of any type from SQL database.
void * ReadKeyObject(void *obj, const TClass *expectedClass)
Read object, associated with key, from database.
TObject * ReadObj() final
Read object derived from TObject class If it is not TObject or in case of error, return 0.
Long64_t fKeyId
! key identifier in KeysTables
Long64_t fObjId
! stored object identifier
void Delete(Option_t *option="") final
Removes key from current directory Note: TKeySQL object is not deleted.
Bool_t IsKeyModified(const char *keyname, const char *keytitle, const char *keydatime, Int_t cycle, const char *classname)
Compares keydata with provided and return kTRUE if key was modified Used in TFile::StreamKeysForDirec...
Long64_t GetDBKeyId() const
Long64_t GetDBDirId() const
return sql id of parent directory
TObject * ReadObjWithBuffer(char *bufferRead) final
Read object derived from TObject class If it is not TObject or in case of error, return 0.
Long64_t GetDBObjId() const
Int_t Read(TObject *obj) final
To read an object from the file.
void StoreKeyObject(const void *obj, const TClass *cl)
Stores object, associated with key, into data tables.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
TFile * GetFile() const
Returns file to which key belong.
TDatime fDatime
Date/Time of insertion in file.
virtual const char * GetClassName() const
virtual const char * GetTitle() const
Returns title (title can contain 32x32 xpm thumbnail/icon).
const TDatime & GetDatime() const
Short_t fCycle
Cycle number.
TDirectory * GetMotherDir() const
Short_t GetCycle() const
Return cycle number associated to this key.
TDirectory * fMotherDir
!pointer to mother directory
TString fClassName
Object Class name.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void UseCurrentStyle()
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Access an SQL db via the TFile interface.