3#include <CesiumUtility/Library.h>
7#include <unordered_map>
24 return this->
id == rhs.id;
30 Credit(
size_t id_) noexcept : id(id_) {}
32 friend class CreditSystem;
33 friend class CreditReferencer;
118 void addBulkReferences(const
std::vector<int32_t>& references) noexcept;
119 void releaseBulkReferences(const
std::vector<int32_t>& references) noexcept;
121 const
std::
string INVALID_CREDIT_MESSAGE =
122 "Error: Invalid
Credit, cannot get HTML
string.";
124 struct CreditRecord {
127 int32_t referenceCount;
128 bool shownLastSnapshot;
131 std::vector<CreditRecord> _credits;
132 std::vector<Credit> _creditsToNoLongerShowThisSnapshot;
Provides a way to reference a set of credits in a CreditSystem so that the references can easily be r...
Creates and manages Credit objects. Avoids repetitions and tracks which credits should be shown and w...
bool shouldBeShownOnScreen(Credit credit) const noexcept
Gets whether or not the credit should be shown on screen.
Credit createCredit(std::string &&html, bool showOnScreen=false)
Inserts a credit string.
const CreditsSnapshot & getSnapshot() noexcept
Gets a snapshot of the credits. The returned instance is only valid until the next call to this metho...
void setShowOnScreen(Credit credit, bool showOnScreen) noexcept
Sets whether or not the credit should be shown on screen.
Credit createCredit(const std::string &html, bool showOnScreen=false)
Inserts a credit string.
void addCreditReference(Credit credit)
Adds a reference to a credit, incrementing its reference count. The referenced credit will be shown u...
void removeCreditReference(Credit credit)
Removes a reference from a credit, decrementing its reference count. When the reference count goes to...
const std::string & getHtml(Credit credit) const noexcept
Get the HTML string for this credit.
Utility classes for Cesium.
Represents an HTML string that should be shown on screen to attribute third parties for used data,...
bool operator==(const Credit &rhs) const noexcept
Returns true if two credit objects have the same ID.
A snapshot of the credits currently active in a CreditSystem.
std::vector< Credit > currentCredits
The credits that are currently active.
std::vector< Credit > removedCredits
The credits that were removed since the last call to CreditSystem::getSnapshot.