本文整理汇总了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;
}
示例2: getInstance
Facade* Facade::getInstance(std::string key)
{
Facade* facade = Multiton<Facade>::instance(key);
facade->initializeNotifier(key);
facade->initializeFacade();
return facade;
}
示例3: test_facade
void test_facade()
{
Facade* f = new Facade;
f->OperationWrapper();
delete f;
}
示例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();
}
示例5: main
int main() {
Facade * facade = new Facade();
facade->MethodA();
facade->MethodB();
return 0;
}
示例6: main
int main(int argc, char *argv[])
{
Facade *f = new Facade();
f->OperationWrapper();
system("pause");
return 0;
}
示例7: test_wg
void test_wg()
{
cout << "\n----外观模式----\n";
//外观模式中, 外部只能看到Facade类, 且只能通过Facede类接口完成内部系统的逻辑
Facade facade;
facade.DoSomething();
}
示例8: main
int main(int argc, char * argv[])
{
Facade *facade = new Facade();
facade->Method();
delete facade;
system("pause");
return 0;
}
示例9: main
int main()
{
Facade facade;
facade.calc(30);
facade.calc(36);
facade.calc(2);
return EXIT_SUCCESS;
}
示例10: main
int main()
{
Facade *pFacade = new Facade();
pFacade->MethodA();
pFacade->MethodB();
system("pause");
return 0;
}
示例11: main
int main(void){
cout<<"Facade Pattern Sample Start!!"<<endl;
//ユーザが使用するのはfacadeクラスだけ
Facade facade;
//facadeの簡易的な関数を実行するだけで、クラスA,B,Cの複雑な処理を実施してくれる
facade.Do();
return 0;
}
示例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;
}
示例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);
}
示例14: Facade
void MainWindow::testFacade()
{
Facade *pFacade = new Facade();
pFacade->operation();
}
示例15: up
static void up(Facade& f)
{
f.up();
}