本文整理汇总了C++中Interpreter::getDataModel方法的典型用法代码示例。如果您正苦于以下问题:C++ Interpreter::getDataModel方法的具体用法?C++ Interpreter::getDataModel怎么用?C++ Interpreter::getDataModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interpreter
的用法示例。
在下文中一共展示了Interpreter::getDataModel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getQualifiedInvokeBreakpoints
std::list<Breakpoint> getQualifiedInvokeBreakpoints(Interpreter interpreter, const Arabica::DOM::Element<std::string>& invokeElem, const std::string invokeId, Breakpoint breakpointTemplate) {
std::list<Breakpoint> breakpoints;
Breakpoint bp = breakpointTemplate; // copy base as template
bp.subject = Breakpoint::INVOKER;
bp.element = invokeElem;
bp.invokeId = invokeId;
if (HAS_ATTR(invokeElem, "type")) {
bp.invokeType = ATTR(invokeElem, "type");
} else if (HAS_ATTR(invokeElem, "typeexpr")) {
bp.invokeType = interpreter.getDataModel().evalAsString(ATTR(invokeElem, "typeexpr"));
}
breakpoints.push_back(bp);
return breakpoints;
}
示例2: catch
void PostponeElement::Resubmitter::onStableConfiguration(Interpreter interpreter) {
std::list<Postponed>::iterator eventIter = _postponedEvents.begin();
bool dispatched = false;
while(eventIter != _postponedEvents.end()) {
try {
// LOG(INFO) << "Reevaluating: >> " << eventIter->first << " <<";
if ((!dispatched || eventIter->chaining) && interpreter.getDataModel().evalAsBool(eventIter->until)) {
// LOG(INFO) << " -> is TRUE";
eventIter->event.name += ".postponed";
interpreter.receive(eventIter->event, true);
_postponedEvents.erase(eventIter++);
dispatched = true;
}
// LOG(INFO) << " -> is FALSE";
} catch (Event e) {
LOG(ERROR) << "Syntax error while evaluating until attribute of postpone element:" << std::endl << e << std::endl;
_postponedEvents.erase(eventIter++);
continue;
}
eventIter++;
}
// LOG(ERROR) << _postponedEvents.size() << " Postponess remaining";
}
示例3: matches
bool Breakpoint::matches(Interpreter interpreter, const Breakpoint& other) const {
// would we match the given breakpoint?
if (subject != UNDEF_SUBJECT &&
other.subject != subject)
return false; // subject does not match
if (when != UNDEF_WHEN &&
other.when != when)
return false; // time does not match
if (action != UNDEF_ACTION &&
other.action != action)
return false; // action does not match
// when we have a qualifier it has to match
if(invokeId.length() > 0 && invokeId != other.invokeId) {
return false;
}
if(invokeType.length() > 0 && invokeType != other.invokeType) {
return false;
}
if(stateId.length() > 0 && stateId != other.stateId) {
return false;
}
if(eventName.length() > 0 && !InterpreterImpl::nameMatch(eventName, other.eventName)) {
return false;
}
if(executableName.length() > 0 && executableName != other.executableName) {
return false;
}
if(executableXPath.length()) {
Arabica::XPath::NodeSet<std::string> nodes;
try {
nodes = interpreter.getNodeSetForXPath(executableXPath);
} catch (...) {
return false;
}
return Interpreter::isMember(other.element, nodes);
}
if(transSourceId.length() > 0 && transSourceId != other.transSourceId) {
return false;
}
if(transTargetId.length() > 0 && transTargetId != other.transTargetId) {
return false;
}
if (condition.length() > 0) {
try {
DataModel dm = interpreter.getDataModel();
if (!dm || !dm.evalAsBool(condition)) {
return false;
}
} catch (...) {
return false;
}
}
return true;
}