Documentation
¶
Overview ¶
Package exec defines execution state
Index ¶
- Constants
- func RegisterSignature(p reflect.Type)
- type Caller
- type Executor
- type Func
- type New
- type Operand
- type Pathway
- type Selector
- func (s *Selector) Addr(pointer unsafe.Pointer) unsafe.Pointer
- func (s *Selector) IndexPointer(ptr unsafe.Pointer, index int) unsafe.Pointer
- func (s *Selector) Interface(ptr unsafe.Pointer) interface{}
- func (s *Selector) Offset() uintptr
- func (s *Selector) SetInterface(ptr unsafe.Pointer, value interface{})
- func (s *Selector) SetInterfaces(ptr unsafe.Pointer, value []interface{})
- func (s *Selector) SetValue(ptr unsafe.Pointer, value interface{})
- func (s *Selector) Upstream(ptr unsafe.Pointer) unsafe.Pointer
- func (s *Selector) UpstreamOffset() uintptr
- func (s *Selector) XPos() []uint16
- type Selectors
- type State
- func (s *State) Bool(name string) (bool, error)
- func (s *State) Float64(name string) (float64, error)
- func (s *State) Index(name string) (int, error)
- func (s *State) Int(name string) (int, error)
- func (s *State) Interface() interface{}
- func (s *State) Pointer() unsafe.Pointer
- func (s *State) Release()
- func (s *State) Selector(name string) (*Selector, error)
- func (s *State) SetBool(name string, value bool) error
- func (s *State) SetBoolAt(idx int, value bool)
- func (s *State) SetFloat64(name string, value float64) error
- func (s *State) SetInt(name string, value int) error
- func (s *State) SetString(name string, value string) error
- func (s *State) SetStringAt(index int, value string) error
- func (s *State) SetValue(name string, value interface{}) error
- func (s *State) SetValueAt(idx int, value interface{})
- func (s *State) String(name string) (string, error)
- func (s *State) Tracker() *Tracker
- func (s *State) Value(name string) (interface{}, error)
- func (s *State) ValueAt(idx int) interface{}
- type Tracker
- type Uint64s
Constants ¶
const ( //PathwayUndefined represents non Selector component PathwayUndefined = Pathway(0) //PathwayDirect a path Selector has no pointer, nor slices nor map, precomputed Offset can be used for the fastest access PathwayDirect = Pathway(1) //PathwayRef a path Selector has at least on pointer or slice PathwayRef = Pathway(2) )
Variables ¶
This section is empty.
Functions ¶
func RegisterSignature ¶
RegisterSignature register caller or func signature type adapter
Types ¶
type Executor ¶
type Executor struct { In []string //params variable identity Out []string //result variable identity Init []interface{} // contains filtered or unexported fields }
Executor abstraction holding execution plan (execution syntax tree) to execute it
func NewExecution ¶
func NewExecution(compute internal.Compute, pool *sync.Pool, in []*Selector, out []*Selector) *Executor
NewExecution creates a new execution
type Func ¶
type Func interface {
New(exec *Executor) interface{}
}
Func converts executor state to actual function
type Operand ¶
type Operand struct { *xunsafe.Type //result pointer type Offset uintptr // contains filtered or unexported fields }
Operand represents typed compute
func NewOperand ¶
func NewOperand(xType *xunsafe.Type, offset uintptr, compute func(ptr unsafe.Pointer) unsafe.Pointer, selector *Selector, ptr unsafe.Pointer) *Operand
NewOperand creates an operand
func (*Operand) SetValuePtr ¶
SetValuePtr set value ptr
type Pathway ¶
type Pathway uint8
Pathway defines Selector leaf more complex pathway
func SelectorPathway ¶
SelectorPathway sets Selector pathway to pre computer fixed Offset as long it's not pointer,slice or map
type Selector ¶
type Selector struct { ID string *xunsafe.Field Pathway Slice *xunsafe.Slice Index *Operand IsErrorType bool //and Ancestors lookup need to take place to resolve data address Ancestors []*Selector Pos uint16 // contains filtered or unexported fields }
Selector represent data selector
func (*Selector) IndexPointer ¶
IndexPointer returns slice item pointer
func (*Selector) SetInterface ¶
SetInterface sets interface, it takes a state pointer
func (*Selector) SetInterfaces ¶ added in v0.2.0
func (*Selector) UpstreamOffset ¶
UpstreamOffset returns Selector Offset
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents execution plan variables
func (*State) SetBool ¶
SetBool set boolean value for supplied variable name or error if variable name is invalid
func (*State) SetFloat64 ¶
SetFloat64 set float64 value for supplied variable name or error if variable name is invalid
func (*State) SetString ¶
SetString set value for supplied variable name or error if variable name is invalid
func (*State) SetStringAt ¶
SetStringAt set value for supplied variable index
func (*State) SetValueAt ¶
SetValueAt set values at position
func (*State) String ¶
String set string value for supplied variable name or error if variable name is invalid
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker abstraction to track mutation