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<typename... Args>
using FormatString = fmt::format_string< Args... >
 
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 >
std::size_t Count (const ContainerMapList< SPECIFIC_TYPE > &elements, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE >
std::size_t Count (const ContainerMapList< TypeNull > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
std::size_t Count (const ContainerMapList< T > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
std::size_t Count (const ContainerMapList< TypeList< SPECIFIC_TYPE, T > > &elements, SPECIFIC_TYPE *fake)
 
template<class SPECIFIC_TYPE , class H , class T >
std::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... Args>
std::string StringFormat (FormatString< Args... > fmt, Args &&... args)
 Default AC string format function. More...
 
bool IsFormatEmptyOrNull (char const *fmt)
 Returns true if the given char pointer is null. More...
 
bool IsFormatEmptyOrNull (std::string_view fmt)
 Returns true if the given std::string is empty. More...
 
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

◆ FormatString

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

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, StringFormat(fmt, std::forward<Args>(args)...));
47 }
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default AC string format function.
Definition: StringFormat.h:34
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 StringFormat().

◆ 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 = StringFormat("Caught signal {}\n", sigval);
152 fmt::print(stderr, "{}", formattedMessage);
153 fflush(stderr);
154 Crash(formattedMessage.c_str());
155}

References Crash, and StringFormat().

Referenced by main().

◆ AddressOrSelf() [1/2]

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

◆ AddressOrSelf() [2/2]

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

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, StringFormat(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 StringFormat().

◆ 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
175 {
176 // calculate and store temporary values in double format for having same result as same mySQL calculations
177 double x_offset = (double(x) - center_offset) / size;
178 double y_offset = (double(y) - center_offset) / size;
179
180 int x_val = int(x_offset + CENTER_VAL + 0.5f);
181 int y_val = int(y_offset + CENTER_VAL + 0.5f);
182 return RET_TYPE(x_val, y_val);
183 }

◆ ComputeCellCoord() [1/2]

◆ ComputeCellCoord() [2/2]

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

References CENTER_GRID_CELL_ID, CENTER_GRID_CELL_OFFSET, and SIZE_OF_GRID_CELL.

◆ ComputeGridCoord()

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

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 >
std::size_t Acore::Count ( const ContainerMapList< SPECIFIC_TYPE > &  elements,
SPECIFIC_TYPE *   
)
160 {
161 return elements._element.getSize();
162 }
GridRefMgr< OBJECT > _element
Definition: TypeContainer.h:39

References ContainerMapList< OBJECT >::_element.

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

◆ Count() [2/5]

template<class SPECIFIC_TYPE , class T >
std::size_t Acore::Count ( const ContainerMapList< T > &  ,
SPECIFIC_TYPE *   
)
172 {
173 return 0;
174 }

◆ Count() [3/5]

template<class SPECIFIC_TYPE , class H , class T >
std::size_t Acore::Count ( const ContainerMapList< TypeList< H, T > > &  elements,
SPECIFIC_TYPE *  fake 
)
184 {
185 return Count(elements._TailElements, fake);
186 }
std::size_t Count(const ContainerMapList< SPECIFIC_TYPE > &elements, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:159
ContainerMapList< T > _TailElements
Definition: TypeContainer.h:51

References Count().

◆ Count() [4/5]

template<class SPECIFIC_TYPE , class T >
std::size_t Acore::Count ( const ContainerMapList< TypeList< SPECIFIC_TYPE, T > > &  elements,
SPECIFIC_TYPE *  fake 
)
178 {
179 return Count(elements._elements, fake);
180 }

References Count().

◆ Count() [5/5]

template<class SPECIFIC_TYPE >
std::size_t Acore::Count ( const ContainerMapList< TypeNull > &  ,
SPECIFIC_TYPE *   
)
166 {
167 return 0;
168 }

◆ 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
68 {
69#if AC_COMPILER == AC_COMPILER_MICROSOFT
70#pragma warning(push)
71#pragma warning(disable:4297)
72/*
73 Silence warning with boost 1.83
74 boost/process/pipe.hpp(132,5): warning C4297: 'boost::process::basic_pipebuf<char,std::char_traits<char>>::~basic_pipebuf': function assumed not to throw an exception but does
75 boost/process/pipe.hpp(132,5): message : destructor or deallocator has a (possibly implicit) non-throwing exception specification
76 boost/process/pipe.hpp(124,6): message : while compiling class template member function 'boost::process::basic_pipebuf<char,std::char_traits<char>>::~basic_pipebuf(void)'
77 boost/process/pipe.hpp(304,42): message : see reference to class template instantiation 'boost::process::basic_pipebuf<char,std::char_traits<char>>' being compiled
78*/
79#endif
80 ipstream outStream;
81 ipstream errStream;
82#if AC_COMPILER == AC_COMPILER_MICROSOFT
83#pragma warning(pop)
84#endif
85
86 if (!secure)
87 {
88 LOG_TRACE(logger, "Starting process \"{}\" with arguments: \"{}\".",
89 executable, boost::algorithm::join(argsVector, " "));
90 }
91
92 // prepare file with only read permission (boost process opens with read_write)
93 std::shared_ptr<FILE> inputFile(!input.empty() ? fopen(input.c_str(), "rb") : nullptr, [](FILE* ptr)
94 {
95 if (ptr != nullptr)
96 fclose(ptr);
97 });
98
99 // Start the child process
100 child c = [&]()
101 {
102 if (inputFile)
103 {
104 // With binding stdin
105 return child{
106 exe = std::filesystem::absolute(executable).string(),
107 args = argsVector,
108 env = environment(boost::this_process::environment()),
109 std_in = inputFile.get(),
110 std_out = outStream,
111 std_err = errStream
112 };
113 }
114 else
115 {
116 // Without binding stdin
117 return child{
118 exe = std::filesystem::absolute(executable).string(),
119 args = argsVector,
120 env = environment(boost::this_process::environment()),
121 std_in = boost::process::close,
122 std_out = outStream,
123 std_err = errStream
124 };
125 }
126 }();
127
128 auto outInfo = MakeACLogSink([&](std::string const& msg)
129 {
130 LOG_INFO(logger, "{}", msg);
131 });
132
133 auto outError = MakeACLogSink([&](std::string const& msg)
134 {
135 LOG_ERROR(logger, "{}", msg);
136 });
137
138 copy(outStream, outInfo);
139 copy(errStream, outError);
140
141 // Call the waiter in the current scope to prevent
142 // the streams from closing too early on leaving the scope.
143 int const result = waiter(c);
144
145 if (!secure)
146 {
147 LOG_TRACE(logger, ">> Process \"{}\" finished with return value {}.",
148 executable, result);
149 }
150
151 return result;
152 }
#define LOG_INFO(filterType__,...)
Definition: Log.h:165
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
#define LOG_TRACE(filterType__,...)
Definition: Log.h:173
auto MakeACLogSink(T &&callback) -> ACLogSink< typename std::decay< T >::type >
Definition: StartProcess.cpp:57

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, StringFormat(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 StringFormat().

◆ 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:70
ContainerMapList< H > _elements
Definition: TypeContainer.h:50

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 *   
)
71 {
72 auto i = elements._element.find(handle);
73 if (i == elements._element.end())
74 {
75 return nullptr;
76 }
77 else
78 {
79 return i->second;
80 }
81 }
std::unordered_map< KEY_TYPE, OBJECT * > _element
Definition: TypeContainer.h:57

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 *   
)
91 {
92 return nullptr;
93 }

◆ 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 *   
)
97 {
98 SPECIFIC_TYPE* ret = Find(elements._elements, handle, (SPECIFIC_TYPE*)nullptr);
99 return ret ? ret : Find(elements._TailElements, handle, (SPECIFIC_TYPE*)nullptr);
100 }

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 *   
)
85 {
86 return nullptr;
87 }

◆ 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 
)
191 {
192 //elements._element[hdl] = obj;
193 obj->AddToGrid(elements._element);
194 return obj;
195 }

References ContainerMapList< OBJECT >::_element.

◆ Insert() [3/12]

template<class SPECIFIC_TYPE , class T >
SPECIFIC_TYPE * Acore::Insert ( ContainerMapList< T > &  ,
SPECIFIC_TYPE *   
)
206 {
207 return nullptr; // a missed
208 }

◆ 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:34

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 
)
213 {
214 SPECIFIC_TYPE* t = Insert(elements._elements, obj);
215 return (t != nullptr ? t : Insert(elements._TailElements, obj));
216 }

References Insert().

◆ Insert() [7/12]

template<class SPECIFIC_TYPE >
SPECIFIC_TYPE * Acore::Insert ( ContainerMapList< TypeNull > &  ,
SPECIFIC_TYPE *   
)
199 {
200 return nullptr;
201 }

◆ 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 
)
35 {
36 auto i = elements._element.find(handle);
37 if (i == elements._element.end())
38 {
39 elements._element[handle] = obj;
40 return true;
41 }
42 else
43 {
44 ASSERT(i->second == obj, "Object with certain key already in but objects are different!");
45 return false;
46 }
47 }
#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 *   
)
57 {
58 return false;
59 }

◆ 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 
)
63 {
64 bool ret = Insert(elements._elements, handle, obj);
65 return ret ? ret : Insert(elements._TailElements, handle, obj);
66 }
ContainerUnorderedMap< T, KEY_TYPE > _TailElements
Definition: TypeContainer.h:69
ContainerUnorderedMap< H, KEY_TYPE > _elements
Definition: TypeContainer.h:68

References Insert().

◆ Insert() [12/12]

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

◆ IsFormatEmptyOrNull() [1/2]

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

Returns true if the given char pointer is null.

48 {
49 return fmt == nullptr;
50 }

◆ IsFormatEmptyOrNull() [2/2]

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

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

54 {
55 return fmt.empty();
56 }

◆ IsValidMapCoord() [1/4]

◆ IsValidMapCoord() [2/4]

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

References IsValidMapCoord().

◆ IsValidMapCoord() [3/4]

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

References IsValidMapCoord().

◆ IsValidMapCoord() [4/4]

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

References IsValidMapCoord().

◆ MakeACLogSink()

template<typename T >
auto Acore::MakeACLogSink ( T &&  callback) -> ACLogSink<typename std::decay<T>::type>
59 {
60 return { std::forward<T>(callback) };
61 }

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:104

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 *   
)
105 {
106 elements._element.erase(handle);
107 return true;
108 }

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 *   
)
118 {
119 return false;
120 }

◆ 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 *   
)
124 {
125 bool ret = Remove(elements._elements, handle, (SPECIFIC_TYPE*)nullptr);
126 return ret ? ret : Remove(elements._TailElements, handle, (SPECIFIC_TYPE*)nullptr);
127 }

References Remove().

◆ Remove() [8/8]

template<class SPECIFIC_TYPE , class KEY_TYPE >
bool Acore::Remove ( ContainerUnorderedMap< TypeNull, KEY_TYPE > &  ,
KEY_TYPE const &  ,
SPECIFIC_TYPE *   
)
112 {
113 return false;
114 }

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

266 {
267 try
268 {
269 return search_path(filename).string();
270 }
271 catch (...)
272 {
273 return "";
274 }
275 }

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 *   
)
132 {
133 *size = elements._element.size();
134 return true;
135 }

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 *   
)
145 {
146 return false;
147 }

◆ 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 *   
)
151 {
152 bool ret = Size(elements._elements, size, (SPECIFIC_TYPE*)nullptr);
153 return ret ? ret : Size(elements._TailElements, size, (SPECIFIC_TYPE*)nullptr);
154 }
bool Size(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &elements, std::size_t *size, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:131

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 *   
)
139 {
140 return false;
141 }

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

257 {
258 auto handle = std::make_shared<AsyncProcessResultImplementation>(
259 std::move(executable), std::move(args), std::move(logger), std::move(input_file), secure);
260
261 handle->SetFuture(std::async(std::launch::async, [handle] { return handle->StartProcess(); }));
262 return handle;
263 }

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

156 {
157 return CreateChildProcess([](child& c) -> int
158 {
159 try
160 {
161 c.wait();
162 return c.exit_code();
163 }
164 catch (...)
165 {
166 return EXIT_FAILURE;
167 }
168 }, executable, args, logger, input_file, secure);
169 }
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:64

References CreateChildProcess().

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

◆ StringFormat()

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

Default AC string format function.

35 {
36 try
37 {
38 return fmt::format(fmt, std::forward<Args>(args)...);
39 }
40 catch (std::exception const& e)
41 {
42 return fmt::format("Wrong format occurred ({}). Fmt string: '{}'", e.what(), fmt.get());
43 }
44 }

Referenced by Abort(), AbortHandler(), TransactionBase::Append(), AppenderFile::AppenderFile(), DBUpdater< T >::ApplyFile(), Warden::ApplyPenalty(), Assert(), SecretMgr::AttemptTransition(), ByteBufferInvalidValueException::ByteBufferInvalidValueException(), DatabaseWorkerPool< T >::DirectExecute(), DatabaseWorkerPool< T >::Execute(), ExtractMapsFromMpq(), Fatal(), Acore::Impl::ChatCommands::FormatAcoreString(), Acore::Impl::ChatCommands::ChatCommandNode::GetAutoCompletionsFor(), message_commandscript::HandleAnnounceCommand(), character_commandscript::HandleCharacterTitlesCommand(), debug_commandscript::HandleDebugGetItemStateCommand(), lookup_commandscript::HandleLookupSkillCommand(), lookup_commandscript::HandleLookupTitleCommand(), spell_the_flag_of_ownership::HandleScript(), send_commandscript::HandleSendItemsCommand(), server_commandscript::HandleServerDebugCommand(), titles_commandscript::HandleTitlesAddCommand(), titles_commandscript::HandleTitlesCurrentCommand(), titles_commandscript::HandleTitlesRemoveCommand(), AppenderConsole::InitColors(), PlayerDump::InitializeTables(), DBCDatabaseLoader::Load(), PlayerDumpReader::LoadDump(), MMAP::MMapMgr::loadMap(), MMAP::MMapMgr::loadMapData(), WardenCheckMgr::LoadWardenChecks(), LogCommandUsage(), Log::outCommand(), Log::outMessage(), anonymous_namespace{Config.cpp}::ParseFile(), ChatHandler::PGetParseModuleString(), ChatHandler::PGetParseString(), anonymous_namespace{Config.cpp}::PrintError(), ChatHandler::PSendSysMessage(), DatabaseWorkerPool< T >::Query(), WardenPayloadMgr::RegisterPayload(), ArenaSpectator::SendCommand(), ChatHandler::SendGMText(), BattlegroundQueue::SendJoinMessageArenaQueue(), ChatHandler::SendNotification(), ChatHandler::SendWorldText(), ChatHandler::SendWorldTextOptional(), Acore::Banner::Show(), ArenaScore::ToString(), PreparedStatementData::ToString(), Acore::Impl::ChatCommands::ArgInfo< Acore::ChatCommands::Variant< Ts... > >::TryAtIndex(), Acore::Impl::ChatCommands::ArgInfo< Acore::ChatCommands::Variant< Ts... > >::TryConsume(), Acore::Impl::ChatCommands::MultiConsumer< Tuple, Optional< NestedNextType >, offset >::TryConsumeTo(), DBUpdater< T >::Update(), and Appender::write().

◆ 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
33{ 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 std::size_t start = 0;
25 for (std::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::SendGMText(), ChatHandler::SendNotification(), ChatHandler::SendSysMessage(), ChatHandler::SendWorldText(), ChatHandler::SendWorldTextOptional(), 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