pvAccessCPP 7.1.9
Loading...
Searching...
No Matches
pvac::ClientChannel Class Reference

Represents a single channel. More...

#include <client/pva/client.h>

Classes

struct  Options
 Channel creation options. More...
struct  GetCallback
 callback for get() and rpc() More...
struct  PutCallback
 callbacks for put() More...
struct  MonitorCallback
 Monitor event notification. More...
struct  ConnectCallback
 Connection state change CB. More...

Public Member Functions

 ClientChannel ()
 Construct a null channel. All methods throw. May later be assigned from a valid ClientChannel.
 ClientChannel (const std::tr1::shared_ptr< epics::pvAccess::ChannelProvider > &provider, const std::string &name, const Options &opt=Options())
 Construct a ClientChannel using epics::pvAccess::ChannelProvider::createChannel().
std::string name () const
 Channel name or an empty string.
bool valid () const
 operator bool_type () const
void reset ()
Operation get (GetCallback *cb, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer())
epics::pvData::PVStructure::const_shared_pointer get (double timeout=3.0, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer())
Operation rpc (GetCallback *cb, const epics::pvData::PVStructure::const_shared_pointer &arguments, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer())
epics::pvData::PVStructure::const_shared_pointer rpc (double timeout, const epics::pvData::PVStructure::const_shared_pointer &arguments, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer())
Operation put (PutCallback *cb, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer(), bool getprevious=false)
detail::PutBuilder put (const epics::pvData::PVStructure::const_shared_pointer &pvRequest=epics::pvData::PVStructure::const_shared_pointer())
 Synchronious put operation.
Monitor monitor (MonitorCallback *cb, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer())
MonitorSync monitor (const epics::pvData::PVStructure::const_shared_pointer &pvRequest=epics::pvData::PVStructure::const_shared_pointer(), epicsEvent *event=0)
 Begin subscription w/o callbacks.
Operation info (InfoCallback *cb, const std::string &subfld=std::string())
epics::pvData::FieldConstPtr info (double timeout=3.0, const std::string &subfld=std::string())
 Synchronious getField opreation.
void addConnectListener (ConnectCallback *)
void removeConnectListener (ConnectCallback *)
 Remove from list of listeners.
void show (std::ostream &strm) const

Friends

class ClientProvider
void detail::registerRefTrack ()

Detailed Description

Represents a single channel.

This class has two sets of methods, those which block for completion, and those which use callbacks to signal completion.

Those which block accept a 'timeout' argument (in seconds).

Those which use callbacks accept a 'cb' argument and return an Operation or Monitor handle object.

Definition at line 266 of file client.h.

Constructor & Destructor Documentation

◆ ClientChannel() [1/2]

pvac::ClientChannel::ClientChannel ( )
inline

Construct a null channel. All methods throw. May later be assigned from a valid ClientChannel.

Definition at line 290 of file client.h.

◆ ClientChannel() [2/2]

pvac::ClientChannel::ClientChannel ( const std::tr1::shared_ptr< epics::pvAccess::ChannelProvider > & provider,
const std::string & name,
const Options & opt = Options() )

Construct a ClientChannel using epics::pvAccess::ChannelProvider::createChannel().

Does not block.

Exceptions
std::logic_errorif the provider is NULL or name is an empty string
std::runtime_errorif the ChannelProvider can't provide

Member Function Documentation

◆ addConnectListener()

void pvac::ClientChannel::addConnectListener ( ConnectCallback * )

Append to list of listeners

Parameters
cbChannel dis/connect notification callback. Must outlive ClientChannel or call to removeConnectListener()

◆ get() [1/2]

epics::pvData::PVStructure::const_shared_pointer pvac::ClientChannel::get ( double timeout = 3.0,
epics::pvData::PVStructure::const_shared_pointer pvRequest = epics::pvData::PVStructure::const_shared_pointer() )

Block and retrieve current PV value

Parameters
timeoutin seconds
pvRequestif NULL defaults to "field()".
Exceptions
Timeoutor std::runtime_error

◆ get() [2/2]

Operation pvac::ClientChannel::get ( GetCallback * cb,
epics::pvData::PVStructure::const_shared_pointer pvRequest = epics::pvData::PVStructure::const_shared_pointer() )

Issue request to retrieve current PV value

Parameters
cbCompletion notification callback. Must outlive Operation (call Operation::cancel() to force release)
pvRequestif NULL defaults to "field()".

◆ info()

Operation pvac::ClientChannel::info ( InfoCallback * cb,
const std::string & subfld = std::string() )

Request PV type info.

Note
This type may not be the same as the types used in the get/put/monitor operations.

◆ monitor() [1/2]

MonitorSync pvac::ClientChannel::monitor ( const epics::pvData::PVStructure::const_shared_pointer & pvRequest = epics::pvData::PVStructure::const_shared_pointer(),
epicsEvent * event = 0 )

Begin subscription w/o callbacks.

Parameters
eventIf not NULL, then subscription events are signaled to this epicsEvent. Use MonitorSync::test() to see if a subscription has an event waiting. Otherwise an internal epicsEvent is allocated for use with MonitorSync::wait()
Note
For simple usage with a single MonitorSync, pass event=NULL and call MonitorSync::wait(). If more than one MonitorSync is being created, then pass a custom epicsEvent and use MonitorSync::test() to find which subscriptions have events pending.

◆ monitor() [2/2]

Monitor pvac::ClientChannel::monitor ( MonitorCallback * cb,
epics::pvData::PVStructure::const_shared_pointer pvRequest = epics::pvData::PVStructure::const_shared_pointer() )

Begin subscription

Parameters
cbCompletion notification callback. Must outlive Monitor (call Monitor::cancel() to force release)

◆ operator bool_type()

pvac::ClientChannel::operator bool_type ( ) const
inline

Definition at line 313 of file client.h.

◆ put()

Operation pvac::ClientChannel::put ( PutCallback * cb,
epics::pvData::PVStructure::const_shared_pointer pvRequest = epics::pvData::PVStructure::const_shared_pointer(),
bool getprevious = false )

Initiate request to change PV

Parameters
cbCompletion notification callback. Must outlive Operation (call Operation::cancel() to force release)
pvRequestif NULL defaults to "field()".
getpreviousIf true, fetch a previous value of the PV and make this available as PutCallback::Args::previous and previousmask. If false, then previous=NULL

◆ reset()

void pvac::ClientChannel::reset ( )
inline

Definition at line 316 of file client.h.

◆ rpc() [1/2]

epics::pvData::PVStructure::const_shared_pointer pvac::ClientChannel::rpc ( double timeout,
const epics::pvData::PVStructure::const_shared_pointer & arguments,
epics::pvData::PVStructure::const_shared_pointer pvRequest = epics::pvData::PVStructure::const_shared_pointer() )

Block and execute remote call

Parameters
timeoutin seconds
argumentsencoded call arguments
pvRequestif NULL defaults to "field()".

◆ rpc() [2/2]

Operation pvac::ClientChannel::rpc ( GetCallback * cb,
const epics::pvData::PVStructure::const_shared_pointer & arguments,
epics::pvData::PVStructure::const_shared_pointer pvRequest = epics::pvData::PVStructure::const_shared_pointer() )

Start an RPC call

Parameters
cbCompletion notification callback. Must outlive Operation (call Operation::cancel() to force release)
argumentsencoded call arguments
pvRequestif NULL defaults to "field()".

◆ valid()

bool pvac::ClientChannel::valid ( ) const
inline

Definition at line 305 of file client.h.

◆ ClientProvider

friend class ClientProvider
friend

Definition at line 275 of file client.h.


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