cesium-native 0.47.0
Loading...
Searching...
No Matches
CesiumUtility::CreditSystem Class Referencefinal

Creates and manages Credit objects. Avoids repetitions and tracks which credits should be shown and which credits should be removed this frame. More...

#include <CesiumUtility/CreditSystem.h>

Public Member Functions

Credit createCredit (std::string &&html, bool showOnScreen=false)
 Inserts a credit string.
 
Credit createCredit (const std::string &html, bool showOnScreen=false)
 Inserts a credit string.
 
bool shouldBeShownOnScreen (Credit credit) const noexcept
 Gets whether or not the credit should be shown on screen.
 
void setShowOnScreen (Credit credit, bool showOnScreen) noexcept
 Sets whether or not the credit should be shown on screen.
 
const std::string & getHtml (Credit credit) const noexcept
 Get the HTML string for this credit.
 
void addCreditReference (Credit credit)
 Adds a reference to a credit, incrementing its reference count. The referenced credit will be shown until its reference count goes back down to zero.
 
void removeCreditReference (Credit credit)
 Removes a reference from a credit, decrementing its reference count. When the reference count goes to zero, this credit will no longer be shown.
 
const CreditsSnapshotgetSnapshot () noexcept
 Gets a snapshot of the credits. The returned instance is only valid until the next call to this method.
 

Friends

class CreditReferencer
 

Detailed Description

Creates and manages Credit objects. Avoids repetitions and tracks which credits should be shown and which credits should be removed this frame.

Definition at line 57 of file CreditSystem.h.

Member Function Documentation

◆ addCreditReference()

void CesiumUtility::CreditSystem::addCreditReference ( Credit credit)

Adds a reference to a credit, incrementing its reference count. The referenced credit will be shown until its reference count goes back down to zero.

Parameters
creditThe credit to reference.

◆ createCredit() [1/2]

Credit CesiumUtility::CreditSystem::createCredit ( const std::string & html,
bool showOnScreen = false )

Inserts a credit string.

Returns
If this string already exists, returns a Credit handle to the existing entry. Otherwise returns a Credit handle to a new entry.

◆ createCredit() [2/2]

Credit CesiumUtility::CreditSystem::createCredit ( std::string && html,
bool showOnScreen = false )

Inserts a credit string.

Returns
If this string already exists, returns a Credit handle to the existing entry. Otherwise returns a Credit handle to a new entry.

◆ getSnapshot()

const CreditsSnapshot & CesiumUtility::CreditSystem::getSnapshot ( )
noexcept

Gets a snapshot of the credits. The returned instance is only valid until the next call to this method.

The snapshot will include a sorted list of credits that are currently active, as well as a list of credits that have been removed since the last snapshot.

◆ removeCreditReference()

void CesiumUtility::CreditSystem::removeCreditReference ( Credit credit)

Removes a reference from a credit, decrementing its reference count. When the reference count goes to zero, this credit will no longer be shown.

Parameters
creditThe credit from which to remove a reference.

Friends And Related Symbol Documentation

◆ CreditReferencer

friend class CreditReferencer
friend

Definition at line 135 of file CreditSystem.h.


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