pvAccessCPP  7.1.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | Friends | List of all members
pvac::ClientChannel Class Reference

Represents a single channel. More...

#include <client/pva/client.h>

Classes

struct  ConnectCallback
 Connection state change CB. More...
 
struct  GetCallback
 callback for get() and rpc() More...
 
struct  MonitorCallback
 Monitor event notification. More...
 
struct  Options
 Channel creation options. More...
 
struct  PutCallback
 callbacks for put() 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() More...
 
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())
 Issue request to retrieve current PV value. More...
 
epics::pvData::PVStructure::const_shared_pointer get (double timeout=3.0, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer())
 Block and retrieve current PV value. More...
 
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())
 Start an RPC call. More...
 
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())
 Block and execute remote call. More...
 
Operation put (PutCallback *cb, epics::pvData::PVStructure::const_shared_pointer pvRequest=epics::pvData::PVStructure::const_shared_pointer(), bool getprevious=false)
 Initiate request to change PV. More...
 
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())
 Begin subscription. More...
 
MonitorSync monitor (const epics::pvData::PVStructure::const_shared_pointer &pvRequest=epics::pvData::PVStructure::const_shared_pointer(), epicsEvent *event=0)
 Begin subscription w/o callbacks. More...
 
Operation info (InfoCallback *cb, const std::string &subfld=std::string())
 Request PV type info. More...
 
epics::pvData::FieldConstPtr info (double timeout=3.0, const std::string &subfld=std::string())
 Synchronious getField opreation.
 
void addConnectListener (ConnectCallback *)
 Append to list of listeners. More...
 
void removeConnectListener (ConnectCallback *)
 Remove from list of listeners.
 
void show (std::ostream &strm) const
 

Friends

class ClientProvider
 
void detail::registerRefTrack ()
 
friend::std::ostreamoperator<< (::std::ostream &strm, const ClientChannel &op)
 

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

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

void pvac::ClientChannel::addConnectListener ( ConnectCallback )

Append to list of listeners.

Parameters
cbChannel dis/connect notification callback. Must outlive ClientChannel or call to removeConnectListener()
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()".
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
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 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)
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.
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
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()".
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()".

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