示例#1
0
 static FormulaUtil()
 {
     fm = new FuncMap();
     fm.SetFunction("sin", new SinFunction());
     fm.SetFunction("cos", new CosFunction());
     fm.SetFunction("acos", new AcosFunction());
     fm.SetFunction("asin", new AsinFunction());
     fm.SetFunction("atan", new AtanFunction());
     fm.SetFunction("tan", new TanFunction());
     fm.SetFunction("cos", new CosFunction());
     fm.SetFunction("max", new MaxFunction());
     fm.SetFunction("min", new MinFunction());
     fm.SetFunction("abs", new AbsFunction());
     fm.SetFunction("log", new LogFunction());
     fm.SetFunction("pow", new PowFunction());
     fm.SetFunction("mod", new ModFunction());
 }
示例#2
0
 public common(map <@string, ptr <Template> > tmpl = default, option option = default, sync.RWMutex muFuncs = default, FuncMap parseFuncs = default, map <@string, reflect.Value> execFuncs = default)
 {
     this.tmpl       = tmpl;
     this.option     = option;
     this.muFuncs    = muFuncs;
     this.parseFuncs = parseFuncs;
     this.execFuncs  = execFuncs;
 }
示例#3
0
文件: funcs.cs 项目: zjmit/go2cs
 // addValueFuncs adds to values the functions in funcs, converting them to reflect.Values.
 private static void addValueFuncs(map<@string, reflect.Value> @out, FuncMap @in) => func((_, panic, __) =>
示例#4
0
文件: funcs.cs 项目: zjmit/go2cs
 // createValueFuncs turns a FuncMap into a map[string]reflect.Value
 private static map<@string, reflect.Value> createValueFuncs(FuncMap funcMap)
 {
     var m = make_map<@string, reflect.Value>();
     addValueFuncs(m, funcMap);
     return m;
 }