cesium-native 0.43.0
Loading...
Searching...
No Matches
CesiumUtility Namespace Reference

Utility classes for Cesium. More...

Classes

class  AttributeCompression
 Functions to handle compressed attributes in different formats. More...
 
struct  Credit
 Represents an HTML string that should be shown on screen to attribute third parties for used data, imagery, etc. Acts as a handle into a CreditSystem object that actually holds the credit string. More...
 
class  CreditSystem
 Creates and manages Credit objects. Avoids repetitions and tracks which credits should be shown and which credits should be removed this frame. More...
 
class  DoublyLinkedListAdvanced
 A doubly-linked list. More...
 
class  DoublyLinkedListPointers
 Contains the previous and next pointers for an element in a DoublyLinkedList. More...
 
struct  ErrorList
 The container to store the error and warning list when loading a tile or glTF content. More...
 
struct  ExtensibleObject
 The base class for objects that have extensions and extras. More...
 
struct  Hash
 Contains functions for working with hashes. More...
 
class  IDepotOwningAsset
 An interface representing the depot that owns a SharedAsset. This interface is an implementation detail of the shared asset system and should not be used directly. More...
 
class  IntrusivePointer
 A smart pointer that calls addReference and releaseReference on the controlled object. More...
 
class  JsonHelpers
 A collection of helper functions to make reading JSON simpler. More...
 
class  JsonValue
 A generic implementation of a value in a JSON structure. More...
 
class  Math
 Mathematical constants and functions. More...
 
class  ReferenceCounted
 A reference-counted base class, meant to be used with IntrusivePointer. More...
 
struct  Result
 Holds the result of an operation. If the operation succeeds, it will provide a value. It may also provide errors and warnings. More...
 
struct  Result< CesiumUtility::IntrusivePointer< T > >
 Holds the result of an operation. If the operation succeeds, it will provide a value. It may also provide errors and warnings. More...
 
class  ScopeGuard
 A utility that will automatically call the lambda function when exiting a scope. More...
 
class  SharedAsset
 An asset that is potentially shared between multiple objects, such as an image shared between multiple glTF models. This is intended to be the base class for such assets. More...
 
class  StringHelpers
 Helper functions for working with strings. More...
 
class  Uri
 A class for building and manipulating Uniform Resource Identifiers (URIs). More...
 

Typedefs

template<typename T , DoublyLinkedListPointers< T >T::* Pointers>
using DoublyLinkedList = DoublyLinkedListAdvanced<T, T, Pointers>
 An intrusive doubly-linked list.
 
template<typename T >
using ReferenceCountedThreadSafe = ReferenceCounted<T, true>
 A reference-counted base class, meant to be used with IntrusivePointer. The reference count is thread-safe, so references may be added and removed from any thread at any time. The object will be destroyed in the thread that releases the last reference.
 
template<typename T >
using ReferenceCountedNonThreadSafe = ReferenceCounted<T, false>
 A reference-counted base class, meant to be used with IntrusivePointer. The reference count is not thread-safe, so references must be added and removed (including automatically via IntrusivePointer) from only one thread at a time.
 
template<typename T >
using ResultPointer = Result<IntrusivePointer<T>>
 A convenient shortcut for CesiumUtility::Result<CesiumUtility::IntrusivePointer<T>>.
 

Functions

bool isGzip (const std::span< const std::byte > &data)
 Checks whether the data is gzipped.
 
bool gzip (const std::span< const std::byte > &data, std::vector< std::byte > &out)
 Gzips data.
 
bool gunzip (const std::span< const std::byte > &data, std::vector< std::byte > &out)
 Gunzips data.
 
template<typename T , typename U >
IntrusivePointer< T > const_intrusive_cast (const IntrusivePointer< U > &p) noexcept
 Casts a const IntrusivePointer to its non-const equivalent.
 
template<class TIterator >
std::string joinToString (TIterator begin, TIterator end, const std::string &separator)
 Joins multiple elements together into a string, separated by a given separator.
 
template<class TCollection >
std::string joinToString (TCollection collection, const std::string &separator)
 Joins multiple elements together into a string, separated by a given separator.
 
template<typename T , typename U >
constexpr std::optional< T > losslessNarrow (U u) noexcept
 Attempts a narrowing conversion of U into T without losing information. If a lossless conversion can't be performed, std::nullopt is returned.
 
template<typename T , typename U >
constexpr T losslessNarrowOrDefault (U u, T defaultValue) noexcept
 Attempts a narrowing conversion of U into T without losing information. If a lossless conversion can't be performed, defaultValue is returned.
 
template<typename ExitFunction >
 ScopeGuard (ExitFunction) -> ScopeGuard< ExitFunction >
 Template deduction guide for ScopeGuard to help the compiler figure out that the type of ExitFunction should be the type of the function passed to the constructor.
 
template<typename To , typename From >
std::span< To > reintepretCastSpan (const std::span< From > &from) noexcept
 This function converts between span types. This function has the same rules with C++ reintepret_cast https://en.cppreference.com/w/cpp/language/reinterpret_cast. So please use it carefully.
 

Detailed Description

Utility classes for Cesium.

--- comment: This file was generated by dep-graph-gen. DO NOT EDIT THIS FILE! title: CesiumUtility Dependency Graph --- graph TD classDef dependencyNode fill:#fff,stroke:#ccc,color:#666,font-weight:bold,font-size:28px classDef libraryNode fill:#9f9,font-weight:bold,font-size:28px CesiumUtility[CesiumUtility] --> glm_glm{{glm::glm}} CesiumUtility[CesiumUtility] --> spdlog_spdlog{{spdlog::spdlog}} CesiumUtility[CesiumUtility] --> uriparser_uriparser{{uriparser::uriparser}} CesiumUtility[CesiumUtility] --> zlib-ng_zlib-ng{{zlib-ng::zlib-ng}} class glm_glm,spdlog_spdlog,uriparser_uriparser,zlib-ng_zlib-ng dependencyNode class CesiumUtility libraryNode

Typedef Documentation

◆ DoublyLinkedList

template<typename T , DoublyLinkedListPointers< T >T::* Pointers>
using CesiumUtility::DoublyLinkedList = DoublyLinkedListAdvanced<T, T, Pointers>

An intrusive doubly-linked list.

Definition at line 272 of file DoublyLinkedList.h.

◆ ReferenceCountedNonThreadSafe

template<typename T >
using CesiumUtility::ReferenceCountedNonThreadSafe = ReferenceCounted<T, false>

A reference-counted base class, meant to be used with IntrusivePointer. The reference count is not thread-safe, so references must be added and removed (including automatically via IntrusivePointer) from only one thread at a time.

Template Parameters
TThe type that is deriving from this class. For example, you should declare your class as class MyClass : public ReferenceCountedNonThreadSafe<MyClass> { ... };

Definition at line 134 of file ReferenceCounted.h.

◆ ReferenceCountedThreadSafe

template<typename T >
using CesiumUtility::ReferenceCountedThreadSafe = ReferenceCounted<T, true>

A reference-counted base class, meant to be used with IntrusivePointer. The reference count is thread-safe, so references may be added and removed from any thread at any time. The object will be destroyed in the thread that releases the last reference.

Template Parameters
TThe type that is deriving from this class. For example, you should declare your class as class MyClass : public ReferenceCountedThreadSafe<MyClass> { ... };

Definition at line 121 of file ReferenceCounted.h.

◆ ResultPointer

template<typename T >
using CesiumUtility::ResultPointer = Result<IntrusivePointer<T>>

A convenient shortcut for CesiumUtility::Result<CesiumUtility::IntrusivePointer<T>>.

Template Parameters
TThe type of object that the IntrusivePointer points to.

Definition at line 122 of file Result.h.

Function Documentation

◆ const_intrusive_cast()

template<typename T , typename U >
IntrusivePointer< T > CesiumUtility::const_intrusive_cast ( const IntrusivePointer< U > & p)
noexcept

Casts a const IntrusivePointer to its non-const equivalent.

Parameters
pThe const IntrusivePointer.
Returns
A non-const IntrusivePointer with the same underlying pointer.

Definition at line 237 of file IntrusivePointer.h.

◆ gunzip()

bool CesiumUtility::gunzip ( const std::span< const std::byte > & data,
std::vector< std::byte > & out )

Gunzips data.

If successful, it will return true and the result will be in the provided vector.

Parameters
dataThe data to gunzip.
outThe gunzipped data.
Returns
True if successful, false otherwise.

◆ gzip()

bool CesiumUtility::gzip ( const std::span< const std::byte > & data,
std::vector< std::byte > & out )

Gzips data.

If successful, it will return true and the result will be in the provided vector.

Parameters
dataThe data to gzip.
outThe gzipped data.
Returns
True if successful, false otherwise.

◆ isGzip()

bool CesiumUtility::isGzip ( const std::span< const std::byte > & data)

Checks whether the data is gzipped.

Parameters
dataThe data.
Returns
Whether the data is gzipped

◆ joinToString() [1/2]

template<class TCollection >
std::string CesiumUtility::joinToString ( TCollection collection,
const std::string & separator )

Joins multiple elements together into a string, separated by a given separator.

Template Parameters
TIteratorThe type of the collection iterator.
Parameters
collectionThe collection of elements to be joined.
separatorThe string to use to separate successive elements.
Returns
The joined string.

Definition at line 44 of file joinToString.h.

◆ joinToString() [2/2]

template<class TIterator >
std::string CesiumUtility::joinToString ( TIterator begin,
TIterator end,
const std::string & separator )

Joins multiple elements together into a string, separated by a given separator.

Template Parameters
TIteratorThe type of the collection iterator.
Parameters
beginAn iterator referring to the first element to join.
endAn iterator referring to one past the last element to join.
separatorThe string to use to separate successive elements.
Returns
The joined string.

Definition at line 19 of file joinToString.h.

◆ losslessNarrow()

template<typename T , typename U >
std::optional< T > CesiumUtility::losslessNarrow ( U u)
constexprnoexcept

Attempts a narrowing conversion of U into T without losing information. If a lossless conversion can't be performed, std::nullopt is returned.

Template Parameters
UThe type to convert from.
TThe type to convert to.
Parameters
uThe value to perform the conversion on.

Definition at line 29 of file JsonValue.h.

◆ losslessNarrowOrDefault()

template<typename T , typename U >
T CesiumUtility::losslessNarrowOrDefault ( U u,
T defaultValue )
constexprnoexcept

Attempts a narrowing conversion of U into T without losing information. If a lossless conversion can't be performed, defaultValue is returned.

Template Parameters
UThe type to convert from.
TThe type to convert to.
Parameters
uThe value to perform the conversion on.
defaultValueThe value that will be returned if a lossless conversion can't be performed.

Definition at line 55 of file JsonValue.h.

◆ reintepretCastSpan()

template<typename To , typename From >
std::span< To > CesiumUtility::reintepretCastSpan ( const std::span< From > & from)
noexcept

This function converts between span types. This function has the same rules with C++ reintepret_cast https://en.cppreference.com/w/cpp/language/reinterpret_cast. So please use it carefully.

Definition at line 13 of file SpanHelper.h.