Om
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Om::Shareable< ThisOwnerCount > Class Template Referenceabstract

A pointee for boost::intrusive_ptr. More...

#include "shareable.hpp"

+ Collaboration diagram for Om::Shareable< ThisOwnerCount >:

Public Member Functions

virtual ~Shareable ()=0
 
ThisOwnerCount GetOwnerCount () const
 

Protected Member Functions

 Shareable ()
 
 Shareable (Shareable const &)
 
Shareableoperator= (Shareable const &)
 

Private Member Functions

void DecrementOwnerCount ()
 
void IncrementOwnerCount ()
 

Private Attributes

ThisOwnerCount thisOwnerCount
 The number of owners of this object. More...
 

Friends

template<typename TheOwnerCount >
void intrusive_ptr_add_ref (Shareable< TheOwnerCount > *const)
 
template<typename TheOwnerCount >
void intrusive_ptr_release (Shareable< TheOwnerCount > *const)
 

Detailed Description

template<typename ThisOwnerCount = size_t>
class Om::Shareable< ThisOwnerCount >

This type can be used as a template argument for boost::intrusive_ptr. Shared ownership is implemented via owner counting.

Definition at line 37 of file shareable.hpp.

Constructor & Destructor Documentation

◆ ~Shareable()

template<typename ThisOwnerCount = size_t>
virtual Om::Shareable< ThisOwnerCount >::~Shareable ( )
pure virtual

◆ Shareable() [1/2]

template<typename ThisOwnerCount = size_t>
Om::Shareable< ThisOwnerCount >::Shareable ( )
protected

◆ Shareable() [2/2]

template<typename ThisOwnerCount = size_t>
Om::Shareable< ThisOwnerCount >::Shareable ( Shareable< ThisOwnerCount > const &  )
protected

Member Function Documentation

◆ GetOwnerCount()

template<typename ThisOwnerCount = size_t>
ThisOwnerCount Om::Shareable< ThisOwnerCount >::GetOwnerCount ( ) const

◆ operator=()

template<typename ThisOwnerCount = size_t>
Shareable& Om::Shareable< ThisOwnerCount >::operator= ( Shareable< ThisOwnerCount > const &  )
protected

◆ DecrementOwnerCount()

template<typename ThisOwnerCount = size_t>
void Om::Shareable< ThisOwnerCount >::DecrementOwnerCount ( )
private

◆ IncrementOwnerCount()

template<typename ThisOwnerCount = size_t>
void Om::Shareable< ThisOwnerCount >::IncrementOwnerCount ( )
private

Friends And Related Function Documentation

◆ intrusive_ptr_add_ref

template<typename ThisOwnerCount = size_t>
template<typename TheOwnerCount >
void intrusive_ptr_add_ref ( Shareable< TheOwnerCount > * const  )
friend
Exceptions
std::overflow_errorOn overflow.
Note
Called by the boost::intrusive_ptr constructors.

◆ intrusive_ptr_release

template<typename ThisOwnerCount = size_t>
template<typename TheOwnerCount >
void intrusive_ptr_release ( Shareable< TheOwnerCount > * const  )
friend
Note
Called by the boost::intrusive_ptr destructor.

Member Data Documentation

◆ thisOwnerCount

template<typename ThisOwnerCount = size_t>
ThisOwnerCount Om::Shareable< ThisOwnerCount >::thisOwnerCount
private

Automatic instances have a owner count of 0. If the owner count is incremented from 0, it is owned by a boost::intrusive_ptr and is deleted when decremented back to zero.

Definition at line 85 of file shareable.hpp.


The documentation for this class was generated from the following file: