C# 클래스 Wombat.MamaWrapper

Base class for all wrapped native objects. Provides common facilities to the base classes.
상속: IDisposable
파일 보기 프로젝트 열기: OpenMAMA/OpenMAMA 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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