00001
00015 #ifndef P6RULEENGINE_H__
00016 #define P6RULEENGINE_H__ 1
00017
00018 #include "p6err.h"
00019 #include "p6comdef.h"
00020 #include "p6datastream.h"
00021 #include "p6xpathvariables.h"
00022
00023 namespace P6R {
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00048 typedef P6UINT32 P6RULEFLAGS;
00049 const P6RULEFLAGS P6RULE_NOFLAGS = 0x00000000;
00050 const P6RULEFLAGS P6RULE_TRACEBASIC = 0x00000001;
00051 const P6RULEFLAGS P6RULE_TRACEVERBOSE = 0x00000002;
00052 const P6RULEFLAGS P6RULE_RESETAGENDAS = 0x00000004;
00053 const P6RULEFLAGS P6RULE_IGNORETRACE = 0x00000008;
00054 const P6RULEFLAGS P6RULE_USEJSON = 0x00000010;
00055 const P6RULEFLAGS P6RULE_KEEPSTATS = 0x00000020;
00056
00057
00075 typedef P6UINT32 P6RULERESETS;
00076 const P6RULERESETS P6RULE_CLEAR_AGENDAS = 0x00000001;
00077 const P6RULERESETS P6RULE_CLEAR_INFER = 0x00000002;
00078 const P6RULERESETS P6RULE_CLEAR_FACTS = 0x00000004;
00079 const P6RULERESETS P6RULE_CLEAR_STATS = 0x00000008;
00080
00081
00082
00090 interface p6IRuleEngine : public p6ICom
00091 {
00108 P6COMMETHOD initialize( P6RULEFLAGS flags, p6IDataStream* pErrorResult ) = 0;
00109
00123 P6COMMETHOD setDefaultCollation( const P6CHAR* pCollate ) = 0;
00124
00143 P6COMMETHOD setExternalFunctions( p6IXpathVariables* pConnector ) = 0;
00144
00162 P6COMMETHOD modifyRules( const P6CHAR* pRuleDef ) = 0;
00163
00192 P6COMMETHOD startFacts( const P6CHAR* pBuffer,
00193 P6UINT32 bufSize,
00194 P6BOOL isLast ) = 0;
00195
00211 P6COMMETHOD continueFacts( const P6CHAR* pBuffer,
00212 P6UINT32 bufSize,
00213 P6BOOL isLast ) = 0;
00214
00235 P6COMMETHOD startFactsWithDOM( p6IDOMXML* pStatedFacts ) = 0;
00236
00251 P6COMMETHOD evaluate( P6CHAR* pRuleSetName ) = 0;
00252
00264 P6COMMETHOD reset( P6RULERESETS flag ) = 0;
00265
00281 P6COMMETHOD setEvalLimits( P6UINT32 maxExecuteRules ) = 0;
00282
00303 P6COMMETHOD setRegexLimits( P6UINT32 maxBackStack, P6UINT32 maxBackTracks ) = 0;
00304
00317 P6COMMETHOD outputInferredFacts( p6IDataStream* pResult ) = 0;
00318
00332 P6COMMETHOD outputStatistics( p6IDataStream* pResult ) = 0;
00333 };
00334
00335
00336 #define IF_p6IRuleEngine {0x962cc36b,0x160d,0x43df,{0x93,0xa9,0xba,0x39,0x6c,0x4f,0x12,0xb1}}
00337
00338
00339 #define COMP_p6RuleEngine {0xb51203,0x4cb9,0x4494,{0xb4,0x82,0x3,0x65,0x50,0xed,0xca,0xf}}
00340
00341 #ifdef __cplusplus
00342 }
00343 #endif
00344
00345 }
00346
00347
00348 #endif
00349
00350
00351
00352
00353
00354
00355