本文整理汇总了C++中Interpreter::getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C++ Interpreter::getConfiguration方法的具体用法?C++ Interpreter::getConfiguration怎么用?C++ Interpreter::getConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interpreter
的用法示例。
在下文中一共展示了Interpreter::getConfiguration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testEvents1
bool testEvents1() {
LOG(INFO) << "---- testEvent1 ";
Interpreter* interpreter = Interpreter::fromURI(path + "/eventdata-01.xml");
interpreter->start();
interpreter->waitForStabilization();
assert(interpreter->getConfiguration().size() == 1);
assert(Interpreter::isMember(interpreter->getState("state1"), interpreter->getConfiguration()));
Event eventFoo;
eventFoo.name = "event.foo";
eventFoo.atom = "3";
interpreter->receive(eventFoo);
interpreter->waitForStabilization();
assert(interpreter->getConfiguration().size() == 1);
assert(Interpreter::isMember(interpreter->getState("state3"), interpreter->getConfiguration()));
Event eventBar;
eventBar.name = "event.bar";
eventBar.atom = "6";
interpreter->receive(eventBar);
interpreter->waitForStabilization();
assert(interpreter->getConfiguration().size() == 1);
assert(Interpreter::isMember(interpreter->getState("state6"), interpreter->getConfiguration()));
Event eventBaz;
eventBaz.name = "event.baz";
eventBaz.atom = "7";
interpreter->receive(eventBaz);
delete interpreter;
return true;
}
示例2: testEvents2
bool testEvents2() {
LOG(INFO) << "---- testEvent2 ";
Interpreter* interpreter = Interpreter::fromURI(path + "/eventdata-02.xml");
interpreter->start();
interpreter->waitForStabilization();
assert(interpreter->getConfiguration().size() == 1);
assert(Interpreter::isMember(interpreter->getState("state0"), interpreter->getConfiguration()));
Event eventConnAlert;
eventConnAlert.name = "connection.alerting";
eventConnAlert.atom = "'line2'";
interpreter->receive(eventConnAlert);
interpreter->waitForStabilization();
assert(interpreter->getConfiguration().size() == 1);
assert(Interpreter::isMember(interpreter->getState("state2"), interpreter->getConfiguration()));
Event eventConnAlert2;
eventConnAlert2.name = "connection.alerting";
eventConnAlert2.compound["line"] = Data(std::string("4"));
interpreter->receive(eventConnAlert2);
delete interpreter;
return true;
}