#pragma once #include #include #include #if MXL_MULTIVIEWER_ENABLE_MXL_SDK #include #include #include #include #endif struct MxlInstanceHandle { #if MXL_MULTIVIEWER_ENABLE_MXL_SDK mxlInstance instance = nullptr; #endif std::string domain; int refCount = 0; }; class MxlInstanceCache { public: static MxlInstanceCache& instance(); MxlInstanceHandle* acquire( const std::string& domain, bool verbose = false); void release(MxlInstanceHandle* handle); MxlInstanceCache(const MxlInstanceCache&) = delete; MxlInstanceCache& operator=(const MxlInstanceCache&) = delete; private: MxlInstanceCache() = default; #if MXL_MULTIVIEWER_ENABLE_MXL_SDK std::vector m_handles; #endif };