14#include "SharedPtrTypes.h"
16#include <AUI/Common/AObject.h>
17#include <AUI/Thread/AThread.h>
18#include <AUI/Reflect/AClass.h>
20template<
typename T,
typename... Args>
23 return static_cast<_<T>>(std::make_shared<T>(std::forward<Args>(
args)...));
26template<
typename T,
typename E>
27inline _<T> _new(std::initializer_list<E> il) {
29 if constexpr (std::is_base_of_v<AObject, T>) {
30 auto o =
new T(il.begin(), il.end());
31 return _<T>(o, [](T* obj)
33 static_cast<AObject*
>(obj)->getThread()->enqueue([obj]()
36 static_cast<AObject*
>(obj)->getThread()->enqueue([obj]()
44 return static_cast<_<T>>(std::make_shared<T>(il.begin(), il.end()));
50std::ostream& operator<<(std::ostream& os,
const _<T>& rhs)
noexcept {
56inline void PrintTo(
const _<T>& ptr, std::ostream* stream) {
61template<
typename SignalField,
typename Object,
typename Function>
62inline _<T>&
_<T>::connect(SignalField signalField, Object
object, Function&&
function) {
63 AObject::connect(super::get()->*signalField,
object, std::forward<Function>(
function));
68template<
typename SignalField,
typename Function>
70 AObject::connect(super::get()->*signalField, super::get(), std::forward<Function>(
function));
75#ifdef AUI_SHARED_PTR_FIND_INSTANCES
A base object class.
Definition: AObject.h:49
Stacktrace consisting of a collection of stack function frames.
Definition: AStacktrace.h:28
static AStacktrace capture(unsigned skipFrames=0, unsigned maxFrames=128) noexcept
Creates stacktrace of the current thread.
Definition: AStacktraceImpl.cpp:156
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
API_AUI_CORE const ACommandLineArgs & args() noexcept
Definition: OSAndroid.cpp:29