pvaClient is a synchronous wrapper for the pvAccess API, which is a callback based API.
More...
#include "pvaClient.h"
pvaClient is a synchronous wrapper for the pvAccess API, which is a callback based API.
Overview of PvaClient
Definition at line 106 of file pvaClient.h.
epics::pvaClient::PvaClient::~PvaClient |
( |
| ) |
|
Destructor.
Definition at line 148 of file pvaClient.cpp.
150 cout<<
"PvaClient::~PvaClient()\n" 151 <<
"pvaChannel cache:\n";
155 if(
getDebug()) cout<<
"calling ClientFactory::stop()\n";
156 ClientFactory::stop();
157 if(
getDebug()) cout<<
"after calling ClientFactory::stop()\n";
160 if(
getDebug()) cout<<
"calling CAClientFactory::stop()\n";
161 CAClientFactory::stop();
162 if(
getDebug()) cout<<
"after calling CAClientFactory::stop()\n";
164 channelRegistry.reset();
void showCache()
Show the list of cached channels.
static bool getDebug()
Is debug set?
size_t epics::pvaClient::PvaClient::cacheSize |
( |
| ) |
|
Get the number of cached channels.
Definition at line 228 of file pvaClient.cpp.
230 return pvaClientChannelCache->cacheSize();
PvaClientChannelPtr epics::pvaClient::PvaClient::channel |
( |
std::string const & |
channelName, |
|
|
std::string const & |
providerName = "pva" , |
|
|
double |
timeOut = 5.0 |
|
) |
| |
Get a cached channel or create and connect to a new channel.
- Parameters
-
channelName | The channelName. |
providerName | The providerName. |
timeOut | The number of seconds to wait for connection. 0.0 means forever. |
- Returns
- The interface.
- Exceptions
-
runtime_error | if connection fails. |
Definition at line 189 of file pvaClient.cpp.
195 pvaClientChannelCache->getChannel(channelName,providerName);
196 if(pvaClientChannel)
return pvaClientChannel;
198 pvaClientChannel->connect(timeOut);
199 pvaClientChannelCache->addChannel(pvaClientChannel);
200 return pvaClientChannel;
std::tr1::shared_ptr< PvaClientChannel > PvaClientChannelPtr
PvaClientChannelPtr createChannel(std::string const &channelName, std::string const &providerName="pva")
Create an PvaClientChannel with the specified provider.
void epics::pvaClient::PvaClient::clearRequester |
( |
| ) |
|
Clear the requester. PvaClient will handle messages.
Definition at line 213 of file pvaClient.cpp.
const ChannelProcessRequester::weak_pointer requester
Get the requester name.
- Returns
- The name.Create an instance of PvaClient with providerName "pva ca".
-
shared pointer to the single instance
- Deprecated:
- This method will go away in future versions. Use get instead.
Definition at line 113 of file pvaClient.cpp.
PvaClientChannelPtr epics::pvaClient::PvaClient::createChannel |
( |
std::string const & |
channelName, |
|
|
std::string const & |
providerName = "pva" |
|
) |
| |
Create an PvaClientChannel with the specified provider.
- Parameters
-
channelName | The channelName. |
providerName | The provider. |
- Returns
- The interface.
- Exceptions
-
runtime_error | if connection fails. |
Definition at line 203 of file pvaClient.cpp.
205 return PvaClientChannel::create(shared_from_this(),channelName,providerName);
PvaClientPtr epics::pvaClient::PvaClient::get |
( |
std::string const & |
providerNames = "pva ca" | ) |
|
|
static |
Get the single instance of PvaClient.
- Parameters
-
providerNames | Space separated list of provider names. |
- Returns
- shared pointer to the single instance.
Definition at line 102 of file pvaClient.cpp.
std::tr1::shared_ptr< PvaClient > PvaClientPtr
A lock for multithreading.
bool epics::pvaClient::PvaClient::getDebug |
( |
| ) |
|
|
static |
Is debug set?
- Returns
- true or false
Definition at line 97 of file pvaClient.cpp.
string epics::pvaClient::PvaClient::getRequesterName |
( |
| ) |
|
Definition at line 167 of file pvaClient.cpp.
169 static string name(
"pvaClient");
172 return req->getRequesterName();
std::tr1::shared_ptr< Requester > RequesterPtr
const ChannelProcessRequester::weak_pointer requester
void epics::pvaClient::PvaClient::message |
( |
std::string const & |
message, |
|
|
epics::pvData::MessageType |
messageType |
|
) |
| |
A new message.
If a requester is set then it is called otherwise message is displayed on standard out.
- Parameters
-
message | The message. |
messageType | The type. |
Definition at line 177 of file pvaClient.cpp.
183 req->message(
message,messageType);
void message(std::string const &message, epics::pvData::MessageType messageType)
A new message.
epicsShareExtern std::string getMessageTypeName(MessageType messageType)
std::tr1::shared_ptr< Requester > RequesterPtr
const ChannelProcessRequester::weak_pointer requester
epics::pvaClient::PvaClient::POINTER_DEFINITIONS |
( |
PvaClient |
| ) |
|
void epics::pvaClient::PvaClient::setDebug |
( |
bool |
value | ) |
|
|
static |
Should debug info be shown?
- Parameters
-
Definition at line 92 of file pvaClient.cpp.
void epics::pvaClient::PvaClient::setRequester |
( |
epics::pvData::RequesterPtr const & |
requester | ) |
|
Set a requester.
The default is for PvaClient to handle messages by printing to System.out.
- Parameters
-
Definition at line 208 of file pvaClient.cpp.
const ChannelProcessRequester::weak_pointer requester
void epics::pvaClient::PvaClient::showCache |
( |
| ) |
|
Show the list of cached channels.
Definition at line 218 of file pvaClient.cpp.
220 if(pvaClientChannelCache->cacheSize()>=1) {
221 pvaClientChannelCache->showCache();
223 cout <<
"pvaClientChannelCache is empty\n";
The documentation for this class was generated from the following files: