C# Класс Wombat.MamaWrapper

Base class for all wrapped native objects. Provides common facilities to the base classes.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
nativeHandle System.IntPtr

Открытые методы

Метод Описание
Dispose ( ) : void

Destroys the underlying peer object and unbinds the wrapper from it.

setNativeHandle ( IntPtr nHandle ) : void

Sets the native handle of the native peer object. Should only be used by subclasses and in the same assembly.

Защищенные методы

Метод Описание
CheckResultCode ( int code ) : void

Helper method for the sub classes

CheckResultCodeIgnoreNotFound ( int code ) : MamaStatus.mamaStatus

Helper method for the sub classes which will not throw exception for not found

DestroyNativePeer ( ) : MamaStatus.mamaStatus

Subclasses must do whatever is necessary with the native handle in the overridden method in order to destroy the native peer object. If the destruction went successfully, the overridden method must return MamaStatus.mamaStatus.MAMA_STATUS_OK, or a suitable error code otherwise

Dispose ( bool disposing, bool destroyNativeHandle = true ) : void

The actual implementation of Dispose - called by both the Dispose method and the finalizer.

EnsurePeerCreated ( ) : void

Throws an exception if the native object has not been created.

MamaWrapper ( ) : System

Constructs a new wrapper object but doesn't create it. If the object is not explicitly disposed it will remain registered for finalization and will attempt the destroy the native peer object when finalized.

MamaWrapper ( IntPtr nativeHandle ) : System

Constructs a managed wrapper from an existing native peer. The peer object will not be automatically finalized

OnDispose ( ) : void

SelfManageLifeTime ( bool value ) : void

In some situations, wrappers are created elsewhere, but need to automatically destroy themselves, otherwise would be leaked; as a general rule, all .NET wrapper objects that were created from a native handle are not supposed to manage its own life time and will not be destroyed - this is an exception that needs to be handled (example - MamaMsg uses this method)

Описание методов

CheckResultCode() защищенный статический Метод

Helper method for the sub classes
protected static CheckResultCode ( int code ) : void
code int the MamaStatus.mamaStatus returned from the native call (as integer)
Результат void

CheckResultCodeIgnoreNotFound() защищенный статический Метод

Helper method for the sub classes which will not throw exception for not found
protected static CheckResultCodeIgnoreNotFound ( int code ) : MamaStatus.mamaStatus
code int the MamaStatus.mamaStatus returned from the native call (as integer)
Результат MamaStatus.mamaStatus

DestroyNativePeer() защищенный абстрактный Метод

Subclasses must do whatever is necessary with the native handle in the overridden method in order to destroy the native peer object. If the destruction went successfully, the overridden method must return MamaStatus.mamaStatus.MAMA_STATUS_OK, or a suitable error code otherwise
protected abstract DestroyNativePeer ( ) : MamaStatus.mamaStatus
Результат MamaStatus.mamaStatus

Dispose() публичный Метод

Destroys the underlying peer object and unbinds the wrapper from it.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

The actual implementation of Dispose - called by both the Dispose method and the finalizer.
protected Dispose ( bool disposing, bool destroyNativeHandle = true ) : void
disposing bool true if the object is being disposed (false if being finalized)
destroyNativeHandle bool
Результат void

EnsurePeerCreated() защищенный Метод

Throws an exception if the native object has not been created.
/// Thrown if the native object has not been created. ///
protected EnsurePeerCreated ( ) : void
Результат void

MamaWrapper() защищенный Метод

Constructs a new wrapper object but doesn't create it. If the object is not explicitly disposed it will remain registered for finalization and will attempt the destroy the native peer object when finalized.
protected MamaWrapper ( ) : System
Результат System

MamaWrapper() защищенный Метод

Constructs a managed wrapper from an existing native peer. The peer object will not be automatically finalized
protected MamaWrapper ( IntPtr nativeHandle ) : System
nativeHandle System.IntPtr The opaque native handle to the peer object
Результат System

OnDispose() защищенный Метод

protected OnDispose ( ) : void
Результат void

SelfManageLifeTime() защищенный Метод

In some situations, wrappers are created elsewhere, but need to automatically destroy themselves, otherwise would be leaked; as a general rule, all .NET wrapper objects that were created from a native handle are not supposed to manage its own life time and will not be destroyed - this is an exception that needs to be handled (example - MamaMsg uses this method)
protected SelfManageLifeTime ( bool value ) : void
value bool
Результат void

setNativeHandle() публичный Метод

Sets the native handle of the native peer object. Should only be used by subclasses and in the same assembly.
public setNativeHandle ( IntPtr nHandle ) : void
nHandle System.IntPtr
Результат void

Описание свойств

nativeHandle защищенное свойство

the handle to the native peer object
protected IntPtr,System nativeHandle
Результат System.IntPtr