cesium-native 0.47.0
Loading...
Searching...
No Matches
CesiumUtility::CreditReferencer Class Reference

Provides a way to reference a set of credits in a CreditSystem so that the references can easily be released later. More...

#include <CesiumUtility/CreditReferencer.h>

Public Member Functions

 CreditReferencer () noexcept
 Constructs a new credit referencer without a credit system.
 
 CreditReferencer (const std::shared_ptr< CreditSystem > &pCreditSystem) noexcept
 Constructs a new credit referencer.
 
 CreditReferencer (const CreditReferencer &rhs) noexcept
 Copies an instance, increasing the credit references on the CreditSystem accordingly.
 
 CreditReferencer (CreditReferencer &&rhs) noexcept
 Moves an instance. After the move, the rhs will not own any references, so this operation does not affect the total number of credit references on the CreditSystem.
 
 ~CreditReferencer () noexcept
 Destroys this instance, releasing all of its references.
 
CreditReferenceroperator= (const CreditReferencer &rhs) noexcept
 Copy-assigns another instance to this one. The rhs references are copied to this instance and then all credit references previously owned by this instance are released.
 
CreditReferenceroperator= (CreditReferencer &&rhs) noexcept
 Move-assigns another instance to this one. The rhs references are moved to this instance and then all credit references previously owned by this instance are released.
 
const std::shared_ptr< CreditSystem > & getCreditSystem () const noexcept
 Gets the credit system that this instance references.
 
void setCreditSystem (const std::shared_ptr< CreditSystem > &pCreditSystem) noexcept
 Sets the credit system that this instance references.
 
void addCreditReference (Credit credit) noexcept
 Adds a reference to a credit.
 
void releaseAllReferences () noexcept
 Releases all references that have been added to this instance.
 

Detailed Description

Provides a way to reference a set of credits in a CreditSystem so that the references can easily be released later.

Multiple CreditReferencers may be used on the same credit system to track separate sets of references – e.g., two sets of credits from different frames.

Definition at line 20 of file CreditReferencer.h.

Constructor & Destructor Documentation

◆ CreditReferencer() [1/4]

CesiumUtility::CreditReferencer::CreditReferencer ( )
noexcept

Constructs a new credit referencer without a credit system.

The methods on this instance will have no effect before the credit system is set by calling setCreditSystem.

◆ CreditReferencer() [2/4]

CesiumUtility::CreditReferencer::CreditReferencer ( const std::shared_ptr< CreditSystem > & pCreditSystem)
noexcept

Constructs a new credit referencer.

Parameters
pCreditSystemThe credit system that owns the referenced credits. This may be nullptr, but methods on this instance will have no effect before the credit system is set.

◆ CreditReferencer() [3/4]

CesiumUtility::CreditReferencer::CreditReferencer ( const CreditReferencer & rhs)
noexcept

Copies an instance, increasing the credit references on the CreditSystem accordingly.

Parameters
rhsThe instance to copy.

◆ CreditReferencer() [4/4]

CesiumUtility::CreditReferencer::CreditReferencer ( CreditReferencer && rhs)
noexcept

Moves an instance. After the move, the rhs will not own any references, so this operation does not affect the total number of credit references on the CreditSystem.

Parameters
rhsThe instance to move.

Member Function Documentation

◆ addCreditReference()

void CesiumUtility::CreditReferencer::addCreditReference ( Credit credit)
noexcept

Adds a reference to a credit.

Parameters
creditThe credit to reference.

◆ operator=() [1/2]

CreditReferencer & CesiumUtility::CreditReferencer::operator= ( const CreditReferencer & rhs)
noexcept

Copy-assigns another instance to this one. The rhs references are copied to this instance and then all credit references previously owned by this instance are released.

Parameters
rhsThe instance to copy.
Returns
A reference to this instance.

◆ operator=() [2/2]

CreditReferencer & CesiumUtility::CreditReferencer::operator= ( CreditReferencer && rhs)
noexcept

Move-assigns another instance to this one. The rhs references are moved to this instance and then all credit references previously owned by this instance are released.

Parameters
rhsThe instance to move.
Returns
A reference to this instance.

◆ setCreditSystem()

void CesiumUtility::CreditReferencer::setCreditSystem ( const std::shared_ptr< CreditSystem > & pCreditSystem)
noexcept

Sets the credit system that this instance references.

If the specified credit system is different from the current one, this method will clear all current credit references.

Parameters
pCreditSystemThe new credit system.

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