#include <logic_event.h>
Nevrax France
Definition at line 149 of file logic_event.h.
Public Member Functions | |
CLogicEvent () | |
void | read (xmlNodePtr node) |
void | reset () |
void | setLogicStateMachine (CLogicStateMachine *logicStateMachine) |
bool | testCondition () |
void | write (xmlNodePtr node) const |
Data Fields | |
std::string | ConditionName |
condition name | |
CLogicEventAction | EventAction |
event action | |
Private Attributes | |
CLogicStateMachine * | _LogicStateMachine |
state machine managing this event |
|
Default constructor Definition at line 165 of file logic_event.h. References ConditionName.
00166 { 00167 _LogicStateMachine = 0; 00168 ConditionName = "no_condition"; 00169 } |
|
Definition at line 250 of file logic_event.cpp. References ConditionName, EventAction, NLLOGIC::getXMLProp(), NLLOGIC::CLogicEventAction::read(), and NLLOGIC::xmlCheckNodeName().
00251 { 00252 xmlCheckNodeName (node, "EVENT"); 00253 00254 ConditionName = getXMLProp (node, "ConditionName"); 00255 EventAction.read(node); 00256 } |
|
Reset this event Definition at line 162 of file logic_event.cpp. References EventAction, NLLOGIC::CLogicEventAction::EventMessage, NLLOGIC::CLogicEventMessage::Sent, and NLLOGIC::CLogicEventMessage::ToSend.
00163 { 00164 EventAction.EventMessage.Sent = false; 00165 EventAction.EventMessage.ToSend = false; 00166 00167 } // reset // |
|
Set the logic state machine
Definition at line 175 of file logic_event.cpp. References nlwarning. Referenced by NLLOGIC::CLogicState::addEvent().
00176 { 00177 if( logicStateMachine == 0 ) 00178 { 00179 nlwarning("(LOGIC)<CLogicEvent::setLogicStateMachine> The state machine is null"); 00180 } 00181 else 00182 { 00183 // init the logic state machine for this event 00184 _LogicStateMachine = logicStateMachine; 00185 } 00186 00187 } // setLogicStateMachine // |
|
Test the condition
Definition at line 195 of file logic_event.cpp. References ConditionName, NLLOGIC::CLogicStateMachine::getCondition(), nlwarning, and NLLOGIC::CLogicCondition::testLogic().
00196 { 00197 if( _LogicStateMachine ) 00198 { 00199 if( ConditionName != "no_condition" ) 00200 { 00201 CLogicCondition cond; 00202 if( _LogicStateMachine->getCondition( ConditionName, cond ) ) 00203 { 00204 return cond.testLogic(); 00205 } 00206 else 00207 { 00208 nlwarning("(LOGIC)<CLogicEvent::testCondition> Condition %s not found in the state machine",ConditionName.c_str()); 00209 return false; 00210 } 00211 } 00212 else 00213 { 00214 nlwarning("(LOGIC)<CLogicEvent::testCondition> Condition undefined"); 00215 return false; 00216 } 00217 } 00218 else 00219 { 00220 nlwarning("(LOGIC)<CLogicEvent::testCondition> The state machine managing this event is Null"); 00221 } 00222 00223 return false; 00224 00225 } // testCondition // |
|
serial Definition at line 243 of file logic_event.cpp. References ConditionName, EventAction, and NLLOGIC::CLogicEventAction::write().
00244 { 00245 xmlNodePtr elmPtr = xmlNewChild ( node, NULL, (const xmlChar*)"EVENT", NULL); 00246 xmlSetProp (elmPtr, (const xmlChar*)"ConditionName", (const xmlChar*)ConditionName.c_str()); 00247 EventAction.write(elmPtr); 00248 } |
|
state machine managing this event
Definition at line 152 of file logic_event.h. |
|
condition name
Definition at line 157 of file logic_event.h. Referenced by CLogicEvent(), read(), testCondition(), and write(). |
|
event action
Definition at line 160 of file logic_event.h. |