Exemplo n.º 1
0
func init() {
	fwk.Register(reflect.TypeOf(task2{}),
		func(typ, name string, mgr fwk.App) (fwk.Component, error) {
			var err error
			tsk := &task2{
				TaskBase: fwk.NewTask(typ, name, mgr),
				input:    "ints1",
				output:   "massaged_ints1",
			}
			tsk.fct = func(f int64) int64 {
				return f * f
			}

			err = tsk.DeclProp("Input", &tsk.input)
			if err != nil {
				return nil, err
			}

			err = tsk.DeclProp("Output", &tsk.output)
			if err != nil {
				return nil, err
			}

			err = tsk.DeclProp("Fct", &tsk.fct)
			if err != nil {
				return nil, err
			}

			return tsk, err
		},
	)
}
Exemplo n.º 2
0
func init() {
	fwk.Register(reflect.TypeOf(task3{}),
		func(typ, name string, mgr fwk.App) (fwk.Component, error) {
			var err error
			tsk := &task3{
				TaskBase: fwk.NewTask(typ, name, mgr),
				parts:    "/fads/test/StableParticles",
			}
			err = tsk.DeclProp("Output", &tsk.parts)
			if err != nil {
				return nil, err
			}

			return tsk, err
		},
	)
}
Exemplo n.º 3
0
func init() {
	fwk.Register(reflect.TypeOf(task1{}),
		func(typ, name string, mgr fwk.App) (fwk.Component, error) {
			var err error
			tsk := &task1{
				TaskBase: fwk.NewTask(typ, name, mgr),
				i1prop:   "ints1",
				i2prop:   "ints2",
				i1:       -1,
				i2:       +2,
			}

			err = tsk.DeclProp("Ints1", &tsk.i1prop)
			if err != nil {
				return nil, err
			}

			err = tsk.DeclProp("Ints2", &tsk.i2prop)
			if err != nil {
				return nil, err
			}

			err = tsk.DeclProp("Int1", &tsk.i1)
			if err != nil {
				return nil, err
			}

			err = tsk.DeclProp("Int2", &tsk.i2)
			if err != nil {
				return nil, err
			}

			err = tsk.SetProp("Int1", int64(1))
			if err != nil {
				return nil, err
			}

			return tsk, err
		},
	)
}
Exemplo n.º 4
0
Arquivo: htask.go Projeto: postfix/fwk
func init() {
	fwk.Register(reflect.TypeOf(testhsvc{}), newtesthsvc)
}
Exemplo n.º 5
0
func init() {
	fwk.Register(reflect.TypeOf(CPUCruncher{}), newCPUCruncher)
}
Exemplo n.º 6
0
func init() {
	fwk.Register(reflect.TypeOf(svc1{}), newsvc1)
}
Exemplo n.º 7
0
func init() {
	fwk.Register(reflect.TypeOf(reducer{}), newreducer)
}