<commit_before>/*
 * copyright: (c) RDO-Team, 2010
 * filename : rdosmart_ptr_wrapper.h
 * author   :  
 * date     : 26.02.2010
 * bref     : 
 * indent   : 4T
 */

#ifndef _RDOSMART_PTR_WRAPPER_H_
#define _RDOSMART_PTR_WRAPPER_H_

// ====================================================================== INCLUDES
// ====================================================================== SYNOPSIS
#include "rdo_common/namespace.h"
#include "rdo_common/rdomacros.h"
#include "rdo_common/rdotypes.h"
#include "rdo_common/rdosmart_ptr.h"
// ===============================================================================

OPEN_RDO_NAMESPACE

class ISmartPtrWrapper
{
public:
	virtual void      destroy    () = 0;
	virtual PTR(void) getSmartPtr() = 0;
};
typedef PTR(ISmartPtrWrapper) LPISmartPtrWrapper;

#define DECLARE_ISmartPtrWrapper     \
public:                              \
	virtual void      destroy    (); \
	virtual PTR(void) getSmartPtr();

template<class T>
class smart_ptr_wrapper: public ISmartPtrWrapper
{
public:
	smart_ptr_wrapper(CREF(smart_ptr<T>) smart_ptr)
		: m_smart_ptr(smart_ptr)
	{}
	~smart_ptr_wrapper()
	{}
	void destroy()
	{
		delete this;
	}
	PTR(void) getSmartPtr()
	{
		return &m_smart_ptr;
	}

private:
	smart_ptr<T> m_smart_ptr;
};

CLOSE_RDO_NAMESPACE

#endif //! _RDOSMART_PTR_WRAPPER_H_<commit_msg> - smart_ptr_wrapper переведен на intrusive_ptr<commit_after>/*
 * copyright: (c) RDO-Team, 2010
 * filename : rdosmart_ptr_wrapper.h
 * author   :  
 * date     : 26.02.2010
 * bref     : 
 * indent   : 4T
 */

#ifndef _RDOSMART_PTR_WRAPPER_H_
#define _RDOSMART_PTR_WRAPPER_H_

// ====================================================================== INCLUDES
// ====================================================================== SYNOPSIS
#include "rdo_common/namespace.h"
#include "rdo_common/rdomacros.h"
#include "rdo_common/rdotypes.h"
#include "rdo_common/smart_ptr/intrusive_ptr.h"
// ===============================================================================

OPEN_RDO_NAMESPACE

class ISmartPtrWrapper
{
public:
	virtual void      destroy    () = 0;
	virtual PTR(void) getSmartPtr() = 0;
};
typedef PTR(ISmartPtrWrapper) LPISmartPtrWrapper;

#define DECLARE_ISmartPtrWrapper     \
public:                              \
	virtual void      destroy    (); \
	virtual PTR(void) getSmartPtr();

template<class T>
class smart_ptr_wrapper: public ISmartPtrWrapper
{
public:
	smart_ptr_wrapper(CREF(intrusive_ptr<T>) intrusive_ptr)
		: m_intrusive_ptr(intrusive_ptr)
	{}
	~smart_ptr_wrapper()
	{}
	void destroy()
	{
		delete this;
	}
	PTR(void) getSmartPtr()
	{
		return &m_intrusive_ptr;
	}

private:
	intrusive_ptr<T> m_intrusive_ptr;
};

CLOSE_RDO_NAMESPACE

#endif //! _RDOSMART_PTR_WRAPPER_H_
{'fraction_non_alphanumeric': 0.253551912568306, 'fraction_numerical': 0.01092896174863388, 'mean_word_length': 4.6735537190082646, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5936976', 'n_tokens_mistral': 1006, 'n_tokens_neox': 943, 'n_words': 155}