TcAChE口爆是什么意思思

使用 IntraWeb &30& - TIWAppInfo&TIWMimeTypes&TIWAppCache
TIWAppInfo
//IntraWeb 12.2.15 开始使用 TIWAppInfo 来获取应用的相关信息, 和 IWServerController、WebApplication 的某些属性有重复
TIWMimeTypes //IntraWeb 14.0.11 新增, 可方便处理 Http Mime T Mime 类型? 我的理解是: 浏览器接受到一个文件或数据流, 如果让浏览器解析(而不是下载), 浏览器该按什么类型来解析呢? 所以需要指定类型.
TIWAppCache
//IntraWeb 14.0.29 新增, 可以方便处理缓存文件; 之前有类似的功能, 如: IWServerController.NewCacheFile
{三个类提供的都是 class 方法, 使用时无须实例化}
TIWAppInfo 所在单元及继承链:
IW.Common.AppInfo.TIWAppInfo & TObject
class function GetAppFullFileName: string
class function GetAppFileName: string
class function GetAppLogFileName: string
class function GetAppPath: string
class function GetAppName: string
class function GetSystemPath: string
class function GetTempPath: string
class function GetCurrentPath: string
class function GetComputerName: string
class function GetFileInfo(const aFileName: aFileInfo: TFileInfo): string
class function GetAppVersion: string
procedure TIWForm1.IWButton1Click(Sender: TObject);
IWMemo1.Lines.Add(TIWAppInfo.GetAppFullFileName);
IWMemo1.Lines.Add(TIWAppInfo.GetAppFileName);
IWMemo1.Lines.Add(TIWAppInfo.GetAppLogFileName);
IWMemo1.Lines.Add(TIWAppInfo.GetAppPath);
IWMemo1.Lines.Add(TIWAppInfo.GetAppName);
IWMemo1.Lines.Add(TIWAppInfo.GetSystemPath);
IWMemo1.Lines.Add(TIWAppInfo.GetTempPath);
IWMemo1.Lines.Add(TIWAppInfo.GetCurrentPath);
IWMemo1.Lines.Add(TIWAppInfo.GetComputerName);
IWMemo1.Lines.Add(TIWAppInfo.GetAppVersion);
IWMemo1.Lines.Add('===============');
for i := 0 to 9 do
str := TIWAppInfo.GetFileInfo(TIWAppInfo.GetSystemPath + 'NotePad.exe', TFileInfo(i));
IWMemo1.Lines.Add(str);
IWMemo1.Lines.Add('===============');
TIWMimeTypes 所在单元及继承链:
IWMimeTypes.TIWMimeTypes & TObject
class function IsStaticFile(const aFileName: out aMimeType: string): Boolean //
class function GetAsString(const aFileExtension: string): string //根据扩展名即可获取类型的标准字符串很方便, 譬如 TIWMimeTypes.GetAsString('.pdf') 将返回 application/pdf
class function GetAsString(const aMimeType: TMimeType): string
//TIWMimeTypes.GetAsString(mtPDF) 结果也是 application/pdf
class procedure RegisterType(const aFileExtension: const aMimeTypeDesc: const aIsStatic: Boolean) //能自行注册
class procedure UnregisterType(const aFileExtension: string)
{IWMimeTypes.TIWMimeType 枚举的定义}
TIWMimeType = (mtUnknown, mtBinary, mtJPG, mtGIF, mtPNG, mtRSS, mtXML, mtTXT, mtICO, mtHTML, mtJavaScript, mtPDF, mtZIP, mtCSS, mtMP3, mtOGG, mtWAV, mtEXE, mtFlash, mtWMV, mtMOV, mtAVI, mtMPEG, mtXSL);
{IWMimeTypes 单元提供的常用的 Mime 类型常量}
'image/jpeg';
'image/gif';
'image/png';
'application/rss+ charset=UTF-8';
'text/ charset=UTF-8';
'text/ charset=UTF-8';
'text/ charset=UTF-8';
'image/x-ico';
MIME_JavaScript =
'application/x- charset=UTF-8';
'application/pdf';
'text/ charset=UTF-8';
'audio/mpeg';
'audio/ogg';
'audio/wav';
MIME_Flash
'application/x-shockwave-flash';
'video/x-ms-wmv';
'video/quicktime';
'video/x-msvideo';
'video/mpeg';
MIME_Binary
'application/octet-stream';
'text/ charset=UTF-8';
{ 更多不常用的类型可参见: http://www.iana.org/assignments/media-types/media-types.xhtml }
TIWAppCache 所在单元及继承链:
IWAppCache.TIWAppCache & TObject
{建立缓存流; 如需特别指定第一个参数时, 不如选用下面三个函数}
class procedure NewCacheStream(aOwner: TO
//建立页面级的缓存要指定当前窗体(一般用 Self); 建立 Session 级缓存可指定 WebA 建立应用级缓存指定 nil
const aContentType:
//Mime Type 字符串, 如: application/pdf
aCacheType: TCacheT
//缓存期选项:ctOneTime、ctApp、ctSession、ctForm
out ACacheStream: TCacheS //输出流
out aFileHRef: string
//输出缓存文件地址
{建立建立应用级缓存流; 参数 1 将被忽略, 其它同上}
class procedure NewAppCacheStream(aOwner: TO const aContentType: out ACacheStream: TCacheS out aFileHRef: string)
{建立建立 Session 级缓存流; 参数 1 将被忽略, 其它同上}
class procedure NewSessionCacheStream(aOwner: TO const aContentType: out ACacheStream: TCacheS out aFileHRef: string)
{建立建立页面级缓存流; 参数 1 将被忽略, 其它同上}
class procedure NewFormCacheStream(aOwner: TO const aContentType: out ACacheStream: TCacheS out aFileHRef: string)
{保存流到缓存文件}
class function StreamToCacheFile(aOwner: TO AStream: TS const aContentType: const aCacheType: TCacheType): string
{保存图像到缓存文件}
class function GraphicToCacheFile(aOwner: TO AGraphic: TG const aCacheType: TCacheT const PreferPNG: Boolean): string
class function GraphicToCacheFile(aOwner: TO AGraphic: TG imgType: TIWImageO const aCacheType: TCacheType): string
//TIWImageOutput = (ioGIF, ioJPEG, ioPNG)
{保存资源到缓存文件}
class function ResourceToCacheFile(aOwner: TO const aResourceName: const aContentType: const aCacheType: TCacheType): string
{情况缓存}
class function ClearCache(ACacheList: TStrings): Integer
{创建一个临时文件, 位置在用户临时文件夹}
class function NewTempFileName: string
{添加文件到缓存}
class function AddFileToCache(aOwner: TO const aFileName: const aContentType: const aCacheType: TCacheType): string
测试 - 将资源中的图片提取到缓存, 然后呈现出来:
uses IWAppCache, IWServerInternalF
procedure TIWForm1.IWButton1Click(Sender: TObject);
fStream: TS
fStream := TIWServerInternalFiles.GetResourceStream('IW_GFX_LogoIntraWeb');
fPath := TIWAppCache.StreamToCacheFile(Self, fStream, 'image/png');
IWImageFile1.ImageFile.Filename := fP
{获取代码:-------------------------------------------------------}
uses ServerController, IW.Common.AppI
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
IWMemo1.Lines.Add(IWServerController.ContentPath + #9'{IWServerController.ContentPath}');
IWMemo1.Lines.Add(IWServerController.CacheDir + #9'{IWServerController.CacheDir}');
IWMemo1.Lines.Add(IWServerController.TemplateDir + #9'{IWServerController.TemplateDir}' + sLineBreak);
IWMemo1.Lines.Add(WebApplication.AppUrlBase + #9'{WebApplication.AppUrlBase}');
IWMemo1.Lines.Add(WebApplication.InternalUrlBase + #9'{WebApplication.InternalUrlBase}');
IWMemo1.Lines.Add(WebApplication.SessionInternalUrlBase + #9'{WebApplication.SessionInternalUrlBase}');
IWMemo1.Lines.Add(WebApplication.SessionUrlBase + #9'{WebApplication.SessionUrlBase}');
IWMemo1.Lines.Add(WebApplication.UserCacheUrlBase + #9'{WebApplication.UserCacheUrlBase}');
IWMemo1.Lines.Add(WebApplication.ApplicationURL + #9'{WebApplication.ApplicationURL}');
IWMemo1.Lines.Add(WebApplication.ApplicationPath + #9'{WebApplication.ApplicationPath}');
IWMemo1.Lines.Add(WebApplication.ReferringURL + #9'{WebApplication.ReferringURL}');
IWMemo1.Lines.Add(WebApplication.UserCacheDir + #9'{WebApplication.UserCacheDir}' + sLineBreak);
IWMemo1.Lines.Add(TIWAppInfo.GetAppFullFileName + #9'{TIWAppInfo.GetAppFullFileName}');
IWMemo1.Lines.Add(TIWAppInfo.GetAppPath + #9'{TIWAppInfo.GetAppPath}');
IWMemo1.Lines.Add(TIWAppInfo.GetAppFileName + #9'{TIWAppInfo.GetAppFileName}');
IWMemo1.Lines.Add(TIWAppInfo.GetAppName + #9'{TIWAppInfo.GetAppName}');
IWMemo1.Lines.Add(TIWAppInfo.GetTempPath + #9'{TIWAppInfo.GetTempPath}');
IWMemo1.Lines.Add(TIWAppInfo.GetCurrentPath + #9'{TIWAppInfo.GetCurrentPath}');
{参考结果:-------------------------------------------------------}
C:\Users\wy\Documents\RAD Studio\Projects\MyTest6\Win32\Debug\wwwroot\
{IWServerController.ContentPath}
C:\Users\wy\AppData\Local\Temp1a3ozdw6r\
{IWServerController.CacheDir}
C:\Users\wy\Documents\RAD Studio\Projects\MyTest6\Win32\Debug\Templates\
{IWServerController.TemplateDir}
{WebApplication.AppUrlBase}
/$/ {WebApplication.InternalUrlBase}
/$/ {WebApplication.SessionInternalUrlBase}
{WebApplication.SessionUrlBase}
/$/MyApp/0pnlkje0r4hi7j19tzrq30eq0k2i/
{WebApplication.UserCacheUrlBase}
http://127.0.0.1:3126
{WebApplication.ApplicationURL}
C:\Users\wy\Documents\RAD Studio\Projects\MyTest6\Win32\Debug\
{WebApplication.ApplicationPath}
http://127.0.0.1:3126/$/start
{WebApplication.ReferringURL}
C:\Users\wy\AppData\Local\Temp1a3ozdw6r\userpnlkje0r4hi7j19tzrq30eq0k2i\
{WebApplication.UserCacheDir}
C:\Users\wy\Documents\RAD Studio\Projects\MyTest6\Win32\Debug\MyTest6.exe
{TIWAppInfo.GetAppFullFileName}
C:\Users\wy\Documents\RAD Studio\Projects\MyTest6\Win32\Debug\
{TIWAppInfo.GetAppPath}
MyTest6.exe {TIWAppInfo.GetAppFileName}
MyTest6 {TIWAppInfo.GetAppName}
C:\Users\wy\AppData\Local\Temp\ {TIWAppInfo.GetTempPath}
C:\Users\wy\Documents\RAD Studio\Projects\MyTest6\Win32\Debug\
{TIWAppInfo.GetCurrentPath}
Copyright (C) , All Rights Reserved.
版权所有 闽ICP备号
processed in 0.052 (s). 12 q(s)class TChain: public
A chain is a collection of files containg
When the chain is created, the first parameter is the default name
for the Tree to be processed later on.
Enter a new element in the chain via the :: function.
Once a chain is defined, one can use the normal
Use :: to activate one or more branches for all
the trees in the chain.
Function Members (Methods)
void(const char* method) const
virtual (* chain)
virtual (const char* name,
nentries = )
virtual (const char* bname,
subbranches = )
virtual (* branch,
subbranches = )
virtual (const char* name,
nentries = , const char* tname = "")
virtual (* list,
nfiles = )
virtual *(const char* chainname, const char* dummy = "")
virtual *(const char* chainname, * dummy)
virtual *(* chain, const char* alias = "",
virtual void( tot)
virtual void( zip)
virtual void(* option = "")
virtual (* option = "")
virtual (* list,
bufsize = 32000,
splitlevel = 99)
virtual (const char* folder,
bufsize = 32000,
splitlevel = 99)
virtual (* list,
bufsize = 32000,
splitlevel = 99, const char* name = "")
virtual *(const char* name, void* address, const char* leaflist,
bufsize = 32000)
*(const char* name, char* address, const char* leaflist,
bufsize = 32000)
*(const char* name,
address, const char* leaflist,
bufsize = 32000)
*(const char* name, int address, const char* leaflist,
bufsize = 32000)
virtual *(const char* name, const char* classname, void* addobj,
bufsize = 32000,
splitlevel = 99)
*(const char* name, const char* classname, const char* obj,
bufsize = 32000,
splitlevel = 99)
*(const char* name, void* obj,
bufsize = 32000,
splitlevel = 99)
virtual *(const char* name, const char* classname, void* addobj,
bufsize = 32000,
splitlevel = 1)
virtual *()
virtual *(const char* name, const char* classname, void* addobj,
bufsize = 32000,
splitlevel = 99)
virtual void(*)
virtual (const char* majorname, const char* minorname = "0")
*(* cl, void* pointer = 0,
canOptimize = )
virtual void( flag = )
virtual *(* file)
static *()
virtual const char*() const
virtual void(* option = "")
virtual *(const char* newname = "") const
virtual *( nentries = -1, * option = "")
virtual (const * obj) const
virtual void(& named) const
virtual void(*,
virtual (* tree,
nentries = -1, * option = "")
virtual *(const char* selection, * option = "",
nentries = ,
firstentry = 0)
virtual *(*)
virtual void()
virtual void(* option = "")MENU
virtual void(*)
virtual ( px,
virtual void(* opt)
virtual (const char* varexp, const & selection, * option = "",
nentries = ,
firstentry = 0)
virtual (const char* varexp, const char* selection, * option = "",
nentries = ,
firstentry = 0)MENU
virtual void() constMENU
virtual *(* option = "") constMENU
virtual void()
virtual (const char* bname,
subbranches = )
virtual (* branch,
subbranches = )
virtual void( nbytes)
virtual void() constMENU
virtual void(const char* method, const char* msgfmt) const
virtual void(const char* method, const char* params, * error = 0)
virtual void(* method, * params, * error = 0)
virtual void( event,
virtual void(const char* method, const char* msgfmt) const
virtual ()
virtual void(char*& buffer)
virtual *(const char* name)
virtual *(const char* name)
virtual *(const char* name) const
virtual *(const * obj) const
virtual (const char* funcname, const char* varexp, const char* selection = "", * option = "", * goption = "",
nentries = ,
firstentry = 0)MENU
virtual () const
virtual const char*(const char* aliasName) const
virtual () const
virtual () const
virtual *(const char* name)
virtual *() const
virtual (const char* branchname) const
virtual () const
virtual ( entry) const
virtual () const
virtual ::TClusterIterator( firstentry)
virtual *() const
virtual () const
virtual (const char* sel)
virtual () const
virtual () const
virtual ( entry = 0,
getall = 0)
virtual *()
virtual ( entry) const
virtual ( major,
minor = 0) const
virtual ( major,
minor = 0) const
virtual ( major,
minor = 0)
virtual () const
( entry = 0,
getall = 0)
virtual () const
virtual () const
virtual () const
virtual *(const char*) const
virtual const char*(*) const
virtual const char*() const
virtual *()
virtual *()
virtual *( dir = )
virtual *(const char* name)
virtual *(const char* branchname, const char* leafname)
virtual () const
virtual () const
virtual () const
virtual *() const
virtual *()
virtual *()
virtual *() const
virtual *()
virtual () const
virtual () const
virtual () const
virtual () const
virtual (const char* columname)
virtual () const
virtual (const char* columname)
virtual const char*() const
virtual ()
virtual char*( px,
virtual *() const
virtual () const
virtual *() const
virtual () const
virtual () const
virtual () const
virtual ()
virtual () const
virtual const char*() const
virtual () const
virtual *() const
virtual *() const
virtual () const
virtual () const
virtual () const
virtual *()
virtual *()
virtual *()
virtual *()
virtual *()
virtual *( i)
virtual *()
virtual () const
virtual () const
virtual (* timer)
virtual () const
virtual void( nbytes)
virtual void(const char* method, const char* msgfmt) const
virtual (const char* classname) const
virtual (const * cl) const
virtual void() constMENU
virtual *() const
virtual (const * obj) const
virtual () const
virtual () const
virtual () const
virtual ( maxmemory)
virtual ( entry)
virtual ( entry, * T)
void( force = )
virtual void(* option = "",
nentries = ,
firstentry = 0)MENU
virtual void(* option = "") const
virtual (const char* classname = 0, * option = "")
virtual (const char* filename = 0)
virtual (const char* classname, const char* macrofilename = 0, const char* cutfilename = 0, const char* option = 0,
maxUnrolling = 3)
virtual (const char* selector = 0)
void(const char* method) const
virtual (const char* name, * option = "")
virtual (* list, * option = "")
virtual (* list, * info)
virtual (* file,
basketsize, * option = "")
static *(* list, * option = "")
virtual void()
virtual ()
void(const char* method, const char* asOfVers, const char* removedFromVers) const
void(void* ptr)
void(void* ptr, void* vp)
void(void* ptr)
void(void* ptr, void* vp)
void*( sz)
void*( sz, void* vp)
void*( sz)
void*( sz, void* vp)
virtual void( maxMemory = ,
minComp = 1.0001, * option = "")
virtual void(* option = "")
virtual void()
*(const char* varexp = "", const char* selection = "", * option = "np",
nentries = ,
firstentry = 0)
virtual void(* option = "") const
virtual void(* option = "") const
virtual (const char* filename, * option = "",
nentries = ,
firstentry = 0)MENU
virtual (* selector, * option = "",
nentries = ,
firstentry = 0)
virtual (const char* hname, const char* varexp, const char* selection = "", * option = "",
nentries = ,
firstentry = 0)
virtual *(const char* varexp = "", const char* selection = "", * option = "",
nentries = ,
firstentry = 0)
virtual (const char* name)
virtual (const char* filename, const char* branchDescriptor = "", char delimiter = ' ')
virtual (& inputStream, const char* branchDescriptor = "", char delimiter = ' ')
virtual void(* obj)
virtual void()
virtual void(*)
virtual void(* option = "")
virtual void(*)
virtual void(* option = "")
virtual void(* option = "")
virtual void(* toption = "")
virtual void(*)
virtual void()
virtual void(const char* filename = "", * option = "") constMENU
virtual void(& out, const char* name,
coldef = 1,
stydef = 1001)
virtual void(& out, const char* name,
coldef = 1,
stydef = 1,
widdef = 1)
virtual void(& out, const char* name,
coldef = 1,
stydef = 1,
sizdef = 1)
virtual void(& out, * option = "")
virtual (const char* varexp = "", const char* selection = "", * option = "",
nentries = ,
firstentry = 0)MENU
virtual (const char* aliasName, const char* aliasFormula)
virtual void( autodel = )
virtual void( autof = -)
virtual void( autos = -)
virtual void(const char* bname,
buffsize = 16000)
virtual (const char* bname, void* add, ** ptr = 0)
virtual (const char* bname, void* add, * realClass, EDataType datatype,
virtual (const char* bname, void* add, ** ptr, * realClass, EDataType datatype,
virtual void(const char* bname,
status = 1, * found = 0)
static void( style = 1)
virtual ( first,
virtual void( n = 10)
virtual ( cacheSize = -1)
virtual void( offset = 0)
virtual void( maxEntries)
virtual void( level = 1,
max = 9999999)MENU
virtual void( newdefault,
updateExisting = )
virtual void(* dir)
virtual void(* option = "")MENU
static void(void* obj)
virtual ( n = -1)
virtual void(* elist, * opt = "")
virtual void(const char* filename = "", * opt = "")
virtual void( nentries = 1000000)
virtual void(* evlist)
virtual void( number = 0)
virtual void()MENU
virtual void( fcolor)
virtual void( fcolor,
virtual void( fstyle)
virtual void()MENU
virtual void( lcolor)
virtual void( lcolor,
virtual void( lstyle)
virtual void( lwidth)
virtual void( make)
virtual void()MENU
virtual void( mcolor = 1)
virtual void( mcolor,
virtual void( msize = 1)
virtual void( mstyle = 1)
virtual void( maxev = )MENU
static void( maxsize = )
virtual void( size = 0)MENU
virtual void(const char* name)MENU
virtual void(const char* name, const char* title)
virtual void(* obj)
virtual void(const char* name, const char* title)
static void( stat)
virtual void( size = 100)
virtual void( opt = ,
RelSize = -1)
virtual void(* perf)
virtual void( on = ,
refresh = ,
gettreeheader = )
virtual void( n = 50)MENU
virtual void( msec = 333)
virtual void(const char* title = "")MENU
virtual void(* index)
virtual void( uid)
virtual void( freq = 0)
virtual void( w = 1, * option = "")
virtual void( entry = -1,
lenmax = 20)
virtual void(& insp) const
virtual () const
virtual void()MENU
virtual ()
virtual void(&)
void(& ClassDef_StreamerNVirtual_b)
virtual void(const char* method, const char* msgfmt) const
(const char* name, const char* title = "")
( f) const
( f) const
virtual (const char* funcname, const char* varexp, const char* selection = "", * option = "",
nentries = ,
firstentry = 0)
virtual void( maxCacheSize = 10,
pageSize = 0)
virtual void()
virtual void(const char* method, const char* msgfmt) const
virtual (const char* name = 0,
option = 0,
bufsize = 0)
virtual (const char* name = 0,
option = 0,
bufsize = 0) const
protected:
virtual *(const char* branchname, * ptrClass, void* addobj,
splitlevel)
virtual *(const char* branchname, const char* classname, * ptrClass, void* addobj,
splitlevel)
virtual *(const char* branchname, const char* classname, * ptrClass, void* addobj,
splitlevel)
virtual *(const char* branchname, * ptrClass, EDataType datatype, void* addobj,
splitlevel)
virtual *(const char* name, const char* classname, void* addobj,
splitlevel)
virtual (* branch, * ptrClass, EDataType datatype,
virtual void(int level, const char* location, const char* fmt,
( withDefault = ) const
virtual *(const char* branchname, const char* leafname)
char(& inputStream)
create = )
void(* fromtree)
virtual void()
void(* src, * dir)
(* branch, void* addr, ** ptr)
( autocache = ,
cacheSize = 0)
&(const &)
void(const char* name, & filename, & treename, & query, & suffix,
wildcards) const
Data Members
static ::(anonymous)kAutoDelete
static ::(anonymous)kBigNumber
static ::(anonymous)
static ::EStatusBits
static ::EStatusBits
static ::(anonymous)
static ::ESetBranchAddressStatus
static ::(anonymous)
static ::(anonymous)kGlobalWeight
static ::EStatusBits
static ::ESetBranchAddressStatus
static ::EStatusBits
static ::(anonymous)
static ::EStatusBits
static ::ESetBranchAddressStatus
static ::ESetBranchAddressStatus
static ::ESetBranchAddressStatus
static ::ESetBranchAddressStatus
static ::ESetBranchAddressStatus
static ::ESetBranchAddressStatus
static ::ESetBranchAddressStatus
static ::EStatusBits
static ::ESetBranchAddressStatus
static ::EStatusBits
static ::(anonymous)
static ::EStatusBits
static ::(anonymous)
static ::(anonymous)kProofLite
static ::(anonymous)kProofUptodate
static ::(anonymous)
static ::(anonymous)
static ::ESetBranchAddressStatus
static ::(anonymous)
static ::(anonymous)
protected:
*List of aliases for expressions based on the tree branches.
Autoflush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced
Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced
*Branch supporting the TRefTable (if any)
List of Branches
! true if cache auto creation or resize check is needed
! Maximum size of file buffers
! true if the cache setting was explicitly given by user
fCanDeleteRefs! If true, TProcessIDs are deleted when closing a file
! Offset of 1st entry of this Tree in a TChain
*! List of cloned trees which share our addresses
*[fNClusterRange] Last entry of a cluster range.
*[fNClusterRange] Number of entries in each cluster for a given range.
! Debug level
! Last entry number to debug
! First entry number to debug
Initial Length of fEntryOffset table in the basket buffers
*! Pointer to directory holding this tree
Number of entries
*! Pointer to event selection list (if one)
Number of entries to estimate histogram limits
*! Pointer to event selection list (if one)
*fFile! Pointer to current file (We own the file).
! current file number (if file extensions)
*fFiles-& List of file names containing the trees (TChainElement, owned)
fill area color
fill area style
Number of autoflushed bytes
! Record which method is locking the friend recursion
*pointer to list of friend elements
Index of sorted values
Sorted index values
Direct pointers to individual branch leaves
line color
line style
line width
! not zero when processing code generated by MakeClass
Marker color index
Marker size
Marker style
! Memory allocated for the cluster range.
Maximum number of entries in case of circular buffers
Maximum number of entries to process
Maximum total size of buffers kept in memory
Number of Cluster range in addition to the one defined by 'AutoFlush'
object identifier
! Local for EntryLoop
*! Object to be notified when loading a Tree
fNtreesNumber of trees
! Number of entries in one packet for parallel root
*! pointer to the current perf stats object
*! Pointer to current Tree player
*fProofChain! chain proxy when going to be processed by PROOF
! Number of the entry being processed
Number of autosaved bytes
Number of runs before prompting in Scan
*fStatus-& List of active/inactive branches (TChainElement, owned)
Timer interval in milliseconds
object title
Total number of bytes in all branches before compression
! Total number of bytes in branch buffers
*! Pointer to the current transient buffer.
*fTree! Pointer to current tree (Note: We do *not* own this tree.)
*Pointer to the tree Index (if any)
fTreeNumber! Current Tree number in fTreeOffset table
*fTreeOffset[fTreeOffsetLen] Array of variables
fTreeOffsetLenCurrent size of fTreeOffset array
Update frequency for EntryLoop
*pointer to a list of user objects associated to this Tree
Tree weight (see TTree::SetWeight)
Total number of bytes in all branches after compression
static Old/New branch style
static Maximum size of a file containg a Tree
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
static ::ELockStatusBits
Class Charts
Function documentation
-- Default constructor.
(const char* name, const char* title = "")
-- Create a chain.
is a collection of
the first parameter "name" is the name of the
in the files added with .
Use :: to add a new element to this chain.
In case the Tree is in a subdirectory, do, eg:
ch("subdir/treename");
Suppose we have 3 files f1.root, f2.root and f3.root. Each file
contains a
object named "T".
creates a chain to process a Tree called "T"
ch.("f1.root");
ch.("f2.root");
ch.("f3.root");
function above will process the variable "x" in Tree "T"
reading sequentially the 3 files in the chain ch.
data structure
has a name equal to the tree name of this
and a title equal to the file name. So, to loop over the
TFiles that have been added to this chain:
*fileElements=chain-&();
next(fileElements);
while (( chEl=(*)next() )) {
f(chEl-&());
... do something with f ...
-- Destructor.
all files referenced by the passed chain to this chain.
The function returns the total number of files connected.
(const char* name,
nentries = )
a new file to this chain.
Argument name may have either of two formats. The first:
[//machine]/path/file_name.root[/tree_name]
If tree_name is missing the chain name will be assumed.
Wildcard treatment is triggered by the any of the special characters []*?
which may be used in the file name, eg. specifying "xxx*.root" adds
all files starting with xxx in the current file system directory.
Alternatively name may have the format of a url, eg.
root://machine/path/file_name.root
root://machine/path/file_name.root/tree_name
root://machine/path/file_name.root/tree_name?query
where "query" is to be interpreted by the remote server. Wildcards may be
supported in urls, depending on the protocol plugin and the remote server.
http or https urls can contain a query identifier without tree_name, but
generally urls can not be written with them because of ambiguity with the
wildcard character. (Also see the documentaiton for ::,
which does not support wildcards but allows the url to contain query)
NB. To add all the files of a
to a chain, use ( *chain).
A- if nentries &= 0, the file is connected and the tree header read
in memory to get the number of entries.
B- if (nentries & 0, the file is not connected, nentries is assumed to be
the number of entries in the file. In this case, no check is made that
the file exists and the Tree existing in the file. This second mode
is interesting in case the number of entries in the file is already stored
in a run data base for example.
C- if (nentries == ) (default), the file is not connected.
the number of entries in each file will be read only when the file
will need to be connected to read an entry.
This option is the default and very efficient if one process
the chain sequentially. Note that in case ::(entry)
is called and entry refers to an entry in the 3rd file, for example,
this forces the Tree headers in the first and second file
to be read to find the number of entries in these files.
Note that if one calls ::() after having created
a chain with this default,
will return !
:: will force of the Tree headers in the chain to be
read to read the number of entries in each Tree.
data structure
has a name equal to the tree name of this
and a title equal to the file name. So, to loop over the
TFiles that have been added to this chain:
*fileElements=chain-&();
next(fileElements);
while (( chEl=(*)next() )) {
f(chEl-&());
... do something with f ...
Return value:
If nentries&0 (including the default of ) and no
wildcarding is used, ALWAYS returns 1 without regard to whether
the file exists or contains the correct tree.
If wildcarding is used, regardless of the value of nentries,
returns the number of files matching the name without regard to
whether they contain the correct tree.
If nentries&=0 and wildcarding is not used, return 1 if the file
exists and contains the correct tree and 0 otherwise.
(const char* name,
nentries = , const char* tname = "")
a new file to this chain.
Filename formats are similar to ::. Wildcards are not
applied. urls may also contain query and fragment identifiers
where the tree name can be specified in the url fragment.
root://machine/path/file_name.root?query#tree_name
If tree_name is given as a part of the file name it is used to
as the name of the tree to load from the file. Otherwise if tname
argument is specified the chain will load the tree named tname from
the file, otherwise the original treename specified in the
constructor will be used.
A. If nentries &= 0, the file is opened and the tree header read
into memory to get the number of entries.
B. If nentries & 0, the file is not opened, and nentries is assumed
to be the number of entries in the file. In this case, no check
is made that the file exists nor that the tree exists in the file.
This second mode is interesting in case the number of entries in
the file is already stored in a run database for example.
C. If nentries ==
(default), the file is not opened.
The number of entries in each file will be read only when the file
is opened to read an entry.
This option is the default and very
efficient if one processes the chain sequentially.
Note that in
case (entry) is called and entry refers to an entry in the
third file, for example, this forces the tree headers in the first
and second file to be read to find the number of entries in those
Note that if one calls () after having created
a chain with this default, () will return !
Using the () function instead will force all of the tree
headers in the chain to be read to read the number of entries in
each tree.
data structure
has a name equal to the tree name of this
and a title equal to the file name. So, to loop over the
TFiles that have been added to this chain:
*fileElements=chain-&();
next(fileElements);
while (( chEl=(*)next() )) {
f(chEl-&());
... do something with f ...
The function returns 1 if the file is successfully connected, 0 otherwise.
nfiles = )
all files referenced in the list to the chain. The object type in the
list must be either
The function return 1 if successful, 0 otherwise.
* (const char* chainname, const char* dummy = "")
to the list of friends of this chain.
has a list of friends similar to a tree (see ::).
You can add a friend to a chain with the :: method, and you
can retrieve the list of friends with ::.
This example has four chains each has 20
trees from 20
ch("t"); // a chain with 20 trees from 20 files
ch1("t1");
ch2("t2");
ch3("t3");
Now we can add the friends to the first chain.
The parameter is the name of friend chain (the name of a chain is always
the name of the tree from which it was created).
The original chain has access to all variable in its friends.
We can use the :: method as if the values in the friends were
in the original chain.
To specify the chain to use in the
method, use the syntax:
&chainname&.&branchname&.&varname&
If the variable name is enough to uniquely identify the variable, you can
leave out the chain and/or branch name.
For example, this generates a 3-d scatter plot of variable "var" in the
ch versus variable v1 in
t1 versus variable v2 in
ch.("var:t1.v1:t2.v2");
When a :: is executed, an automatic call to ::
connects the trees in the chain. When a chain is deleted, its friend
elements are also deleted.
The number of entries in the friend must be equal or greater to the number
of entries of the original chain. If the friend has fewer entries a warning
is given and the resulting histogram will have missing entries.
For additional information see ::.
* (const char* chainname, * dummy)
the whole chain or tree as a friend of this chain.
* (* chain, const char* alias = "",
the whole chain or tree as a friend of this chain.
the contents of the chain.
void ( flag = )
When closing a file during the chain processing, the file
may be closed with option "R" if flag is set to .
by default flag is .
When closing a file with option "R", all TProcessIDs referenced by this
file are deleted.
Calling ::("R") might be necessary in case one reads a
of files having , writing some of the referenced objects or
to a new file. If the
or referenced objects of the file being closed
will not be referenced again, it is possible to minimize the size
data structures in memory by forcing a delete of
the unused .
-- Initialize the packet descriptor string.
Override the :: behavior:
we never auto add.
(const char* varexp, const & selection, * option = "",
nentries = ,
firstentry = 0)
expression varexp for selected entries.
Returns -1 in case of error or number of selected events in case of success.
This function accepts
objects as arguments.
Useful to use the string operator +, example:
ntuple.("x",cut1+cut2+cut3);
(const char* varexp, const char* selection, * option = "",
nentries = ,
firstentry = 0)
all entries in this chain and draw histogram corresponding to
expression varexp.
Returns -1 in case of error or number of selected events in case of success.
* (const char* name)
-- See ::().
* (const char* name)
-- See ::().
const char* (const char* aliasName) const
-- Returns the expanded value of the alias.
Search in the friends if any.
* (const char* name)
-- Return pointer to the branch name in the current tree.
(const char* branchname) const
-- See ::().
::TClusterIterator ( firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
This iterator is not yet supported for
( entry) const
-- Return absolute entry number in the chain.
The input parameter entry is the entry number in
the current tree of this chain.
-- Return the total number of entries in the chain.
In case the number of entries in each tree is not yet known,
the offset table is computed.
( entry = 0,
getall = 0)
-- Get entry from the file to memory.
getall = 0 : get only active branches
getall = 1 : get all branches
Return the total number of bytes read,
0 bytes read indicates a failure.
( entry) const
-- Return entry number corresponding to entry.
set returns entry
else returns entry #entry from this entry list and
also computes the global entry number (loads all tree headers)
minor = 0)
-- Return entry corresponding to major and minor number.
The function returns the total number of bytes read.
If the Tree has friend trees, the corresponding entry with
the index values (major,minor) is read. Note that the master Tree
and its friend may have different entry serial numbers corresponding
to (major,minor).
* () const
-- Return a pointer to the current file.
If no file is connected, the first file is automatically loaded.
* (const char* branchname, const char* leafname)
-- Return a pointer to the leaf name in the current tree.
* (const char* name)
-- Return a pointer to the leaf name in the current tree.
-- Return a pointer to the list of branches of the current tree.
: If there is no current
yet, this routine will open the
first in the chain.
Returns 0 on failure.
-- Return a pointer to the list of leaves of the current tree.
: May set the current tree!
(const char* columname)
-- Return maximum of column with name columname.
(const char* columname)
-- Return minimum of column with name columname.
-- Return the number of branches of the current tree.
: May set the current tree!
-- See ::().
-- Return the chain weight.
By default the weight is the weight of the current tree.
However, if the weight has been set in ::()
with the option "global", then that weight will be returned.
: May set the current tree!
to be reloaded as soon as possible.
In particular this
is needed when adding a Friend.
( maxmemory)
-- Dummy function.
It could be implemented and load all baskets of all trees in the chain.
For the time being use :: and ::LoadBasket
on the resulting tree.
-- Find the tree which contains entry, and set it as the current tree.
Returns the entry number in that tree.
The input argument entry is the entry serial number in the whole chain.
In case of error,
returns a negative number:
-1: The chain is empty.
-2: The requested entry number of less than zero or too large for the chain.
or too large for the large .
-3: The file corresponding to the entry could not be correctly open
corresponding to the entry is missing or
is missing from the file.
Note: This is the only routine which sets the value of
a non-zero pointer.
void ( force = )
Check / locate the files in the chain.
By default only the files not yet looked up are checked.
Use force =
to check / re-check every file.
void (* option = "",
nentries = ,
firstentry = 0)
on nentries of this chain starting at firstentry.
(NOT IMPLEMENTED)
void (* option = "") const
-- List the chain.
(const char* name, * option = "")
all the entries in the chain into a new tree in a new file.
See important note in the following function ().
If the chain is expecting the input tree inside a directory,
this directory is NOT created by this routine.
So in a case where we have:
ch("mydir/mytree");
ch.("newfile.root");
The resulting file will have not subdirectory. To recreate
the directory structure do:
* file = ::("newfile.root", "RECREATE");
file-&mkdir("mydir")-&cd();
ch.(file);
(* list, * option = "")
all chains in the collection.
(NOT IMPLEMENTED)
(* list, * info)
all chains in the collection.
(NOT IMPLEMENTED)
basketsize, * option = "")
all the entries in the chain into a new tree in the current file.
Note: The "file" parameter is *not* the file where the new
tree will be inserted.
The new tree is inserted into
gDirectory, which is usually the most recently opened
file, or the directory most recently cd()'d to.
If option = "C" is given, the compression level for all branches
in the new Tree is set to the file compression level.
By default,
the compression level of all branches is the original compression
level in the old trees.
If basketsize & 1000, the basket size for all branches of the
new tree will be set to basketsize.
Example using the file generated in $ROOTSYS/test/Event
merge two copies of Event.root
.("libEvent");
ch.("Event1.root");
ch.("Event2.root");
ch.("all.root");
If the chain is expecting the input tree inside a directory,
this directory is NOT created by this routine.
So if you do:
ch("mydir/mytree");
ch.("newfile.root");
The resulting file will not have subdirectories.
In order to
preserve the directory structure do the following instead:
* file = ::("newfile.root", "RECREATE");
file-&mkdir("mydir")-&cd();
ch.(file);
If 'option' contains the word 'fast' the merge will be done without
unzipping or unstreaming the baskets (i.e., a direct copy of the raw
bytes on disk).
When 'fast' is specified, 'option' can also contains a
sorting order for the baskets in the output file.
There is currently 3 supported sorting order:
SortBasketsByOffset (the default)
SortBasketsByBranch
SortBasketsByEntry
When using SortBasketsByOffset the baskets are written in
the output file in the same order as in the original file
(i.e. the basket are sorted on their offset in the original
Usually this also means that the baskets are sorted
on the index/number of the _last_ entry they contain)
When using SortBasketsByBranch all the baskets of each
individual branches are stored contiguously.
This tends to
optimize reading speed when reading a small number (1-&5) of
branches, since all their baskets will be clustered together
instead of being spread across the file.
However it might
decrease the performance when reading more branches (or the full
When using SortBasketsByEntry the baskets with the lowest
starting entry are written first.
(i.e. the baskets are
sorted on the index/number of the first entry they contain).
This means that on the file the baskets will be in the order
in which they will be needed when reading the whole tree
sequentially.
IMPORTANT Note 1: AUTOMATIC
When merging many files, it may happen that the resulting file
reaches a size & :: (default = 1.9 GBytes).
In this case the current file is automatically closed and a new
file started.
If the name of the merged file was "merged.root",
the subsequent files will be named "merged_1.root", "merged_2.root",
fgMaxTreeSize may be modified via the static function
When in fast mode, the check and switch is only done in between each
input file.
IMPORTANT Note 2: The output file is automatically closed and deleted.
This is required because in general the automatic file overflow described
above may happen during the merge.
If only the current file is produced (the file passed as first argument),
one can instruct
to not close and delete the file by specifying
the option "keep".
The function returns the total number of files produced.
To check that all files have been merged use something like:
if (newchain-&()!=oldchain-&()) {
... not all the file have been copied ...
void (const char* name, & filename, & treename, & query, & suffix,
wildcards) const
-- Get the tree url or filename and other information from the name
A treename and a url's query section is split off from name. The
splitting depends on whether the resulting filename is to be
subsequently treated for wildcards or not, since the question mark is
both the url query identifier and a wildcard. Wildcard matching is not
done in this method itself.
/a/path/file.root[/treename]
xxx://a/path/file.root[/treename][?query]
xxx://a/path/file.root[?query[#treename]]
- is the original name
wildcards - indicates if the resulting filename will be treated for
wildcards. For backwards compatibility, with most protocols
this flag suppresses the search for the url fragment
identifier and limits the query identifier search to cases
where the tree name is given as a trailing slash-separated
string at the end of the file name.
- the url or filename to be opened or matched
- the treename, which may be found as a trailing part of the
name or in a url fragment section. If not found this will
- is the url query section, including the leading question
mark. If not found or the query section is only followed by
a fragment this will be empty.
- the portion of name which was removed to form filename.
void (* option = "") const
the header information of each tree in the chain.
See :: for a list of options.
(const char* filename, * option = "",
nentries = ,
firstentry = 0)
all entries in this chain, calling functions in filename.
The return value is -1 in case of error and ::() in
in case of success.
(* selector, * option = "",
nentries = ,
firstentry = 0)
this chain executing the code in selector.
The return value is -1 in case of error and ::() in
in case of success.
void (* obj)
Make sure that obj (which is being deleted or will soon be) is no
longer referenced by this .
Remove a friend from the list of friends.
void (* option = "")
Resets the state of this chain.
Resets the state of this chain after a merge (keep the customization but
forget the data).
(const char* varexp = "", const char* selection = "", * option = "",
nentries = ,
firstentry = 0)
on tree and print entries passing selection.
If varexp is 0 (or "") then print only first 8 columns.
If varexp = "*" print all columns.
Otherwise a columns selection can be made using "var1:var2:var3".
See :: for more information.
void ( autodel = )
-- Set the global branch
loads a new Tree, the branches for which
the address is set will have the option AutoDelete set
For more details on AutoDelete, see ::.
( cacheSize = -1)
Set the cache size of the underlying ,
0 cache state ok (exists or not, as appropriate)
-1 on error
the addresses of the branch.
the addresses of the branches.
(const char* bname, void* add, ** ptr = 0)
Set branch address.
bname is the name of a branch.
add is the address of the branch.
Note: See the comments in ::() for a more
detailed discussion of the meaning of the add parameter.
IMPORTANT REMARK:
In case :: is called, it must be called
BEFORE calling this function.
See :: for the semantic of the return value.
(const char* bname, void* add, * realClass, EDataType datatype,
Check if bname is already in the status list, and if not, create a
object and set its address.
See :: for the semantic of the return value.
Note: See the comments in ::() for a more
detailed discussion of the meaning of the add parameter.
(const char* bname, void* add, ** ptr, * realClass, EDataType datatype,
Check if bname is already in the status list, and if not, create a
object and set its address.
See :: for the semantic of the return value.
Note: See the comments in ::() for a more
detailed discussion of the meaning of the add parameter.
void (const char* bname,
status = 1, * found = 0)
-- Set branch status to
or DoNotProcess
bname is the name of a branch. if bname="*", apply to all branches.
status = 1
branch will be processed
branch will not be processed
See IMPORTANT REMARKS in :: and ::
If found is not 0, the number of branch(es) found matching the regular
expression is returned in *found AND the error message 'unknown branch'
is suppressed.
void (* dir)
Remove reference to this chain from current directory and add
reference to new directory dir. dir can be 0 in which case the chain
does not belong to any directory.
void (* elist, * opt = "")
Set the input entry list (processing the entries of the chain will then be
limited to the entries in the list)
This function finds correspondance between the sub-lists of the
and the trees of the
By default (opt=""), both the file names of the chain elements and
the file names of the
sublists are expanded to full path name.
If opt = "ne", the file names are taken as they are and not expanded
void (const char* filename = "", * opt = "")
Set the input entry list (processing the entries of the chain will then be
limited to the entries in the list). This function creates a special kind
of entry list ( object) that loads lists, corresponding
to the chain elements, one by one, so that only one list is in memory at a time.
If there is an error opening one of the files, this file is skipped and the
next file is loaded
File naming convention:
- by default, filename_elist.root is used, where filename is the
name of the chain element
- xxx$xxx.root - $ sign is replaced by the name of the chain element
If the list name is not specified (by passing filename_elist.root/listname to
the ::() function, the first object of class
in the file is taken.
It is assumed, that there are as many list files, as there are elements in
the chain and they are in the same order
void (* evlist)
This function transfroms the given
NOTE, that this function loads all tree headers, because the entry numbers
are global and have to be recomputed, taking into account
the number of entries in each tree.
is owned by the
and gets deleted when the chain
is deleted. This
is returned by () function, and after
() function is called, the
is not owned by the chain
any more and will not be deleted with it.
void ( size = 100)
-- Set number of entries per packet for parallel root.
void ( on = ,
refresh = ,
gettreeheader = )
Enable/Disable PROOF processing on the current default Proof ().
"Draw" and "Processed" commands will be handled by PROOF.
The refresh and gettreeheader are meaningfull only if on == .
If refresh is
the underlying
(chain proxy) is always
rebuilt (even if already existing).
If gettreeheader is
the header of the tree will be read from the
PROOF cluster: this is only needed for browsing and should be used with
care because it may take a
time to execute.
void ( w = 1, * option = "")
-- Set chain weight.
The weight is used by :: to automatically weight each
selected entry in the resulting histogram.
For example the equivalent of
chain.("x","w")
chain.(w,"global");
chain.("x");
By default the weight used will be the weight
of each Tree in the . However, one can force the individual
weights to be ignored by specifying the option "global".
In this case, the
global weight will be used for all Trees.
-- Stream a class object.
void ( maxCacheSize = 10,
pageSize = 0)
-- Dummy function kept for back compatibility.
The cache is now activated automatically when processing TTrees/.
(const & )
& (const & )
(const char* varexp, const & selection, * option = "",
nentries = ,
firstentry = 0)
{ ("Fill()"); return -1; }
? ->() : fCacheS }
{ return ; }
* () const
returns the list of TChainElements (not the list of files)
see :: to see how to get the corresponding
{return ;}
* () const
{ return ; }
* () const
{ return ; }
{ return ; }
* () const
{ return ; }
{ return ; }
void ( make)
{ ::(make); if () ->(make);}

我要回帖

更多关于 口爆是什么意思 的文章

 

随机推荐