add reftrack to pvac

This commit is contained in:
Michael Davidsaver
2017-11-22 12:32:38 -06:00
parent 3f51c74ba1
commit 250826ffb9
6 changed files with 109 additions and 11 deletions

View File

@@ -10,10 +10,11 @@
#include <pv/current_function.h>
#include <pv/pvData.h>
#include <pv/bitSet.h>
#include <pv/reftrack.h>
#define epicsExportSharedSymbols
#include "pv/logger.h"
#include "pva/client.h"
#include "clientpvt.h"
#include "pv/pvAccess.h"
namespace pvd = epics::pvData;
@@ -35,9 +36,13 @@ struct GetPutter : public pva::ChannelPutRequester,
pvac::ClientChannel::PutCallback *putcb;
pvac::GetEvent event;
GetPutter(pvac::ClientChannel::GetCallback* cb) :started(false), getcb(cb), putcb(0) {}
GetPutter(pvac::ClientChannel::PutCallback* cb) :started(false), getcb(0), putcb(cb) {}
virtual ~GetPutter() {cancel();}
static size_t num_instances;
GetPutter(pvac::ClientChannel::GetCallback* cb) :started(false), getcb(cb), putcb(0)
{REFTRACE_INCREMENT(num_instances);}
GetPutter(pvac::ClientChannel::PutCallback* cb) :started(false), getcb(0), putcb(cb)
{REFTRACE_INCREMENT(num_instances);}
virtual ~GetPutter() {cancel();REFTRACE_DECREMENT(num_instances);}
void callEvent(Guard& G, pvac::GetEvent::event_t evt = pvac::GetEvent::Fail)
{
@@ -172,6 +177,8 @@ struct GetPutter : public pva::ChannelPutRequester,
}
};
size_t GetPutter::num_instances;
} //namespace
namespace pvac {
@@ -213,4 +220,13 @@ ClientChannel::put(PutCallback* cb,
}
namespace detail {
void registerRefTrackGet()
{
epics::registerRefCounter("pvac::GetPutter", &GetPutter::num_instances);
}
}
}//namespace pvac