TrinityCore
Loading...
Searching...
No Matches
Trinity Namespace Reference

Namespaces

namespace  Asio
 
namespace  Banner
 
namespace  ChatCommands
 
namespace  Containers
 
namespace  Crypto
 
namespace  Currency
 
namespace  DB
 
namespace  Encoding
 
namespace  Honor
 
 
namespace  Impl
 
namespace  Legacy
 
namespace  Locale
 
namespace  Net
 
namespace  Predicates
 
namespace  Service
 
namespace  SpellScripts
 
namespace  Timezone
 
namespace  XP
 

Classes

class  AbsorbAuraOrderPred
 
struct  AIRelocationNotifier
 
class  AllCreaturesOfEntryInRange
 
class  AllFriendlyCreaturesInGrid
 
class  AllGameObjectsWithEntryInRange
 
class  AllWorldObjectsInRange
 
class  AnyAoETargetUnitInObjectRangeCheck
 
class  AnyAssistCreatureInRangeCheck
 
struct  AnyDeadUnitCheck
 
class  AnyDeadUnitObjectInRangeCheck
 
class  AnyDeadUnitSpellTargetInRangeCheck
 
class  AnyFriendlyUnitInObjectRangeCheck
 
class  AnyGroupedUnitInObjectRangeCheck
 
class  AnyPlayerInPositionRangeCheck
 
class  AnyUnfriendlyUnitInObjectRangeCheck
 
class  AnyUnitInObjectRangeCheck
 
struct  AreaTriggerLastSearcher
 
struct  AreaTriggerListSearcher
 
struct  AreaTriggerSearcher
 
struct  AreaTriggerSearcherBase
 
struct  AreaTriggerWorker
 
class  AsyncProcessResult
 
class  AsyncProcessResultImplementation
 
class  BroadcastTextBuilder
 
class  CallOfHelpCreatureInRangeDo
 
class  ChatPacketSender
 
class  CheckedBufferOutputIterator
 
struct  ConversationLastSearcher
 
struct  ConversationListSearcher
 
struct  ConversationSearcher
 
struct  ConversationSearcherBase
 
struct  ConversationWorker
 
struct  CreatureAggroGracePeriodExpiredNotifier
 
struct  CreatureLastSearcher
 
struct  CreatureListSearcher
 
struct  CreatureRelocationNotifier
 
struct  CreatureSearcher
 
struct  CreatureSearcherBase
 
class  CreatureTextTextBuilder
 
class  CreatureWithOptionsInObjectRangeCheck
 
struct  CreatureWorker
 
class  CustomChatTextBuilder
 
struct  DelayedUnitRelocation
 
struct  dependant_false
 
struct  DynamicGridMapTypeMaskCheck
 
struct  find_type_result
 
struct  find_type_result< false, T >
 
class  FriendlyBelowHpPctEntryInRange
 
class  FriendlyCCedInRange
 
class  FriendlyMissingBuffInRange
 
class  GameObjectFocusCheck
 
class  GameObjectInRangeCheck
 
struct  GameObjectLastSearcher
 
struct  GameObjectListSearcher
 
struct  GameObjectSearcher
 
struct  GameObjectSearcherBase
 
class  GameObjectWithOptionsInObjectRangeCheck
 
struct  GameObjectWorker
 
struct  GridMapTypeMaskForType
 
struct  GridMapTypeMaskForType< AreaTrigger >
 
struct  GridMapTypeMaskForType< Conversation >
 
struct  GridMapTypeMaskForType< Corpse >
 
struct  GridMapTypeMaskForType< Creature >
 
struct  GridMapTypeMaskForType< DynamicObject >
 
struct  GridMapTypeMaskForType< GameObject >
 
struct  GridMapTypeMaskForType< Player >
 
struct  GridMapTypeMaskForType< SceneObject >
 
struct  GridUpdater
 
struct  HashFnv1a
 
struct  HashFnv1aConstants
 
struct  HashFnv1aConstants< 4 >
 
struct  HashFnv1aConstants< 8 >
 
class  HeightDifferenceCheck
 
class  InRangeCheckCustomizer
 
class  IteratorPair
 Utility class to enable range for loop syntax for multimap.equal_range uses. More...
 
class  LocalizedDo
 
struct  MessageDistDeliverer
 
struct  MessageDistDelivererToHostile
 
class  MostHPMissingInRange
 
class  MostHPPercentMissingInRange
 
class  NearestAreaTriggerEntryInObjectRangeCheck
 
class  NearestAssistCreatureInCreatureRangeCheck
 
class  NearestAttackableNoTotemUnitInObjectRangeCheck
 
class  NearestAttackableUnitInObjectRangeCheck
 
class  NearestCheckCustomizer
 
class  NearestCreatureEntryWithLiveStateInObjectRangeCheck
 
class  NearestGameObjectCheck
 
class  NearestGameObjectEntryInObjectRangeCheck
 
class  NearestGameObjectFishingHole
 
class  NearestGameObjectTypeInObjectRangeCheck
 
class  NearestHostileUnitCheck
 
class  NearestHostileUnitInAggroRangeCheck
 
class  NearestHostileUnitInAttackDistanceCheck
 
class  NearestPlayerInObjectRangeCheck
 
class  NearestUnspawnedGameObjectEntryInObjectRangeCheck
 
struct  NoArgFormatterBase
 
class  ObjectDistanceOrderPred
 
class  ObjectEntryAndPrivateOwnerIfExistsCheck
 
class  ObjectGUIDCheck
 
class  ObjectTypeIdCheck
 
struct  ObjectUpdater
 
struct  PacketSenderOwning
 
struct  PacketSenderRef
 
class  PlayerAtMinimumRangeAway
 
struct  PlayerDistWorker
 
struct  PlayerLastSearcher
 
struct  PlayerListSearcher
 
struct  PlayerRelocationNotifier
 
struct  PlayerSearcher
 
struct  PlayerSearcherBase
 
struct  PlayerWorker
 
struct  RaceMask
 
struct  RaceMask< std::array< T, N > >
 
class  RespawnDo
 
struct  SceneObjectLastSearcher
 
struct  SceneObjectListSearcher
 
struct  SceneObjectSearcher
 
struct  SceneObjectSearcherBase
 
struct  SceneObjectWorker
 
class  SearcherContainerResult
 
class  SearcherFirstObjectResult
 
class  SearcherLastObjectResult
 
struct  StaticGridMapTypeMaskCheck
 
struct  TargetPriorityRule
 
class  ThreadPool
 
struct  TransparentHash
 
class  TrinityStringChatBuilder
 
class  unique_strong_ref_ptr
 Result of unique_weak_ptr::lock() function, this class holds a temporary strong reference to held object to prevent it from being deallocated by another thread while it is being actively accessed. This class is non-movable and non-copypable and is intended only for short lived local variables. More...
 
class  unique_trackable_ptr
 Specialized variant of std::shared_ptr that enforces unique ownership and/or std::unique_ptr with std::weak_ptr capabilities Implementation has the same overhead as a std::shared_ptr, that is, a separate allocation for control block that holds use counters. More...
 
class  unique_weak_ptr
 Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr. More...
 
class  UnitAuraCheck
 
struct  UnitLastSearcher
 
struct  UnitListSearcher
 
struct  UnitSearcher
 
struct  UnitSearcherBase
 
struct  UnitWorker
 
struct  VisibleChangesNotifier
 
struct  VisibleNotifier
 
struct  WorldObjectLastSearcher
 
struct  WorldObjectListSearcher
 
struct  WorldObjectSearcher
 
struct  WorldObjectSearcherBase
 
struct  WorldObjectSpellAreaTargetCheck
 
struct  WorldObjectSpellConeTargetCheck
 
struct  WorldObjectSpellLineTargetCheck
 
struct  WorldObjectSpellNearbyTargetCheck
 
struct  WorldObjectSpellTargetCheck
 
struct  WorldObjectSpellTrajTargetCheck
 
struct  WorldObjectWorker
 
struct  WorldObjectWorkerBase
 
class  WorldWorldTextBuilder
 

Concepts

concept  invocable_r
 
concept  HashablePrimitive
 

Typedefs

using regex = TC_REGEX_NAMESPACE ::regex
 
using wregex = TC_REGEX_NAMESPACE ::wregex
 
template<typename... Args>
using FormatString = fmt::format_string< Args... >
 
using FormatStringView = fmt::string_view
 
using FormatArgs = fmt::format_args
 
template<typename... Ts>
using is_tuple_t = std::bool_constant< is_tuple_v< Ts... > >
 
template<typename T , typename... Us>
using tuple_has_type_t = std::bool_constant< tuple_has_type_v< T, Us... > >
 
template<template< typename... > typename Check, typename... Ts>
using find_type_in_list_if = decltype(Impl::find_type_in_list_if_impl< Check, Ts... >())
 

Enumerations

enum class  WorldObjectSearcherContinuation { Continue , Return }
 
enum class  WorldObjectSpellAreaTargetSearchReason { Area , Chain }
 

Functions

void Assert (char const *file, int line, char const *function, char const *message, std::string debugInfo) noexcept
 
void Assert (char const *file, int line, char const *function, char const *message, std::string debugInfo, char const *format,...) noexcept
 
void Fatal (char const *file, int line, char const *function, char const *message,...) noexcept
 
void Error (char const *file, int line, char const *function, char const *message) noexcept
 
void Warning (char const *file, int line, char const *function, char const *message) noexcept
 
void Abort (char const *file, int line, char const *function) noexcept
 
void Abort (char const *file, int line, char const *function, char const *message,...) noexcept
 
void AbortHandler (int sigval) noexcept
 
template<typename T >
void hash_combine (std::size_t &seed, T const &val)
 
template<typename Ptr , typename Del >
requires std::invocable<Del, Ptr> && std::is_pointer_v<Ptr>
Impl::stateful_unique_ptr_deleter< Ptr, Del > unique_ptr_deleter (Del deleter)
 
template<typename Ptr , auto Del>
requires std::invocable<decltype(Del), Ptr> && std::is_pointer_v<Ptr>
Impl::stateless_unique_ptr_deleter< Ptr, Del > unique_ptr_deleter ()
 
template<typename Ptr , typename T = std::remove_pointer_t<Ptr>, typename Del >
requires std::invocable<Del, Ptr> && std::is_pointer_v<Ptr>
std::unique_ptr< T, Impl::stateful_unique_ptr_deleter< Ptr, Del > > make_unique_ptr_with_deleter (Ptr ptr, Del deleter)
 
template<auto Del, typename Ptr , typename T = std::remove_pointer_t<Ptr>>
requires std::invocable<decltype(Del), Ptr> && std::is_pointer_v<Ptr>
std::unique_ptr< T, Impl::stateless_unique_ptr_deleter< Ptr, Del > > make_unique_ptr_with_deleter (Ptr ptr)
 
int32 StartProcess (std::string executable, std::vector< std::string > args, std::string logger, std::string input_file, bool secure)
 
std::shared_ptr< AsyncProcessResultStartAsyncProcess (std::string executable, std::vector< std::string > args, std::string logger, std::string input_file, bool secure)
 
std::string SearchExecutableInPath (std::string const &filename)
 
template<typename Result , typename... Params>
Optional< Result > StringTo (std::string_view str, Params &&... params)
 
template<typename Type , typename... Params>
std::string ToString (Type &&val, Params &&... params)
 
template<typename... Args>
constexpr auto MakeFormatArgs (Args &&... args)
 
template<typename OutputIt >
OutputIt StringVFormatTo (OutputIt out, FormatStringView fmt, FormatArgs args) noexcept
 
template<typename... Args>
std::string StringFormat (FormatString< Args... > fmt, Args &&... args) noexcept
 Default TC string format function.
 
template<typename OutputIt , typename... Args>
OutputIt StringFormatTo (OutputIt out, FormatString< Args... > fmt, Args &&... args) noexcept
 
bool IsFormatEmptyOrNull (char const *fmt)
 Returns true if the given char pointer is null.
 
bool IsFormatEmptyOrNull (std::string const &fmt)
 Returns true if the given std::string is empty.
 
constexpr bool IsFormatEmptyOrNull (std::string_view fmt)
 Returns true if the given std::string_view is empty.
 
constexpr bool IsFormatEmptyOrNull (fmt::string_view fmt)
 
template<class T , class Tuple >
T * new_from_tuple (Tuple &&args)
 
template<typename T1 , typename T2 >
bool operator== (unique_trackable_ptr< T1 > const &left, unique_trackable_ptr< T2 > const &right)
 
template<typename T1 , typename T2 >
std::strong_ordering operator<=> (unique_trackable_ptr< T1 > const &left, unique_trackable_ptr< T2 > const &right)
 
template<typename T1 >
bool operator== (unique_trackable_ptr< T1 > const &left, std::nullptr_t)
 
template<typename T1 >
std::strong_ordering operator<=> (unique_trackable_ptr< T1 > const &left, std::nullptr_t)
 
template<typename T , typename... Args>
std::enable_if_t<!std::is_array_v< T >, unique_trackable_ptr< T > > make_unique_trackable (Args &&... args)
 
template<typename T >
std::enable_if_t< std::is_unbounded_array_v< T >, unique_trackable_ptr< T > > make_unique_trackable (std::size_t N)
 
template<typename T >
std::enable_if_t< std::is_unbounded_array_v< T >, unique_trackable_ptr< T > > make_unique_trackable (std::size_t N, std::remove_extent_t< T > const &val)
 
template<typename T >
std::enable_if_t< std::is_bounded_array_v< T >, unique_trackable_ptr< T > > make_unique_trackable ()
 
template<typename T >
std::enable_if_t< std::is_bounded_array_v< T >, unique_trackable_ptr< T > > make_unique_trackable (std::remove_extent_t< T > const &val)
 
template<class To , class From >
unique_weak_ptr< To > static_pointer_cast (unique_weak_ptr< From > const &other)
 
template<class To , class From >
unique_weak_ptr< To > const_pointer_cast (unique_weak_ptr< From > const &other)
 
template<class To , class From >
unique_weak_ptr< To > reinterpret_pointer_cast (unique_weak_ptr< From > const &other)
 
template<class To , class From >
unique_weak_ptr< To > dynamic_pointer_cast (unique_weak_ptr< From > const &other)
 
template<typename T1 , typename T2 >
bool operator== (unique_strong_ref_ptr< T1 > const &left, unique_strong_ref_ptr< T2 > const &right)
 
template<typename T1 , typename T2 >
std::strong_ordering operator<=> (unique_strong_ref_ptr< T1 > const &left, unique_strong_ref_ptr< T2 > const &right)
 
template<typename T1 >
bool operator== (unique_strong_ref_ptr< T1 > const &left, std::nullptr_t)
 
template<typename T1 >
std::strong_ordering operator<=> (unique_strong_ref_ptr< T1 > const &left, std::nullptr_t)
 
template<class To , class From >
unique_strong_ref_ptr< To > static_pointer_cast (unique_strong_ref_ptr< From > const &other)
 
template<class To , class From >
unique_strong_ref_ptr< To > static_pointer_cast (unique_strong_ref_ptr< From > &&other)
 
template<class To , class From >
unique_strong_ref_ptr< To > const_pointer_cast (unique_strong_ref_ptr< From > const &other)
 
template<class To , class From >
unique_strong_ref_ptr< To > const_pointer_cast (unique_strong_ref_ptr< From > &&other)
 
template<class To , class From >
unique_strong_ref_ptr< To > reinterpret_pointer_cast (unique_strong_ref_ptr< From > const &other)
 
template<class To , class From >
unique_strong_ref_ptr< To > reinterpret_pointer_cast (unique_strong_ref_ptr< From > &&other)
 
template<class To , class From >
unique_strong_ref_ptr< To > dynamic_pointer_cast (unique_strong_ref_ptr< From > const &other)
 
template<class To , class From >
unique_strong_ref_ptr< To > dynamic_pointer_cast (unique_strong_ref_ptr< From > &&other)
 
TC_COMMON_API void VerifyOsVersion ()
 
TC_COMMON_API std::vector< std::string_view > Tokenize (std::string_view str, char sep, bool keepEmpty)
 
std::vector< std::string_view > Tokenize (std::string &&, char, bool)=delete
 
std::vector< std::string_view > Tokenize (std::string const &&, char, bool)=delete
 
std::vector< std::string_view > Tokenize (char const *str, char sep, bool keepEmpty)
 
template<typename T >
std::string GetTypeName ()
 
template<typename T >
std::string GetTypeName (T &&v)
 
template<class RET_TYPE , int CENTER_VAL>
RET_TYPE Compute (float x, float y, float center_offset, float size)
 
GridCoord ComputeGridCoord (float x, float y)
 
GridCoord ComputeGridCoordSimple (float x, float y)
 
CellCoord ComputeCellCoord (float x, float y)
 
CellCoord ComputeCellCoord (float x, float y, float &x_off, float &y_off)
 
void NormalizeMapCoord (float &c)
 
bool IsValidMapCoord (float c)
 
bool IsValidMapCoord (float x, float y)
 
bool IsValidMapCoord (float x, float y, float z)
 
bool IsValidMapCoord (float x, float y, float z, float o)
 
template<class Check , typename Container >
 WorldObjectListSearcher (PhaseShift const &, Container &, Check const &) -> WorldObjectListSearcher< Check const >
 
template<class Check , typename Container >
 WorldObjectListSearcher (WorldObject const *, Container &, Check const &) -> WorldObjectListSearcher< Check const >
 
template<class Check , typename Container >
 GameObjectListSearcher (PhaseShift const &, Container &, Check const &) -> GameObjectListSearcher< Check const >
 
template<class Check , typename Container >
 GameObjectListSearcher (WorldObject const *, Container &, Check const &) -> GameObjectListSearcher< Check const >
 
uint32 GetExpansionForLevel (uint32 level)
 
void SelectRandomInjuredTargets (std::list< WorldObject * > &targets, size_t maxTargets, bool prioritizePlayers, Unit const *prioritizeGroupMembersOf)
 
void SortTargetsWithPriorityRules (std::list< WorldObject * > &targets, size_t maxTargets, std::span< TargetPriorityRule const > rules)
 
template<std::size_t N>
void SortTargetsWithPriorityRules (std::list< WorldObject * > &targets, size_t maxTargets, std::array< TargetPriorityRule, N > const &rules)
 

Variables

template<typename... Ts>
constexpr bool is_tuple_v = false
 
template<typename T , typename... Us>
constexpr bool tuple_has_type_v = false
 
template<std::size_t I>
constexpr auto TupleElement = []<typename Tuple>(Tuple&& tuple) constexpr -> decltype(auto) { return std::get<I>(std::forward<Tuple>(tuple)); }
 
template<typename T , typename... Us>
constexpr bool has_type_in_list_v = std::disjunction_v<std::is_same<T, Us>...>
 
template<typename T >
constexpr bool dependant_false_v = dependant_false<T>::value
 

Typedef Documentation

◆ find_type_in_list_if

template<template< typename... > typename Check, typename... Ts>
using Trinity::find_type_in_list_if = typedef decltype(Impl::find_type_in_list_if_impl<Check, Ts...>())

Definition at line 64 of file Types.h.

◆ FormatArgs

using Trinity::FormatArgs = typedef fmt::format_args

Definition at line 33 of file StringFormat.h.

◆ FormatString

template<typename... Args>
using Trinity::FormatString = typedef fmt::format_string<Args...>

Definition at line 29 of file StringFormat.h.

◆ FormatStringView

using Trinity::FormatStringView = typedef fmt::string_view

Definition at line 31 of file StringFormat.h.

◆ is_tuple_t

template<typename... Ts>
using Trinity::is_tuple_t = typedef std::bool_constant<is_tuple_v<Ts...> >

Definition at line 32 of file Tuples.h.

◆ regex

Definition at line 28 of file Regex.h.

◆ tuple_has_type_t

template<typename T , typename... Us>
using Trinity::tuple_has_type_t = typedef std::bool_constant<tuple_has_type_v<T, Us...> >

Definition at line 41 of file Tuples.h.

◆ wregex

Definition at line 29 of file Regex.h.

Enumeration Type Documentation

◆ WorldObjectSearcherContinuation

Enumerator
Continue 
Return 

Definition at line 250 of file GridNotifiers.h.

◆ WorldObjectSpellAreaTargetSearchReason

Enumerator
Area 
Chain 

Definition at line 1038 of file Spell.h.

Function Documentation

◆ Abort() [1/2]

TC_COMMON_API void Trinity::Abort ( char const *  file,
int  line,
char const *  function 
)
noexcept

Definition at line 135 of file Errors.cpp.

+ Here is the call graph for this function:

◆ Abort() [2/2]

TC_COMMON_API void Trinity::Abort ( char const *  file,
int  line,
char const *  function,
char const *  message,
  ... 
)
noexcept

Definition at line 143 of file Errors.cpp.

+ Here is the call graph for this function:

◆ AbortHandler()

TC_COMMON_API void Trinity::AbortHandler ( int  sigval)
noexcept

Definition at line 160 of file Errors.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Assert() [1/2]

TC_COMMON_API void Trinity::Assert ( char const *  file,
int  line,
char const *  function,
char const *  message,
std::string  debugInfo 
)
noexcept

Definition at line 76 of file Errors.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Assert() [2/2]

TC_COMMON_API void Trinity::Assert ( char const *  file,
int  line,
char const *  function,
char const *  message,
std::string  debugInfo,
char const *  format,
  ... 
)
noexcept

Definition at line 84 of file Errors.cpp.

+ Here is the call graph for this function:

◆ Compute()

template<class RET_TYPE , int CENTER_VAL>
RET_TYPE Trinity::Compute ( float  x,
float  y,
float  center_offset,
float  size 
)
inline

Definition at line 179 of file GridDefines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeCellCoord() [1/2]

CellCoord Trinity::ComputeCellCoord ( float  x,
float  y 
)
inline

Definition at line 202 of file GridDefines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeCellCoord() [2/2]

CellCoord Trinity::ComputeCellCoord ( float  x,
float  y,
float &  x_off,
float &  y_off 
)
inline

Definition at line 207 of file GridDefines.h.

+ Here is the call graph for this function:

◆ ComputeGridCoord()

GridCoord Trinity::ComputeGridCoord ( float  x,
float  y 
)
inline

Definition at line 190 of file GridDefines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeGridCoordSimple()

GridCoord Trinity::ComputeGridCoordSimple ( float  x,
float  y 
)
inline

Definition at line 195 of file GridDefines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ const_pointer_cast() [1/3]

template<class To , class From >
unique_strong_ref_ptr< To > Trinity::const_pointer_cast ( unique_strong_ref_ptr< From > &&  other)

Definition at line 478 of file UniqueTrackablePtr.h.

◆ const_pointer_cast() [2/3]

template<class To , class From >
unique_strong_ref_ptr< To > Trinity::const_pointer_cast ( unique_strong_ref_ptr< From > const &  other)

Definition at line 472 of file UniqueTrackablePtr.h.

◆ const_pointer_cast() [3/3]

template<class To , class From >
unique_weak_ptr< To > Trinity::const_pointer_cast ( unique_weak_ptr< From > const &  other)

Definition at line 410 of file UniqueTrackablePtr.h.

◆ dynamic_pointer_cast() [1/3]

template<class To , class From >
unique_strong_ref_ptr< To > Trinity::dynamic_pointer_cast ( unique_strong_ref_ptr< From > &&  other)

Definition at line 502 of file UniqueTrackablePtr.h.

◆ dynamic_pointer_cast() [2/3]

template<class To , class From >
unique_strong_ref_ptr< To > Trinity::dynamic_pointer_cast ( unique_strong_ref_ptr< From > const &  other)

Definition at line 496 of file UniqueTrackablePtr.h.

◆ dynamic_pointer_cast() [3/3]

template<class To , class From >
unique_weak_ptr< To > Trinity::dynamic_pointer_cast ( unique_weak_ptr< From > const &  other)

Definition at line 426 of file UniqueTrackablePtr.h.

◆ Error()

TC_COMMON_API void TC_COMMON_API void TC_COMMON_API void Trinity::Error ( char const *  file,
int  line,
char const *  function,
char const *  message 
)
noexcept

Definition at line 121 of file Errors.cpp.

+ Here is the call graph for this function:

◆ Fatal()

TC_COMMON_API void TC_COMMON_API void Trinity::Fatal ( char const *  file,
int  line,
char const *  function,
char const *  message,
  ... 
)
noexcept

Definition at line 103 of file Errors.cpp.

+ Here is the call graph for this function:

◆ GameObjectListSearcher() [1/2]

template<class Check , typename Container >
Trinity::GameObjectListSearcher ( PhaseShift const &  ,
Container &  ,
Check const &   
) -> GameObjectListSearcher< Check const >

◆ GameObjectListSearcher() [2/2]

template<class Check , typename Container >
Trinity::GameObjectListSearcher ( WorldObject const *  ,
Container &  ,
Check const &   
) -> GameObjectListSearcher< Check const >

◆ GetExpansionForLevel()

uint32 Trinity::GetExpansionForLevel ( uint32  level)
inline

Definition at line 31 of file Formulas.h.

+ Here is the caller graph for this function:

◆ GetTypeName() [1/2]

template<typename T >
std::string Trinity::GetTypeName ( )

Definition at line 588 of file Util.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeName() [2/2]

template<typename T >
std::string Trinity::GetTypeName ( T &&  v)

Definition at line 590 of file Util.h.

+ Here is the call graph for this function:

◆ hash_combine()

template<typename T >
void Trinity::hash_combine ( std::size_t &  seed,
T const &  val 
)
inline

Definition at line 28 of file Hash.h.

+ Here is the caller graph for this function:

◆ IsFormatEmptyOrNull() [1/4]

bool Trinity::IsFormatEmptyOrNull ( char const *  fmt)
inline

Returns true if the given char pointer is null.

Definition at line 69 of file StringFormat.h.

+ Here is the caller graph for this function:

◆ IsFormatEmptyOrNull() [2/4]

constexpr bool Trinity::IsFormatEmptyOrNull ( fmt::string_view  fmt)
inlineconstexpr

Definition at line 86 of file StringFormat.h.

◆ IsFormatEmptyOrNull() [3/4]

bool Trinity::IsFormatEmptyOrNull ( std::string const &  fmt)
inline

Returns true if the given std::string is empty.

Definition at line 75 of file StringFormat.h.

◆ IsFormatEmptyOrNull() [4/4]

constexpr bool Trinity::IsFormatEmptyOrNull ( std::string_view  fmt)
inlineconstexpr

Returns true if the given std::string_view is empty.

Definition at line 81 of file StringFormat.h.

◆ IsValidMapCoord() [1/4]

bool Trinity::IsValidMapCoord ( float  c)
inline

Definition at line 227 of file GridDefines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsValidMapCoord() [2/4]

bool Trinity::IsValidMapCoord ( float  x,
float  y 
)
inline

Definition at line 232 of file GridDefines.h.

+ Here is the call graph for this function:

◆ IsValidMapCoord() [3/4]

bool Trinity::IsValidMapCoord ( float  x,
float  y,
float  z 
)
inline

Definition at line 237 of file GridDefines.h.

+ Here is the call graph for this function:

◆ IsValidMapCoord() [4/4]

bool Trinity::IsValidMapCoord ( float  x,
float  y,
float  z,
float  o 
)
inline

Definition at line 242 of file GridDefines.h.

+ Here is the call graph for this function:

◆ make_unique_ptr_with_deleter() [1/2]

template<auto Del, typename Ptr , typename T = std::remove_pointer_t<Ptr>>
requires std::invocable<decltype(Del), Ptr> && std::is_pointer_v<Ptr>
std::unique_ptr< T, Impl::stateless_unique_ptr_deleter< Ptr, Del > > Trinity::make_unique_ptr_with_deleter ( Ptr  ptr)
inline

Utility function to construct a std::unique_ptr object with custom stateless deleter (function pointer, captureless lambda)

Template Parameters
DelThe freeing function. This can be either a free function pointer that accepts T* as argument, pointer to a member function of T that accepts no arguments or a lambda with no captures
PtrType of the pointer
TType of the pointed-to object (defaults to std::remove_pointer_t<Ptr>)
Parameters
ptrRaw pointer to owned object

Example uses

void DestroyResource(Resource*);
class Resource
{
void Destroy();
};
// Free function
auto free = Trinity::make_unique_ptr_with_deleter<&DestroyResource>(new Resource());
// Member function
auto member = Trinity::make_unique_ptr_with_deleter<&Resource::Destroy>(new Resource());
// Lambda
auto lambda = Trinity::make_unique_ptr_with_deleter<[](Resource* res){ res->Destroy(); }>(new Resource());
std::unique_ptr< T, Impl::stateful_unique_ptr_deleter< Ptr, Del > > make_unique_ptr_with_deleter(Ptr ptr, Del deleter)
Definition Memory.h:133

Definition at line 164 of file Memory.h.

◆ make_unique_ptr_with_deleter() [2/2]

template<typename Ptr , typename T = std::remove_pointer_t<Ptr>, typename Del >
requires std::invocable<Del, Ptr> && std::is_pointer_v<Ptr>
std::unique_ptr< T, Impl::stateful_unique_ptr_deleter< Ptr, Del > > Trinity::make_unique_ptr_with_deleter ( Ptr  ptr,
Del  deleter 
)
inline

Utility function to construct a std::unique_ptr object with custom stateful deleter (such as lambda with captures)

Template Parameters
PtrType of the pointer
TType of the pointed-to object (defaults to std::remove_pointer_t<Ptr>)
DelType of object freeing function (deduced from second argument)
Parameters
ptrRaw pointer to owned object
deleterObject deleter

Example use

class Resource
{
};
class ResourceService
{
Resource* Create();
void Destroy(Resource*);
};
ResourceService* service = GetResourceService();
// Lambda that captures all required variables for destruction
auto resource = Trinity::make_unique_ptr_with_deleter(service->Create(), [service](Resource* res){ service->Destroy(res); });

Definition at line 133 of file Memory.h.

+ Here is the caller graph for this function:

◆ make_unique_trackable() [1/5]

template<typename T >
std::enable_if_t< std::is_bounded_array_v< T >, unique_trackable_ptr< T > > Trinity::make_unique_trackable ( )

Definition at line 384 of file UniqueTrackablePtr.h.

◆ make_unique_trackable() [2/5]

template<typename T , typename... Args>
std::enable_if_t<!std::is_array_v< T >, unique_trackable_ptr< T > > Trinity::make_unique_trackable ( Args &&...  args)

Definition at line 360 of file UniqueTrackablePtr.h.

◆ make_unique_trackable() [3/5]

template<typename T >
std::enable_if_t< std::is_bounded_array_v< T >, unique_trackable_ptr< T > > Trinity::make_unique_trackable ( std::remove_extent_t< T > const &  val)

Definition at line 392 of file UniqueTrackablePtr.h.

◆ make_unique_trackable() [4/5]

template<typename T >
std::enable_if_t< std::is_unbounded_array_v< T >, unique_trackable_ptr< T > > Trinity::make_unique_trackable ( std::size_t  N)

Definition at line 368 of file UniqueTrackablePtr.h.

◆ make_unique_trackable() [5/5]

template<typename T >
std::enable_if_t< std::is_unbounded_array_v< T >, unique_trackable_ptr< T > > Trinity::make_unique_trackable ( std::size_t  N,
std::remove_extent_t< T > const &  val 
)

Definition at line 376 of file UniqueTrackablePtr.h.

◆ MakeFormatArgs()

template<typename... Args>
constexpr auto Trinity::MakeFormatArgs ( Args &&...  args)
constexpr

Definition at line 36 of file StringFormat.h.

+ Here is the caller graph for this function:

◆ new_from_tuple()

template<class T , class Tuple >
T * Trinity::new_from_tuple ( Tuple &&  args)
inline

Definition at line 53 of file Tuples.h.

◆ NormalizeMapCoord()

void Trinity::NormalizeMapCoord ( float &  c)
inline

Definition at line 219 of file GridDefines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<=>() [1/4]

template<typename T1 >
std::strong_ordering Trinity::operator<=> ( unique_strong_ref_ptr< T1 > const &  left,
std::nullptr_t   
)

Definition at line 454 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:

◆ operator<=>() [2/4]

template<typename T1 , typename T2 >
std::strong_ordering Trinity::operator<=> ( unique_strong_ref_ptr< T1 > const &  left,
unique_strong_ref_ptr< T2 > const &  right 
)

Definition at line 442 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:

◆ operator<=>() [3/4]

template<typename T1 >
std::strong_ordering Trinity::operator<=> ( unique_trackable_ptr< T1 > const &  left,
std::nullptr_t   
)

Definition at line 354 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:

◆ operator<=>() [4/4]

template<typename T1 , typename T2 >
std::strong_ordering Trinity::operator<=> ( unique_trackable_ptr< T1 > const &  left,
unique_trackable_ptr< T2 > const &  right 
)

Definition at line 342 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:

◆ operator==() [1/4]

template<typename T1 >
bool Trinity::operator== ( unique_strong_ref_ptr< T1 > const &  left,
std::nullptr_t   
)

Definition at line 448 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:

◆ operator==() [2/4]

template<typename T1 , typename T2 >
bool Trinity::operator== ( unique_strong_ref_ptr< T1 > const &  left,
unique_strong_ref_ptr< T2 > const &  right 
)

Definition at line 436 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:

◆ operator==() [3/4]

template<typename T1 >
bool Trinity::operator== ( unique_trackable_ptr< T1 > const &  left,
std::nullptr_t   
)

Definition at line 348 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:

◆ operator==() [4/4]

template<typename T1 , typename T2 >
bool Trinity::operator== ( unique_trackable_ptr< T1 > const &  left,
unique_trackable_ptr< T2 > const &  right 
)

Definition at line 336 of file UniqueTrackablePtr.h.

+ Here is the call graph for this function:

◆ reinterpret_pointer_cast() [1/3]

template<class To , class From >
unique_strong_ref_ptr< To > Trinity::reinterpret_pointer_cast ( unique_strong_ref_ptr< From > &&  other)

Definition at line 490 of file UniqueTrackablePtr.h.

◆ reinterpret_pointer_cast() [2/3]

template<class To , class From >
unique_strong_ref_ptr< To > Trinity::reinterpret_pointer_cast ( unique_strong_ref_ptr< From > const &  other)

Definition at line 484 of file UniqueTrackablePtr.h.

◆ reinterpret_pointer_cast() [3/3]

template<class To , class From >
unique_weak_ptr< To > Trinity::reinterpret_pointer_cast ( unique_weak_ptr< From > const &  other)

Definition at line 418 of file UniqueTrackablePtr.h.

◆ SearchExecutableInPath()

TC_COMMON_API std::string Trinity::SearchExecutableInPath ( std::string const &  filename)

Searches for the given executable in the PATH variable and returns a non-empty string when it was found.

Definition at line 223 of file StartProcess.cpp.

+ Here is the caller graph for this function:

◆ SelectRandomInjuredTargets()

TC_GAME_API void Trinity::SelectRandomInjuredTargets ( std::list< WorldObject * > &  targets,
size_t  maxTargets,
bool  prioritizePlayers,
Unit const *  prioritizeGroupMembersOf 
)
private

Definition at line 9577 of file Spell.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SortTargetsWithPriorityRules() [1/2]

template<std::size_t N>
void Trinity::SortTargetsWithPriorityRules ( std::list< WorldObject * > &  targets,
size_t  maxTargets,
std::array< TargetPriorityRule, N > const &  rules 
)
inline

Definition at line 1112 of file Spell.h.

+ Here is the call graph for this function:

◆ SortTargetsWithPriorityRules() [2/2]

TC_GAME_API void Trinity::SortTargetsWithPriorityRules ( std::list< WorldObject * > &  targets,
size_t  maxTargets,
std::span< TargetPriorityRule const >  rules 
)
private

Definition at line 9642 of file Spell.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartAsyncProcess()

TC_COMMON_API std::shared_ptr< AsyncProcessResult > Trinity::StartAsyncProcess ( std::string  executable,
std::vector< std::string >  args,
std::string  logger,
std::string  input_file = "",
bool  secure = false 
)

Starts a process asynchronously with the given arguments and parameters and returns an AsyncProcessResult immediately which is set, when the process exits. When an input path is given, the file will be routed to the processes stdin. When the process is marked as secure no arguments are leaked to logs. Note that most executables expect it's name as the first argument.

Definition at line 213 of file StartProcess.cpp.

◆ StartProcess()

TC_COMMON_API int32 Trinity::StartProcess ( std::string  executable,
std::vector< std::string >  args,
std::string  logger,
std::string  input_file = "",
bool  secure = false 
)

Starts a process with the given arguments and parameters and will block until the process is finished. When an input path is given, the file will be routed to the processes stdin. When the process is marked as secure no arguments are leaked to logs. Note that most executables expect it's name as the first argument.

Definition at line 204 of file StartProcess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ static_pointer_cast() [1/3]

template<class To , class From >
unique_strong_ref_ptr< To > Trinity::static_pointer_cast ( unique_strong_ref_ptr< From > &&  other)

Definition at line 466 of file UniqueTrackablePtr.h.

◆ static_pointer_cast() [2/3]

template<class To , class From >
unique_strong_ref_ptr< To > Trinity::static_pointer_cast ( unique_strong_ref_ptr< From > const &  other)

Definition at line 460 of file UniqueTrackablePtr.h.

◆ static_pointer_cast() [3/3]

template<class To , class From >
unique_weak_ptr< To > Trinity::static_pointer_cast ( unique_weak_ptr< From > const &  other)

Definition at line 402 of file UniqueTrackablePtr.h.

◆ StringFormat()

template<typename... Args>
std::string Trinity::StringFormat ( FormatString< Args... >  fmt,
Args &&...  args 
)
inlinenoexcept

Default TC string format function.

Definition at line 57 of file StringFormat.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StringFormatTo()

template<typename OutputIt , typename... Args>
OutputIt Trinity::StringFormatTo ( OutputIt  out,
FormatString< Args... >  fmt,
Args &&...  args 
)
inlinenoexcept

Definition at line 63 of file StringFormat.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StringTo()

template<typename Result , typename... Params>
Optional< Result > Trinity::StringTo ( std::string_view  str,
Params &&...  params 
)

Definition at line 266 of file StringConvert.h.

+ Here is the caller graph for this function:

◆ StringVFormatTo()

template<typename OutputIt >
OutputIt Trinity::StringVFormatTo ( OutputIt  out,
FormatStringView  fmt,
FormatArgs  args 
)
inlinenoexcept

Definition at line 48 of file StringFormat.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Tokenize() [1/4]

std::vector< std::string_view > Trinity::Tokenize ( char const *  str,
char  sep,
bool  keepEmpty 
)
inline

Definition at line 52 of file Util.h.

+ Here is the call graph for this function:

◆ Tokenize() [2/4]

std::vector< std::string_view > Trinity::Tokenize ( std::string &&  ,
char  ,
bool   
)
delete

◆ Tokenize() [3/4]

std::vector< std::string_view > Trinity::Tokenize ( std::string const &&  ,
char  ,
bool   
)
delete

◆ Tokenize() [4/4]

std::vector< std::string_view > Trinity::Tokenize ( std::string_view  str,
char  sep,
bool  keepEmpty 
)

Definition at line 57 of file Util.cpp.

+ Here is the caller graph for this function:

◆ ToString()

template<typename Type , typename... Params>
std::string Trinity::ToString ( Type &&  val,
Params &&...  params 
)

Definition at line 272 of file StringConvert.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unique_ptr_deleter() [1/2]

template<typename Ptr , auto Del>
requires std::invocable<decltype(Del), Ptr> && std::is_pointer_v<Ptr>
Impl::stateless_unique_ptr_deleter< Ptr, Del > Trinity::unique_ptr_deleter ( )

Convenience function to construct type aliases for std::unique_ptr stateful deleters (such as lambda with captures)

Main use is for forming struct/class members without the call to make_unique_ptr_with_deleter

Template Parameters
PtrType of the pointer
DelThe freeing function. This can be either a free function pointer that accepts T* as argument, pointer to a member function of T that accepts no arguments or a lambda with no captures

Example use

using FileDeleter = decltype(Trinity::unique_ptr_deleter<FILE*, &::fclose>());
class Resource
{
std::unique_ptr<FILE, FileDeleter> File;
};

Definition at line 102 of file Memory.h.

◆ unique_ptr_deleter() [2/2]

template<typename Ptr , typename Del >
requires std::invocable<Del, Ptr> && std::is_pointer_v<Ptr>
Impl::stateful_unique_ptr_deleter< Ptr, Del > Trinity::unique_ptr_deleter ( Del  deleter)

Convenience function to construct type aliases for std::unique_ptr stateful deleters (such as lambda with captures)

Template Parameters
PtrType of the pointer
DelType of object freeing function (deduced from argument)
Parameters
deleterObject deleter

Example use

void FreeV1(Resource*);
void FreeV2(Resource*);
using ResourceDeleter = decltype(Trinity::unique_ptr_deleter<Resource*>(&FreeV1));
std::unique_ptr<Resource, ResourceDeleter> resource = Trinity::make_unique_ptr_with_deleter(GetResourceV1(), &FreeV1);
// do stuff ...
// ... later get new resource
resource = Trinity::make_unique_ptr_with_deleter(GetResourceV2(), &FreeV2);

Definition at line 79 of file Memory.h.

◆ VerifyOsVersion()

void Trinity::VerifyOsVersion ( )

Definition at line 35 of file Util.cpp.

+ Here is the caller graph for this function:

◆ Warning()

TC_COMMON_API void Trinity::Warning ( char const *  file,
int  line,
char const *  function,
char const *  message 
)
noexcept

Definition at line 129 of file Errors.cpp.

◆ WorldObjectListSearcher() [1/2]

template<class Check , typename Container >
Trinity::WorldObjectListSearcher ( PhaseShift const &  ,
Container &  ,
Check const &   
) -> WorldObjectListSearcher< Check const >

◆ WorldObjectListSearcher() [2/2]

template<class Check , typename Container >
Trinity::WorldObjectListSearcher ( WorldObject const *  ,
Container &  ,
Check const &   
) -> WorldObjectListSearcher< Check const >

Variable Documentation

◆ dependant_false_v

template<typename T >
constexpr bool Trinity::dependant_false_v = dependant_false<T>::value
constexpr

Definition at line 73 of file Types.h.

◆ has_type_in_list_v

template<typename T , typename... Us>
constexpr bool Trinity::has_type_in_list_v = std::disjunction_v<std::is_same<T, Us>...>
constexpr

Definition at line 67 of file Types.h.

◆ is_tuple_v

template<typename... Ts>
constexpr bool Trinity::is_tuple_v< std::tuple< Ts... > > = false
constexpr

Definition at line 26 of file Tuples.h.

◆ tuple_has_type_v

template<typename T , typename... Us>
constexpr bool Trinity::tuple_has_type_v< T, std::tuple< Us... > > = false
constexpr

Definition at line 35 of file Tuples.h.

◆ TupleElement

template<std::size_t I>
constexpr auto Trinity::TupleElement = []<typename Tuple>(Tuple&& tuple) constexpr -> decltype(auto) { return std::get<I>(std::forward<Tuple>(tuple)); }
inlineconstexpr

Definition at line 59 of file Tuples.h.