当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectFactory::createMockChannel方法代码示例

本文整理汇总了C++中ObjectFactory::createMockChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectFactory::createMockChannel方法的具体用法?C++ ObjectFactory::createMockChannel怎么用?C++ ObjectFactory::createMockChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectFactory的用法示例。


在下文中一共展示了ObjectFactory::createMockChannel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CancelEventHandler

WPFCppCliDemo::WPFCppCliDemo()
{
  // set up channel
  ObjectFactory* pObjFact = new ObjectFactory;
  pSendr_ = pObjFact->createSendr();
  pRecvr_ = pObjFact->createRecvr();
  pChann_ = pObjFact->createMockChannel(pSendr_, pRecvr_);
  pChann_->start();
  delete pObjFact;
  // client's receive thread
  recvThread = gcnew Thread(gcnew ThreadStart(this, &WPFCppCliDemo::getMessage));
  recvThread->Start();
  // set event handlers
  this->Loaded += 
    gcnew System::Windows::RoutedEventHandler(this, &WPFCppCliDemo::OnLoaded);
  this->Closing += 
    gcnew CancelEventHandler(this, &WPFCppCliDemo::Unloading);
  hSendButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::sendMessage);
  hClearButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::clear);
  hFolderBrowseButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::browseForFolder);
  hConnectButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::connect);
  hUploadBrowseButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::uploadBrowseFolder);
  hUploadFileButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::uploadFile);
  hDownloadBrowseButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::downloadBrowseFolder);
  hDownloadFileButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::downloadFile);
  hTextSearchButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::textSearch);

  // set Window properties
  this->Title = "WPF C++/CLI Demo";
  this->Width = 800;
  this->Height = 600;
  // attach dock panel to Window
  this->Content = hDockPanel;
  hDockPanel->Children->Add(hStatusBar);
  hDockPanel->SetDock(hStatusBar, Dock::Bottom);
  hDockPanel->Children->Add(hGrid);

  // setup Window controls and views
  setUpTabControl();
  setUpStatusBar();
  setUpSendMessageView();
  setUpConnectionView();
  setUpFileUploadView();
  setUpFileDownloadView();
  setUpTextSearchView();
  setUpFileSearchView();
}
开发者ID:CodeWizrd,项目名称:Remote-Code-Mgmt-Facility,代码行数:47,代码来源:Window.cpp

示例2: main

int main()
{
  ObjectFactory objFact;
  ISendr* pSendr = objFact.createSendr();
  IRecvr* pRecvr = objFact.createRecvr();
  IMockChannel* pMockChannel = objFact.createMockChannel(pSendr, pRecvr);
  pMockChannel->start();
  pSendr->postMessage("Hello World");
  pSendr->postMessage("CSE687 - Object Oriented Design");
  Message msg = pRecvr->getMessage();
  std::cout << "\n  received message = \"" << msg << "\"";
  msg = pRecvr->getMessage();
  std::cout << "\n  received message = \"" << msg << "\"";
  pSendr->postMessage("stopping");
  msg = pRecvr->getMessage();
  std::cout << "\n  received message = \"" << msg << "\"";
  pMockChannel->stop();
  pSendr->postMessage("quit");
  std::cin.get();
}
开发者ID:sunilkumarlakkad,项目名称:Remote-Code-Management-Facility,代码行数:20,代码来源:MockChannel.cpp


注:本文中的ObjectFactory::createMockChannel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。