示例#1
0
void EngineFrontend<Engine>::start ()
{
  CommandVisitor<Engine> visitor (engine_, codec_);

  while (!stop_ && !visitor.stop())
  {
    try
    {
      WhateverCommand cmd = codec_.readCommand ();
//FIXME: without this like everything blocks
//      boost::apply_visitor (PrintCmd(), cmd);
      boost::apply_visitor (visitor, cmd);
    }
    catch (...) //FIXME
    {
      stop_ = true;
    }
  }
}