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


C++ Facade类代码示例

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


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

示例1: main

int main()
{
	Facade* test = new Facade();
	test->FacadeMethod();
	system("pause");
	return 0;
}
开发者ID:annp,项目名称:DesignPattern,代码行数:7,代码来源:test.cpp

示例2: getInstance

Facade* Facade::getInstance(std::string key)
{
    Facade* facade = Multiton<Facade>::instance(key);
    facade->initializeNotifier(key);
    facade->initializeFacade();
    return facade;
}
开发者ID:kikko,项目名称:PureMVC-Plus-Plus,代码行数:7,代码来源:pmvcpp.cpp

示例3: test_facade

void test_facade()
{
	Facade* f = new Facade;
	f->OperationWrapper();

	delete f;
}
开发者ID:lvpingjie,项目名称:design_pattern,代码行数:7,代码来源:test.cpp

示例4: Sender

	Sender(const unsigned char* data, string ia, tpport_t port, uint32 tstamp,
			uint16 count) :

		packetsPerSecond(10) {

		Facade* facade = Facade::getInstance();
		SessionManager* session = facade->createClientSession(ia, port,
				new RecordDevice, new PlaybackDevice,
				"/home/ivocalado/workspace/streamadapt/policies/instance1.xml",
				0);

		TransportSession* sender = session->getTSession();
		uint32 timestamp = tstamp ? tstamp : 0;
		//
		//
		//
		string s = sender->getSession()->retrievePluginInformation(
				"CurrentRTPClockRate");
		istringstream s1(s);
		uint16 tstampInc = 0;
		s1 >> tstampInc;
		tstampInc /= packetsPerSecond;
		uint32 period = 1000 / packetsPerSecond;
		TimerPort::setTimer(period);
		for (int i = 0; i < count; i++) {
			uint32 tmp = timestamp + i * tstampInc;
			sender->getSession()->sendData(tmp, data,
					strlen((char *) data) + 1, &b);
			Thread::sleep(TimerPort::getTimer());
			TimerPort::incTimer(period);
		}
		session->endSession();
	}
开发者ID:txithihausen,项目名称:streamadapt,代码行数:33,代码来源:main.cpp

示例5: main

int main() {
    Facade * facade = new Facade();

    facade->MethodA();
    facade->MethodB();

    return 0;
}
开发者ID:fafa-npu,项目名称:Design-Pattern,代码行数:8,代码来源:facade_model.cpp

示例6: main

int main(int argc, char *argv[])
{
    Facade *f = new Facade();
    f->OperationWrapper();

    system("pause");
    return 0;
}
开发者ID:Redi0,项目名称:CppLanguagePrograms,代码行数:8,代码来源:testFacade.cpp

示例7: test_wg

	void test_wg()
	{
		cout << "\n----外观模式----\n";
		//外观模式中, 外部只能看到Facade类, 且只能通过Facede类接口完成内部系统的逻辑
		Facade facade;
		facade.DoSomething();

	}
开发者ID:bluer007,项目名称:Design_Patterns,代码行数:8,代码来源:外观模式.cpp

示例8: main

int main(int argc, char * argv[])
{
  Facade *facade = new Facade();
  facade->Method();
  delete facade;

  system("pause");
  return 0;
}
开发者ID:XiaolongJason,项目名称:design_patterns,代码行数:9,代码来源:facade_test.cpp

示例9: main

int main()
{
  Facade facade;
  facade.calc(30);
  facade.calc(36);
  facade.calc(2);

  return EXIT_SUCCESS;
}
开发者ID:MoriokaReimen,项目名称:DesignPattern,代码行数:9,代码来源:ChainOfResponsibility.cpp

示例10: main

int main()
{
	Facade *pFacade = new Facade();

	pFacade->MethodA();
	pFacade->MethodB();

	system("pause");
	return 0;
}
开发者ID:woaitubage,项目名称:Design-Pattern,代码行数:10,代码来源:Facade+Pattern.cpp

示例11: main

int main(void){
  cout<<"Facade Pattern Sample Start!!"<<endl;

  //ユーザが使用するのはfacadeクラスだけ
  Facade facade;
  //facadeの簡易的な関数を実行するだけで、クラスA,B,Cの複雑な処理を実施してくれる
  facade.Do();

  return 0;
}
开发者ID:AtsushiSakai,项目名称:cpp,代码行数:10,代码来源:Facade.cpp

示例12: main

int main()
{
	/*Create object of Facade*/
	Facade shapeMaker;

	/*Use this object to control the other object functionalties*/
	shapeMaker.drawCircle();
	shapeMaker.drawRectangle();
	shapeMaker.drawSquare();

    return 0;
}
开发者ID:modyskyline,项目名称:OOP_Concepts,代码行数:12,代码来源:main.cpp

示例13: while

//-----------------------------------------------------------------------
void DestoryContextCommand::_destroyContext(u2::Context* context)
{
    if (context == nullptr)
    {
        return;
    }

    // destroy children
    u2::Context::ContextMapIterator it = context->getChildIterator();
    while (it.hasMoreElements())
    {
        _destroyContext(it.getNext());
    }


    // destroy view component
    ViewComponent* pViewComp = ViewComponentManager::getSingletonPtr()->retrieveObjectByName(context->getViewCompName());
    if (pViewComp != nullptr)
    {
        //pViewComp->end();
        Facade* pFacade = FacadeManager::getSingletonPtr()->retrieveObjectByName(context->getFacadeName());
        if (pFacade != nullptr)
        {
            pFacade->removeViewComp(context->getViewCompName());
        }
        ViewComponentManager::getSingletonPtr()->destoryObject(pViewComp);
    }

    // destroy context
    u2::Context* pParent = context->getParent();
    if (pParent == nullptr)
    {
        pParent->removeChild(context);
    }
    ContextProxy* pContextProxy = getFacade().retrieveProxy<ContextProxy>(ON_Proxy_Context);
    pContextProxy->erase(context);
    ContextManager::getSingletonPtr()->destoryObject(context);
}
开发者ID:jrsnail,项目名称:u2project_logic,代码行数:39,代码来源:U2PredefinedCommands.cpp

示例14: Facade

void MainWindow::testFacade()
{
    Facade *pFacade = new Facade();
    pFacade->operation();
}
开发者ID:lansedetuzi,项目名称:DesignPattern,代码行数:5,代码来源:mainwindow.cpp

示例15: up

 static void up(Facade& f)
 {
     f.up();
 }
开发者ID:BrainlessLabsInc,项目名称:boost-tree,代码行数:4,代码来源:cursor_facade.hpp


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