GemStone::GemFire::Cache::Generic::Internal::UMWrapN< NTYPE > Class Template Reference


Detailed Description

template<typename NTYPE>
class GemStone::GemFire::Cache::Generic::Internal::UMWrapN< NTYPE >

Internal class to wrap native object pointers that do not derive from SharedBase; NTYPE is the native class.

This is a convenience template class to wrap native class objects that do not derive from SharedBase.

The constructors (and SetPtr method) of this class require a boolean parameter that informs whether or not to take ownership of the native object. Even if the ownership is taken, the native object is purposefully not destroyed as the class that impelements it has the protected or the private destructor.

All the managed wrapper classes that wrap corresponding native classes not deriving from SharedBase should derive from this class.

IMPORTANT: Direct assignment of m_nativeptr has been disabled, rather the classes deriving from this should use UMWrap.SetPtr that also requires a boolean parameter to indicate whether or not to take ownership of the native object.

This class is intentionally not thread-safe.

Public Member Functions

 !UMWrapN ()
 ~UMWrapN ()

Protected Member Functions

void InternalCleanup ()
void SetPtr (NTYPE *nativeptr, bool own)

Properties

bool Own [get, set]


Constructor & Destructor Documentation

template<typename NTYPE>
GemStone::GemFire::Cache::Generic::Internal::UMWrapN< NTYPE >::~UMWrapN (  )  [inline]

The dispose function.

template<typename NTYPE>
GemStone::GemFire::Cache::Generic::Internal::UMWrapN< NTYPE >::!UMWrapN (  )  [inline]

The finalizer, for the case dispose is not called.


Member Function Documentation

template<typename NTYPE>
void GemStone::GemFire::Cache::Generic::Internal::UMWrapN< NTYPE >::InternalCleanup (  )  [inline, protected]

Internal cleanup function invoked by dispose/finalizer.

template<typename NTYPE>
void GemStone::GemFire::Cache::Generic::Internal::UMWrapN< NTYPE >::SetPtr ( NTYPE *  nativeptr,
bool  own 
) [inline, protected]

Used to set the native pointer to a new object. This should only be used when you know that the underlying object is NULL or you do not own it.


Property Documentation

template<typename NTYPE>
bool GemStone::GemFire::Cache::Generic::Internal::UMWrapN< NTYPE >::Own [get, set, protected]

Get or set the ownership of this object.

Returns:
True if the native object is owned by this object.


GemFire C++ Cache .NET API Documentation