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


C++ channel::shared_pointer类代码示例

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


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

示例1: addChannel

void PvaClientChannelCache::addChannel(PvaClientChannelPtr const & pvaClientChannel)
{
     Channel::shared_pointer channel = pvaClientChannel->getChannel();
     string name = channel->getChannelName()
         + channel->getProvider()->getProviderName();
     pvaClientChannelMap.insert(std::pair<string,PvaClientChannelPtr>(
         name,pvaClientChannel));
}
开发者ID:MichaelRitzert,项目名称:pvaClientCPP,代码行数:8,代码来源:pvaClient.cpp

示例2: connectionChange

bool PvaClientMultiChannel::connectionChange()
{
    for(size_t i=0; i<numChannel; ++i) {
         PvaClientChannelPtr pvaClientChannel = pvaClientChannelArray[i];
         Channel::shared_pointer channel = pvaClientChannel->getChannel();
         Channel::ConnectionState stateNow = channel->getConnectionState();
         bool connectedNow = stateNow==Channel::CONNECTED ? true : false;
         if(connectedNow!=isConnected[i]) return true;
    }
    return false;
}
开发者ID:epics-base,项目名称:pvaClientCPP,代码行数:11,代码来源:pvaClientMultiChannel.cpp

示例3: addChannel

void PvaClientChannelCache::addChannel(PvaClientChannelPtr const & pvaClientChannel)
{
     Channel::shared_pointer channel = pvaClientChannel->getChannel();
     string name = channel->getChannelName()
         + channel->getProvider()->getProviderName();
    map<string,PvaClientChannelPtr>::iterator iter = pvaClientChannelMap.find(name);
    if(iter!=pvaClientChannelMap.end()) {
        throw std::runtime_error("pvaClientChannelCache::addChannel channel already cached");
    }
    pvaClientChannelMap.insert(std::pair<string,PvaClientChannelPtr>(
         name,pvaClientChannel));
}
开发者ID:epics-base,项目名称:pvaClientCPP,代码行数:12,代码来源:pvaClient.cpp

示例4: connectionChange

bool PvaClientMultiChannel::connectionChange()
{
    if(isDestroyed) throw std::runtime_error("pvaClientMultiChannel was destroyed");
    for(size_t i=0; i<numChannel; ++i) {
         PvaClientChannelPtr pvaClientChannel = pvaClientChannelArray[i];
         Channel::shared_pointer channel = pvaClientChannel->getChannel();
         Channel::ConnectionState stateNow = channel->getConnectionState();
         bool connectedNow = stateNow==Channel::CONNECTED ? true : false;
         if(connectedNow!=isConnected[i]) return true;
    }
    return false;
}
开发者ID:mdavidsaver,项目名称:easyPVACPP,代码行数:12,代码来源:pvaClientMultiChannel.cpp

示例5: channelCreated

void ChannelRequesterImpl::channelCreated(const epics::pvData::Status& status, Channel::shared_pointer const & channel)
{
    qDebug() << "ChannelRequesterImpl channelCreated";
    if (status.isSuccess()) {
        // show warning
        if (!status.isOK()) {
             std::cout << "[" << channel->getChannelName() << "] channel create: " << status.toString()  << std::endl;
        }
    } else {
         std::cout << "[" << channel->getChannelName() << "] failed to create a channel: " << status.toString()  << std::endl;
    }
}
开发者ID:jerryjiahaha,项目名称:caqtdm,代码行数:12,代码来源:pvAccessImpl.cpp

示例6: showCache

void PvaClientChannelCache::showCache()
{
    map<string,PvaClientChannelPtr>::iterator iter;
    for(iter = pvaClientChannelMap.begin(); iter != pvaClientChannelMap.end(); ++iter)
    {
         PvaClientChannelPtr pvaChannel = iter->second;
         Channel::shared_pointer channel = pvaChannel->getChannel();
         string channelName = channel->getChannelName();
         string providerName = channel->getProvider()->getProviderName();
         cout << "channel " << channelName << " provider " << providerName << endl;
         pvaChannel->showCache();
    } 
}
开发者ID:epics-base,项目名称:pvaClientCPP,代码行数:13,代码来源:pvaClient.cpp

示例7:

epics::pvData::shared_vector<epics::pvData::boolean>  PvaClientMultiChannel::getIsConnected()
{
    for(size_t i=0; i<numChannel; ++i) {
         PvaClientChannelPtr pvaClientChannel = pvaClientChannelArray[i];
         if(!pvaClientChannel) {
              isConnected[i] = false;
              continue;
         }
         Channel::shared_pointer channel = pvaClientChannel->getChannel();
         Channel::ConnectionState stateNow = channel->getConnectionState();
         isConnected[i] = (stateNow==Channel::CONNECTED) ? true : false;
    }
    return isConnected;
}
开发者ID:epics-base,项目名称:pvaClientCPP,代码行数:14,代码来源:pvaClientMultiChannel.cpp

示例8: destroy

void CAChannelProvider::destroy()
{
    Lock lock(channelsMutex);
    {
        while (!channels.empty())
        {
            Channel::shared_pointer channel = channels.rbegin()->second.lock();
            if (channel)
                channel->destroy();
        }
    }

    /* Destroy CA Context */
    ca_context_destroy();
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例9: channelCreated

 virtual void channelCreated(const epics::pvData::Status& status,
                             Channel::shared_pointer const & channel)
 {
     if (status.isSuccess())
     {
         // show warning
         if (!status.isOK())
         {
             std::cout << "[" << channel->getChannelName() << "] channel create: " << status << std::endl;
         }
     }
     else
     {
         std::cout << "[" << channel->getChannelName() << "] failed to create a channel: " << status << std::endl;
     }
 }
开发者ID:mdavidsaver,项目名称:pvAccessCPP,代码行数:16,代码来源:testMonitorPerformance.cpp

示例10: channelStateChange

void ChannelRequesterImpl::channelStateChange(Channel::shared_pointer const & channel, Channel::ConnectionState connectionState)
{
    Q_UNUSED(channel);
    qDebug() << "ChannelRequesterImpl channelStateChange " << m_channelIndex;
    if (connectionState == Channel::CONNECTED) {
         std::cout << channel->getChannelName() << " CONNECTED: " << std::endl;
        m_event.signal();
        m_mutexData->SetMutexKnobDataConnected(m_channelIndex, true);
    } else if (connectionState == Channel::DISCONNECTED) {
         std::cout << channel->getChannelName() << " DISCONNECTED: " <<  std::endl;
        m_event.signal();
        m_mutexData->SetMutexKnobDataConnected(m_channelIndex, false);
    } else {
         std::cout << channel->getChannelName() << " " << Channel::ConnectionStateNames[connectionState] <<  std::endl;
    }
}
开发者ID:jerryjiahaha,项目名称:caqtdm,代码行数:16,代码来源:pvAccessImpl.cpp

示例11: channelStateChange

 // always called from the same thread
 virtual void channelStateChange(Channel::shared_pointer const & c, Channel::ConnectionState connectionState)
 {
     if (connectionState == Channel::CONNECTED)
     {
         cout << c->getChannelName() << " CONNECTED: " << (count+1) << endl;
         if (static_cast<size_t>(++count) == total)
             g_event.signal();
     }
     else if (connectionState == Channel::DISCONNECTED)
     {
         --count;
         cout << c->getChannelName() << " DISCONNECTED: " << count << endl;
     }
     else
         cout << c->getChannelName() << " " << Channel::ConnectionStateNames[connectionState] << endl;
     
 }
开发者ID:hartmansm,项目名称:pvAccessCPP,代码行数:18,代码来源:testChannelConnect.cpp

示例12: channelStateChange

void MyChannelRequester::channelStateChange(Channel::shared_pointer const & channel, Channel::ConnectionState connectionState)
{
    cout << channel->getChannelName() << " state: "
         << Channel::ConnectionStateNames[connectionState]
         << " (" << connectionState << ")" << endl;
    if (connectionState == Channel::CONNECTED)
        connect_event.signal();
}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例13: channelCreated

 virtual void channelCreated(const epics::pvData::Status& status, Channel::shared_pointer const & channel)
 {
     if (!status.isSuccess())
     {
         std::cout << "channelCreated(" << status << ", "
                   << (channel ? channel->getChannelName() : "(0)") << ")" << std::endl;
     }
 }
开发者ID:hartmansm,项目名称:pvAccessCPP,代码行数:8,代码来源:testChannelConnect.cpp

示例14: channelCreated

void PvValue::channelCreated(
    const Status& status,
    Channel::shared_pointer const & channel)
{
    if(!status.isOK()) {
        this->status = status;
        requester->message(status.getMessage(),errorMessage);
        isConnected = false;
        event.signal();
    }
    this->channel = channel;
    isConnected = true;
    channelGet = channel->createChannelGet(getPtrSelf(),getRequest);
}
开发者ID:pheest,项目名称:pvaSrv,代码行数:14,代码来源:pvValue.cpp

示例15: connectState

PvaClientRPC::PvaClientRPC(
        PvaClientPtr const &pvaClient,
        Channel::shared_pointer const & channel,
        PVStructurePtr const &pvRequest)
: 
  connectState(connectIdle),
  pvaClient(pvaClient),
  channel(channel),
  pvRequest(pvRequest),
  rpcState(rpcIdle),
  responseTimeout(0.0)
{
    if(PvaClient::getDebug()) {
         cout<< "PvaClientRPC::PvaClientRPC()"
             << " channelName " << channel->getChannelName() 
             << endl;
    }
}
开发者ID:epics-base,项目名称:pvaClientCPP,代码行数:18,代码来源:pvaClientRPC.cpp


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