Castor3D 0.16.0
Multiplatform 3D engine
Classes | Namespaces | Macros | Typedefs | Functions
SmartPtr.hpp File Reference

Classes

struct  castor::Deleter< TypeT >
 

Namespaces

namespace  castor
 

Macros

#define CU_DeclareSmartPtr(nmspc, class_name, expdecl)
 
#define CU_ImplementSmartPtr(nmspc, class_name)
 
#define CU_DeclareTemplateSmartPtr(nmspc, class_name)
 
#define CU_DeclareEnumTemplateSmartPtr(nmspc, class_name, enum_name)
 

Typedefs

template<class DataT >
using castor::ReferenceWrapper = std::reference_wrapper< DataT >
 
template<class DataT >
using castor::SharedPtr = std::shared_ptr< DataT >
 
template<typename TypeT , class DelT = std::default_delete< TypeT >>
using castor::RawUniquePtr = std::unique_ptr< TypeT, DelT >
 
template<typename TypeT >
using castor::UniquePtr = RawUniquePtr< TypeT, Deleter< TypeT > >
 

Functions

template<typename TypeT , typename TypeU , typename ... ParamsT>
UniquePtr< TypeT > castor::makeUniqueDerived (ParamsT &&... params)
 
template<typename TypeT , typename ... ParamsT>
UniquePtr< TypeT > castor::makeUnique (ParamsT &&... params)
 
template<typename TypeU , typename TypeT >
UniquePtr< TypeU > castor::ptrCast (UniquePtr< TypeT > ptr)
 
template<typename TypeU , typename TypeT >
UniquePtr< TypeU > castor::ptrRefCast (UniquePtr< TypeT > &ptr)
 
template<typename TypeU , typename TypeT >
RawUniquePtr< TypeU > castor::ptrCast (RawUniquePtr< TypeT > ptr)
 
template<typename TypeU , typename TypeT >
RawUniquePtr< TypeU > castor::ptrRefCast (RawUniquePtr< TypeT > &ptr)
 

Macro Definition Documentation

◆ CU_DeclareEnumTemplateSmartPtr

#define CU_DeclareEnumTemplateSmartPtr ( nmspc,
class_name,
enum_name )
Value:
}\
namespace castor\
{\
template< enum_name EnumT >\
struct Deleter< nmspc::class_name##T< EnumT > >\
{\
void operator()( nmspc::class_name##T< EnumT > * pointer )noexcept\
{\
delete pointer;\
}\
};\
}\
namespace nmspc\
{\
template< enum_name EnumT >\
using class_name##UPtrT = castor::UniquePtr< class_name##T< EnumT > >;\
template< enum_name EnumT >\
using class_name##RPtrT = class_name##T< EnumT > *
Definition AnimatedObjectGroupCache.hpp:22
void operator()(TypeT *pointer) noexcept

◆ CU_DeclareSmartPtr

#define CU_DeclareSmartPtr ( nmspc,
class_name,
expdecl )
Value:
}\
namespace castor\
{\
template<>\
struct Deleter< nmspc::class_name >\
{\
expdecl void operator()( nmspc::class_name * pointer )noexcept;\
};\
}\
namespace nmspc\
{\
using class_name##UPtr = castor::UniquePtr< class_name >;\
using class_name##RPtr = class_name *

◆ CU_DeclareTemplateSmartPtr

#define CU_DeclareTemplateSmartPtr ( nmspc,
class_name )
Value:
}\
namespace castor\
{\
template< typename InstT >\
struct Deleter< nmspc::class_name##T< InstT > >\
{\
void operator()( nmspc::class_name##T< InstT > * pointer )noexcept\
{\
delete pointer;\
}\
};\
}\
namespace nmspc\
{\
template< typename InstT >\
using class_name##UPtrT = castor::UniquePtr< class_name##T< InstT > >;\
template< typename InstT >\
using class_name##RPtrT = class_name##T< InstT > *

◆ CU_ImplementSmartPtr

#define CU_ImplementSmartPtr ( nmspc,
class_name )
Value:
namespace castor\
{\
void Deleter< nmspc::class_name >::operator()( nmspc::class_name * pointer )noexcept\
{\
delete pointer;\
}\
}