C# Class OpenCvSharp.DisposableObject

Represents a class which manages its own memory.
Inheritance: IDisposable
显示文件 Open project: shimat/opencvsharp

Protected Properties

Property Type Description
dataHandle System.Runtime.InteropServices.GCHandle

Public Methods

Method Description
Dispose ( ) : void

Releases the resources

ThrowIfDisposed ( ) : void

If this object is disposed, then ObjectDisposedException is thrown.

Protected Methods

Method Description
AllocGCHandle ( object obj ) : GCHandle

Pins the object to be allocated by cvSetData.

AllocMemory ( int size ) : IntPtr

Allocates the specified size of memory.

DisposableObject ( ) : System

Default constructor

DisposableObject ( bool isEnabledDispose ) : System

Constructor

Dispose ( bool disposing ) : void

Releases the resources

NotifyMemoryPressure ( long size ) : void

Notifies the allocated size of memory.

Method Details

AllocGCHandle() protected method

Pins the object to be allocated by cvSetData.
protected AllocGCHandle ( object obj ) : GCHandle
obj object
return System.Runtime.InteropServices.GCHandle

AllocMemory() protected method

Allocates the specified size of memory.
protected AllocMemory ( int size ) : IntPtr
size int
return System.IntPtr

DisposableObject() protected method

Default constructor
protected DisposableObject ( ) : System
return System

DisposableObject() protected method

Constructor
protected DisposableObject ( bool isEnabledDispose ) : System
isEnabledDispose bool true if you permit disposing this class by GC
return System

Dispose() public method

Releases the resources
public Dispose ( ) : void
return void

Dispose() protected method

Releases the resources
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. ///
return void

NotifyMemoryPressure() protected method

Notifies the allocated size of memory.
protected NotifyMemoryPressure ( long size ) : void
size long
return void

ThrowIfDisposed() public method

If this object is disposed, then ObjectDisposedException is thrown.
public ThrowIfDisposed ( ) : void
return void

Property Details

dataHandle protected_oe property

Gets or sets a handle which allocates using cvSetData.
protected GCHandle,System.Runtime.InteropServices dataHandle
return System.Runtime.InteropServices.GCHandle