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


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

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


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

示例1: displayRequirements

void Display::displayRequirements(CmdParser c)
{
	try
	{
		Verbose v(true);
		Verbose::show("******** REQUIREMENT 4 ********");
		Verbose::show("Refer to files Message.h and Message.cpp\n");
		Verbose::show("******** REQUIREMENT 6 ********");
		Verbose::show("Refer to files Communiation.h and Communication.cpp\n");
		Verbose::show("******** REQUIREMENT 8 ********");
		Verbose::show("Refer to files Executive.h, Display.h, Display.cpp and Executive.cpp\n");
		Verbose::show("******** DEMONSTRATING REQUIREMENT 3, 5 & 7 ********\n");
		ObjectFactory of;
		IRecvr *recv = of.createRecvr(stoi(c.getSelfPortNo()));
		ISendr *sender = of.createSendr();
		IMessage *msg = of.createMessage();
		Peer *peer_ = new Peer(sender,recv,msg);
		peer_->start();
		std::cout.flush();
		Verbose::show("\n\n  Press Enter to Exit.");
		std::cin.get();
		peer_->stop();
		
	}
	catch (exception ex)
	{
		string s = ex.what();
		Verbose::show("Exception thrown: "+s);
	}
	


}
开发者ID:akhilpanchal,项目名称:RemoteCodeManagement,代码行数:33,代码来源:Display.cpp

示例2: 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

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