TrinityCore
Trinity Namespace Reference

Namespaces

 Asio
 
 Banner
 
 ChatCommands
 
 Containers
 
 Crypto
 
 Currency
 
 Encoding
 
 Honor
 
 
 Impl
 
 Legacy
 
 Net
 
 Predicates
 
 SpellScripts
 
 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  AnyPlayerInObjectRangeCheck
 
class  AnyPlayerInPositionRangeCheck
 
class  AnyUnfriendlyUnitInObjectRangeCheck
 
class  AnyUnitInObjectRangeCheck
 
class  AsyncProcessResult
 
class  AsyncProcessResultImplementation
 
class  BroadcastTextBuilder
 
class  CallOfHelpCreatureInRangeDo
 
class  ChatPacketSender
 
class  CheckedBufferOutputIterator
 
class  ContainerInserter
 
struct  CreatureLastSearcher
 
struct  CreatureListSearcher
 
struct  CreatureRelocationNotifier
 
struct  CreatureSearcher
 
class  CreatureTextTextBuilder
 
struct  CreatureWorker
 
class  CustomChatTextBuilder
 
struct  DelayedUnitRelocation
 
struct  dependant_false
 
struct  find_type_if
 
struct  find_type_if< Check >
 
struct  find_type_if< Check, T1, Ts... >
 
class  FriendlyBelowHpPctEntryInRange
 
class  FriendlyCCedInRange
 
class  FriendlyMissingBuffInRange
 
class  GameObjectFocusCheck
 
class  GameObjectInRangeCheck
 
struct  GameObjectLastSearcher
 
struct  GameObjectListSearcher
 
struct  GameObjectSearcher
 
struct  GameObjectWorker
 
struct  GridUpdater
 
struct  has_type
 
struct  has_type< T, std::tuple< Us... > >
 
class  HealthPctOrderPred
 
class  HeightDifferenceCheck
 
struct  is_tuple
 
struct  is_tuple< std::tuple< Ts... > >
 
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  NearestAssistCreatureInCreatureRangeCheck
 
class  NearestAttackableNoTotemUnitInObjectRangeCheck
 
class  NearestAttackableUnitInObjectRangeCheck
 
class  NearestCreatureEntryWithLiveStateInObjectRangeCheck
 
class  NearestGameObjectCheck
 
class  NearestGameObjectEntryInObjectRangeCheck
 
class  NearestGameObjectFishingHole
 
class  NearestGameObjectTypeInObjectRangeCheck
 
class  NearestHostileUnitCheck
 
class  NearestHostileUnitInAggroRangeCheck
 
class  NearestHostileUnitInAttackDistanceCheck
 
class  NearestPlayerInObjectRangeCheck
 
class  NearestUnspawnedGameObjectEntryInObjectRangeCheck
 
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  PlayerWorker
 
class  PowerPctOrderPred
 
struct  RaceMask
 
class  RespawnDo
 
class  TCLogSink
 
class  TrinityStringChatBuilder
 
class  UnitAuraCheck
 
struct  UnitLastSearcher
 
struct  UnitListSearcher
 
struct  UnitSearcher
 
struct  VisibleChangesNotifier
 
struct  VisibleNotifier
 
struct  WorldObjectLastSearcher
 
struct  WorldObjectListSearcher
 
struct  WorldObjectSearcher
 
struct  WorldObjectSpellAreaTargetCheck
 
struct  WorldObjectSpellConeTargetCheck
 
struct  WorldObjectSpellLineTargetCheck
 
struct  WorldObjectSpellNearbyTargetCheck
 
struct  WorldObjectSpellTargetCheck
 
struct  WorldObjectSpellTrajTargetCheck
 
struct  WorldObjectWorker
 
class  WorldWorldTextBuilder
 

Typedefs

using regex = TC_REGEX_NAMESPACE ::regex
 
using wregex = TC_REGEX_NAMESPACE ::wregex
 
template<template< typename... > typename Check, typename... Ts>
using find_type_if_t = typename find_type_if< Check, Ts... >::type
 

Functions

void Assert (char const *file, int line, char const *function, std::string debugInfo, char const *message)
 
void Assert (char const *file, int line, char const *function, std::string debugInfo, char const *message, char const *format,...)
 
void Fatal (char const *file, int line, char const *function, char const *message,...)
 
void Error (char const *file, int line, char const *function, char const *message)
 
void Warning (char const *file, int line, char const *function, char const *message)
 
void Abort (char const *file, int line, char const *function)
 
void Abort (char const *file, int line, char const *function, char const *message,...)
 
void AbortHandler (int sigval)
 
template<class T >
constexpr T * AddressOrSelf (T *ptr)
 
template<class T >
constexpr T * AddressOrSelf (T &not_ptr)
 
template<typename T >
void hash_combine (std::size_t &seed, T const &val)
 
template<typename T , typename Del >
auto make_unique_ptr_with_deleter (T ptr, Del &&deleter)
 
template<typename T >
auto MakeTCLogSink (T &&callback) -> TCLogSink< typename std::decay< T >::type >
 
template<typename T >
static int CreateChildProcess (T waiter, std::string const &executable, std::vector< std::string > const &argsVector, std::string const &logger, std::string const &input, bool secure)
 
int StartProcess (std::string const &executable, std::vector< std::string > const &args, std::string const &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 Format , typename... Args>
std::string StringFormat (Format &&fmt, Args &&... args)
 Default TC string format function. More...
 
bool IsFormatEmptyOrNull (char const *fmt)
 Returns true if the given char pointer is null. More...
 
bool IsFormatEmptyOrNull (std::string const &fmt)
 Returns true if the given std::string is empty. More...
 
template<class T , class Tuple >
T * new_from_tuple (Tuple &&args)
 
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<class SPECIFIC_TYPE , class KEY_TYPE >
bool Insert (ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *obj)
 
template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Insert (ContainerUnorderedMap< TypeNull, KEY_TYPE > &, KEY_TYPE const &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Insert (ContainerUnorderedMap< T, KEY_TYPE > &, KEY_TYPE const &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Insert (ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *obj)
 
template<class SPECIFIC_TYPE , class KEY_TYPE >
SPECIFIC_TYPE * Find (ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE >
SPECIFIC_TYPE * Find (ContainerUnorderedMap< TypeNull, KEY_TYPE > const &, KEY_TYPE const &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
SPECIFIC_TYPE * Find (ContainerUnorderedMap< T, KEY_TYPE > const &, KEY_TYPE const &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
SPECIFIC_TYPE * Find (ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > const &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Remove (ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Remove (ContainerUnorderedMap< TypeNull, KEY_TYPE > &, KEY_TYPE const &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Remove (ContainerUnorderedMap< T, KEY_TYPE > &, KEY_TYPE const &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Remove (ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Size (ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &elements, std::size_t *size, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Size (ContainerUnorderedMap< TypeNull, KEY_TYPE > const &, std::size_t *, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Size (ContainerUnorderedMap< T, KEY_TYPE > const &, std::size_t *, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Size (ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > const &elements, std::size_t *size, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE >
size_t Count (ContainerMapList< SPECIFIC_TYPE > const &elements, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE >
size_t Count (ContainerMapList< TypeNull > const &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
size_t Count (ContainerMapList< T > const &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
size_t Count (ContainerMapList< TypeList< SPECIFIC_TYPE, T >> const &elements, SPECIFIC_TYPE *fake)
 
template<class SPECIFIC_TYPE , class H , class T >
size_t Count (ContainerMapList< TypeList< H, T >> const &elements, SPECIFIC_TYPE *fake)
 
template<class SPECIFIC_TYPE >
SPECIFIC_TYPE * Insert (ContainerMapList< SPECIFIC_TYPE > &elements, SPECIFIC_TYPE *obj)
 
template<class SPECIFIC_TYPE >
SPECIFIC_TYPE * Insert (ContainerMapList< TypeNull > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
SPECIFIC_TYPE * Insert (ContainerMapList< T > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class H , class T >
SPECIFIC_TYPE * Insert (ContainerMapList< TypeList< H, T >> &elements, SPECIFIC_TYPE *obj)
 
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)
 
uint32 GetExpansionForLevel (uint32 level)
 
void SelectRandomInjuredTargets (std::list< WorldObject *> &targets, size_t maxTargets, bool prioritizePlayers)
 

Variables

template<typename T , typename... Us>
constexpr bool has_type_v = has_type<T, Us...>::value
 
template<typename... Ts>
constexpr bool is_tuple_v = is_tuple<Ts...>::value
 
template<typename T >
constexpr bool dependant_false_v = dependant_false<T>::value
 

Typedef Documentation

◆ find_type_if_t

template<template< typename... > typename Check, typename... Ts>
using Trinity::find_type_if_t = typedef typename find_type_if<Check, Ts...>::type

◆ regex

◆ wregex

Function Documentation

◆ Abort() [1/2]

TC_COMMON_API void Trinity::Abort ( char const *  file,
int  line,
char const *  function 
)
125 {
126  std::string formattedMessage = StringFormat("\n%s:%i in %s ABORTED.\n", file, line, function);
127  fprintf(stderr, "%s", formattedMessage.c_str());
128  fflush(stderr);
129  Crash(formattedMessage.c_str());
130 }
std::string StringFormat(Format &&fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:27
#define Crash(message)
Definition: Errors.cpp:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Abort() [2/2]

TC_COMMON_API void Trinity::Abort ( char const *  file,
int  line,
char const *  function,
char const *  message,
  ... 
)
133 {
134  va_list args;
135  va_start(args, message);
136 
137  std::string formattedMessage = StringFormat("\n%s:%i in %s ABORTED:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
138  va_end(args);
139 
140  fprintf(stderr, "%s", formattedMessage.c_str());
141  fflush(stderr);
142 
143  Crash(formattedMessage.c_str());
144 }
std::string StringFormat(Format &&fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:27
#define Crash(message)
Definition: Errors.cpp:39
+ Here is the call graph for this function:

◆ AbortHandler()

TC_COMMON_API void Trinity::AbortHandler ( int  sigval)
147 {
148  // nothing useful to log here, no way to pass args
149  std::string formattedMessage = StringFormat("Caught signal %i\n", sigval);
150  fprintf(stderr, "%s", formattedMessage.c_str());
151  fflush(stderr);
152  Crash(formattedMessage.c_str());
153 }
std::string StringFormat(Format &&fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:27
#define Crash(message)
Definition: Errors.cpp:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddressOrSelf() [1/2]

template<class T >
constexpr T* Trinity::AddressOrSelf ( T *  ptr)
inline
34  {
35  return ptr;
36  }
+ Here is the caller graph for this function:

◆ AddressOrSelf() [2/2]

template<class T >
constexpr T* Trinity::AddressOrSelf ( T &  not_ptr)
inline
40  {
41  return std::addressof(not_ptr);
42  }

◆ Assert() [1/2]

TC_COMMON_API void Trinity::Assert ( char const *  file,
int  line,
char const *  function,
std::string  debugInfo,
char const *  message 
)
74 {
75  std::string formattedMessage = StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + debugInfo + '\n';
76  fprintf(stderr, "%s", formattedMessage.c_str());
77  fflush(stderr);
78  Crash(formattedMessage.c_str());
79 }
std::string StringFormat(Format &&fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:27
#define Crash(message)
Definition: Errors.cpp:39
+ Here is the call graph for this function:

◆ Assert() [2/2]

TC_COMMON_API void Trinity::Assert ( char const *  file,
int  line,
char const *  function,
std::string  debugInfo,
char const *  message,
char const *  format,
  ... 
)
82 {
83  va_list args;
84  va_start(args, format);
85 
86  std::string formattedMessage = StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + FormatAssertionMessage(format, args) + '\n' + debugInfo + '\n';
87  va_end(args);
88 
89  fprintf(stderr, "%s", formattedMessage.c_str());
90  fflush(stderr);
91 
92  Crash(formattedMessage.c_str());
93 }
std::string StringFormat(Format &&fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:27
#define Crash(message)
Definition: Errors.cpp:39
+ 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
183  {
184  // calculate and store temporary values in double format for having same result as same mySQL calculations
185  double x_offset = (double(x) - center_offset)/size;
186  double y_offset = (double(y) - center_offset)/size;
187 
188  int x_val = int(x_offset + CENTER_VAL + 0.5);
189  int y_val = int(y_offset + CENTER_VAL + 0.5);
190  return RET_TYPE(x_val, y_val);
191  }

◆ ComputeCellCoord() [1/2]

CellCoord Trinity::ComputeCellCoord ( float  x,
float  y 
)
inline
206  {
207  return Compute<CellCoord, CENTER_GRID_CELL_ID>(x, y, CENTER_GRID_CELL_OFFSET, SIZE_OF_GRID_CELL);
208  }
#define SIZE_OF_GRID_CELL
Definition: GridDefines.h:48
#define CENTER_GRID_CELL_OFFSET
Definition: GridDefines.h:51
+ 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
211  {
212  double x_offset = (double(x) - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL;
213  double y_offset = (double(y) - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL;
214 
215  int x_val = int(x_offset + CENTER_GRID_CELL_ID + 0.5f);
216  int y_val = int(y_offset + CENTER_GRID_CELL_ID + 0.5f);
217  x_off = (float(x_offset) - float(x_val) + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
218  y_off = (float(y_offset) - float(y_val) + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
219  return CellCoord(x_val, y_val);
220  }
#define CENTER_GRID_CELL_ID
Definition: GridDefines.h:50
#define SIZE_OF_GRID_CELL
Definition: GridDefines.h:48
#define CENTER_GRID_CELL_OFFSET
Definition: GridDefines.h:51
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
Definition: GridDefines.h:177

◆ ComputeGridCoord()

GridCoord Trinity::ComputeGridCoord ( float  x,
float  y 
)
inline
194  {
195  return Compute<GridCoord, CENTER_GRID_ID>(x, y, CENTER_GRID_OFFSET, SIZE_OF_GRIDS);
196  }
#define SIZE_OF_GRIDS
Definition: GridDefines.h:40
#define CENTER_GRID_OFFSET
Definition: GridDefines.h:43
+ Here is the caller graph for this function:

◆ ComputeGridCoordSimple()

GridCoord Trinity::ComputeGridCoordSimple ( float  x,
float  y 
)
inline
199  {
200  int gx = (int)(CENTER_GRID_ID - x / SIZE_OF_GRIDS);
201  int gy = (int)(CENTER_GRID_ID - y / SIZE_OF_GRIDS);
202  return GridCoord((MAX_NUMBER_OF_GRIDS - 1) - gx, (MAX_NUMBER_OF_GRIDS - 1) - gy);
203  }
#define SIZE_OF_GRIDS
Definition: GridDefines.h:40
#define CENTER_GRID_ID
Definition: GridDefines.h:41
#define MAX_NUMBER_OF_GRIDS
Definition: GridDefines.h:38
CoordPair< MAX_NUMBER_OF_GRIDS > GridCoord
Definition: GridDefines.h:176
+ Here is the caller graph for this function:

◆ Count() [1/5]

template<class SPECIFIC_TYPE >
size_t Trinity::Count ( ContainerMapList< SPECIFIC_TYPE > const &  elements,
SPECIFIC_TYPE *   
)
157  {
158  return elements._element.getSize();
159  }
GridRefManager< OBJECT > _element
Definition: TypeContainer.h:40
+ Here is the caller graph for this function:

◆ Count() [2/5]

template<class SPECIFIC_TYPE >
size_t Trinity::Count ( ContainerMapList< TypeNull > const &  ,
SPECIFIC_TYPE *   
)
163  {
164  return 0;
165  }

◆ Count() [3/5]

template<class SPECIFIC_TYPE , class T >
size_t Trinity::Count ( ContainerMapList< T > const &  ,
SPECIFIC_TYPE *   
)
169  {
170  return 0;
171  }

◆ Count() [4/5]

template<class SPECIFIC_TYPE , class T >
size_t Trinity::Count ( ContainerMapList< TypeList< SPECIFIC_TYPE, T >> const &  elements,
SPECIFIC_TYPE *  fake 
)
175  {
176  return Count(elements._elements, fake);
177  }
size_t Count(ContainerMapList< TypeList< H, T >> const &elements, SPECIFIC_TYPE *fake)
Definition: TypeContainerFunctions.h:180
+ Here is the call graph for this function:

◆ Count() [5/5]

template<class SPECIFIC_TYPE , class H , class T >
size_t Trinity::Count ( ContainerMapList< TypeList< H, T >> const &  elements,
SPECIFIC_TYPE *  fake 
)
181  {
182  return Count(elements._TailElements, fake);
183  }
size_t Count(ContainerMapList< TypeList< H, T >> const &elements, SPECIFIC_TYPE *fake)
Definition: TypeContainerFunctions.h:180
+ Here is the call graph for this function:

◆ CreateChildProcess()

template<typename T >
static int Trinity::CreateChildProcess ( waiter,
std::string const &  executable,
std::vector< std::string > const &  argsVector,
std::string const &  logger,
std::string const &  input,
bool  secure 
)
static
84 {
85  ipstream outStream;
86  ipstream errStream;
87 
88  if (!secure)
89  {
90  TC_LOG_TRACE(logger, "Starting process \"%s\" with arguments: \"%s\".",
91  executable.c_str(), boost::algorithm::join(argsVector, " ").c_str());
92  }
93 
94  // prepare file with only read permission (boost process opens with read_write)
95  std::shared_ptr<FILE> inputFile(!input.empty() ? fopen(input.c_str(), "rb") : nullptr, [](FILE* ptr)
96  {
97  if (ptr != nullptr)
98  fclose(ptr);
99  });
100 
101  // Start the child process
102  child c = [&]()
103  {
104  if (inputFile)
105  {
106  // With binding stdin
107  return child{
108  exe = boost::filesystem::absolute(executable).string(),
109  args = argsVector,
110  env = environment(boost::this_process::environment()),
111  std_in = inputFile.get(),
112  std_out = outStream,
113  std_err = errStream
114  };
115  }
116  else
117  {
118  // Without binding stdin
119  return child{
120  exe = boost::filesystem::absolute(executable).string(),
121  args = argsVector,
122  env = environment(boost::this_process::environment()),
123  std_in = boost::process::close,
124  std_out = outStream,
125  std_err = errStream
126  };
127  }
128  }();
129 
130  auto outInfo = MakeTCLogSink([&](std::string_view msg)
131  {
133  });
134 
135  auto outError = MakeTCLogSink([&](std::string_view msg)
136  {
138  });
139 
140  copy(outStream, outInfo);
141  copy(errStream, outError);
142 
143  // Call the waiter in the current scope to prevent
144  // the streams from closing too early on leaving the scope.
145  int const result = waiter(c);
146 
147  if (!secure)
148  {
149  TC_LOG_TRACE(logger, ">> Process \"%s\" finished with return value %i.",
150  executable.c_str(), result);
151  }
152 
153  return result;
154 }
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:185
#define TC_LOG_TRACE(filterType__,...)
Definition: Log.h:173
auto MakeTCLogSink(T &&callback) -> TCLogSink< typename std::decay< T >::type >
Definition: StartProcess.cpp:73
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:179
#define STRING_VIEW_FMT
Definition: Define.h:135
#define STRING_VIEW_FMT_ARG(str)
Definition: Define.h:136
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 
)
111 {
112  std::string formattedMessage = StringFormat("\n%s:%i in %s ERROR:\n %s\n", file, line, function, message);
113  fprintf(stderr, "%s", formattedMessage.c_str());
114  fflush(stderr);
115  Crash(formattedMessage.c_str());
116 }
std::string StringFormat(Format &&fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:27
#define Crash(message)
Definition: Errors.cpp:39
+ Here is the call graph for this function:
+ Here is the caller 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,
  ... 
)
96 {
97  va_list args;
98  va_start(args, message);
99 
100  std::string formattedMessage = StringFormat("\n%s:%i in %s FATAL ERROR:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
101  va_end(args);
102 
103  fprintf(stderr, "%s", formattedMessage.c_str());
104  fflush(stderr);
105 
106  std::this_thread::sleep_for(std::chrono::seconds(10));
107  Crash(formattedMessage.c_str());
108 }
std::string StringFormat(Format &&fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:27
#define Crash(message)
Definition: Errors.cpp:39
+ Here is the call graph for this function:

◆ Find() [1/4]

template<class SPECIFIC_TYPE , class KEY_TYPE >
SPECIFIC_TYPE* Trinity::Find ( ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *   
)
72  {
73  auto i = elements._element.find(handle);
74  if (i == elements._element.end())
75  return nullptr;
76  else
77  return i->second;
78  }
std::unordered_map< KEY_TYPE, OBJECT * > _element
Definition: TypeContainer.h:58
+ Here is the caller graph for this function:

◆ Find() [2/4]

template<class SPECIFIC_TYPE , class KEY_TYPE >
SPECIFIC_TYPE* Trinity::Find ( ContainerUnorderedMap< TypeNull, KEY_TYPE > const &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
82  {
83  return nullptr;
84  }

◆ Find() [3/4]

template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
SPECIFIC_TYPE* Trinity::Find ( ContainerUnorderedMap< T, KEY_TYPE > const &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
88  {
89  return nullptr;
90  }

◆ Find() [4/4]

template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
SPECIFIC_TYPE* Trinity::Find ( ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > const &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *   
)
94  {
95  SPECIFIC_TYPE* ret = Find(elements._elements, handle, (SPECIFIC_TYPE*)nullptr);
96  return ret ? ret : Find(elements._TailElements, handle, (SPECIFIC_TYPE*)nullptr);
97  }
SPECIFIC_TYPE * Find(ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > const &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:93
+ Here is the call graph for this function:

◆ GetExpansionForLevel()

uint32 Trinity::GetExpansionForLevel ( uint32  level)
inline
32  {
33  if (level < 60)
34  return EXPANSION_CLASSIC;
35  else if (level < 70)
37  else if (level < 80)
39  else if (level < 85)
40  return EXPANSION_CATACLYSM;
41  else if (level < 90)
43  else if (level < 100)
45  else
46  return CURRENT_EXPANSION;
47  }
Definition: SharedDefines.h:84
#define CURRENT_EXPANSION
Definition: SharedDefines.h:97
Definition: SharedDefines.h:85
Definition: SharedDefines.h:83
Definition: SharedDefines.h:88
Definition: SharedDefines.h:86
Definition: SharedDefines.h:87
+ Here is the caller graph for this function:

◆ hash_combine()

template<typename T >
void Trinity::hash_combine ( std::size_t &  seed,
T const &  val 
)
inline
28  {
29  seed ^= std::hash<T>()(val) + 0x9E3779B9 + (seed << 6) + (seed >> 2);
30  }
+ Here is the caller graph for this function:

◆ Insert() [1/8]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Trinity::Insert ( ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *  obj 
)
36  {
37  auto i = elements._element.find(handle);
38  if (i == elements._element.end())
39  {
40  elements._element[handle] = obj;
41  return true;
42  }
43  else
44  {
45  ASSERT(i->second == obj, "Object with certain key already in but objects are different!");
46  return false;
47  }
48  }
#define ASSERT
Definition: Errors.h:68
std::unordered_map< KEY_TYPE, OBJECT * > _element
Definition: TypeContainer.h:58
+ Here is the caller graph for this function:

◆ Insert() [2/8]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Trinity::Insert ( ContainerUnorderedMap< TypeNull, KEY_TYPE > &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
52  {
53  return false;
54  }

◆ Insert() [3/8]

template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Trinity::Insert ( ContainerUnorderedMap< T, KEY_TYPE > &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
58  {
59  return false;
60  }

◆ Insert() [4/8]

template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Trinity::Insert ( ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *  obj 
)
64  {
65  bool ret = Insert(elements._elements, handle, obj);
66  return ret ? ret : Insert(elements._TailElements, handle, obj);
67  }
ContainerUnorderedMap< T, KEY_TYPE > _TailElements
Definition: TypeContainer.h:70
ContainerUnorderedMap< H, KEY_TYPE > _elements
Definition: TypeContainer.h:69
SPECIFIC_TYPE * Insert(ContainerMapList< TypeList< H, T >> &elements, SPECIFIC_TYPE *obj)
Definition: TypeContainerFunctions.h:209
+ Here is the call graph for this function:

◆ Insert() [5/8]

template<class SPECIFIC_TYPE >
SPECIFIC_TYPE* Trinity::Insert ( ContainerMapList< SPECIFIC_TYPE > &  elements,
SPECIFIC_TYPE *  obj 
)
188  {
189  //elements._element[hdl] = obj;
190  obj->AddToGrid(elements._element);
191  return obj;
192  }
GridRefManager< OBJECT > _element
Definition: TypeContainer.h:40

◆ Insert() [6/8]

template<class SPECIFIC_TYPE >
SPECIFIC_TYPE* Trinity::Insert ( ContainerMapList< TypeNull > &  ,
SPECIFIC_TYPE *   
)
196  {
197  return nullptr;
198  }

◆ Insert() [7/8]

template<class SPECIFIC_TYPE , class T >
SPECIFIC_TYPE* Trinity::Insert ( ContainerMapList< T > &  ,
SPECIFIC_TYPE *   
)
203  {
204  return nullptr; // a missed
205  }

◆ Insert() [8/8]

template<class SPECIFIC_TYPE , class H , class T >
SPECIFIC_TYPE* Trinity::Insert ( ContainerMapList< TypeList< H, T >> &  elements,
SPECIFIC_TYPE *  obj 
)
210  {
211  SPECIFIC_TYPE* t = Insert(elements._elements, obj);
212  return (t != nullptr ? t : Insert(elements._TailElements, obj));
213  }
SPECIFIC_TYPE * Insert(ContainerMapList< TypeList< H, T >> &elements, SPECIFIC_TYPE *obj)
Definition: TypeContainerFunctions.h:209
+ Here is the call graph for this function:

◆ IsFormatEmptyOrNull() [1/2]

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

Returns true if the given char pointer is null.

42  {
43  return fmt == nullptr;
44  }
+ Here is the caller graph for this function:

◆ IsFormatEmptyOrNull() [2/2]

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

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

48  {
49  return fmt.empty();
50  }

◆ IsValidMapCoord() [1/4]

bool Trinity::IsValidMapCoord ( float  c)
inline
231  {
232  return std::isfinite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f);
233  }
#define MAP_HALFSIZE
Definition: GridDefines.h:58
+ Here is the caller graph for this function:

◆ IsValidMapCoord() [2/4]

bool Trinity::IsValidMapCoord ( float  x,
float  y 
)
inline
236  {
237  return IsValidMapCoord(x) && IsValidMapCoord(y);
238  }
bool IsValidMapCoord(float x, float y, float z, float o)
Definition: GridDefines.h:245
+ Here is the call graph for this function:

◆ IsValidMapCoord() [3/4]

bool Trinity::IsValidMapCoord ( float  x,
float  y,
float  z 
)
inline
241  {
242  return IsValidMapCoord(x, y) && IsValidMapCoord(z);
243  }
bool IsValidMapCoord(float x, float y, float z, float o)
Definition: GridDefines.h:245
+ Here is the call graph for this function:

◆ IsValidMapCoord() [4/4]

bool Trinity::IsValidMapCoord ( float  x,
float  y,
float  z,
float  o 
)
inline
246  {
247  return IsValidMapCoord(x, y, z) && std::isfinite(o);
248  }
bool IsValidMapCoord(float x, float y, float z, float o)
Definition: GridDefines.h:245
+ Here is the caller graph for this function:

◆ make_unique_ptr_with_deleter()

template<typename T , typename Del >
auto Trinity::make_unique_ptr_with_deleter ( ptr,
Del &&  deleter 
)
42 {
43  using Deleter_t = Impl::unique_ptr_deleter<T, Del>;
44 
45  return std::unique_ptr<T, Deleter_t>(ptr, Deleter_t(std::forward<Del>(deleter)));
46 }
+ Here is the caller graph for this function:

◆ MakeTCLogSink()

template<typename T >
auto Trinity::MakeTCLogSink ( T &&  callback) -> TCLogSink<typename std::decay<T>::type>
75 {
76  return { std::forward<T>(callback) };
77 }
+ Here is the caller graph for this function:

◆ new_from_tuple()

template<class T , class Tuple >
T* Trinity::new_from_tuple ( Tuple &&  args)
60  {
61  return Impl::new_from_tuple<T>(std::forward<Tuple>(args), std::make_index_sequence<std::tuple_size_v<std::remove_reference_t<Tuple>>>{});
62  }

◆ NormalizeMapCoord()

void Trinity::NormalizeMapCoord ( float &  c)
inline
223  {
224  if (c > MAP_HALFSIZE - 0.5f)
225  c = MAP_HALFSIZE - 0.5f;
226  else if (c < -(MAP_HALFSIZE - 0.5f))
227  c = -(MAP_HALFSIZE - 0.5f);
228  }
#define MAP_HALFSIZE
Definition: GridDefines.h:58
+ Here is the caller graph for this function:

◆ Remove() [1/4]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Trinity::Remove ( ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *   
)
102  {
103  elements._element.erase(handle);
104  return true;
105  }
std::unordered_map< KEY_TYPE, OBJECT * > _element
Definition: TypeContainer.h:58
+ Here is the caller graph for this function:

◆ Remove() [2/4]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Trinity::Remove ( ContainerUnorderedMap< TypeNull, KEY_TYPE > &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
109  {
110  return false;
111  }

◆ Remove() [3/4]

template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Trinity::Remove ( ContainerUnorderedMap< T, KEY_TYPE > &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
115  {
116  return false;
117  }

◆ Remove() [4/4]

template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Trinity::Remove ( ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *   
)
121  {
122  bool ret = Remove(elements._elements, handle, (SPECIFIC_TYPE*)nullptr);
123  return ret ? ret : Remove(elements._TailElements, handle, (SPECIFIC_TYPE*)nullptr);
124  }
ContainerUnorderedMap< T, KEY_TYPE > _TailElements
Definition: TypeContainer.h:70
ContainerUnorderedMap< H, KEY_TYPE > _elements
Definition: TypeContainer.h:69
bool Remove(ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:120
+ Here is the call graph for this function:

◆ 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.

269 {
270  try
271  {
272  return search_path(filename).string();
273  }
274  catch (...)
275  {
276  return "";
277  }
278 }
+ Here is the caller graph for this function:

◆ SelectRandomInjuredTargets()

TC_GAME_API void Trinity::SelectRandomInjuredTargets ( std::list< WorldObject *> &  targets,
size_t  maxTargets,
bool  prioritizePlayers 
)
8985 {
8986  if (targets.size() <= maxTargets)
8987  return;
8988 
8989  std::vector<WorldObject*> tempTargets(targets.begin(), targets.end());
8990 
8991  auto begin = tempTargets.begin();
8992  auto end = tempTargets.end();
8993 
8994  if (prioritizePlayers)
8995  {
8996  auto playersEnd = std::stable_partition(begin, end, [](WorldObject const* target)
8997  {
8998  return target->IsPlayer();
8999  });
9000 
9001  size_t playerCount = std::distance(begin, playersEnd);
9002  if (playerCount < maxTargets)
9003  {
9004  // not enough players, add nonplayer targets
9005  // prioritize injured nonplayers over full health nonplayers
9006  auto injuredNonPlayersEnd = std::stable_partition(playersEnd, end, [](WorldObject const* target)
9007  {
9008  return target->IsUnit() && !target->ToUnit()->IsFullHealth();
9009  });
9010 
9011  size_t injuredNonPlayersCount = std::distance(playersEnd, injuredNonPlayersEnd);
9012  if (playerCount + injuredNonPlayersCount < maxTargets)
9013  {
9014  // not enough players + injured nonplayers
9015  // fill remainder with random full health nonplayers
9016  Containers::RandomShuffle(injuredNonPlayersEnd, end);
9017  }
9018  else if (playerCount + injuredNonPlayersCount > maxTargets)
9019  {
9020  // randomize injured nonplayers order
9021  // final list will contain all players + random injured nonplayers
9022  Containers::RandomShuffle(playersEnd, injuredNonPlayersEnd);
9023  }
9024 
9025  targets.assign(tempTargets.begin(), tempTargets.begin() + maxTargets);
9026  return;
9027  }
9028 
9029  // We have more players than we requested, proceed checking injured targets
9030  end = playersEnd;
9031  }
9032 
9033  auto injuredUnitsEnd = std::stable_partition(begin, end, [](WorldObject const* target)
9034  {
9035  return target->IsUnit() && !target->ToUnit()->IsFullHealth();
9036  });
9037 
9038  size_t injuredUnitsCount = std::distance(begin, injuredUnitsEnd);
9039  if (injuredUnitsCount < maxTargets)
9040  {
9041  // not enough injured units
9042  // fill remainder with full health units
9043  Containers::RandomShuffle(injuredUnitsEnd, end);
9044  }
9045  else if (injuredUnitsCount > maxTargets)
9046  {
9047  // select random injured units
9048  Containers::RandomShuffle(begin, injuredUnitsEnd);
9049  }
9050 
9051  targets.assign(tempTargets.begin(), tempTargets.begin() + maxTargets);
9052 }
bool IsFullHealth() const
Definition: Unit.h:896
Definition: Object.h:430
void RandomShuffle(Iterator begin, Iterator end)
Reorder the elements of the iterator range randomly.
Definition: Containers.h:178
bool IsPlayer() const
Definition: Object.h:197
bool IsUnit() const
Definition: Object.h:209
static Unit * ToUnit(Object *o)
Definition: Object.h:210
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Size() [1/4]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Trinity::Size ( ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &  elements,
std::size_t *  size,
SPECIFIC_TYPE *   
)
129  {
130  *size = elements._element.size();
131  return true;
132  }
std::unordered_map< KEY_TYPE, OBJECT * > _element
Definition: TypeContainer.h:58
+ Here is the caller graph for this function:

◆ Size() [2/4]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Trinity::Size ( ContainerUnorderedMap< TypeNull, KEY_TYPE > const &  ,
std::size_t *  ,
SPECIFIC_TYPE *   
)
136  {
137  return false;
138  }

◆ Size() [3/4]

template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Trinity::Size ( ContainerUnorderedMap< T, KEY_TYPE > const &  ,
std::size_t *  ,
SPECIFIC_TYPE *   
)
142  {
143  return false;
144  }

◆ Size() [4/4]

template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Trinity::Size ( ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > const &  elements,
std::size_t *  size,
SPECIFIC_TYPE *   
)
148  {
149  bool ret = Size(elements._elements, size, (SPECIFIC_TYPE*)nullptr);
150  return ret ? ret : Size(elements._TailElements, size, (SPECIFIC_TYPE*)nullptr);
151  }
bool Size(ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > const &elements, std::size_t *size, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:147
+ Here is the call 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.

260 {
261  auto handle = std::make_shared<AsyncProcessResultImplementation>(
262  std::move(executable), std::move(args), std::move(logger), std::move(input_file), secure);
263 
264  handle->SetFuture(std::async(std::launch::async, [handle] { return handle->StartProcess(); }));
265  return handle;
266 }
+ Here is the caller graph for this function:

◆ StartProcess()

TC_COMMON_API int Trinity::StartProcess ( std::string const &  executable,
std::vector< std::string > const &  args,
std::string const &  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.

158 {
159  return CreateChildProcess([](child& c) -> int
160  {
161  try
162  {
163  c.wait();
164  return c.exit_code();
165  }
166  catch (...)
167  {
168  return EXIT_FAILURE;
169  }
170  }, executable, args, logger, input_file, secure);
171 }
static int CreateChildProcess(T waiter, std::string const &executable, std::vector< std::string > const &argsVector, std::string const &logger, std::string const &input, bool secure)
Definition: StartProcess.cpp:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StringFormat()

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

Default TC string format function.

28  {
29  try
30  {
31  return fmt::sprintf(std::forward<Format>(fmt), std::forward<Args>(args)...);
32  }
33  catch (const fmt::format_error& formatError)
34  {
35  std::string error = "An error occurred formatting string \"" + std::string(fmt) + "\" : " + std::string(formatError.what());
36  return error;
37  }
38  }
+ Here is the caller graph for this function:

◆ StringTo()

template<typename Result , typename... Params>
Optional<Result> Trinity::StringTo ( std::string_view  str,
Params &&...  params 
)
264  {
265  return Trinity::Impl::StringConvertImpl::For<Result>::FromString(str, std::forward<Params>(params)...);
266  }
Definition: StringConvert.h:33
std::unordered_set< uint32 > params[2]
Definition: DisableMgr.cpp:50
+ Here is the caller graph for this function:

◆ Tokenize() [1/4]

std::vector< std::string_view > Trinity::Tokenize ( std::string_view  str,
char  sep,
bool  keepEmpty 
)
41 {
42  std::vector<std::string_view> tokens;
43 
44  size_t start = 0;
45  for (size_t end = str.find(sep); end != std::string_view::npos; end = str.find(sep, start))
46  {
47  if (keepEmpty || (start < end))
48  tokens.push_back(str.substr(start, end - start));
49  start = end+1;
50  }
51 
52  if (keepEmpty || (start < str.length()))
53  tokens.push_back(str.substr(start));
54 
55  return tokens;
56 }
+ Here is the call graph for this function:
+ Here is the caller 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 ( char const *  str,
char  sep,
bool  keepEmpty 
)
inline
50 { return Tokenize(std::string_view(str ? str : ""), sep, keepEmpty); }
std::vector< std::string_view > Tokenize(char const *str, char sep, bool keepEmpty)
Definition: Util.h:50
+ Here is the call graph for this function:

◆ ToString()

template<typename Type , typename... Params>
std::string Trinity::ToString ( Type &&  val,
Params &&...  params 
)
270  {
271  return Trinity::Impl::StringConvertImpl::For<std::decay_t<Type>>::ToString(std::forward<Type>(val), std::forward<Params>(params)...);
272  }
std::string ToString(Type &&val, Params &&... params)
Definition: StringConvert.h:269
Definition: StringConvert.h:33
std::unordered_set< uint32 > params[2]
Definition: DisableMgr.cpp:50
+ 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 
)
119 {
120  fprintf(stderr, "\n%s:%i in %s WARNING:\n %s\n",
121  file, line, function, message);
122 }

Variable Documentation

◆ dependant_false_v

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

◆ has_type_v

template<typename T , typename... Us>
constexpr bool Trinity::has_type_v = has_type<T, Us...>::value

◆ is_tuple_v

template<typename... Ts>
constexpr bool Trinity::is_tuple_v = is_tuple<Ts...>::value