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

Public Member Functions

 POINTER_DEFINITIONS (RPCChannel)
 
 RPCChannel (ChannelProvider::shared_pointer const &provider, string const &channelName, ChannelRequester::shared_pointer const &channelRequester, RPCServiceAsync::shared_pointer const &rpcService)
 
virtual ~RPCChannel ()
 
virtual std::tr1::shared_ptr< ChannelProvidergetProvider ()
 
virtual std::string getRemoteAddress ()
 
virtual ConnectionState getConnectionState ()
 
virtual std::string getChannelName ()
 
virtual std::tr1::shared_ptr< ChannelRequestergetChannelRequester ()
 
virtual AccessRights getAccessRights (epics::pvData::PVField::shared_pointer const &)
 
virtual ChannelRPC::shared_pointer createChannelRPC (ChannelRPCRequester::shared_pointer const &channelRPCRequester, epics::pvData::PVStructure::shared_pointer const &)
 
virtual void printInfo (std::ostream &out)
 
virtual string getRequesterName ()
 
virtual void destroy ()
 
- 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 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 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)
 

Additional Inherited Members

- Public Types inherited from epics::pvAccess::Channel
enum  ConnectionState { NEVER_CONNECTED, CONNECTED, DISCONNECTED, DESTROYED }
 
typedef ChannelRequester requester_type
 
- 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 117 of file rpcServer.cpp.

Constructor & Destructor Documentation

epics::pvAccess::RPCChannel::RPCChannel ( ChannelProvider::shared_pointer const &  provider,
string const &  channelName,
ChannelRequester::shared_pointer const &  channelRequester,
RPCServiceAsync::shared_pointer const &  rpcService 
)
inline

Definition at line 134 of file rpcServer.cpp.

138  :
139  m_provider(provider),
140  m_channelName(channelName),
141  m_channelRequester(channelRequester),
142  m_rpcService(rpcService)
143  {
144  }
virtual epics::pvAccess::RPCChannel::~RPCChannel ( )
inlinevirtual

Definition at line 146 of file rpcServer.cpp.

147  {
148  destroy();
149  }

Member Function Documentation

virtual ChannelRPC::shared_pointer epics::pvAccess::RPCChannel::createChannelRPC ( ChannelRPCRequester::shared_pointer const &  requester,
epics::pvData::PVStructure::shared_pointer const &  pvRequest 
)
inlinevirtual

Initiate a request for a RPC action.

ChannelRPCRequester::channelRPCConnect() may be called before createChannelRPC() returns, or at some time afterwards.

Failure is indicated by a call to channelProcessConnect with !Error::isOk()

Precondition
The Channel need not be CONNECTED
Postcondition
The returned ChannelRPC will hold a strong reference to the provided ChannelRPCRequester.
Returned shared_ptr<ChannelRPC> will have unique()==true.
Returns
A non-NULL ChannelRPC unless channelRPCConnect() called with an Error
Note
The default implementation yields a not implemented error

Reimplemented from epics::pvAccess::Channel.

Definition at line 184 of file rpcServer.cpp.

187  {
188  // nothing expected to be in pvRequest
189 
190  if (channelRPCRequester.get() == 0)
191  throw std::invalid_argument("channelRPCRequester == null");
192 
193  if (m_destroyed.get())
194  {
195  ChannelRPC::shared_pointer nullPtr;
196  channelRPCRequester->channelRPCConnect(epics::pvData::Status(epics::pvData::Status::STATUSTYPE_ERROR, "channel destroyed"), nullPtr);
197  return nullPtr;
198  }
199 
200  // TODO use std::make_shared
201  std::tr1::shared_ptr<ChannelRPCServiceImpl> tp(
202  new ChannelRPCServiceImpl(shared_from_this(), channelRPCRequester, m_rpcService)
203  );
204  ChannelRPC::shared_pointer channelRPCImpl = tp;
205  channelRPCRequester->channelRPCConnect(Status::Ok, channelRPCImpl);
206  return channelRPCImpl;
207  }
static Status Ok
Definition: status.h:47
virtual void epics::pvAccess::RPCChannel::destroy ( )
inlinevirtual

Destroy this instance.

Implements epics::pvAccess::Destroyable.

Definition at line 223 of file rpcServer.cpp.

224  {
225  m_destroyed.set();
226  }
virtual AccessRights epics::pvAccess::RPCChannel::getAccessRights ( epics::pvData::PVField::shared_pointer const &  pvField)
inlinevirtual

Not useful...

Parameters
pvFieldThe field for which access rights is desired.
Returns
The access rights.

Reimplemented from epics::pvAccess::Channel.

Definition at line 179 of file rpcServer.cpp.

180  {
181  return none;
182  }
virtual std::string epics::pvAccess::RPCChannel::getChannelName ( )
inlinevirtual

The name passed to ChannelProvider::createChannel()

Implements epics::pvAccess::Channel.

Definition at line 169 of file rpcServer.cpp.

170  {
171  return m_channelName;
172  }
virtual std::tr1::shared_ptr<ChannelRequester> epics::pvAccess::RPCChannel::getChannelRequester ( )
inlinevirtual

The ChannelRequester passed to ChannelProvider::createChannel()

Exceptions
std::tr1::bad_weak_ptr

Implements epics::pvAccess::Channel.

Definition at line 174 of file rpcServer.cpp.

175  {
176  return m_channelRequester;
177  }
virtual ConnectionState epics::pvAccess::RPCChannel::getConnectionState ( )
inlinevirtual

Poll the connection state in more detail

Reimplemented from epics::pvAccess::Channel.

Definition at line 162 of file rpcServer.cpp.

virtual std::tr1::shared_ptr<ChannelProvider> epics::pvAccess::RPCChannel::getProvider ( )
inlinevirtual

The ChannelProvider from which this Channel was requested. May never be NULL.

Implements epics::pvAccess::Channel.

Definition at line 151 of file rpcServer.cpp.

152  {
153  return m_provider;
154  }
virtual std::string epics::pvAccess::RPCChannel::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.

Implements epics::pvAccess::Channel.

Definition at line 156 of file rpcServer.cpp.

157  {
158  // local
159  return getChannelName();
160  }
virtual std::string getChannelName()
Definition: rpcServer.cpp:169
virtual string epics::pvAccess::RPCChannel::getRequesterName ( )
inlinevirtual

The requester must have a name.

Returns
The requester's name.

Reimplemented from epics::pvAccess::Channel.

Definition at line 218 of file rpcServer.cpp.

219  {
220  return getChannelName();
221  }
virtual std::string getChannelName()
Definition: rpcServer.cpp:169
epics::pvAccess::RPCChannel::POINTER_DEFINITIONS ( RPCChannel  )
virtual void epics::pvAccess::RPCChannel::printInfo ( std::ostream &  out)
inlinevirtual

Prints detailed information about the context to the specified output stream.

Parameters
outthe output stream.

Reimplemented from epics::pvAccess::Channel.

Definition at line 209 of file rpcServer.cpp.

210  {
211  out << "RPCChannel: ";
212  out << getChannelName();
213  out << " [";
215  out << "]";
216  }
static const char * ConnectionStateNames[]
Definition: pvAccess.h:910
virtual ConnectionState getConnectionState()
Definition: rpcServer.cpp:162
virtual std::string getChannelName()
Definition: rpcServer.cpp:169

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