#include <logic_condition.h>
Nevrax France
Definition at line 272 of file logic_condition.h.
Public Member Functions | |
void | addNode (CLogicConditionNode node) |
CLogicCondition () | |
void | fillVarSet (std::set< std::string > &condVars) |
std::string | getName () const |
void | read (xmlNodePtr node) |
void | setLogicStateMachine (CLogicStateMachine *logicStateMachine) |
void | setName (std::string name) |
bool | testLogic () |
void | write (xmlNodePtr node) const |
Data Fields | |
std::vector< CLogicConditionNode > | Nodes |
condition tree | |
Private Attributes | |
std::string | _ConditionName |
condition name |
|
Definition at line 285 of file logic_condition.h. References _ConditionName.
00286 { 00287 _ConditionName = "no_condition"; 00288 } |
|
Add a condition node
Definition at line 316 of file logic_condition.h.
00316 { Nodes.push_back( node ); } |
|
Fill a set with all the variables name referenced by this condition
Definition at line 571 of file logic_condition.cpp.
|
|
Get the condition's name
Definition at line 309 of file logic_condition.h. References _ConditionName.
00309 { return _ConditionName; } |
|
Definition at line 610 of file logic_condition.cpp. References _ConditionName, NLLOGIC::getXMLProp(), uint, v, and NLLOGIC::xmlCheckNodeName().
00611 { 00612 xmlCheckNodeName (node, "CONDITION"); 00613 00614 _ConditionName = getXMLProp (node, "Name"); 00615 00616 { 00617 // Count the parent 00618 uint nb = CIXml::countChildren (node, "CONDITION_NODE"); 00619 uint i = 0; 00620 xmlNodePtr parent = CIXml::getFirstChildNode (node, "CONDITION_NODE"); 00621 while (i<nb) 00622 { 00623 CLogicConditionNode v; 00624 v.read(parent); 00625 Nodes.push_back (v); 00626 00627 // Next parent 00628 parent = CIXml::getNextChildNode (parent, "CONDITION_NODE"); 00629 i++; 00630 } 00631 } 00632 } |
|
Set the logic state machine
Definition at line 527 of file logic_condition.cpp. References nlwarning.
00528 { 00529 if( logicStateMachine == 0 ) 00530 { 00531 nlwarning("(LOGIC)<CLogicCondition::setLogicStateMachine> The state machine is null"); 00532 } 00533 else 00534 { 00535 // init the logic state machine for each node 00536 vector<CLogicConditionNode>::iterator itNodes; 00537 for( itNodes = Nodes.begin(); itNodes != Nodes.end(); ++itNodes ) 00538 { 00539 (*itNodes).setLogicStateMachine( logicStateMachine ); 00540 } 00541 } 00542 00543 } // setLogicStateMachine // |
|
Set the condition's name
Definition at line 302 of file logic_condition.h. References _ConditionName.
00302 { _ConditionName = name; } |
|
Test the condition
Definition at line 550 of file logic_condition.cpp. Referenced by NLLOGIC::CLogicEvent::testCondition().
|
|
serial Definition at line 598 of file logic_condition.cpp. References _ConditionName, and uint.
00599 { 00600 xmlNodePtr elmPtr = xmlNewChild ( node, NULL, (const xmlChar*)"CONDITION", NULL); 00601 xmlSetProp (elmPtr, (const xmlChar*)"Name", (const xmlChar*)_ConditionName.c_str()); 00602 00603 uint i; 00604 for (i = 0; i < Nodes.size(); i++) 00605 { 00606 Nodes[i].write(elmPtr); 00607 } 00608 } |
|
condition name
Definition at line 275 of file logic_condition.h. Referenced by CLogicCondition(), getName(), read(), setName(), and write(). |
|
condition tree
Definition at line 280 of file logic_condition.h. |