SatelliteServerPtr SatelliteServer::Create(SatelliteServerInfoPtr info) {
  SatelliteServerPtr satellite;
  if (info->getPort()) {
    switch (info->getType()) {
    case KindOfInternalPageServer:
      satellite = SatelliteServerPtr(new InternalPageServer(info));
      break;
    case KindOfDanglingPageServer:
      satellite = SatelliteServerPtr(new DanglingPageServer(info));
      break;
    case KindOfRPCServer:
      satellite = SatelliteServerPtr(new RPCServer(info));
      break;
    case KindOfXboxServer:
      satellite = SatelliteServerPtr(new RPCServer(info));
      break;
    default:
      ASSERT(false);
    }
    if (satellite) {
      satellite->setName(info->getName());
    }
  }
  return satellite;
}
示例#2
0
std::shared_ptr<SatelliteServer>
SatelliteServer::Create(std::shared_ptr<SatelliteServerInfo> info) {
  std::shared_ptr<SatelliteServer> satellite;
  if (info->getPort()) {
    using SatelliteServerPtr = std::shared_ptr<SatelliteServer>;
    switch (info->getType()) {
    case Type::KindOfInternalPageServer:
      satellite = SatelliteServerPtr(new InternalPageServer(info));
      break;
    case Type::KindOfDanglingPageServer:
      satellite = SatelliteServerPtr(new DanglingPageServer(info));
      break;
    case Type::KindOfRPCServer:
      satellite = SatelliteServerPtr(new RPCServer(info));
      break;
    case Type::KindOfXboxServer:
      satellite = SatelliteServerPtr(new RPCServer(info));
      break;
    default:
      assert(false);
    }
    if (satellite) {
      satellite->setName(info->getName());
    }
  }
  return satellite;
}