This is Unofficial EPICS BASE Doxygen Site
TestPVChannel Struct Reference

#include "utilities.h"

+ Inheritance diagram for TestPVChannel:
+ Collaboration diagram for TestPVChannel:

Public Types

typedef weak_set< TestPVMonitormonitors_t
 
- Public Types inherited from BaseChannel
typedef epicsGuard< epicsMutex > guard_t
 
- Public Types inherited from epics::pvAccess::Channel
enum  ConnectionState { NEVER_CONNECTED, CONNECTED, DISCONNECTED, DESTROYED }
 
typedef ChannelRequester requester_type
 

Public Member Functions

 POINTER_DEFINITIONS (TestPVChannel)
 
 TestPVChannel (const std::tr1::shared_ptr< TestPV > &pv, const std::tr1::shared_ptr< epics::pvAccess::ChannelRequester > &req)
 
virtual ~TestPVChannel ()
 
virtual std::string getRemoteAddress ()
 
virtual ConnectionState getConnectionState ()
 
virtual void getField (epics::pvAccess::GetFieldRequester::shared_pointer const &requester, std::string const &subField)
 
virtual epics::pvData::Monitor::shared_pointer createMonitor (epics::pvData::MonitorRequester::shared_pointer const &monitorRequester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 
- 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 ~BaseChannel ()
 
virtual std::string getRequesterName () OVERRIDE
 
virtual void destroy () OVERRIDE FINAL
 
virtual std::tr1::shared_ptr< epics::pvAccess::ChannelProvidergetProvider () OVERRIDE FINAL
 
virtual std::string getChannelName () OVERRIDE FINAL
 
virtual std::tr1::shared_ptr< epics::pvAccess::ChannelRequestergetChannelRequester () OVERRIDE FINAL
 
virtual void printInfo (std::ostream &out) OVERRIDE
 
- Public Member Functions inherited from epics::pvAccess::Channel
 POINTER_DEFINITIONS (Channel)
 
 Channel ()
 
virtual ~Channel ()
 
virtual void message (std::string const &message, epics::pvData::MessageType messageType)
 
virtual bool isConnected ()
 
virtual void getField (GetFieldRequester::shared_pointer const &requester, std::string const &subField)
 
virtual AccessRights getAccessRights (epics::pvData::PVField::shared_pointer const &pvField)
 
virtual ChannelProcess::shared_pointer createChannelProcess (ChannelProcessRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 
virtual ChannelGet::shared_pointer createChannelGet (ChannelGetRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 
virtual ChannelPut::shared_pointer createChannelPut (ChannelPutRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 
virtual ChannelPutGet::shared_pointer createChannelPutGet (ChannelPutGetRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 
virtual ChannelRPC::shared_pointer createChannelRPC (ChannelRPCRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 
virtual Monitor::shared_pointer createMonitor (MonitorRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 
virtual ChannelArray::shared_pointer createChannelArray (ChannelArrayRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 
virtual void printInfo ()
 
- Public Member Functions inherited from epics::pvAccess::Requester
 POINTER_DEFINITIONS (Requester)
 
virtual ~Requester ()
 
virtual void message (std::string const &message, MessageType messageType=errorMessage)
 
- Public Member Functions inherited from epics::pvAccess::Destroyable
 POINTER_DEFINITIONS (Destroyable)
 

Public Attributes

std::tr1::weak_ptr< TestPVChannelweakself
 
const std::tr1::shared_ptr< TestPVpv
 
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
 

Additional Inherited Members

- Static Public Attributes inherited from epics::pvAccess::Channel
static size_t num_instances
 
static const char * ConnectionStateNames [] = { "NEVER_CONNECTED", "CONNECTED", "DISCONNECTED", "DESTROYED" }
 
- Protected Member Functions inherited from epics::pvAccess::Destroyable
virtual ~Destroyable ()
 

Detailed Description

Definition at line 184 of file utilities.h.

Member Typedef Documentation

Definition at line 193 of file utilities.h.

Constructor & Destructor Documentation

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 }
ConnectionState state
Definition: utilities.h:191
Definition: tool_lib.h:67
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)
Definition: pvahelper.h:21
const std::tr1::shared_ptr< TestPV > pv
Definition: utilities.h:190
char * name
Definition: tool_lib.h:69
EPICS_ATOMIC_INLINE size_t epicsAtomicIncrSizeT(size_t *pTarget)
TestPVChannel::~TestPVChannel ( )
virtual

Definition at line 229 of file utilities.cpp.

230 {
231  epicsAtomicDecrSizeT(&countTestPVChannel);
232 }
EPICS_ATOMIC_INLINE size_t epicsAtomicDecrSizeT(size_t *pTarget)

Member Function Documentation

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 }
monitors_t monitors
Definition: utilities.h:194
Definition: tool_lib.h:67
int testDiag(const char *fmt,...)
std::tr1::weak_ptr< TestPVChannel > weakself
Definition: utilities.h:188
const requester_type::weak_pointer requester
Definition: pvahelper.h:35
char * name
Definition: tool_lib.h:69
void insert(value_pointer &)
Definition: weakset.h:227
TestPVChannel::ConnectionState TestPVChannel::getConnectionState ( )
virtual

Poll the connection state in more detail

Reimplemented from epics::pvAccess::Channel.

Definition at line 234 of file utilities.cpp.

235 {
236  Guard G(pv->lock);
237  return state;
238 }
ConnectionState state
Definition: utilities.h:191
Definition: tool_lib.h:67
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 }
Definition: tool_lib.h:67
const requester_type::weak_pointer requester
Definition: pvahelper.h:35
virtual std::string TestPVChannel::getRemoteAddress ( )
inlinevirtual

Returns the channel's remote address, signal name, etc... For example:

  • client side channel would return server's address, e.g. "/192.168.1.101:5064"
  • server side channel would return underlying bus address, e.g. "#C0 S1".

The value returned here will changed depending on the connection status. A disconnected channel should return an empty() string.

Reimplemented from BaseChannel.

Definition at line 200 of file utilities.h.

200 { return "localhost:1234"; }
TestPVChannel::POINTER_DEFINITIONS ( TestPVChannel  )

Member Data Documentation

monitors_t TestPVChannel::monitors

Definition at line 194 of file utilities.h.

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

Definition at line 190 of file utilities.h.

ConnectionState TestPVChannel::state

Definition at line 191 of file utilities.h.

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

Definition at line 188 of file utilities.h.


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