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

Member Function Documentation

◆ cacheSize()

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

Get the number of cached gets and puts.

Definition at line 573 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.

◆ channelStateChange()

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

Definition at line 187 of file pvaClientChannel.cpp.

◆ 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 253 of file pvaClientChannel.cpp.

◆ createGet() [1/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 349 of file pvaClientChannel.cpp.

◆ createGet() [2/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.

◆ createMonitor() [1/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 505 of file pvaClientChannel.cpp.

◆ createMonitor() [2/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.

◆ createProcess() [1/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 315 of file pvaClientChannel.cpp.

◆ createProcess() [2/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.

◆ createPut() [1/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 404 of file pvaClientChannel.cpp.

◆ createPut() [2/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.

◆ createPutGet() [1/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 462 of file pvaClientChannel.cpp.

◆ createPutGet() [2/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.

◆ createRPC() [1/2]

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

Create a PvaClientRPC.

Returns
The interface.
Exceptions
runtime_errorif failure.

Definition at line 541 of file pvaClientChannel.cpp.

◆ 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 336 of file pvaClientChannel.cpp.

◆ getChannel()

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

Get the the channel to which PvaClientChannel is connected.

Returns
The channel interface.

Definition at line 239 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 234 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 369 of file pvaClientChannel.cpp.

◆ 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 379 of file pvaClientChannel.cpp.

◆ getRequesterName()

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

Definition at line 218 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 374 of file pvaClientChannel.cpp.

◆ 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 384 of file pvaClientChannel.cpp.

◆ issueConnect()

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

Issue a connect request and return immediately.

Definition at line 268 of file pvaClientChannel.cpp.

◆ message()

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

Definition at line 225 of file pvaClientChannel.cpp.

◆ monitor() [1/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 482 of file pvaClientChannel.cpp.

◆ monitor() [2/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 490 of file pvaClientChannel.cpp.

◆ monitor() [3/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 495 of file pvaClientChannel.cpp.

◆ 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 390 of file pvaClientChannel.cpp.

◆ 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 424 of file pvaClientChannel.cpp.

◆ 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 438 of file pvaClientChannel.cpp.

◆ 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 431 of file pvaClientChannel.cpp.

◆ 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 &  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.

◆ rpc() [2/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.

◆ setStateChangeRequester()

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

Set a client stateChangeRequester.

Parameters
stateChangeRequesterThe client stateChangeRequester implementation.

Definition at line 244 of file pvaClientChannel.cpp.

◆ showCache()

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

Show the list of cached gets and puts.

Definition at line 557 of file pvaClientChannel.cpp.

◆ 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 294 of file pvaClientChannel.cpp.

Friends And Related Function 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: