/// <summary> /// LoadModel reloads the model from the model CONF file. Because the policy is /// attached to a model, so the policy is invalidated and needs to be reloaded by /// calling LoadPolicy(). /// calling LoadPolicy(). /// </summary> public void LoadModel() { model = NewModel(); model.LoadModel(this.modelPath); fm = FunctionMap.LoadFunctionMap(); InitializeInterpreter(); }
public static FunctionMap LoadFunctionMap() { FunctionMap fm = new FunctionMap(); fm._fm = new Dictionary <string, AbstractFunction>(); fm.AddFunction("keyMatch", new KeyMatchFunc()); fm.AddFunction("keyMatch2", new KeyMatch2Func()); fm.AddFunction("regexMatch", new RegexMatchFunc()); fm.AddFunction("ipMatch", new IPMatchFunc()); return(fm); }
public Enforcer(Model.Model model, IAdapter adapter) { this.adapter = adapter; watcher = null; this.model = model; functionMap = FunctionMap.LoadFunctionMap(); Initialize(); LoadPolicy(); }
public Enforcer(Model.Model m, IAdapter adapter) { this.adapter = adapter; this.watcher = null; model = m; fm = FunctionMap.LoadFunctionMap(); Initialize(); if (this.adapter != null) { LoadPolicy(); } }
/// <summary> /// LoadModel reloads the model from the model CONF file. Because the policy is /// attached to a model, so the policy is invalidated and needs to be reloaded by /// calling LoadPolicy(). /// calling LoadPolicy(). /// </summary> public void LoadModel() { model = NewModel(); model.LoadModel(this.modelPath); fm = FunctionMap.LoadFunctionMap(); }
/// <summary> /// sets the current model. /// </summary> /// <param name="model"> the model.</param> public void SetModel(Model model) { this.model = model; fm = FunctionMap.LoadFunctionMap(); }
/// <summary> /// sets the current model. /// </summary> /// <param name="model"> the model.</param> public void SetModel(Model.Model model) { this.model = model; fm = FunctionMap.LoadFunctionMap(); InitializeInterpreter(); }
/// <summary> /// LoadModel reloads the model from the model CONF file. Because the policy is /// Attached to a model, so the policy is invalidated and needs to be reloaded by /// calling LoadPolicy(). /// </summary> public void LoadModel() { model = NewModel(); model.LoadModel(modelPath); functionMap = FunctionMap.LoadFunctionMap(); }