/
riofs.go
57 lines (48 loc) · 2.38 KB
/
riofs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright ©2017 The go-hep Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package riofs contains the types and low-level functions to deal with opening
// and creating ROOT files, and decoding the internal structure of ROOT files.
//
// Users should prefer to use the groot package to open or create ROOT files instead of this one.
package riofs // import "go-hep.org/x/hep/groot/riofs"
import (
"go-hep.org/x/hep/groot/root"
)
//go:generate go run ./gen-code.go
//go:generate go run ./gendata/gen-dirs.go -f ../testdata/dirs.root
//go:generate go run ./gendata/gen-evnt-tree.go -f ../testdata/small-evnt-tree-nosplit.root
//go:generate go run ./gendata/gen-evnt-tree.go -f ../testdata/small-evnt-tree-fullsplit.root -split=99
//go:generate go run ./gendata/gen-flat-tree.go -f ../testdata/leaves.root
//go:generate go run ./gendata/gen-map-tree.go -f ../testdata/std-map-split0.root -split=0
//go:generate go run ./gendata/gen-map-tree.go -f ../testdata/std-map-split1.root -split=1
//go:generate go run ./gendata/gen-map-tree.go -f ../testdata/std-map-split2.root -split=2
//go:generate go run ./gendata/gen-multi-leaves-tree.go -f ../testdata/padding.root
//go:generate go run ./gendata/gen-join-trees.go -d ../testdata
//go:generate go run ./gendata/gen-bitset-tree.go -f ../testdata/std-bitset.root
// Directory describes a ROOT directory structure in memory.
type Directory interface {
// Get returns the object identified by namecycle
// namecycle has the format name;cycle
// name = * is illegal, cycle = * is illegal
// cycle = "" or cycle = 9999 ==> apply to a memory object
//
// examples:
// foo : get object named foo in memory
// if object is not in memory, try with highest cycle from file
// foo;1 : get cycle 1 of foo on file
Get(namecycle string) (root.Object, error)
// Put puts the object v under the key with the given name.
Put(name string, v root.Object) error
// Keys returns the list of keys being held by this directory.
Keys() []Key
// Mkdir creates a new subdirectory
Mkdir(name string) (Directory, error)
// Parent returns the directory holding this directory.
// Parent returns nil if this is the top-level directory.
Parent() Directory
}
// SetFiler is a simple interface to establish File ownership.
type SetFiler interface {
SetFile(f *File)
}