pvAccessCPP
7.1.7
|
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::ostream & | operator<< (::std::ostream &strm, const ClientChannel &op) |
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.
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.
std::logic_error | if the provider is NULL or name is an empty string |
std::runtime_error | if the ChannelProvider can't provide |
void pvac::ClientChannel::addConnectListener | ( | ConnectCallback * | ) |
Append to list of listeners.
cb | Channel 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.
cb | Completion notification callback. Must outlive Operation (call Operation::cancel() to force release) |
pvRequest | if 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.
timeout | in seconds |
pvRequest | if NULL defaults to "field()". |
Timeout | or std::runtime_error |
Operation pvac::ClientChannel::info | ( | InfoCallback * | cb, |
const std::string & | subfld = std::string() |
||
) |
Request PV type info.
Monitor pvac::ClientChannel::monitor | ( | MonitorCallback * | cb, |
epics::pvData::PVStructure::const_shared_pointer | pvRequest = epics::pvData::PVStructure::const_shared_pointer() |
||
) |
Begin subscription.
cb | Completion 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.
event | If 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() |
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.
cb | Completion notification callback. Must outlive Operation (call Operation::cancel() to force release) |
pvRequest | if NULL defaults to "field()". |
getprevious | If 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.
cb | Completion notification callback. Must outlive Operation (call Operation::cancel() to force release) |
arguments | encoded call arguments |
pvRequest | if 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.
timeout | in seconds |
arguments | encoded call arguments |
pvRequest | if NULL defaults to "field()". |