This is Unofficial EPICS BASE Doxygen Site
epics::pvAccess::PipelineChannelProvider Class Reference
+ Inheritance diagram for epics::pvAccess::PipelineChannelProvider:
+ Collaboration diagram for epics::pvAccess::PipelineChannelProvider:

Public Member Functions

 POINTER_DEFINITIONS (PipelineChannelProvider)
 
 PipelineChannelProvider ()
 
virtual string getProviderName ()
 
virtual std::tr1::shared_ptr< ChannelProvidergetChannelProvider ()
 
virtual void cancel ()
 
virtual void destroy ()
 
virtual ChannelFind::shared_pointer channelFind (std::string const &channelName, ChannelFindRequester::shared_pointer const &channelFindRequester)
 
virtual ChannelFind::shared_pointer channelList (ChannelListRequester::shared_pointer const &channelListRequester)
 
virtual Channel::shared_pointer createChannel (std::string const &channelName, ChannelRequester::shared_pointer const &channelRequester, short)
 
virtual Channel::shared_pointer createChannel (std::string const &, ChannelRequester::shared_pointer const &, short, std::string const &)
 
void registerService (std::string const &serviceName, PipelineService::shared_pointer const &service)
 
void unregisterService (std::string const &serviceName)
 
- Public Member Functions inherited from epics::pvAccess::ChannelProvider
 POINTER_DEFINITIONS (ChannelProvider)
 
 ChannelProvider ()
 
virtual ~ChannelProvider ()
 
- Public Member Functions inherited from epics::pvAccess::Destroyable
 POINTER_DEFINITIONS (Destroyable)
 
- Public Member Functions inherited from epics::pvAccess::ChannelFind
 POINTER_DEFINITIONS (ChannelFind)
 
 ChannelFind ()
 
virtual ~ChannelFind ()
 

Static Public Attributes

static const string PROVIDER_NAME
 
static const Status noSuchChannelStatus
 
- Static Public Attributes inherited from epics::pvAccess::ChannelProvider
static const short PRIORITY_MIN = 0
 
static const short PRIORITY_MAX = 99
 
static const short PRIORITY_DEFAULT = PRIORITY_MIN
 
static const short PRIORITY_LINKS_DB = PRIORITY_MAX
 
static const short PRIORITY_ARCHIVE = (PRIORITY_MAX + PRIORITY_MIN) / 2
 
static const short PRIORITY_OPI = PRIORITY_MIN
 
static size_t num_instances
 

Additional Inherited Members

- Public Types inherited from epics::pvAccess::ChannelFind
typedef ChannelFindRequester requester_type
 
- Static Public Member Functions inherited from epics::pvAccess::ChannelFind
static ChannelFind::shared_pointer buildDummy (const std::tr1::shared_ptr< ChannelProvider > &provider)
 
- Protected Member Functions inherited from epics::pvAccess::Destroyable
virtual ~Destroyable ()
 

Detailed Description

Definition at line 449 of file pipelineServer.cpp.

Constructor & Destructor Documentation

epics::pvAccess::PipelineChannelProvider::PipelineChannelProvider ( )
inline

Definition at line 463 of file pipelineServer.cpp.

463  {
464  }

Member Function Documentation

virtual void epics::pvAccess::PipelineChannelProvider::cancel ( )
inlinevirtual

Implements epics::pvAccess::ChannelFind.

Definition at line 475 of file pipelineServer.cpp.

475 {}
virtual ChannelFind::shared_pointer epics::pvAccess::PipelineChannelProvider::channelFind ( std::string const &  name,
ChannelFindRequester::shared_pointer const &  requester 
)
inlinevirtual

Test to see if this provider has the named channel.

May call ChannelFindRequester::channelFindResult() before returning, or at some time later. If an exception is thrown, then channelFindResult() will never be called.

Parameters
nameThe channel name.
requesterThe Requester.
Returns
An unique()==true handle for the pending response. May only return NULL if channelFindResult() called with an Error

Implements epics::pvAccess::ChannelProvider.

Definition at line 479 of file pipelineServer.cpp.

481  {
482  bool found;
483  {
484  Lock guard(m_mutex);
485  found = (m_services.find(channelName) != m_services.end()) ||
486  findWildService(channelName);
487  }
488  ChannelFind::shared_pointer thisPtr(shared_from_this());
489  channelFindRequester->channelFindResult(Status::Ok, thisPtr, found);
490  return thisPtr;
491  }
static Status Ok
Definition: status.h:47
A lock for multithreading.
Definition: lock.h:36
virtual ChannelFind::shared_pointer epics::pvAccess::PipelineChannelProvider::channelList ( ChannelListRequester::shared_pointer const &  requester)
inlinevirtual

Request a list of all valid channel names for this provider.

May call ChannelListRequester::channelListResult() before returning, or at some time later. If an exception is thrown, then channelListResult() will never be called.

Parameters
requesterThe Requester.
Returns
An unique()==true handle for the pending response. May only return NULL if channelFindResult() called with an Error

Reimplemented from epics::pvAccess::ChannelProvider.

Definition at line 494 of file pipelineServer.cpp.

496  {
497  if (!channelListRequester.get())
498  throw std::runtime_error("null requester");
499 
500  PVStringArray::svector channelNames;
501  {
502  Lock guard(m_mutex);
503  channelNames.reserve(m_services.size());
504  for (PipelineServiceMap::const_iterator iter = m_services.begin();
505  iter != m_services.end();
506  iter++)
507  channelNames.push_back(iter->first);
508  }
509 
510  ChannelFind::shared_pointer thisPtr(shared_from_this());
511  channelListRequester->channelListResult(Status::Ok, thisPtr, freeze(channelNames), false);
512  return thisPtr;
513  }
A holder for a contiguous piece of memory.
Definition: sharedVector.h:27
static Status Ok
Definition: status.h:47
A lock for multithreading.
Definition: lock.h:36
void push_back(param_type v)
Definition: sharedVector.h:602
void reserve(size_t i)
Set array capacity.
Definition: sharedVector.h:428
virtual Channel::shared_pointer epics::pvAccess::PipelineChannelProvider::createChannel ( std::string const &  name,
ChannelRequester::shared_pointer const &  requester,
short  priority 
)
inlinevirtual

See longer form

Reimplemented from epics::pvAccess::ChannelProvider.

Definition at line 515 of file pipelineServer.cpp.

519  {
520  PipelineService::shared_pointer service;
521 
522  PipelineServiceMap::const_iterator iter;
523  {
524  Lock guard(m_mutex);
525  iter = m_services.find(channelName);
526  }
527  if (iter != m_services.end())
528  service = iter->second;
529 
530  // check for wild services
531  if (!service)
532  service = findWildService(channelName);
533 
534  if (!service)
535  {
536  Channel::shared_pointer nullChannel;
537  channelRequester->channelCreated(noSuchChannelStatus, nullChannel);
538  return nullChannel;
539  }
540 
541  // TODO use std::make_shared
542  std::tr1::shared_ptr<PipelineChannel> tp(
543  new PipelineChannel(
544  shared_from_this(),
545  channelName,
546  channelRequester,
547  service));
548  Channel::shared_pointer pipelineChannel = tp;
549  channelRequester->channelCreated(Status::Ok, pipelineChannel);
550  return pipelineChannel;
551  }
static Status Ok
Definition: status.h:47
A lock for multithreading.
Definition: lock.h:36
if(yy_init)
Definition: scan.c:972
virtual Channel::shared_pointer epics::pvAccess::PipelineChannelProvider::createChannel ( std::string const &  name,
ChannelRequester::shared_pointer const &  requester,
short  priority,
std::string const &  address 
)
inlinevirtual

Request a Channel.

Channel creation is immediate. ChannelRequester::channelCreated() will be called before returning. The shared_ptr which is passed to channelCreated() will also be returned.

Failures during channel creation are delivered to ChannelRequester::channelCreated() with Status::isSuccess()==false.

Postcondition
The returned Channel will hold a strong reference to the provided ChannelRequester and to the ChannelProvider through which it is created.
The shared_ptr passed to ChannelRequester::channelCreated() is unique. See providers_ownership_unique
The new Channel will not hold a strong reference to this ChannelProvider. This provider must be kept alive in order to keep the Channel from being destoryed.
Parameters
nameThe name of the channel.
requesterWill receive notifications about channel state changes
prioritychannel priority, must be PRIORITY_MIN <= priority <= PRIORITY_MAX.
addressImplementation dependent condition. eg. A network address to bypass the search phase. Pass an empty() string for default behavour.
Returns
A non-NULL Channel unless channelCreated() called with an Error

Implements epics::pvAccess::ChannelProvider.

Definition at line 553 of file pipelineServer.cpp.

558  {
559  // this will never get called by the pvAccess server
560  throw std::runtime_error("not supported");
561  }
virtual void epics::pvAccess::PipelineChannelProvider::destroy ( )
inlinevirtual

Destroy this instance.

Implements epics::pvAccess::Destroyable.

Definition at line 477 of file pipelineServer.cpp.

477 {}
virtual std::tr1::shared_ptr<ChannelProvider> epics::pvAccess::PipelineChannelProvider::getChannelProvider ( )
inlinevirtual

Implements epics::pvAccess::ChannelFind.

Definition at line 470 of file pipelineServer.cpp.

471  {
472  return shared_from_this();
473  }
virtual string epics::pvAccess::PipelineChannelProvider::getProviderName ( )
inlinevirtual

Get the provider name.

Returns
The name.

Implements epics::pvAccess::ChannelProvider.

Definition at line 466 of file pipelineServer.cpp.

466  {
467  return PROVIDER_NAME;
468  }
epics::pvAccess::PipelineChannelProvider::POINTER_DEFINITIONS ( PipelineChannelProvider  )
void epics::pvAccess::PipelineChannelProvider::registerService ( std::string const &  serviceName,
PipelineService::shared_pointer const &  service 
)
inline

Definition at line 563 of file pipelineServer.cpp.

564  {
565  Lock guard(m_mutex);
566  m_services[serviceName] = service;
567 
568  if (isWildcardPattern(serviceName))
569  m_wildServices.push_back(std::make_pair(serviceName, service));
570  }
A lock for multithreading.
Definition: lock.h:36
void epics::pvAccess::PipelineChannelProvider::unregisterService ( std::string const &  serviceName)
inline

Definition at line 572 of file pipelineServer.cpp.

573  {
574  Lock guard(m_mutex);
575  m_services.erase(serviceName);
576 
577  if (isWildcardPattern(serviceName))
578  {
579  for (PipelineWildServiceList::iterator iter = m_wildServices.begin();
580  iter != m_wildServices.end();
581  iter++)
582  if (iter->first == serviceName)
583  {
584  m_wildServices.erase(iter);
585  break;
586  }
587  }
588  }
A lock for multithreading.
Definition: lock.h:36

Member Data Documentation

const Status epics::pvAccess::PipelineChannelProvider::noSuchChannelStatus
static

Definition at line 459 of file pipelineServer.cpp.

const string epics::pvAccess::PipelineChannelProvider::PROVIDER_NAME
static

Definition at line 457 of file pipelineServer.cpp.


The documentation for this class was generated from the following file: