use auto_ptr or unique_ptr

This commit is contained in:
Michael Davidsaver
2020-10-26 15:09:13 -07:00
parent d83e3b5de1
commit db2f7d8b92
5 changed files with 40 additions and 7 deletions

View File

@@ -48,6 +48,17 @@
#include "db_convert.h"
#include "resourceLib.h"
namespace ca {
#if __cplusplus>=201103L
template<typename T>
using auto_ptr = std::unique_ptr<T>;
#define PTRMOVE(AUTO) std::move(AUTO)
#else
using std::auto_ptr;
#define PTRMOVE(AUTO) (AUTO)
#endif
}
extern "C" int putNotifyPut ( processNotify *ppn, notifyPutType notifyPutType );
extern "C" void putNotifyCompletion ( processNotify *ppn );
@@ -194,7 +205,7 @@ private:
epicsMutex & mutex;
epicsMutex & cbMutex;
cacContextNotify & notify;
std::auto_ptr < cacContext > pNetContext;
ca::auto_ptr < cacContext > pNetContext;
char * pStateNotifyCache;
bool isolated;

View File

@@ -71,7 +71,7 @@ dbContext::dbContext ( epicsMutex & cbMutexIn,
epicsMutex & mutexIn, cacContextNotify & notifyIn ) :
readNotifyCache ( mutexIn ), ctx ( 0 ),
stateNotifyCacheSize ( 0 ), mutex ( mutexIn ), cbMutex ( cbMutexIn ),
notify ( notifyIn ), pNetContext ( 0 ), pStateNotifyCache ( 0 ),
notify ( notifyIn ), pStateNotifyCache ( 0 ),
isolated(dbServiceIsolate)
{
}