MB-23714: Make VBucketPtr a std::shared_ptr 57/76557/10
authorJim Walker <jim@couchbase.com>
Wed, 12 Apr 2017 13:39:18 +0000 (14:39 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 19 Apr 2017 11:32:43 +0000 (11:32 +0000)
commit0c379f9641cec3df134521e3b23d950dfd1983c0
tree99972499ed9eb0a481ee1f54b0f168629ce665e0
parent7152c3229fd0327a249740ad91e561ee97c61d9d
MB-23714: Make VBucketPtr a std::shared_ptr

Change the VBucketPtr definition so that VBucket poiners are managed
using std::shared_ptr.

To enable some functions to turn this* into a VBucketPtr, VBucket
inherits std::enable_shared_from_this. The only current user of this
is EphemeralVBucket where it constructs the DCPBackfillMemory with a
shared pointer to itself. Arguably EphemeralVBucket could be the class
to inherit std::enable_shared_from_this, but giving the base-class the
shared_from_this method seems more flexible for future enhancement.

Change-Id: Id2f39ece3983509b5c6742107de56b1dcba2d844
Reviewed-on: http://review.couchbase.org/76557
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
13 files changed:
src/dcp/backfill_memory.cc
src/dcp/backfill_memory.h
src/ep_bucket.cc
src/ephemeral_bucket.cc
src/ephemeral_tombstone_purger.cc
src/ephemeral_tombstone_purger.h
src/ephemeral_vb.cc
src/ephemeral_vb.h
src/kvshard.cc
src/kvshard.h
src/vbucket.h
src/vbucketmap.cc
src/vbucketmap.h