9 #include <epicsMutex.h>
10 #include <epicsTimer.h>
12 #include <pv/pvAccess.h>
25 static size_t num_instances;
30 const size_t bufferSize;
33 inline epicsMutex& mutex()
const {
return interested.
mutex(); }
35 typedef std::vector<epicsUInt8> pvrequest_t;
42 epics::pvData::StructureConstPtr typedesc;
46 epics::pvData::MonitorElement::shared_pointer
lastelem;
47 epics::pvData::MonitorPtr mon;
48 epics::pvData::Status startresult;
56 virtual void monitorConnect(epics::pvData::Status
const & status,
57 epics::pvData::MonitorPtr
const & monitor,
58 epics::pvData::StructureConstPtr
const & structure);
59 virtual void monitorEvent(epics::pvData::MonitorPtr
const & monitor);
60 virtual void unlisten(epics::pvData::MonitorPtr
const & monitor);
62 virtual std::string getRequesterName();
68 static size_t num_instances;
71 inline epicsMutex& mutex()
const {
return entry->mutex(); }
73 MonitorCacheEntry::shared_pointer entry;
74 epics::pvData::MonitorRequester::weak_pointer req;
75 std::tr1::weak_ptr<GWChannel> srvchan;
85 std::deque<epics::pvData::MonitorElementPtr> filled, empty;
86 std::set<epics::pvData::MonitorElementPtr> inuse;
88 epics::pvData::MonitorElementPtr overflowElement;
90 MonitorUser(
const MonitorCacheEntry::shared_pointer&);
93 virtual void destroy();
95 virtual epics::pvData::Status start();
96 virtual epics::pvData::Status stop();
97 virtual epics::pvData::MonitorElementPtr poll();
98 virtual void release(epics::pvData::MonitorElementPtr
const & monitorElement);
100 virtual std::string getRequesterName();
106 static size_t num_instances;
108 const std::string channelName;
112 inline epicsMutex& mutex()
const {
return interested.
mutex(); }
115 epics::pvAccess::Channel::shared_pointer channel;
116 epics::pvAccess::ChannelRequester::shared_pointer requester;
123 typedef MonitorCacheEntry::pvrequest_t pvrequest_t;
134 static size_t num_instances;
136 CRequester(
const ChannelCacheEntry::shared_pointer& p);
138 ChannelCacheEntry::weak_pointer chan;
140 virtual std::string getRequesterName();
142 virtual void channelCreated(
const epics::pvData::Status& status,
143 epics::pvAccess::Channel::shared_pointer
const & channel);
144 virtual void channelStateChange(epics::pvAccess::Channel::shared_pointer
const & channel,
145 epics::pvAccess::Channel::ConnectionState connectionState);
153 typedef std::map<std::string, ChannelCacheEntry::shared_pointer > entries_t;
156 epicsMutex cacheLock;
160 epics::pvAccess::ChannelProvider::shared_pointer provider;
162 epicsTimerQueueActive *timerQueue;
163 epicsTimer *cleanTimer;
169 ChannelCache(
const epics::pvAccess::ChannelProvider::shared_pointer& prov);
172 ChannelCacheEntry::shared_pointer lookup(
const std::string& name);
175 #endif // CHANCACHE_H
epics::pvData::MonitorElement::shared_pointer lastelem
epicsMutex & mutex() const