diff options
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/bindings/swig/php/uscxml.i | 12 | ||||
-rw-r--r-- | src/bindings/swig/php/uscxmlNativePHP.php | 20 | ||||
-rw-r--r-- | test/samples/uscxml/test-prolog2.scxml | 18 |
4 files changed, 38 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bdd2f45..68b196a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,11 +325,11 @@ if (NOT WIN32) include_directories(${LIBXML2_INCLUDE_DIR}) list (APPEND USCXML_CORE_LIBS ${LIBXML2_LIBRARIES}) set(XML_LIBRARIES ${LIBXML2_LIBRARIES}) - list (APPEND USCXML_CORE_LIBS "dl") - list (APPEND USCXML_CORE_LIBS "pthread") if (NOT APPLE) list (APPEND USCXML_CORE_LIBS "rt") endif() + list (APPEND USCXML_CORE_LIBS "dl") + list (APPEND USCXML_CORE_LIBS "pthread") elseif(WIN32) list (APPEND XML_LIBRARIES "Ws2_32") list (APPEND XML_LIBRARIES "Winmm") diff --git a/src/bindings/swig/php/uscxml.i b/src/bindings/swig/php/uscxml.i index 5f0b930..5dd59b9 100644 --- a/src/bindings/swig/php/uscxml.i +++ b/src/bindings/swig/php/uscxml.i @@ -42,6 +42,18 @@ void*** tsrm_ls; %ignore uscxml::InterpreterImpl; //*********************************************** +// Beautify interpreter class +//*********************************************** + +%ignore uscxml::Interpreter::isAtomic(Arabica::DOM::Node<std::string>); +%extend uscxml::Interpreter { + bool isAtomic(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isAtomic(state); + } +} + +//*********************************************** // Parse the header file to generate wrappers //*********************************************** diff --git a/src/bindings/swig/php/uscxmlNativePHP.php b/src/bindings/swig/php/uscxmlNativePHP.php index e7ef93d..61e7c2e 100644 --- a/src/bindings/swig/php/uscxmlNativePHP.php +++ b/src/bindings/swig/php/uscxmlNativePHP.php @@ -274,8 +274,12 @@ class Event { return $r; } - function setData($invokeId) { - Event_setData($this->_cPtr,$invokeId); + function setData($data) { + Event_setData($this->_cPtr,$data); + } + + function initContent($content) { + Event_initContent($this->_cPtr,$content); } static function fromXML($xmlString) { @@ -747,10 +751,6 @@ class Interpreter { return Interpreter_isTargetless($transition); } - static function isAtomic($state) { - return Interpreter_isAtomic($state); - } - static function isFinal($state) { return Interpreter_isFinal($state); } @@ -832,6 +832,14 @@ class Interpreter { static function getUUID() { return Interpreter_getUUID(); } + + function isAtomic($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isAtomic($this->_cPtr); break; + default: $r=Interpreter_isAtomic($this->_cPtr,$stateId); + } + return $r; + } } class InterpreterMonitor { diff --git a/test/samples/uscxml/test-prolog2.scxml b/test/samples/uscxml/test-prolog2.scxml index f697b89..50dd1b3 100644 --- a/test/samples/uscxml/test-prolog2.scxml +++ b/test/samples/uscxml/test-prolog2.scxml @@ -1,12 +1,14 @@ <scxml datamodel="prolog"> - <data id="father/2"> - bob, jim. - bob, john. - </data> - <data> - mother(martha, jim). - mother(martha, john). - </data> + <datamodel> + <data id="father/2"> + bob, jim. + bob, john. + </data> + <data> + mother(martha, jim). + mother(martha, john). + </data> + </datamodel> <state id="s1"> <onentry> <foreach array="father(bob, X)" |