#pragma once #include "Backend.h" #include namespace xs { namespace unievent { struct DLoopSP : xs::nn { using LoopSP = panda::unievent::LoopSP; using Loop = panda::unievent::Loop; using Super = typename xs::nn; using Super::Super; LoopSP& operator-> () { if (!val) val = Loop::default_loop(); return val; } Loop& operator* () { return *operator->(); } operator LoopSP () { return operator->(); } operator Loop* () { return operator->(); } }; }} namespace xs { template struct Typemap : TypemapObject { static panda::string package () { return "UniEvent::Loop"; } }; template <> struct Typemap : TypemapBase { static xs::unievent::DLoopSP in (const Sv& arg) { auto val = xs::in(arg); return xs::unievent::DLoopSP(val ? val : panda::unievent::Loop::default_loop()); } }; }