pvaClientCPP  4.8.1-dev
Public Member Functions | Static Public Member Functions | Friends | List of all members
epics::pvaClient::PvaClientMonitor Class Reference

An easy to use alternative to Monitor. More...

#include <pv/pvaClient.h>

Inheritance diagram for epics::pvaClient::PvaClientMonitor:
epics::pvaClient::PvaClientChannelStateChangeRequester epics::pvaClient::PvaClientMonitorRequester

Public Member Functions

 POINTER_DEFINITIONS (PvaClientMonitor)
 
 ~PvaClientMonitor ()
 Destructor. More...
 
void connect ()
 Call issueConnect and then waitConnect. More...
 
void issueConnect ()
 Issue the channelMonitor connection to the channel. More...
 
epics::pvData::Status waitConnect ()
 Wait until the channelMonitor connection to the channel is complete. More...
 
void setRequester (PvaClientMonitorRequesterPtr const &pvaClientMonitorRequester)
 Set a user callback. More...
 
void start ()
 Start monitoring. More...
 
void start (const std::string &request)
 Start or restart the monitor with a new request. More...
 
void stop ()
 Stop monitoring. More...
 
bool poll ()
 Poll for a monitor event. More...
 
bool waitEvent (double secondsToWait=0.0)
 Wait for a monitor event. More...
 
void releaseEvent ()
 Release the monitorElement returned by poll. More...
 
PvaClientChannelPtr getPvaClientChannel ()
 Get the PvaClientChannel;. More...
 
PvaClientMonitorDataPtr getData ()
 The data in which monitor events are placed. More...
 
void channelStateChange (PvaClientChannelPtr const &channel, bool isConnected)
 A channel connection state change has occurred. More...
 
void event (PvaClientMonitorPtr const &monitor)
 A monitor event has occurred. More...
 
 POINTER_DEFINITIONS (PvaClientChannelStateChangeRequester)
 
 POINTER_DEFINITIONS (PvaClientMonitorRequester)
 
virtual void monitorConnect (epics::pvData::Status const &status, PvaClientMonitorPtr const &monitor, epics::pvData::StructureConstPtr const &structure)
 The server has returned a message that the monitor is connected. More...
 
virtual void unlisten ()
 The data source is no longer available. More...
 

Static Public Member Functions

static PvaClientMonitorPtr create (PvaClientPtr const &pvaClient, PvaClientChannelPtr const &pvaClientChannel, epics::pvData::PVStructurePtr const &pvRequest)
 Create a PvaClientMonitor. More...
 
static PvaClientMonitorPtr create (PvaClientPtr const &pvaClient, std::string const &channelName, std::string const &providerName, std::string const &request, PvaClientChannelStateChangeRequesterPtr const &stateChangeRequester=PvaClientChannelStateChangeRequesterPtr(), PvaClientMonitorRequesterPtr const &monitorRequester=PvaClientMonitorRequesterPtr()) EPICS_DEPRECATED
 Create a PvaClientMonitor. More...
 

Friends

class MonitorRequesterImpl
 

Detailed Description

An easy to use alternative to Monitor.

Definition at line 1512 of file pvaClient.h.

Constructor & Destructor Documentation

◆ ~PvaClientMonitor()

epics::pvaClient::PvaClientMonitor::~PvaClientMonitor ( )

Destructor.

Definition at line 139 of file pvaClientMonitor.cpp.

Member Function Documentation

◆ channelStateChange()

void epics::pvaClient::PvaClientMonitor::channelStateChange ( PvaClientChannelPtr const &  channel,
bool  isConnected 
)
virtual

A channel connection state change has occurred.

Warning A call to a method that blocks should not be made by this method.

Parameters
channelThe channel.
isConnectedThe new connection status.

Implements epics::pvaClient::PvaClientChannelStateChangeRequester.

Definition at line 151 of file pvaClientMonitor.cpp.

◆ connect()

void epics::pvaClient::PvaClientMonitor::connect ( )

Call issueConnect and then waitConnect.

An exception is thrown if connect fails.

Definition at line 299 of file pvaClientMonitor.cpp.

◆ create() [1/2]

static PvaClientMonitorPtr epics::pvaClient::PvaClientMonitor::create ( PvaClientPtr const &  pvaClient,
PvaClientChannelPtr const &  pvaClientChannel,
epics::pvData::PVStructurePtr const &  pvRequest 
)
static

Create a PvaClientMonitor.

Parameters
pvaClientInterface to PvaClient
pvaClientChannelInterface to PvaClientChannel
pvRequestThe request structure.
Returns
The interface to the PvaClientMonitor.

◆ create() [2/2]

PvaClientMonitorPtr epics::pvaClient::PvaClientMonitor::create ( PvaClientPtr const &  pvaClient,
std::string const &  channelName,
std::string const &  providerName,
std::string const &  request,
PvaClientChannelStateChangeRequesterPtr const &  stateChangeRequester = PvaClientChannelStateChangeRequesterPtr(),
PvaClientMonitorRequesterPtr const &  monitorRequester = PvaClientMonitorRequesterPtr() 
)
static

Create a PvaClientMonitor.

Parameters
pvaClientInterface to PvaClient
channelNamechannel name
providerNameprovider name
requestThe request.
stateChangeRequesterThe state change requester. Can be null.
monitorRequesterThe monitor requester. Can be null;
Returns
The new instance.
Deprecated:
client can create PvaClientMonitor on first channel connect.

Definition at line 90 of file pvaClientMonitor.cpp.

◆ event()

void epics::pvaClient::PvaClientMonitor::event ( PvaClientMonitorPtr const &  monitor)
virtual

A monitor event has occurred.

Parameters
monitorThe PvaClientMonitor that received the event.

Implements epics::pvaClient::PvaClientMonitorRequester.

Definition at line 170 of file pvaClientMonitor.cpp.

◆ getData()

PvaClientMonitorDataPtr epics::pvaClient::PvaClientMonitor::getData ( )

The data in which monitor events are placed.

Returns
The interface.

Definition at line 477 of file pvaClientMonitor.cpp.

◆ getPvaClientChannel()

PvaClientChannelPtr epics::pvaClient::PvaClientMonitor::getPvaClientChannel ( )

Get the PvaClientChannel;.

Returns
The interface.

Definition at line 472 of file pvaClientMonitor.cpp.

◆ issueConnect()

void epics::pvaClient::PvaClientMonitor::issueConnect ( )

Issue the channelMonitor connection to the channel.

This can only be called once. An exception is thrown if connect fails.

Exceptions
runtime_errorif failure.

Definition at line 312 of file pvaClientMonitor.cpp.

◆ monitorConnect()

virtual void epics::pvaClient::PvaClientMonitorRequester::monitorConnect ( epics::pvData::Status const &  status,
PvaClientMonitorPtr const &  monitor,
epics::pvData::StructureConstPtr const &  structure 
)
inlinevirtualinherited

The server has returned a message that the monitor is connected.

Parameters
statusCompletion status.
monitorThe monitor
structureThe structure defining the data.

Definition at line 1482 of file pvaClient.h.

◆ POINTER_DEFINITIONS() [1/3]

epics::pvaClient::PvaClientChannelStateChangeRequester::POINTER_DEFINITIONS ( PvaClientChannelStateChangeRequester  )
inherited

◆ POINTER_DEFINITIONS() [2/3]

epics::pvaClient::PvaClientMonitorRequester::POINTER_DEFINITIONS ( PvaClientMonitorRequester  )
inherited

◆ POINTER_DEFINITIONS() [3/3]

epics::pvaClient::PvaClientMonitor::POINTER_DEFINITIONS ( PvaClientMonitor  )

◆ poll()

bool epics::pvaClient::PvaClientMonitor::poll ( )

Poll for a monitor event.

The data will be in PvaClientData.

Returns
(false,true) means event (did not, did) occur.

Definition at line 418 of file pvaClientMonitor.cpp.

◆ releaseEvent()

void epics::pvaClient::PvaClientMonitor::releaseEvent ( )

Release the monitorElement returned by poll.

Definition at line 456 of file pvaClientMonitor.cpp.

◆ setRequester()

void epics::pvaClient::PvaClientMonitor::setRequester ( PvaClientMonitorRequesterPtr const &  pvaClientMonitorRequester)

Set a user callback.

Parameters
pvaClientMonitorRequesterThe requester which must be implemented by the caller.

Definition at line 341 of file pvaClientMonitor.cpp.

◆ start() [1/2]

void epics::pvaClient::PvaClientMonitor::start ( )

Start monitoring.

Definition at line 351 of file pvaClientMonitor.cpp.

◆ start() [2/2]

void epics::pvaClient::PvaClientMonitor::start ( const std::string &  request)

Start or restart the monitor with a new request.

Parameters
requestThe new request.

Definition at line 372 of file pvaClientMonitor.cpp.

◆ stop()

void epics::pvaClient::PvaClientMonitor::stop ( )

Stop monitoring.

Definition at line 406 of file pvaClientMonitor.cpp.

◆ unlisten()

virtual void epics::pvaClient::PvaClientMonitorRequester::unlisten ( )
inlinevirtualinherited

The data source is no longer available.

Definition at line 1495 of file pvaClient.h.

◆ waitConnect()

Status epics::pvaClient::PvaClientMonitor::waitConnect ( )

Wait until the channelMonitor connection to the channel is complete.

Returns
status;

Definition at line 325 of file pvaClientMonitor.cpp.

◆ waitEvent()

bool epics::pvaClient::PvaClientMonitor::waitEvent ( double  secondsToWait = 0.0)

Wait for a monitor event.

The data will be in PvaClientData.

Parameters
secondsToWaitTime to wait for event.
Returns
(false,true) means event (did not, did) occur.

Definition at line 433 of file pvaClientMonitor.cpp.

Friends And Related Function Documentation

◆ MonitorRequesterImpl

friend class MonitorRequesterImpl
friend

Definition at line 1651 of file pvaClient.h.


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