72 if (name && *name)
SetName(name);
85 const char* keydatetime,
Int_t cycle,
const char* classname) :
113 Int_t len2 = (keyname==0) ? 0 : strlen(keyname);
114 if (len1!=len2)
return kTRUE;
115 if ((len1>0) && (strcmp(
GetName(), keyname)!=0))
return kTRUE;
118 len2 = (keytitle==0) ? 0 : strlen(keytitle);
119 if (len1!=len2)
return kTRUE;
120 if ((len1>0) && (strcmp(
GetTitle(), keytitle)!=0))
return kTRUE;
123 len1 = (tm==0) ? 0 : strlen(tm);
124 len2 = (keydatime==0) ? 0 : strlen(keydatime);
125 if (len1!=len2)
return kTRUE;
126 if ((len1>0) && (strcmp(tm, keydatime)!=0))
return kTRUE;
131 len2 = (classname==0) ? 0 : strlen(classname);
132 if (len1!=len2)
return kTRUE;
179 Error(
"StoreKeyObject",
"Cannot write data to key tables");
200 if (tobj==0)
return 0;
204 return res==0 ? 0 : 1;
278 if ((cl==0) || (res==0))
return 0;
282 if (expectedClass!=0) {
291 "Trying to read an emulated class (%s) to store in a compiled pointer (%s)",
296 return ((
char*)res) + delta;
void * SqlReadAny(Long64_t keyid, Long64_t objid, TClass **cl, void *obj=0)
Recreate object from sql structure.
Long64_t fKeyId
! key identifier in KeysTables
TDirectory * GetMotherDir() const
void SetSeekDir(Long64_t v)
void Set()
Set Date/Time to current time as reported by the system.
Long64_t GetDBDirId() const
return sql id of parent directory
virtual TList * GetListOfKeys() const
void * ReadKeyObject(void *obj, const TClass *expectedClass)
Read object, associated with key, from database.
virtual void SetName(const char *name)
Change (i.e.
Long64_t GetDBObjId() const
Short_t GetCycle() const
Return cycle number associated to this key.
Long64_t fObjId
! stored object identifer
TFile * GetFile() const
Returns file to which key belong.
virtual const char * GetClassName() const
Long64_t StoreObjectInTables(Long64_t keyid, const void *obj, const TClass *cl)
Store object in database. Return stored object id or -1 if error.
virtual void UseCurrentStyle()
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
TKeySQL()
default constructor
TDirectory * fMotherDir
!pointer to mother directory
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
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...
void StoreKeyObject(const void *obj, const TClass *cl)
Stores object, associated with key, into data tables.
virtual TObject * ReadObjWithBuffer(char *bufferRead)
Read object derived from TObject class If it is not TObject or in case of error, return 0...
virtual Long64_t GetSeekDir() const
TString fClassName
Object Class name.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TDatime fDatime
Date/Time of insertion in file.
Long64_t DefineNextKeyId()
Returns next possible key identifier.
virtual const char * GetTitle() const
Returns title (title can contain 32x32 xpm thumbnail/icon).
Bool_t WriteKeyData(TKeySQL *key)
Add entry into keys table.
virtual ~TKeySQL()
TKeySQL destructor.
Access an SQL db via the TFile interface.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
A ROOT file is structured in Directories (like a file system).
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
void DeleteKeyFromDB(Long64_t keyid)
Remove key with specified id from keys table also removes all objects data, related to this table...
virtual Int_t Read(const char *name)
Read contents of object with specified name from the current directory.
virtual Int_t AppendKey(TKey *)
Converts data to SQL statements or read data from SQL tables.
virtual void SetName(const char *newname)
Set the name for directory If the directory name is changed after the directory was written once...
Short_t fCycle
Cycle number.
virtual const char * GetName() const
Returns name of object.
virtual Int_t ReadKeys(Bool_t forceRead=kTRUE)
Read the linked list of keys.
Describe directory structure in memory.
virtual void * ReadObjectAny(const TClass *expectedClass)
Read object of any type from SQL database.
virtual TObject * ReadObj()
Read object derived from TObject class If it is not TObject or in case of error, return 0...
Mother of all ROOT objects.
TKeySQL represents metainforamtion about object, which was written to SQL database.
Long64_t GetDBKeyId() const
const TDatime & GetDatime() const
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
virtual void SetMother(TObject *mother)
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
virtual void Delete(Option_t *option="")
Removes key from current directory Note: TKeySQL object is not deleted.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.