Photon Common Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::detail Namespace Reference

Implementation detail mainly for internal usages. More...

Namespaces

namespace  core_logging
 Core logging functionalities. Most logs will output information (logs) via a main logger, which we refer to as "core logger". This namespace contains implementation details for core logging functionalities.
 
namespace  stats
 

Classes

struct  AlignedMemoryDeleter
 
struct  HeterogeneousStringHash
 

Concepts

concept  CPermissiveImplicitLifetime
 

Functions

void output_assertion_message (const std::string &filename, const std::string &lineNumber, const std::string &condition, const std::string &message)
 
void on_assertion_failed ()
 
void * allocate_aligned_memory (std::size_t numBytes, std::size_t alignmentInBytes)
 
void free_aligned_memory (void *ptr)
 
void output_not_implemented_warning (const std::string &filename, const std::string &lineNumber)
 
template<typename T , std::size_t... Is>
constexpr std::array< T, sizeof...(Is)> make_array (T element, std::index_sequence< Is... >)
 

Variables

template<typename T >
constexpr bool DEPENDENT_FALSE = false
 

Detailed Description

Implementation detail mainly for internal usages.

Function Documentation

◆ allocate_aligned_memory()

void * ph::detail::allocate_aligned_memory ( std::size_t numBytes,
std::size_t alignmentInBytes )
nodiscard
Parameters
numBytesNumber of bytes to allocate. Must be an integer multiple of alignmentInBytes.
alignmentInBytesHow many bytes to align (so the returned pointer is an integer multiple of alignmentInBytes). Must be an integer power of 2 and a multiple of sizeof(void*).
Returns
Pointer to the beginning of newly allocated memory. nullptr on failure.
Note
Call free_aligned_memory(void*) to deallocate the memory. The implementation is based on malloc(), and object lifetime can be reasoned w.r.t. malloc(). This function is thread safe.

◆ free_aligned_memory()

void ph::detail::free_aligned_memory ( void * ptr)
Parameters
ptrThe memory to be deallocated. ptr must be allocated by allocate_aligned_memory(std::size_t, std::size_t). If ptr is nullptr, no action is performed.
Note
This function is thread safe.

◆ make_array()

template<typename T , std::size_t... Is>
std::array< T, sizeof...(Is)> ph::detail::make_array ( T element,
std::index_sequence< Is... >  )
inlineconstexpr

◆ on_assertion_failed()

void ph::detail::on_assertion_failed ( )

◆ output_assertion_message()

void ph::detail::output_assertion_message ( const std::string & filename,
const std::string & lineNumber,
const std::string & condition,
const std::string & message )

◆ output_not_implemented_warning()

void ph::detail::output_not_implemented_warning ( const std::string & filename,
const std::string & lineNumber )

Variable Documentation

◆ DEPENDENT_FALSE

template<typename T >
bool ph::detail::DEPENDENT_FALSE = false
inlineconstexpr