Documentation ¶
Overview ¶
Package rdict contains the definition of ROOT streamers and facilities to generate new streamers meta data from user types.
Index ¶
- Variables
- func GoName2Cxx(name string) string
- func NewGenGoType(pkg string, sictx rbytes.StreamerInfoContext, verbose bool) (*genGoType, error)
- func StreamerOf(ctx rbytes.StreamerInfoContext, typ reflect.Type) rbytes.StreamerInfo
- func Typename(name, title string) (string, bool)
- func Visit(ctx rbytes.StreamerInfoContext, si rbytes.StreamerInfo, ...) error
- type Element
- type Generator
- type Object
- type StreamerArtificial
- type StreamerBase
- type StreamerBasicPointer
- type StreamerBasicType
- type StreamerElement
- func (tse *StreamerElement) ArrayDim() int
- func (tse *StreamerElement) ArrayLen() int
- func (tse *StreamerElement) Class() string
- func (tse *StreamerElement) Factor() float64
- func (tse *StreamerElement) MarshalROOT(w *rbytes.WBuffer) (int, error)
- func (tse *StreamerElement) Name() string
- func (tse *StreamerElement) Offset() uintptr
- func (*StreamerElement) RVersion() int16
- func (tse *StreamerElement) Size() uintptr
- func (tse *StreamerElement) Title() string
- func (tse *StreamerElement) Type() rmeta.Enum
- func (tse *StreamerElement) TypeName() string
- func (tse *StreamerElement) UnmarshalROOT(r *rbytes.RBuffer) error
- func (tse *StreamerElement) XMax() float64
- func (tse *StreamerElement) XMin() float64
- type StreamerInfo
- func (tsi *StreamerInfo) CheckSum() int
- func (tsi *StreamerInfo) Class() string
- func (tsi *StreamerInfo) ClassVersion() int
- func (tsi *StreamerInfo) Elements() []rbytes.StreamerElement
- func (tsi *StreamerInfo) MarshalROOT(w *rbytes.WBuffer) (int, error)
- func (tsi *StreamerInfo) Name() string
- func (*StreamerInfo) RVersion() int16
- func (si *StreamerInfo) String() string
- func (tsi *StreamerInfo) Title() string
- func (tsi *StreamerInfo) UnmarshalROOT(r *rbytes.RBuffer) error
- type StreamerLoop
- type StreamerObject
- type StreamerObjectAny
- type StreamerObjectAnyPointer
- type StreamerObjectPointer
- type StreamerSTL
- func (tss *StreamerSTL) Class() string
- func (tss *StreamerSTL) ContainedType() rmeta.Enum
- func (tss *StreamerSTL) ElemTypeName() string
- func (tss *StreamerSTL) MarshalROOT(w *rbytes.WBuffer) (int, error)
- func (*StreamerSTL) RVersion() int16
- func (tss *StreamerSTL) STLVectorType() rmeta.ESTLType
- func (tss *StreamerSTL) UnmarshalROOT(r *rbytes.RBuffer) error
- type StreamerSTLstring
- type StreamerString
Constants ¶
This section is empty.
Variables ¶
var StreamerInfos = &streamerDb{ db: make(map[streamerDbKey]rbytes.StreamerInfo), }
StreamerInfos stores all the streamers available at runtime.
Functions ¶
func GoName2Cxx ¶ added in v0.17.0
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 ¶ added in v0.18.0
func NewGenGoType(pkg string, sictx rbytes.StreamerInfoContext, verbose bool) (*genGoType, error)
NewGenGoType generates code for Go types from a ROOT StreamerInfo.
func StreamerOf ¶
func StreamerOf(ctx rbytes.StreamerInfoContext, typ reflect.Type) rbytes.StreamerInfo
StreamerOf generates a StreamerInfo from a reflect.Type.
func Typename ¶ added in v0.17.0
Typename returns a language dependent typename, usually encoded inside a StreamerInfo's title.
func Visit ¶ added in v0.17.0
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.
Types ¶
type Element ¶ added in v0.17.0
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 ¶ added in v0.17.0
func (e Element) New() StreamerElement
type Generator ¶ added in v0.17.0
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.
type Object ¶ added in v0.17.0
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 ¶ added in v0.17.0
func ObjectFrom(si rbytes.StreamerInfo, sictx rbytes.StreamerInfoContext) *Object
func (*Object) MarshalROOT ¶ added in v0.17.0
type StreamerArtificial ¶
type StreamerArtificial struct {
StreamerElement
}
func (*StreamerArtificial) Class ¶
func (tss *StreamerArtificial) Class() string
func (*StreamerArtificial) MarshalROOT ¶
func (tsa *StreamerArtificial) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerArtificial) RVersion ¶
func (*StreamerArtificial) RVersion() int16
func (*StreamerArtificial) UnmarshalROOT ¶
func (tsa *StreamerArtificial) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerBase ¶
type StreamerBase struct { StreamerElement // contains filtered or unexported fields }
func NewStreamerBase ¶ added in v0.18.0
func NewStreamerBase(se StreamerElement, vbase int32) *StreamerBase
func (*StreamerBase) Base ¶ added in v0.17.0
func (tsb *StreamerBase) Base() int
Base returns the base class' version.
func (*StreamerBase) Class ¶
func (tsb *StreamerBase) Class() string
func (*StreamerBase) MarshalROOT ¶
func (tsb *StreamerBase) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerBase) RVersion ¶
func (*StreamerBase) RVersion() int16
func (*StreamerBase) UnmarshalROOT ¶
func (tsb *StreamerBase) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerBasicPointer ¶
type StreamerBasicPointer struct { StreamerElement // contains filtered or unexported fields }
func NewStreamerBasicPointer ¶ added in v0.18.0
func NewStreamerBasicPointer(se StreamerElement, cvers int32, cname, ccls string) *StreamerBasicPointer
func (*StreamerBasicPointer) Class ¶
func (tsb *StreamerBasicPointer) Class() string
func (*StreamerBasicPointer) CountName ¶
func (tsb *StreamerBasicPointer) CountName() string
func (*StreamerBasicPointer) MarshalROOT ¶
func (tsb *StreamerBasicPointer) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerBasicPointer) RVersion ¶
func (*StreamerBasicPointer) RVersion() int16
func (*StreamerBasicPointer) UnmarshalROOT ¶
func (tsb *StreamerBasicPointer) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerBasicType ¶
type StreamerBasicType struct {
StreamerElement
}
func (*StreamerBasicType) Class ¶
func (tsb *StreamerBasicType) Class() string
func (*StreamerBasicType) MarshalROOT ¶
func (tsb *StreamerBasicType) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerBasicType) RVersion ¶
func (*StreamerBasicType) RVersion() int16
func (*StreamerBasicType) UnmarshalROOT ¶
func (tsb *StreamerBasicType) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerElement ¶
type StreamerElement struct {
// contains filtered or unexported fields
}
func (*StreamerElement) ArrayDim ¶
func (tse *StreamerElement) ArrayDim() int
func (*StreamerElement) ArrayLen ¶
func (tse *StreamerElement) ArrayLen() int
func (*StreamerElement) Class ¶
func (tse *StreamerElement) Class() string
func (*StreamerElement) Factor ¶ added in v0.20.0
func (tse *StreamerElement) Factor() float64
func (*StreamerElement) MarshalROOT ¶
func (tse *StreamerElement) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerElement) Name ¶
func (tse *StreamerElement) Name() string
func (*StreamerElement) Offset ¶
func (tse *StreamerElement) Offset() uintptr
func (*StreamerElement) RVersion ¶
func (*StreamerElement) RVersion() int16
func (*StreamerElement) Size ¶
func (tse *StreamerElement) Size() uintptr
func (*StreamerElement) Title ¶
func (tse *StreamerElement) Title() string
func (*StreamerElement) Type ¶
func (tse *StreamerElement) Type() rmeta.Enum
func (*StreamerElement) TypeName ¶
func (tse *StreamerElement) TypeName() string
func (*StreamerElement) UnmarshalROOT ¶
func (tse *StreamerElement) UnmarshalROOT(r *rbytes.RBuffer) error
func (*StreamerElement) XMax ¶ added in v0.20.0
func (tse *StreamerElement) XMax() float64
func (*StreamerElement) XMin ¶ added in v0.20.0
func (tse *StreamerElement) XMin() float64
type StreamerInfo ¶
type StreamerInfo struct {
// contains filtered or unexported fields
}
func NewCxxStreamerInfo ¶ added in v0.18.0
func NewCxxStreamerInfo(name string, version int32, chksum uint32, elems []rbytes.StreamerElement) *StreamerInfo
NewCxxStreamerInfo creates a new StreamerInfo from C++ provided informations.
func NewStreamerInfo ¶
func NewStreamerInfo(name string, version int, elems []rbytes.StreamerElement) *StreamerInfo
NewStreamerInfo creates a new StreamerInfo from Go provided informations.
func (*StreamerInfo) CheckSum ¶
func (tsi *StreamerInfo) CheckSum() int
func (*StreamerInfo) Class ¶
func (tsi *StreamerInfo) Class() string
func (*StreamerInfo) ClassVersion ¶
func (tsi *StreamerInfo) ClassVersion() int
func (*StreamerInfo) Elements ¶
func (tsi *StreamerInfo) Elements() []rbytes.StreamerElement
func (*StreamerInfo) MarshalROOT ¶
func (tsi *StreamerInfo) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerInfo) Name ¶
func (tsi *StreamerInfo) Name() string
func (*StreamerInfo) RVersion ¶
func (*StreamerInfo) RVersion() int16
func (*StreamerInfo) String ¶
func (si *StreamerInfo) String() string
func (*StreamerInfo) Title ¶
func (tsi *StreamerInfo) Title() string
func (*StreamerInfo) UnmarshalROOT ¶
func (tsi *StreamerInfo) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerLoop ¶
type StreamerLoop struct { StreamerElement // contains filtered or unexported fields }
func NewStreamerLoop ¶ added in v0.18.0
func NewStreamerLoop(se StreamerElement, cvers int32, cname, cclass string) *StreamerLoop
func (*StreamerLoop) Class ¶
func (*StreamerLoop) Class() string
func (*StreamerLoop) CountName ¶
func (tsl *StreamerLoop) CountName() string
func (*StreamerLoop) MarshalROOT ¶
func (tsl *StreamerLoop) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerLoop) RVersion ¶
func (*StreamerLoop) RVersion() int16
func (*StreamerLoop) UnmarshalROOT ¶
func (tsl *StreamerLoop) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerObject ¶
type StreamerObject struct {
StreamerElement
}
func (*StreamerObject) Class ¶
func (tso *StreamerObject) Class() string
func (*StreamerObject) MarshalROOT ¶
func (tso *StreamerObject) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerObject) RVersion ¶
func (*StreamerObject) RVersion() int16
func (*StreamerObject) UnmarshalROOT ¶
func (tso *StreamerObject) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerObjectAny ¶
type StreamerObjectAny struct {
StreamerElement
}
func (*StreamerObjectAny) Class ¶
func (tso *StreamerObjectAny) Class() string
func (*StreamerObjectAny) MarshalROOT ¶
func (tso *StreamerObjectAny) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerObjectAny) RVersion ¶
func (*StreamerObjectAny) RVersion() int16
func (*StreamerObjectAny) UnmarshalROOT ¶
func (tso *StreamerObjectAny) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerObjectAnyPointer ¶
type StreamerObjectAnyPointer struct {
StreamerElement
}
func (*StreamerObjectAnyPointer) Class ¶
func (tso *StreamerObjectAnyPointer) Class() string
func (*StreamerObjectAnyPointer) MarshalROOT ¶
func (tso *StreamerObjectAnyPointer) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerObjectAnyPointer) RVersion ¶
func (*StreamerObjectAnyPointer) RVersion() int16
func (*StreamerObjectAnyPointer) UnmarshalROOT ¶
func (tso *StreamerObjectAnyPointer) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerObjectPointer ¶
type StreamerObjectPointer struct {
StreamerElement
}
func (*StreamerObjectPointer) Class ¶
func (tso *StreamerObjectPointer) Class() string
func (*StreamerObjectPointer) MarshalROOT ¶
func (tso *StreamerObjectPointer) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerObjectPointer) RVersion ¶
func (*StreamerObjectPointer) RVersion() int16
func (*StreamerObjectPointer) UnmarshalROOT ¶
func (tso *StreamerObjectPointer) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerSTL ¶
type StreamerSTL struct { StreamerElement // contains filtered or unexported fields }
func NewCxxStreamerSTL ¶ added in v0.18.0
func NewCxxStreamerSTL(se StreamerElement, vtype rmeta.ESTLType, ctype rmeta.Enum) *StreamerSTL
NewCxxStreamerSTL creates a new StreamerSTL from C++ informations.
func NewStreamerSTL ¶
func (*StreamerSTL) Class ¶
func (tss *StreamerSTL) Class() string
func (*StreamerSTL) ContainedType ¶
func (tss *StreamerSTL) ContainedType() rmeta.Enum
func (*StreamerSTL) ElemTypeName ¶
func (tss *StreamerSTL) ElemTypeName() string
func (*StreamerSTL) MarshalROOT ¶
func (tss *StreamerSTL) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerSTL) RVersion ¶
func (*StreamerSTL) RVersion() int16
func (*StreamerSTL) STLVectorType ¶
func (tss *StreamerSTL) STLVectorType() rmeta.ESTLType
func (*StreamerSTL) UnmarshalROOT ¶
func (tss *StreamerSTL) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerSTLstring ¶
type StreamerSTLstring struct {
StreamerSTL
}
func (*StreamerSTLstring) Class ¶
func (tss *StreamerSTLstring) Class() string
func (*StreamerSTLstring) MarshalROOT ¶
func (tss *StreamerSTLstring) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerSTLstring) RVersion ¶
func (*StreamerSTLstring) RVersion() int16
func (*StreamerSTLstring) UnmarshalROOT ¶
func (tss *StreamerSTLstring) UnmarshalROOT(r *rbytes.RBuffer) error
type StreamerString ¶
type StreamerString struct {
StreamerElement
}
func (*StreamerString) Class ¶
func (tss *StreamerString) Class() string
func (*StreamerString) MarshalROOT ¶
func (tss *StreamerString) MarshalROOT(w *rbytes.WBuffer) (int, error)
func (*StreamerString) RVersion ¶
func (*StreamerString) RVersion() int16
func (*StreamerString) UnmarshalROOT ¶
func (tss *StreamerString) UnmarshalROOT(r *rbytes.RBuffer) error