initial commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#if MXL_MULTIVIEWER_ENABLE_MXL_SDK
|
||||
|
||||
#include <mxl/flow.h>
|
||||
#include <mxl/mxl.h>
|
||||
#include <mxl/rational.h>
|
||||
#include <mxl/time.h>
|
||||
|
||||
#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<MxlInstanceHandle> m_handles;
|
||||
#endif
|
||||
};
|
||||
Reference in New Issue
Block a user