A smart pointer class that holds a single Sample object. More...
#include <SamplePtr.h>
Public Member Functions | |
void | testInvariant () const |
test the invariant of this object | |
SamplePtr () | |
standard constructor | |
SamplePtr (Sample *val_sample) | |
initializing constructor | |
SamplePtr (std::unique_ptr< Sample > val_sample) | |
initializing constructor | |
SamplePtr (const SamplePtr &that) | |
standard copy constructor | |
~SamplePtr () | |
standard destructor | |
SamplePtr & | operator= (const SamplePtr &that) |
standard assignment operator | |
bool | empty () const |
get() == 0 | |
Sample * | get () const |
the sample itself | |
Sample * | operator-> () const |
the sample itself | |
Sample & | operator* () const |
the sample itself |
A smart pointer class that holds a single Sample object.
To avoid various memory management issues, samples are usually held via such a smart pointer. Since the reference count is internal to the Sample object it is safe to assign the same Sample to multiple smart pointers.
SH::SamplePtr::SamplePtr | ( | ) |
standard constructor
SH::SamplePtr::SamplePtr | ( | Sample * | val_sample | ) |
initializing constructor
SH::SamplePtr::SamplePtr | ( | std::unique_ptr< Sample > | val_sample | ) | [explicit] |
initializing constructor
SH::SamplePtr::SamplePtr | ( | const SamplePtr & | that | ) |
standard copy constructor
SH::SamplePtr::~SamplePtr | ( | ) |
standard destructor
Sample * SH::SamplePtr::get | ( | ) | const |
the sample itself
Sample & SH::SamplePtr::operator* | ( | ) | const |
the sample itself
Sample * SH::SamplePtr::operator-> | ( | ) | const |
the sample itself
standard assignment operator
void SH::SamplePtr::testInvariant | ( | ) | const |
test the invariant of this object