diff options
Diffstat (limited to 'src/bindings')
-rw-r--r-- | src/bindings/swig/php/uscxml.i | 85 | ||||
-rw-r--r-- | src/bindings/swig/php/uscxmlNativePHP.php | 116 |
2 files changed, 163 insertions, 38 deletions
diff --git a/src/bindings/swig/php/uscxml.i b/src/bindings/swig/php/uscxml.i index 0ab248e..f51309f 100644 --- a/src/bindings/swig/php/uscxml.i +++ b/src/bindings/swig/php/uscxml.i @@ -15,6 +15,10 @@ %ignore operator!=; %ignore operator<; %ignore operator=; +%ignore operator[]; +%ignore operator std::list<Data>; +%ignore operator std::string; +%ignore operator std::map<std::string,Data>; %template(StringMap) std::map<std::string, std::string>; %template(StringVector) std::vector<std::string>; @@ -74,6 +78,38 @@ void*** tsrm_ls; %ignore uscxml::Interpreter::getBasicConfiguration(); %extend uscxml::Interpreter { + bool isState(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isState(state); + } +} +%ignore uscxml::Interpreter::isState(Arabica::DOM::Node<std::string>); + +%extend uscxml::Interpreter { + bool isPseudoState(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isPseudoState(state); + } +} +%ignore uscxml::Interpreter::isPseudoState(Arabica::DOM::Node<std::string>); + +%extend uscxml::Interpreter { + bool isTransitionTarget(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isTransitionTarget(state); + } +} +%ignore uscxml::Interpreter::isTransitionTarget(Arabica::DOM::Node<std::string>); + +%extend uscxml::Interpreter { + bool isTargetless(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isTargetless(state); + } +} +%ignore uscxml::Interpreter::isTargetless(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); @@ -81,6 +117,55 @@ void*** tsrm_ls; } %ignore uscxml::Interpreter::isAtomic(Arabica::DOM::Node<std::string>); +%extend uscxml::Interpreter { + bool isInitial(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isInitial(state); + } +} +%ignore uscxml::Interpreter::isInitial(Arabica::DOM::Node<std::string>); + +%extend uscxml::Interpreter { + bool isFinal(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isFinal(state); + } +} +%ignore uscxml::Interpreter::isFinal(Arabica::DOM::Node<std::string>); + +%extend uscxml::Interpreter { + bool isHistory(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isHistory(state); + } +} +%ignore uscxml::Interpreter::isHistory(Arabica::DOM::Node<std::string>); + +%extend uscxml::Interpreter { + bool isParallel(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isParallel(state); + } +} +%ignore uscxml::Interpreter::isParallel(Arabica::DOM::Node<std::string>); + +%extend uscxml::Interpreter { + bool isCompound(const std::string stateId) { + Arabica::DOM::Node<std::string> state = self->getState(stateId); + return self->isCompound(state); + } +} +%ignore uscxml::Interpreter::isCompound(Arabica::DOM::Node<std::string>); + +%extend uscxml::Interpreter { + bool isDescendant(const std::string stateId1, const std::string stateId2) { + Arabica::DOM::Node<std::string> state1 = self->getState(stateId1); + Arabica::DOM::Node<std::string> state2 = self->getState(stateId2); + return self->isDescendant(state1, state2); + } +} +%ignore uscxml::Interpreter::isDescendant(Arabica::DOM::Node<std::string>); + //*********************************************** // Parse the header file to generate wrappers //*********************************************** diff --git a/src/bindings/swig/php/uscxmlNativePHP.php b/src/bindings/swig/php/uscxmlNativePHP.php index 451fb1d..ef37b94 100644 --- a/src/bindings/swig/php/uscxmlNativePHP.php +++ b/src/bindings/swig/php/uscxmlNativePHP.php @@ -946,40 +946,8 @@ class Interpreter { return Interpreter_hasLegalConfiguration($this->_cPtr); } - static function isState($state) { - return Interpreter_isState($state); - } - - static function isPseudoState($state) { - return Interpreter_isPseudoState($state); - } - - static function isTransitionTarget($elem) { - return Interpreter_isTransitionTarget($elem); - } - - static function isTargetless($transition) { - return Interpreter_isTargetless($transition); - } - - static function isFinal($state) { - return Interpreter_isFinal($state); - } - - static function isHistory($state) { - return Interpreter_isHistory($state); - } - - static function isParallel($state) { - return Interpreter_isParallel($state); - } - - static function isCompound($state) { - return Interpreter_isCompound($state); - } - - static function isDescendant($s1,$s2) { - return Interpreter_isDescendant($s1,$s2); + function isLegalConfiguration($config) { + return Interpreter_isLegalConfiguration($this->_cPtr,$config); } static function tokenizeIdRefs($idRefs) { @@ -996,10 +964,6 @@ class Interpreter { return Interpreter_spaceNormalize($text); } - function isInitial($state) { - return Interpreter_isInitial($this->_cPtr,$state); - } - function getInitialStates($state=null) { switch (func_num_args()) { case 0: $r=Interpreter_getInitialStates($this->_cPtr); break; @@ -1072,6 +1036,38 @@ class Interpreter { return $r; } + function isState($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isState($this->_cPtr); break; + default: $r=Interpreter_isState($this->_cPtr,$stateId); + } + return $r; + } + + function isPseudoState($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isPseudoState($this->_cPtr); break; + default: $r=Interpreter_isPseudoState($this->_cPtr,$stateId); + } + return $r; + } + + function isTransitionTarget($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isTransitionTarget($this->_cPtr); break; + default: $r=Interpreter_isTransitionTarget($this->_cPtr,$stateId); + } + return $r; + } + + function isTargetless($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isTargetless($this->_cPtr); break; + default: $r=Interpreter_isTargetless($this->_cPtr,$stateId); + } + return $r; + } + function isAtomic($stateId=null) { switch (func_num_args()) { case 0: $r=Interpreter_isAtomic($this->_cPtr); break; @@ -1079,6 +1075,50 @@ class Interpreter { } return $r; } + + function isInitial($state_or_stateId) { + return Interpreter_isInitial($this->_cPtr,$state_or_stateId); + } + + function isFinal($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isFinal($this->_cPtr); break; + default: $r=Interpreter_isFinal($this->_cPtr,$stateId); + } + return $r; + } + + function isHistory($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isHistory($this->_cPtr); break; + default: $r=Interpreter_isHistory($this->_cPtr,$stateId); + } + return $r; + } + + function isParallel($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isParallel($this->_cPtr); break; + default: $r=Interpreter_isParallel($this->_cPtr,$stateId); + } + return $r; + } + + function isCompound($stateId=null) { + switch (func_num_args()) { + case 0: $r=Interpreter_isCompound($this->_cPtr); break; + default: $r=Interpreter_isCompound($this->_cPtr,$stateId); + } + return $r; + } + + function isDescendant($s2_or_stateId1,$stateId2=null) { + switch (func_num_args()) { + case 1: $r=Interpreter_isDescendant($this->_cPtr,$s2_or_stateId1); break; + default: $r=Interpreter_isDescendant($this->_cPtr,$s2_or_stateId1,$stateId2); + } + return $r; + } } class InterpreterMonitor { |