utils.go 900 B

1234567891011121314151617181920212223242526272829
  1. package rt2
  2. import (
  3. "fmt"
  4. "fw/cp"
  5. "fw/cp/node"
  6. "fw/rt2/context"
  7. "fw/rt2/frame"
  8. "fw/rt2/nodeframe"
  9. "fw/rt2/scope"
  10. "reflect"
  11. )
  12. var utils nodeframe.NodeFrameUtils
  13. func DataOf(f frame.Frame) map[interface{}]interface{} { panic(100) }
  14. func RegOf(f frame.Frame) map[interface{}]interface{} { return utils.DataOf(f) }
  15. func ValueOf(f frame.Frame) map[cp.ID]scope.Value {
  16. fmt.Println("getval ", reflect.TypeOf(NodeOf(f)))
  17. return utils.ValueOf(f)
  18. }
  19. func NodeOf(f frame.Frame) node.Node { return utils.NodeOf(f) }
  20. func Push(f, p frame.Frame) { utils.Push(f, p) }
  21. func New(n node.Node) frame.Frame { return utils.New(n) }
  22. func ScopeOf(f frame.Frame) scope.Manager {
  23. return f.Domain().Discover(context.SCOPE).(scope.Manager)
  24. }
  25. func ReplaceDomain(f frame.Frame, d context.Domain) { utils.ReplaceDomain(f, d) }
  26. func Assert(f frame.Frame, ok frame.Assert) { utils.Assert(f, ok) }