This is Unofficial EPICS BASE Doxygen Site
GWServerChannelProvider Struct Reference

#include "server.h"

+ Inheritance diagram for GWServerChannelProvider:
+ Collaboration diagram for GWServerChannelProvider:

Public Member Functions

 POINTER_DEFINITIONS (GWServerChannelProvider)
 
virtual std::tr1::shared_ptr< ChannelProvidergetChannelProvider ()
 
virtual void cancel ()
 
virtual std::string getProviderName ()
 
virtual epics::pvAccess::ChannelFind::shared_pointer channelFind (std::string const &channelName, epics::pvAccess::ChannelFindRequester::shared_pointer const &channelFindRequester)
 
virtual epics::pvAccess::Channel::shared_pointer createChannel (std::string const &channelName, epics::pvAccess::ChannelRequester::shared_pointer const &channelRequester, short priority, std::string const &addressx)
 
virtual void destroy ()
 
 GWServerChannelProvider (const epics::pvAccess::ChannelProvider::shared_pointer &prov)
 
virtual ~GWServerChannelProvider ()
 
- Public Member Functions inherited from epics::pvAccess::ChannelProvider
 POINTER_DEFINITIONS (ChannelProvider)
 
 ChannelProvider ()
 
virtual ~ChannelProvider ()
 
virtual ChannelFind::shared_pointer channelFind (std::string const &name, ChannelFindRequester::shared_pointer const &requester)=0
 
virtual ChannelFind::shared_pointer channelList (ChannelListRequester::shared_pointer const &requester)
 
virtual Channel::shared_pointer createChannel (std::string const &name, ChannelRequester::shared_pointer const &requester=DefaultChannelRequester::build(), short priority=PRIORITY_DEFAULT)
 
virtual Channel::shared_pointer createChannel (std::string const &name, ChannelRequester::shared_pointer const &requester, short priority, std::string const &address)=0
 
- 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 ()
 

Public Attributes

ChannelCache cache
 

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)
 
- 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
 
- Protected Member Functions inherited from epics::pvAccess::Destroyable
virtual ~Destroyable ()
 

Detailed Description

Definition at line 11 of file server.h.

Constructor & Destructor Documentation

GWServerChannelProvider::GWServerChannelProvider ( const epics::pvAccess::ChannelProvider::shared_pointer &  prov)
explicit

Definition at line 96 of file server.cpp.

97  :cache(prov)
98 {}
ChannelCache cache
Definition: server.h:17
GWServerChannelProvider::~GWServerChannelProvider ( )
virtual

Definition at line 100 of file server.cpp.

100 {}

Member Function Documentation

virtual void GWServerChannelProvider::cancel ( )
inlinevirtual

Implements epics::pvAccess::ChannelFind.

Definition at line 21 of file server.h.

21 {}
pva::ChannelFind::shared_pointer GWServerChannelProvider::channelFind ( std::string const &  channelName,
epics::pvAccess::ChannelFindRequester::shared_pointer const &  channelFindRequester 
)
virtual

Definition at line 36 of file server.cpp.

38 {
39  pva::ChannelFind::shared_pointer ret;
40  bool found = false;
41 
42  if(!channelName.empty())
43  {
44  LOG(pva::logLevelDebug, "Searching for '%s'", channelName.c_str());
45  ChannelCacheEntry::shared_pointer ent(cache.lookup(channelName));
46  if(ent) {
47  found = true;
48  ret = shared_from_this();
49  }
50  }
51 
52  // unlock for callback
53 
54  channelFindRequester->channelFindResult(pvd::Status::Ok, ret, found);
55 
56  return ret;
57 }
static Status Ok
Definition: status.h:47
#define LOG(level, format,...)
Definition: logger.h:48
ChannelCache cache
Definition: server.h:17
ChannelCacheEntry::shared_pointer lookup(const std::string &name)
Definition: chancache.cpp:166
pva::Channel::shared_pointer GWServerChannelProvider::createChannel ( std::string const &  channelName,
epics::pvAccess::ChannelRequester::shared_pointer const &  channelRequester,
short  priority,
std::string const &  addressx 
)
virtual

Definition at line 62 of file server.cpp.

65 {
66  GWChannel::shared_pointer ret;
67  std::string address = channelRequester->getRequesterName();
68 
69  if(!channelName.empty())
70  {
72 
73  ChannelCacheEntry::shared_pointer ent(cache.lookup(channelName)); // recursively locks cacheLock
74 
75  if(ent)
76  {
77  ret.reset(new GWChannel(ent, shared_from_this(), channelRequester, address));
78  ent->interested.insert(ret);
79  ret->weakref = ret;
80  }
81  }
82 
83  if(!ret) {
85  channelRequester->channelCreated(S, ret);
86  } else {
87  channelRequester->channelCreated(pvd::Status::Ok, ret);
88  channelRequester->channelStateChange(ret, pva::Channel::CONNECTED);
89  }
90 
91  return ret; // ignored by caller
92 }
static Status Ok
Definition: status.h:47
epicsMutex cacheLock
Definition: chancache.h:158
ChannelCache cache
Definition: server.h:17
ChannelCacheEntry::shared_pointer lookup(const std::string &name)
Definition: chancache.cpp:166
void GWServerChannelProvider::destroy ( )
virtual

Destroy this instance.

Implements epics::pvAccess::Destroyable.

Definition at line 94 of file server.cpp.

94 {}
std::tr1::shared_ptr< pva::ChannelProvider > GWServerChannelProvider::getChannelProvider ( )
virtual

Implements epics::pvAccess::ChannelFind.

Definition at line 28 of file server.cpp.

29 {
30  return shared_from_this();
31 }
virtual std::string GWServerChannelProvider::getProviderName ( )
inlinevirtual

Get the provider name.

Returns
The name.

Implements epics::pvAccess::ChannelProvider.

Definition at line 23 of file server.h.

23  {
24  return "GWServer";
25  }
GWServerChannelProvider::POINTER_DEFINITIONS ( GWServerChannelProvider  )

Member Data Documentation

ChannelCache GWServerChannelProvider::cache

Definition at line 17 of file server.h.


The documentation for this struct was generated from the following files: