blob: ed1f53909a60c2efee4f1ba109bfba7d9d3454cd [file] [log] [blame]
#pragma once
#include "begin_native.hpp"
#include <memory>
#include "end_native.hpp"
namespace Apache
{
namespace Geode
{
namespace Client
{
template <class _T>
public ref class native_shared_ptr sealed {
private:
std::shared_ptr<_T>* ptr;
public:
native_shared_ptr(const std::shared_ptr<_T>& ptr) : ptr(new std::shared_ptr<_T>(ptr)) {}
~native_shared_ptr() {
native_shared_ptr::!native_shared_ptr();
}
!native_shared_ptr() {
delete ptr;
}
inline _T* get() {
return ptr->get();
}
inline std::shared_ptr<_T> get_shared_ptr() {
return *ptr;
}
};
}
}
}