pvaClientCPP 4.8.1
epics::pvaClient::PvaClientChannel Class Reference

An easy to use alternative to directly calling the Channel methods of pvAccess. More...

#include <pv/pvaClient.h>

Inheritance diagram for epics::pvaClient::PvaClientChannel:

Public Member Functions

 POINTER_DEFINITIONS (PvaClientChannel)
 
 ~PvaClientChannel ()
 Destructor.
 
void setStateChangeRequester (PvaClientChannelStateChangeRequesterPtr const &stateChangeRequester)
 Set a client stateChangeRequester.
 
std::string getChannelName ()
 Get the name of the channel to which PvaClientChannel is connected.
 
epics::pvAccess::Channel::shared_pointer getChannel ()
 Get the the channel to which PvaClientChannel is connected.
 
void connect (double timeout=5.0)
 Connect to the channel.
 
void issueConnect ()
 Issue a connect request and return immediately.
 
epics::pvData::Status waitConnect (double timeout=5.0)
 Wait until the connection completes or for timeout.
 
PvaClientProcessPtr createProcess (std::string const &request="")
 First call createRequest as implemented by pvDataCPP and then call the next method.
 
PvaClientProcessPtr createProcess (epics::pvData::PVStructurePtr const &pvRequest)
 
PvaClientGetPtr get (std::string const &request="field(value,alarm,timeStamp)")
 create a PvaChannelGet
 
PvaClientGetPtr createGet (std::string const &request="field(value,alarm,timeStamp)")
 create a PvaClientGet.
 
PvaClientGetPtr createGet (epics::pvData::PVStructurePtr const &pvRequest)
 Creates an PvaClientGet.
 
double getDouble (std::string const &request="field(value)")
 Get the value as a double.
 
std::string getString (std::string const &request="field(value)")
 
epics::pvData::shared_vector< const double > getDoubleArray (std::string const &request="field(value)")
 Get the value as a double array.
 
epics::pvData::shared_vector< const std::string > getStringArray (std::string const &request="field(value)")
 Get the value as a string array.
 
PvaClientPutPtr put (std::string const &request="field(value)")
 create a PvaClientPut.
 
PvaClientPutPtr createPut (std::string const &request="field(value)")
 create a PvaClientPut.
 
PvaClientPutPtr createPut (epics::pvData::PVStructurePtr const &pvRequest)
 Create a PvaClientPut.
 
void putDouble (double value, std::string const &request="field(value)")
 Put the value as a double.
 
void putString (std::string const &value, std::string const &request="field(value)")
 Put the value as a string.
 
void putDoubleArray (epics::pvData::shared_vector< const double > const &value, std::string const &request="field(value)")
 Copy the array to the value field.
 
void putStringArray (epics::pvData::shared_vector< const std::string > const &value, std::string const &request="field(value)")
 Copy array to the value field.
 
void putStringArray (std::vector< std::string > const &value, std::string const &request="field(value)")
 Copy array to the value field.
 
PvaClientPutGetPtr createPutGet (std::string const &request="putField(argument)getField(result)")
 create a PvaClientPutGet.
 
PvaClientPutGetPtr createPutGet (epics::pvData::PVStructurePtr const &pvRequest)
 Create a PvaClientPutGet.
 
PvaClientMonitorPtr monitor (std::string const &request="field(value,alarm,timeStamp)")
 Create a PvaClientMonitor.
 
PvaClientMonitorPtr monitor (PvaClientMonitorRequesterPtr const &pvaClientMonitorRequester)
 Call the next method with request = "field(value,alarm,timeStamp)".
 
PvaClientMonitorPtr monitor (std::string const &request, PvaClientMonitorRequesterPtr const &pvaClientMonitorRequester)
 Create and connect to a new PvaClientMonitor.
 
PvaClientMonitorPtr createMonitor (std::string const &request="field(value,alarm,timeStamp)")
 First call createRequest as implemented by pvDataJava and then call the next method.
 
PvaClientMonitorPtr createMonitor (epics::pvData::PVStructurePtr const &pvRequest)
 
epics::pvData::PVStructurePtr rpc (epics::pvData::PVStructurePtr const &pvRequest, epics::pvData::PVStructurePtr const &pvArgument)
 Issue a channelRPC request.
 
epics::pvData::PVStructurePtr rpc (epics::pvData::PVStructurePtr const &pvArgument)
 Issue a channelRPC request.
 
PvaClientRPCPtr createRPC ()
 Create a PvaClientRPC.
 
PvaClientRPCPtr createRPC (epics::pvData::PVStructurePtr const &pvRequest)
 Create a PvaClientRPC.
 
void showCache ()
 Show the list of cached gets and puts.
 
size_t cacheSize ()
 Get the number of cached gets and puts.
 
virtual std::string getRequesterName ()
 
virtual void message (std::string const &message, epics::pvData::MessageType messageType)
 
virtual void channelCreated (const epics::pvData::Status &status, epics::pvAccess::Channel::shared_pointer const &channel)
 
virtual void channelStateChange (epics::pvAccess::Channel::shared_pointer const &channel, epics::pvAccess::Channel::ConnectionState connectionState)
 

Friends

class PvaClient
 

Detailed Description

An easy to use alternative to directly calling the Channel methods of pvAccess.

Definition at line 231 of file pvaClient.h.

Constructor & Destructor Documentation

◆ ~PvaClientChannel()

epics::pvaClient::PvaClientChannel::~PvaClientChannel ( )

Destructor.

Definition at line 151 of file pvaClientChannel.cpp.

References epics::pvaClient::PvaClient::getDebug(), and showCache().

Member Function Documentation

◆ cacheSize()

size_t epics::pvaClient::PvaClientChannel::cacheSize ( )

Get the number of cached gets and puts.

Definition at line 574 of file pvaClientChannel.cpp.

◆ channelCreated()

void epics::pvaClient::PvaClientChannel::channelCreated ( const epics::pvData::Status & status,
epics::pvAccess::Channel::shared_pointer const & channel )
virtual

Definition at line 161 of file pvaClientChannel.cpp.

References epics::pvaClient::PvaClient::getDebug(), and message().

◆ channelStateChange()

void epics::pvaClient::PvaClientChannel::channelStateChange ( epics::pvAccess::Channel::shared_pointer const & channel,
epics::pvAccess::Channel::ConnectionState connectionState )
virtual

Definition at line 188 of file pvaClientChannel.cpp.

References epics::pvaClient::PvaClient::getDebug().

◆ connect()

void epics::pvaClient::PvaClientChannel::connect ( double timeout = 5.0)

Connect to the channel.

This calls issueConnect and waitConnect.

Parameters
timeoutThe time to wait for connecting to the channel. The defaut is 5 seconds.
Exceptions
runtime_errorif connection fails.

Definition at line 254 of file pvaClientChannel.cpp.

References epics::pvaClient::PvaClient::getDebug(), issueConnect(), message(), and waitConnect().

Referenced by createRPC().

◆ createGet() [1/2]

PvaClientGetPtr epics::pvaClient::PvaClientChannel::createGet ( epics::pvData::PVStructurePtr const & pvRequest)

Creates an PvaClientGet.

Parameters
pvRequestThe syntax of request is defined by the copy facility of pvData.
Returns
The interface.
The interface.
Exceptions
runtime_errorif failure.

◆ createGet() [2/2]

PvaClientGetPtr epics::pvaClient::PvaClientChannel::createGet ( std::string const & request = "field(value,alarm,timeStamp)")

create a PvaClientGet.

First call createRequest as implemented by pvData and then call the next method.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 350 of file pvaClientChannel.cpp.

References createGet(), and message().

Referenced by createGet(), and get().

◆ createMonitor() [1/2]

PvaClientMonitorPtr epics::pvaClient::PvaClientChannel::createMonitor ( epics::pvData::PVStructurePtr const & pvRequest)

Create an PvaClientMonitor.

Parameters
pvRequestThe syntax of pvRequest is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif failure.

◆ createMonitor() [2/2]

PvaClientMonitorPtr epics::pvaClient::PvaClientChannel::createMonitor ( std::string const & request = "field(value,alarm,timeStamp)")

First call createRequest as implemented by pvDataJava and then call the next method.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 506 of file pvaClientChannel.cpp.

References createMonitor(), and message().

Referenced by createMonitor(), monitor(), and monitor().

◆ createProcess() [1/2]

PvaClientProcessPtr epics::pvaClient::PvaClientChannel::createProcess ( epics::pvData::PVStructurePtr const & pvRequest)

Creates a PvaClientProcess.

Parameters
pvRequestThe syntax of pvRequest is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif failure.

◆ createProcess() [2/2]

PvaClientProcessPtr epics::pvaClient::PvaClientChannel::createProcess ( std::string const & request = "")

First call createRequest as implemented by pvDataCPP and then call the next method.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 316 of file pvaClientChannel.cpp.

References createProcess(), and message().

Referenced by createProcess().

◆ createPut() [1/2]

PvaClientPutPtr epics::pvaClient::PvaClientChannel::createPut ( epics::pvData::PVStructurePtr const & pvRequest)

Create a PvaClientPut.

Parameters
pvRequestThe syntax of pvRequest is defined by the copy facility of pvData.
Returns
The interface.

◆ createPut() [2/2]

PvaClientPutPtr epics::pvaClient::PvaClientChannel::createPut ( std::string const & request = "field(value)")

create a PvaClientPut.

First call createRequest as implemented by pvDataJava and then call the next method.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 405 of file pvaClientChannel.cpp.

References createPut(), and message().

Referenced by createPut(), and put().

◆ createPutGet() [1/2]

PvaClientPutGetPtr epics::pvaClient::PvaClientChannel::createPutGet ( epics::pvData::PVStructurePtr const & pvRequest)

Create a PvaClientPutGet.

Parameters
pvRequestThe syntax of pvRequest is defined by the copy facility of pvData.
Returns
The interface.

◆ createPutGet() [2/2]

PvaClientPutGetPtr epics::pvaClient::PvaClientChannel::createPutGet ( std::string const & request = "putField(argument)getField(result)")

create a PvaClientPutGet.

First call createRequest as implemented by pvDataJava and then calls the next method.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 463 of file pvaClientChannel.cpp.

References createPutGet(), and message().

Referenced by createPutGet().

◆ createRPC() [1/2]

PvaClientRPCPtr epics::pvaClient::PvaClientChannel::createRPC ( )

Create a PvaClientRPC.

Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 542 of file pvaClientChannel.cpp.

References connect(), and epics::pvaClient::PvaClientRPC::create().

◆ createRPC() [2/2]

PvaClientRPCPtr epics::pvaClient::PvaClientChannel::createRPC ( epics::pvData::PVStructurePtr const & pvRequest)

Create a PvaClientRPC.

Parameters
pvRequestThe pvRequest that must have the same interface as a pvArgument that is passed to an rpc request.
Returns
The interface.
Exceptions
runtime_errorif failure.

◆ get()

PvaClientGetPtr epics::pvaClient::PvaClientChannel::get ( std::string const & request = "field(value,alarm,timeStamp)")

create a PvaChannelGet

Get a cached PvaClientGet or create and connect to a new PvaClientGet.

Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 337 of file pvaClientChannel.cpp.

References createGet().

Referenced by getDouble(), getDoubleArray(), getString(), and getStringArray().

◆ getChannel()

Channel::shared_pointer epics::pvaClient::PvaClientChannel::getChannel ( )

Get the the channel to which PvaClientChannel is connected.

Returns
The channel interface.

Definition at line 240 of file pvaClientChannel.cpp.

◆ getChannelName()

string epics::pvaClient::PvaClientChannel::getChannelName ( )

Get the name of the channel to which PvaClientChannel is connected.

Returns
The channel name.

Definition at line 235 of file pvaClientChannel.cpp.

◆ getDouble()

double epics::pvaClient::PvaClientChannel::getDouble ( std::string const & request = "field(value)")

Get the value as a double.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The value.
Exceptions
runtime_errorif failure.

Definition at line 370 of file pvaClientChannel.cpp.

References get().

◆ getDoubleArray()

shared_vector< const double > epics::pvaClient::PvaClientChannel::getDoubleArray ( std::string const & request = "field(value)")

Get the value as a double array.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The value.
Exceptions
runtime_errorif failure.

Definition at line 380 of file pvaClientChannel.cpp.

References get().

◆ getRequesterName()

string epics::pvaClient::PvaClientChannel::getRequesterName ( )
virtual

Definition at line 219 of file pvaClientChannel.cpp.

◆ getString()

string epics::pvaClient::PvaClientChannel::getString ( std::string const & request = "field(value)")

Get the value as a string.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The value.
Exceptions
runtime_errorif failure.

Definition at line 375 of file pvaClientChannel.cpp.

References get().

◆ getStringArray()

shared_vector< const std::string > epics::pvaClient::PvaClientChannel::getStringArray ( std::string const & request = "field(value)")

Get the value as a string array.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The value.
Exceptions
runtime_errorif failure.

Definition at line 385 of file pvaClientChannel.cpp.

References get().

◆ issueConnect()

void epics::pvaClient::PvaClientChannel::issueConnect ( )

Issue a connect request and return immediately.

Definition at line 269 of file pvaClientChannel.cpp.

References epics::pvaClient::PvaClient::getDebug().

Referenced by connect().

◆ message()

void epics::pvaClient::PvaClientChannel::message ( std::string const & message,
epics::pvData::MessageType messageType )
virtual

◆ monitor() [1/3]

PvaClientMonitorPtr epics::pvaClient::PvaClientChannel::monitor ( PvaClientMonitorRequesterPtr const & pvaClientMonitorRequester)

Call the next method with request = "field(value,alarm,timeStamp)".

Parameters
pvaClientMonitorRequesterThe client callback.
Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 491 of file pvaClientChannel.cpp.

References monitor().

◆ monitor() [2/3]

PvaClientMonitorPtr epics::pvaClient::PvaClientChannel::monitor ( std::string const & request,
PvaClientMonitorRequesterPtr const & pvaClientMonitorRequester )

Create and connect to a new PvaClientMonitor.

Then call it's start method. If connection can not be made an exception is thrown.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
pvaClientMonitorRequesterThe client callback.
Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 496 of file pvaClientChannel.cpp.

References createMonitor().

◆ monitor() [3/3]

PvaClientMonitorPtr epics::pvaClient::PvaClientChannel::monitor ( std::string const & request = "field(value,alarm,timeStamp)")

Create a PvaClientMonitor.

Create and connect to a new PvaClientMonitor. Then call it's start method. If connection can not be made an exception is thrown.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 483 of file pvaClientChannel.cpp.

References createMonitor().

Referenced by monitor().

◆ POINTER_DEFINITIONS()

epics::pvaClient::PvaClientChannel::POINTER_DEFINITIONS ( PvaClientChannel )

◆ put()

PvaClientPutPtr epics::pvaClient::PvaClientChannel::put ( std::string const & request = "field(value)")

create a PvaClientPut.

Get a cached PvaClientPut or create and connect to a new PvaClientPut. Then call it's get method.

Parameters
requestThe syntax of request is defined by the copy facility of pvData.
Returns
The interface.
Exceptions
runtime_errorif connection fails

Definition at line 391 of file pvaClientChannel.cpp.

References createPut().

Referenced by putDouble(), putDoubleArray(), and putString().

◆ putDouble()

void epics::pvaClient::PvaClientChannel::putDouble ( double value,
std::string const & request = "field(value)" )

Put the value as a double.

Parameters
valueThe new value.
requestThe syntax of request is defined by the copy facility of pvData.
Exceptions
runtime_errorif failure.

Definition at line 425 of file pvaClientChannel.cpp.

References put().

◆ putDoubleArray()

void epics::pvaClient::PvaClientChannel::putDoubleArray ( epics::pvData::shared_vector< const double > const & value,
std::string const & request = "field(value)" )

Copy the array to the value field.

Parameters
valueThe new value.
requestThe syntax of request is defined by the copy facility of pvData.
Exceptions
runtime_errorif failure.

Definition at line 439 of file pvaClientChannel.cpp.

References put().

◆ putString()

void epics::pvaClient::PvaClientChannel::putString ( std::string const & value,
std::string const & request = "field(value)" )

Put the value as a string.

Parameters
valueThe new value.
requestThe syntax of request is defined by the copy facility of pvData.
Exceptions
runtime_errorif failure.

Definition at line 432 of file pvaClientChannel.cpp.

References put().

◆ putStringArray() [1/2]

void epics::pvaClient::PvaClientChannel::putStringArray ( epics::pvData::shared_vector< const std::string > const & value,
std::string const & request = "field(value)" )

Copy array to the value field.

Parameters
valueThe new value.
requestThe syntax of request is defined by the copy facility of pvData.
Exceptions
runtime_errorif failure.

◆ putStringArray() [2/2]

void epics::pvaClient::PvaClientChannel::putStringArray ( std::vector< std::string > const & value,
std::string const & request = "field(value)" )

Copy array to the value field.

Parameters
valueThe data used to update the channel value.
requestThe request as a string to pass to createRequest.
Exceptions
runtime_errorif failure.

◆ rpc() [1/2]

epics::pvData::PVStructurePtr epics::pvaClient::PvaClientChannel::rpc ( epics::pvData::PVStructurePtr const & pvArgument)

Issue a channelRPC request.

Parameters
pvArgumentThe argument for the request.
Returns
The result.
Exceptions
runtime_errorif failure.

◆ rpc() [2/2]

epics::pvData::PVStructurePtr epics::pvaClient::PvaClientChannel::rpc ( epics::pvData::PVStructurePtr const & pvRequest,
epics::pvData::PVStructurePtr const & pvArgument )

Issue a channelRPC request.

Parameters
pvRequestThe pvRequest that is passed to createRPC.
pvArgumentThe argument for a request.
Returns
The result.
Exceptions
runtime_errorif failure.

◆ setStateChangeRequester()

void epics::pvaClient::PvaClientChannel::setStateChangeRequester ( PvaClientChannelStateChangeRequesterPtr const & stateChangeRequester)

Set a client stateChangeRequester.

Parameters
stateChangeRequesterThe client stateChangeRequester implementation.

Definition at line 245 of file pvaClientChannel.cpp.

◆ showCache()

void epics::pvaClient::PvaClientChannel::showCache ( )

Show the list of cached gets and puts.

Definition at line 558 of file pvaClientChannel.cpp.

Referenced by ~PvaClientChannel().

◆ waitConnect()

Status epics::pvaClient::PvaClientChannel::waitConnect ( double timeout = 5.0)

Wait until the connection completes or for timeout.

Parameters
timeoutThe time in seconds to wait. A value of 0 means forever.
Returns
status.

Definition at line 295 of file pvaClientChannel.cpp.

References epics::pvaClient::PvaClient::getDebug().

Referenced by connect().

Friends And Related Symbol Documentation

◆ PvaClient

friend class PvaClient
friend

Definition at line 534 of file pvaClient.h.


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