FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
OMEreferenceToData< C > Class Template Reference

Templated type-specific reference to a reference-counted object. More...

#include <OMErefCount.h>

Public Member Functions

void getUniqueReference ()
 Force unique reference to the data, which will trigger duplication if necessary (copy-on-write). More...
 
int_fast32_t totalReferences () const OME_ALWAYS_INLINE
 Get current reference total. More...
 

Protected Member Functions

void addReadOnlyReference () OME_ALWAYS_INLINE
 
void dropReference (C *newData=nullptr) OME_ALWAYS_INLINE
 
 OMEreferenceToData ()
 
 OMEreferenceToData (C *existingData) NONNULL_CLASS_PARAMETERS(2)
 
 OMEreferenceToData (const OMEreferenceToData< C > &org)
 
virtual ~OMEreferenceToData ()
 

Protected Attributes

C * data
 

Detailed Description

template<class C>
class OMEreferenceToData< C >

Templated type-specific reference to a reference-counted object.

Parameters
Cspecifies the class of the object being referenced.

OMEreferenceToData<C> is a template to provide a type-specific handle to reference-counted data and enable support for copy-on-write.

The class argument C should be the name of a class that both inherits from class OMEreferenceCount and holds the data.

Constructor & Destructor Documentation

◆ OMEreferenceToData() [1/3]

template<class C >
OMEreferenceToData< C >::OMEreferenceToData ( )
inlineprotected

◆ OMEreferenceToData() [2/3]

template<class C >
OMEreferenceToData< C >::OMEreferenceToData ( C *  existingData)
inlineexplicitprotected

◆ OMEreferenceToData() [3/3]

template<class C >
OMEreferenceToData< C >::OMEreferenceToData ( const OMEreferenceToData< C > &  org)
inlineexplicitprotected

◆ ~OMEreferenceToData()

template<class C >
virtual OMEreferenceToData< C >::~OMEreferenceToData ( )
inlineprotectedvirtual

Member Function Documentation

◆ addReadOnlyReference()

template<class C >
void OMEreferenceToData< C >::addReadOnlyReference ( )
inlineprotected

Referenced by OMEfixed::OMEfixed().

◆ dropReference()

template<class C >
void OMEreferenceToData< C >::dropReference ( C *  newData = nullptr)
inlineprotected

◆ getUniqueReference()

template<class C >
void OMEreferenceToData< C >::getUniqueReference ( )
inline

Force unique reference to the data, which will trigger duplication if necessary (copy-on-write).

Referenced by OMEarray::deleteIndex(), OMEassoc::deleteIndex(), OMEset::operator&=(), OMEset::operator+=(), OMEset::operator-=(), OMEarray::operator[](), OMEassoc::operator[](), OMEset::operator|=(), and OMEstring::truncateToLength().

◆ totalReferences()

template<class C >
int_fast32_t OMEreferenceToData< C >::totalReferences ( ) const
inline

Get current reference total.

Return values
-1234indicates improper initialization.

Referenced by makeUnique(), OMEset::operator=(), OMEnlm::operator=(), and OMEfixed::operator=().

Member Data Documentation

◆ data


The documentation for this class was generated from the following file:
Generated: Fri Jul 31 2020 18:19:16
Support Information