SH::SamplePtr Class Reference

A smart pointer class that holds a single Sample object. More...

#include <SamplePtr.h>

List of all members.

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
SamplePtroperator= (const SamplePtr &that)
 standard assignment operator
bool empty () const
 get() == 0
Sampleget () const
 the sample itself
Sampleoperator-> () const
 the sample itself
Sampleoperator* () const
 the sample itself

Detailed Description

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.

Rationale
This class is mostly to make SampleHandler independent of boost, otherwise I could have used boost::intrusive_ptr.

Constructor & Destructor Documentation

SH::SamplePtr::SamplePtr (  ) 

standard constructor

Guarantee
no-fail
SH::SamplePtr::SamplePtr ( Sample val_sample  ) 

initializing constructor

Guarantee
no-fail
SH::SamplePtr::SamplePtr ( std::unique_ptr< Sample val_sample  )  [explicit]

initializing constructor

Guarantee
no-fail
SH::SamplePtr::SamplePtr ( const SamplePtr that  ) 

standard copy constructor

Guarantee
no-fail
SH::SamplePtr::~SamplePtr (  ) 

standard destructor

Guarantee
no-fail

Member Function Documentation

bool SH::SamplePtr::empty (  )  const

get() == 0

Returns:
get() == 0
Guarantee
no-fail
Sample * SH::SamplePtr::get (  )  const

the sample itself

Returns:
the sample itself
Guarantee
no-fail
Sample & SH::SamplePtr::operator* (  )  const

the sample itself

Returns:
the sample itself
Guarantee
no-fail
Precondition:
!empty()
Sample * SH::SamplePtr::operator-> (  )  const

the sample itself

Returns:
the sample itself
Guarantee
no-fail
Precondition:
!empty()
SamplePtr & SH::SamplePtr::operator= ( const SamplePtr that  ) 

standard assignment operator

Guarantee
no-fail
void SH::SamplePtr::testInvariant (  )  const

test the invariant of this object

Guarantee
no-fail

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1