public DefaultCompiledRuleStore(
            ILexer lexer,
            IParser parser,
            IInterpreter interpreter,
            IRuleStore ruleStore)
        {
            if (lexer == null)
            {
                throw new ArgumentNullException(nameof(lexer));
            }

            if (parser == null)
            {
                throw new ArgumentNullException(nameof(parser));
            }

            if (interpreter == null)
            {
                throw new ArgumentNullException(nameof(interpreter));
            }

            if (ruleStore == null)
            {
                throw new ArgumentNullException(nameof(ruleStore));
            }

            _lexer       = lexer;
            _parser      = parser;
            _interpreter = interpreter;
            _ruleStore   = ruleStore;
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleManager"/> class.
 /// </summary>
 /// <param name="store">The store that the <see cref="RuleManager" /> operates against.</param>
 public RuleManager(IRuleStore store)
 {
     if (store == null)
     {
         throw new ArgumentNullException(nameof(store));
     }
     Store = store;
 }
Exemple #3
0
 /// <summary>
 /// If disposing, calls dispose on the Context. Always nulls out the Context
 /// </summary>
 /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources</param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing && Store != null)
     {
         // Store.Dispose();
     }
     _disposed = true;
     Store     = null;
 }
 public DefaultCompiledRuleStore(IRuleStore ruleStore)
     : this(new DefaultLexer(), new DefaultParser(), new DefaultInterpreter(), ruleStore)
 {
 }
Exemple #5
0
 public RuleEngine(IRuleStore pool, IRuleEvaluationStrategy strategy)
 {
     _pool     = pool;
     _strategy = strategy;
 }
Exemple #6
0
 public RuleEngine(IRuleStore pool) : this(pool, new SimpleRuleEvaluationStrategy())
 {
 }
Exemple #7
0
 public RuleBookBuilder()
 {
     _ruleStore = ComponentFactory.Instance.Create <IRuleStore>();
 }
 public RuleEngine(IRuleStore store)
 {
     _store = store;
 }
Exemple #9
0
 public TestRuleStore()
 {
     _ruleStore = new DefaultRuleStore();
 }