1 // Condition.h: interface for the CCondition class.
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_CONDITION_H__160ED1FB_6106_4D5D_B298_0C66ED094B4B__INCLUDED_)
6 #define AFX_CONDITION_H__160ED1FB_6106_4D5D_B298_0C66ED094B4B__INCLUDED_
10 #endif // _MSC_VER > 1000
18 class CLogicConditionNode
;
19 class CLogicCondition
;
22 typedef CList
< CConditionNode
*, CConditionNode
* > TPtrConditionList
;
26 * class CConditionNode
41 inline CConditionNode( CConditionNode
*parent
= NULL
) : m_pParentNode(parent
)
47 /// copy constructor, also copy all sub nodes (and allocate new nodes for them)
48 CConditionNode( const CConditionNode
&node
);
55 /// get the node as a string for display
56 const CString
&getNodeAsString() const;
58 inline CConditionNode
*getParentNode() { return m_pParentNode
; }
60 /// change all the occurences of the 'old' condition into 'newName' (recursive)
61 void changeConditionName( const CString
&old
, const CString
&newName
);
63 /// change all the occurences of the 'old' condition into 'newName' (recursive)
64 void conditionDeleted( const CString
&name
);
69 /// \name condition logic block
72 TConditionType m_type
;
74 /// if sub condition block
75 CString m_sConditionName
;
78 CString m_sVariableName
;
79 CString m_sOperator
; //in set '<' '>' '<=' >=' '=' '!='
83 /// the sub conditions tree
84 TPtrConditionList m_ctSubTree
;
86 /// pointer on the 'parent' node, or NULL if this node is a first level node
87 CConditionNode
* m_pParentNode
;
90 mutable CString m_sNodeString
;
104 CCondition( const CCondition
&cond
);
106 /// change all the occurences of the 'old' condition into 'newName' (for the nodes)
107 void changeConditionName( CString old
, const CString
&newName
) const;
109 // the specified condition has been deleted, delete all references to it
110 void conditionDeleted( CString name
);
112 virtual ~CCondition();
119 TPtrConditionList m_ctConditionTree
;
125 * cConditionToCLogicCondition
127 void cConditionToCLogicCondition( CCondition
& condition
, NLLOGIC::CLogicCondition
& logicCondition
);
130 * cLogicConditionToCCondition
132 void cLogicConditionToCCondition( const NLLOGIC::CLogicCondition
& logicCondition
, CCondition
& condition
);
135 #endif // !defined(AFX_CONDITION_H__160ED1FB_6106_4D5D_B298_0C66ED094B4B__INCLUDED_)