本文整理汇总了C++中channel::shared_pointer::createChannelArray方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_pointer::createChannelArray方法的具体用法?C++ shared_pointer::createChannelArray怎么用?C++ shared_pointer::createChannelArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类channel::shared_pointer
的用法示例。
在下文中一共展示了shared_pointer::createChannelArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
{
ChannelPutRequester::shared_pointer channelPutRequesterImpl(new ChannelPutRequesterImpl());
PVStructure::shared_pointer pvRequest = CreateRequest::create()->createRequest("field(value,timeStamp)");
ChannelPut::shared_pointer channelPut = channel->createChannelPut(channelPutRequesterImpl, pvRequest);
epicsThreadSleep ( SLEEP_TIME );
channelPut->get();
epicsThreadSleep ( SLEEP_TIME );
// TODO !!!
//channelPut->put();
//epicsThreadSleep ( SLEEP_TIME );
channelPut->destroy();
}
{
ChannelPutGetRequester::shared_pointer channelPutGetRequesterImpl(new ChannelPutGetRequesterImpl());
PVStructure::shared_pointer pvRequest = CreateRequest::create()->createRequest("putField(value,timeStamp)getField(timeStamp)");
ChannelPutGet::shared_pointer channelPutGet = channel->createChannelPutGet(channelPutGetRequesterImpl, pvRequest);
epicsThreadSleep ( SLEEP_TIME );
channelPutGet->getGet();
epicsThreadSleep ( SLEEP_TIME );
channelPutGet->getPut();
epicsThreadSleep ( SLEEP_TIME );
// TODO !!!
//channelPutGet->putGet();
//epicsThreadSleep ( SLEEP_TIME );
channelPutGet->destroy();
}
{
ChannelRPCRequester::shared_pointer channelRPCRequesterImpl(new ChannelRPCRequesterImpl());
PVStructure::shared_pointer pvRequest = CreateRequest::create()->createRequest("record[]field(arguments)");
ChannelRPC::shared_pointer channelRPC = channel->createChannelRPC(channelRPCRequesterImpl, pvRequest);
epicsThreadSleep ( SLEEP_TIME );
// for test simply use pvRequest as arguments
channelRPC->request(pvRequest);
epicsThreadSleep ( SLEEP_TIME );
channelRPC->destroy();
}
{
ChannelArrayRequester::shared_pointer channelArrayRequesterImpl(new ChannelArrayRequesterImpl());
StringArray fieldNames; fieldNames.push_back("field");
FieldConstPtrArray fields; fields.push_back(getFieldCreate()->createScalar(pvString));
PVStructure::shared_pointer pvRequest(getPVDataCreate()->createPVStructure(getFieldCreate()->createStructure(fieldNames, fields)));
ChannelArray::shared_pointer channelArray = channel->createChannelArray(channelArrayRequesterImpl, pvRequest);
epicsThreadSleep ( SLEEP_TIME );
channelArray->getArray(0,0,1);
epicsThreadSleep ( SLEEP_TIME );
// TODO !!!
//channelArray->putArray(0,0,1);
//epicsThreadSleep ( SLEEP_TIME );
channelArray->setLength(3);
epicsThreadSleep ( SLEEP_TIME );
channelArray->getLength();
epicsThreadSleep ( SLEEP_TIME );
channelArray->destroy();
}
{
MonitorRequester::shared_pointer monitorRequesterImpl(new MonitorRequesterImpl());
PVStructure::shared_pointer pvRequest = CreateRequest::create()->createRequest("field()");
Monitor::shared_pointer monitor = channel->createMonitor(monitorRequesterImpl, pvRequest);
epicsThreadSleep( SLEEP_TIME );
Status status = monitor->start();
std::cout << "monitor->start() = " << status << std::endl;
epicsThreadSleep( 3*SLEEP_TIME );
status = monitor->stop();
std::cout << "monitor->stop() = " << status << std::endl;
monitor->destroy();
}
epicsThreadSleep ( 3*SLEEP_TIME );
printf("Destroying channel... \n");
channel->destroy();
printf("done.\n");
epicsThreadSleep ( 3*SLEEP_TIME );
}
ClientFactory::stop();
/*
printf("Destroying context... \n");
context->destroy();
printf("done.\n");
*/
epicsThreadSleep ( SLEEP_TIME ); }
//std::cout << "-----------------------------------------------------------------------" << std::endl;
//epicsExitCallAtExits();
return(0);
}