AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
QueryCallback.cpp File Reference
#include "QueryCallback.h"
#include "Duration.h"
#include "Errors.h"

Go to the source code of this file.

Classes

struct  QueryCallback::QueryCallbackData
 

Functions

template<typename T , typename... Args>
void Construct (T &t, Args &&... args)
 
template<typename T >
void Destroy (T &t)
 
template<typename T >
void ConstructActiveMember (T *obj)
 
template<typename T >
void DestroyActiveMember (T *obj)
 
template<typename T >
void MoveFrom (T *to, T &&from)
 

Function Documentation

◆ Construct()

template<typename T , typename... Args>
void Construct ( T &  t,
Args &&...  args 
)
inline
24{
25 new (&t) T(std::forward<Args>(args)...);
26}

Referenced by QueryCallback::QueryCallback().

◆ ConstructActiveMember()

template<typename T >
void ConstructActiveMember ( T *  obj)
inline
36{
37 if (!obj->_isPrepared)
38 Construct(obj->_string);
39 else
40 Construct(obj->_prepared);
41}
void Construct(T &t, Args &&... args)
Definition: QueryCallback.cpp:23

Referenced by QueryCallback::operator=(), and QueryCallback::QueryCallback().

◆ Destroy()

template<typename T >
void Destroy ( T &  t)
inline
30{
31 t.~T();
32}

◆ DestroyActiveMember()

template<typename T >
void DestroyActiveMember ( T *  obj)
inline
45{
46 if (!obj->_isPrepared)
47 Destroy(obj->_string);
48 else
49 Destroy(obj->_prepared);
50}

Referenced by QueryCallback::operator=().

◆ MoveFrom()

template<typename T >
void MoveFrom ( T *  to,
T &&  from 
)
inline
54{
55 ASSERT(to->_isPrepared == from._isPrepared);
56
57 if (!to->_isPrepared)
58 to->_string = std::move(from._string);
59 else
60 to->_prepared = std::move(from._prepared);
61}
#define ASSERT
Definition: Errors.h:68

Referenced by QueryCallback::operator=(), and QueryCallback::QueryCallback().