MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / reset

Method reset

libCacheSim/dataStructure/sparsepp/spp_smartptr.h:46–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 T* get() const { return _p; }
45 void swap(spp_sptr &o) { T *tmp = _p; _p = o._p; o._p = tmp; }
46 void reset(const T *p = 0)
47 {
48 if (p == _p)
49 return;
50 if (_p) _p->decrement();
51 _p = (T *)p;
52 if (_p) _p->increment();
53 }
54 T* operator->() const { return const_cast<T *>(_p); }
55 bool operator!() const { return _p == 0; }
56

Callers

nothing calls this directly

Calls 2

decrementMethod · 0.80
incrementMethod · 0.80

Tested by

no test coverage detected