2#include "zipios++/zipios-config.h"
4#include "zipios++/meta-iostreams.h"
12using namespace zipios ;
28 Bogus(
bool &isAlive) : _isAlive(isAlive) {}
29 ~Bogus() { _isAlive =
false; }
35 void ref()
const { _refcount.ref() ; }
36 unsigned int unref()
const {
return _refcount.unref() ; }
37 unsigned int getReferenceCount()
const {
return _refcount.getReferenceCount() ; }
51 Bogus *p =
new Bogus(isAlive);
53 assert( sp1.getReferenceCount() == 1 );
57 assert( sp1.getReferenceCount() == 2 );
61 assert( sp1.getReferenceCount() == 3 );
63 assert( sp1.getReferenceCount() == 2 );
66 assert( sp1.getReferenceCount() == 1 );
ReferenceCount is useful to ensure proper handling of the reference count for (objects of) classes ha...
SimpleSmartPointer is a simple reference counting smart pointer template.
Header file that defines SimpleSmartPointer and ReferenceCount.