pvAccessCPP 7.1.8
Loading...
Searching...
No Matches
epics::pvAccess::Channel Class Referenceabstract

The interface through which Operations (get, put, monitor, ...) are initiated. More...

#include <client/pv/pvAccess.h>

Inheritance diagram for epics::pvAccess::Channel:
Collaboration diagram for epics::pvAccess::Channel:

Public Types

enum  ConnectionState { NEVER_CONNECTED , CONNECTED , DISCONNECTED , DESTROYED }
 Channel connection status. More...
 
typedef std::tr1::shared_ptr< Channelshared_pointer
 
typedef std::tr1::shared_ptr< const Channelconst_shared_pointer
 
typedef std::tr1::weak_ptr< Channelweak_pointer
 
typedef std::tr1::weak_ptr< const Channelconst_weak_pointer
 
typedef ChannelRequester requester_type
 

Public Member Functions

virtual std::string getRequesterName ()
 The requester must have a name.
 
virtual void message (std::string const &message, epics::pvData::MessageType messageType)
 
virtual std::tr1::shared_ptr< ChannelProvidergetProvider ()=0
 The ChannelProvider from which this Channel was requested.
 
virtual std::string getRemoteAddress ()=0
 Returns the channel's remote address, signal name, etc... For example:
 
virtual ConnectionState getConnectionState ()
 Poll the connection state in more detail.
 
virtual std::string getChannelName ()=0
 The name passed to ChannelProvider::createChannel()
 
virtual std::tr1::shared_ptr< ChannelRequestergetChannelRequester ()=0
 The ChannelRequester passed to ChannelProvider::createChannel()
 
virtual bool isConnected ()
 Poll connection state.
 
virtual void getField (GetFieldRequester::shared_pointer const &requester, std::string const &subField)
 Initiate a request to retrieve a description of the structure of this Channel.
 
virtual AccessRights getAccessRights (epics::pvData::PVField::shared_pointer const &pvField)
 Not useful...
 
virtual ChannelProcess::shared_pointer createChannelProcess (ChannelProcessRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 Initiate a request for a Process action.
 
virtual ChannelGet::shared_pointer createChannelGet (ChannelGetRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 Initiate a request for a Get action.
 
virtual ChannelPut::shared_pointer createChannelPut (ChannelPutRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 Initiate a request for a Put action.
 
virtual ChannelPutGet::shared_pointer createChannelPutGet (ChannelPutGetRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 Initiate a request for a PutGet action.
 
virtual ChannelRPC::shared_pointer createChannelRPC (ChannelRPCRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 Initiate a request for a RPC action.
 
virtual Monitor::shared_pointer createMonitor (MonitorRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 Initiate a request for a Monitor action.
 
virtual ChannelArray::shared_pointer createChannelArray (ChannelArrayRequester::shared_pointer const &requester, epics::pvData::PVStructure::shared_pointer const &pvRequest)
 Initiate a request for a Array (get) action.
 
virtual void printInfo ()
 Prints detailed information about the context to the standard output stream.
 
virtual void printInfo (std::ostream &out)
 Prints detailed information about the context to the specified output stream.
 
virtual void message (std::string const &message, MessageType messageType=errorMessage)
 Push notification.
 
virtual void destroy ()
 Destroy this instance.
 

Static Public Attributes

static size_t num_instances
 
static const char * ConnectionStateNames []
 

Detailed Description

The interface through which Operations (get, put, monitor, ...) are initiated.

Handle for a Channel returned by ChannelProvider::createChannel()

At any given moment a Channel may be CONNECTED or DISCONNECTED. (NEVER_CONNECTED and DESTORYED are special cases of DISCONNECTED)

A Channel is required to honor calls to Channel::create*() methods while in the disconnected state.

A Channel is required to maintain a strong reference (shared_ptr<>) to the ChannelProvider through which it was created.

Definition at line 886 of file pvAccess.h.

Member Typedef Documentation

◆ const_shared_pointer

std::tr1::shared_ptr<const Channel> epics::pvAccess::Channel::const_shared_pointer

Definition at line 892 of file pvAccess.h.

◆ const_weak_pointer

std::tr1::weak_ptr<const Channel> epics::pvAccess::Channel::const_weak_pointer

Definition at line 892 of file pvAccess.h.

◆ requester_type

◆ shared_pointer

std::tr1::shared_ptr<Channel> epics::pvAccess::Channel::shared_pointer

Definition at line 892 of file pvAccess.h.

◆ weak_pointer

std::tr1::weak_ptr<Channel> epics::pvAccess::Channel::weak_pointer

Definition at line 892 of file pvAccess.h.

Member Enumeration Documentation

◆ ConnectionState

Channel connection status.

Definition at line 906 of file pvAccess.h.

Member Function Documentation

◆ createChannelArray()

virtual ChannelArray::shared_pointer epics::pvAccess::Channel::createChannelArray ( ChannelArrayRequester::shared_pointer const & requester,
epics::pvData::PVStructure::shared_pointer const & pvRequest )
virtual

Initiate a request for a Array (get) action.

ChannelArrayRequester::channelArrayConnect() may be called before createChannelArray() returns, or at some time afterwards.

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

Precondition
The Channel need not be CONNECTED
Postcondition
The returned ChannelArray will hold a strong reference to the provided MonitorRequester.
Returned shared_ptr<ChannelArray> will have unique()==true.
Returns
A non-NULL ChannelArray unless channelArrayConnect() called with an Error

Create a ChannelArray.

Parameters
channelArrayRequesterThe ChannelArrayRequester
pvRequestAdditional options (e.g. triggering).
Returns
ChannelArray instance.
Note
The default implementation yields a not implemented error

◆ createChannelGet()

virtual ChannelGet::shared_pointer epics::pvAccess::Channel::createChannelGet ( ChannelGetRequester::shared_pointer const & requester,
epics::pvData::PVStructure::shared_pointer const & pvRequest )
virtual

Initiate a request for a Get action.

ChannelGetRequester::channelGetConnect() may be called before createChannelGet() 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 ChannelGet will hold a strong reference to the provided ChannelGetRequester.
Returned shared_ptr<ChannelGet> will have unique()==true.
Returns
A non-NULL ChannelGet unless channelGetConnect() called with an Error
Note
The default implementation proxies to createChannelPut()

◆ createChannelProcess()

virtual ChannelProcess::shared_pointer epics::pvAccess::Channel::createChannelProcess ( ChannelProcessRequester::shared_pointer const & requester,
epics::pvData::PVStructure::shared_pointer const & pvRequest )
virtual

Initiate a request for a Process action.

ChannelProcessRequester::channelProcessConnect() may be called before createChannelProcess() 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 ChannelProcess will hold a strong reference to the provided ChannelProcessRequester.
Returned shared_ptr<ChannelProcess> will have unique()==true.
Returns
A non-NULL ChannelProcess unless channelProcessConnect() called with an Error
Note
The default implementation proxies using createChannelPut() and ChannelPut::put() with no data (empty bit set)

◆ createChannelPut()

virtual ChannelPut::shared_pointer epics::pvAccess::Channel::createChannelPut ( ChannelPutRequester::shared_pointer const & requester,
epics::pvData::PVStructure::shared_pointer const & pvRequest )
virtual

Initiate a request for a Put action.

ChannelPutRequester::channelPutConnect() may be called before createChannelPut() 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 ChannelPut will hold a strong reference to the provided ChannelPutRequester.
Returned shared_ptr<ChannelPut> will have unique()==true.
Returns
A non-NULL ChannelPut unless channelPutConnect() called with an Error
Note
The default implementation yields a not implemented error

◆ createChannelPutGet()

virtual ChannelPutGet::shared_pointer epics::pvAccess::Channel::createChannelPutGet ( ChannelPutGetRequester::shared_pointer const & requester,
epics::pvData::PVStructure::shared_pointer const & pvRequest )
virtual

Initiate a request for a PutGet action.

ChannelPutGetRequester::channelPutGetConnect() may be called before createChannelPutGet() 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 ChannelPutGet will hold a strong reference to the provided ChannelPutGetRequester.
Returned shared_ptr<ChannelPutGet> will have unique()==true.
Returns
A non-NULL ChannelPutGet unless channelPutGetConnect() called with an Error
Note
The default implementation yields a not implemented error

◆ createChannelRPC()

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

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

◆ createMonitor()

virtual Monitor::shared_pointer epics::pvAccess::Channel::createMonitor ( MonitorRequester::shared_pointer const & requester,
epics::pvData::PVStructure::shared_pointer const & pvRequest )
virtual

Initiate a request for a Monitor action.

MonitorRequester::channelMonitorConnect() may be called before createMonitor() returns, or at some time afterwards.

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

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

◆ destroy()

virtual void epics::pvAccess::Destroyable::destroy ( )
inlinevirtualinherited

Destroy this instance.

Reimplemented in epics::pvAccess::MonitorFIFO.

Definition at line 30 of file destroyable.h.

◆ getAccessRights()

virtual AccessRights epics::pvAccess::Channel::getAccessRights ( epics::pvData::PVField::shared_pointer const & pvField)
virtual

Not useful...

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

◆ getChannelRequester()

virtual std::tr1::shared_ptr< ChannelRequester > epics::pvAccess::Channel::getChannelRequester ( )
pure virtual

The ChannelRequester passed to ChannelProvider::createChannel()

Exceptions
std::tr1::bad_weak_ptr

◆ getField()

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

Initiate a request to retrieve a description of the structure of this Channel.

While the type described by calls to getField() should match what is provided for all operations except RPC.

GetFieldRequester::getDone() will be called before getField() returns, or at some time afterwards.

Parameters
RequesterThe Requester.
subFieldEmpty string, or the field name of a sub-structure.

◆ getProvider()

virtual std::tr1::shared_ptr< ChannelProvider > epics::pvAccess::Channel::getProvider ( )
pure virtual

The ChannelProvider from which this Channel was requested.

May never be NULL.

◆ getRemoteAddress()

virtual std::string epics::pvAccess::Channel::getRemoteAddress ( )
pure virtual

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.

◆ getRequesterName()

virtual std::string epics::pvAccess::Channel::getRequesterName ( )
virtual

The requester must have a name.

Returns
The requester's name.

Implements epics::pvAccess::Requester.

◆ printInfo() [1/2]

virtual void epics::pvAccess::Channel::printInfo ( )
inlinevirtual

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

Definition at line 1126 of file pvAccess.h.

◆ printInfo() [2/2]

virtual void epics::pvAccess::Channel::printInfo ( std::ostream & out)
inlinevirtual

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

Parameters
outthe output stream.

Definition at line 1132 of file pvAccess.h.

Member Data Documentation

◆ ConnectionStateNames

const char* epics::pvAccess::Channel::ConnectionStateNames[]
static

Definition at line 910 of file pvAccess.h.

◆ num_instances

size_t epics::pvAccess::Channel::num_instances
static

Definition at line 895 of file pvAccess.h.


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