doc changes; add additional create method for RPC

This commit is contained in:
mrkraimer
2016-07-18 13:05:15 -04:00
parent bf42a5c22d
commit b5d4d178f5
7 changed files with 350 additions and 559 deletions
+232 -171
View File
File diff suppressed because it is too large Load Diff
+57 -53
View File
@@ -62,7 +62,7 @@ class epicsShareClass PvaClientMultiChannel :
{
public:
POINTER_DEFINITIONS(PvaClientMultiChannel);
/** Create a PvaClientMultiChannel.
/** @brief Create a PvaClientMultiChannel.
* @param pvaClient The interface to pvaClient.
* @param channelNames The names of the channel..
* @param providerName The name of the provider.
@@ -76,69 +76,70 @@ public:
size_t maxNotConnected=0
);
/**
* Destructor
* @brief Destructor
*/
~PvaClientMultiChannel();
/** Get the channelNames.
/** @brief Get the channelNames.
* @return The names.
*/
epics::pvData::shared_vector<const std::string> getChannelNames();
/** Connect to the channels.
/** @brief Connect to the channels.
*
* This calls issueConnect and waitConnect.
* An exception is thrown if connect fails.
* @param timeout The time to wait for connecting to the channel.
* @return status of request
*/
epics::pvData::Status connect(double timeout=5);
/** Are all channels connected?
/** @brief Are all channels connected?
* @return if all are connected.
*/
bool allConnected();
/** Has a connection state change occured?
/** @brief Has a connection state change occured?
* @return (true, false) if (at least one, no) channel has changed state.
*/
bool connectionChange();
/** Get the connection state of each channel.
/** @brief Get the connection state of each channel.
* @return The state of each channel.
*/
epics::pvData::shared_vector<epics::pvData::boolean> getIsConnected();
/** Get the pvaClientChannelArray.
/** @brief Get the pvaClientChannelArray.
* @return The shared pointer.
*/
PvaClientChannelArray getPvaClientChannelArray();
/** Get pvaClient.
/** @brief Get pvaClient.
* @return The shared pointer.
*/
PvaClientPtr getPvaClient();
/**
* create a pvaClientMultiGetDouble
* @brief create a pvaClientMultiGetDouble
* @return The interface.
*/
PvaClientMultiGetDoublePtr createGet();
/**
* create a pvaClientMultiPutDouble
* @brief Create a pvaClientMultiPutDouble.
* @return The interface.
*/
PvaClientMultiPutDoublePtr createPut();
/**
* Create a pvaClientMultiMonitorDouble.
* @brief Create a pvaClientMultiMonitorDouble.
* @return The interface.
*/
PvaClientMultiMonitorDoublePtr createMonitor();
/**
* Create a pvaClientNTMultiPut.
* @brief Create a pvaClientNTMultiPut.
* @return The interface.
*/
PvaClientNTMultiPutPtr createNTPut();
/**
* Create a pvaClientNTMultiGet;
* @brief Create a pvaClientNTMultiGet;
* @param request The request for each channel.
* @return The interface.
*/
PvaClientNTMultiGetPtr createNTGet(
std::string const &request = "field(value,alarm,timeStamp)");
/**
* Create a pvaClientNTMultiPut.
* @brief Create a pvaClientNTMultiPut.
* @param request The request for each channel.
* @return The interface.
*/
@@ -181,7 +182,7 @@ public:
POINTER_DEFINITIONS(PvaClientMultiGetDouble);
/**
* Factory method that creates a PvaClientMultiGetDouble.
* @brief Create a PvaClientMultiGetDouble.
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
* @param pvaClientChannelArray The PvaClientChannel array.
* @return The interface.
@@ -193,15 +194,15 @@ public:
~PvaClientMultiGetDouble();
/**
* Create a channelGet for each channel.
*/
* @brief Create a channelGet for each channel.
*/
void connect();
/**
* get the data.
* @brief Get the data.
* @return The double[] where each element is the value field of the corresponding channel.
*/
epics::pvData::shared_vector<double> get();
/** Get the shared pointer to self.
/** @brief Get the shared pointer to self.
* @return The shared pointer.
*/
PvaClientMultiGetDoublePtr getPtrSelf()
@@ -237,7 +238,7 @@ class epicsShareClass PvaClientMultiPutDouble :
public:
POINTER_DEFINITIONS(PvaClientMultiPutDouble);
/** Factory method that creates a PvaClientMultiPutDouble.
/** @brief Create a PvaClientMultiPutDouble.
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
* @param pvaClientChannelArray The PvaClientChannel array.
* @return The interface.
@@ -247,14 +248,14 @@ public:
PvaClientChannelArray const &pvaClientChannelArray);
~PvaClientMultiPutDouble();
/**
* Create a channelPut for each channel.
* @brief Create a channelPut for each channel.
*/
void connect();
/** put data to each channel as a double
/** @brief put data to each channel as a double
* @param data The array of data for each channel.
*/
void put(epics::pvData::shared_vector<double> const &data);
/** Get the shared pointer to self.
/** @brief Get the shared pointer to self.
* @return The shared pointer.
*/
PvaClientMultiPutDoublePtr getPtrSelf()
@@ -289,7 +290,7 @@ class epicsShareClass PvaClientMultiMonitorDouble :
public:
POINTER_DEFINITIONS(PvaClientMultiMonitorDouble);
/** Factory method that creates a PvaClientMultiMonitorDouble.
/** @brief Create a PvaClientMultiMonitorDouble.
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
* @param pvaClientChannelArray The PvaClientChannel array.
* @return The interface.
@@ -299,17 +300,18 @@ public:
PvaClientChannelArray const &pvaClientChannelArray);
~PvaClientMultiMonitorDouble();
/**
* Create a channel monitor for each channel.
*/
* @brief Connect a channel monitor for each channel.
*/
void connect();
/**
* poll each channel.
* @brief Poll each channel.
*
* If any has new data it is used to update the double[].
* @return (false,true) if (no, at least one) value was updated.
*/
bool poll();
/**
* Wait until poll returns true.
* @brief Wait until poll returns true.
* @param secondsToWait The time to keep trying.
* A thread sleep of .1 seconds occurs between each call to poll.
* @return (false,true) if (timeOut, poll returned true).
@@ -320,7 +322,7 @@ public:
* @return The double[] where each element is the value field of the corresponding channel.
*/
epics::pvData::shared_vector<double> get();
/** Monitor the shared pointer to self.
/** @brief Monitor the shared pointer to self.
* @return The shared pointer.
*/
PvaClientMultiMonitorDoublePtr getPtrSelf()
@@ -356,7 +358,7 @@ class epicsShareClass PvaClientNTMultiGet :
public:
POINTER_DEFINITIONS(PvaClientNTMultiGet);
/**
* Factory method that creates a PvaClientNTMultiGet.
* @brief Create a PvaClientNTMultiGet.
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
* @param pvaClientChannelArray The PvaClientChannel array.
* @param pvRequest The pvRequest for each channel.
@@ -369,19 +371,19 @@ public:
~PvaClientNTMultiGet();
/**
* Create a channelGet for each channel.
*/
* @brief Connect a channelGet for each channel.
*/
void connect();
/**
* get data for each channel.
* @brief Get each channel.
*/
void get();
/**
* get the data.
* @brief Get the data from the last get.
* @return the pvaClientNTMultiData.
*/
PvaClientNTMultiDataPtr getData();
/** Get the shared pointer to self.
/** @brief Get the shared pointer to self.
* @return The shared pointer.
*/
PvaClientNTMultiGetPtr getPtrSelf()
@@ -421,7 +423,7 @@ class epicsShareClass PvaClientNTMultiPut :
public:
POINTER_DEFINITIONS(PvaClientNTMultiPut);
/**
* Factory method that creates a PvaClientNTMultiPut.
* @brief Create a PvaClientNTMultiPut.
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
* @param pvaClientChannelArray The PvaClientChannel array.
* @return The interface.
@@ -432,19 +434,19 @@ public:
~PvaClientNTMultiPut();
/**
* Create a channelPut for each channel.
* @brief Connect a channelPut for each channel.
*/
void connect();
/**
* get the value field of each channel as a union.
* @brief Get the value field of each channel as a union.
* @return A shared vector of union.
*/
epics::pvData::shared_vector<epics::pvData::PVUnionPtr> getValues();
/**
* put the data to each channel.
* @brief Issue a put for each channel.
' */
void put();
/** Get the shared pointer to self.
/** @brief Get the shared pointer to self.
* @return The shared pointer.
*/
PvaClientNTMultiPutPtr getPtrSelf()
@@ -480,7 +482,7 @@ class epicsShareClass PvaClientNTMultiMonitor :
public:
POINTER_DEFINITIONS(PvaClientNTMultiMonitor);
/** Factory method that creates a PvaClientNTMultiMonitor.
/** @brief Create a PvaClientNTMultiMonitor.
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
* @param pvaClientChannelArray The PvaClientChannel array.
* @param pvRequest The pvRequest for each channel.
@@ -492,24 +494,25 @@ public:
epics::pvData::PVStructurePtr const & pvRequest);
~PvaClientNTMultiMonitor();
/**
* Create a channel monitor for each channel.
* @brief Connect to a channel monitor for each channel.
*/
void connect();
/**
* poll each channel.
* @brief Poll each channel.
*
* If any has new data it is used to update the double[].
* @return (false,true) if (no, at least one) value was updated.
*/
bool poll();
/**
* Wait until poll returns true.
* @brief Wait until poll returns true.
* @param secondsToWait The time to keep trying.
* A thread sleep of .1 seconds occurs between each call to poll.
* @return (false,true) if (timeOut, poll returned true).
*/
bool waitEvent(double secondsToWait);
/**
* get the data.
* @brief Get the data for the last successfull poll.
* @return the pvaClientNTMultiData.
*/
PvaClientNTMultiDataPtr getData();
@@ -551,7 +554,8 @@ class epicsShareClass PvaClientNTMultiData :
public:
POINTER_DEFINITIONS(PvaClientNTMultiData);
/**
* Factory method that creates a PvaClientNTMultiData.
* @brief Create a PvaClientNTMultiData.
*
* Normally only called by PvaClientNTMultiGet and PvaClientNTMultiMonitor.
* @param u The union interface for the value field of each channel.
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
@@ -566,31 +570,31 @@ public:
~PvaClientNTMultiData();
/**
* Get the number of channels.
* @brief Get the number of channels.
* @return The number of channels.
*/
size_t getNumber();
/**
* Set the timeStamp base for computing deltaTimes.
* @brief Set the timeStamp base for computing deltaTimes.
*/
void startDeltaTime();
/**
* Update NTMultiChannel fields.
* @brief Update NTMultiChannel fields.
*/
void endDeltaTime();
/**
* Get the time when the last get was made.
* @brief Get the time when the last get was made.
* @return The timeStamp.
*/
epics::pvData::TimeStamp getTimeStamp();
/**
* Get the NTMultiChannel.
* @brief Get the NTMultiChannel.
* @return The value.
*/
epics::nt::NTMultiChannelPtr getNTMultiChannel();
/** Get the shared pointer to self.
/** @brief Get the shared pointer to self.
* @return The shared pointer.
*/
PvaClientNTMultiDataPtr getPtrSelf()
+9 -1
View File
@@ -547,9 +547,17 @@ PVStructurePtr PvaClientChannel::rpc(
PVStructurePtr PvaClientChannel::rpc(
PVStructurePtr const & pvArgument)
{
return rpc(pvArgument,pvArgument);
PvaClientRPCPtr rpc = createRPC();
return rpc->request(pvArgument);
}
PvaClientRPCPtr PvaClientChannel::createRPC()
{
if(connectState!=connected) connect(5.0);
PvaClientPtr yyy = pvaClient.lock();
if(!yyy) throw std::runtime_error("PvaClient was destroyed");
return PvaClientRPC::create(yyy,channel);
}
PvaClientRPCPtr PvaClientChannel::createRPC(PVStructurePtr const & pvRequest)
{
+8 -1
View File
@@ -72,7 +72,14 @@ public:
}
};
PvaClientRPCPtr PvaClientRPC::create(
PvaClientPtr const &pvaClient,
Channel::shared_pointer const & channel)
{
StructureConstPtr structure(getFieldCreate()->createStructure());
PVStructurePtr pvRequest(getPVDataCreate()->createPVStructure(structure));
return create(pvaClient,channel,pvRequest);
}
PvaClientRPCPtr PvaClientRPC::create(
PvaClientPtr const &pvaClient,
Channel::shared_pointer const & channel,