Merge pull request #38 from mrkraimer/master

fix warning messages; at least on linux
This commit is contained in:
Marty Kraimer
2019-03-14 14:47:09 -04:00
committed by GitHub
5 changed files with 17 additions and 49 deletions

View File

@ -42,7 +42,6 @@ PVRecord::PVRecord(
pvStructure(pvStructure), pvStructure(pvStructure),
depthGroupPut(0), depthGroupPut(0),
traceLevel(0), traceLevel(0),
isDestroyed(false),
isAddListener(false) isAddListener(false)
{ {
} }
@ -53,13 +52,8 @@ void PVRecord::notifyClients()
epicsGuard<epics::pvData::Mutex> guard(mutex); epicsGuard<epics::pvData::Mutex> guard(mutex);
if(traceLevel>0) { if(traceLevel>0) {
cout << "PVRecord::notifyClients() " << recordName cout << "PVRecord::notifyClients() " << recordName
<< " isDestroyed " << (isDestroyed ? "true" : "false")
<< endl; << endl;
} }
if(isDestroyed) {
return;
}
isDestroyed = true;
} }
pvTimeStamp.detach(); pvTimeStamp.detach();
for(std::list<PVListenerWPtr>::iterator iter = pvListenerList.begin(); for(std::list<PVListenerWPtr>::iterator iter = pvListenerList.begin();
@ -115,13 +109,6 @@ void PVRecord::initPVRecord()
if(pvField) pvTimeStamp.attach(pvField); if(pvField) pvTimeStamp.attach(pvField);
} }
void PVRecord::destroy()
{
PVDatabasePtr pvDatabase(PVDatabase::getMaster());
if(pvDatabase) pvDatabase->removeRecord(shared_from_this());
notifyClients();
}
void PVRecord::process() void PVRecord::process()
{ {
if(traceLevel>2) { if(traceLevel>2) {
@ -207,9 +194,6 @@ bool PVRecord::addPVRecordClient(PVRecordClientPtr const & pvRecordClient)
cout << "PVRecord::addPVRecordClient() " << recordName << endl; cout << "PVRecord::addPVRecordClient() " << recordName << endl;
} }
epicsGuard<epics::pvData::Mutex> guard(mutex); epicsGuard<epics::pvData::Mutex> guard(mutex);
if(isDestroyed) {
return false;
}
// clean clientList // clean clientList
bool clientListClean = false; bool clientListClean = false;
while(!clientListClean) { while(!clientListClean) {
@ -243,9 +227,6 @@ bool PVRecord::addListener(
cout << "PVRecord::addListener() " << recordName << endl; cout << "PVRecord::addListener() " << recordName << endl;
} }
epicsGuard<epics::pvData::Mutex> guard(mutex); epicsGuard<epics::pvData::Mutex> guard(mutex);
if(isDestroyed) {
return false;
}
pvListenerList.push_back(pvListener); pvListenerList.push_back(pvListener);
this->pvListener = pvListener; this->pvListener = pvListener;
isAddListener = true; isAddListener = true;
@ -274,9 +255,6 @@ bool PVRecord::removeListener(
cout << "PVRecord::removeListener() " << recordName << endl; cout << "PVRecord::removeListener() " << recordName << endl;
} }
epicsGuard<epics::pvData::Mutex> guard(mutex); epicsGuard<epics::pvData::Mutex> guard(mutex);
if(isDestroyed) {
return false;
}
std::list<PVListenerWPtr>::iterator iter; std::list<PVListenerWPtr>::iterator iter;
for (iter = pvListenerList.begin(); iter!=pvListenerList.end(); iter++ ) for (iter = pvListenerList.begin(); iter!=pvListenerList.end(); iter++ )
{ {

View File

@ -78,10 +78,10 @@ public:
*/ */
virtual ~ChannelProviderLocal(); virtual ~ChannelProviderLocal();
/** /**
* @brief Destroy the channel provider. * @brief DEPRECATED
* *
*/ */
virtual void destroy() EPICS_DEPRECATED {}; virtual void destroy(){};
/** /**
* @brief Returns the channel provider name. * @brief Returns the channel provider name.
* *
@ -202,10 +202,10 @@ public:
*/ */
virtual ~ChannelLocal(); virtual ~ChannelLocal();
/** /**
* @brief Destroy the channel. * @brief DEPRECATED
* *
*/ */
virtual void destroy() EPICS_DEPRECATED {}; virtual void destroy() {};
/** /**
* @brief Detach from the record. * @brief Detach from the record.
* *

View File

@ -98,18 +98,9 @@ public:
*/ */
virtual void process(); virtual void process();
/** /**
* @brief Destroy the record. * @brief DEPRECATED
*
* Destroy the PVRecord. Release any resources used and
* get rid of listeners and requesters.
* If derived class overrides this then it must call PVRecord::destroy()
* after it has destroyed any resorces it uses.
*
* Note: for most classes destroy no longer exists or has been deprecated.
* This method makes it possible to remove a record from a database
* while the database is still running.
*/ */
virtual void destroy(); virtual void destroy() {}
/** /**
* @brief Optional method for derived class. * @brief Optional method for derived class.
* *
@ -276,7 +267,6 @@ private:
epics::pvData::Mutex mutex; epics::pvData::Mutex mutex;
std::size_t depthGroupPut; std::size_t depthGroupPut;
int traceLevel; int traceLevel;
bool isDestroyed;
// following only valid while addListener or removeListener is active. // following only valid while addListener or removeListener is active.
bool isAddListener; bool isAddListener;
PVListenerWPtr pvListener; PVListenerWPtr pvListener;

View File

@ -71,13 +71,13 @@ class ChannelProcessLocal :
public: public:
POINTER_DEFINITIONS(ChannelProcessLocal); POINTER_DEFINITIONS(ChannelProcessLocal);
virtual ~ChannelProcessLocal(); virtual ~ChannelProcessLocal();
virtual void destroy() {} // DEPRECATED
static ChannelProcessLocalPtr create( static ChannelProcessLocalPtr create(
ChannelLocalPtr const &channelLocal, ChannelLocalPtr const &channelLocal,
ChannelProcessRequester::shared_pointer const & channelProcessRequester, ChannelProcessRequester::shared_pointer const & channelProcessRequester,
PVStructurePtr const & pvRequest, PVStructurePtr const & pvRequest,
PVRecordPtr const &pvRecord); PVRecordPtr const &pvRecord);
virtual void process(); virtual void process();
virtual void destroy() EPICS_DEPRECATED {};
virtual std::tr1::shared_ptr<Channel> getChannel(); virtual std::tr1::shared_ptr<Channel> getChannel();
virtual void cancel(){} virtual void cancel(){}
virtual void lock(); virtual void lock();
@ -204,13 +204,13 @@ class ChannelGetLocal :
public: public:
POINTER_DEFINITIONS(ChannelGetLocal); POINTER_DEFINITIONS(ChannelGetLocal);
virtual ~ChannelGetLocal(); virtual ~ChannelGetLocal();
virtual void destroy() {} // DEPRECATED
static ChannelGetLocalPtr create( static ChannelGetLocalPtr create(
ChannelLocalPtr const &channelLocal, ChannelLocalPtr const &channelLocal,
ChannelGetRequester::shared_pointer const & channelGetRequester, ChannelGetRequester::shared_pointer const & channelGetRequester,
PVStructurePtr const & pvRequest, PVStructurePtr const & pvRequest,
PVRecordPtr const &pvRecord); PVRecordPtr const &pvRecord);
virtual void get(); virtual void get();
virtual void destroy() EPICS_DEPRECATED {};
virtual std::tr1::shared_ptr<Channel> getChannel(); virtual std::tr1::shared_ptr<Channel> getChannel();
virtual void cancel(){} virtual void cancel(){}
virtual void lock(); virtual void lock();
@ -378,6 +378,7 @@ class ChannelPutLocal :
public: public:
POINTER_DEFINITIONS(ChannelPutLocal); POINTER_DEFINITIONS(ChannelPutLocal);
virtual ~ChannelPutLocal(); virtual ~ChannelPutLocal();
virtual void destroy() {} // DEPRECATED
static ChannelPutLocalPtr create( static ChannelPutLocalPtr create(
ChannelLocalPtr const &channelLocal, ChannelLocalPtr const &channelLocal,
ChannelPutRequester::shared_pointer const & channelPutRequester, ChannelPutRequester::shared_pointer const & channelPutRequester,
@ -385,7 +386,6 @@ public:
PVRecordPtr const &pvRecord); PVRecordPtr const &pvRecord);
virtual void put(PVStructurePtr const &pvStructure,BitSetPtr const &bitSet); virtual void put(PVStructurePtr const &pvStructure,BitSetPtr const &bitSet);
virtual void get(); virtual void get();
virtual void destroy() EPICS_DEPRECATED {};
virtual std::tr1::shared_ptr<Channel> getChannel(); virtual std::tr1::shared_ptr<Channel> getChannel();
virtual void cancel(){} virtual void cancel(){}
virtual void lock(); virtual void lock();
@ -551,6 +551,7 @@ class ChannelPutGetLocal :
public: public:
POINTER_DEFINITIONS(ChannelPutGetLocal); POINTER_DEFINITIONS(ChannelPutGetLocal);
virtual ~ChannelPutGetLocal(); virtual ~ChannelPutGetLocal();
virtual void destroy() {} // DEPRECATED
static ChannelPutGetLocalPtr create( static ChannelPutGetLocalPtr create(
ChannelLocalPtr const &channelLocal, ChannelLocalPtr const &channelLocal,
ChannelPutGetRequester::shared_pointer const & channelPutGetRequester, ChannelPutGetRequester::shared_pointer const & channelPutGetRequester,
@ -561,7 +562,6 @@ public:
BitSetPtr const &putBitSet); BitSetPtr const &putBitSet);
virtual void getPut(); virtual void getPut();
virtual void getGet(); virtual void getGet();
virtual void destroy() EPICS_DEPRECATED {};
virtual std::tr1::shared_ptr<Channel> getChannel(); virtual std::tr1::shared_ptr<Channel> getChannel();
virtual void cancel(){} virtual void cancel(){}
virtual void lock(); virtual void lock();
@ -769,6 +769,7 @@ class ChannelRPCLocal :
{ {
public: public:
POINTER_DEFINITIONS(ChannelRPCLocal); POINTER_DEFINITIONS(ChannelRPCLocal);
virtual void destroy() {} // DEPRECATED
static ChannelRPCLocalPtr create( static ChannelRPCLocalPtr create(
ChannelLocalPtr const & channelLocal, ChannelLocalPtr const & channelLocal,
ChannelRPCRequester::shared_pointer const & channelRPCRequester, ChannelRPCRequester::shared_pointer const & channelRPCRequester,
@ -805,7 +806,6 @@ public:
virtual void request(PVStructurePtr const & pvArgument); virtual void request(PVStructurePtr const & pvArgument);
virtual Channel::shared_pointer getChannel(); virtual Channel::shared_pointer getChannel();
virtual void cancel() {} virtual void cancel() {}
virtual void destroy() EPICS_DEPRECATED {};
virtual void lock() {} virtual void lock() {}
virtual void unlock() {} virtual void unlock() {}
virtual void lastRequest() {} virtual void lastRequest() {}
@ -964,6 +964,7 @@ class ChannelArrayLocal :
public: public:
POINTER_DEFINITIONS(ChannelArrayLocal); POINTER_DEFINITIONS(ChannelArrayLocal);
virtual ~ChannelArrayLocal(); virtual ~ChannelArrayLocal();
virtual void destroy() {} // DEPRECATED
static ChannelArrayLocalPtr create( static ChannelArrayLocalPtr create(
ChannelLocalPtr const &channelLocal, ChannelLocalPtr const &channelLocal,
ChannelArrayRequester::shared_pointer const & channelArrayRequester, ChannelArrayRequester::shared_pointer const & channelArrayRequester,
@ -975,7 +976,6 @@ public:
size_t offset, size_t count, size_t stride); size_t offset, size_t count, size_t stride);
virtual void getLength(); virtual void getLength();
virtual void setLength(size_t length); virtual void setLength(size_t length);
virtual void destroy() EPICS_DEPRECATED {};
virtual std::tr1::shared_ptr<Channel> getChannel(); virtual std::tr1::shared_ptr<Channel> getChannel();
virtual void cancel(){} virtual void cancel(){}
virtual void lock(); virtual void lock();
@ -1151,7 +1151,7 @@ void ChannelArrayLocal::getArray(size_t offset, size_t count, size_t stride)
pvCopy->setLength(count); pvCopy->setLength(count);
copy(pvArray,offset,stride,pvCopy,0,1,count); copy(pvArray,offset,stride,pvCopy,0,1,count);
} }
} catch(std::exception e) { } catch(std::exception& e) {
exceptionMessage = e.what(); exceptionMessage = e.what();
} }
Status status = Status::Ok; Status status = Status::Ok;
@ -1178,7 +1178,7 @@ void ChannelArrayLocal::putArray(
try { try {
epicsGuard <PVRecord> guard(*pvr); epicsGuard <PVRecord> guard(*pvr);
copy(pvArray,0,1,this->pvArray,offset,stride,count); copy(pvArray,0,1,this->pvArray,offset,stride,count);
} catch(std::exception e) { } catch(std::exception& e) {
exceptionMessage = e.what(); exceptionMessage = e.what();
} }
Status status = Status::Ok; Status status = Status::Ok;
@ -1199,7 +1199,7 @@ void ChannelArrayLocal::getLength()
try { try {
epicsGuard <PVRecord> guard(*pvr); epicsGuard <PVRecord> guard(*pvr);
length = pvArray->getLength(); length = pvArray->getLength();
} catch(std::exception e) { } catch(std::exception& e) {
exceptionMessage = e.what(); exceptionMessage = e.what();
} }
Status status = Status::Ok; Status status = Status::Ok;
@ -1225,7 +1225,7 @@ void ChannelArrayLocal::setLength(size_t length)
if(pvArray->getLength()!=length) pvArray->setLength(length); if(pvArray->getLength()!=length) pvArray->setLength(length);
} }
requester->setLengthDone(Status::Ok,getPtrSelf()); requester->setLengthDone(Status::Ok,getPtrSelf());
} catch(std::exception e) { } catch(std::exception& e) {
string exceptionMessage = e.what(); string exceptionMessage = e.what();
Status status = Status(Status::STATUSTYPE_ERROR,exceptionMessage); Status status = Status(Status::STATUSTYPE_ERROR,exceptionMessage);
requester->setLengthDone(status,getPtrSelf()); requester->setLengthDone(status,getPtrSelf());

View File

@ -135,10 +135,10 @@ class MonitorLocal :
public: public:
POINTER_DEFINITIONS(MonitorLocal); POINTER_DEFINITIONS(MonitorLocal);
virtual ~MonitorLocal(); virtual ~MonitorLocal();
virtual void destroy() {} // DEPRECATED
virtual Status start(); virtual Status start();
virtual Status stop(); virtual Status stop();
virtual MonitorElementPtr poll(); virtual MonitorElementPtr poll();
virtual void destroy() EPICS_DEPRECATED {};
virtual void detach(PVRecordPtr const & pvRecord){} virtual void detach(PVRecordPtr const & pvRecord){}
virtual void release(MonitorElementPtr const & monitorElement); virtual void release(MonitorElementPtr const & monitorElement);
virtual void dataPut(PVRecordFieldPtr const & pvRecordField); virtual void dataPut(PVRecordFieldPtr const & pvRecordField);