pvRequest == 0 check

This commit is contained in:
Matej Sekoranja
2011-02-15 11:29:36 +01:00
parent 163d5a88fb
commit a8abd07282

View File

@@ -95,6 +95,7 @@ namespace epics {
static Status* destroyedStatus;
static Status* channelNotConnected;
static Status* otherRequestPendingStatus;
static Status* pvRequestNull;
BaseRequestImpl(ChannelImpl* channel, Requester* requester) :
m_channel(channel), m_context(channel->getContext()),
@@ -284,6 +285,7 @@ namespace epics {
Status* BaseRequestImpl::destroyedStatus = getStatusCreate()->createStatus(STATUSTYPE_ERROR, "request destroyed");
Status* BaseRequestImpl::channelNotConnected = getStatusCreate()->createStatus(STATUSTYPE_ERROR, "channel not connected");
Status* BaseRequestImpl::otherRequestPendingStatus = getStatusCreate()->createStatus(STATUSTYPE_ERROR, "other request pending");
Status* BaseRequestImpl::pvRequestNull = getStatusCreate()->createStatus(STATUSTYPE_ERROR, "pvRequest == 0");
@@ -314,7 +316,7 @@ namespace epics {
{
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelProcess);
// TODO check for 0s!!!!
// pvRequest can be null
// TODO best-effort support
@@ -433,6 +435,12 @@ namespace epics {
m_data(0), m_bitSet(0)
{
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelGet);
if (pvRequest == 0)
{
EXCEPTION_GUARD(m_channelGetRequester->channelGetConnect(pvRequestNull, 0, 0, 0));
return;
}
// TODO immediate get, i.e. get data with init message
// TODO one-time get, i.e. immediate get + lastRequest
@@ -579,6 +587,12 @@ namespace epics {
{
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelPut);
if (pvRequest == 0)
{
EXCEPTION_GUARD(m_channelPutRequester->channelPutConnect(pvRequestNull, 0, 0, 0));
return;
}
// TODO low-overhead put
// TODO best-effort put
@@ -751,6 +765,12 @@ namespace epics {
{
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelPutGet);
if (pvRequest == 0)
{
EXCEPTION_GUARD(m_channelPutGetRequester->channelPutGetConnect(pvRequestNull, 0, 0, 0));
return;
}
// subscribe
try {
resubscribeSubscription(m_channel->checkAndGetTransport());
@@ -966,6 +986,12 @@ namespace epics {
{
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelRPC);
if (pvRequest == 0)
{
EXCEPTION_GUARD(m_channelRPCRequester->channelRPCConnect(pvRequestNull, 0, 0, 0));
return;
}
// subscribe
try {
resubscribeSubscription(m_channel->checkAndGetTransport());
@@ -1114,6 +1140,12 @@ namespace epics {
{
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelArray);
if (pvRequest == 0)
{
EXCEPTION_GUARD(m_channelArrayRequester->channelArrayConnect(pvRequestNull, 0, 0));
return;
}
// subscribe
try {
resubscribeSubscription(m_channel->checkAndGetTransport());
@@ -1504,6 +1536,12 @@ namespace epics {
{
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(channelMonitor);
if (pvRequest == 0)
{
EXCEPTION_GUARD(m_monitorRequester->monitorConnect(pvRequestNull, 0, 0));
return;
}
// TODO quques
// subscribe