hep: go-hep.org/x/hep/groot/rdict Index | Files

package rdict

import "go-hep.org/x/hep/groot/rdict"

Package rdict contains the definition of ROOT streamers and facilities to generate new streamers meta data from user types.

Index

Package Files

cxx_root_streamers_gen.go db.go gen.go gen_streamer.go gen_type.go object.go rdict.go streamer.go visit.go

Variables

var StreamerInfos = &streamerDb{
    db: make(map[streamerDbKey]rbytes.StreamerInfo),
}

StreamerInfos stores all the streamers available at runtime.

func GenCxxStreamerInfo Uses

func GenCxxStreamerInfo(w io.Writer, si rbytes.StreamerInfo, verbose bool) error

GenCxxStreamerInfo generates the textual representation of the provided streamer info.

func GoName2Cxx Uses

func GoName2Cxx(name string) string

GoName2Cxx translates a fully-qualified Go type name to a C++ one. e.g.:

- go-hep.org/x/hep/hbook.H1D -> go_hep_org::x::hep::hbook::H1D

func NewGenGoType Uses

func NewGenGoType(pkg string, sictx rbytes.StreamerInfoContext, verbose bool) (*genGoType, error)

NewGenGoType generates code for Go types from a ROOT StreamerInfo.

func StreamerOf Uses

func StreamerOf(ctx rbytes.StreamerInfoContext, typ reflect.Type) rbytes.StreamerInfo

StreamerOf generates a StreamerInfo from a reflect.Type.

func Typename Uses

func Typename(name, title string) (string, bool)

Typename returns a language dependent typename, usually encoded inside a StreamerInfo's title.

func Visit Uses

func Visit(ctx rbytes.StreamerInfoContext, si rbytes.StreamerInfo, f func(depth int, se rbytes.StreamerElement) error) error

Visit inspects a streamer info and visits all its elements, once.

type Element Uses

type Element struct {
    Name   rbase.Named
    Type   rmeta.Enum // element type
    Size   int32      // size of element
    ArrLen int32      // cumulative size of all array dims
    ArrDim int32      // number of array dimensions
    MaxIdx [5]int32   // maximum array index for array dimension "dim"
    Offset int32      // element offset in class
    EName  string     // data type name of data member
    XMin   float64    // minimum of data member if a range is specified [xmin.xmax.nbits]
    XMax   float64    // maximum of data member if a range is specified [xmin.xmax.nbits]
    Factor float64    // conversion factor if a range is specified. factor = (1<<nbits/(xmax-xmin))
}

func (Element) New Uses

func (e Element) New() StreamerElement

type Generator Uses

type Generator interface {
    // Generate generates code for a given type.
    Generate(typ string) error

    // Format formats the Go generated code.
    Format() ([]byte, error)
}

Generator is the interface used to generate ROOT related code.

func NewGenStreamer Uses

func NewGenStreamer(p string, verbose bool) (Generator, error)

NewGenStreamer returns a new code generator for package p, where p is the package's import path.

type Object Uses

type Object struct {
    // contains filtered or unexported fields
}

Object wraps a type created from a Streamer and implements the following interfaces:

- root.Object
- rbytes.RVersioner
- rbytes.Marshaler
- rbytes.Unmarshaler

func ObjectFrom Uses

func ObjectFrom(si rbytes.StreamerInfo, sictx rbytes.StreamerInfoContext) *Object

func (*Object) Class Uses

func (obj *Object) Class() string

func (*Object) MarshalROOT Uses

func (obj *Object) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*Object) RVersion Uses

func (obj *Object) RVersion() int16

func (*Object) SetClass Uses

func (obj *Object) SetClass(name string)

func (*Object) String Uses

func (obj *Object) String() string

func (*Object) UnmarshalROOT Uses

func (obj *Object) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerArtificial Uses

type StreamerArtificial struct {
    StreamerElement
}

func (*StreamerArtificial) Class Uses

func (tss *StreamerArtificial) Class() string

func (*StreamerArtificial) MarshalROOT Uses

func (tsa *StreamerArtificial) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerArtificial) RVersion Uses

func (*StreamerArtificial) RVersion() int16

func (*StreamerArtificial) UnmarshalROOT Uses

func (tsa *StreamerArtificial) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerBase Uses

type StreamerBase struct {
    StreamerElement
    // contains filtered or unexported fields
}

func NewStreamerBase Uses

func NewStreamerBase(se StreamerElement, vbase int32) *StreamerBase

func (*StreamerBase) Base Uses

func (tsb *StreamerBase) Base() int

Base returns the base class' version.

func (*StreamerBase) Class Uses

func (tsb *StreamerBase) Class() string

func (*StreamerBase) MarshalROOT Uses

func (tsb *StreamerBase) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerBase) RVersion Uses

func (*StreamerBase) RVersion() int16

func (*StreamerBase) UnmarshalROOT Uses

func (tsb *StreamerBase) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerBasicPointer Uses

type StreamerBasicPointer struct {
    StreamerElement
    // contains filtered or unexported fields
}

func NewStreamerBasicPointer Uses

func NewStreamerBasicPointer(se StreamerElement, cvers int32, cname, ccls string) *StreamerBasicPointer

func (*StreamerBasicPointer) Class Uses

func (tsb *StreamerBasicPointer) Class() string

func (*StreamerBasicPointer) CountName Uses

func (tsb *StreamerBasicPointer) CountName() string

func (*StreamerBasicPointer) MarshalROOT Uses

func (tsb *StreamerBasicPointer) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerBasicPointer) RVersion Uses

func (*StreamerBasicPointer) RVersion() int16

func (*StreamerBasicPointer) UnmarshalROOT Uses

func (tsb *StreamerBasicPointer) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerBasicType Uses

type StreamerBasicType struct {
    StreamerElement
}

func (*StreamerBasicType) Class Uses

func (tsb *StreamerBasicType) Class() string

func (*StreamerBasicType) MarshalROOT Uses

func (tsb *StreamerBasicType) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerBasicType) RVersion Uses

func (*StreamerBasicType) RVersion() int16

func (*StreamerBasicType) UnmarshalROOT Uses

func (tsb *StreamerBasicType) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerElement Uses

type StreamerElement struct {
    // contains filtered or unexported fields
}

func (*StreamerElement) ArrayDim Uses

func (tse *StreamerElement) ArrayDim() int

func (*StreamerElement) ArrayLen Uses

func (tse *StreamerElement) ArrayLen() int

func (*StreamerElement) Class Uses

func (tse *StreamerElement) Class() string

func (*StreamerElement) Factor Uses

func (tse *StreamerElement) Factor() float64

func (*StreamerElement) MarshalROOT Uses

func (tse *StreamerElement) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerElement) Name Uses

func (tse *StreamerElement) Name() string

func (*StreamerElement) Offset Uses

func (tse *StreamerElement) Offset() uintptr

func (*StreamerElement) RVersion Uses

func (*StreamerElement) RVersion() int16

func (*StreamerElement) Size Uses

func (tse *StreamerElement) Size() uintptr

func (*StreamerElement) Title Uses

func (tse *StreamerElement) Title() string

func (*StreamerElement) Type Uses

func (tse *StreamerElement) Type() rmeta.Enum

func (*StreamerElement) TypeName Uses

func (tse *StreamerElement) TypeName() string

func (*StreamerElement) UnmarshalROOT Uses

func (tse *StreamerElement) UnmarshalROOT(r *rbytes.RBuffer) error

func (*StreamerElement) XMax Uses

func (tse *StreamerElement) XMax() float64

func (*StreamerElement) XMin Uses

func (tse *StreamerElement) XMin() float64

type StreamerInfo Uses

type StreamerInfo struct {
    // contains filtered or unexported fields
}

func NewCxxStreamerInfo Uses

func NewCxxStreamerInfo(name string, version int32, chksum uint32, elems []rbytes.StreamerElement) *StreamerInfo

NewCxxStreamerInfo creates a new StreamerInfo from C++ provided informations.

func NewStreamerInfo Uses

func NewStreamerInfo(name string, version int, elems []rbytes.StreamerElement) *StreamerInfo

NewStreamerInfo creates a new StreamerInfo from Go provided informations.

func (*StreamerInfo) CheckSum Uses

func (tsi *StreamerInfo) CheckSum() int

func (*StreamerInfo) Class Uses

func (tsi *StreamerInfo) Class() string

func (*StreamerInfo) ClassVersion Uses

func (tsi *StreamerInfo) ClassVersion() int

func (*StreamerInfo) Elements Uses

func (tsi *StreamerInfo) Elements() []rbytes.StreamerElement

func (*StreamerInfo) MarshalROOT Uses

func (tsi *StreamerInfo) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerInfo) Name Uses

func (tsi *StreamerInfo) Name() string

func (*StreamerInfo) RVersion Uses

func (*StreamerInfo) RVersion() int16

func (*StreamerInfo) String Uses

func (si *StreamerInfo) String() string

func (*StreamerInfo) Title Uses

func (tsi *StreamerInfo) Title() string

func (*StreamerInfo) UnmarshalROOT Uses

func (tsi *StreamerInfo) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerLoop Uses

type StreamerLoop struct {
    StreamerElement
    // contains filtered or unexported fields
}

func NewStreamerLoop Uses

func NewStreamerLoop(se StreamerElement, cvers int32, cname, cclass string) *StreamerLoop

func (*StreamerLoop) Class Uses

func (*StreamerLoop) Class() string

func (*StreamerLoop) CountName Uses

func (tsl *StreamerLoop) CountName() string

func (*StreamerLoop) MarshalROOT Uses

func (tsl *StreamerLoop) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerLoop) RVersion Uses

func (*StreamerLoop) RVersion() int16

func (*StreamerLoop) UnmarshalROOT Uses

func (tsl *StreamerLoop) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerObject Uses

type StreamerObject struct {
    StreamerElement
}

func (*StreamerObject) Class Uses

func (tso *StreamerObject) Class() string

func (*StreamerObject) MarshalROOT Uses

func (tso *StreamerObject) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerObject) RVersion Uses

func (*StreamerObject) RVersion() int16

func (*StreamerObject) UnmarshalROOT Uses

func (tso *StreamerObject) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerObjectAny Uses

type StreamerObjectAny struct {
    StreamerElement
}

func (*StreamerObjectAny) Class Uses

func (tso *StreamerObjectAny) Class() string

func (*StreamerObjectAny) MarshalROOT Uses

func (tso *StreamerObjectAny) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerObjectAny) RVersion Uses

func (*StreamerObjectAny) RVersion() int16

func (*StreamerObjectAny) UnmarshalROOT Uses

func (tso *StreamerObjectAny) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerObjectAnyPointer Uses

type StreamerObjectAnyPointer struct {
    StreamerElement
}

func (*StreamerObjectAnyPointer) Class Uses

func (tso *StreamerObjectAnyPointer) Class() string

func (*StreamerObjectAnyPointer) MarshalROOT Uses

func (tso *StreamerObjectAnyPointer) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerObjectAnyPointer) RVersion Uses

func (*StreamerObjectAnyPointer) RVersion() int16

func (*StreamerObjectAnyPointer) UnmarshalROOT Uses

func (tso *StreamerObjectAnyPointer) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerObjectPointer Uses

type StreamerObjectPointer struct {
    StreamerElement
}

func (*StreamerObjectPointer) Class Uses

func (tso *StreamerObjectPointer) Class() string

func (*StreamerObjectPointer) MarshalROOT Uses

func (tso *StreamerObjectPointer) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerObjectPointer) RVersion Uses

func (*StreamerObjectPointer) RVersion() int16

func (*StreamerObjectPointer) UnmarshalROOT Uses

func (tso *StreamerObjectPointer) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerSTL Uses

type StreamerSTL struct {
    StreamerElement
    // contains filtered or unexported fields
}

func NewCxxStreamerSTL Uses

func NewCxxStreamerSTL(se StreamerElement, vtype rmeta.ESTLType, ctype rmeta.Enum) *StreamerSTL

NewCxxStreamerSTL creates a new StreamerSTL from C++ informations.

func NewStreamerSTL Uses

func NewStreamerSTL(name string, vtype rmeta.ESTLType, ctype rmeta.Enum) *StreamerSTL

func (*StreamerSTL) Class Uses

func (tss *StreamerSTL) Class() string

func (*StreamerSTL) ContainedType Uses

func (tss *StreamerSTL) ContainedType() rmeta.Enum

func (*StreamerSTL) ElemTypeName Uses

func (tss *StreamerSTL) ElemTypeName() []string

func (*StreamerSTL) MarshalROOT Uses

func (tss *StreamerSTL) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerSTL) RVersion Uses

func (*StreamerSTL) RVersion() int16

func (*StreamerSTL) STLType Uses

func (tss *StreamerSTL) STLType() rmeta.ESTLType

func (*StreamerSTL) UnmarshalROOT Uses

func (tss *StreamerSTL) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerSTLstring Uses

type StreamerSTLstring struct {
    StreamerSTL
}

func (*StreamerSTLstring) Class Uses

func (tss *StreamerSTLstring) Class() string

func (*StreamerSTLstring) MarshalROOT Uses

func (tss *StreamerSTLstring) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerSTLstring) RVersion Uses

func (*StreamerSTLstring) RVersion() int16

func (*StreamerSTLstring) UnmarshalROOT Uses

func (tss *StreamerSTLstring) UnmarshalROOT(r *rbytes.RBuffer) error

type StreamerString Uses

type StreamerString struct {
    StreamerElement
}

func (*StreamerString) Class Uses

func (tss *StreamerString) Class() string

func (*StreamerString) MarshalROOT Uses

func (tss *StreamerString) MarshalROOT(w *rbytes.WBuffer) (int, error)

func (*StreamerString) RVersion Uses

func (*StreamerString) RVersion() int16

func (*StreamerString) UnmarshalROOT Uses

func (tss *StreamerString) UnmarshalROOT(r *rbytes.RBuffer) error

Package rdict imports 23 packages (graph) and is imported by 6 packages. Updated 2020-02-21. Refresh now. Tools for package owners.