IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseRule.h
1 // BaseRule.h:
3 // -----------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_BASERULE_H__
16 #define __IPSDKBASEPROCESSING_BASERULE_H__
17 
18 // suppression warnings
19 // warning C4251: 'boost::enable_shared_from_this<T>::weak_this_' : class 'boost::weak_ptr<T>' needs to have dll-interface to be used by clients of class 'boost::enable_shared_from_this<T>'
20 // warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'ipsdk::processor::BaseRule'
21 #pragma warning (push)
22 #pragma warning (disable : 4251 4275)
23 
26 #include <IPSDKUtil/BaseTypes.h>
27 #include <IPSDKUtil/Tools/ProcessingResult.h>
28 #include <boost/noncopyable.hpp>
29 
30 namespace ipsdk {
31 namespace processor {
32 
33 class RuleOr;
34 class RuleAnd;
35 class RuleNot;
36 class RuleIf;
37 
40 
41 class IPSDKBASEPROCESSING_API BaseRule : public boost::noncopyable
42 {
43  // friend class for protected member access
44  friend class RuleAnd;
45  friend class RuleOr;
46  friend class RuleNot;
47  friend class RuleIf;
48 
49 public:
52  BaseRule();
53  virtual ~BaseRule() = 0;
55 
56 // methods
57 public:
59  virtual eRuleType getRuleType() const = 0;
60 
62  bool isInit() const;
63 
66  BoolResult isSatisfied() const;
67 
70  std::string getRuleFormalString() const;
71 
76  std::string getRuleEvaluatedString() const;
77 
78 protected:
80  void initBase();
81 
83  std::string createRuleEvaluatedStartString(const ipUInt32 increment) const;
84 
86  virtual bool testRule() const = 0;
87 
89  virtual std::string createRuleFormalString() const = 0;
90 
92  virtual std::string createRuleEvaluatedString(const ipUInt32 increment) const = 0;
93 
94 // attributes
95 private:
97  bool _bInit;
98 };
99 
102 
103 inline bool
105 {
106  return _bInit;
107 }
108 
111 
112 } // end of namespace processor
113 } // end of namespace ipsdk
114 
115 #pragma warning (pop)
116 
117 #endif // __IPSDKBASEPROCESSING_BASERULE_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
#define IPSDKBASEPROCESSING_API
Import/Export macro for library IPSDKBaseProcessing.
Definition: IPSDKBaseProcessingExports.h:27
Class for logical or operations on rules.
Definition: RuleOr.h:26
Class for logical and operations on rules.
Definition: RuleAnd.h:26
Base types for multiplatform compatibility.
Class for logical not operations on rules.
Definition: RuleNot.h:26
Rule allowing to check a conditional condition.
Definition: RuleIf.h:31
Predefined types for rules management.
Definition of import/export macro for library.
eRuleType
enumerate describing rule type
Definition: RuleTypes.h:40
bool isInit() const
retrieve object initialization flag
Definition: BaseRule.h:104
Base class for processing attributes rules.
Definition: BaseRule.h:41
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53