pva2pva 1.4.2
Loading...
Searching...
No Matches
TestPVChannel Struct Reference
Inheritance diagram for TestPVChannel:
Collaboration diagram for TestPVChannel:

Public Types

typedef weak_set< TestPVMonitor > monitors_t
Public Types inherited from BaseChannel
typedef epicsGuard< epicsMutex > guard_t

Public Member Functions

 POINTER_DEFINITIONS (TestPVChannel)
 TestPVChannel (const std::tr1::shared_ptr< TestPV > &pv, const std::tr1::shared_ptr< epics::pvAccess::ChannelRequester > &req)
virtual std::string getRemoteAddress () OVERRIDE FINAL
virtual ConnectionState getConnectionState () OVERRIDE FINAL
virtual void getField (epics::pvAccess::GetFieldRequester::shared_pointer const &requester, std::string const &subField) OVERRIDE FINAL
virtual epics::pvData::Monitor::shared_pointer createMonitor (epics::pvData::MonitorRequester::shared_pointer const &monitorRequester, epics::pvData::PVStructure::shared_pointer const &pvRequest) OVERRIDE FINAL
Public Member Functions inherited from BaseChannel
 BaseChannel (const std::string &name, const std::tr1::weak_ptr< epics::pvAccess::ChannelProvider > &prov, const epics::pvAccess::ChannelRequester::shared_pointer &req, const epics::pvData::StructureConstPtr &dtype)
virtual std::string getRequesterName () OVERRIDE
virtual void destroy () OVERRIDE FINAL
virtual std::tr1::shared_ptr< epics::pvAccess::ChannelProvider > getProvider () OVERRIDE FINAL
virtual std::string getChannelName () OVERRIDE FINAL
virtual std::tr1::shared_ptr< epics::pvAccess::ChannelRequester > getChannelRequester () OVERRIDE FINAL
virtual void printInfo (std::ostream &out) OVERRIDE

Public Attributes

std::tr1::weak_ptr< TestPVChannel > weakself
const std::tr1::shared_ptr< TestPV > pv
ConnectionState state
monitors_t monitors
Public Attributes inherited from BaseChannel
epicsMutex lock
const std::string pvname
const epics::pvAccess::ChannelProvider::weak_pointer provider
const requester_type::weak_pointer requester
const epics::pvData::StructureConstPtr fielddesc

Detailed Description

Definition at line 190 of file utilities.h.

Member Typedef Documentation

◆ monitors_t

typedef weak_set<TestPVMonitor> TestPVChannel::monitors_t

Definition at line 199 of file utilities.h.

Constructor & Destructor Documentation

◆ TestPVChannel()

TestPVChannel::TestPVChannel ( const std::tr1::shared_ptr< TestPV > & pv,
const std::tr1::shared_ptr< epics::pvAccess::ChannelRequester > & req )

Definition at line 220 of file utilities.cpp.

222 :BaseChannel(pv->name, pv->provider, req, pv->dtype)
223 ,pv(pv)
224 ,state(CONNECTED)
225{
226 epicsAtomicIncrSizeT(&countTestPVChannel);
227}

◆ ~TestPVChannel()

TestPVChannel::~TestPVChannel ( )
virtual

Definition at line 229 of file utilities.cpp.

230{
231 epicsAtomicDecrSizeT(&countTestPVChannel);
232}

Member Function Documentation

◆ createMonitor()

pvd::Monitor::shared_pointer TestPVChannel::createMonitor ( epics::pvData::MonitorRequester::shared_pointer const & monitorRequester,
epics::pvData::PVStructure::shared_pointer const & pvRequest )
virtual

Definition at line 249 of file utilities.cpp.

252{
253 shared_pointer self(weakself);
254 TestPVMonitor::shared_pointer ret(new TestPVMonitor(self, requester, 2));
255 {
256 Guard G(pv->lock);
257 monitors.insert(ret);
258 static_cast<TestPVMonitor*>(ret.get())->weakself = ret; // save wrapped weak ref
259 }
260 testDiag("TestPVChannel::createMonitor %s %p", pv->name.c_str(), ret.get());
261 requester->monitorConnect(pvd::Status(), ret, pv->dtype);
262 return ret;
263}

◆ getConnectionState()

TestPVChannel::ConnectionState TestPVChannel::getConnectionState ( )
virtual

Definition at line 234 of file utilities.cpp.

235{
236 Guard G(pv->lock);
237 return state;
238}

◆ getField()

void TestPVChannel::getField ( epics::pvAccess::GetFieldRequester::shared_pointer const & requester,
std::string const & subField )
virtual

Reimplemented from BaseChannel.

Definition at line 240 of file utilities.cpp.

241{
242 Guard G(pv->lock);
243
244 //TODO subField?
245 requester->getDone(pvd::Status(), pv->dtype);
246}

◆ getRemoteAddress()

virtual std::string TestPVChannel::getRemoteAddress ( )
inlinevirtual

Reimplemented from BaseChannel.

Definition at line 206 of file utilities.h.

207 { return "localhost:1234"; }

Member Data Documentation

◆ monitors

monitors_t TestPVChannel::monitors

Definition at line 200 of file utilities.h.

◆ pv

const std::tr1::shared_ptr<TestPV> TestPVChannel::pv

Definition at line 196 of file utilities.h.

◆ state

ConnectionState TestPVChannel::state

Definition at line 197 of file utilities.h.

◆ weakself

std::tr1::weak_ptr<TestPVChannel> TestPVChannel::weakself

Definition at line 194 of file utilities.h.


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