diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/null/NULLDataModel.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/null/NULLDataModel.cpp | 60 |
1 files changed, 7 insertions, 53 deletions
diff --git a/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp b/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp index 7211dc5..773a970 100644 --- a/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp +++ b/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp @@ -21,10 +21,7 @@ #include "uscxml/Common.h" #include "NULLDataModel.h" -#include "uscxml/dom/DOMUtils.h" - -#include "uscxml/Message.h" -#include <glog/logging.h> +#include "uscxml/util/DOM.h" #ifdef BUILD_AS_PLUGINS #include <Pluma/Connector.hpp> @@ -43,28 +40,16 @@ bool pluginConnect(pluma::Host& host) { NULLDataModel::NULLDataModel() { } -boost::shared_ptr<DataModelImpl> NULLDataModel::create(InterpreterInfo* interpreter) { - boost::shared_ptr<NULLDataModel> dm = boost::shared_ptr<NULLDataModel>(new NULLDataModel()); - dm->_interpreter = interpreter; +std::shared_ptr<DataModelImpl> NULLDataModel::create(DataModelCallbacks* callbacks) { + std::shared_ptr<NULLDataModel> dm(new NULLDataModel()); + dm->_callbacks = callbacks; return dm; } NULLDataModel::~NULLDataModel() { } -void NULLDataModel::pushContext() { -} - -void NULLDataModel::popContext() { -} - -void NULLDataModel::initialize() { -} - -void NULLDataModel::setEvent(const Event& event) { -} - -Data NULLDataModel::getStringAsData(const std::string& content) { +Data NULLDataModel::getAsData(const std::string& content) { Data data = Data::fromJSON(content); if (data.empty()) { data = Data(content, Data::VERBATIM); @@ -72,39 +57,13 @@ Data NULLDataModel::getStringAsData(const std::string& content) { return data; } -bool NULLDataModel::validate(const std::string& location, const std::string& schema) { - return true; -} - -bool NULLDataModel::isLocation(const std::string& expr) { - return true; -} - -uint32_t NULLDataModel::getLength(const std::string& expr) { - return 0; -} - -void NULLDataModel::setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration) { -} - -void NULLDataModel::eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr) { -} - -bool NULLDataModel::isDeclared(const std::string& expr) { - return true; -} - /** * The boolean expression language consists of the In predicate only. It has the * form 'In(id)', where id is the id of a state in the enclosing state machine. * The predicate must return 'true' if and only if that state is in the current * state configuration. */ -bool NULLDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { +bool NULLDataModel::evalAsBool(const xercesc::DOMElement* scriptNode, const std::string& expr) { std::string trimmedExpr = expr; boost::trim(trimmedExpr); if (!boost::istarts_with(trimmedExpr, "in")) @@ -138,7 +97,7 @@ bool NULLDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, c stateName = *stateIter; } - if (_interpreter->isInState(stateName)) { + if (_callbacks->isInState(stateName)) { continue; } return false; @@ -146,9 +105,4 @@ bool NULLDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, c return true; } -std::string NULLDataModel::evalAsString(const std::string& expr) { - return expr; -} - - }
\ No newline at end of file |