AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore Namespace Reference

Namespaces

namespace  Asio
 
namespace  Banner
 
namespace  ChatCommands
 
namespace  Containers
 
namespace  Crypto
 
namespace  Encoding
 
namespace  Honor
 
namespace  Hyperlinks
 
namespace  Impl
 
namespace  Module
 
namespace  Net
 
namespace  PlayerCommand
 
namespace  SpellScripts
 
namespace  String
 
namespace  Time
 
namespace  TimeDiff
 
namespace  Types
 
namespace  XP
 

Classes

class  AbsorbAuraOrderPred
 
class  ACLogSink
 
class  AcoreStringChatBuilder
 
struct  AIRelocationNotifier
 
class  AllCreaturesOfEntryInRange
 
class  AllDeadCreaturesInRange
 
class  AllFriendlyCreaturesInGrid
 
class  AllGameObjectsWithEntryInRange
 
class  AllWorldObjectsInExactRange
 
class  AllWorldObjectsInRange
 
class  AnyAoETargetUnitInObjectRangeCheck
 
class  AnyAssistCreatureInRangeCheck
 
class  AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck
 
struct  AnyDeadUnitCheck
 
class  AnyDeadUnitObjectInRangeCheck
 
class  AnyDeadUnitSpellTargetInRangeCheck
 
class  AnyFriendlyNotSelfUnitInObjectRangeCheck
 
class  AnyFriendlyUnitInObjectRangeCheck
 
class  AnyGroupedUnitInObjectRangeCheck
 
class  AnyPlayerExactPositionInGameObjectRangeCheck
 
class  AnyPlayerInObjectRangeCheck
 
class  AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck
 
class  AnyUnfriendlyNoTotemUnitInObjectRangeCheck
 
class  AnyUnfriendlyUnitInObjectRangeCheck
 
class  AnyUnitInObjectRangeCheck
 
class  AsyncProcessResult
 
class  AsyncProcessResultImplementation
 
class  Battleground2ChatBuilder
 
class  BattlegroundChatBuilder
 
class  BroadcastTextBuilder
 
class  CallOfHelpCreatureInRangeDo
 
class  CheckedBufferOutputIterator
 
class  ClassLevelLockable
 
class  ContainerInserter
 
struct  CreatureLastSearcher
 
struct  CreatureListSearcher
 
struct  CreatureRelocationNotifier
 
struct  CreatureSearcher
 
struct  CreatureWorker
 
class  CustomChatTextBuilder
 
struct  dependant_false
 
class  EmoteChatBuilder
 
struct  find_type_if
 
struct  find_type_if< Check >
 
struct  find_type_if< Check, T1, Ts... >
 
class  FriendlyCCedInRange
 
class  FriendlyMissingBuffInRange
 
class  GameObjectFocusCheck
 
class  GameObjectInRangeCheck
 
struct  GameObjectLastSearcher
 
struct  GameObjectListSearcher
 
struct  GameObjectSearcher
 
struct  GameObjectWorker
 
class  GeneralLock
 
struct  has_type
 
struct  has_type< T, std::tuple< Us... > >
 
class  HealthPctOrderPred
 
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  LocalizedPacketDo
 
class  LocalizedPacketListDo
 
struct  MessageDistDeliverer
 
struct  MessageDistDelivererToHostile
 
class  MostHPMissingGroupInRange
 
class  MostHPMissingInRange
 
class  MostHPPercentMissingInRange
 
class  NearestAssistCreatureInCreatureRangeCheck
 
class  NearestAttackableNoTotemUnitInObjectRangeCheck
 
class  NearestAttackableUnitInObjectRangeCheck
 
class  NearestCreatureEntryWithLiveStateInObjectRangeCheck
 
class  NearestGameObjectCheck
 
class  NearestGameObjectEntryInObjectRangeCheck
 
class  NearestGameObjectFishingHole
 
class  NearestGameObjectTypeInObjectRangeCheck
 
class  NearestHostileUnitCheck
 
class  NearestHostileUnitInAttackDistanceCheck
 
class  NearestPlayerInObjectRangeCheck
 
class  NearestVisibleDetectableContestedGuardUnitCheck
 
class  ObjectDistanceOrderPred
 
class  ObjectGUIDCheck
 
class  ObjectLevelLockable
 
class  ObjectTypeIdCheck
 
struct  ObjectUpdater
 
class  PlayerAtMinimumRangeAway
 
struct  PlayerDistWorker
 
struct  PlayerLastSearcher
 
struct  PlayerListSearcher
 
struct  PlayerListSearcherWithSharedVision
 
struct  PlayerRelocationNotifier
 
struct  PlayerSearcher
 
struct  PlayerWorker
 
class  PowerCheck
 
class  PowerPctOrderPred
 
class  RaidCheck
 
class  RandomCheck
 
class  RespawnDo
 
class  Runnable
 
class  SignalHandler
 Handle termination signals. More...
 
class  SingleThreaded
 
class  Thread
 
class  ThreatOrderPred
 
struct  unary_function
 
class  UnitAuraCheck
 
struct  UnitLastSearcher
 
struct  UnitListSearcher
 
struct  UnitSearcher
 
struct  VisibleChangesNotifier
 
struct  VisibleNotifier
 
struct  WorldObjectLastSearcher
 
struct  WorldObjectListSearcher
 
struct  WorldObjectSearcher
 
struct  WorldObjectSpellAreaTargetCheck
 
struct  WorldObjectSpellConeTargetCheck
 
struct  WorldObjectSpellNearbyTargetCheck
 
struct  WorldObjectSpellTargetCheck
 
struct  WorldObjectSpellTrajTargetCheck
 
struct  WorldObjectWorker
 
class  WorldWorldTextBuilder
 

Typedefs

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

Enumerations

enum  Priority {
  Priority_Idle ,
  Priority_Lowest ,
  Priority_Low ,
  Priority_Normal ,
  Priority_High ,
  Priority_Highest ,
  Priority_Realtime
}
 

Functions

AC_COMMON_API void Assert (std::string_view file, uint32 line, std::string_view function, std::string_view debugInfo, std::string_view message, std::string_view fmtMessage={})
 
AC_COMMON_API void Fatal (std::string_view file, uint32 line, std::string_view function, std::string_view message, std::string_view fmtMessage={})
 
AC_COMMON_API void Error (std::string_view file, uint32 line, std::string_view function, std::string_view message)
 
AC_COMMON_API void Abort (std::string_view file, uint32 line, std::string_view function, std::string_view fmtMessage={})
 
template<typename... Args>
AC_COMMON_API void Assert (std::string_view file, uint32 line, std::string_view function, std::string_view debugInfo, std::string_view message, std::string_view fmt, Args &&... args)
 
template<typename... Args>
AC_COMMON_API void Fatal (std::string_view file, uint32 line, std::string_view function, std::string_view message, std::string_view fmt, Args &&... args)
 
template<typename... Args>
AC_COMMON_API void Abort (std::string_view file, uint32 line, std::string_view function, std::string_view fmt, Args &&... args)
 
AC_COMMON_API void Warning (std::string_view file, uint32 line, std::string_view function, std::string_view message)
 
AC_COMMON_API void AbortHandler (int sigval)
 
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 (const ContainerMapList< SPECIFIC_TYPE > &elements, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE >
size_t Count (const ContainerMapList< TypeNull > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
size_t Count (const ContainerMapList< T > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
size_t Count (const ContainerMapList< TypeList< SPECIFIC_TYPE, T > > &elements, SPECIFIC_TYPE *fake)
 
template<class SPECIFIC_TYPE , class H , class T >
size_t Count (const ContainerMapList< TypeList< H, T > > &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 SPECIFIC_TYPE >
CountedPtr< SPECIFIC_TYPE > & Find (ContainerMapList< SPECIFIC_TYPE > &elements, OBJECT_HANDLE hdl, CountedPtr< SPECIFIC_TYPE > *)
 
template<class SPECIFIC_TYPE >
CountedPtr< SPECIFIC_TYPE > & Find (ContainerMapList< TypeNull > &elements, OBJECT_HANDLE hdl, CountedPtr< SPECIFIC_TYPE > *)
 
template<class SPECIFIC_TYPE , class T >
CountedPtr< SPECIFIC_TYPE > & Find (ContainerMapList< T > &elements, OBJECT_HANDLE hdl, CountedPtr< SPECIFIC_TYPE > *)
 
template<class SPECIFIC_TYPE , class H , class T >
CountedPtr< SPECIFIC_TYPE > & Find (ContainerMapList< TypeList< H, T > > &elements, OBJECT_HANDLE hdl, CountedPtr< SPECIFIC_TYPE > *fake)
 
template<class SPECIFIC_TYPE >
const CountedPtr< SPECIFIC_TYPE > & Find (const ContainerMapList< SPECIFIC_TYPE > &elements, OBJECT_HANDLE hdl, CountedPtr< SPECIFIC_TYPE > *)
 
template<class SPECIFIC_TYPE >
const CountedPtr< SPECIFIC_TYPE > & Find (const ContainerMapList< TypeNull > &elements, OBJECT_HANDLE hdl, CountedPtr< SPECIFIC_TYPE > *)
 
template<class SPECIFIC_TYPE , class T >
const CountedPtr< SPECIFIC_TYPE > & Find (const ContainerMapList< T > &elements, OBJECT_HANDLE hdl, CountedPtr< SPECIFIC_TYPE > *)
 
template<class SPECIFIC_TYPE , class H , class T >
CountedPtr< SPECIFIC_TYPE > & Find (const ContainerMapList< TypeList< H, T > > &elements, OBJECT_HANDLE hdl, CountedPtr< SPECIFIC_TYPE > *fake)
 
template<class SPECIFIC_TYPE >
CountedPtr< SPECIFIC_TYPE > & Insert (ContainerMapList< SPECIFIC_TYPE > &elements, CountedPtr< SPECIFIC_TYPE > &obj, OBJECT_HANDLE hdl)
 
template<class SPECIFIC_TYPE >
CountedPtr< SPECIFIC_TYPE > & Insert (ContainerMapList< TypeNull > &elements, CountedPtr< SPECIFIC_TYPE > &obj, OBJECT_HANDLE hdl)
 
template<class SPECIFIC_TYPE , class T >
CountedPtr< SPECIFIC_TYPE > & Insert (ContainerMapList< T > &elements, CountedPtr< SPECIFIC_TYPE > &obj, OBJECT_HANDLE hdl)
 
template<class SPECIFIC_TYPE , class H , class T >
CountedPtr< SPECIFIC_TYPE > & Insert (ContainerMapList< TypeList< H, T > > &elements, CountedPtr< SPECIFIC_TYPE > &obj, OBJECT_HANDLE hdl)
 
template<class SPECIFIC_TYPE >
bool Remove (ContainerMapList< SPECIFIC_TYPE > &elements, CountedPtr< SPECIFIC_TYPE > &obj, OBJECT_HANDLE hdl)
 
template<class SPECIFIC_TYPE >
bool Remove (ContainerMapList< TypeNull > &elements, CountedPtr< SPECIFIC_TYPE > &obj, OBJECT_HANDLE hdl)
 
template<class SPECIFIC_TYPE , class T >
bool Remove (ContainerMapList< T > &elements, CountedPtr< SPECIFIC_TYPE > &obj, OBJECT_HANDLE hdl)
 
template<class SPECIFIC_TYPE , class T , class H >
bool Remove (ContainerMapList< TypeList< H, T > > &elements, CountedPtr< SPECIFIC_TYPE > &obj, OBJECT_HANDLE hdl)
 
template<class T >
constexpr T * AddressOrSelf (T *ptr)
 
template<class T >
constexpr T * AddressOrSelf (T &not_ptr)
 
template<typename T >
auto MakeACLogSink (T &&callback) -> ACLogSink< 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 AC string format function.
 
template<typename... Args>
std::string StringFormatFmt (std::string_view fmt, Args &&... args)
 
bool IsFormatEmptyOrNull (char const *fmt)
 Returns true if the given char pointer is null.
 
bool IsFormatEmptyOrNull (std::string_view fmt)
 Returns true if the given std::string is empty.
 
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 T , class Tuple >
T * new_from_tuple (Tuple &&args)
 
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)
 
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)
 

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 Acore::find_type_if_t = typedef typename find_type_if<Check, Ts...>::type

Enumeration Type Documentation

◆ Priority

Enumerator
Priority_Idle 
Priority_Lowest 
Priority_Low 
Priority_Normal 
Priority_High 
Priority_Highest 
Priority_Realtime 
45 {
53 };
@ Priority_Lowest
Definition: Threading.h:47
@ Priority_Idle
Definition: Threading.h:46
@ Priority_Low
Definition: Threading.h:48
@ Priority_Normal
Definition: Threading.h:49
@ Priority_High
Definition: Threading.h:50
@ Priority_Realtime
Definition: Threading.h:52
@ Priority_Highest
Definition: Threading.h:51

Function Documentation

◆ Abort() [1/2]

template<typename... Args>
AC_COMMON_API void Acore::Abort ( std::string_view  file,
uint32  line,
std::string_view  function,
std::string_view  fmt,
Args &&...  args 
)
inline
45 {
46 Abort(file, line, function, StringFormatFmt(fmt, std::forward<Args>(args)...));
47 }
std::string StringFormatFmt(std::string_view fmt, Args &&... args)
Definition: StringFormat.h:44
AC_COMMON_API void Abort(std::string_view file, uint32 line, std::string_view function, std::string_view fmtMessage={})
Definition: Errors.cpp:139

References Abort(), and StringFormatFmt().

◆ Abort() [2/2]

void Acore::Abort ( std::string_view  file,
uint32  line,
std::string_view  function,
std::string_view  fmtMessage = {} 
)
140{
141 std::string formattedMessage = MakeAbortMessage(file, line, function, fmtMessage);
142 fmt::print(stderr, "{}", formattedMessage);
143 fflush(stderr);
144 std::this_thread::sleep_for(10s);
145 Crash(formattedMessage.c_str());
146}
#define Crash(message)
Definition: Errors.cpp:37
std::string MakeAbortMessage(std::string_view file, uint32 line, std::string_view function, std::string_view fmtMessage={})
Definition: Errors.cpp:91

References Crash, and anonymous_namespace{Errors.cpp}::MakeAbortMessage().

Referenced by Abort().

◆ AbortHandler()

void Acore::AbortHandler ( int  sigval)
149{
150 // nothing useful to log here, no way to pass args
151 std::string formattedMessage = StringFormatFmt("Caught signal {}\n", sigval);
152 fmt::print(stderr, "{}", formattedMessage);
153 fflush(stderr);
154 Crash(formattedMessage.c_str());
155}

References Crash, and StringFormatFmt().

Referenced by main().

◆ AddressOrSelf() [1/2]

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

◆ AddressOrSelf() [2/2]

template<class T >
constexpr T * Acore::AddressOrSelf ( T *  ptr)
inlineconstexpr
34 {
35 return ptr;
36 }

Referenced by Acore::Containers::MapGetValuePtr().

◆ Assert() [1/2]

template<typename... Args>
AC_COMMON_API void Acore::Assert ( std::string_view  file,
uint32  line,
std::string_view  function,
std::string_view  debugInfo,
std::string_view  message,
std::string_view  fmt,
Args &&...  args 
)
inline
33 {
34 Assert(file, line, function, debugInfo, message, StringFormatFmt(fmt, std::forward<Args>(args)...));
35 }
AC_COMMON_API void Assert(std::string_view file, uint32 line, std::string_view function, std::string_view debugInfo, std::string_view message, std::string_view fmtMessage={})
Definition: Errors.cpp:107

References Assert(), and StringFormatFmt().

◆ Assert() [2/2]

void Acore::Assert ( std::string_view  file,
uint32  line,
std::string_view  function,
std::string_view  debugInfo,
std::string_view  message,
std::string_view  fmtMessage = {} 
)
108{
109 std::string formattedMessage = MakeMessage("ASSERTION FAILED", file, line, function, message, fmtMessage, debugInfo);
110 fmt::print(stderr, "{}", formattedMessage);
111 fflush(stderr);
112 Crash(formattedMessage.c_str());
113}
std::string MakeMessage(std::string_view messageType, std::string_view file, uint32 line, std::string_view function, std::string_view message, std::string_view fmtMessage={}, std::string_view debugInfo={})
Definition: Errors.cpp:62

References Crash, and anonymous_namespace{Errors.cpp}::MakeMessage().

Referenced by Assert().

◆ Compute()

template<class RET_TYPE , int CENTER_VAL>
RET_TYPE Acore::Compute ( float  x,
float  y,
float  center_offset,
float  size 
)
inline
176 {
177 // calculate and store temporary values in double format for having same result as same mySQL calculations
178 double x_offset = (double(x) - center_offset) / size;
179 double y_offset = (double(y) - center_offset) / size;
180
181 int x_val = int(x_offset + CENTER_VAL + 0.5f);
182 int y_val = int(y_offset + CENTER_VAL + 0.5f);
183 return RET_TYPE(x_val, y_val);
184 }

◆ ComputeCellCoord() [1/2]

◆ ComputeCellCoord() [2/2]

CellCoord Acore::ComputeCellCoord ( float  x,
float  y,
float &  x_off,
float &  y_off 
)
inline
197 {
198 double x_offset = (double(x) - CENTER_GRID_CELL_OFFSET) / SIZE_OF_GRID_CELL;
199 double y_offset = (double(y) - CENTER_GRID_CELL_OFFSET) / SIZE_OF_GRID_CELL;
200
201 int x_val = int(x_offset + CENTER_GRID_CELL_ID + 0.5f);
202 int y_val = int(y_offset + CENTER_GRID_CELL_ID + 0.5f);
203 x_off = (float(x_offset) - x_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
204 y_off = (float(y_offset) - y_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
205 return CellCoord(x_val, y_val);
206 }
#define CENTER_GRID_CELL_ID
Definition: GridDefines.h:46
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
Definition: GridDefines.h:170

References CENTER_GRID_CELL_ID, CENTER_GRID_CELL_OFFSET, and SIZE_OF_GRID_CELL.

◆ ComputeGridCoord()

GridCoord Acore::ComputeGridCoord ( float  x,
float  y 
)
inline
187 {
188 return Compute<GridCoord, CENTER_GRID_ID>(x, y, CENTER_GRID_OFFSET, SIZE_OF_GRIDS);
189 }
#define SIZE_OF_GRIDS
Definition: MapDefines.h:13
#define CENTER_GRID_OFFSET
Definition: GridDefines.h:39

References CENTER_GRID_OFFSET, and SIZE_OF_GRIDS.

Referenced by MapMgr::ExistMapAndVMap(), misc_commandscript::HandleGPSCommand(), Map::IsGridLoaded(), and Map::IsRemovalGrid().

◆ Count() [1/5]

template<class SPECIFIC_TYPE >
size_t Acore::Count ( const ContainerMapList< SPECIFIC_TYPE > &  elements,
SPECIFIC_TYPE *   
)
163 {
164 return elements._element.getSize();
165 }
GridRefMgr< OBJECT > _element
Definition: TypeContainer.h:42

References ContainerMapList< OBJECT >::_element.

Referenced by TypeMapContainer< OBJECT_TYPES >::Count(), and Count().

◆ Count() [2/5]

template<class SPECIFIC_TYPE , class T >
size_t Acore::Count ( const ContainerMapList< T > &  ,
SPECIFIC_TYPE *   
)
175 {
176 return 0;
177 }

◆ Count() [3/5]

template<class SPECIFIC_TYPE , class H , class T >
size_t Acore::Count ( const ContainerMapList< TypeList< H, T > > &  elements,
SPECIFIC_TYPE *  fake 
)
187 {
188 return Count(elements._TailElements, fake);
189 }
size_t Count(const ContainerMapList< SPECIFIC_TYPE > &elements, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:162
ContainerMapList< T > _TailElements
Definition: TypeContainer.h:54

References Count().

◆ Count() [4/5]

template<class SPECIFIC_TYPE , class T >
size_t Acore::Count ( const ContainerMapList< TypeList< SPECIFIC_TYPE, T > > &  elements,
SPECIFIC_TYPE *  fake 
)
181 {
182 return Count(elements._elements, fake);
183 }

References Count().

◆ Count() [5/5]

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

◆ CreateChildProcess()

template<typename T >
static int Acore::CreateChildProcess ( waiter,
std::string const &  executable,
std::vector< std::string > const &  argsVector,
std::string const &  logger,
std::string const &  input,
bool  secure 
)
static
74 {
75 ipstream outStream;
76 ipstream errStream;
77
78 if (!secure)
79 {
80 LOG_TRACE(logger, "Starting process \"{}\" with arguments: \"{}\".",
81 executable, boost::algorithm::join(argsVector, " "));
82 }
83
84 // prepare file with only read permission (boost process opens with read_write)
85 std::shared_ptr<FILE> inputFile(!input.empty() ? fopen(input.c_str(), "rb") : nullptr, [](FILE* ptr)
86 {
87 if (ptr != nullptr)
88 fclose(ptr);
89 });
90
91 // Start the child process
92 child c = [&]()
93 {
94 if (inputFile)
95 {
96 // With binding stdin
97 return child{
98 exe = std::filesystem::absolute(executable).string(),
99 args = argsVector,
100 env = environment(boost::this_process::environment()),
101 std_in = inputFile.get(),
102 std_out = outStream,
103 std_err = errStream
104 };
105 }
106 else
107 {
108 // Without binding stdin
109 return child{
110 exe = std::filesystem::absolute(executable).string(),
111 args = argsVector,
112 env = environment(boost::this_process::environment()),
113 std_in = boost::process::close,
114 std_out = outStream,
115 std_err = errStream
116 };
117 }
118 }();
119
120 auto outInfo = MakeACLogSink([&](std::string const& msg)
121 {
122 LOG_INFO(logger, "{}", msg);
123 });
124
125 auto outError = MakeACLogSink([&](std::string const& msg)
126 {
127 LOG_ERROR(logger, "{}", msg);
128 });
129
130 copy(outStream, outInfo);
131 copy(errStream, outError);
132
133 // Call the waiter in the current scope to prevent
134 // the streams from closing too early on leaving the scope.
135 int const result = waiter(c);
136
137 if (!secure)
138 {
139 LOG_TRACE(logger, ">> Process \"{}\" finished with return value {}.",
140 executable, result);
141 }
142
143 return result;
144 }
#define LOG_INFO(filterType__,...)
Definition: Log.h:167
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
#define LOG_TRACE(filterType__,...)
Definition: Log.h:175
auto MakeACLogSink(T &&callback) -> ACLogSink< typename std::decay< T >::type >
Definition: StartProcess.cpp:63

References LOG_ERROR, LOG_INFO, LOG_TRACE, and MakeACLogSink().

Referenced by Acore::AsyncProcessResultImplementation::StartProcess(), and StartProcess().

◆ Error()

void Acore::Error ( std::string_view  file,
uint32  line,
std::string_view  function,
std::string_view  message 
)
125{
126 std::string formattedMessage = MakeMessage("ERROR", file, line, function, message);
127 fmt::print(stderr, "{}", formattedMessage);
128 fflush(stderr);
129 std::this_thread::sleep_for(10s);
130 Crash(formattedMessage.c_str());
131}

References Crash, and anonymous_namespace{Errors.cpp}::MakeMessage().

◆ Fatal() [1/2]

template<typename... Args>
AC_COMMON_API void Acore::Fatal ( std::string_view  file,
uint32  line,
std::string_view  function,
std::string_view  message,
std::string_view  fmt,
Args &&...  args 
)
inline
39 {
40 Fatal(file, line, function, message, StringFormatFmt(fmt, std::forward<Args>(args)...));
41 }
AC_COMMON_API void Fatal(std::string_view file, uint32 line, std::string_view function, std::string_view message, std::string_view fmtMessage={})
Definition: Errors.cpp:115

References Fatal(), and StringFormatFmt().

◆ Fatal() [2/2]

void Acore::Fatal ( std::string_view  file,
uint32  line,
std::string_view  function,
std::string_view  message,
std::string_view  fmtMessage = {} 
)
116{
117 std::string formattedMessage = MakeMessage("FATAL ERROR", file, line, function, message, fmtMessage);
118 fmt::print(stderr, "{}", formattedMessage);
119 fflush(stderr);
120 std::this_thread::sleep_for(10s);
121 Crash(formattedMessage.c_str());
122}

References Crash, and anonymous_namespace{Errors.cpp}::MakeMessage().

Referenced by Fatal().

◆ Find() [1/12]

template<class SPECIFIC_TYPE >
const CountedPtr< SPECIFIC_TYPE > & Acore::Find ( const ContainerMapList< SPECIFIC_TYPE > &  elements,
OBJECT_HANDLE  hdl,
CountedPtr< SPECIFIC_TYPE > *   
)
85 {
86 typename CountedPtr<SPECIFIC_TYPE>::iterator iter = elements._element.find(hdl);
87 return (iter == elements._element.end() ? NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr) : iter->second);
88 };

References ContainerMapList< OBJECT >::_element.

◆ Find() [2/12]

template<class SPECIFIC_TYPE , class T >
const CountedPtr< SPECIFIC_TYPE > & Acore::Find ( const ContainerMapList< T > &  elements,
OBJECT_HANDLE  hdl,
CountedPtr< SPECIFIC_TYPE > *   
)
96 {
97 return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);
98 }

◆ Find() [3/12]

template<class SPECIFIC_TYPE , class H , class T >
CountedPtr< SPECIFIC_TYPE > & Acore::Find ( const ContainerMapList< TypeList< H, T > > &  elements,
OBJECT_HANDLE  hdl,
CountedPtr< SPECIFIC_TYPE > *  fake 
)
101 {
102 CountedPtr<SPECIFIC_TYPE>& t = Find(elements._elements, hdl, fake);
103 if (!t)
104 {
105 t = Find(elements._TailElement, hdl, fake);
106 }
107
108 return t;
109 }
SPECIFIC_TYPE * Find(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:73
ContainerMapList< H > _elements
Definition: TypeContainer.h:53

References Find().

◆ Find() [4/12]

template<class SPECIFIC_TYPE >
const CountedPtr< SPECIFIC_TYPE > & Acore::Find ( const ContainerMapList< TypeNull > &  elements,
OBJECT_HANDLE  hdl,
CountedPtr< SPECIFIC_TYPE > *   
)
91 {
92 return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);
93 }

◆ Find() [5/12]

template<class SPECIFIC_TYPE >
CountedPtr< SPECIFIC_TYPE > & Acore::Find ( ContainerMapList< SPECIFIC_TYPE > &  elements,
OBJECT_HANDLE  hdl,
CountedPtr< SPECIFIC_TYPE > *   
)
62 {
63 typename std::map<OBJECT_HANDLE, CountedPtr<SPECIFIC_TYPE>>::iterator iter = elements._element.find(hdl);
64 return (iter == elements._element.end() ? NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr) : iter->second);
65 };

References ContainerMapList< OBJECT >::_element.

◆ Find() [6/12]

template<class SPECIFIC_TYPE , class T >
CountedPtr< SPECIFIC_TYPE > & Acore::Find ( ContainerMapList< T > &  elements,
OBJECT_HANDLE  hdl,
CountedPtr< SPECIFIC_TYPE > *   
)
73 {
74 return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);// this is a missed
75 }

◆ Find() [7/12]

template<class SPECIFIC_TYPE , class H , class T >
CountedPtr< SPECIFIC_TYPE > & Acore::Find ( ContainerMapList< TypeList< H, T > > &  elements,
OBJECT_HANDLE  hdl,
CountedPtr< SPECIFIC_TYPE > *  fake 
)
78 {
79 CountedPtr<SPECIFIC_TYPE>& t = Find(elements._elements, hdl, fake);
80 return (!t ? Find(elements._TailElements, hdl, fake) : t);
81 }

References Find().

◆ Find() [8/12]

template<class SPECIFIC_TYPE >
CountedPtr< SPECIFIC_TYPE > & Acore::Find ( ContainerMapList< TypeNull > &  elements,
OBJECT_HANDLE  hdl,
CountedPtr< SPECIFIC_TYPE > *   
)
68 {
69 return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);// terminate recursion
70 }

◆ Find() [9/12]

template<class SPECIFIC_TYPE , class KEY_TYPE >
SPECIFIC_TYPE * Acore::Find ( ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *   
)
74 {
75 auto i = elements._element.find(handle);
76 if (i == elements._element.end())
77 {
78 return nullptr;
79 }
80 else
81 {
82 return i->second;
83 }
84 }
std::unordered_map< KEY_TYPE, OBJECT * > _element
Definition: TypeContainer.h:60

References ContainerUnorderedMap< OBJECT, KEY_TYPE >::_element.

Referenced by Find(), and TypeUnorderedMapContainer< OBJECT_TYPES, KEY_TYPE >::Find().

◆ Find() [10/12]

template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
SPECIFIC_TYPE * Acore::Find ( ContainerUnorderedMap< T, KEY_TYPE > const &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
94 {
95 return nullptr;
96 }

◆ Find() [11/12]

template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
SPECIFIC_TYPE * Acore::Find ( ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > const &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *   
)
100 {
101 SPECIFIC_TYPE* ret = Find(elements._elements, handle, (SPECIFIC_TYPE*)nullptr);
102 return ret ? ret : Find(elements._TailElements, handle, (SPECIFIC_TYPE*)nullptr);
103 }

References Find().

◆ Find() [12/12]

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

◆ Insert() [1/12]

template<class SPECIFIC_TYPE >
CountedPtr< SPECIFIC_TYPE > & Acore::Insert ( ContainerMapList< SPECIFIC_TYPE > &  elements,
CountedPtr< SPECIFIC_TYPE > &  obj,
OBJECT_HANDLE  hdl 
)
113 {
114 elements._element[hdl] = obj;
115 return obj;
116 };

References ContainerMapList< OBJECT >::_element.

◆ Insert() [2/12]

template<class SPECIFIC_TYPE >
SPECIFIC_TYPE * Acore::Insert ( ContainerMapList< SPECIFIC_TYPE > &  elements,
SPECIFIC_TYPE *  obj 
)
194 {
195 //elements._element[hdl] = obj;
196 obj->AddToGrid(elements._element);
197 return obj;
198 }

References ContainerMapList< OBJECT >::_element.

◆ Insert() [3/12]

template<class SPECIFIC_TYPE , class T >
SPECIFIC_TYPE * Acore::Insert ( ContainerMapList< T > &  ,
SPECIFIC_TYPE *   
)
209 {
210 return nullptr; // a missed
211 }

◆ Insert() [4/12]

template<class SPECIFIC_TYPE , class T >
CountedPtr< SPECIFIC_TYPE > & Acore::Insert ( ContainerMapList< T > &  elements,
CountedPtr< SPECIFIC_TYPE > &  obj,
OBJECT_HANDLE  hdl 
)
125 {
126 return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);// a missed
127 }

◆ Insert() [5/12]

template<class SPECIFIC_TYPE , class H , class T >
CountedPtr< SPECIFIC_TYPE > & Acore::Insert ( ContainerMapList< TypeList< H, T > > &  elements,
CountedPtr< SPECIFIC_TYPE > &  obj,
OBJECT_HANDLE  hdl 
)
131 {
132 CountedPtr<SPECIFIC_TYPE>& t = Insert(elements._elements, obj, hdl);
133 return (!t ? Insert(elements._TailElements, obj, hdl) : t);
134 }
bool Insert(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *obj)
Definition: TypeContainerFunctions.h:37

References Insert().

◆ Insert() [6/12]

template<class SPECIFIC_TYPE , class H , class T >
SPECIFIC_TYPE * Acore::Insert ( ContainerMapList< TypeList< H, T > > &  elements,
SPECIFIC_TYPE *  obj 
)
216 {
217 SPECIFIC_TYPE* t = Insert(elements._elements, obj);
218 return (t != nullptr ? t : Insert(elements._TailElements, obj));
219 }

References Insert().

◆ Insert() [7/12]

template<class SPECIFIC_TYPE >
SPECIFIC_TYPE * Acore::Insert ( ContainerMapList< TypeNull > &  ,
SPECIFIC_TYPE *   
)
202 {
203 return nullptr;
204 }

◆ Insert() [8/12]

template<class SPECIFIC_TYPE >
CountedPtr< SPECIFIC_TYPE > & Acore::Insert ( ContainerMapList< TypeNull > &  elements,
CountedPtr< SPECIFIC_TYPE > &  obj,
OBJECT_HANDLE  hdl 
)
119 {
120 return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);
121 }

◆ Insert() [9/12]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Acore::Insert ( ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *  obj 
)
38 {
39 auto i = elements._element.find(handle);
40 if (i == elements._element.end())
41 {
42 elements._element[handle] = obj;
43 return true;
44 }
45 else
46 {
47 ASSERT(i->second == obj, "Object with certain key already in but objects are different!");
48 return false;
49 }
50 }
#define ASSERT
Definition: Errors.h:68

References ContainerUnorderedMap< OBJECT, KEY_TYPE >::_element, and ASSERT.

Referenced by Insert(), TypeUnorderedMapContainer< OBJECT_TYPES, KEY_TYPE >::Insert(), TypeMapContainer< OBJECT_TYPES >::insert(), Acore::CreatureListSearcher< Check >::Visit(), Acore::GameObjectListSearcher< Check >::Visit(), Acore::WorldObjectListSearcher< Check >::Visit(), Acore::UnitListSearcher< Check >::Visit(), and Acore::PlayerListSearcher< Check >::Visit().

◆ Insert() [10/12]

template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Acore::Insert ( ContainerUnorderedMap< T, KEY_TYPE > &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
60 {
61 return false;
62 }

◆ Insert() [11/12]

template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Acore::Insert ( ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *  obj 
)
66 {
67 bool ret = Insert(elements._elements, handle, obj);
68 return ret ? ret : Insert(elements._TailElements, handle, obj);
69 }
ContainerUnorderedMap< T, KEY_TYPE > _TailElements
Definition: TypeContainer.h:72
ContainerUnorderedMap< H, KEY_TYPE > _elements
Definition: TypeContainer.h:71

References Insert().

◆ Insert() [12/12]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Acore::Insert ( ContainerUnorderedMap< TypeNull, KEY_TYPE > &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
54 {
55 return false;
56 }

◆ IsFormatEmptyOrNull() [1/2]

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

Returns true if the given char pointer is null.

58 {
59 return fmt == nullptr;
60 }

◆ IsFormatEmptyOrNull() [2/2]

bool Acore::IsFormatEmptyOrNull ( std::string_view  fmt)
inline

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

64 {
65 return fmt.empty();
66 }

◆ IsValidMapCoord() [1/4]

◆ IsValidMapCoord() [2/4]

bool Acore::IsValidMapCoord ( float  x,
float  y 
)
inline
222 {
223 return IsValidMapCoord(x) && IsValidMapCoord(y);
224 }
bool IsValidMapCoord(float c)
Definition: GridDefines.h:216

References IsValidMapCoord().

◆ IsValidMapCoord() [3/4]

bool Acore::IsValidMapCoord ( float  x,
float  y,
float  z 
)
inline
227 {
228 return IsValidMapCoord(x, y) && IsValidMapCoord(z);
229 }

References IsValidMapCoord().

◆ IsValidMapCoord() [4/4]

bool Acore::IsValidMapCoord ( float  x,
float  y,
float  z,
float  o 
)
inline
232 {
233 return IsValidMapCoord(x, y, z) && std::isfinite(o);
234 }

References IsValidMapCoord().

◆ MakeACLogSink()

template<typename T >
auto Acore::MakeACLogSink ( T &&  callback) -> ACLogSink<typename std::decay<T>::type>
65 {
66 return { std::forward<T>(callback) };
67 }

Referenced by CreateChildProcess().

◆ new_from_tuple()

template<class T , class Tuple >
T * Acore::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 Acore::NormalizeMapCoord ( float &  c)
inline

◆ Remove() [1/8]

template<class SPECIFIC_TYPE >
bool Acore::Remove ( ContainerMapList< SPECIFIC_TYPE > &  elements,
CountedPtr< SPECIFIC_TYPE > &  obj,
OBJECT_HANDLE  hdl 
)
138 {
139 typename std::map<OBJECT_HANDLE, CountedPtr<SPECIFIC_TYPE>>::iterator iter = elements._element.find(hdl);
140 if ( iter != elements._element.end() )
141 {
142 elements._element.erase(iter);
143 return true;
144 }
145
146 return false; // found... terminate the search
147 }

References ContainerMapList< OBJECT >::_element.

◆ Remove() [2/8]

template<class SPECIFIC_TYPE , class T >
bool Acore::Remove ( ContainerMapList< T > &  elements,
CountedPtr< SPECIFIC_TYPE > &  obj,
OBJECT_HANDLE  hdl 
)
156 {
157 return false;
158 }

◆ Remove() [3/8]

template<class SPECIFIC_TYPE , class T , class H >
bool Acore::Remove ( ContainerMapList< TypeList< H, T > > &  elements,
CountedPtr< SPECIFIC_TYPE > &  obj,
OBJECT_HANDLE  hdl 
)
161 {
162 // The head element is bad
163 bool t = Remove(elements._elements, obj, hdl);
164 return ( !t ? Remove(elements._TailElements, obj, hdl) : t );
165 }
bool Remove(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:107

References Remove().

◆ Remove() [4/8]

template<class SPECIFIC_TYPE >
bool Acore::Remove ( ContainerMapList< TypeNull > &  elements,
CountedPtr< SPECIFIC_TYPE > &  obj,
OBJECT_HANDLE  hdl 
)
150 {
151 return false;
152 }

◆ Remove() [5/8]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Acore::Remove ( ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *   
)
108 {
109 elements._element.erase(handle);
110 return true;
111 }

References ContainerUnorderedMap< OBJECT, KEY_TYPE >::_element.

Referenced by Remove(), and TypeUnorderedMapContainer< OBJECT_TYPES, KEY_TYPE >::Remove().

◆ Remove() [6/8]

template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Acore::Remove ( ContainerUnorderedMap< T, KEY_TYPE > &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
121 {
122 return false;
123 }

◆ Remove() [7/8]

template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Acore::Remove ( ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > &  elements,
KEY_TYPE const &  handle,
SPECIFIC_TYPE *   
)
127 {
128 bool ret = Remove(elements._elements, handle, (SPECIFIC_TYPE*)nullptr);
129 return ret ? ret : Remove(elements._TailElements, handle, (SPECIFIC_TYPE*)nullptr);
130 }

References Remove().

◆ Remove() [8/8]

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

◆ SearchExecutableInPath()

AC_COMMON_API std::string Acore::SearchExecutableInPath ( std::string const &  filename)

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

258 {
259 try
260 {
261 return search_path(filename).string();
262 }
263 catch (...)
264 {
265 return "";
266 }
267 }

Referenced by DBUpdaterUtil::CheckExecutable().

◆ Size() [1/4]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Acore::Size ( ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &  elements,
std::size_t *  size,
SPECIFIC_TYPE *   
)
135 {
136 *size = elements._element.size();
137 return true;
138 }

References ContainerUnorderedMap< OBJECT, KEY_TYPE >::_element.

Referenced by TypeUnorderedMapContainer< OBJECT_TYPES, KEY_TYPE >::Size(), and Size().

◆ Size() [2/4]

template<class SPECIFIC_TYPE , class KEY_TYPE , class T >
bool Acore::Size ( ContainerUnorderedMap< T, KEY_TYPE > const &  ,
std::size_t *  ,
SPECIFIC_TYPE *   
)
148 {
149 return false;
150 }

◆ Size() [3/4]

template<class SPECIFIC_TYPE , class KEY_TYPE , class H , class T >
bool Acore::Size ( ContainerUnorderedMap< TypeList< H, T >, KEY_TYPE > const &  elements,
std::size_t *  size,
SPECIFIC_TYPE *   
)
154 {
155 bool ret = Size(elements._elements, size, (SPECIFIC_TYPE*)nullptr);
156 return ret ? ret : Size(elements._TailElements, size, (SPECIFIC_TYPE*)nullptr);
157 }
bool Size(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &elements, std::size_t *size, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:134

References Size().

◆ Size() [4/4]

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

◆ StartAsyncProcess()

AC_COMMON_API std::shared_ptr< AsyncProcessResult > Acore::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.

249 {
250 auto handle = std::make_shared<AsyncProcessResultImplementation>(
251 std::move(executable), std::move(args), std::move(logger), std::move(input_file), secure);
252
253 handle->SetFuture(std::async(std::launch::async, [handle] { return handle->StartProcess(); }));
254 return handle;
255 }

◆ StartProcess()

AC_COMMON_API int Acore::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.

148 {
149 return CreateChildProcess([](child& c) -> int
150 {
151 try
152 {
153 c.wait();
154 return c.exit_code();
155 }
156 catch (...)
157 {
158 return EXIT_FAILURE;
159 }
160 }, executable, args, logger, input_file, secure);
161 }
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:70

References CreateChildProcess().

Referenced by DBUpdater< T >::ApplyFile().

◆ StringFormat()

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

Default AC string format function.

30 {
31 try
32 {
33 return fmt::sprintf(std::forward<Format>(fmt), std::forward<Args>(args)...);
34 }
35 catch (const fmt::format_error& formatError)
36 {
37 std::string error = "An error occurred formatting string \"" + std::string(fmt) + "\" : " + std::string(formatError.what());
38 return error;
39 }
40 }

Referenced by DBUpdater< T >::ApplyFile(), SecretMgr::AttemptTransition(), ByteBufferInvalidValueException::ByteBufferInvalidValueException(), ExtractMapsFromMpq(), Acore::Impl::ChatCommands::FormatAcoreString(), message_commandscript::HandleAnnounceCommand(), character_commandscript::HandleCharacterTitlesCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupTitleCommand(), server_commandscript::HandleServerDebugCommand(), titles_commandscript::HandleTitlesAddCommand(), titles_commandscript::HandleTitlesCurrentCommand(), titles_commandscript::HandleTitlesRemoveCommand(), PlayerDump::InitializeTables(), DBCDatabaseLoader::Load(), PlayerDumpReader::LoadDump(), MMAP::MMapMgr::loadMap(), MMAP::MMapMgr::loadMapData(), WardenCheckMgr::LoadWardenChecks(), ChatHandler::PGetParseString(), ChatHandler::PSendSysMessage(), WardenPayloadMgr::RegisterPayload(), ArenaSpectator::SendCommand(), BattlegroundQueue::SendJoinMessageArenaQueue(), Acore::Impl::ChatCommands::ArgInfo< Acore::ChatCommands::Variant< Ts... > >::TryAtIndex(), Acore::Impl::ChatCommands::ArgInfo< Acore::ChatCommands::Variant< Ts... > >::TryConsume(), and Appender::write().

◆ StringFormatFmt()

◆ StringTo()

template<typename Result , typename... Params>
Optional< Result > Acore::StringTo ( std::string_view  str,
Params &&...  params 
)
245 {
246 return Acore::Impl::StringConvertImpl::For<Result>::FromString(str, std::forward<Params>(params)...);
247 }
Definition: StringConvert.h:34

◆ Tokenize() [1/4]

std::vector< std::string_view > Acore::Tokenize ( char const *  str,
char  sep,
bool  keepEmpty 
)
inline
34{ return Tokenize(std::string_view(str ? str : ""), sep, keepEmpty); }
std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
Definition: Tokenize.cpp:20

References Tokenize().

◆ Tokenize() [2/4]

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

◆ Tokenize() [3/4]

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

◆ Tokenize() [4/4]

std::vector< std::string_view > Acore::Tokenize ( std::string_view  str,
char  sep,
bool  keepEmpty 
)
21{
22 std::vector<std::string_view> tokens;
23
24 size_t start = 0;
25 for (size_t end = str.find(sep); end != std::string_view::npos; end = str.find(sep, start))
26 {
27 if (keepEmpty || (start < end))
28 {
29 tokens.push_back(str.substr(start, end - start));
30 }
31
32 start = end + 1;
33 }
34
35 if (keepEmpty || (start < str.length()))
36 {
37 tokens.push_back(str.substr(start));
38 }
39
40 return tokens;
41}

Referenced by Player::_LoadCharacterSettings(), Object::_LoadIntoDataField(), Player::_LoadItem(), Player::BuildEnumData(), ConfigMgr::Configure(), Log::CreateAppenderFromConfig(), Log::CreateLoggerFromConfig(), Acore::Module::GetEnableModulesList(), WorldSession::HandleCharFactionOrRaceChangeCallback(), reload_commandscript::HandleReloadCreatureTemplateCommand(), send_commandscript::HandleSendItemsCommand(), misc_commandscript::HandleSkirmishCommand(), AppenderConsole::InitColors(), ChannelMgr::LoadChannelRights(), Acore::Impl::ChatCommands::ChatCommandNode::LoadCommandMap(), Acore::Impl::ChatCommands::ChatCommandNode::LoadCommandsIntoMap(), ObjectMgr::LoadCreatureAddons(), ObjectMgr::LoadCreatureCustomIDs(), ObjectMgr::LoadCreatureTemplateAddons(), DisableMgr::LoadDisables(), Metric::LoadFromConfigs(), Item::LoadFromDB(), CharmInfo::LoadPetActionBar(), PlayerTaxi::LoadTaxiDestinationsFromString(), PlayerTaxi::LoadTaxiMask(), MoneyStringToMoney(), MySQLConnectionInfo::MySQLConnectionInfo(), UpdateFetcher::ReceiveIncludedDirectories(), Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelpFor(), ChatHandler::SendGlobalGMSysMessage(), ChatHandler::SendGlobalSysMessage(), ChatHandler::SendSysMessage(), MotdMgr::SetMotd(), and Tokenize().

◆ ToString()

template<typename Type , typename... Params>
std::string Acore::ToString ( Type &&  val,
Params &&...  params 
)
251 {
252 return Acore::Impl::StringConvertImpl::For<std::decay_t<Type>>::ToString(std::forward<Type>(val), std::forward<Params>(params)...);
253 }

References ToString().

Referenced by ConfigMgr::GetValueDefault(), npc_commandscript::HandleNpcSetModelCommand(), and ToString().

◆ Warning()

void Acore::Warning ( std::string_view  file,
uint32  line,
std::string_view  function,
std::string_view  message 
)
134{
135 std::string formattedMessage = MakeMessage("WARNING", file, line, function, message);
136 fmt::print(stderr, "{}", formattedMessage);
137}

References anonymous_namespace{Errors.cpp}::MakeMessage().

Variable Documentation

◆ dependant_false_v

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

◆ has_type_v

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

◆ is_tuple_v

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