artdaq_node_server  v1_00_11
 All Classes Namespaces Files Variables
Variables
JSRootIOEvolution.js File Reference

Go to the source code of this file.

Variables

function JSROOT fUserStreamers = null
 
JSROOT addUserStreamer
 
JSROOT ReconstructObject
 
JSROOT TBuffer prototype ntou4
 
JSROOT TBuffer prototype ntou8
 
JSROOT TBuffer prototype ntoi1
 
JSROOT TBuffer prototype ntoi4
 
JSROOT TBuffer prototype ntoi8
 
JSROOT TBuffer prototype ntof
 
JSROOT TBuffer prototype ntod
 
JSROOT TBuffer prototype ReadFastArray
 
JSROOT TBuffer prototype ReadBasicPointer
 
JSROOT TBuffer prototype ReadString
 
JSROOT TBuffer prototype ReadTString
 
JSROOT TBuffer prototype GetMappedObject
 
JSROOT TBuffer prototype MapObject
 
JSROOT TBuffer prototype MapClass
 
JSROOT TBuffer prototype GetMappedClass
 
JSROOT TBuffer prototype ClearObjectMap
 
JSROOT TBuffer prototype ReadVersion
 
JSROOT TBuffer prototype CheckBytecount
 
JSROOT TBuffer prototype ReadTObjString
 
JSROOT TBuffer prototype ReadTClonesArray
 
JSROOT TBuffer prototype ReadStreamerElement
 
JSROOT TBuffer prototype ReadStreamerBase
 
JSROOT TBuffer prototype ReadStreamerBasicType
 
JSROOT TBuffer prototype ReadStreamerBasicPointer
 
JSROOT TBuffer prototype ReadStreamerSTL
 
JSROOT TBuffer prototype ReadTStreamerObject
 
JSROOT TBuffer prototype ReadClass
 
JSROOT TBuffer prototype ReadObjectAny
 
JSROOT TBuffer prototype ClassStreamer
 
JSROOT TStreamer prototype ReadBasicType
 
JSROOT TStreamer prototype Stream
 
JSROOT TDirectory
 
JSROOT TDirectory prototype GetKey
 
JSROOT TDirectory prototype StreamHeader
 
JSROOT TFile
 
JSROOT TFile prototype Seek
 
JSROOT TFile prototype ReadHeader
 

Detailed Description

I/O methods of JavaScript ROOT

Definition in file JSRootIOEvolution.js.

Variable Documentation

JSROOT TBuffer prototype CheckBytecount
Initial value:
= function(ver, where) {
if (('bytecnt' in ver) && (ver['off'] + ver['bytecnt'] != this.o)) {
alert("Missmatch in " + where + " bytecount expected = " + ver['bytecnt'] + " got = " + (this.o-ver['off']));
this.o = ver['off'] + ver['bytecnt'];
return false;
}
return true;
}
JSROOT.TBuffer.prototype.ReadTObject = function(tobj) {
this.o += 2;
if ((!'_typename' in tobj) || (tobj['_typename'] == ''))
tobj['_typename'] = "TObject";
tobj['fUniqueID'] = this.ntou4();
tobj['fBits'] = this.ntou4();
return true;
}
JSROOT.TBuffer.prototype.ReadTNamed = function(tobj) {
var ver = this.ReadVersion();
this.ReadTObject(tobj);
tobj['fName'] = this.ReadTString();
tobj['fTitle'] = this.ReadTString();
return this.CheckBytecount(ver, "ReadTNamed");
}

Definition at line 408 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ClearObjectMap
Initial value:
= function() {
this.fObjectMap = {};
this.fClassMap = {};
this.fObjectMap[0] = null;
}

Definition at line 391 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype GetMappedClass
Initial value:
= function(tag) {
if (tag in this.fClassMap) return this.fClassMap[tag];
return -1;
}

Definition at line 386 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype GetMappedObject
Initial value:
= function(tag) {
return this.fObjectMap[tag];
}

Definition at line 373 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype MapClass
Initial value:
= function(tag, classname) {
this.fClassMap[tag] = classname;
}

Definition at line 382 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype MapObject
Initial value:
= function(tag, obj) {
if (obj==null) return;
this.fObjectMap[tag] = obj;
}

Definition at line 377 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ntod
Initial value:
= function() {
var inString = this.b.substring(this.o, this.o + 8); this.o+=8;
if (inString.length < 8) return Number.NaN;
var bits = "";
for (var i=0; i<8; i++) {
var curByte = (inString.charCodeAt(i) & 0xff).toString(2);
var byteLen = curByte.length;
if (byteLen < 8) {
curByte = '0' + curByte;
}
bits = bits + curByte;
}
var bsign = (bits.charAt(0) == '1') ? -1 : 1;
var bexp = parseInt(bits.substring(1, 12), 2) - 1023;
var bman;
bman = 0;
else {
bman = 1;
for (var i=0; i<52; i++) {
if (parseInt(bits.substr(12+i, 1)) == 1)
bman = bman + 1 / Math.pow(2, i+1);
}
}
return (bsign * Math.pow(2, bexp) * bman);
}

Definition at line 251 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ntof
Initial value:
= function() {
var inString = this.b.substring(this.o, this.o + 4); this.o+=4;
if (inString.length < 4) return Number.NaN;
var bits = "";
for (var i=0; i<4; i++) {
var curByte = (inString.charCodeAt(i) & 0xff).toString(2);
var byteLen = curByte.length;
if (byteLen < 8) {
curByte = '0' + curByte;
}
bits = bits + curByte;
}
var bsign = (bits.charAt(0) == '1') ? -1 : 1;
var bexp = parseInt(bits.substring(1, 9), 2) - 127;
var bman;
bman = 0;
else {
bman = 1;
for (var i=0; i<23; i++) {
if (parseInt(bits.substr(9+i, 1)) == 1)
bman = bman + 1 / Math.pow(2, i+1);
}
}
return (bsign * Math.pow(2, bexp) * bman);
}

Definition at line 221 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ntoi1
Initial value:
= function() {
return (this.b.charCodeAt(this.o++) & 0xff);
}
JSROOT.TBuffer.prototype.ntoi2 = function() {
var n = (this.b.charCodeAt(this.o) & 0xff) << 8;
n += (this.b.charCodeAt(this.o+1) & 0xff);
this.o += 2;
return n;
}

Definition at line 185 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ntoi4
Initial value:
= function() {
var n = ((this.b.charCodeAt(this.o) & 0xff) << 24) +
((this.b.charCodeAt(this.o+1) & 0xff) << 16) +
((this.b.charCodeAt(this.o+2) & 0xff) << 8) +
((this.b.charCodeAt(this.o+3) & 0xff));
this.o += 4;
return n;
}

Definition at line 197 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ntoi8
Initial value:
= function(b, o) {
var n = (this.b.charCodeAt(this.o) & 0xff) << 56;
n += (this.b.charCodeAt(this.o+1) & 0xff) << 48;
n += (this.b.charCodeAt(this.o+2) & 0xff) << 40;
n += (this.b.charCodeAt(this.o+3) & 0xff) << 32;
n += (this.b.charCodeAt(this.o+4) & 0xff) << 24;
n += (this.b.charCodeAt(this.o+5) & 0xff) << 16;
n += (this.b.charCodeAt(this.o+6) & 0xff) << 8;
n += (this.b.charCodeAt(this.o+7) & 0xff);
this.o += 8;
return n;
}

Definition at line 207 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ntou4
Initial value:
= function() {
var n = ((this.b.charCodeAt(this.o) & 0xff) << 24) >>> 0;
n += ((this.b.charCodeAt(this.o+1) & 0xff) << 16) >>> 0;
n += ((this.b.charCodeAt(this.o+2) & 0xff) << 8) >>> 0;
n += (this.b.charCodeAt(this.o+3) & 0xff) >>> 0;
this.o += 4;
return n;
}

Definition at line 161 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ntou8
Initial value:
= function() {
var n = ((this.b.charCodeAt(this.o) & 0xff) << 56) >>> 0;
n += ((this.b.charCodeAt(this.o+1) & 0xff) << 48) >>> 0;
n += ((this.b.charCodeAt(this.o+2) & 0xff) << 40) >>> 0;
n += ((this.b.charCodeAt(this.o+3) & 0xff) << 32) >>> 0;
n += ((this.b.charCodeAt(this.o+4) & 0xff) << 24) >>> 0;
n += ((this.b.charCodeAt(this.o+5) & 0xff) << 16) >>> 0;
n += ((this.b.charCodeAt(this.o+6) & 0xff) << 8) >>> 0;
n += (this.b.charCodeAt(this.o+7) & 0xff) >>> 0;
this.op += 8;
return n;
}

Definition at line 171 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadBasicPointer
Initial value:
= function(len, array_type) {
var isArray = this.b.charCodeAt(this.o++) & 0xff;
return this.ReadFastArray(len, array_type);
if (len==0) return new Array();
this.o--;
return this.ReadFastArray(len, array_type);
}

Definition at line 335 of file JSRootIOEvolution.js.

JSROOT TFile prototype ReadHeader
Initial value:
= function(str) {
if (str.substring(0, 4) != "root") {
return null;
}
var header = {};
var buf = new JSROOT.TBuffer(str, 4, this);
header['version'] = buf.ntou4();
header['begin'] = buf.ntou4();
var largeFile = header['version'] >= 1000000;
header['end'] = largeFile ? buf.ntou8() : buf.ntou4();
header['seekFree'] = largeFile ? buf.ntou8() : buf.ntou4();
buf.shift(12);
header['units'] = buf.ntoi1();
header['fCompress'] = buf.ntou4();
header['seekInfo'] = largeFile ? buf.ntou8() : buf.ntou4();
header['nbytesInfo'] = buf.ntou4();
if (!header['seekInfo'] && !header['nbytesInfo']) {
return null;
}
this.fSeekInfo = header['seekInfo'];
this.fNbytesInfo = header['nbytesInfo'];
return header;
}

Definition at line 1377 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadObjectAny
Initial value:
= function() {
var startpos = this.o;
var clRef = this.ReadClass();
return this.GetMappedObject(clRef['objtag']);
if (clRef['name'] == -1) return null;
var obj = {};
this.MapObject(this.fTagOffset + startpos + JSROOT.IO.kMapOffset, obj);
this.ClassStreamer(obj, clRef['name']);
return obj;
}

Definition at line 742 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadStreamerBase
Initial value:
= function(streamerbase) {
var R__v = this.ReadVersion();
this.ReadStreamerElement(streamerbase);
if (R__v['val'] > 2) {
streamerbase['baseversion'] = this.ntou4();
}
return this.CheckBytecount(R__v, "ReadStreamerBase");
}

Definition at line 647 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadStreamerBasicPointer
Initial value:
= function(streamerbase) {
var R__v = this.ReadVersion();
if (R__v['val'] > 1) {
this.ReadStreamerElement(streamerbase);
streamerbase['countversion'] = this.ntou4();
streamerbase['countName'] = this.ReadTString();
streamerbase['countClass'] = this.ReadTString();
}
return this.CheckBytecount(R__v, "ReadStreamerBasicPointer");
}

Definition at line 667 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadStreamerBasicType
Initial value:
= function(streamerbase) {
var R__v = this.ReadVersion();
if (R__v['val'] > 1) {
this.ReadStreamerElement(streamerbase);
}
return this.CheckBytecount(R__v, "ReadStreamerBasicType");
}

Definition at line 658 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadStreamerSTL
Initial value:
= function(streamerSTL) {
var R__v = this.ReadVersion();
if (R__v['val'] > 2) {
this.ReadStreamerElement(streamerSTL);
streamerSTL['stltype'] = this.ntou4();
streamerSTL['ctype'] = this.ntou4();
}
return this.CheckBytecount(R__v, "ReadStreamerSTL");
}

Definition at line 679 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadString
Initial value:
= function(max_len) {
max_len = typeof(max_len) != 'undefined' ? max_len : 0;
var len = 0;
var pos0 = this.o;
while ((max_len==0) || (len<max_len)) {
if ((this.b.charCodeAt(this.o++) & 0xff) == 0) break;
len++;
}
return (len == 0) ? "" : this.b.substring(pos0, pos0 + len);
}

Definition at line 347 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadTStreamerObject
Initial value:
= function(streamerbase) {
var R__v = this.ReadVersion();
if (R__v['val'] > 1) {
this.ReadStreamerElement(streamerbase);
}
return this.CheckBytecount(R__v, "ReadTStreamerObject");
}

Definition at line 691 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadTString
Initial value:
= function() {
var len = this.b.charCodeAt(this.o++) & 0xff;
if (len == 255) len = this.ntou4();
var pos = this.o;
this.o += len;
return (this.b.charCodeAt(pos) == 0) ? '' : this.b.substring(pos, pos + len);
}

Definition at line 360 of file JSRootIOEvolution.js.

JSROOT TBuffer prototype ReadVersion
Initial value:
= function() {
var ver = {};
var bytecnt = this.ntou4();
ver['bytecnt'] = bytecnt - JSROOT.IO.kByteCountMask - 2;
ver['val'] = this.ntou2();
ver['off'] = this.o;
return ver;
}

Definition at line 397 of file JSRootIOEvolution.js.

JSROOT TFile prototype Seek
Initial value:
= function(offset, pos) {
switch (pos) {
case this.ERelativeTo.kBeg:
this.fOffset = offset;
break;
case this.ERelativeTo.kCur:
this.fOffset += offset;
break;
case this.ERelativeTo.kEnd:
throw "Seek : seeking from end in file with fEND==0 is not supported";
this.fOffset = this.fEND - offset;
break;
default:
throw "Seek : unknown seek option (" + pos + ")";
break;
}
}

Definition at line 1356 of file JSRootIOEvolution.js.

JSROOT TDirectory prototype StreamHeader
Initial value:
= function(buf) {
var version = buf.ntou2();
var versiondir = version%1000;
buf.shift(8);
this.fNbytesKeys = buf.ntou4();
this.fNbytesName = buf.ntou4();
this.fSeekDir = (version > 1000) ? buf.ntou8() : buf.ntou4();
this.fSeekParent = (version > 1000) ? buf.ntou8() : buf.ntou4();
this.fSeekKeys = (version > 1000) ? buf.ntou8() : buf.ntou4();
if (versiondir > 2) buf.shift(18);
}

Definition at line 1222 of file JSRootIOEvolution.js.

JSROOT TDirectory
Initial value:
= function(file, dirname, cycle) {
if (! (this instanceof arguments.callee) ) {
var error = new Error("you must use new to instantiate this class");
error.source = "JSROOT.TDirectory.ctor";
throw error;
}
this.fFile = file;
this._typename = "TDirectory";
this['dir_name'] = dirname;
this['dir_cycle'] = cycle;
this.fKeys = new Array();
return this;
}

Definition at line 1110 of file JSRootIOEvolution.js.