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

View File

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

View File

@ -98,18 +98,9 @@ public:
*/
virtual void process();
/**
* @brief Destroy the record.
*
* 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.
* @brief DEPRECATED
*/
virtual void destroy();
virtual void destroy() {}
/**
* @brief Optional method for derived class.
*
@ -276,7 +267,6 @@ private:
epics::pvData::Mutex mutex;
std::size_t depthGroupPut;
int traceLevel;
bool isDestroyed;
// following only valid while addListener or removeListener is active.
bool isAddListener;
PVListenerWPtr pvListener;

View File

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

View File

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