summaryrefslogtreecommitdiffstats
path: root/test/src/test-communication.cpp
blob: ac0fa6c57ef60559c1e1c6f74070a37827acda28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "uscxml/Interpreter.h"
#include <DOM/io/Stream.hpp>

int main(int argc, char** argv) {
  if (argc != 2) {
    std::cerr << "Expected path to test-communication.scxml" << std::endl;
    exit(EXIT_FAILURE);
  }
  
  
  using namespace uscxml;
  std::list<Interpreter*> _interpreters;

//  Event e;
//  e.compound["foo"] = Data("bar", Data::VERBATIM);
//  e.compound["foo2"] = Data("bar2", Data::VERBATIM);
//  std::cout << e.toDocument() << std::endl;
  
  int nrInterpreters = 1;
  for (int i = 0; i < nrInterpreters; i++) {
    _interpreters.push_back(Interpreter::fromURI(argv[1]));
    _interpreters.back()->start();
  }

  std::list<Interpreter*>::iterator interIter = _interpreters.begin();
  while(interIter != _interpreters.end()) {
    (*interIter)->join();
    interIter++;
  }

}